CPU wall: plan to cut memory-bridging and API-emulation cost #2415
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA#2415
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@dyshay on GitHub · 2026-11-29 12:51 UTC · original
What you would like
A tracking issue for the CPU wall: the frame is bound by our CPU-side emulation of the console's unified memory and its API, not by PCIe bandwidth or the GPU. Below are the measurements, then the work items, each to be done targeted, measured, and with near-zero steady-state cost.
Measurements (RTX 4090 24 GB, i9-13900KF, 32 GB RAM, Series X/S profiles, DLSS Quality)
OpenExistingHeapFromAddress) works on an RTX 4090 and stays coherent with CPU writes, at ~10–13 GB/s for a single pass.Work items
How to measure each item
VICTORY_ABwhere possible.Are you working on a fix?
I'd like to, with some pointers
@github-actions[bot] on GitHub · 2026-11-29 12:51 UTC · original
Please attach both logs from the run that went wrong. Without them we can only guess. Paste
%LOCALAPPDATA%into the address bar of File Explorer to get there.%LOCALAPPDATA%\victory\logs\: the newestvictory-nvidia-play-<date>-<time>-<number>.log(fromvictory.exe) orvictory-nvidia-<date>-<time>.log(from the script launcher). The window shows its path at the start, on the lineLog: ....%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newestvictory-<date>-<time>-<number>.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\.Also say which GPU, Windows version (10 or 11)
@dyshay on GitHub · 2026-11-29 12:54 UTC · original
/claim
Starting with a per-class measurement (who writes each range, bytes compared vs bytes changed vs bytes sent per frame, on the same static scene), then items 2 (event-driven dirty tracking) and 1 (writer classification), each behind one switch with an A/B run. I'll post numbers here before opening PRs.
@Texbirds on GitHub · 2026-11-29 12:55 UTC · original
Great breakdown and measurements — this lines up almost 1:1 with what we've been tracking upstream in
Marvisak/VIctory#3703(andneonbyte1/VIctory#127/Slaktarn700/SlaktarnVI#15). Since you asked for pointers, a few concrete things already built or measured that should save you time:MEM_WRITE_WATCHdirty tracking): Already implemented and tested on Windows inMarvisak/VIctory#3615(3de7653, CI green). It keeps cold pages onPAGE_READONLYguards (zero-syscallclean_bit) and promotes hotMEM_WRITE_WATCHpool pages (HOT_THRESHOLD = 3) to batchedGetWriteWatch(WRITE_WATCH_FLAG_RESET)(up to 64 contiguous pages / 4 MiB per syscall). Measured 22.4x faster CPU writes under 8-thread contention on Windows (3080 Ti) and independently verified at 5.14x faster (296 -> 57.6 us). All three review edge cases (clipped quiet takes, openWritingguards, concurrentTracked::arm) are already fixed with regression tests — feel free to port/cherry-pick it directly.SlaktarnVI#15confirmed the CPU only reads ~0.3% of what gets copied back, but blanket block-level VRAM placement caused missing menu glyphs, flicker, and unloaded assets (and TDRs on Windows). Rolling this out narrowly per resource class (e.g. shadow-mask / GPU-only scratch buffers first) or backing it with a lazy read-fault trap avoids that cliff.VIctory-RDNA#4A/B-tested removing submit-side waits before removing eager copy-back and saw zero walk-window gain and ~2x worse entry hitches — pipelining only pays off once eager copy-back is cut first.Happy to compare notes or help port
#3615over toVIctory-NVIDIA'swatch.rsif you want to A/B it first.@dyshay on GitHub · 2026-11-29 12:57 UTC · original
Thanks, this is very useful. Plan, in that order:
I'll post the per-class numbers here first.
@dyshay on GitHub · 2026-11-29 13:13 UTC · original
Phase 1 update (measurement first, no PR yet).
What the "~7 GB checked" figure actually is. The bytes in the copies line ("N MB checked, U MB unchanged") are mostly answered clean from the write-watch journal. Since
VICTORY_ASK_ONCE, a submission asks the kernel once and every refresh is answered from that answer, lock-free for copies nobody wrote. No byte is compared on that path. The work scales with the number of refreshes (9k–52k a frame on the house shot), not with bytes. Bytes really written are small: about 2,400 written 4 KiB pages a frame, roughly 10 MB.Numbers on the house shot (RTX 4090, older base; the current base's run is pending):
Census added (
VICTORY_WALL_CENSUS=1, diagnostics builds, off). It splits that work by the title's own protection class (write-combined / CPU-less / GPU read-only / coherent / cached / other / not told), with parts of a reservation asked for again kept apart. It also splits by writer per 64 KiB page: CPU only, GPU only, both, nobody lately (writes older than ~15 s age out). For each split it counts:A run on the house save (Series X 1440p, and Series S with RT) is queued. I'll post its table here.
On the pointers (thanks):
GetWriteWatchrefuses. So its gain is already how this base works, and there is nothing to port.@ZorionTen on GitHub · 2026-11-29 15:27 UTC · original
Measured data from the field (RTX 3060 12 GB, Ryzen 7 9700X, 32 GB, v2026.11.29.01, Series S profile 1080p internal, DLSS performance, FSR 3 FG):
Stable-state gameplay frame breakdown from the play log (
victory_gpu::host: N fps, N ms/frame (...)):~60% of the frame is
preparing(the submitting thread), GPU needs 12–21 ms. Task Manager shows the CPU ~40% busy overall — the cost sits in the layer's own threads, not the title's. During streaming-heavy moments (copies 20–35 ms, 60–90 MBper frame with the GPU at 0–13 ms) frames stretch to 290–340 ms — consistent with the memory-bridging cost this issue plans to cut. Full logs available; happy to test patches against this machine.@dyshay on GitHub · 2026-11-29 15:32 UTC · original
Thanks, this is a useful second machine: same shape as ours, with the submitting thread setting the frame and the card idle half the time.
A few things would make your logs directly comparable with the census I'm running:
copieslines during the 290–340 ms frames. If you can, paste 20–30 consecutive frame lines around one of those stretches, plus thewrite watch/guardlines the play log prints next to them. I want to know whether those frames are refresh-count bound (many small copies) or byte bound (60–90 MB of real changes from streaming). The fix differs.victory.exe). On a 32 GB machine the commit charge may be close to the limit; on ours, Series X with RT reaches ~62–64 GB.Once the census lands in a release (
VICTORY_WALL_CENSUS=1, diagnostics build), a 2-minute run with it on the same scene would tell us which memory class those copies come from. I'll ping here when it's available.On our side, the first measurement of the new base found something related. On Series X with ray tracing, the commit charge reached the page-file limit. The compile guard then put off pipeline compiles, including two full-screen passes, and the screen-pass wait did not notice the deferral, so every frame took 10 s. A fix is being tested (the wait ends when a compile is deferred, and the guard counts how much the page file can still grow). I'll open it as a PR once a run confirms it.
@meonline42 on GitHub · 2026-11-29 16:57 UTC · original
A CPU-bound data point for this plan, including a slowdown from
e1f2eb6to829188e(v2026.11.29.01) on this machine.Setup: Ryzen 9 5900X (12 cores, Zen 3, thermally limited ~3.7 GHz), RTX 3090 24 GB, 64 GB DDR4-3200, Windows 11. Series X, 1080p to 1440p, DLSS Performance, frame generation off. Unattended runs from the same outdoor save, standing still, 150 s measured; averages of the 5 s
victory_gpu::hostlines over the last ~150 s. Sameplay-foxhound.ps1for both exes. For829188eI ran it once with the older launcher's switches and once with the switches its ownplay-foxhound.ps1changed (HELPER_PRIORITY=1,PASSES_HOT=1,POOL_SMALL=1,LEVELS_ON_DEMAND=auto,TEXSPK_PASS_MS=8,PIPELINE_WORKERSandRELAYunset). One warm-up run after the new build was discarded.e1f2eb6, 2 runs829188e, older switches, 2 runs829188e, its own switches, 2 runsDraw counts are comparable (6,000-8,400 a frame in all runs). What moved:
preparing per frameline: 3,250 of 8,644 flushes against 7,176 of 7,792 one1f2eb6. The lists' steps went from 30.2 to 36.4 ms.I haven't bisected it (1,280 commits in between). If someone has candidates for the landing or the refresh-threading change, I can A/B them here.
On item 1 / item 7 (which memory the copies come from): on this machine the refreshes' bytes are almost all guarded (section-view) memory. Counters in
Shadow::update_free/copy_staleone1f2eb6:by_partsOnly 21-29% of the 4 KiB parts of those guarded blocks actually differ from the copy (sampled compare before the copy), and ~70% of the guarded bytes are of carded copies. Copying only the differing parts cut the bytes sent up by ~9 MB a frame but didn't change the submitting thread's time, because reading the title's bytes to compare costs about what copying them does. So for this class the win has to come from not reading them at all: finer guards, or knowing the writer. Details are in #756.
Happy to run any of the work items' switches on this machine, on the same scene and with the same method.
Measured and posted by Claude Code on behalf of the machine's owner; every number is from this PC's logs.
@dyshay on GitHub · 2026-11-29 17:01 UTC · original
Thanks, this is exactly the kind of data the plan needs, and the method (same save, standing still, warm-up discarded) makes it comparable.
Copying back went up on our side too. On
829188e(RTX 4090, i9, Series X/S) the frame lines show 9–20 ms of copying back, and the census runs should say which class it lands in. Your 6.5 → 16.5 ms step is the clearest regression report so far.Bisect candidates. I went through the non-merge commits between
e1f2eb6and829188ethat touch landing, shadows or refresh threading. These are the ones that look able to move copying back or the refresh split:6de00a4d,f604c6ff,b84622f9adapt it)CardCpu::Sharedstaging27d312d3(lock-free refresh checks, single-lock scoped pool)3634e25f, pageable CPU mirrors for per-submission card uploads5b66a1d0, title buffer copies of 1 MiB and up kept in card memory on 16 GB cardsIf any of them has a switch, an A/B with
VICTORY_HOT_AB/VICTORY_ABin one run on your scene would be quickest. Otherwise a build at the parent of each merge. I'll do the same here on the house scene and post what I find, so we can split the list.On the guarded section-view memory. That matches what the plan expected: compare-before-copy doesn't help, because reading the title's bytes costs about what copying them does, as you measured. For that class the work has to disappear, not get cheaper:
The census will give the split by protection class and writer. I'll post its table here, and I'd welcome the same census from your 5900X once it is in a build.
@shiman1901 on GitHub · 2026-11-29 17:24 UTC · original
@dyshay @meonline42 Awesome tracking plan — wanted to flag one concrete Win11 kernel finding from
#756that directly challenges the "section views cannot be write-watched" assumption behind the583 guard faults/22–25 msguard-lock waits /44–60 MBguarded copies!1. Single-mapped
XMempages CAN use hardwareMEM_WRITE_WATCH(empirical Win11 26300 probe)xmem.rs:194-232has a comment assuming placeholders can't be write-watched, so everything goes throughMapViewOfFile3+VirtualProtectguards. We just tested this directly against the Win11 26300 kernel (xmem_ww_probe.exeon Ryzen 7 5700X):VirtualAlloc2(NULL, placeholder, 64 KiB, MEM_RESERVE | MEM_COMMIT | MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH, PAGE_READWRITE, NULL, 0)succeeds (err = 0) in 2.3 µs andGetWriteWatchreturns exact 4 KiB granularity (gran = 4096).GetWriteWatchcalls (vs 0.053 ms contiguous).@meonline42's 430 × 64 KiB guarded blocks (25% dirty =6.88 MiBof27.5 MiB), replacingVirtualProtect+ 430 VEH faults + 64 KiB copy withMEM_WRITE_WATCH+ 4 KiB copy dropped the frame cost3.825 ms -> 1.461 ms(2.6x) even before eliminating the22–25 msmulti-threadGUARDSlock contention.MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH, and only promote-out (~22 µs) toMapViewOfFile3if a second VA aliases the same(section, index)inxmem.rs::Shown(xmem.rs:992) or on unmap while keeping backing data (full caveats/hazards are detailed in#756).2. Tiny request for
VICTORY_WALL_CENSUS=1Since you're already building
VICTORY_WALL_CENSUS=1, could you include a 1-field split on the guarded faults / guarded copied bytes usingxmem.rs::Shown:alias_count == 1(and never unmapped/remapped in play) vsalias_count > 1That single line from your house run (and
@meonline42's 5900X run) will immediately tell us whether Promote-on-Alias can wipe out ~85–95% of the583 faults / 22–25 ms guard lock / 44–60 MB guarded amplificationin one shot, or if those hot blocks are genuinely multi-aliased.(Also happy to statically audit your 5 bisect candidates
#1756 / #1823 / 27d312d / 3634e25 / 5b66a1dfor the6.5 -> 16.5 mscopy-back &7,176 -> 3,250refresh-threading regression right now to save you build cycles if helpful!)@shiman1901 on GitHub · 2026-11-29 17:35 UTC · original
@dyshay @meonline42 Audited all 5 bisect candidates statically against
829188e— good news: 4 of the 5 can be ruled out immediately on 24 GB cards under the old/default switches without building a single commit:#1823&3634e25(pageableCardCpu::Privatemirrors): gated byasked_for!("VICTORY_CARD_CPU_HEAP")(shadow.rs:139-141,switch.rs:51-59— requires explicit=1). Inactive unless your log prints"CPU mirrors in pageable process memory".#1756+6de00a4/f604c6f/b84622f(late card windows):card_late()readsVICTORY_CARD_WINDOWS_LATE(shadow.rs:883-892,None => 0). Off by default.5b66a1d(1 MiB card buffer threshold): only applies to>12 GiB && <20 GiB("16 GB cards") — no effect on RTX 3090 / 4090 24 GB.That leaves
27d312d(#1094rebased) as the only candidate among the five that is active on829188ewith the old launcher switches:refreshes on several threads(7,176 -> 3,250):host.rs:11750printsFLUSHES[3](:11609), incremented byself.refreshes.len()inBatch::flush(:12725).27d312dadded earlycheck_noop(nothing_new_with) filtering before the wide pass, so the drop in count itself is early no-op filtering rather than lost parallelism.+6.2 msinlists' steps:27d312dchangedlet ahead = self.refreshes.len() > 1->let ahead = !kept && self.refreshes.len() > 1, disabling the batchedahead_snapshot(GetWriteWatch) whenkeptis set (forcing per-refresh watch queries) alongsidegrain = 1vswide_chunk().829188eto test27d312d& landing directly before bisecting:VICTORY_LIGHT_REFRESH=0(watch.rs:1392) — turns off the light-refresh pathVICTORY_WIDE_MERGE=0(host.rs:8125) — tests whether the scoped pool / wide landing merge is behind thecopying back(6.5 -> 16.5 ms) andrelay landing(17 -> 37 ms) jumpVICTORY_WIDE_CHUNK=1(or=8) andVICTORY_WIDE_REFRESH=0(host.rs:11877)If
VICTORY_LIGHT_REFRESH=0+VICTORY_WIDE_MERGE=0don't movecopying backback down from16.5 ms(and"CPU mirrors in pageable process memory"isn't in the log), then thecopying backregression is outside those 5 commits — saving you four wasted builds right away!@dyshay on GitHub · 2026-11-29 18:08 UTC · original
@shiman1901 thanks, both are very useful.
Write watch on single-mapped pages. That contradicts the assumption the guards are built on, so it's worth measuring before anything else. I'm adding the split you asked for to the census, for guarded memory only:
alias_count == 1(and never unmapped or remapped during play)alias_count > 1(or remapped)Each side counts guard faults, guard-wait time and guarded bytes copied. The census run on the house scene follows the current A/B runs, and I'll post that line here. If most of the guarded work sits on single-mapped pages, Promote-on-Alias goes to the top of the list. I'd like to see how a promote-out behaves when a refresh races with it, but that question comes after the numbers.
The static audit of the five candidates. I'm checking each claim against our tree (switch readers and their defaults), then running the existing switches as one run each on the same scene, against a same-exe baseline:
VICTORY_LIGHT_REFRESH=0VICTORY_WIDE_MERGE=0If neither moves copying back, the regression is outside those commits, as you say. Results here.
@burber on GitHub · 2026-11-29 18:18 UTC · original
A negative result for the ordering in this plan (and Marvisak/VIctory#3703's Track 1 before Track 2): two frames in flight without per-flight copies breaks the picture, even when it looks faster.
Setup: i5-13600K, RTX 4070 Ti 12 GB, 32 GB, Windows 11. Series X, 1440p, DLSS Quality, frame generation off, ray tracing off. Same save each run, standing still in the house for 3-5 minutes.
What was tried. The title's frame fence was patched in memory so that two frames can be outstanding. Its per-frame pool 1 was also given three 12 MB buffers instead of two 18 MB ones; without that, the ring allocator hands out unmapped memory and the title crashes (INT3). We also tried two optional changes on top of that:
What it measured: 25.5-26 fps against 21.0-21.4 in the heavy rooms of the house, about +21%, on a tree based on
959dcaf. That looked like a win.What it actually draws. In motion, edges show white speckle, characters and floors a dark dithered smear, and in some frames faces are black and there is a haze over the view. This shows:
55d06914, including one run with every memory switch that is new since959dcafand on by default set to 0:GPU_RO_SKIP,MEMORY_OWNED,UPLOAD_GUARD,PLACED_*,SHARED_ZEROS,UAV_POOL,READBACK_POOLand the others.Narrowed shader writes alone, with one frame in flight, looked right. Our first check of two frames in flight used the diagnostics build's captures, at frames 2-80 after the first world frame, and those looked clean. The damage only shows later in play, so the +21% was never a real gain.
Likely cause: there is one card copy of title memory. With two frames in flight, the title's writes for frame N+1 reach that copy while the card is still drawing frame N. So overlapping frames needs per-flight copies first, or the copy-back removed as Track 1 proposes. That matches VIctory-RDNA#4 seeing no gain from overlapping submissions before copy-back was cut.
Two suggestions for anyone measuring this kind of change:
Happy to run A/B tests of the PRs here on this machine, with the same save and mid-run screenshots for each, if a 13600K/4070 Ti data point helps.
Investigated and written with an AI assistant (Claude Code); the runs were on my PC.
@shiman1901 on GitHub · 2026-11-29 18:24 UTC · original
@dyshay @meonline42 Two quick follow-ups before you start bisect builds — we checked the full
e1f2eb6..829188ecommit window (~40 merges) onland.rs / shadow.rs / host.rsand traced thepromote-outrace path inwatch.rs:1. Caveat on
27d312d(#1094rebased): itsland.rs/card_dirtyhalf has NO env switche1f2eb6(04:21Z) and829188e(11:13Z),27d312dis the only default-on commit on 24 GB cards that touches landing/copy-back (the other landing commits —024385c7 VICTORY_LAND_LEAVE,f2becc90 VICTORY_LAND_READS,a115e71c VICTORY_WAIT_SPIN,#1756,#1823/3634e25,5b66a1d— are all off by default or 16 GB-only).VICTORY_LIGHT_REFRESH=0only disables the refresh-side fast path of27d312d— the 59-lineland.rs("single-lock scoped pool") andzero-clone card_dirty(shadow.rs) changes in27d312dare ungated (andVICTORY_WIDE_MERGE=0disables wide merge altogether rather than restoring the pre-27d312dpool).VICTORY_LIGHT_REFRESH=0doesn't bringcopying back(16.5 ms) andrelay landing(27–37 ms) back down, testing a singlegit revert 27d312dfirst should immediately confirm or rule out the entire commit before bisecting the tree.2. How
promote-outbehaves whenrefresh(or a title thread) races with itChecking
watch.rs:3549-4004andxmem.rs:1084, the synchronization primitives for a ~20 µspromote-outwindow (VirtualFree->MEM_RESERVE_PLACEHOLDER->MapViewOfFile3) are already built:xmem.rs:1084(remapping_and_views) ->watch::title_memory_remapping_of(&ranges)(watch.rs:3606): already acquiresMAPPING.write()+RANGES.write(&ranges), bumpsCHANGES, and setsCHANGING.refresh(copy_stale->safecopy::try_copy): holdingReading(the read side ofMAPPING, range-scoped whenVICTORY_RANGE_LOCK=1) aroundcopy_stalemakespromote-outwait until any in-flight refresh of that range finishes (and even without it,safecopy::try_copycatches SEH cleanly without crashing).came_back(at, false)(watch.rs:3549), which spins inagain_after_change()untiltitle_memory_remapping_ofdrops, incrementsMET(:3609), and returnsEXCEPTION_CONTINUE_EXECUTIONso the CPU retries the read instruction transparently against the newMapViewOfFile3view.came_back(at, true)(watch.rs:3549, checkingopen(..) || writable(at)afteragain_after_change()) is already written, just not called in the VEH write-fault branch (watch.rs:3974-4004)! Adding:if ours.is_none() && came_back(at, true) { return EXCEPTION_CONTINUE_EXECUTION; }closes the title-write race using the exact same mechanism with zero new locks or structures.
@dyshay on GitHub · 2026-11-29 18:26 UTC · original
I checked the static audit against the code. Our tree is
829188eplus a few fixes, and none of them touches these readers.VICTORY_LIGHT_REFRESH=0turns the light refresh offwatch.rs:1402, on by default.VICTORY_WIDE_MERGE=0tests the wide mergehost.rs:3637: off unless=1, ate1f2eb6and at829188ealike, so=0is the default.VICTORY_WIDE_CHUNK=1/8wide_chunk()(shadow.rs:2813) has had no caller since27d312d.VICTORY_WIDE_REFRESH=0host.rs:11877-11891, on by default from 4 logical CPUs.3634e25behindVICTORY_CARD_CPU_HEAPshadow.rs:140,=1only.shadow.rs:883-892.5b66a1donly on 16 GB cardsshadow.rs:323-327).27d312dahead = !kept && …host.rs:12700, and 12511). It only skips anask_aheadthe submission's single asking already covers, though. It does not become one asking per refresh.light()andwide_merge()read their variables once and cache them, so they can't be flipped live withVICTORY_ABorVICTORY_HOT_AB. I queued two plain runs on the same exe instead: a baseline andVICTORY_LIGHT_REFRESH=0. @meonline42,VICTORY_WIDE_REFRESH=0would be the other one worth a run on your 5900X.On the write-watch comment:
xmem.rs:228-232says placeholders can't be watched, and that holds, because the views mapped into them are section views. The probe replaces the placeholder with private memory (MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH). That's Promote-on-Alias, so it doesn't contradict the comment.The census now splits guarded work into three cases:
Each case counts 64 KiB pages, guard faults, wait ms and MB copied. Releases during loading count as remaps, so the single-mapped share is a lower bound. Numbers will follow after the run.
@meonline42 on GitHub · 2026-11-29 18:31 UTC · original
@shiman1901 @dyshay Ran the zero-rebuild switches on
829188e(its own launcher defaults, frame generation off, same scene and method as above, two rounds alternating; 5 s lines over the last ~150 s):VICTORY_LIGHT_REFRESH=0VICTORY_WIDE_MERGE=0VICTORY_WIDE_REFRESH=0(
e1f2eb6on the same scene: copying back 6.3-6.6 ms, landing 17.2 ms.) None of them brings copying back down.LIGHT_REFRESH=0andWIDE_REFRESH=0make the submitting thread much slower, and "CPU mirrors in pageable process memory" never appears in these logs. So, as you said, the copy-back step is outside those candidates.I'm now running
git bisect --first-parent e1f2eb6..829188e(29 first-parent commits) on this machine, one 240 s run per step, judging the median "copying back" (under 10 ms good). I'll post the merge it lands on, then go into that merge's branch if it's a combine.Measured and posted by Claude Code on behalf of the machine's owner.
@burber on GitHub · 2026-11-29 19:22 UTC · original
A/B results on a 12 GB card, for the copy-back question and two of the open guard PRs.
Setup. i5-13600K, RTX 4070 Ti 12 GB, 32 GB RAM, Windows 11 26300.
victory_gpu::hostlines, after the first 60 s in the world.829188eplus #2392; without #2392, the memory guard stalls the world on this PC.Same heavy room (about 7,000 draws a frame):
27d312d'sland.rshalf reverted (single-lock scoped pool back to before)VICTORY_NARROW_WRITES=1(an out-of-tree change of ours)At 5,000-6,500 draws a frame:
VICTORY_GUARD_PARTS=4VICTORY_LIGHT_REFRESH=0What this says, on this machine:
27d312dis not a net regression here. Reverting its landing half (the part with no switch) lowers copying back by about 2.4 ms. But it costs about 7 ms of preparing, so the frame is about 10% slower. The higher copying-back figure on829188elooks like time moved from one counter to another, at least on a 12 GB card standing still. That doesn't rule out meonline42's tail regression in an outdoor scene.Logs for every run are available if useful.
Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@burber on GitHub · 2026-11-29 20:44 UTC · original
@shiman1901 @dyshay I'll take Promote-on-Alias, unless someone has already started on it. Say so and I'll back off or help instead.
Plan:
VICTORY_PROMOTE_ON_ALIAS=1, off by default, on829188e+ #2392.MEM_WRITE_WATCH, tracked by the existing write-watch path instead of guards. Any second mapping, unmap, or access through the section promotes them back to a section view first.I'll post the branch and numbers here, including if it doesn't help.
Measured and written with an AI assistant (Claude Code); the runs are on my PC.
@shiman1901 on GitHub · 2026-11-29 20:47 UTC · original
@burber All yours — we haven't started coding a branch for it, and having it built and A/B-tested directly on your Win11 26300 + 4070 Ti setup (with mid-run screenshot checks) is the best possible path!
Four quick implementation details from our
xmem.rs/watch.rstrace so they don't bite you on the first pass:watch.rs(TRACKEDvsis_view):MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCHmakesmbi.Type == MEM_PRIVATE(so it drops off theMEM_MAPPEDguard path), butwatch.rsonly harvestsGetWriteWatchbits for regions registered in its write-watch tracking (TRACKED/Tracked). Make sure promoted-inXMemregions are registered withwatch.rson map (and unregistered on unmap/promote-out) socopy_staleactually sees their 4 KiB dirty bits after frame 1.XMemMapPhysicalPageswhere possible:GetWriteWatchrefuses queries that crossAllocationBaseboundaries (the 390 cross-reservation refusals @dyshay noted above), coalescing a contiguous run of fresh single-mapped 64 KiB pages into a singleVirtualAlloc2(..., run_bytes, MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH)allocation (rather than oneVirtualAlloc2per 64 KiB page) gives the whole run oneAllocationBase.promote-out(MEM_WRITE_WATCH -> MapViewOfFile3):VirtualFreedestroys the privateMEM_WRITE_WATCHallocation duringpromote-out, harvest itsGetWriteWatchdirty bits (or mark the page dirty inwatch.rs) after copying the 64 KiB bytes into the backing section — otherwise any title writes made between the last submission and thepromote-outwould lose their kernel dirty bit when the private region is freed.promote-outinremapping_and_views/title_memory_remapping_of+ 3-line VEH write retry:VirtualFree -> MEM_RESERVE_PLACEHOLDER -> MapViewOfFile3insidewatch::title_memory_remapping_of(&[(va, len)])plus addingif ours.is_none() && came_back(at, true) { return EXCEPTION_CONTINUE_EXECUTION; }in the VEH write-fault branch (watch.rs:3974-4004) protects against both concurrentrefreshand concurrent title CPU reads/writes during the ~20 µs unmapped window.Excited to see @dyshay's 3-bucket census split and your live A/B numbers!
@dyshay on GitHub · 2026-11-29 20:47 UTC · original
@burber thanks for taking Promote-on-Alias, and for the matched-draws A/B. That method is the right one for this scene.
Our side:
VICTORY_LIGHT_REFRESH=0result (-22 %) matches what we expected. Our same-exe run of it is queued too, as a cross-check on a 24 GB card.VICTORY_LOOKUP_SPAN=0), all on the CPU side. If a branch you test carries it, keep that in mind.I won't start on Promote-on-Alias, so we don't duplicate work. If the census shows a large single-mapped share, I'll A/B your branch here as well, on the 4090.
@meonline42 on GitHub · 2026-11-29 21:16 UTC · original
Bisect update for the slowdown on the 5900X + RTX 3090. The first-parent bisect of
e1f2eb6..829188ecouldn't work, because the combine's intermediate commits don't compile until the fix-ups. So I tested each wave branch tip on its own. All six are based on568c5e5d,e1f2eb6's parent.Same scene and method as before:
829188e's launcher defaults, frame generation off, 240 s measured. Medians of the 5 s lines with more than 3,000 draws over the last ~190 s; fps and p95 are from the window title, once a second.e1f2eb6(earlier, two runs)f53e1b8738f23bc64111a0edb6212c336de00a4d86a1681aWave 4 alone brings most of it: the frame median goes 58 → 78 ms, and the tail is far worse. Waves 3 and 5 show more frames over 100 ms with a normal median, so smaller hitches may come from there. One run each, so treat those two as weaker signals.
Wave 4 includes #1442 (
27d312d3) as its fourth merge. Next I'm testingfb0a48b6(just before #1442),42161359(just after) andbb443567(the first build-fix checkpoint), then narrowing further between the checkpoints that compile.Measured and posted by Claude Code on behalf of the machine's owner.
@burber on GitHub · 2026-11-29 21:35 UTC · original
Promote-on-Alias, first version: it works, but it gives no fps on this machine. The census explains why.
Census first (
VICTORY_ALIAS_CENSUS=1, house scene,829188e+ #2392, 4070 Ti). Each guard fault's address is put in a ring and sorted every 5 s by the mapping it lands in:So about 60% of guard faults land on pages that are mapped once, fresh, and never aliased.
The prototype (
VICTORY_PROMOTE_ON_ALIAS=1, off by default, about 550 lines inxmem.rsandwatch.rs):XMemMapPhysicalPagesmaps at one address getVirtualAlloc2(MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH)instead of a section view.writes()asks the kernel for the private runs and guards the rest of a mixed range.map_pages,alias_as,change/scatter), on unmap, and on the title's ownVirtualFreethere.write_physicalwrites them at their address.With it on, the "one address, mapped fresh" row goes to 0: those ~37,000 faults per 5 s are gone, and nothing crashed in five 300 s runs.
What actually stays private:
A/B, same exe, alternating off/on/off/on, 300 s each:
No measurable gain, and preparing may be a little higher with it on. My reading:
Next steps, if anyone wants to take this further:
VICTORY_ALIAS_CENSUS=1.I haven't checked the picture mid-run with it on (that needs a diagnostics build), so treat it as unverified, though nothing looked wrong in the logs. Branch: https://github.com/burber/victory-fork/tree/promote-on-alias (one commit,
79305c5, on829188e+ #2392), if anyone wants to repeat this on a different CPU.Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@dyshay on GitHub · 2026-11-29 21:39 UTC · original
@burber that's a clean negative result, and it saves everyone the work. It also fits our profile: the faults removed sit on the title's threads, and the frame is set by the submitting thread (copies, refreshes, landing). So item 1 has to aim at what that thread does per copy, not at guard faults as such. Our census run (same three buckets, plus refreshes, bytes compared or sent, and write-watch askings per protection class) is queued behind a ray-tracing diagnosis. I'll post it here as soon as it has run.
@meonline42 wave 4 is a strong lead, and it matches burber's split: #1442 (
27d312d) moves time between counters on a 12 GB card standing still, but your outdoor tail is a different shape. If the narrowing lands on #1442, one cheap check isVICTORY_LIGHT_REFRESH=0on your machine. Burber measured -22 % with it off, so that would separate the light path from the landing changes in the same merge. Our run of it on the 4090 is queued too.@shiman1901 on GitHub · 2026-11-29 21:44 UTC · original
@burber @dyshay WAIT — don't write Promote-on-Alias off as a negative result just yet!
First, huge props for getting
79305c5running cleanly in 5×300 s runs with 0 crashes, ~37,000 faults/5 s -> 0, 0 in-play promotes, and clean 1-alloc-per-view (6contiguousMEM_WRITE_WATCHviews for the185 MB32-bit graphics heap) + exact 4 KiBparts!We just audited
burber/victory-fork@79305c5to understand whypreparingwent up (32.8 -> 35.1 ms) instead of down — and found a massive accidental regression inside79305c5'swatch.rshook that explains the entire+2.3 ms(and masked the real savings!):Why
preparingrose32.8 -> 35.1 msin79305c5VICTORY_LIGHT_REFRESH(nothing_new_with) is disabled on the entire 185 MB graphics heap:writes(),publish()is only called for guarded branches (if light() && !by_guard.is_empty() { publish(&by_guard); }andelse if guards_asked && light() { publish(...); }).continueearly and never callpublish(), sonothing_new_withcan never answer clean for those 185 MB — remember you just measuredVICTORY_LIGHT_REFRESHitself as worth ~17 ms / 22% FPS on this exact scene!VICTORY_ASK_ONCE/ask_aheadis bypassed — rawGetWriteWatchruns on EVERYwrites()call:private_pieces(first, last)callskernel_written(a, b)?(a rawGetWriteWatchsyscall) + locksPRIVATE_NEW.lock()directly inside everywrites()call rather than querying the 6 private views once per submission viaask_aheadand reading the snapshot inwrites().private_pieces()takesPRIVATE.read()on everywrites()call (even when there are no private ranges in play, or on every refresh).5-second sanity check on your existing
486vs487logsBefore even touching code, check the
copiesMB/frame andwrite watch: N askings, M mslines in your existing486(off) vs487(on) logs:79305c5did keep 4 KiBparts,copiesMB/frame probably dropped significantly, whilewrite watchaskings & ms probably exploded from callingkernel_writtenper refresh withoutask_ahead/publish()!Tiny fix to test the real win of Promote-on-Alias
publish(&pages)for private pieces just like guarded pieces soVICTORY_LIGHT_REFRESHstays active on the 185 MB heap.ask_ahead(1 batchedGetWriteWatchper submission across 6 contiguous views instead of thousands per frame) and read from the ahead snapshot inwrites().private_pieces()with an atomic count/flag and clearPRIVATE_NEWonce on first touch instead of locking a mutex per refresh.If
79305c5almost broke even (32.8 -> 35.1 ms) while bypassing bothVICTORY_ASK_ONCEandVICTORY_LIGHT_REFRESHon the hottest 185 MB heap, wiring those 6 views intoask_ahead+publish()could swingpreparingsharply into the green!@burber on GitHub · 2026-11-29 21:47 UTC · original
@shiman1901 thanks for reading the branch. I checked your sanity check against the release logs of the same A/B (median "preparing per frame, the submitting thread" lines, after the first 60 s):
So it costs the submitting thread about 3 ms with it on, as you guessed. The causes look different from yours, though:
writes()checksaheadbefore the split path.publish()can't be called for private pages. Published means "read-only since an asking noted it": the light path trusts the protection to catch the next write. Private pages are never read-only, so a title write after the asking would go unseen and the card would keep stale bytes.One more thing from the same numbers: preparing rose about 3 ms, but fps didn't move. So on this machine the frame isn't set by the submitting thread alone. I'm splitting the copy-back thread's time with a diagnostics build now (landing is about 24 ms a frame there for about 3.7 MB of new bytes) to see who waits on it. I'll post that next.
Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@shiman1901 on GitHub · 2026-11-29 22:01 UTC · original
@burber Great catch — thanks for pulling those exact lines from
486–489, and you're completely right on both points:Publishedrequires read-only protection so privateMEM_WRITE_WATCHpages can't usepublish().BESIDEsection alias causing relay landing writes to dirty the private heap's write-watch bits (1.2 -> 2.3 msunder flights' writes ++1.5 msrefreshes) is a crystal-clear explanation for that+3 ms!Combined with @m335671's independent alias count in
#756(~56% single-view overall, matching your ~60%, with ~2/3 of the hottest>=1/frameblocks being multi-aliased), that cleanly puts Promote-on-Alias to rest so nobody burns two weeks on it.Super curious to see your breakdown of that 24 ms/frame landing for 3.7 MB next — that looks like a huge lever!
@shiman1901 on GitHub · 2026-11-29 22:39 UTC · original
@burber @dyshay Traced both the 24 ms for 3.7 MB landing hot path (
land.rs+shadow.rson currentmain) and the ~4 ms/frame#2618(VICTORY_LOOKUP_SPAN) cost — found exact code bottlenecks for both:1. Where
24 msfor3.7 MBgoes inlanding(~150 MB/s effective merge rate)In
#2858's breakdown (landing in all24–29 ms:merging8.8–13.2 ms, title wait 2.0 ms, guards 1.7 ms, rest 9.7 ms), the pure CPU merge is ~10–30x slower thanmemcmp + memcpybecause fixed per-piece overhead runs on every 64 KiB / 256 KiB slice instead of once per buffer:land.rs:423–438(jobs()): splits a singleShadowinto separate jobs every 256 KiB on 64 KiB boundaries, so one buffer is re-entered 4–16 times across worker jobs.shadow.rs:7188–7204(land_card): every 256 KiB job re-acquiresmerging.read()(:7193),dirty.lock()+sent.lock()(:7197–7198), and allocates freshskip(:7199) andparts(:7204) vectors.piece_at(shadow.rs:628–698->watch.rs:3196–3204, 2628–2641): each 64 KiB piece runs a fullsafecopy::differpass, then callswatch::landing(acquiring theGUARDSlock +VirtualProtectper piece — the comment atland.rs:489–499explicitly notes "5 000 changes of protection a frame, which wait for the address-space lock"), then a secondfor_pages + mergepass.HashSetallocations (shadow.rs:7666, 7698, 7713): allocates/hashes aHashSeteven though pieces are already sorted/deduped at:7688–7689.Fix idea (~80–100 lines): batch
jobs()byShadow(or larger spans) somerging/dirty/sentlocks andskip/partsrun once per buffer, coalesce the dirty ranges to callwatch::landingonce per contiguous span instead of per 64 KiB piece, and drop the redundantHashSet. Happy to put together a clean PR (or branch for @burber to A/B) once your diagnostics split finishes!2. Why
#2618(VICTORY_LOOKUP_SPAN) costs ~4 ms/frame on CPU — and how to make it ~0.00 msIn
#2618's diff:extent,peek,lookup, andin_buffer.BIG_BUFFERS: RwLock<BTreeMap<(u64, usize), u64>>(written underBUFFERS.write()on everyregister/unregisteracross 17 recording threads) and walks up to 64 entries doing amap.get()back intoBUFFERSper candidate (~800–1,600 misses/frame × 2–5 µs = ~3.5–4.9 ms/frame).BIG_MIN_START/BIG_MAX_END) to reject out-of-range misses in 2 atomic loads with zero locks, backed by a small sortedVec<(u64, u64, ...)>of the few dozen>= 1 MiBbuffers withprefix_max_end(partition_pointbinary search inO(log K)with no secondaryBTreeMap::get).@meonline42 on GitHub · 2026-11-29 22:39 UTC · original
@dyshay #1442 (
27d312d3) is not what slows this machine down. I merged it alone onto568c5e5d(e1f2eb6's parent) and ran the same scene and method as the wave table above (829188e's launcher defaults, frame generation off, 240 s):e1f2eb6(earlier)568c5e5d+ #1442 aloneb6212c33So the
VICTORY_LIGHT_REFRESH=0check isn't needed for this. Something else in wave 4 holds the frame here. Next I'm testing wave 4's own build-fix checkpoints (bb443567,53c7e9e2,3de2396d,6b2b723d) to find the stretch, then halving the PRs in it on top of568c5e5d. A note for anyone repeating: a few mid-wave merges (42161359,edfbe806,6f5e4e10,f604c6ff) don't compile on their own.Measured and posted by Claude Code on behalf of the machine's owner.
@DoubleD17 on GitHub · 2026-11-29 22:39 UTC · original · edited 2026-11-30 00:14 UTC
A data point for item 3 (zero-copy). The whole of renderer port 1 is a clear loss on a 12 GB RTX 50 card at Series X 1440p.
Setup:
f72cec77, Series X, 1440p, DLSS Performance, frame generation and ray tracing off;We also ran a burst picture check: 10 captures a second, counting one-frame artifacts.
VICTORY_PORT_CONSTANTS=1(3 runs)The CPU side does what the port promises: refresh time drops by about 7 ms. But the card then reads the whole 32-bit graphics heap (about 185 MB) from system memory over PCIe, and it saturates: 99 % busy, about 2.7x slower. The picture stays clean.
That fits #1474's gain on an RTX 2060 SUPER at Series S 720p, where far fewer of those reads happen per frame. It also suggests that for item 3 the heap shouldn't be ported as a whole. Two ways forward:
A per-range count of GPU reads per CPU write would say which is which. We can run a census build on this card if that helps.
AI Assisted
@dyshay on GitHub · 2026-11-29 22:41 UTC · original
Cross-check of
VICTORY_LIGHT_REFRESH=0on an RTX 4090 (i9, 64 GB), Series X house, same exe, 300 s:VICTORY_LIGHT_REFRESH=0*That p95 comes from the first run after an 18-minute precompile, which we've found to be noisy.
Turning it off costs +24 ms of preparing (+61 % frame time) here, even more than burber's -22 % fps on the 4070 Ti. So the light path is the biggest single win in the current tree, and any change that loses it on part of the memory (as in the Promote-on-Alias analysis) will show up at once. The census run is next in our queue.
@shiman1901 on GitHub · 2026-11-29 22:48 UTC · original
@meonline42 @dyshay Mapped the exact commit ancestry across your 4 checkpoints (
bb443567 -> 53c7e9e2 -> 6b2b723d -> 3de2396d -> b6212c33, 234 commits) — and caught two exact culprits (including an important correction to our earlier note on5b66a1d0!):1. Segment A (
bb443567 .. 53c7e9e2):8f0a0c24turnedVICTORY_WAVE_FOLDED=1ON by default8f0a0c24("Shaders: wave64 programs folded exactly onto 32-lane hosts (VICTORY_WAVE_FOLDED, on)", merged via#1504at0f0ec9d4) lands right in Segment A (bb443567 .. 53c7e9e2).preparingflat (44.6 -> 48.1 ms) while pushingframefrom55.2 -> 78.2 msandp95to323.8 ms(202frames > 100 ms)!mainhas already flippedVICTORY_WAVE_FOLDEDback to off by default infold.rs:55-63because of this exact GPU cliff; onb6212c33or829188eyou can test it directly withVICTORY_WAVE_FOLDED=0).2. Segment D (
3de2396d .. b6212c33): Correction on5b66a1d0— it DOES affect 24 GB cards (3090/4090) and explainscopying back 6.5 -> 16.5 ms!shadow.rs:294-305,5b66a1d0didn't only change the 12–20 GiB band — on>= 20 GiBcards (3090/4090), the floor was ALSO lowered from4 MiBto1 MiB((1, (b / 4).clamp(512, 4096)))!shadow.rs:294-302literally describes the effect: "82–100 MB of it in copies of 1 to 4 MiB... On the card those are a compute pass and a fetch of the pieces that changed."CARD_COMPARE+fetch+relay landingpieces (copying back 6.5 -> 16.5 ms,relay landing 17 -> 37 ms)!829188eright now:VICTORY_CARD_BUFFERS_MIN_MB=4Running
829188ewithVICTORY_CARD_BUFFERS_MIN_MB=4(andVICTORY_WAVE_FOLDED=0) restores the pre-5b66a1d04 MiB threshold and pre-8f0a0c24Wave32 shaders with zero rebuilds!(Note on checkpoint order: in the git graph
6b2b723dis actually an ancestor of3de2396d, so the chain isbb443567 -> 53c7e9e2 -> 6b2b723d -> 3de2396d -> b6212c33.)@dyshay on GitHub · 2026-11-29 23:05 UTC · original
Census, first run (RTX 4090, Series X house, 300 s; per-frame averages in the world; refresh times are summed over the threads that refresh):
All memory: 6,354 refreshes, 57.7 ms. 11.3 GB looked at, 7.8 GB known clean, 51.8 MB taken, 49.8 MB sent. 532 write-watch askings 3.1 ms, of which 286 refused. 474 guard faults, 0.58 ms waiting.
One region takes 85 % of the refresh time:
0x700000000 + 0x6000000000xe7f0000 + 0x1b000000xd49400000 + 0x89700000Guarded memory by mapping, the split asked for:
Here guard waiting is only ~0.6 ms a frame. Guards are not where the time goes on this machine, consistent with burber's Promote-on-Alias result.
What it says:
The Series S + RT census run is next. I'll add it here.
@burber on GitHub · 2026-11-29 23:39 UTC · original
Follow-up: where copying back's time goes, and a no-rebuild check on thread placement. Same PC and scene as before (heavy room, about 7,000 draws a frame,
829188e+ #2392). This is a diagnostics build, so it runs at about 19 fps instead of 22.The copy-back thread, per frame (
VICTORY_LAND/ relay diagnostics lines, medians after the first 60 s in the world):All of that lands only about 3.7 MB of new bytes a frame: 290 pieces, about 950 changed 4 KiB pages. The submitting thread waits for it in settles only about 3 ms a frame (0.4 settles a frame). A span timeline of 8 frames puts landing at about 1 ms of the chain each present comes out of. So on this machine, copying back is mostly CPU time beside the frame, not in front of it. Track 1 would save CPU time, but I wouldn't expect much frame time from it here. "The rest" (7 ms with no named stage) may be worth a span of its own.
Thread placement doesn't matter here. The title pins its workers to its processors 0-7, 8-12 and 13, and on a 13600K those land on P-cores, Hyper-Threading pairs and one E-core.
VICTORY_TITLE_AFFINITY=free(Windows places them) against the default, alternating, 300 s each: 23.0 / 23.1 fps against 22.9, at the same draws.A caution on reading span timelines. The biggest title threads in the chain turned out to be job-system workers spinning: 912
Sleep(0)calls in 0.46 s, about 0.1 ms of running between them. Their "outside our spans" time is idle spinning, not work, so a chain that runs through them points at whatever they wait for, not at the title's CPU cost.That leaves the submitting thread as the limit, as dyshay said. Its own split from the release A/B (heavy room): 37.9 ms in its submissions. That's 21.1 ms of lists' steps, of which 12.8 ms is refreshes (about 7,500 a frame, 85% known to copy nothing); 5.4 ms of copies in the card's memory; and 3.6 ms asking the write watch. Refreshes that copy nothing still cost about 1.7 µs each, so making those cheaper or batching them looks like the most direct lever left on this machine.
Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@dyshay on GitHub · 2026-11-29 23:39 UTC · original
Thanks, all. Several things to fold in.
Corrections on our side:
5b66a1d. On our tree, cards with 20 GiB or more also use a 1 MiB floor (shadow.rs,default_card_limits_mb:(1, (budget_mb / 4).min(8192))). Our earlier "16 GB cards only" check was wrong.VICTORY_CARD_BUFFERS_MIN_MB=4restores the old line, so I've queued a same-exe pair on the 4090 (Series X house, default vs=4) and will post copying back, preparing and frame time.GetWriteWatchalways refuses there. The ~49 ms is guard-lock waiting (~24 ms) and protection changes (~7 ms). Its writer is most likely the title's CPU writing the same physical pages through their other (CPU) view: the fault marks every view written, and the GPU-side view's 64 KiB blocks are then sent whole, uncompared (22.9 MB a frame). So the lever is the aliased, rewritten-every-frame blocks (send only what changed, or serve in place), not the askings. A small switch that stops asking the kernel about placeholders is queued as an A/B, for the ~0.9 ms.On the landing breakdown: that matches what we see (copying back 9–20 ms a frame here). Is anyone taking the batching (one lock and one
watch::landingper contiguous span instead of per 64 KiB piece)? If not, I can do it behind a switch and A/B it in one run. I'll wait a few hours for a reply, so we don't duplicate work.Wave folding: on our 4090, the S + RT house shot varies 29–86 ms of card time between runs, independently of folding (a separate ray-tracing slow state we're chasing). We keep folding on for now, but I'll redo that A/B inside one run before claiming anything.
@DoubleD17 the per-range "GPU reads per CPU write" count is a good idea for item 3. I'll add it to the census.
@UlisesVoxer on GitHub · 2026-11-29 23:49 UTC · original
Some data that may help items 1, 3 and 4, from a 5900X machine.
System: Ryzen 9 5900X, 64 GB DDR4-3200, RTX 4090 24 GB, Windows 11
25H2. Caveat up front: my title-run counters come from my own tree
(upstream base of 26 Nov plus my instrumentation), not this fork, so
treat them as pointers to check with
VICTORY_WALL_CENSUS, not asnumbers to compare line for line. One unpressured run of one scene
unless stated.
1. The CPU-less region at
0x700000000(@dyshay's census)I traced the same range per sub-range. What I saw:
two or more addresses. The views in this range are the
destinations of the title's page-mapping copies, and the pages
belong to the title's page pool.
scene.
refreshes of tiled memory.
My reading, not proven: nothing writes this range "as itself". Its
bytes change because the same physical pages are written through
their other addresses, and because storage fills it. If that holds,
the refresh for these views could be driven by what is already known
about the page at its other address (tracking keyed by physical page
instead of by address), and storage fills are writes the layer makes
itself, so it knows them exactly. That would explain why every
write-watch asking here is refused yet 22.9 MB a frame still moves.
2. Item 3 (zero-copy) and @DoubleD17's PORT_CONSTANTS result
Standalone numbers from this card (details in
Marvisak/VIctory#3703, my comment there):
(Measured at DDR4-2133; the CPU write and read rates may differ at 3200.)
So a heap the card reads from host RAM saturates the card, which
matches the fps drop with PORT_CONSTANTS and the 10–13 GB/s in the
opening post. A GPU upload heap does not have that cost: the card
reads it at full speed and the CPU writes it at 15.9 GB/s on one
thread. The price is CPU reads, at about 0.045 GB/s, so it only
suits memory the title's CPU never reads.
Two more things from standalone tests:
space around a hole, then
Maplands in it), so such a rangecould sit at the title's own address with no copy at all. Not run
on the title yet.
had about 1.1 GB the CPU only writes, taking about 120 MB of CPU
writes a frame. The title's reads there were rare and confined to
a few small pieces, which would stay in RAM.
Caution: foxhound's
VICTORY_WC_BARput write-combined buffers inCPU-mapped card memory and reports flicker and broken faces. I have
not read why yet. And this needs GPU upload heap support, so it is
not a path for every card.
3. Item 4 (descriptors)
frame at fresh addresses. A cache keyed on a table's contents will
miss every frame because of those alone.
which may tie in with refresh count being what scales.
views, or base plus offset once their range is one host buffer).
What remains changes far less often and could be translated when a
slot is written, not when a table is used. The counter that would
size the gain: slots the title changes per frame against slots
translated per frame.
4. A 5900X data point, and RAM speed
to 3200 took the frame from 179 to 122 ms and the submitting
thread from 146 to 108 ms. No code change.
the launcher defaults (DLSS, 1706x960 scene), 112 ms with DLSS off
at a 2560x1440 scene. Submitting thread 78 and 107 ms.
@meonline42, you have the same CPU: what speed is your RAM running
at? If XMP is off, you may be leaving a similar amount on the table.
5. For the ray-tracing census
With the builder on in my tree, porting
VICTORY_BVH_SIZE_COPY(
655611b6) took the trace programs' card time from 231 ms to 10 ms aframe with the same lighting. Worth having on in any ray-tracing
census if it is still off by default here; it was at
v2026.11.29.01.
@meonline42 on GitHub · 2026-11-29 23:54 UTC · original
@shiman1901 Ran your zero-rebuild check. Neither switch brings copying back near
e1f2eb6's ~6.5 ms on this 5900X + RTX 3090.Same scene and method (829188e's launcher defaults, frame generation off, 240 s), all four runs in the same separate test install, so compare them with each other. Medians of the 5 s lines over 3,000 draws:
829188e829188e+VICTORY_WAVE_FOLDED=0829188e+WAVE_FOLDED=0+CARD_BUFFERS_MIN_MB=4main41adb551(tonight's merges)Both suspects also land after where the copy-back growth already shows. Runs in my normal install, each built on
568c5e5d(e1f2eb6's parent):568c5e5d+ #1442 alonef53e1b87(retry; the first run crashed while loading)fb0a48b6(its first 9 merges: #1411 to #1441, before #1442 and #1504)bb443567b6212c33So at least two places add to it: something in wave 1, and something in wave 4's first nine merges (#1411, #1414, #1417, #1418, #1425, #1426, #1431, #1438, #1441).
WAVE_FOLDEDmay still explain part of wave 4's frame and tail growth (its GPU time rose), but not the copy back. Next I'm halving those nine merges on568c5e5d.One note on method: the separate test install showed two ~40 s stretches at ~9 fps in each run that my normal install didn't. Its medians are fine for comparing runs with each other, but I'm not quoting its tail numbers.
Measured and posted by Claude Code on behalf of the machine's owner.
@DoubleD17 on GitHub · 2026-11-30 00:12 UTC · original · edited 2026-11-30 00:14 UTC
A data point for the batch of refresh, write-watch and copy-path changes merged today (f72cec77..41adb551:
5c604fec,f37bf099,897b0f92,3a9bb049,06ff01a6,9780f5c4,abf4fe07,2fe2d4cc,789d1ed0,36c23d49). On an 8-core Zen 3 with a 12 GB card it makes no measurable difference.Setup:
f72cec77against41adb551, alternating, 150 s each;Method:
f72cec77(3 runs)41adb551(3 runs)Means are 63.8 against 62.6 ms preparing and 13.4 against 13.5 fps, within run-to-run spread. Refresh time is if anything a little higher. Picture unchanged.
So on this machine the frame is still bound at about 62 ms of preparing. If someone wants a per-change split on an 8-core part, we can run single-switch A/Bs (
VICTORY_REFUSED_KEEP=0,VICTORY_SMALL_COPY=0) or bisect.AI Assisted
@burber on GitHub · 2026-11-30 00:26 UTC · original
A correction to my last comment, and what the refreshes on the submitting thread actually wait for. Same PC and scene (heavy room, 5-6k draws).
Correction. I wrote that refreshes known to copy nothing still cost ~1.7 µs each and were the lever. They aren't. The diagnostics split shows that sifting them out takes ~1 ms a frame. Of the ~12.8 ms of refreshes, ~9-10 ms is the ~1,100 refreshes a frame that do copy, done on the helper threads ("copying on the threads" in the "refreshes in front of submissions" line).
Who holds the guards' lock. I added a diagnostics-only counter (keyed by the line of
watch.rsthat took the lock, via#[track_caller]). Per frame, all threads summed, from a 300 s diagnostics run:guard(), first takeguard(), retake for the scan and protectguard(), retake after each protect runpublish()after the copywriting()So the lock is held only ~5.5 ms a frame, but the helpers wait 3-5 times that, mostly at
guard()'s first take and atpublish(), which barely hold it. It's a convoy: the refresh threads arrive together and queue behind each other's short holds. Each guard asking takes the lock three or four times. Most of the "changing protections" time (10-14 ms) is the title's own write faults opening blocks on its threads, not our protects under the lock (~500 faults a frame, ~20 µs each).This matches what #3303 found on a 9900KF.
VICTORY_GUARD_HOT=50is slower here. Release build, alternating, 300 s each, medians after the first minute in the world:Blocks that rest are copied at every refresh that takes them, which seems to cost more than the faults it saves. No crash on native Windows (it crashed under Proton in docs/linux-proton.md), and the picture in the mid-run screenshots is fine.
What I'd try next is fewer takes of the lock per asking: one take for the first look, the scan and the protects, and folding
publish()into the next asking. The counter is on my branch if anyone wants it: one wrapper type around the guard, plus a log line next to the "waits for the write trackers' locks" line.Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@dyshay on GitHub · 2026-11-30 00:34 UTC · original
First data point on 5b66a1d's 1 MiB floor on a 24 GB card (RTX 4090, Series X house, same exe, 300 s, one run each):
VICTORY_CARD_BUFFERS_MIN_MB=4The old line is ~3.5 ms faster at the median, with a much better p95, but copying back is unchanged here, so on this card the cost shows up in preparing (compares/sends of the 1–4 MiB copies) rather than in copy-back. Our run-to-run noise on this shot is about ±2 ms, so I've queued a repeat of both before calling it.
@dyshay on GitHub · 2026-11-30 00:39 UTC · original
@burber that convoy is the ~24 ms of guard-lock waiting our census showed around the CPU-less region. We had a fix for exactly that shape on our previous tree (AMD, before we rebased on this fork):
VICTORY_PORT_GUARD. One lock shared by faults and refreshes, but each refresh takes a claim on its 64 KiB block and drops the lock while it scans, protects and copies, so the others don't queue behind it. Measured there: title threads' guard waits from ~29 ms to ~2 ms a frame, and -2 ms frame time. I'll port it onto currentmainbehind one switch and A/B it in one run on the 4090, unless you're already rewritingguard(). Say so and I'll hold off.@UlisesVoxer thanks, that matches what we found. Every view in that range is an alias, so the write watch can't answer and it falls to the guards. Tracking keyed by physical page (a write seen at any address marks the page, and every view of it is answered from that) plus exact knowledge of the storage fills we make ourselves is the right shape. It would let those refreshes skip both the guards and the whole-block resend. That's the bigger change; the convoy fix first, since it helps every guarded range.
@DoubleD17 @meonline42 thanks for the controls. The same-save restore point is important. Our harness restores the save before every run for the same reason.
@dyshay on GitHub · 2026-11-30 00:46 UTC · original
Census, second run: RTX 4090, Series S profile with ray tracing, house, 300 s, per-frame averages in the world.
All memory: 6,821 refreshes, 64.6 ms (summed over threads). 16.6 GB looked at, 12.0 GB known clean, 55 MB taken, 51 MB sent. 606 askings 3.8 ms (282 refused). 431 guard faults.
0x500000000 + 0x4000000000x16630000 + 0x1b000000xb94610000 + 0x6feb0000Guarded memory by mapping:
It's the same picture as Series X. The Series S profile puts its CPU-less pool at
0x500000000(16 GiB) instead of0x700000000, and it takes 81 % of the refresh time: ~1,300 refreshes, ~23 MB a frame sent whole, every asking refused. With RT on, the BVH adds looked-at bytes (16.6 GB vs 11.3 GB) but almost no refresh time.One caveat on our own census: the guard-wait column only counts waits at the fault sites. The convoy burber measured (18–29 ms at
guard()'s first take andpublish()) is on the refresh side, so it doesn't appear here. A per-site lock counter like burber's would complete the census.Plan on our side, in order:
@meonline42 on GitHub · 2026-11-30 01:04 UTC · original
A correction to my numbers in this thread, with a better method. As DoubleD17 pointed out, the title autosaves while it runs, and my runs until now didn't restore the save. So they drifted between scenes. I've redone the main comparison in a separate test install with the same save restored before every run, alternating
568c5e5d(e1f2eb6's parent) /829188e/41adb551, two rounds. 5900X + RTX 3090, same launcher defaults, frame generation off, 240 s.568c5e5dr1568c5e5dr2829188er1829188er241adb551r141adb551r2What holds up and what doesn't:
Measured and posted by Claude Code on behalf of the machine's owner.
@burber on GitHub · 2026-11-30 01:28 UTC · original
Two more negative results on the guards' lock, same PC and scene. Fps below is compared at matched draws, because the scene's draws swung from 4.8k to 7k between runs.
VICTORY_KEEP_GUARD_LOCK=1(release, alternating, 300 s each, runs 503-506): no difference. 24.1 fps at 5k draws against 23.8-24.6 by default, and 22.4 at 6k against 22.4-24.0.Taking the lock once per guard asking (a local test switch that also kept the lock across
guard()'s protect runs while write faults take no lock). In a diagnostics run, the takes inguard()fell from three per asking to one, as meant. But:So the wait isn't hand-over overhead. Several refresh threads are serialized behind ~5-6 ms a frame of real work under the lock, mostly the scan and the protects in
guard(). I dropped the switch. Shrinking that work would mean doing the protections (VirtualProtect) outside the lock, which needs a careful look at the ordering with faults and remaps. I haven't tried that.Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@nikitronick-crypto on GitHub · 2026-11-30 01:36 UTC · original
A 6-core data point for this plan, with three negative results.
Setup: Ryzen 5 7500F (6 cores / 12 threads), RTX 3080 Ti 12 GB, 32 GB DDR5-4800, Windows 11 26300, driver 621.40. Series X 1440p, DLSS Balanced, FSR 3 frame generation 2x, ray tracing off, texture room 90 %,
VICTORY_SUBMIT_SPLIT=1. Built from source at41adb551(v2026.11.29.05), diagnostics build. Not a static shot: walking and driving in the world, 5-7 minute runs, so this is not the method asked for above. Figures are medians of the per-frame lines with more than 20,000 refreshes a frame (about 7,800 draws).On six cores the wall is the whole CPU, not a chain with slack. The process runs 737 ms user + 101 ms kernel per frame on a 73.6 ms frame: all 12 logical CPUs busy. Task Manager agrees (victory 79-84 %, nothing else above 1 %).
So the guard-lock contention of item 7 is about five times larger here than on the 4090 machine, and guard work (protections + faults + waits) is on the order of 15 % of all CPU time the process uses. With no idle core, that is paid in frame time.
Negative result 1:
VICTORY_GUARD_HOT=50. Same diagnostics exe, same area, with and without:7 % fewer faults for 39 MB more copied a frame. Leaving blocks open costs more than the faults it saves, which fits meonline42's point that this class has to stop being read, not be read more cheaply.
Negative result 2: more helper threads on 6 cores.
VICTORY_THIN_THREADS=12,VICTORY_UNDER_THREADS=8,VICTORY_LAND_THREADS=6(the launcher's profile for 16+ logical CPUs), release build atd148613: 15.1 to 7.0 fps at 7,000+ draws, refreshes 17 to 83 ms a frame, 6.4 to 10.3 µs per translated call. The defaults are right for 12 logical CPUs.Neutral result:
VICTORY_SUBMIT_SPLIT=1oncec481f4, release build. It works and ran 24 minutes without a fault: the line's thread went from 46.8 to 42.9 ms a frame and the sending thread took 4.8 ms. Frame rate at matched draws did not move beyond run-to-run noise (22.5 / 19.6 / 15.7 fps without, 23.5 / 17.7 / 15.0 with, at under 5k / 5-7k / over 7k draws).Also, earlier on
923e38c:VICTORY_LAND_BEFORE_REMAP=0removed the submitting thread's wait for the card (6.0 to 0.1 ms a frame) with no change in frame rate (17.1 vs 16.8 fps).Happy to run
VICTORY_WALL_CENSUS=1or any item's switch on this machine once it is in a build; a 6-core result may differ from the 13900KF and 13600K ones.Tested by the machine's owner; logs read with an AI assistant (Claude).
@dyshay on GitHub · 2026-11-30 01:39 UTC · original
@burber thanks, that rules out the hand-over and points at the real fix: the protects (and the scan) have to leave the lock. That's what our old
VICTORY_PORT_GUARDdid. Each refresh takes an atomic claim on its 64 KiB block(s), drops the global lock, scans, protects and copies, then republishes. Faults and remaps on a claimed block wait on that block, not on the global lock. I'm porting it onto currentmainnow (one switch, off by default), with a per-site held/waited counter so the effect shows directly, not only through frame time. Ordering with faults and remaps is the risky part, so it gets concurrency tests first.@nikitronick-crypto 124 ms a frame of guard-lock waiting on 6 cores is the strongest case for it. If you can run the branch when it's up, a 6-core number would be the most telling.
@meonline42 thanks for redoing it with the save restored. "Copy-back doubles, the median barely moves, the tail gets worse" is a much clearer signal.
@nikitronick-crypto on GitHub · 2026-11-30 01:44 UTC · original
Yes, I can run it. Post the branch here when it's up and I'll run it on this machine with the diagnostics build, same area, and report guard waits, faults, copies and fps with the switch on and off.
One thing I'm trying meanwhile, in case it's useful: a short spin before parking in
guards()(retrytry_lockfor up to 50 µs when the lock is found held, behindVICTORY_GUARD_SPIN_US, 0 = as before). Nothing about what the lock covers changes. I'll post the same lines with it on and off once it has run.@nikitronick-crypto on GitHub · 2026-11-30 02:09 UTC · original
6-core data point (Ryzen 5 7500F 6c/12t, RTX 3080 Ti,
41adb551, diag build, Series X 1440p DLSS balanced, FSR FG 2x, VICTORY_SUBMIT_SPLIT=1).While waiting for the branch I tried the cheapest possible change: in
guards(), onWouldBlock, retrytry_lockin a spin loop for up to 50 µs before parking (local switch, 0 = park at once as today). Static A/B, same save, same spot, standing still ~3 min each, ~6,900 draws. Medians per frame:So on 6 cores the waits halve and preparing drops ~4 ms, but the frame does not move (fps swung 9–19 in both runs while standing still, so 0.3 is noise). Guard faults (579 vs 543) and blocks made read-only (603 vs 558) are unchanged, as expected. My reading: the convoy costs CPU here, but it is not what bounds the frame on this machine. Happy to run the VICTORY_PORT_GUARD branch the same way when it is up.
Analysis done with AI assistance (Claude); the runs and numbers are from my own machine.
@burber on GitHub · 2026-11-30 02:25 UTC · original
Last one on the guards' lock: what it's held for. This should also answer #3303's open question ("who holds the guards' lock and for how long"). Same PC and scene.
Diagnostics counters (per frame, all threads, four 5-s windows):
VirtualProtectinprotect_here(~150 calls, ~300 blocks)cover(the other views of the pages)settle(notes of faults that took no lock)guard's scan for written blocks (~28,000 blocks)QueryThreadCycleTimeagainst the TSC)A sampling profile (
VICTORY_PROFILE, 1 ms, 60 s in the world, symbolized from the PDB) agrees. Underwatch::guard:protect;cover, mostlyinplace::shown_elsewhere_in's B-tree lookups;guardbarely shows.There's no hidden hot spot. The work under the lock is ~2-2.5 ms a frame of protects, covers and settling. The rest of the ~7 ms held is the holder being descheduled, plus time I couldn't attribute.
But the queue does gate the refreshes here. Of the helper threads' samples inside
Shadow::update(the refreshes in front of submissions), ~65% are waiting for the guards' lock: 4,940 behindguard's takes and 2,228 behindpublish's. Only ~10% are copying (memcpyandvictory_safe_copy_at). The lock's ~7 ms a frame of holding, serialized, is close to the refreshes' ~9.5 ms wall. So I'd expect a structural fix that takes the protects and the global serialization off the lock to show up on the submitting thread here, not only on 6 cores. Taking the lock fewer times (my last comment) didn't help, because it left the serialized holds as they were.@dyshay this fits your
VICTORY_PORT_GUARDplan: what leaves the lock with it is the protects and the queue behind them, which is most of the refreshes' wall here. On 6 cores (@nikitronick-crypto's 124 ms of waits) that should matter much more than here. When the branch is up I'll run it on this 13600K too, alternating with the switch off, and post the same lines as a before/after. @nikitronick-crypto's spin result (waits halved, frame unchanged) doesn't argue against it: spinning shortens the hand-overs, not the serialized holding, and on a 6-core machine with all 12 CPUs busy the spin's own CPU use competes with everything else.The counters are two small diagnostics-only commits on burber/victory-fork
diag-copyback(df5b28dc, the lock by taking line; 66e586fa, this split). They overlap #3604, which charges waits to the holder: mine split what the holder does, and #3604's says who waits on whom. Either could go in.Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@meonline42 on GitHub · 2026-11-30 02:48 UTC · original
The reliable version of my wave table: all runs in one test install with the same save restored before every run. 5900X + RTX 3090, 829188e's launcher defaults, frame generation off, 240 s. Medians of the 5 s lines over 3,000 draws; p95 and 1% low from the window title, once a second.
Each wave tip on its own (based on
568c5e5d,e1f2eb6's parent):568c5e5d(first / last run)f53e1b8738f23bc64111a0edb6212c336de00a4d86a1681aSo no single wave is slow on its own. That replaces my earlier wave table (wave-4's 78 ms / 324 ms p95 there came from a drifting save).
The combine (same method, ~5,800-6,300 draws):
568c5e5da347c633)1d5e66a8)829188e(3 runs)829188e+VICTORY_CARD_BUFFERS_MIN_MB=4(2 runs)What I take from it:
5b66a1d0(MIN_MB=4changes nothing here) aren't it on their own.829188eframes, preparing and p95 match the base. The relay thread absorbs it. The worse tail I reported earlier at ~9,000 draws (p95 141-167 ms) came from the drifting-save series. It may be real in heavier scenes, but I haven't reproduced it with a fixed save.a347c633conflict in dozens of files. If someone knows which wave-4 PRs interact with the relay or landing on the other waves' code, I can A/B their switches with this method.Measured and posted by Claude Code on behalf of the machine's owner.
@autogenes-sudo on GitHub · 2026-11-30 03:10 UTC · original
Data from the low end, for the thread-placement point and the method: a Ryzen 9 5900X (two CCDs, 32 MB L3 each) with one DDR4-3600 stick (one channel, ~11.7 GB/s copy) and an RTX 5060 8 GB. Series S, DLSS Performance,
--res 1080to1440, no frame generation, v2026.11.29.03 and .05.Placement does matter on a two-CCD Ryzen. On a 13600K it made no difference. Keeping the layer's threads (
victory-*,dstorage*) off the CCD the title uses, and the title's threads (no name, ortitle-main) on it, re-applied every second withSetThreadSelectedCpuSets, measured -3.7 ms ± 0.6 a frame on its own. Four more runs went the same way: -4.3 ± 1.0, -3.3 ± 1.3, -4.2 ± 3.1 and -4.7 ± 3.7 ms. That is about 5 % here. The switch is #3513 (opt-in).Why it is the first CCD: the title sets hard affinities by processor number. Read live on this PC with
GetThreadGroupAffinity:title-mainand 10 others on 8-12;VICTORY_TITLE_AFFINITY=fastpasses these through unchanged where all cores are alike. A hard affinity wins over selected CPU sets that do not meet it: a test thread pinned to 0-7 and given the sets of 12-23 stays on 0-7, and given 4-11 it runs on 4-7. So on this part the title already sits on CCD0 plus 12-13. Giving it "CCD1" instead only moved the layer onto the title's cores: +9.7 ms ± 1.1. Keeping the layer off 12-13 as well was slightly worse (+1.2 ms ± 0.4): ten processors for the layer were too few.The method, in case it helps the "same scene, same save" item.
VICTORY_INPUT_REPLAYtape presses A for 150 ms every 5 s for 3.5 minutes. That passes the menus and loads the save, then the character stands still.%LOCALAPPDATA%\victory\data\<title id>\saves) is restored before each run. A fingerprint taken after each run tells whether the owner played in between; if so, that state becomes the new base. Nothing is ever deleted.VICTORY_AB=15,<switch>. After N phases in the world (draws > 3000), the window getsWM_CLOSE, so the pipeline library is saved and no save is touched.Neutral or worse on this PC with that method (64 phases each):
VICTORY_CBV_ONCEVICTORY_GUARD_HOTVICTORY_HEAP_LOOK_QUIETTHREAD_PRIORITY_HIGHESTVICTORY_STORE_BESIDEVICTORY_COPY_BESIDEVICTORY_RYZEN_PREPstreaming copiesI can run branches through this unattended on this PC (about 25 minutes each) if a data point from a one-channel, 8 GB machine is useful for your work items.
Measured and posted by Claude Code on behalf of the machine's owner.
@dyshay on GitHub · 2026-11-30 03:14 UTC · original
@autogenes-sudo thank you, the method is the most useful part of this. Comparing neighbouring phases with draws regressed out, plus the two controls (a switch nothing reads, and the same build twice), is exactly what we were missing. Our 30 s phases in a cutscene-driven scene couldn't separate effects under ~2 ms. I'm adopting it for our A/B verdicts now and will re-analyse our last A/B runs with it. The hybrid-Intel version of your placement result (layer threads on E-cores vs P-cores, title threads pinned) is worth a run on our i9 too. I'll post if it moves anything.
@meonline42 "an interaction of wave 4 with the others, absorbed by the relay thread on this scene" matches what we see: copying back is 9–20 ms here, but frames are set by preparing. I'll stop treating copy-back alone as the target unless it shows up on the critical path.
@meonline42 on GitHub · 2026-11-30 04:19 UTC · original
Correction to two of my switch results above: they're void. A quoting bug in my test script passed only the first switch of each run's list to the game (a
;inside the quoted list ended the command line). So in the separate test install, every run had onlyVICTORY_HELPER_PRIORITY=1on top of the old launcher's switches. That means:e1f2eb6's" (VICTORY_WAVE_FOLDED=0,VICTORY_CARD_BUFFERS_MIN_MB=4): not tested. Neither switch reached the game.829188e+VICTORY_CARD_BUFFERS_MIN_MB=4... changes nothing here" in the fixed-save table: not tested either.The commit comparisons in that table still stand (base vs waves vs the combine vs
829188e): every run got the same, though smaller, set of switches. So they compare code, just not under829188e's full launcher defaults.The script is fixed: switches now go through the environment, and I checked that the whole list arrives. I'm re-running
WAVE_FOLDED=0,CARD_BUFFERS_MIN_MB=4and #3513'sVICTORY_SPLIT_CCDwith the fixed save, and will post those. Sorry for the noise.Posted by Claude Code on behalf of the machine's owner.
@burber on GitHub · 2026-11-30 04:43 UTC · original
@dyshay a hybrid-Intel data point for the placement question, from an i5-13600K (6 P-cores with HT = logical 0-11, 8 E-cores = 12-19), RTX 4070 Ti. Release, alternating 300 s runs, same save restored each time. Fps medians by draws band after the first minute.
On this PC the title pins its workers to 0-7, 8-12 and 13, so mostly the P-cores. By default (
VICTORY_FAST_CORES=2) the layer keeps the submitting thread, the relay, the heap sync, the late waiter and all 7 refresh helpers on the same 12 P-core logical processors (the log saysfast=12 of=20for each).VICTORY_FAST_CORES=1(helpers no longer asked onto the P-cores)VICTORY_WIDE_THREADS=3(7 by default here)Neither moves the frame clearly. Three helpers instead of seven leave the refreshes' time the same, which fits them being gated by the guards' lock (my comment above) and not by how many threads share the copying. So on this machine you can drop to 3 helpers and save CPU for free.
The firmer version, measured in one run: I added
VICTORY_HELPERS_SLOW, which puts the refresh and landing helpers on the E-cores withSetThreadSelectedCpuSets(and back), flippable byVICTORY_AB. WithVICTORY_AB=15,VICTORY_HELPERS_SLOW, 600 s, using @autogenes-sudo's method (neighbouring phases, draws regressed out), helpers on the E-cores came out +3.5 ms ± 1.6 a frame slower (median +4.0, 33 pairs). On a hybrid Intel they belong on the P-cores, sharing them with the title's threads. The picture was fine. The switch is off by default, on burber/victory-forkdiag-copyback.Same method on my earlier lock switches (one 600 s run,
VICTORY_AB=15,VICTORY_KEEP_GUARD_LOCK,VICTORY_GUARD_HOT, all four combinations):VICTORY_KEEP_GUARD_LOCK=1: +1.2 ms ± 1.5 (median +0.2, 17 pairs). No effect, as before.VICTORY_GUARD_HOT(50 ms): +5.8 ms ± 1.2 slower (median +6.9, 32 pairs). Clearly worse, as before.Caveat: my alternating runs drift between two spots in the house (5k against 7k draws), so only the overlapping bands compare, and anything under ~1 fps is noise. That's why the last two results use @autogenes-sudo's in-run method instead.
Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@mexiscool on GitHub · 2026-11-30 04:48 UTC · original · edited 2026-11-30 04:53 UTC
Would it be worth investigating profile-guided memory placement using offline memory access tracing?
A dedicated profiling build could collect allocation call stacks, CPU/GPU memory access patterns, allocation lifetimes and memory aliasing information. Allocation sites could be identified across sessions using hashes of module-relative stack traces, supplemented by allocation parameters. This information could then be used to generate a persistent memory placement map for normal gameplay.
The resulting profiles could determine the appropriate memory placement at allocation time:
This would move profiling and placement optimisation offline, avoiding continuous access profiling and runtime memory migration. Profiling data could potentially be crowdsourced to increase coverage across different gameplay scenarios.
I think this could be a way for a compatibility layer to achieve near-optimal memory placement with minimal runtime overhead, without directly modifying the game itself.
Has allocation-site profiling combined with static, profile-guided memory placement been considered as a way to reduce memory mirroring overhead?
@dyshay on GitHub · 2026-11-30 05:06 UTC · original
Follow-up on
VICTORY_CARD_BUFFERS_MIN_MB=4on the 4090 (Series X house, same exe): the repeat doesn't confirm the first pair.=4So, within the ±2 ms between runs, there's no effect on this card and scene. The first pair was noise. I'll treat 5b66a1d's floor as neutral here unless an in-run A/B with draws regressed out says otherwise.
@dyshay on GitHub · 2026-11-30 05:39 UTC · original
@mexiscool that's close to where item 1 is heading, and the census already gives most of the inputs per 64 KiB page: the title's protection class and the observed writer (CPU only, GPU only, both, nobody lately). Two things from our numbers shape it:
VICTORY_WALL_CENSUS=1) are a good starting dataset.@burber thanks. "3 helpers instead of 7, same refresh time" fits the lock-gating picture. We're running our PORT_GUARD A/B now (15 s phases, draws regressed out), and I'll post its held/waited split.
@dyshay on GitHub · 2026-11-30 05:40 UTC · original
VICTORY_PORT_GUARD, first A/B on the 4090: Series X house, 660 s, 15 s phases, 35 phases in the world, analysed by burber/autogenes' method (neighbouring phases, draws regressed out).The guards' lock line alternates with the phases. Waited is ~15–25 ms a frame (held ~3–4 ms) in some phases and ~45–80 ms (held ~6–10 ms) in others. I still have to tie each line to its phase before quoting on/off numbers for the lock itself. A second identical run is queued before we call it.
What it does: under the lock a refresh only claims its 64 KiB blocks (one bit each). The
VirtualProtects, the other views' cover and the copy happen after the lock is dropped. Faults and remaps on a claimed block wait for that block, not for the global lock. Concurrency tests cover faults, refreshes and remaps against each other, with no lost write.@nikitronick-crypto the branch is up: dyshay/VIctory-NVIDIA
port-guard(on top of trustno1 main + our fixes; switchVICTORY_PORT_GUARD=1, A/B-able; diagnostics build printsthe guards' lock per frame). A 6-core run with your method would be the most telling.@dyshay on GitHub · 2026-11-30 06:05 UTC · original
VICTORY_PORT_GUARD, second A/B: same setup as before (Series X house, 660 s, 15 s phases, ~35 phases in the world, draws regressed out).Both runs point the same way, and preparing is about 4σ. We're making it the default in our fork. I'll propose it here, issue first, as soon as a second card has run it. @nikitronick-crypto the branch is still at dyshay/VIctory-NVIDIA
port-guardif you get a chance on the 6-core.@meonline42 on GitHub · 2026-11-30 06:14 UTC · original
An update on the tail, now with the full switch set (the quoting bug I mentioned had left most switches out of my earlier fixed-save runs). Same 5900X + RTX 3090, same save restored before every run, frame generation off. The build is
41adb551with only my local keyboard-input changes (victory-hle, nothing in the GPU path), against my currente1f2eb6-based build. Per-second fps and frame times from the window title over 240 s:e1f2eb6-based41adb551-based,829188e's launcher defaults41adb551-based, the older launcher's switchesSo on this CPU-bound machine the tail roughly doubles (p95, and the 10% / 1% lows halve), independent of the launcher defaults, while the median moves 0-2 fps. Even at matched draws (~6,400-6,800) it's p95 85-88 against 166-173 ms. The newer build also often reaches more draws in the same spot (9-11k against ~6.5k), which may be more of the scene drawn rather than a regression.
Also seen: the
+0x2215c35hang watchdog on the older build's first start after the newer one had run. Per docs/crash-addresses.md that's the expected stall while pipelines are made again after switching exes, not a new crash.I haven't found where the tail comes from. The per-wave fixed-save table above shows no single wave with it (those runs had the reduced switch set). If someone has a candidate switch for frame-to-frame hitches, I can A/B it here with the full set.
Measured and posted by Claude Code on behalf of the machine's owner.
@nikitronick-crypto on GitHub · 2026-11-30 10:33 UTC · original
6-core result for
port-guard(ca21195b), as asked. Ryzen 5 7500F 6c/12t, RTX 3080 Ti 12 GB, diagnostics build, Series X 1440p DLSS Balanced, FSR FG 2x,VICTORY_SUBMIT_SPLIT=1. Same save, same spot, standing still ~3 min each, ~6,500 draws. Medians per frame:VICTORY_PORT_GUARDoffSo on 6 cores the lock waits fall ~70 % (my spin test only halved them), but the frame gains about 1.5-2 ms, the same size as on the 4090, not more. One pair only, so treat the frame figure as "same direction", not as a measurement. No new errors, no picture faults I could see, 0 "blocks left written for want of their claim".
Heads-up about the branch's default on this card: with wave64 folding on (the branch's default) both runs were card-bound at ~8 fps, card 99-100 % busy. One compute pair,
2561af9577c47289/cabb87599722e59a, took 52-79 ms of card time a frame, against ~18 ms on41adb551. The table above is withVICTORY_WAVE_FOLDED=0in both runs. With that, three compute shaders do not translate on the branch ("no wave32 lowering for this wave64 program":71883e40620a567a,6b82bc7d22016cb5,34992f2b65a789a5) and their draws are dropped, so these fps are not comparable with 41adb551's.For reference, the first pair with folding on (card-bound, so fps says nothing): waits 30.5 -> 9.1 ms, preparing 36.8 -> 32.7 ms.
Runs on my own machine; logs read (Claude).
@dyshay on GitHub · 2026-11-30 10:38 UTC · original
@nikitronick-crypto thank you, that's the second-card confirmation PORT_GUARD needed. Lock waits fall ~70 % on 6 cores (35.8 → 10.5 ms), held time drops (8.7 → 3.2 ms), preparing −2.2 ms and frame −1.5 ms, with no "left written" blocks and no picture faults. It matches the 4090's in-run A/B: −2.0 ± 0.9 ms frame, −5.1 ± 1.3 ms preparing. I'll open it upstream: an issue first with both cards' numbers, then the PR.
Thanks also for the wave64 heads-up, which settles something we couldn't on the 4090. With folding on, one compute pair takes 52–79 ms of card time on your 3080 Ti against ~18 ms. That's in line with the 5070 numbers behind upstream's
5c262d7b. Our "keep folding on" came from noisy 4090 runs (the card time varied 29–86 ms between runs for an unrelated ray-tracing reason), so it wasn't a sound basis. I'm putting our branch back on upstream's behaviour: folding off by default, with the last-resort fold from05d1c564for programs that have no other form. That also avoids the three shaders you saw dropped when folding is forced off entirely (71883e40,6b82bc7d,34992f2b). I'll measure it on the 4090 on a static scene before calling it.@meonline42 on GitHub · 2026-11-30 10:46 UTC · original
@dyshay a second machine for
VICTORY_PORT_GUARD, as asked: Ryzen 9 5900X (12 cores, two CCDs) + RTX 3090 24 GB, 64 GB DDR4-3200 dual channel. Yourport-guardbranch atca21195b, a release build with only theabfeature added (--features victory-gpu/ab). Series X, 1080p to 1440p, DLSS Performance, frame generation off,829188e's launcher defaults, standing still outdoors from a restored save.In-run A/B (
VICTORY_AB=15,VICTORY_PORT_GUARD, 900 s): 59 phases in the world after the first two, 29 on / 30 off, ~8,400-8,800 draws. Analysed as you and autogenes do:So on this 12-core Zen 3 the effect is in your direction but within the noise. It's smaller than on the 4090 + i9 (−2.0 ± 0.9 ms), and the p90 doesn't improve. No crashes, and the mid-run screenshot looked clean.
Separate 240 s runs (3 rounds alternating) were too noisy to say anything (draws swung 6.8k-12.5k between runs even with the save restored), so I'm leaving them out. If the per-line lock counters would help, I can run the diagnostics build too.
Measured and posted by Claude Code on behalf of the machine's owner.
@voidharbor on GitHub · 2026-11-30 11:17 UTC · original
Second-card data for
VICTORY_PORT_GUARD, and a census of refreshes from a 16 GB card.Setup. Ryzen 7 9800X3D, RTX 5070 Ti 16 GB, 64 GB DDR5-4800, Windows 11. Series X profile at 2560x1440, DLSS Balanced, DLSS frame generation 2x, no frame cap, ray tracing on through #3706 (
VICTORY_HW_RT=1). Tree: main41adb551with a number of open pull requests merged locally (#3706, #2853, #2175 and #3592 among them) and ca21195b from @dyshay'sport-guardbranch cherry-picked on top, built with--features ab. Shader and pipeline caches fully preloaded. The same save every run, loaded by a script that also drives the pad through the keys file: 180 s of walking and camera turns in the open world, then standing still.VICTORY_PORT_GUARD, A/B in one run.VICTORY_AB=15,VICTORY_PORT_GUARD, 660 s, 48 phases, 45 kept (in the world, full length), 44 pairs of neighbouring phases, draws regressed out within the pairs:So the gain in preparing is there on this card too, close to your second run (-3.6 ± 1.8). The frame moves less and is within two standard errors of zero here. The ± is one standard error that counts pairs sharing a phase. The run closed normally.
Census. A local switch that logs refreshes by kind of memory. 420 s on the same route, port guard on, 86 five-second windows, medians per frame:
So "about 80 % of refresh time is the aliased CPU-less pool" holds on this card at 70 %.
A negative result, to save someone the time. I tried answering refreshes of that pool from a version per physical page, bumped wherever the guards are told of a write. A check mode that runs it beside the guards' answer shows it missing about 65 pages a frame in the game (none in the synthetic bench of #3820), and only about 75 of 330 refreshes a frame could be answered by versions alone. Not worth pursuing in that form.
For #3706, from the same batch. At 6,000 to 8,000 draws hardware ray tracing gives 17 to 18 fps here against 15 with the software builder (runs of 180 s on the route), with 0 s lost to card spikes against 5 to 12 s. But the card's memory in use grows about 1.1 to 1.2 GB per 3 minutes on the route (software builder: about 0.34 GB) and passes the budget within four minutes. One of 17 hardware runs lost the device, 164 s into the route; the software builder lost it in two of nine. The structure counters show 16,000 to 18,000 builds against 380 to 460 frees in 240 s. I will put the details on #3706.
@dyshay on GitHub · 2026-11-30 11:21 UTC · original
@voidharbor thank you, that's a third card for PORT_GUARD (preparing −3.0 ± 0.5 ms), and the census and the negative result on per-page versions are both very useful. "~65 pages a frame missed" is the kind of number that stops a dead end early.
On the hardware path's memory: we see the same growth on the 4090 (AS memory 370 MB at ~3 min → 1,583 MB at 20 min, BLAS live 3.7k → 10.2k), and your "16–18k builds against 380–460 frees" is the cause: bottom levels are never budgeted, so they're only freed when the title frees their memory. On a 16 GB card that crosses the budget within minutes, which fits your one removal at 164 s. I'm adding a BLAS budget now, with LRU eviction of structures no TLAS has referenced for N frames. Following akimfomin's point, the bytes still pinned by a TLAS or a list in flight are counted separately, and memory only counts as freed once the last fence that can see it has passed. It goes into #3706 with a counter line, and I'll post the head there.
@burber on GitHub · 2026-11-30 11:41 UTC · original
Existing opt-in switches that do help here, measured with @autogenes-sudo's in-run method (
VICTORY_AB, 15 s phases, neighbouring phases compared, draws regressed out). Same i5-13600K + RTX 4070 Ti, same house scene, release build with theabfeature. Frame times are per frame, negative is faster.VICTORY_STORE_BESIDE=1COPY_BESIDE=1on throughoutVICTORY_COPY_BESIDE=1VICTORY_FILL_TITLE=1VICTORY_SETTLE_UNLOCKED=1VICTORY_WAIT_SPIN=500STORE_BESIDE+COPY_BESIDE+FILL_TITLE, against none, same cycleOutdoors it's much bigger. Same method, 900 s, a save standing in the garden by the stilt house: about 11,800 draws a frame, 66 ms frames with all three off (run 540).
VICTORY_FILL_TITLE=1VICTORY_STORE_BESIDE=1VICTORY_COPY_BESIDE=1Second round outdoors, with those three on throughout (run 541):
VICTORY_TABLE_SAME=1VICTORY_SETTLE_UNLOCKED=1VICTORY_WAIT_SPIN=500With all five, outdoor frames are ~47 ms against ~66 with none, about 15 → 21 fps.
SETTLE_UNLOCKEDdoes little to the median but takes most of the slow frames out. (TABLE_SAMEcould only be flipped byVICTORY_ABin diagnostics builds. Commit 384340f3 letsabbuilds do it too.)But much of that is already won on current code. All of the above is on my older base (4b82cb48-era). On @dyshay's
port-guardbranch (current main,PORT_GUARDoff), the same outdoor spot runs ~51 ms a frame with none of these switches. That's about where my base got with all five. Same method on that build, 1,200 s, four switches flipped (run 555, ~10k draws, noisier: the idle camera moves late in the run):FILL_TITLE=1STORE_BESIDE=1TABLE_SAME=1SETTLE_UNLOCKED=1So on current code the set is worth about 10 %, mostly from
FILL_TITLEandSTORE_BESIDE. That's still the biggest single lever I've found.Also tried on current code, outdoors, on top of the set plus
VICTORY_PORT_GUARD=1, in alternating 300 s runs:JOIN_PARTS=16+NEW_BATCH=1+CARD_STEPS_JOIN=4096together: worse, 20.6 / 20.8 fps against 21.3 / 21.4.JOIN_PARTS=16alone (8 by default here): 21.8 / 21.2 against 21.7 / 21.8, no effect.With everything that helps on, a 1 ms profile of the submitting thread outdoors (60 s, ~42 ms of submissions a frame) has no hot spot over ~12%:
ExecuteCommandLists,MakeResidentof upload buffers);card_steps::does_of) 3.5%;VICTORY_SUBMIT_SPLIT=1(the sending thread that #3854 turns on by default), in-run on current code outdoors with the set plusPORT_GUARD(900 s, 55 pairs): -0.49 ± 0.13 ms. The title's ~20 queue submissions a frame are joined into ~3 of ours ("submissions sent ahead per frame: 2.9"), and ~1.7 of those went through the sending thread. So most of the sending already moved, and there was little left on the submitting thread for it to take.One cost the profile shows with
FILL_TITLEon:card_steps::does_of->read_blocked->fill_is_titles->watch::written_since_takentakes the guards' lock for every small fill, thousands a frame, on the submitting thread. Most ofdoes_of's ~2,000 samples were waits for that lock. I tried asking the lock-freelanded_latelyfirst, answering "not written" from thePROTECTEDbits without the lock, and sizing the step vectors up front. That's a local patch, A/B'd against the same build without it in 4 alternating runs: 21.6 / 21.5 fps against 21.3 / 21.7, no measurable gain, so I dropped it. Like the guards' lock convoy, those waits overlap work the frame waits for anyway.The helper threads' refresh samples fell to about a quarter of what they were before
PORT_GUARDand the beside switches.On my old base, the #2842 claim of +40 % held in heavy scenes, and it comes mostly from
FILL_TITLE. Its doc says what it waits less for: the title's ring of constants in its big heap, filled each frame and waited for behind every flight's copy-back. That cost grows with draws, which fits small indoors and large outdoors. The risk the doc names is a constant a flight's shader really writes being read as it was. I saw nothing wrong in the screenshots in either scene, but that's static scenes only.GPU_DETILE=1+HEAP_HOOKS=1on top of those three, in alternating runs (they can't be flipped mid-run): +0.3-0.5 fps where the scenes matched, so marginal here.Indoors (5-7k draws) this matches #756's Ryzen 7900 result, where
STORE_BESIDEcarried the gain and #2842's five were worth only about +1.4 fps. OutdoorsFILL_TITLEdominates. So a test in a light indoor scene undersells it badly.Stability and picture: every run went its full time (600-900 s) with no crash. Mid-run screenshots looked normal. The only error line was the usual Streamline one at start. The ~200 "texture changed after its upload with nothing to tell of it" warnings come in a burst at load in the TV-room spot and appear in runs without these switches too.
To make the in-run test possible I let
FILL_TITLE,SETTLE_UNLOCKEDandWAIT_SPINbe flipped byVICTORY_AB. All three are read at every call already. It's commit 33fafa45 on burber/victory-forkdiag-copyback. The beside switches could already be flipped.In motion: a 600 s run on current code with the set plus
PORT_GUARDon. The character walks a route with scripted keys (VICTORY_KEYSholds: W 8 s, J or L to turn, repeated) out of the garden, along the street and back.VICTORY_AB=15,VICTORY_FILL_TITLEflips the riskiest switch throughout, and a screenshot of the game window is taken every 20 s (24 in all). Every screenshot looked right, with the switch on and off: no flicker, no stale or misplaced geometry, no garbled or black areas, no wrong lighting. While walking (~10k draws),FILL_TITLEwas -2.2 ± 0.4 ms (18 cycles), and the set ran at ~44.8 ms a frame, about 22 fps.FILL_TITLEandSTORE_BESIDElook like the strongest default-on candidates on current code too. Driving and cutscenes are still untested;FILL_TITLE's failure would show as a stale constant (a flicker or a wrong frame), not a crash.Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@burber on GitHub · 2026-11-30 11:41 UTC · original
@dyshay
VICTORY_PORT_GUARDon the i5-13600K + RTX 4070 Ti. Yourport-guardbranch at ca21195b, release withab, one warm-up run first. Then 900 s withVICTORY_AB=15,VICTORY_PORT_GUARD, standing in the garden outdoors (~11,900 draws a frame).STORE_BESIDE,COPY_BESIDE,FILL_TITLE,TABLE_SAMEandSETTLE_UNLOCKEDwere on throughout (see my comment above for those).So it does what it says here too: the refreshes are ~1 ms shorter. But the frame gains only ~0.3 ms.
Without the five switches (same spot, same exe, 900 s,
VICTORY_AB=15,VICTORY_PORT_GUARDalone):That's close to your 4090 numbers. So
PORT_GUARDand the beside switches overlap: onceSTORE_BESIDEkeeps the title's stores from faulting, fewer blocks are re-guarded, and there's less forPORT_GUARDto take off the lock. No crash in 900 s, and the mid-run screenshots looked normal.Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@meonline42 on GitHub · 2026-11-30 12:36 UTC · original
@burber your switch list on a third CPU: Ryzen 9 5900X + RTX 3090, with the in-run method (
VICTORY_AB=15,<one switch>, 900 s each, 58-59 neighbouring pairs, draws regressed out). The build ise1f2eb6-based plus my local keyboard-input changes. The A/B only works in its diagnostics build there (asked_for!readsVICTORY_ABonly withdiagnosticsin that tree), so absolute frame times are a little higher than release. Series X, 1080p to 1440p, DLSS Performance, frame generation off, standing outdoors, ~8,500-9,000 draws.VICTORY_STORE_BESIDE=1VICTORY_COPY_BESIDE=1STORE_BESIDEwas active (copystat: 2.7M stores beside the guards, 107k not understood, 44.6k blocks opened for too many). On this machine it points the same way as yours (−1.7 ms) and m335671's, with a smaller margin.COPY_BESIDEalone shows nothing here, as you found.FILL_TITLEreads its variable once in this tree, so I'll measure it with separate alternating runs.Measured and posted by Claude Code on behalf of the machine's owner.
@dyshay on GitHub · 2026-11-30 12:40 UTC · original
@burber thanks, these are big, especially
FILL_TITLEoutdoors. We hadn't measured the beside switches on our side. Queued on the 4090 + i9 on an outdoor save:VICTORY_AB=15,VICTORY_STORE_BESIDE,VICTORY_COPY_BESIDEfor 900 s, thenFILL_TITLEin alternating separate runs, since it's read once in this tree. Your overlap finding withPORT_GUARD(−1.42 alone, −0.29 with the beside switches on) is useful: if both hold on our side, the right default is probably the beside switches plusPORT_GUARD, measured together against the beside switches alone. I'll post the numbers.@nikitronick-crypto on GitHub · 2026-11-30 12:49 UTC · original · edited 2026-11-30 13:38 UTC
A synthesis of this thread, and four things it is not measuring (6-core + 12 GB card data)
I went back through every result posted here and in #3303, #2858, #2129 and #756, and re-read my own diagnostics logs against them (Ryzen 5 7500F 6c/12t, RTX 3080 Ti 12 GB, DDR5-4800,
41adb551andport-guardca21195b, Series X 1440p DLSS Balanced, FSR FG 2x). Short version:Everything below is from 5 s / 1 s log lines of my own runs unless a name is given. Standing-still runs are ~3 min from the same save at the same spot.
1. What the thread has established
VICTORY_LIGHT_REFRESH=0VICTORY_LIGHT_REFRESH=0VICTORY_PORT_GUARD=1VICTORY_PORT_GUARD=1VICTORY_PORT_GUARD=1guards()41adb551, card ~80 % busyf72cec77→41adb551(10 commits)VICTORY_GUARD_HOT=50WIDE_THREADS=2same fps)Making preparing slower costs the frame in full. Making it faster returns a fraction. So something else of about the same length runs beside it.
2. Why preparing savings do not reach the frame
(a) Preparing is wall time, and a third of it is not running. The diagnostics line
thread N submitted …: in them running X ms user + Y ms kernelgives the submitting thread's CPU time inside its submissions:41adb551, outdoors, ~9k draws41adb551+ spin, outdoors41adb551, standing still41adb551+ spin, standing stillport-guard, switch offport-guard, switch onPORT_GUARD removed 2.1 ms of blocked time and no CPU time, as designed. With it on, 15.7 ms a frame are still not running. The lines name 5.5 ms waiting for the submission lock and 2.5 ms for the card; the rest has no line. A "blocked, by cause" line for this thread would say what the next lock is.
(b) When the card is busy, the saving becomes a wait for the card. My three A/B pairs:
41adb551This is why I reported "waits halved, frame unchanged" for the spin. burber's reading was right that the spin did not argue against PORT_GUARD. The run was card-coupled and I had not seen it.
3. A 12 GB 30-series card is not "mostly idle"
The opening post's card figure (17-21 ms of a 50 ms frame) is a 4090. Here, standing still on
41adb551:2 pipelines: [compute 2561af9577c47289] / [compute cabb87599722e59a], in 0.4-0.6 lists a frame. So each time it runs it costs roughly 30-45 ms.The same spot under three translations of those programs:
port-guard, folding on (its default; frame figures from one run)41adb551(folding off, last resort on)port-guard,VICTORY_WAVE_FOLDED=0The last row is an upper bound, not a fix. With folding forced off, three compute programs are refused ("no wave32 lowering":
71883e40620a567a,6b82bc7d22016cb5,34992f2b65a789a5) and their draws are dropped, and the row is on a different base. I cannot tell from logs whether the pair got cheap or lost its input.I am not the first to hit it: Arian1192's settings in #3303 (3080 10 GB) already carry
VICTORY_LEAVE_OUT=…,2561af9577c47289,cabb87599722e59a.What follows from this:
41adb551(VICTORY_WAVE_WHY=1) and whether a cheaper exact form exists.41adb551(release, same save and spot, two runs ten minutes apart, onlyVICTORY_LEAVE_OUTdiffers):VICTORY_LEAVE_OUTTwo things I cannot explain yet. The pair cost 54-95 ms a frame in this default run against 18-19 ms the evening before on the same build and spot, so its cost depends on the scene's state (the title autosaves; time of day may differ). And with the pair left out the same spot has ~2,000 fewer draws, so the pair seems to feed a pass that draws. Playing with it left out straight after a default run, I saw no difference in shadows, lighting or characters, but I have no side-by-side captures, so treat the picture as unverified. In free play the two modes gave 14.7 fps (lowest 5 s line 5.6) by default and 17.7 fps (lowest 12.8) with the pair left out. A remote-desktop host was installed on the PC, with no client connected during the measured minutes of either run.
If you have an 8-12 GB card, the card-meter line for that pair in a house or interior scene would show whether this is general.
4. About half the frame does not scale with draws
Regressing the 5 s frame line on draws within a run (2.5k-14k draws, walking and driving):
cec481f4release, 24 min41adb551release41adb551release, second run41adb551diagnostics (three runs)The slope is about the same on three very different machines. The intercept is what differs, and at 7,000 draws it is half the frame or more. On this CPU the floor alone is 25-35 fps with nothing drawn.
From one diagnostics run, what the floor holds at zero draws (same regression; r in brackets):
lists reset in10.5-12 ms a frame in every run, whatever the scene (~230 host lists).Items 4 and 6 of the plan work on the slope. The floor looks tied to the frame's fixed structure: ~240 lists, ~20 submissions and ~45 preparings a frame, each with its own asking, flush and heap records. A census per submission and per list, next to the per-class one, would say which part of it is ours to cut.
5. Across machines: not core count
Indicative only, since scenes differ:
A 6-core Zen 4 is ahead of a 12-core Zen 3. That fits a serial chain bound by per-thread speed and memory latency, which is what Arian1192 concluded in #3303. RAM speed evidence is mixed: UlisesVoxer saw 179 → 122 ms from DDR4-2133 to 3200 on his tree, Arian1192 saw nothing from 2666 to 3200 on another fork.
6. Two smaller things
remap_maskleaves bits past the host's processors as they are. The title asks for 0-7, 8-12, 13, 8-13 and 0-13 (burber's and autogenes-sudo's dumps), so on a 12-thread host every mask but 0-7 names a processor that does not exist. Windows refuses a mask that names a processor the system does not have (error 87), so those threads run unpinned while the eight workers stay pinned to 0-7. I have not measured whether that helps or hurts.VICTORY_TITLE_AFFINITY=freeagainst the default is the test, and a log line whenSetThreadGroupAffinityfails would show it.Sleep(0).What I would do next, in order
2561af9577c47289/cabb87599722e59apair on 30-series and 12 GB cards.I can run any of these on this machine. Logs are available with the user path removed.
Runs and numbers are from my own PC; the logs were read and this was written with an AI assistant (Claude).
@meonline42 on GitHub · 2026-11-30 13:25 UTC · original
VICTORY_FILL_TITLE=1on the 5900X + RTX 3090, the samee1f2eb6-based release build. It reads its variable once in this tree, so these are separate runs: off/on alternating, 4 rounds, 240 s each, the same save restored before every run, frame generation off. Medians of the 5 s host lines; p95, 10% low and "frames over 100 ms" from the per-second lines.Draws were comparable within each pair (6.3-7.1k) except round 2's "on" (10.8k). The median frame doesn't move outside the draws noise (61-67 ms both ways), but copying back drops ~4 ms in every round and the tail halves, consistent with your −1.56 ms outdoors. The fourth "on" run hit the
+0x2215c35hang watchdog while loading. That build does that occasionally on a start with the switch off too, so I'm not counting it against the switch.Together with
STORE_BESIDE(above) that's two opt-in switches with a measurable gain on this CPU-bound Zen 3.Measured and posted by Claude Code on behalf of the machine's owner.
@burber on GitHub · 2026-11-30 13:30 UTC · original
Where the frame goes once the switches that help are on (i5-13600K + RTX 4070 Ti, outdoors, ~11k draws, current code with
STORE_BESIDE,COPY_BESIDE,FILL_TITLE,TABLE_SAME,SETTLE_UNLOCKED,PORT_GUARD; ~45 ms a frame, ~22 fps). From the same 60 s, 1 ms profile as my comment above:victory-submitis busy for practically the whole frame. It's the limit.victory-list-*recording threads spend about half their samples idle inlist::thin::start. More or faster recording won't move the frame here.wide_each_scoped~12%,watch::ask_run~6%,card_steps::does_of~3.5%, the guards' lock ~3%.The refresh is a fork-join (
wide_each_scoped): the submitting thread hands out chunks, works some itself, then waits for the rest. So moving its share to the helpers saves nothing; the refresh stays on the frame's critical path either way. Getting from ~22 to 30 fps here would need about 12 ms off that thread, and I don't see a local fix that does it. The structural options I can see:ExecuteCommandLists, residency and recording calls.SUBMIT_SPLITmoved most of the sending (-0.49 ms here), but the residency and other driver calls are still on the submitting thread.I can test either on this PC if someone has a branch.
Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@m335671 on GitHub · 2026-11-30 13:37 UTC · original
A small data point on the GPU side, in case someone weighs porting it: foxhound's
VICTORY_HOST_FLOAT(readmet3xt-lab/foxhound03ab739) and its water tile-light fix (85b56b9), cherry-picked onto829188e. These are observations from one machine (RTX 4070 12 GB / Ryzen 9 7900) and two scenes, not a general conclusion. AI-assisted (Claude Code).What they do.
HOST_FLOATwrites the console's max/min/med3 and the legacy multiply (0 times anything is 0) as NVIDIA's own instructions instead of 4-7 spelled-out operations each. foxhound's GPU test (host_forms_give_what_the_spelled_out_ones_give) passes on this card too. The water fix lights the transmission tiles that 32-lane waves left dark. Both are on by default in that exe. Three small conflicts (vendor helper,set_host_nvidiaexport, the water module next tomesh_link), nothing in the logic.Setup: release build, Series X, 1440p output, frame generation off, the same switches in every run. Scene A of the protocol (the opening cutscene and the first room, unattended, 240 s). Order ref, ported, ported, ref, each exe warmed first. Averages of the 5 s lines with more than 500 draws; card time is the card meter's median for the title's lists.
829188e(*) The first ported run was still translating shaders, so only its card time is counted.
What we saw:
a host command list did not close (0x80070057), the same error as in #2639, which the unported builds also hit. One case says nothing either way.So
HOST_FLOATlooks safe and slightly helpful here, and it is likely to matter most where the card is the limit (light-heavy night scenes, near the memory budget). A test in such a scene would say more.@burber on GitHub · 2026-11-30 13:49 UTC · original
A correction to my last comment, after @nikitronick-crypto's synthesis. I wrote that
victory-submit"is busy for practically the whole frame". My profiler samples a thread's stack whether it is running or blocked, so that count was occupancy, not CPU. The same profile also logs each thread's processor time:victory-submitused 37.8 s of CPU over the 60 s window, about 63 %. That's inside your 59-72 %. So the submitting thread is on the frame's path the whole time, but blocked for over a third of it, and the shares I gave (driver ~19 %, own refresh chunks ~12 %, …) include the time spent blocked under those calls. The recording threads used ~52 % each.That changes the order of my two suggestions. Finding what the submitting thread is blocked on (your 2a) comes before moving its CPU work elsewhere. Both of the ideas I gave would have taken CPU work off the thread, and that's only part of the gap.
On your 2a, what it's blocked on, from the same profile (no new run): 47 % of the submitting thread's samples have a system DLL at the top of the stack. Grouped by the first layer function under it:
shadow::wide_each_scopeditself, ~12 %: the refresh fork-join waiting for the helpers' last chunks after its own are done. That's the biggest single wait, ~5 ms a frame.card_steps::does_ofgrowing its step vectors (sizing them up front gave nothing measurable, see above), thenwatch::writes.watch::ask_run, ~6 %: the write-watch kernel calls. That's mostly CPU in the kernel, not blocking.Host::submit~3 %,watch::guards(the lock) ~2 %, residency ~1.6 %.Kernel time counts as CPU in the 63 %, so these shares mix real blocking with kernel work. The fork-join wait is the one that's clearly blocking. Whether its tail comes from wake-up latency, uneven chunks or helpers being preempted by the title's threads, I can't tell from samples.
Most of that wait is under
Host::submit's refresh fork-join (~7 % of the thread), where chunks are one refresh each, so a large refresh taken last could hold everyone. I tried a local switch,VICTORY_REFRESH_BIG_FIRST, that sorts a flush's refreshes largest first before handing them out. On current code with the switch set plusPORT_GUARD, outdoors, 900 s,VICTORY_AB=15, 54 pairs: −0.21 ± 0.07 ms. It's real but tiny, so the tail isn't mostly one big refresh landing late. I'm not pursuing it. No crash in the run.FILL_TITLEon a third machine (@meonline42's 5900X + 3090): copying back fell ~4 ms in every round, and frames over 100 ms halved. On @dyshay's 4090 it's queued.Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@nikitronick-crypto on GitHub · 2026-11-30 13:52 UTC · original
@burber thanks for checking it against the profile's CPU times. One data point on which of your three causes it might be, from the 6-core side: here the process keeps 9.4-9.7 of 12 logical processors busy in CPU-bound runs, and the blocked share of the submitting thread grows with load: 41 % outdoors at ~9k draws against 28-37 % standing still indoors (same diagnostics line as in my 2a table). That fits helpers not finding a free processor at the join better than uneven chunks, at least on a machine with no spare cores. On your 20 threads it may be a different mix. If a branch or switch comes out of this I can run it here the same way.
Written with an AI assistant (Claude); the numbers are from my own logs.
@dyshay on GitHub · 2026-11-30 14:23 UTC · original
Results on our side (RTX 4090 + i9-13900KF, our fork's main = trustno1 main +
PORT_GUARDdefault, Series S + hardware RT, 15 s in-run phases, draws regressed out):STORE_BESIDE+COPY_BESIDE(AB of both)STORE_BESIDE−1.67 ± 0.52; both −1.56 ± 0.53 (COPY_BESIDEadds nothing)STORE_BESIDESTORE_BESIDEFILL_TITLE(read once: 2 off/on pairs, 300 s, same save)So
STORE_BESIDEstacks withPORT_GUARDon this machine (unlike burber's overlap), and we've made it the default in our fork.FILL_TITLEdoesn't help here. @meonline42's tail halving is interesting, but on this CPU it costs ~2-3 ms of preparing. Thanks @burber for surfacing them.@Damix49 on GitHub · 2026-11-30 14:55 UTC · original
Data point from a mid-range PC: Ryzen 9 5900X + RTX 3070 Ti (8 GB) + 32 GB DDR4-3600 CL20
Build:
mainat41adb551, release +diagbuilds. Windows 11, driver 617.42. Series S profile (1280×720), DLSS Quality, preset K, prison room, standing still.Where a frame goes (diag build, ~95 ms frame, ~6,300 draws):
Switches tried one per run (release build, same spot; CPU "preparing" time per frame):
VICTORY_ASK_EARLY=2: ~113 ms (clearly worse on this CPU)VICTORY_SUBMIT_FRAMES=2: ~58 ms (no change; fps lower from longer GPU waits)VICTORY_LAND_SKIP=1: ~60 ms (no change)VICTORY_JOIN_PARTS8 vs 1: no measurable difference.The card's load varied between runs (56% to 92% busy) at similar draw counts, so whole-run fps was too noisy to compare. The CPU numbers above were stable.
Memory pressure with 32 GB matters as much as the CPU here. Without a cap, the process takes ~22-25 GB and the card ~7.7 GB dedicated plus 6-9 GB shared, leaving ~0.5 GB of RAM free, with GPU waits of 60-137 ms per frame. With
VICTORY_VRAM_BUDGET_MB=6000, GPU waits drop to 0-23 ms (p90 under ~17 ms) and fps goes from 5-15 to 12-18 in comparable scenes, frame generation (FSR 3, 2x) included. Two side notes:-Moreonplay-nvidia.ps1doesn't survive "save and restart" from F1. Putting the switch invictory-settings.txtdoes.Happy to run a specific build or A/B on this machine if a mid-range data point helps (PR #3760, for example).
@meonline42 on GitHub · 2026-11-30 17:00 UTC · original
A frame-pacing regression on this CPU-bound 5900X + RTX 3090, from
e1f2eb6to current main (c71899d9). Both builds carry only my local keyboard-input changes (victory-hle). Same separate test install, same restored save, frame generation off, 240 s runs, ~6,100-6,600 draws. Thee1f2eb6-based runs used the older launcher's switches; the new ones as listed:e1f2eb6-basedc71899d9,play-foxhound.ps1defaultsc71899d9+ play.rs's 2026-11-30 bench setc71899d9+ that set + step 1 (SUBMIT_FRAMES=2etc.)c71899d9with exactly the older switch setSo it's in the code, not the switches. The submitting thread does the same or less work than before, but the title waits ~20-25 ms longer per frame at presents, and the card is less busy (44-47 % against 52-57 %). Step 1 takes the present wait to zero, but the frame stays at ~68 ms, so the time moves elsewhere. Something now paces the title from outside the submit path (the card's clock line says "the rest outside marked submit work": ~21 ms of 33.6 ms idle).
Not bisected. The
829188ecombine already showed it here as a worse tail, so it's somewhere ine1f2eb6..829188eor later. If someone has a candidate that touches presents, frame waits or the title's pacing, I can A/B it here. For reference: the+0x2215c35hang watchdog fired on the older build's first start after each newer-build run (expected, the pipelines are made again), so I separated the builds' runs.Measured and posted by Claude Code on behalf of the machine's owner.
@dyshay on GitHub · 2026-11-30 17:39 UTC · original
@meonline42 we see the same regression on
c71899d9, worse on our side (RTX 4090 + i9, 32 GB RAM, our merge ofc71899d9): Series S + HW RT went from 33.9 ms to frames of 0.6-6.6 s, Series X from 38 to 57 ms with a p95 of 292 ms. In our logs the frame waits 3-3.5 s for compute pipelines (31 times in 5 min, never on the older base), the host pipeline library is 4.0 GB after one full warm (88k pipelines) and is mapped whole, andpipeline library: slow load ... ms=7990 ... loaded=falserepeats under memory pressure (physical free 609 MiB). Your "title waited at presents" jump may be the same thing, seen through the pacing. We're bisecting the pipeline/library changes between the two and will post what we find.@meonline42 on GitHub · 2026-11-30 17:57 UTC · original
@dyshay I checked my logs for that. No
slow loadlines and no 3 s compute-pipeline waits here (64 GB RAM; the library loads 0.8 GB on the old base, 1.0 GB onc71899d9, mapped). But the warnings differ between the two builds in a way that may matter:e1f2eb6-based: 29×a pipeline creation method that is not implemented: the title goes without this pipelineper run (16 + 13 at two slot addresses).c71899d9-based: none of those. Instead severala pipeline made from loose parts method="DeserializeComputePipelineStateX", and 10×host pipeline not made: D3D12 returned E_OUTOFMEMORY; it is tried again … ms later, its draws are dropped until thenin one 240 s run.So on the old base the title runs without some compute pipelines, which the newer build makes and runs. Part of the frame-time difference I posted may be real work the old build skipped, not only pacing. The
E_OUTOFMEMORYretries fit your memory-pressure reading. It's a 24 GB card with 64 GB RAM, so I'd guess pipeline-creation memory rather than VRAM, but I haven't checked. If there's a switch to turn the loose-parts compute pipelines off again, an A/B with it would separate the two.Posted by Claude Code on behalf of the machine's owner.
@Damix49 on GitHub · 2026-11-30 18:50 UTC · original
Same pattern on a second 5900X: Ryzen 9 5900X + RTX 3070 Ti (8 GB) + 32 GB DDR4-3600, Windows 11, driver 617.42.
All builds from source on the same machine and settings: Series S 1280×720, DLSS Quality with preset K, FSR 3 frame generation 2x,
VICTORY_VRAM_BUDGET_MB=6000, launched withscripts\play-nvidia.ps1. The same save, mixed scenes of ~3,400-9,000 draws. These are play sessions, not controlled 240 s runs, so treat the fps figures as rough.e1f2eb6(28/11)41adb551(29/11)c71899d9(30/11)84bd61e2(30/11)-Preloadand-WarmUsedOn 32 GB the memory growth matters as much as the pacing. With the newer builds, RAM runs out and textures stop fitting. That fits @dyshay's reading: the 4 GB library is mapped whole. On
e1f2eb6the preload's full warm (~88k pipelines, 42 min once) leaves a ~576 MB library, and the run stays at ~21 GB.Like @meonline42, I see 29×
a pipeline creation method that is not implementedone1f2eb6, so part of its speed may be skipped work. I haven't spotted a missing effect in play yet, though.Staying on
e1f2eb6for now, and happy to A/B a candidate fix on this 32 GB machine.@dyshay on GitHub · 2026-11-30 19:18 UTC · original
Cause found for the
c71899d9regression on our side, and it may be what others see too: since38671a8b,victory shaders/warm/preloadcallplay::apply_defaults(), which fills every unset variable withvictory play's defaults, including the switches that are part of the shader translation key (VICTORY_BVH_MISS=1,VICTORY_NAN_SCRUB=1,VICTORY_SAMPLED_MARKS=1). A launcher that starts the game withvictory runwithout those switches (e.g.play-foxhound.ps1) gets a game whose translation key differs from the preload's: we loggedfixed=84859d46…in every warm process vsfixed=9ed7de37…in the game. So the preload fills the shader cache and the pipeline library under names the game never asks for. In our first run after a 47-minute full preload, the game found 0 of 214 translations and compiled 645 pipelines while playing, with 3 s waits per frame. On a 32 GB PC, compiles were throttled under memory pressure, which turned it into seconds-long frames.Our fix (main3 3126bff1):
apply_defaults()does nothing when a launcher has already setVICTORY_MENU_FILE(play'sprepare, play-foxhound.ps1, F1 restarts); a barevictory preloadkeeps the defaults. Test included. We'll confirm on the card and can open a PR if that's the right place for it. @meonline42 if your launcher also usesvictory runwith its own switch set, checking for ashader translations keyedmismatch (or cache misses right after a preload) would tell whether you hit the same thing.@davemathews12 on GitHub · 2026-11-30 19:42 UTC · original
@dyshay I read
port-guard(ca21195b, thewatch.rspart) for the two things that would bite in a lock split like this, and both hold:guard()runsplanned.make()before it returnswritten, and the caller copies only after that. So a write in the window between the two is in the copy. Other askers see claimed blocks as written (unsettled()includesBUSY), so nobody skips a copy on the strength of a protection that isn't in place yet.try_locksGUARDS(inmake()), never waits on it. Lock holders wait for claims while runningapply_fixes, and faults give up a claim wait after 200 µs and take the locked path. So there's no cycle between the lock and the claims.With the −2.7 ms frame / −7.2 ms preparing A/B on the 4090 and the switch off by default, it looks ready to open as a PR against main, to me at least. A run on a 6-core (where the waits were 124 ms a frame) would make the case.
@nikitronick-crypto on GitHub · 2026-11-30 19:45 UTC · original
Copy-back on a 6-core / 12 GB machine: who reads what lands, and a negative result for leaving it on the card
Ryzen 5 7500F (6c/12t), RTX 3080 Ti 12 GB, 32 GB DDR5-4800, v2026.11.30.01 (
c71899d9) release,Series X 1440p DLSS Balanced. Outdoors, walking, running and driving, 8,500-12,500 draws.
1. The census (
VICTORY_LAND_READS=1), 3.5 min, 174 linesAbout 600 pages a frame are made no-access. Who touches them first:
First touches come 0.5 frames after the landing. 63-64 % of the watched pages lie in MiB the title
never touched (two runs). So #2960's "the title almost never reads it" holds in motion too.
2. Which code of ours reads (local patch: the fault's stack, resolved with the PDB)
719,171 first touches by our code in a second run, 45 distinct stacks:
Shadow::update_free>copy_stale/take_all>take_landed(shadow.rs:7592) >host::copy_mappedtake_landed's not-noted branch >Shadow::copylandhelper >merge_page_under_writes>host::read_intoHost::submit>stale_under_flights>stale_of>merge_under_writesSo three quarters of the reads of landed pages are the landing's own echo check (
VICTORY_LAND_ECHO):the write watch cannot tell the landing's write from the title's, so the next refresh reads the page
back to find it is what it already holds.
3. The ranges are the same from run to run, at different high bits
Two censuses named the same MiB in the same order: 0x1_89b00000 / 0xd_89b00000,
0x1_8d300000 / 0xd_8d300000, 0x1_91d00000 / 0xd_91d00000, and so on. Only the bits above the low 32
differ. That is why a
VICTORY_LAND_LEAVEfile from one run does not carry to the next.4. Leaving them on the card: works, picture fine, no frame gain
Local patch:
leavematches ranges by their low 32 bits, read from a file, no census in the run.16 ranges, 19 MB, the MiB the title never touched.
A third fewer pieces landed, and neither "copying back" nor the frame moved. The run with it had more
driving, so I do not read 65 against 57-59 as a loss, only as no gain. Nothing wrong seen in the
picture in about four minutes of play in one area (faces, hair, lights), which is a short check.
Reading: on this machine the relay thread's time is mostly waiting for the card, not merging, and it
runs beside the submitting thread, which stays at ~43 ms preparing (copies 25 ms, 60-70 MB a frame).
Item 1 of the plan (keep GPU-only memory on the card) would not pay here through copy-back; the
refreshes on the submitting thread are where the frame is.
5. Two side findings
VICTORY_LAND_READS,copies stay at 86-92 MB and 52-59 ms a frame, against 60-68 MB and 19-27 ms in ten runs without,
including the minutes after watching ended (0 pages watched, frame ~100 ms against ~63). I have
not found why. Frame times of a run that had a census say nothing, as the module's own doc warns,
and that seems to hold after it ends too.
refreshes 16.4 ms for 9,212 against 10.4 ms for 9,716; copies and fills 6.1 against 2.3 ms;
fetches of card pieces 6-7 against 2.4 ms; write-watch asks 4.5-5.1 against 3.3 ms.
The three local patches (stacks in the census, a census that ends itself with an echo mark in
take_landed, ranges by low 32 bits) are small and I can post them if useful.Runs and numbers are from my own PC; the logs were read, the patches written and this was written
with an AI assistant (Claude).
@dyshay on GitHub · 2026-11-30 20:39 UTC · original
@davemathews12 thank you for reading it that closely. That's the reasoning behind the split: the block is in the copy before
writtenreturns, claimed blocks read as written, and claimants onlytry_lock. It's good to have it checked by someone else.@MrDenn on GitHub · 2026-11-30 23:26 UTC · original
Copy-back with hardware RT on: the census and a leave list pay on the CPU side (RTX 5080, 16 GB)
A follow-up to @nikitronick-crypto's copy-back census without RT. With
VICTORY_HW_RT=1the picture is different: copy-back is several times larger, the leave list carries from run to run on this machine, and it takes real time off the submitting thread. Two ranges also showed that the census can miss readers.Setup: RTX 5080 16 GB (driver 621.40), Ryzen 7 9700X (8c/16t), 32 GB DDR5-6400, Windows 11 24H2, v2026.11.30.03 release (
e1251c31). Series X, native 1440p, DLSS Performance (preset K), no frame cap, frame generation off, water light on,VICTORY_RELAY=2. Numbers are per-frame averages over gameplay seconds only (seconds above 60 fps are left out as menus and loading).1. Hardware RT multiplies copy-back
Same build and settings, RT off vs
VICTORY_HW_RT=1:The card is idle about 25 ms of each RT frame. A landing finishes before the title is told the work is done, so with RT on, copy-back sits squarely in the frame's dependency chain.
2. The census with RT on (
VICTORY_LAND_READS=1,VICTORY_LAND_BESIDE=0, ~12 min, walking and driving)3. The ranges did not move between launches here
Unlike your runs, where the high bits shifted, the addresses were identical on this machine in every launch I checked, high bits included. The same large buffers appear at the same addresses with the same sizes in three logs (
large buffer copied to the host):0xe305e0000(50 MB),0xe5e820000(24 MB),0xe67b60000(36 MB). A list built from one census engaged unchanged in three later launches, leaving 40–60 MB a frame on the card. I can't say what differs between our setups; mine has 16 GB of VRAM and a 32 GB fixed page file.4. Leaving them on the card (
VICTORY_LAND_LEAVE, 14 ranges, 128 MB, all in0xd…/0xe…graphics memory)Fps rose in light scenes: under 6k draws, 16.9 fps before the list against 19.5–21.4 with it. Heavy scenes (9k+ draws) stayed at ~14.3 fps. These are single runs on different routes, so read the fps as indicative. The CPU-side numbers moved far more than the run-to-run spread.
The drop in what is sent up fits your stack finding: most first touches are our echo check reading back what was just landed. When a range isn't landed, it isn't echoed back up either.
5. A warning: two ranges the census called untouched broke shadows
Adding the two ranges in low title memory,
0x3300000+0x400000and0x7700000+0x200000(next to0x6400000,0x6500000and0x7600000, which the title did write), gave dark spots and flickering in shadows at one place (indoors, the player's house). In one run it lasted about a minute; in another it lasted the whole run, though that run also had other test changes. It gained almost nothing (fetched 39 → 34 MB). So 12 minutes of census without a touch is not proof that nothing reads a range. Any automatic version probably needs to keep a fallback for ranges that turn out to be read rarely (what #4527 does with faults).Takeaway
Without RT, Item 1 may not pay through copy-back, as you found. With hardware RT on it does on the CPU side: about −56 MB fetched, −9 ms landing and −12 ms on the submitting thread per frame here. Frame-rate gains are limited to lighter scenes, because the rest of the chain then sets the pace. I'm happy to run builds or switches on this machine with RT on.
Runs and numbers are from my own PC. The logs were read and this was written with an AI assistant (Claude).
@dyshay on GitHub · 2026-11-30 23:39 UTC · original
Thanks @MrDenn, this matches what we see on a 4090 (Series S, hardware RT on, 10 min outdoors, per 64 KiB block): the title reads back almost nothing the card wrote (7 blocks out of ~300,000 mapped are read by the title after a card write), while most landed pages are read first by our own code. So with RT on, most of the copy-back is our echo check, as you found.
Your point 5 is the important one: a census window is not proof. Two consequences we are taking:
Your stable addresses vs. shifted ones elsewhere also argue for keying the list on what was allocated there (size, kind, order) rather than on raw addresses.
@m335671 on GitHub · 2026-11-30 23:42 UTC · original
On the pacing regression @meonline42, @dyshay and @Damix49 reported: one more data point, where it did not show. These are observations from one machine (RTX 4070 12 GB / Ryzen 9 7900, 12 cores, 31 GB RAM) and one scene, not a general conclusion. AI-assisted (Claude Code).
Setup: release builds of
829188eand of main ate1251c31(unmodified), Series X, 1440p output, frame generation off. Both started withvictory runand exactly the same switches, including the three shader-key ones that main'swarmnow fills in from play's defaults (BVH_MISS=1,NAN_SCRUB=1,SAMPLED_MARKS=1), so warm and run used the same translation key on both sides (the mismatch @dyshay found). None of play's other new defaults (CARD_ALL,UAV_FOLD, ...) were set. Each build was warmed first. Scene A of the protocol (the opening cutscene and the first room, unattended, 240 s, ~4,000-4,300 draws). Order:829188e, main, main,829188e. Averages of the 5 s lines with more than 500 draws; card time is the card meter's median for the title's lists.829188ee1251c31What we saw:
DeserializeComputePipelineStateXlines per run. NoE_OUTOFMEMORY, noslow load, no 3 s pipeline waits, no stops.So on this CPU, with the translation key matched by hand, the code between the two looks like a gain. That fits @dyshay's reading (cache misses after a mismatched preload, then compiles under memory pressure) better than a regression in the submit path itself, at least for a 12-core machine with headroom. It doesn't rule out what @meonline42 saw on the 5900X with matched switches.
(The
829188enumbers are lower than in my earlier comments because the three shader-key switches are now on for it too.)@davemathews12 on GitHub · 2026-12-01 02:15 UTC · original
@MrDenn On the two ranges that flickered (0x3300000+0x400000, 0x7700000+0x200000): a guess worth one run. The census counts the title's writes, but DirectStorage and kernel reads fill pages through the runtime's own views, and those arrive through
title_memory_written(.., pages = true)(xmem.rspages_written), not as title writes or faults. A range can read as "untouched" while streaming refills it, and a left range then keeps its old bytes on the card, which would look like dark spots in indoor shadows.If your census can also count
title_memory_writtencalls per range (or log the rangespages_writtennames), those two should show up there and the other 12 shouldn't. If so, an automatic rule looks safe: leave a range only after N seconds with no title write and no runtime page write, and watch it again at the first of either. That keeps your 52 → 40 ms submit / 95 → 39 MB result without a hand-made list. Happy to write it if the numbers agree; could you share the switch or commit your leave list used?@burber on GitHub · 2026-12-01 02:33 UTC · original
Two prototypes on the copy model, measured on an i5-13600K + RTX 4070 Ti (outdoors, ~11.5k draws, ~48 ms frames), on dyshay's
port-guard(ca21195b) with the five switches from above. Both opt-in; diff available on request.1. Cold blocks for write-watched memory (
VICTORY_GUARD_WATCHED=1). A 64 KiB block of write-watched title memory found unwritten for 8 frames is made read-only and called cold: the kernel is no longer asked about it, the journal answers for it, and the first write faults, gives the access back and ends the cold (the write watch, still on, has the write). Order: armed (read-only) → asked once more (catches a write between the last asking and the protection) → cold, under one small lock shared with the fault handler. Kernel writes (kernel_writing/writing) open cold blocks first and keep their destinations out of the cold; the title's ownVirtualProtectand everytitle_memory_*change take blocks out.title_memory_remapping_of's ranges are wide and fire constantly while streaming (scanning them bit by bit hung the load; clearing state from them wiped every cold block each frame), and a saturatedfreadlength reacheswriting.2. What the refresh time is, on this machine. With cold blocks on, kernel asking is ~2% of refresh samples. Helpers wake fast (mean 22 µs after posting, 96% within 50 µs, none too late for a chunk), but the submitting thread waits ~5.5 ms a frame for the last chunk of ~10 of its ~74 fork-joins. Nearly all of those are one copy: the title's 174 MB heap (the constants ring,
port.rs), refreshed ~33 times a frame, most in 0.2 ms, a few in 3-20 ms (guard-lock contention, cut by the ranges shaders write). Splitting its refreshes into 8 MB slices made it worse (the slices contend on the same locks). Of the ~50 MB refreshes copy a frame, ~28 MB is that heap; only ~1.7 MB a frame would qualify for a tapin-style DMA refresh (it refuses copies shaders write, and that heap is one). The heap's writes over 3,400 frames: 681 pages (~43 MB) take nearly all of them (each in 10-90% of frames), 3,504 pages under 1%.3. The card pulling that heap (
VICTORY_HEAP_PULL, a prototype: not ready). The heap's pages found written are not copied on the CPU: the card's sync list copies them from buffers placed over views of ours of the same section, one per stretch (the title maps the heap as several views out of order, so one heap of it is refused as "Scattered"). Ranges shaders write are never pulled; our own CPU writes into the heap wait for a fence behind the list; the CPU side is marked stale where pulled and sent whole when used again.Also: VIctory-NVIDIA main
7d93ee07runs at 0.1-1.6 fps in this harness after a warm-up run (pipeline waits), the same regression reported above, so I measured on the older base.Measured and written with an AI assistant (Claude Code); the runs were on my PC.
@dyshay on GitHub · 2026-12-01 02:39 UTC · original
@burber On the 0.1-1.6 fps of main after a warm-up: that is very likely the translation-key mismatch from above, not your prototypes. Since
38671a8b,warmfills in play's defaults (BVH_MISS,NAN_SCRUB,SAMPLED_MARKS), which are part of the shader key. A title started withvictory runwithout them looks up different keys, misses the whole warmed cache and compiles under memory pressure. Setting those three on the run side (as @m335671 did) should give you a usable main; @m335671 then measured main faster than829188e.On (3), for what it's worth: you found the title maps that heap as several views out of order, and our 4090 census found 2 to 12 views per physical page in the title's pools, with blocks flipping between card-written and CPU-written about 20,000 times in 10 minutes. That is why we would keep a CPU-side copy of the changed slices per submission for such ranges rather than a card pull from opened views: it does not depend on which view the title writes through, or on when.
@m335671 on GitHub · 2026-12-01 03:59 UTC · original
Follow-up to my previous comment: the open CPU-wall pull requests, each merged alone onto main
e1251c31, on the same PC and scene. These are observations from one machine (RTX 4070 12 GB / Ryzen 9 7900, 12 cores, 31 GB RAM) and one scene, not a verdict on any PR. AI-assisted (Claude Code).Setup: same as before (Series X, 1440p, frame generation off,
BVH_MISS/NAN_SCRUB/SAMPLED_MARKS/EARLY_DEPTHset by hand on warm and run). Each PR merged cleanly ontoe1251c31and built in release. Opt-in switches were set where a PR has one: #4490SUBMIT_PIPE=1, #4559SWEEP_OFF_THREAD=1(their log lines show up, so they were active); #3760 is on by default; #4489 and #4533 have no switch. "all" is #4490 + #4489 + #3760 + #4559 together (#4533 conflicts with that set inwatch.rs). Each exe warmed once, then scene A (240 s, ~4,000-4,200 draws), three rounds: forward, reverse, forward.e1251c31What we saw:
did not close, noE_OUTOFMEMORY, no device removed in any of the 21 runs. Oneslow loadline in each first-round run (the first run after a warm), none after.Separately, for #4081: three runs (scene A, boat, scene A, 300 s) of a diagnostics build of
e1251c31withUAV_FOLD=1and the D3D12 debug layer on did not reproduce the close failure here, and the debug layer printed nothing. Our scenes are unattended and stop before free roam, so this doesn't say much against the reports there.@upipibi on GitHub · 2026-12-01 04:18 UTC · original
@burber on your structural option 1 (refresh submission N+1 on the helpers while N is recorded and sent): I read the code for it, and it doesn't fit as it stands. Code reading only,
main5fabb46e; no runs.Why. A refresh writes the copy's CPU side, and there is one per host copy, not one per submission.
Host::submitholds the submission lock "from preparation to copy-back: snapshots and the ranges shaders write are per host copy, not per submission" (host.rs:10114). N reads those CPU sides until itscard_take/publish: its snapshots, the bytes it sends, and the ranges its steps declare written. Only then are they "taken, so the next one's refreshes of those CPU sides do not reach it" (host.rs:5281-5283). So N+1's refresh can start only after N's take, unless every CPU side is kept twice. The overlap that is legal now, N+1's preparation beside N's sending, is whatSUBMIT_SPLITalready does.The early-capture rule itself would be fine. N+1's own asking at submit stamps a later write with a later asking number, and that page is copied again (
shadow.rs:7408-7411). It's the shared CPU sides, plus the single global asking stand (kept) and the singlewide_each_scopedslot, that block it.What's left of the idea is the wait at the end of the fork-join, the ~5 ms a frame in your profile. No counter splits the submitting thread's own chunks from its wait at the join (
shadow.rs:3026-3037). The per-thread "a copy's refresh" spans ofVICTORY_TIMELINE=<file>are the nearest thing. Those spans would show whether the tail is helpers starting late (woken late, or preempted by the title's threads) or one long chunk. Your largest-first test points away from the second.Read with the help of Claude Code (Claude Opus 5.5).
@CuteBooty on GitHub · 2026-12-01 05:03 UTC · original
A data point on the floor of the CPU wall, from a mid-range PC. Ryzen 7 5800X3D (8 cores), RTX 3070 8 GB, 32 GB RAM, Windows 11. v2026.11.30.01 + #4582, Series S, DLSS Performance, DLSS frame generation x2, upstream's play settings. Medians of 5 s windows from the diagnostics build's counters, during normal play of a campaign mission (not a fixed scene).
VICTORY_TEXTURE_HASH_EVERY=64+VICTORY_TEXTURE_TURN_SPREAD=1) and #4295, on the same build, in one 6-minute standing check: refreshes 15.7 → 12.9 ms and in submissions 38.4 → 33.4 ms at 5-9k draws, but the thread stayed at ~54 ms and the frame at ~55 ms. Short, one run, not like-for-like.@meonline42 on GitHub · 2026-12-01 09:36 UTC · original
@m335671 @dyshay On whether the 5900X slowdown was the translation-key mismatch: re-run with the three keys matched by hand, and it still reproduces here.
Setup: Ryzen 9 5900X (12 cores, XMP 3200), RTX 3090, Series X,
-Res 1080to1440 -Dlss performance, no frame generation. Same testbed install, same fixed save restored before every run, 240 s measured per run, each build warmed once first (warm run not counted).7d93ee07with the launcher defaults plusBVH_MISS=1,NAN_SCRUB=1,SAMPLED_MARKS=1(all three confirmed in the run's switch list)e1f2eb6+ mouse/keyboard), its own launcher defaultspipeline failures: 0 ... untranslated=0, nothing "being made".So on this 5900X the matched keys don't close the gap, unlike on @m335671's 7900. The halved helper share stands out to me, but I haven't narrowed it to a commit. Logs are available on request.
Claude Code on behalf of the machine's owner
@dyshay on GitHub · 2026-12-01 09:40 UTC · original
@meonline42 Thanks, that rules the key mismatch out on your machine: so there is a second cause, at least on the 5900X.
Two things in your numbers point at memory rather than the submit path itself:
free RAMthe log prints, during a bad stretch would tell.The halved helper share (4,213 vs 7,947 flushes spread) fits that too, if helpers lose time to faults and the submitting thread then takes the chunks itself. The copy-back line (which
VICTORY_LAND_*defaults differ betweene1f2eb6and7d93ee07) is probably the quickest place to start a bisect. We have paused our own VIctory runs for now, so we can't bisect it on our side soon.@m335671 on GitHub · 2026-12-01 09:51 UTC · original
@meonline42 @dyshay Two counters from the same runs as my comment above (7900, scene A,
829188evs maine1251c31, keys matched), in case they help separate the two causes. Medians of the last three quarters of each 240 s run. Observations from one PC and one scene. AI-assisted (Claude Code).829188er1829188er2So neither change shows up on this PC with the same code, which leaves memory pressure as a plausible difference between the two machines and fits @dyshay's hard-fault reading. A run of this scene with less free RAM would test that, but I haven't done one.
@Damix49 on GitHub · 2026-12-01 10:14 UTC · original
@dyshay @meonline42 On the hard-fault question: I measured it on a 5900X with 32 GB. The other 5900X numbers above come from a 64 GB machine.
Setup: Ryzen 9 5900X, RTX 3070 Ti 8 GB, 32 GB DDR4-3600 (pagefile 16-48 GB on SSD), Windows 11, driver 617.42. Both builds from source, the same profile as @meonline42: Series X,
-Res 1080to1440, DLSS Performance, no frame generation, noVICTORY_VRAM_BUDGET_MB. Same save and spot, camera still, ~7 min each. I dropped the first quarter and any window with pipelines being made. A sampler loggedWin32_PerfFormattedData_PerfOS_Memoryonce a second (pages input/s, available MB, committed) plus the process's private bytes, and I matched them to the 5 s frame lines.main(5fabb46e)e1f2eb6main(44 vs 48 ms), the same as @meonline42 found. The extra frame time sits outside preparing, and copy-back is higher (17 vs 12.5 ms).mainthe process holds ~15 GB more and RAM bottoms out at ~0.1 GB. Hard page-ins are ~4x higher (median ~7.5 MB/s, peaks ~160 MB/s at 4 KiB a page).mainover 100 ms per frame, page-ins averaged ~4,500/s against ~2,650/s elsewhere, and the GPU wait jumped to ~77 ms against ~0.2 ms. A single window, so treat it as a hint.So on a 32 GB 5900X this fits the memory-pressure reading: same CPU work, much more paging, longer copy-back. These are 5 s windows, not per-frame times, so I can't count frames over 100 ms the way @meonline42 did. I can re-run with a per-frame counter or a different sampler if that helps.
@dyshay on GitHub · 2026-12-01 10:39 UTC · original
@Damix49 @m335671 Thanks, that settles the shape of it: same CPU work, +15 GB private on main, RAM down to ~0.1 GB, page-ins x4, and copy-back is what waits on them. On 64 GB (and on the 31 GB PC in a lighter scene) it doesn't show.
So the regression to bisect is the ~15 GB of extra private memory, not the submit path. The quickest split is probably by owner at a steady point, e.g. a VMMap snapshot of both builds at the same spot: host copies of title memory, the pipeline library and shader cache in memory, and staging/upload heaps are the usual candidates. Whichever one grew between
e1f2eb6and5fabb46enames the commit range.@davemathews12 on GitHub · 2026-12-01 12:39 UTC · original
@Damix49 @meonline42 @dyshay: the extra ~15 GB on main may be #4127's leak.
e1f2eb6and829188eare before97593f46(#2469);5fabb46eand7d93ee07contain it. Since #2469, a compute pipeline the driver refuses with E_OUTOFMEMORY is rebuilt about every 250 ms all run: nick0451 measured 1.6–1.9 GB/min on an RTX 3090 (610.88), and 617.x refuses too (#4631). If your main play log has "D3D12 returned E_OUTOFMEMORY", could you run #4695's branch (davemathews12:fix/driver-oom-retry-backoff) on the same route? It stopped the growth for nick0451 and YounesAH15.@meonline42 on GitHub · 2026-12-01 12:53 UTC · original
@davemathews12 Yes, that fits our runs. From the same main
7d93ee07logs as in my comment above (RTX 3090, driver 610.88, 64 GB):Each main run has
host pipeline not made: D3D12 returned E_OUTOFMEMORYforcompute 098fc28e44347a00(10 such lines per run).The process's private memory climbs steadily through each run:
procmemsamples (about 6 minutes)That is roughly 5 GB/min, more than nick0451's figure.
Our own build (
e1f2eb6merge, before #2469) has no E_OUTOFMEMORY line in the same scene.With 64 GB the PC doesn't run out of RAM within a 4-minute window. The growth would still explain the copy-back and the frames over 100 ms getting worse as a run goes on. I'll review #4695's branch and run it on the same route next. I'll report the numbers here.
Claude Code on behalf of the machine's owner
@Damix49 on GitHub · 2026-12-01 12:55 UTC · original
@davemathews12 Yes, the same here: the
mainrun from my paging comment above (5fabb46e, RTX 3070 Ti, driver 617.42, 32 GB).host pipeline not made: D3D12 returned E_OUTOFMEMORY; it is tried again 1000 ms later, forcompute 098fc28e44347a00(the same one @meonline42 sees) andcompute b3e7781d53ff8326.procmemlines: 10,243 → 39,373 MB in 7.3 min, about 4 GB/min. On 32 GB that runs the PC out of RAM within the run, which is where the page-ins and longer copy-backs I measured come from.e1f2eb6, same route and profile: noE_OUTOFMEMORYline, ~25 GB private at the end.297f58a), three runs: noE_OUTOFMEMORYline, ~19-20 GB private.I can run #4695's branch on the same route with the same once-a-second memory sampler and post the numbers.
@davemathews12 on GitHub · 2026-12-01 12:59 UTC · original
@Damix49 yes please, same route and sampler. Branch: davemathews12:fix/driver-oom-retry-backoff (head
38c4a9e5). With the default, the refused compute pipelines should log "not tried again this run" about 30 s in, and private memory should stay flat after that. @meonline42 thanks, same for your run.@Damix49 on GitHub · 2026-12-01 13:17 UTC · original
@davemathews12 #4695 on the 32 GB 5900X: the growth stops.
Branch
pr-4694=main5fabb46e+ #4695's head (38c4a9e5), merged with no conflicts, so the base is the same as mymainrun above. Same PC (RTX 3070 Ti, driver 617.42, 32 GB), same profile (Series X, 1080p to 1440p, DLSS Performance, no frame generation, no VRAM cap), the same once-a-second sampler, camera still.main5fabb46emain+ #4695E_OUTOFMEMORYlinesb3e7781d53ff8326,f7c4f227a2a4c4b2, one more)procmem)e1f2eb6(~25 GB) in my earlier run.mainrun. The memory figures don't depend on that.main~21,000,main+ #4695 ~15,100,e1f2eb6~5,700 in the same profile. So the texture queue staying full is a separate problem from the leak.@davemathews12 on GitHub · 2026-12-01 14:03 UTC · original
@Damix49 thanks, that's the proof for #4695. On the texture queue (~5,700 waiting on
e1f2eb6vs ~15,100 on main + #4695): four switches that decide texture room are new sincee1f2eb6and on by default. A cheap check, one at a time on the same main + #4695 build, route and sampler:times=counts the refusals).The median of textures waiting, and whether white/flat surfaces show, for each would say which one (if any) it is. A caveat on ROOM_REAL=0: it was added because past the budget the card's memory spills into system RAM and can TDR, so watch for device removal. Code reading only (resource.rs), I haven't run it.
@Damix49 on GitHub · 2026-12-01 15:08 UTC · original
@davemathews12
VICTORY_ROOM_REALdoesn't fire here: the "room for textures by what lies free in texture blocks alone" line appears in none of today's three logs (main,main+ #4695,e1f2eb6), so it isn't what keeps textures waiting on this PC.I'll run the other three now, four runs on the same
main+ #4695 build, the same route and profile, with the sampler: a baseline at a fixed spot, thenVICTORY_SMALL_WHEN_FULL=0,VICTORY_SLOT_EVICT_KEPT=0andVICTORY_SLOT_EVICT_ASIDE=0, one at a time. For each I'll post the median of textures waiting, memory, fps, whether white/flat surfaces show, and any device removal.@Damix49 on GitHub · 2026-12-01 15:42 UTC · original
@davemathews12 The four runs, all on
main5fabb46e+ #4695, on the same 32 GB 5900X (RTX 3070 Ti, 617.42), Series X 1080p to 1440p, DLSS Performance, no frame generation, no VRAM cap, camera still ~6 min each, the same sampler. One switch per run, the others at their defaults:VICTORY_SMALL_WHEN_FULL=0VICTORY_SLOT_EVICT_KEPT=0VICTORY_SLOT_EVICT_ASIDE=0e1f2eb6(earlier run)e1f2eb6's.SMALL_WHEN_FULL=0is ~8% lower, which looks the same on screen.SLOT_EVICT_KEPT=0andSLOT_EVICT_ASIDE=0make it worse: more waiting, and whole objects turn black. So those two help rather than cause it.VICTORY_ROOM_REALnever fires here (see above), so none of the four new switches explains the difference.E_OUTOFMEMORYlines each, no growth.So the texture-queue gap between
e1f2eb6andmainis somewhere else.@davemathews12 on GitHub · 2026-12-01 16:42 UTC · original
@Damix49 thanks, that clears all four (and SLOT_EVICT_KEPT/ASIDE clearly help, so they stay). The texture line's text is identical in
e1f2eb6and5fabb46e, so the 5,700 → 21,000 isn't a change in how it's counted.That leaves a bisect: 300 first-parent commits, 9 runs.
The first one to test is
68970432(Merge PR #2702). White/flat surfaces at your fixed spot is probably the clearest good/bad call, with the waiting median as the number. One thing to watch:97593f46(#2469, the leak) is inside the range, so on commits after it judge in the first 3–4 minutes, before RAM fills on 32 GB.If 9 runs is too many, say so and I'll pick out the texture and descriptor commits in the range so we can try those first.
@Damix49 on GitHub · 2026-12-01 16:49 UTC · original
@davemathews12 Thanks. Nine full runs are a lot for me right now, so yes please: pick out the texture and descriptor commits in
e1f2eb6..5fabb46eand I'll test those first, one build each, in your order.How I'll run each one, so the calls are comparable:
If one of them flips it, a short bisect around it should finish the job.
@davemathews12 on GitHub · 2026-12-01 17:02 UTC · original
@Damix49 here's the order, cheapest first.
8c5000ac) made "checked" the default: a slot written with a same-size texture whose bytes differ shows the neutral texture until the upload lands, wheree1f2eb6kept showing the old one. Neutral reads as white/flat. The trade-off is why it changed: with =1 a slot can briefly show the wrong texture of the same size (a shirt with another character's map). So also say if you see wrong textures.d7c2d8a7(36/300, 393,216 dynamic slots)8c5000ac(73/300, #2102)f689cb23(142/300, #2605 batched texture recheck claims)ed8bb2e0(200/300, #2608 sampled_lately / visible missing textures first)49af026c(252/300, #3840 deferred texture flips)On commits after
97593f46(#2469), judge in the first 3–4 minutes, before the leak fills RAM.@meonline42 on GitHub · 2026-12-01 17:23 UTC · original
@davemathews12 A data point for step 0 from our main
7d93ee07run (RTX 3090, driver 610.88, 64 GB, Series X 1080p to 1440p, DLSS Performance; the run from my earlier comment). At the end of the run, the log reads:moved ones checked: 1241 with the same bytes kept, 32471 with other bytes shown neutral (VICTORY_KEEP_SHOWN=checked)So M is large here too: about 26 neutral for each one kept. I haven't run
VICTORY_KEEP_SHOWN=1yet.Claude Code on behalf of the machine's owner
@Damix49 on GitHub · 2026-12-01 17:46 UTC · original
@davemathews12 Steps 0 and 1 on the same
main5fabb46e+ #4695 build, PC and profile as before.Step 0 (logs only): M is large here too.
main+ #4695, baseline of the four runsmain+ #4695, the leak-check runmain, morning rune1f2eb6Step 1,
VICTORY_KEEP_SHOWN=1: the switch took effect ("moved ones checked: 0 … 0 … shown neutral"; 49,610 slots kept what they showed meanwhile). On screen, nothing changed: white/flat surfaces still there, the same black textures and hair artifacts. I saw no wrong (swapped) textures. Textures waiting stayed high: median 26,039, max 27,667 (15.7 fps, ~6,000 draws, private flat at ~27 GB, no device removal).So the neutral-shown slots are real but not what makes the surfaces white here. The queue of textures never uploaded (~20-26k against ~5.7k on
e1f2eb6) looks like the bigger part. Unless you'd rather adjust it, I'll go on with step 2: builds atd7c2d8a7,8c5000ac,f689cb23,ed8bb2e0and49af026c, in order, judged in the first 3-4 minutes.@davemathews12 on GitHub · 2026-12-01 18:02 UTC · original
@Damix49 thanks, that rules out #2102. One change to step 2: halve instead of going in order. Start with
f689cb23(142/300). If it's good, the cause is later: test49af026c(252) next, thened8bb2e0(200). If it's bad, the cause is earlier: test8c5000ac(73) next, thend7c2d8a7(36). Two or three builds then bound it, and a short git bisect --first-parent between the last good and first bad finishes it.