Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@desplmfao Thanks for isolating the reservation queries with the stage split. The locked per-pass result is close to the no-cache preparation result despite far fewer lookups. The cross-frame measurement leaves mapping validity and the watchdog unresolved, so I’ll leave the draft separate. The narrower case to investigate is existing knowledge that an address is in a mapped view. It can rule out private-reservation batching without carrying a cached committed-byte count across frames. I’ll check whether the current guarded-view metadata gives a sufficiently specific proof and keep the existing per-shadow refresh as the fallback. |
…every time A refresh pass sees each reservation about once, so a cache that lasts one pass saves almost nothing. Views are only mapped and unmapped through title_memory_remapped, which drops the entries it overlaps, so they can be kept across passes. Private memory can change through paths that report nothing here (the title's heap, for one), so it is asked about every time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@desplmfao A focused review of That can affect the empty-reservation decision, and it is separate from the Proton watchdog observation. The next check is a negative-only mapped-view hint before cross-shadow grouping, with ordinary per-shadow refresh and live commit queries retained. I added the profile and draft status to Marvisak#185. |
|
@desplmfao I prototyped your observed-mapped-view suggestion as a negative hint on exact Marvisak#185 head The hint uses known 64 KiB view starts to skip the private cross-shadow grouping probe. Each hinted span still goes through the ordinary per-shadow refresh. A same-VA remap from a mapped view to private memory cleared the hint. Injecting the old snapshot still refreshed the new private bytes. With two learned mapped bases and one private reservation, real Reproduce with |
|
Thanks for checking The difference from your hint as I read I'll run your switch in a matched pair when the machine is free and report hinted mapped starts, reservation query count and time, direct SRV preparation and frame time over the same warm scene. I'll need to add a diagnostics counter for the hinted starts, since AI-assisted (Claude Code). |
|
Matched pair for
The hint takes about 70 % of the ranges and halves the reservation queries, but the time in them doesn't fall: the hinted ranges are looked up again in I'm pausing in-game runs until more of the open PRs have landed upstream, then I'll take a fresh baseline. AI-assisted (Claude Code). |
|
Probable root cause, found by someone else: ajsem1337 on Marvisak#340 profiled It may also be why each AI-assisted (Claude Code). |
|
Measured with the
With the patched server a lookup costs about 0.1–0.4 µs instead of 5–25 µs, so this cache saves about 20 ms per world frame of directly measured lookup time. The frame-time difference between the two runs is dominated by where the runs were: the cache-off run spent most of its time in light scenes. Grouped by draws per frame, the two runs disagree in direction (1,000–1,800 draws: 389 ms on vs 767 ms off; 1,800–2,600: 750 ms on vs 467 ms off), so I can't attribute frame time to the cache from these runs. Under Wine with the server fix, the gain I can stand behind is about 20 ms per frame. Without the server fix it was 2.3 s → 0.9 s of lookups (description). The AI-assisted (Claude Code). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@desplmfao Thanks for measuring both server configurations. I recorded the stock-server lookup comparison separately from the patched-server 46 to 26 ms result. The different draw counts leave the patched frame times inconclusive. On native Windows, the synthetic matched fixture at |
Status: ready for review. The head (
dbf9f2d) caches only views; private memory is asked about every time, so the committed=0 window found in7e86c17doesn't apply. In game it ran in seven sessions on NVIDIA/Proton (up to 7.5 minutes in the world, into the first prologue mission) with no crash attributable to it. TheXid 109hang seen in some of those runs also occurs without this change. With thewineserverview-tree patch from Marvisak#340 the saving drops to about 20 ms of lookups per world frame (comments below); with a stock server it was 2.3 s → 0.9 s.Stacked on #2's merge (
a6367ba). Earlier context: matched on/off run on #2 and #2's description, section "Where the frame time goes".Problem
After #2, direct SRV preparation is still about 2 s of a world frame under Proton, with sharing on or off (2,052 vs 2,391 ms in the on/off run, while write-watch went from 684 to 23 ms). With your
VICTORY_PROFILE_SHARED_PREPsplit (docs/direct-srv-preparation-profile.md), most of it isreservation_groups_ms. A counter around the realQueryVirtualMemoryInformationcalls (plus theVirtualQueryfallback from #1) puts that inwatch::allocation: about 530k calls and 2.3 s per world frame. A mapping change anywhere bumpsMAPPING_REVISION, so an earlier answer is rarely still live for its next use.Change (
dbf9f2d)watch::allocationkeeps the views it has looked up, across refreshes. Views of title physical memory are only mapped and unmapped throughtitle_memory_remapped;record_mapping_changenow removes the entries its range overlaps, and an entry no change touched is returned as live at the current revision.VirtualAlloc/VirtualFreeare hooked, andXMemAllocDefaultuses the host heap. A stale extent or commit size there would group the wrong pages, or haveis_empty_private→zero_reservedoverwrite title data.view_lookups_are_cached_until_a_mapping_change: a view is asked about once; it is asked again after a remap over it but not after one elsewhere, and is still live after that; private memory is asked about every time.How I got here (the earlier commits): a cache for one refresh pass (
c21391c,7e86c17) saves almost nothing, because each reservation comes up about once per pass. A cache of everything across passes cut the lookups to about 150, but Marvisak#185'sgrouped_watch_keeps_mixed_private_reservations_separatethen fails after other tests: its fixture frees a reservation and allocates two at the same address without a report, and the stale extent groups across both. That is the unreported-change case, and it is why private memory is no longer cached. The one game run with that version also ended in the title's watchdog crash.Measured
RTX 5080, proton-cachyos, Series X 1.0.2.1. One diagnostics binary of Marvisak#185 + #2 + your profiling branch (
c53f8e6) + Marvisak#493 (+Marvisak#336), Marvisak#259, Marvisak#177, Marvisak#151, withVICTORY_PROFILE_SHARED_PREP=1, lookup counters, and a temporaryVICTORY_NO_PASS_CACHEswitch (the counters and switch are not in this PR). Medians of the first 17 world summary lines; one run each, some cut short, so these are rough.dbf9f2d)reservation_groups_msfallback_msThe no-cache run's frame time is high next to earlier runs of this stack (2.7–2.9 s unprofiled), so the frame-time gain is more like 20 % than 65 %. Lookups drop by 93 %; the 35k left are private memory, at about 25 µs each.
fallback_msrose from about 0.5 to 1.2 s, and I don't know why yet; it may be time moving out of grouping, since direct SRV preparation fell overall.Tests
On vkd3d-proton with
VICTORY_PC_DXCset:watch::8,shadow::18 and coherency 12 pass. The fullvictory-gpusuite is 84 of 87; the same three (argument_clamp_builds,a_rejected_blob_gives_an_empty_library,buffer_data_reaches_the_host_texture) fail ona6367bawithout this change. Mergingreview/cross-shadow-batchingconflicts only on theALLOCATION_QUERIEStest counter; with that resolved, an earlier head passedshadow::22.AI-assisted (Claude Code).
🤖 Generated with Claude Code