CPU wall: plan to cut memory-bridging and API-emulation cost #2415

Open
opened 2026-11-29 12:51:08 +00:00 by dyshay · 112 comments
dyshay commented 2026-11-29 12:51:08 +00:00 (Migrated from github.com)
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T12:51:08Z.


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)

  • The GPU is mostly idle. On a heavy scene (house, open world) the card is busy ~17–21 ms of a ~50 ms frame without ray tracing, measured with per-pass timestamps and fence-clock busy time.
  • Little data actually crosses the bus. About 10–20 MB per frame of real changes.
  • Most of the CPU cost is bookkeeping:
    • ~7 GB of mirrored ranges checked per frame, with >99% unchanged;
    • thousands of refreshes per frame;
    • ~45k emulated D3D12/D3D12X calls per frame on 17 recording threads, ~5 µs each;
    • descriptor mirroring;
    • waits on the submit path.
  • No single thread is saturated. The frame is a dependency chain: the title's own sync (~22 ms), the submit thread (~11), list recording (~8), and guard-lock waits on title write faults (~5–6).
  • The GPU can read the title's own pages directly. A heap opened on a title address (OpenExistingHeapFromAddress) works on an RTX 4090 and stays coherent with CPU writes, at ~10–13 GB/s for a single pass.

Work items

  1. Classify memory by writer. On console most allocations are effectively GPU-only (textures, render targets, BVHs). The title's own protection and XMem flags say so. Keep these VRAM-resident with no host mirror and no per-frame compare, and copy only on an actual CPU write fault. Example: one 174 MB region was compared every frame for ~3 MB of real changes.
  2. Event-driven dirty tracking instead of scanning. Write watch asked once per reservation per submission (see ScarlettPort c74db40), per-submission dirty lists, never comparing ranges nobody touched. Target: the bytes compared per frame drop to roughly the bytes actually written.
  3. Zero-copy for small CPU-written, GPU-read-once data (constants, command and upload rings). Place it in a host-visible heap opened on the title's address: the GPU reads it over PCIe, with no copy and no compare. Measure which ranges qualify first: size, reads per write.
  4. Lazy, cached descriptor translation. Translate console descriptors to views on first use, cached by content, instead of mirroring whole heaps every frame.
  5. No synchronous waits on the submit thread. Pipelined copies, per-resource fences, and retirement after the flight's fence.
  6. Cut per-call emulation cost. Fast paths for the hottest calls (bind, root arguments, descriptor copies), and fewer locks on per-draw paths. Target: under 1 µs per call.
  7. Guard-lock contention on title write faults. Long holds with many waiters. Shard the guard state or make the fault path lock-free for the common case.

How to measure each item

  • Same scene, same save. Static camera shot, 300 s runs.
  • One switch per change, A/B in one run with VICTORY_AB where possible.
  • Report: frame median and p95, CPU preparing time, card busy time, bytes compared and bytes transferred per frame, and a picture check against the base.
  • Cost budget: reject anything that costs more than ~0.5 ms steady-state unless it fixes a visible fault.

Are you working on a fix?

I'd like to, with some pointers

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:6678917606 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T12:51:08Z. --- ### 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) - **The GPU is mostly idle.** On a heavy scene (house, open world) the card is busy ~17–21 ms of a ~50 ms frame without ray tracing, measured with per-pass timestamps and fence-clock busy time. - **Little data actually crosses the bus.** About 10–20 MB per frame of real changes. - **Most of the CPU cost is bookkeeping:** - ~7 GB of mirrored ranges checked per frame, with >99% unchanged; - thousands of refreshes per frame; - ~45k emulated D3D12/D3D12X calls per frame on 17 recording threads, ~5 µs each; - descriptor mirroring; - waits on the submit path. - **No single thread is saturated.** The frame is a dependency chain: the title's own sync (~22 ms), the submit thread (~11), list recording (~8), and guard-lock waits on title write faults (~5–6). - **The GPU can read the title's own pages directly.** A heap opened on a title address (`OpenExistingHeapFromAddress`) works on an RTX 4090 and stays coherent with CPU writes, at ~10–13 GB/s for a single pass. #### Work items 1. **Classify memory by writer.** On console most allocations are effectively GPU-only (textures, render targets, BVHs). The title's own protection and XMem flags say so. Keep these VRAM-resident with no host mirror and no per-frame compare, and copy only on an actual CPU write fault. Example: one 174 MB region was compared every frame for ~3 MB of real changes. 2. **Event-driven dirty tracking instead of scanning.** Write watch asked once per reservation per submission (see ScarlettPort c74db40), per-submission dirty lists, never comparing ranges nobody touched. Target: the bytes compared per frame drop to roughly the bytes actually written. 3. **Zero-copy for small CPU-written, GPU-read-once data** (constants, command and upload rings). Place it in a host-visible heap opened on the title's address: the GPU reads it over PCIe, with no copy and no compare. Measure which ranges qualify first: size, reads per write. 4. **Lazy, cached descriptor translation.** Translate console descriptors to views on first use, cached by content, instead of mirroring whole heaps every frame. 5. **No synchronous waits on the submit thread.** Pipelined copies, per-resource fences, and retirement after the flight's fence. 6. **Cut per-call emulation cost.** Fast paths for the hottest calls (bind, root arguments, descriptor copies), and fewer locks on per-draw paths. Target: under 1 µs per call. 7. **Guard-lock contention on title write faults.** Long holds with many waiters. Shard the guard state or make the fault path lock-free for the common case. #### How to measure each item - **Same scene, same save.** Static camera shot, 300 s runs. - **One switch per change**, A/B in one run with `VICTORY_AB` where possible. - **Report:** frame median and p95, CPU preparing time, card busy time, bytes compared and bytes transferred per frame, and a picture check against the base. - **Cost budget:** reject anything that costs more than ~0.5 ms steady-state unless it fixes a visible fault. ### Are you working on a fix? I'd like to, with some pointers
github-actions[bot] commented 2026-11-29 12:51:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by github-actions[bot] on 2026-11-29T12:51:16Z.


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.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256110658 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7256110658). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T12:51:16Z. --- 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. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
dyshay commented 2026-11-29 12:54:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T12:54:29Z.


/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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256149092 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7256149092). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T12:54:29Z. --- /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 commented 2026-11-29 12:55:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Texbirds on 2026-11-29T12:55:48Z.


Great breakdown and measurements — this lines up almost 1:1 with what we've been tracking upstream in Marvisak/VIctory#3703 (and neonbyte1/VIctory#127 / Slaktarn700/SlaktarnVI#15). Since you asked for pointers, a few concrete things already built or measured that should save you time:

  • Item 2 (event-driven MEM_WRITE_WATCH dirty tracking): Already implemented and tested on Windows in Marvisak/VIctory#3615 (3de7653, CI green). It keeps cold pages on PAGE_READONLY guards (zero-syscall clean_bit) and promotes hot MEM_WRITE_WATCH pool pages (HOT_THRESHOLD = 3) to batched GetWriteWatch(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, open Writing guards, concurrent Tracked::arm) are already fixed with regression tests — feel free to port/cherry-pick it directly.
  • Item 1 (classify by writer / GPU-only VRAM): AMD IBS profiling in SlaktarnVI#15 confirmed 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.
  • Ordering (Item 1 before Item 5): VIctory-RDNA#4 A/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.
  • Item 4 (lazy cached descriptor translation): Real moving/driving telemetry on 7800X3D + 5080 and 9800X3D + 9070 XT showed descriptor tables are ~2/3 of outdoor translator time once draw counts hit 8k–14k, so Item 4 is going to matter a ton for actual driving FPS once copy-back drops.

Happy to compare notes or help port #3615 over to VIctory-NVIDIA's watch.rs if you want to A/B it first.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256164682 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7256164682). Originally posted by [Texbirds](https://github.com/Texbirds) on 2026-11-29T12:55:48Z. --- Great breakdown and measurements — this lines up almost 1:1 with what we've been tracking upstream in `Marvisak/VIctory#3703` (and `neonbyte1/VIctory#127` / `Slaktarn700/SlaktarnVI#15`). Since you asked for pointers, a few concrete things already built or measured that should save you time: - **Item 2 (event-driven `MEM_WRITE_WATCH` dirty tracking):** Already implemented and tested on Windows in **`Marvisak/VIctory#3615`** (`3de7653`, CI green). It keeps cold pages on `PAGE_READONLY` guards (zero-syscall `clean_bit`) and promotes hot `MEM_WRITE_WATCH` pool pages (`HOT_THRESHOLD = 3`) to batched `GetWriteWatch(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, open `Writing` guards, concurrent `Tracked::arm`) are already fixed with regression tests — feel free to port/cherry-pick it directly. - **Item 1 (classify by writer / GPU-only VRAM):** AMD IBS profiling in `SlaktarnVI#15` confirmed 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. - **Ordering (Item 1 before Item 5):** `VIctory-RDNA#4` A/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. - **Item 4 (lazy cached descriptor translation):** Real moving/driving telemetry on 7800X3D + 5080 and 9800X3D + 9070 XT showed descriptor tables are ~2/3 of outdoor translator time once draw counts hit 8k–14k, so Item 4 is going to matter a ton for actual driving FPS once copy-back drops. Happy to compare notes or help port `#3615` over to `VIctory-NVIDIA`'s `watch.rs` if you want to A/B it first.
dyshay commented 2026-11-29 12:57:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T12:57:27Z.


Thanks, this is very useful. Plan, in that order:

  • Item 2: I'll review #3615 (3de7653) and port it here behind one switch, then A/B it in a single run on the same static scene. I'll post write-watch calls, time per frame and the frame median before/after, rather than write another version.
  • Item 1: narrow rollout per resource class, starting with GPU-only scratch and shadow-mask style buffers, with a lazy read-fault trap as the safety net. The ~0.3% CPU-read figure and the glyph/flicker/TDR cliff are exactly what I needed to scope it.
  • Ordering: eager copy-back cut before touching the submit-side waits, as you suggest.
  • Item 4: noted. I'll measure descriptor-table time on a driving route too, not only the static scene.

I'll post the per-class numbers here first.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256184204 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7256184204). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T12:57:27Z. --- Thanks, this is very useful. Plan, in that order: - **Item 2:** I'll review #3615 (3de7653) and port it here behind one switch, then A/B it in a single run on the same static scene. I'll post write-watch calls, time per frame and the frame median before/after, rather than write another version. - **Item 1:** narrow rollout per resource class, starting with GPU-only scratch and shadow-mask style buffers, with a lazy read-fault trap as the safety net. The ~0.3% CPU-read figure and the glyph/flicker/TDR cliff are exactly what I needed to scope it. - **Ordering:** eager copy-back cut before touching the submit-side waits, as you suggest. - **Item 4:** noted. I'll measure descriptor-table time on a driving route too, not only the static scene. I'll post the per-class numbers here first.
dyshay commented 2026-11-29 13:13:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T13:13:48Z.


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):

  • Refreshes and checks: 51.6k refreshes asking about 29 GB, 11.6 GB "checked" (99.5 % unchanged).
  • Write watch: 271 kernel askings, 3.3 ms; 390 askings refused, because they crossed reservations, and then retried by halves.
  • Faults and guards: 583 guard faults (section views, which cannot be write-watched). 22–25 ms waiting for the guards across threads.
  • Submit thread and descriptors: copies step 19 ms. Descriptor heap mirroring 8–14 ms.

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:

  • refreshes and their time;
  • bytes looked at / known clean / taken / compared / changed / sent / copied whole;
  • shader bytes declared / compared back / put back;
  • write-watch askings, time and refusals;
  • guard faults;
  • plus the busiest regions.

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):

  • Marvisak/VIctory#3615: reviewed. Its base guards every tracked page. Ours already asks the kernel for write-watched memory (journal + one asking per submission), and guards only section views, which GetWriteWatch refuses. So its gain is already how this base works, and there is nothing to port.
  • ScarlettPort c74db40 (one asking per reservation) applies here: it would remove the ~390 refused askings. I'll port it behind one switch with an A/B run if the census shows refusals cost over ~0.5 ms a frame.
  • Item 2 proper: a per-submission dirty list (written pages → the copies holding them through an inverse index), so an untouched copy costs one bit test. Expected: the copies step 19 → ~4–8 ms on the submit thread, but only 0–3 ms on the frame for now. A previous refresh speed-up (19–30 → 13–14 ms) did not move the frame because the submit thread had slack.
  • Item 1: rolled out narrowly, per class, before any work on item 5:
    1. First the CPU-less class (the title's CPU cannot read those addresses on the console). This is exact: shader writes stay on the card, no compare back, no merge.
    2. Then GPU-only-by-observation pages, behind a read-fault trap with a per-page cool-down. Kernel and driver readers stay on the old path.
    3. Per 64 KiB page, never per region: the 32-bit GPU heap mixes CPU constants with moving skinning outputs.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256383381 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7256383381). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T13:13:48Z. --- 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): - Refreshes and checks: 51.6k refreshes asking about 29 GB, 11.6 GB "checked" (99.5 % unchanged). - Write watch: 271 kernel askings, 3.3 ms; **390 askings refused**, because they crossed reservations, and then retried by halves. - Faults and guards: 583 guard faults (section views, which cannot be write-watched). 22–25 ms waiting for the guards across threads. - Submit thread and descriptors: copies step 19 ms. Descriptor heap mirroring 8–14 ms. **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: - refreshes and their time; - bytes looked at / known clean / taken / compared / changed / sent / copied whole; - shader bytes declared / compared back / put back; - write-watch askings, time and refusals; - guard faults; - plus the busiest regions. 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):** - Marvisak/VIctory#3615: reviewed. Its base guards every tracked page. Ours already asks the kernel for write-watched memory (journal + one asking per submission), and guards only section views, which `GetWriteWatch` refuses. So its gain is already how this base works, and there is nothing to port. - ScarlettPort c74db40 (one asking per reservation) applies here: it would remove the ~390 refused askings. I'll port it behind one switch with an A/B run if the census shows refusals cost over ~0.5 ms a frame. - Item 2 proper: a per-submission dirty list (written pages → the copies holding them through an inverse index), so an untouched copy costs one bit test. Expected: the copies step 19 → ~4–8 ms on the submit thread, but only 0–3 ms on the frame for now. A previous refresh speed-up (19–30 → 13–14 ms) did not move the frame because the submit thread had slack. - Item 1: rolled out narrowly, per class, before any work on item 5: 1. First the CPU-less class (the title's CPU cannot read those addresses on the console). This is exact: shader writes stay on the card, no compare back, no merge. 2. Then GPU-only-by-observation pages, behind a read-fault trap with a per-page cool-down. Kernel and driver readers stay on the old path. 3. Per 64 KiB page, never per region: the 32-bit GPU heap mixes CPU constants with moving skinning outputs.
ZorionTen commented 2026-11-29 15:27:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ZorionTen on 2026-11-29T15:27:06Z.


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 (...)):

17.6 fps, 56.9 ms/frame (34.0 preparing: copies 13.6 ms 28.6 MB, textures 1.4 ms 24.8 MB; 11.7 on the GPU; 10.1 copying back 1.3 MB), 3071 draws/frame
14.9 fps, 67.3 ms/frame (33.8 preparing: copies 14.0 ms 39.6 MB, textures 1.1 ms 22.0 MB; 21.3 on the GPU; 10.6 copying back 1.5 MB), 4935 draws/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 MB per 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7258099154 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7258099154). Originally posted by [ZorionTen](https://github.com/ZorionTen) on 2026-11-29T15:27:06Z. --- **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 (...)`): ``` 17.6 fps, 56.9 ms/frame (34.0 preparing: copies 13.6 ms 28.6 MB, textures 1.4 ms 24.8 MB; 11.7 on the GPU; 10.1 copying back 1.3 MB), 3071 draws/frame 14.9 fps, 67.3 ms/frame (33.8 preparing: copies 14.0 ms 39.6 MB, textures 1.1 ms 22.0 MB; 21.3 on the GPU; 10.6 copying back 1.5 MB), 4935 draws/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 MB` per 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 commented 2026-11-29 15:32:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T15:32:43Z.


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:

  • The copies lines during the 290–340 ms frames. If you can, paste 20–30 consecutive frame lines around one of those stretches, plus the write watch / guard lines 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.
  • Commit and private memory at the same moment (Task Manager › Details › Commit size for 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.
  • Whether FSR 3 FG is on or off in those lines. Frame generation changes how the layer paces submissions, so a run with it off would isolate the layer's cost.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7258173608 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7258173608). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T15:32:43Z. --- 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: - **The `copies` lines during the 290–340 ms frames.** If you can, paste 20–30 consecutive frame lines around one of those stretches, plus the `write watch` / `guard` lines 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. - **Commit and private memory** at the same moment (Task Manager › Details › Commit size for `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. - **Whether FSR 3 FG is on or off** in those lines. Frame generation changes how the layer paces submissions, so a run with it off would isolate the layer's cost. 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 commented 2026-11-29 16:57:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-29T16:57:57Z.


A CPU-bound data point for this plan, including a slowdown from e1f2eb6 to 829188e (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::host lines over the last ~150 s. Same play-foxhound.ps1 for both exes. For 829188e I ran it once with the older launcher's switches and once with the switches its own play-foxhound.ps1 changed (HELPER_PRIORITY=1, PASSES_HOT=1, POOL_SMALL=1, LEVELS_ON_DEMAND=auto, TEXSPK_PASS_MS=8, PIPELINE_WORKERS and RELAY unset). One warm-up run after the new build was discarded.

fps (median, bench) p95 frame frame / preparing copying back relay landing that thread worked frames over 100 ms per run
e1f2eb6, 2 runs 17-18 74-77 ms 58.8-61.1 / 44.0-44.8 ms 6.3-6.6 ms 17.2 ms 54.5-55.7 ms 12-21
829188e, older switches, 2 runs 15-17 87-88 ms 63.0-68.3 / 47.6-50.1 ms 16.6-16.8 ms 36.9 ms 61.5-65.5 ms 59-99
829188e, its own switches, 2 runs 16-17 91-94 ms 62.5-67.3 / 47.0-49.7 ms 16.2-16.6 ms 26.8-28.1 ms 61.5-64.9 ms 64-93

Draw counts are comparable (6,000-8,400 a frame in all runs). What moved:

  • Copying back went from ~6.5 to ~16.5 ms a frame. The relay's landing thread spends 27-37 ms a frame landing, against 17 ms.
  • Refreshes on several threads dropped in the preparing per frame line: 3,250 of 8,644 flushes against 7,176 of 7,792 on e1f2eb6. The lists' steps went from 30.2 to 36.4 ms.
  • The tail got much worse: 3-5x more frames over 100 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_stale on e1f2eb6:

MB per frame
copied whole, memory not watched 0.0
first-touch pages (copied whole) 0.0-0.5
pages written since their last copy, as whole 64 KiB 60-77
... copied after by_parts 52-69
... of those, guarded memory, copied in full 64 KiB blocks 44-60

Only 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7259313881 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7259313881). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-29T16:57:57Z. --- A CPU-bound data point for this plan, including a slowdown from `e1f2eb6` to `829188e` (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::host` lines over the last ~150 s. Same `play-foxhound.ps1` for both exes. For `829188e` I ran it once with the older launcher's switches and once with the switches its own `play-foxhound.ps1` changed (`HELPER_PRIORITY=1`, `PASSES_HOT=1`, `POOL_SMALL=1`, `LEVELS_ON_DEMAND=auto`, `TEXSPK_PASS_MS=8`, `PIPELINE_WORKERS` and `RELAY` unset). One warm-up run after the new build was discarded. | | fps (median, bench) | p95 frame | frame / preparing | copying back | relay landing | that thread worked | frames over 100 ms per run | |---|---|---|---|---|---|---|---| | `e1f2eb6`, 2 runs | 17-18 | 74-77 ms | 58.8-61.1 / 44.0-44.8 ms | 6.3-6.6 ms | 17.2 ms | 54.5-55.7 ms | 12-21 | | `829188e`, older switches, 2 runs | 15-17 | 87-88 ms | 63.0-68.3 / 47.6-50.1 ms | 16.6-16.8 ms | 36.9 ms | 61.5-65.5 ms | 59-99 | | `829188e`, its own switches, 2 runs | 16-17 | 91-94 ms | 62.5-67.3 / 47.0-49.7 ms | 16.2-16.6 ms | 26.8-28.1 ms | 61.5-64.9 ms | 64-93 | Draw counts are comparable (6,000-8,400 a frame in all runs). What moved: - **Copying back** went from ~6.5 to ~16.5 ms a frame. The relay's landing thread spends 27-37 ms a frame landing, against 17 ms. - **Refreshes on several threads dropped** in the `preparing per frame` line: 3,250 of 8,644 flushes against 7,176 of 7,792 on `e1f2eb6`. The lists' steps went from 30.2 to 36.4 ms. - **The tail got much worse:** 3-5x more frames over 100 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_stale` on `e1f2eb6`: | MB per frame | | |---|---| | copied whole, memory not watched | 0.0 | | first-touch pages (copied whole) | 0.0-0.5 | | pages written since their last copy, as whole 64 KiB | 60-77 | | ... copied after `by_parts` | 52-69 | | ... of those, guarded memory, copied in full 64 KiB blocks | 44-60 | Only **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 commented 2026-11-29 17:01:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T17:01:24Z.


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 e1f2eb6 and 829188e that touch landing, shadows or refresh threading. These are the ones that look able to move copying back or the refresh split:

Candidate Why it could matter
#1756, late card windows (6de00a4d, f604c6ff, b84622f9 adapt it) changes where late-window bytes live and when they land
#1823, CardCpu::Shared staging shared staging for card-side copies
#1094 rebased as 27d312d3 (lock-free refresh checks, single-lock scoped pool) matches "refreshes on several threads dropped" (7,176 → 3,250 flushes)
3634e25f, pageable CPU mirrors for per-submission card uploads more pages for the landing to touch
5b66a1d0, title buffer copies of 1 MiB and up kept in card memory on 16 GB cards changes which copies come back. Check whether it applies on a 24 GB card too

If any of them has a switch, an A/B with VICTORY_HOT_AB / VICTORY_AB in 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:

  1. knowing the writer per 64 KiB page (item 1: GPU-only pages never come back to the PC);
  2. finer guards where the title writes sparsely.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7259358726 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7259358726). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T17:01:24Z. --- 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 e1f2eb6 and 829188e that touch landing, shadows or refresh threading. These are the ones that look able to move copying back or the refresh split: | Candidate | Why it could matter | |---|---| | #1756, late card windows (6de00a4d, f604c6ff, b84622f9 adapt it) | changes where late-window bytes live and when they land | | #1823, `CardCpu::Shared` staging | shared staging for card-side copies | | #1094 rebased as 27d312d3 (lock-free refresh checks, single-lock scoped pool) | matches "refreshes on several threads dropped" (7,176 → 3,250 flushes) | | 3634e25f, pageable CPU mirrors for per-submission card uploads | more pages for the landing to touch | | 5b66a1d0, title buffer copies of 1 MiB and up kept in card memory on 16 GB cards | changes which copies come back. Check whether it applies on a 24 GB card too | If any of them has a switch, an A/B with `VICTORY_HOT_AB` / `VICTORY_AB` in 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: 1. knowing the writer per 64 KiB page (item 1: GPU-only pages never come back to the PC); 2. finer guards where the title writes sparsely. 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 commented 2026-11-29 17:24:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-29T17:24:23Z.


@dyshay @meonline42 Awesome tracking plan — wanted to flag one concrete Win11 kernel finding from #756 that directly challenges the "section views cannot be write-watched" assumption behind the 583 guard faults / 22–25 ms guard-lock waits / 44–60 MB guarded copies!

1. Single-mapped XMem pages CAN use hardware MEM_WRITE_WATCH (empirical Win11 26300 probe)

xmem.rs:194-232 has a comment assuming placeholders can't be write-watched, so everything goes through MapViewOfFile3 + VirtualProtect guards. We just tested this directly against the Win11 26300 kernel (xmem_ww_probe.exe on 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 and GetWriteWatch returns exact 4 KiB granularity (gran = 4096).
  • No VAD scaling cliff: 430 separate 64 KiB write-watch regions take 0.308 ms total for 430 GetWriteWatch calls (vs 0.053 ms contiguous).
  • On a single-threaded Zen 3 microbench modeling @meonline42's 430 × 64 KiB guarded blocks (25% dirty = 6.88 MiB of 27.5 MiB), replacing VirtualProtect + 430 VEH faults + 64 KiB copy with MEM_WRITE_WATCH + 4 KiB copy dropped the frame cost 3.825 ms -> 1.461 ms (2.6x) even before eliminating the 22–25 ms multi-thread GUARDS lock contention.
  • Idea ("Promote-on-Alias"): back 1-to-1 physical pages with private MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH, and only promote-out (~22 µs) to MapViewOfFile3 if a second VA aliases the same (section, index) in xmem.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=1

Since you're already building VICTORY_WALL_CENSUS=1, could you include a 1-field split on the guarded faults / guarded copied bytes using xmem.rs::Shown:

  • alias_count == 1 (and never unmapped/remapped in play) vs alias_count > 1

That 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 the 583 faults / 22–25 ms guard lock / 44–60 MB guarded amplification in one shot, or if those hot blocks are genuinely multi-aliased.

(Also happy to statically audit your 5 bisect candidates #1756 / #1823 / 27d312d / 3634e25 / 5b66a1d for the 6.5 -> 16.5 ms copy-back & 7,176 -> 3,250 refresh-threading regression right now to save you build cycles if helpful!)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7259665315 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7259665315). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T17:24:23Z. --- @dyshay @meonline42 Awesome tracking plan — wanted to flag one concrete Win11 kernel finding from `#756` that directly challenges the *"section views cannot be write-watched"* assumption behind the `583 guard faults` / `22–25 ms` guard-lock waits / `44–60 MB` guarded copies! ### 1. Single-mapped `XMem` pages CAN use hardware `MEM_WRITE_WATCH` (empirical Win11 26300 probe) `xmem.rs:194-232` has a comment assuming placeholders can't be write-watched, so everything goes through `MapViewOfFile3` + `VirtualProtect` guards. We just tested this directly against the Win11 26300 kernel (`xmem_ww_probe.exe` on 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** and `GetWriteWatch` returns exact **4 KiB granularity** (`gran = 4096`). - No VAD scaling cliff: 430 separate 64 KiB write-watch regions take **0.308 ms** total for 430 `GetWriteWatch` calls (vs **0.053 ms** contiguous). - On a single-threaded Zen 3 microbench modeling `@meonline42`'s 430 × 64 KiB guarded blocks (25% dirty = `6.88 MiB` of `27.5 MiB`), replacing `VirtualProtect` + 430 VEH faults + 64 KiB copy with `MEM_WRITE_WATCH` + 4 KiB copy dropped the frame cost **`3.825 ms -> 1.461 ms` (2.6x)** even before eliminating the `22–25 ms` multi-thread `GUARDS` lock contention. - **Idea ("Promote-on-Alias"):** back 1-to-1 physical pages with private `MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH`, and only promote-out (`~22 µs`) to `MapViewOfFile3` if a second VA aliases the same `(section, index)` in `xmem.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=1` Since you're already building `VICTORY_WALL_CENSUS=1`, could you include a 1-field split on the guarded faults / guarded copied bytes using `xmem.rs::Shown`: - **`alias_count == 1` (and never unmapped/remapped in play) vs `alias_count > 1`** That 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 the `583 faults / 22–25 ms guard lock / 44–60 MB guarded amplification` in one shot, or if those hot blocks are genuinely multi-aliased. *(Also happy to statically audit your 5 bisect candidates `#1756 / #1823 / 27d312d / 3634e25 / 5b66a1d` for the `6.5 -> 16.5 ms` copy-back & `7,176 -> 3,250` refresh-threading regression right now to save you build cycles if helpful!)*
shiman1901 commented 2026-11-29 17:35:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-29T17:35:36Z.


@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:

  1. #1823 & 3634e25 (pageable CardCpu::Private mirrors): gated by asked_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".
  2. #1756 + 6de00a4/f604c6f/b84622f (late card windows): card_late() reads VICTORY_CARD_WINDOWS_LATE (shadow.rs:883-892, None => 0). Off by default.
  3. 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 (#1094 rebased) as the only candidate among the five that is active on 829188e with the old launcher switches:

  • refreshes on several threads (7,176 -> 3,250): host.rs:11750 prints FLUSHES[3] (:11609), incremented by self.refreshes.len() in Batch::flush (:12725). 27d312d added early check_noop (nothing_new_with) filtering before the wide pass, so the drop in count itself is early no-op filtering rather than lost parallelism.
  • Suspect for +6.2 ms in lists' steps: 27d312d changed let ahead = self.refreshes.len() > 1 -> let ahead = !kept && self.refreshes.len() > 1, disabling the batched ahead_snapshot (GetWriteWatch) when kept is set (forcing per-refresh watch queries) alongside grain = 1 vs wide_chunk().
  • Zero-rebuild switches already in 829188e to test 27d312d & landing directly before bisecting:
    • VICTORY_LIGHT_REFRESH=0 (watch.rs:1392) — turns off the light-refresh path
    • VICTORY_WIDE_MERGE=0 (host.rs:8125) — tests whether the scoped pool / wide landing merge is behind the copying back (6.5 -> 16.5 ms) and relay landing (17 -> 37 ms) jump
    • VICTORY_WIDE_CHUNK=1 (or =8) and VICTORY_WIDE_REFRESH=0 (host.rs:11877)

If VICTORY_LIGHT_REFRESH=0 + VICTORY_WIDE_MERGE=0 don't move copying back back down from 16.5 ms (and "CPU mirrors in pageable process memory" isn't in the log), then the copying back regression is outside those 5 commits — saving you four wasted builds right away!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7259812214 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7259812214). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T17:35:36Z. --- @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: 1. **`#1823` & `3634e25` (pageable `CardCpu::Private` mirrors):** gated by `asked_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"`. 2. **`#1756` + `6de00a4/f604c6f/b84622f` (late card windows):** `card_late()` reads `VICTORY_CARD_WINDOWS_LATE` (`shadow.rs:883-892`, `None => 0`). Off by default. 3. **`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` (`#1094` rebased)** as the **only** candidate among the five that is active on `829188e` with the old launcher switches: - **`refreshes on several threads` (`7,176 -> 3,250`):** `host.rs:11750` prints `FLUSHES[3]` (`:11609`), incremented by `self.refreshes.len()` in `Batch::flush` (`:12725`). `27d312d` added early `check_noop` (`nothing_new_with`) filtering before the wide pass, so the drop in count itself is early no-op filtering rather than lost parallelism. - **Suspect for `+6.2 ms` in `lists' steps`:** `27d312d` changed `let ahead = self.refreshes.len() > 1` -> `let ahead = !kept && self.refreshes.len() > 1`, disabling the batched `ahead_snapshot` (`GetWriteWatch`) when `kept` is set (forcing per-refresh watch queries) alongside `grain = 1` vs `wide_chunk()`. - **Zero-rebuild switches already in `829188e` to test `27d312d` & landing directly before bisecting:** - `VICTORY_LIGHT_REFRESH=0` (`watch.rs:1392`) — turns off the light-refresh path - `VICTORY_WIDE_MERGE=0` (`host.rs:8125`) — tests whether the scoped pool / wide landing merge is behind the `copying back` (`6.5 -> 16.5 ms`) and `relay landing` (`17 -> 37 ms`) jump - `VICTORY_WIDE_CHUNK=1` (or `=8`) and `VICTORY_WIDE_REFRESH=0` (`host.rs:11877`) If `VICTORY_LIGHT_REFRESH=0` + `VICTORY_WIDE_MERGE=0` don't move `copying back` back down from `16.5 ms` (and `"CPU mirrors in pageable process memory"` isn't in the log), then the `copying back` regression is outside those 5 commits — saving you four wasted builds right away!
dyshay commented 2026-11-29 18:08:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T18:08:06Z.


@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=0
  • VICTORY_WIDE_MERGE=0

If neither moves copying back, the regression is outside those commits, as you say. Results here.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7260238932 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7260238932). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T18:08:06Z. --- @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=0` - `VICTORY_WIDE_MERGE=0` If neither moves *copying back*, the regression is outside those commits, as you say. Results here.
burber commented 2026-11-29 18:18:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-29T18:18:40Z.


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:

  • shader writes declared only over the pieces the card's compare found changed;
  • the present call moved to its own thread.

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:

  • with two frames in flight on its own, and with the two other changes added;
  • on that 959dcaf-based tree;
  • on a port to 55d06914, including one run with every memory switch that is new since 959dcaf and on by default set to 0: GPU_RO_SKIP, MEMORY_OWNED, UPLOAD_GUARD, PLACED_*, SHARED_ZEROS, UAV_POOL, READBACK_POOL and 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:

  • Check the picture well into a run, with screen captures at 100 s and later, not only the early capture frames.
  • Treat a jump in fps with the card still idle as suspect until the picture is checked.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7260380626 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7260380626). Originally posted by [burber](https://github.com/burber) on 2026-11-29T18:18:40Z. --- 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: - shader writes declared only over the pieces the card's compare found changed; - the present call moved to its own thread. **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: - with two frames in flight on its own, and with the two other changes added; - on that 959dcaf-based tree; - on a port to `55d06914`, including one run with every memory switch that is new since 959dcaf and on by default set to 0: `GPU_RO_SKIP`, `MEMORY_OWNED`, `UPLOAD_GUARD`, `PLACED_*`, `SHARED_ZEROS`, `UAV_POOL`, `READBACK_POOL` and 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:** - Check the picture well into a run, with screen captures at 100 s and later, not only the early capture frames. - Treat a jump in fps with the card still idle as suspect until the picture is checked. 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 commented 2026-11-29 18:24:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-29T18:24:41Z.


@dyshay @meonline42 Two quick follow-ups before you start bisect builds — we checked the full e1f2eb6..829188e commit window (~40 merges) on land.rs / shadow.rs / host.rs and traced the promote-out race path in watch.rs:

1. Caveat on 27d312d (#1094 rebased): its land.rs / card_dirty half has NO env switch

  • Across all ~40 merges between e1f2eb6 (04:21Z) and 829188e (11:13Z), 27d312d is 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).
  • Crucially, VICTORY_LIGHT_REFRESH=0 only disables the refresh-side fast path of 27d312d — the 59-line land.rs ("single-lock scoped pool") and zero-clone card_dirty (shadow.rs) changes in 27d312d are ungated (and VICTORY_WIDE_MERGE=0 disables wide merge altogether rather than restoring the pre-27d312d pool).
  • So if VICTORY_LIGHT_REFRESH=0 doesn't bring copying back (16.5 ms) and relay landing (27–37 ms) back down, testing a single git revert 27d312d first should immediately confirm or rule out the entire commit before bisecting the tree.

2. How promote-out behaves when refresh (or a title thread) races with it

Checking watch.rs:3549-4004 and xmem.rs:1084, the synchronization primitives for a ~20 µs promote-out window (VirtualFree -> MEM_RESERVE_PLACEHOLDER -> MapViewOfFile3) are already built:

  • xmem.rs:1084 (remapping_and_views) -> watch::title_memory_remapping_of(&ranges) (watch.rs:3606): already acquires MAPPING.write() + RANGES.write(&ranges), bumps CHANGES, and sets CHANGING.
  • Vs refresh (copy_stale -> safecopy::try_copy): holding Reading (the read side of MAPPING, range-scoped when VICTORY_RANGE_LOCK=1) around copy_stale makes promote-out wait until any in-flight refresh of that range finishes (and even without it, safecopy::try_copy catches SEH cleanly without crashing).
  • Vs concurrent title CPU reads: already handled in VEH via came_back(at, false) (watch.rs:3549), which spins in again_after_change() until title_memory_remapping_of drops, increments MET (:3609), and returns EXCEPTION_CONTINUE_EXECUTION so the CPU retries the read instruction transparently against the new MapViewOfFile3 view.
  • Vs concurrent title CPU writes: came_back(at, true) (watch.rs:3549, checking open(..) || writable(at) after again_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.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7260461156 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7260461156). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T18:24:41Z. --- @dyshay @meonline42 Two quick follow-ups before you start bisect builds — we checked the full `e1f2eb6..829188e` commit window (~40 merges) on `land.rs / shadow.rs / host.rs` and traced the `promote-out` race path in `watch.rs`: ### 1. Caveat on `27d312d` (`#1094` rebased): its `land.rs` / `card_dirty` half has NO env switch - Across all ~40 merges between `e1f2eb6` (04:21Z) and `829188e` (11:13Z), **`27d312d` is 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). - Crucially, `VICTORY_LIGHT_REFRESH=0` only disables the refresh-side fast path of `27d312d` — the **59-line `land.rs` ("single-lock scoped pool") and `zero-clone card_dirty` (`shadow.rs`) changes in `27d312d` are ungated** (and `VICTORY_WIDE_MERGE=0` disables wide merge altogether rather than restoring the pre-`27d312d` pool). - So if `VICTORY_LIGHT_REFRESH=0` doesn't bring `copying back` (`16.5 ms`) and `relay landing` (`27–37 ms`) back down, testing a single **`git revert 27d312d`** first should immediately confirm or rule out the entire commit before bisecting the tree. ### 2. How `promote-out` behaves when `refresh` (or a title thread) races with it Checking `watch.rs:3549-4004` and `xmem.rs:1084`, the synchronization primitives for a ~20 µs `promote-out` window (`VirtualFree` -> `MEM_RESERVE_PLACEHOLDER` -> `MapViewOfFile3`) are **already built**: - **`xmem.rs:1084` (`remapping_and_views`) -> `watch::title_memory_remapping_of(&ranges)` (`watch.rs:3606`):** already acquires `MAPPING.write()` + `RANGES.write(&ranges)`, bumps `CHANGES`, and sets `CHANGING`. - **Vs `refresh` (`copy_stale` -> `safecopy::try_copy`):** holding `Reading` (the read side of `MAPPING`, range-scoped when `VICTORY_RANGE_LOCK=1`) around `copy_stale` makes `promote-out` wait until any in-flight refresh of that range finishes (and even without it, `safecopy::try_copy` catches SEH cleanly without crashing). - **Vs concurrent title CPU reads:** already handled in VEH via `came_back(at, false)` (`watch.rs:3549`), which spins in `again_after_change()` until `title_memory_remapping_of` drops, increments `MET` (`:3609`), and returns `EXCEPTION_CONTINUE_EXECUTION` so the CPU retries the read instruction transparently against the new `MapViewOfFile3` view. - **Vs concurrent title CPU writes:** `came_back(at, true)` (`watch.rs:3549`, checking `open(..) || writable(at)` after `again_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 commented 2026-11-29 18:26:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T18:26:15Z.


I checked the static audit against the code. Our tree is 829188e plus a few fixes, and none of them touches these readers.

Claim Verdict
VICTORY_LIGHT_REFRESH=0 turns the light refresh off Confirmed. watch.rs:1402, on by default.
VICTORY_WIDE_MERGE=0 tests the wide merge Not a test. host.rs:3637: off unless =1, at e1f2eb6 and at 829188e alike, so =0 is the default.
VICTORY_WIDE_CHUNK=1/8 No effect. wide_chunk() (shadow.rs:2813) has had no caller since 27d312d.
VICTORY_WIDE_REFRESH=0 Confirmed. host.rs:11877-11891, on by default from 4 logical CPUs.
#1823 / 3634e25 behind VICTORY_CARD_CPU_HEAP Confirmed. shadow.rs:140, =1 only.
#1756 off by default Confirmed. shadow.rs:883-892.
5b66a1d only on 16 GB cards Confirmed. Only the 12–20 GiB band changes (shadow.rs:323-327).
27d312d ahead = !kept && … The text is right (host.rs:12700, and 12511). It only skips an ask_ahead the submission's single asking already covers, though. It does not become one asking per refresh.

light() and wide_merge() read their variables once and cache them, so they can't be flipped live with VICTORY_AB or VICTORY_HOT_AB. I queued two plain runs on the same exe instead: a baseline and VICTORY_LIGHT_REFRESH=0. @meonline42, VICTORY_WIDE_REFRESH=0 would be the other one worth a run on your 5900X.

On the write-watch comment: xmem.rs:228-232 says 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:

  • single-mapped and never remapped;
  • aliased or remapped;
  • no view known (descriptor-heap hooks, pages above 2^37).

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7260481474 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7260481474). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T18:26:15Z. --- I checked the static audit against the code. Our tree is 829188e plus a few fixes, and none of them touches these readers. | Claim | Verdict | |---|---| | `VICTORY_LIGHT_REFRESH=0` turns the light refresh off | Confirmed. `watch.rs:1402`, on by default. | | `VICTORY_WIDE_MERGE=0` tests the wide merge | **Not a test.** `host.rs:3637`: off unless `=1`, at e1f2eb6 and at 829188e alike, so `=0` *is* the default. | | `VICTORY_WIDE_CHUNK=1/8` | **No effect.** `wide_chunk()` (`shadow.rs:2813`) has had no caller since 27d312d. | | `VICTORY_WIDE_REFRESH=0` | Confirmed. `host.rs:11877-11891`, on by default from 4 logical CPUs. | | #1823 / 3634e25 behind `VICTORY_CARD_CPU_HEAP` | Confirmed. `shadow.rs:140`, `=1` only. | | #1756 off by default | Confirmed. `shadow.rs:883-892`. | | 5b66a1d only on 16 GB cards | Confirmed. Only the 12–20 GiB band changes (`shadow.rs:323-327`). | | 27d312d `ahead = !kept && …` | The text is right (`host.rs:12700`, and 12511). It only skips an `ask_ahead` the submission's single asking already covers, though. It does not become one asking per refresh. | `light()` and `wide_merge()` read their variables once and cache them, so they can't be flipped live with `VICTORY_AB` or `VICTORY_HOT_AB`. I queued two plain runs on the same exe instead: a baseline and `VICTORY_LIGHT_REFRESH=0`. @meonline42, `VICTORY_WIDE_REFRESH=0` would be the other one worth a run on your 5900X. On the write-watch comment: `xmem.rs:228-232` says 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: - single-mapped and never remapped; - aliased or remapped; - no view known (descriptor-heap hooks, pages above 2^37). 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 commented 2026-11-29 18:31:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-29T18:31:04Z.


@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):

frame preparing copying back relay landing that thread worked
base (2 runs) 65.1 / 80.7 ms 48.0 / 54.6 ms 17.2 / 23.2 ms 29.1 / 36.7 ms 62.8 / 78.2 ms
VICTORY_LIGHT_REFRESH=0 96.7 / 134.7 ms 72.6 / 87.0 ms 14.6 / 21.0 ms 23.9 / 30.8 ms 97.3 / 138.2 ms
VICTORY_WIDE_MERGE=0 102.7 / 79.1 ms 46.5 / 51.8 ms 16.5 / 25.3 ms 27.7 / 36.1 ms 69.0 / 75.9 ms
VICTORY_WIDE_REFRESH=0 79.5 / 135.9 ms 59.9 / 90.4 ms 21.6 / 18.8 ms 31.9 / 32.3 ms 80.7 / 136.2 ms

(e1f2eb6 on the same scene: copying back 6.3-6.6 ms, landing 17.2 ms.) None of them brings copying back down. LIGHT_REFRESH=0 and WIDE_REFRESH=0 make 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7260545262 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7260545262). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-29T18:31:04Z. --- @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): | | frame | preparing | copying back | relay landing | that thread worked | |---|---|---|---|---|---| | base (2 runs) | 65.1 / 80.7 ms | 48.0 / 54.6 ms | 17.2 / 23.2 ms | 29.1 / 36.7 ms | 62.8 / 78.2 ms | | `VICTORY_LIGHT_REFRESH=0` | 96.7 / 134.7 ms | 72.6 / 87.0 ms | 14.6 / 21.0 ms | 23.9 / 30.8 ms | 97.3 / 138.2 ms | | `VICTORY_WIDE_MERGE=0` | 102.7 / 79.1 ms | 46.5 / 51.8 ms | 16.5 / 25.3 ms | 27.7 / 36.1 ms | 69.0 / 75.9 ms | | `VICTORY_WIDE_REFRESH=0` | 79.5 / 135.9 ms | 59.9 / 90.4 ms | 21.6 / 18.8 ms | 31.9 / 32.3 ms | 80.7 / 136.2 ms | (`e1f2eb6` on the same scene: copying back 6.3-6.6 ms, landing 17.2 ms.) None of them brings copying back down. `LIGHT_REFRESH=0` and `WIDE_REFRESH=0` make 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 commented 2026-11-29 19:22:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-29T19:22:16Z.


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.

  • Series X, 1440p, DLSS Quality. Frame generation and ray tracing off.
  • Every run starts from the same save, standing still in the house, for 300 s.
  • The figures are medians of the 5 s victory_gpu::host lines, after the first 60 s in the world.
  • The base is 829188e plus #2392; without #2392, the memory guard stalls the world on this PC.
  • Jason lands in a different room each run, so runs are only compared at matching draws.
  • I was using the PC during some of these runs, so differences of ±1 fps are noise.

Same heavy room (about 7,000 draws a frame):

Run fps frame preparing copying back
base 23.4 42.7 ms 31.6 ms 12.6 ms
27d312d's land.rs half reverted (single-lock scoped pool back to before) 21.0 47.7 ms 39.0 ms 10.2 ms
#2655 22.5 44.5 ms 33.9 ms 12.4 ms
base + VICTORY_NARROW_WRITES=1 (an out-of-tree change of ours) 23.9 41.8 ms 32.3 ms 12.4 ms

At 5,000-6,500 draws a frame:

Run fps frame preparing copying back
base, two runs 22.4 / 22.9 44.6 / 43.6 ms 33.8 / 32.6 ms 12.8 / 12.6 ms
#1853 with VICTORY_GUARD_PARTS=4 22.4 44.7 ms 33.0 ms 11.5 ms
VICTORY_LIGHT_REFRESH=0 17.6 56.8 ms 49.7 ms 10.4 ms

What this says, on this machine:

  • 27d312d is 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 on 829188e looks 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.
  • The light refresh path is one of the bigger wins in the current tree. Turning it off costs about 22% fps, with preparing up from about 33 to about 50 ms.
  • #2655 and #1853 made no measurable difference in this scene. #2655 targets streaming windows and #1853 descriptor heap writes, and a standing house shot has little of either. A driving or streaming route would test them better.

Logs for every run are available if useful.


Measured and written with an AI assistant (Claude Code); the runs were on my PC.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7261225411 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7261225411). Originally posted by [burber](https://github.com/burber) on 2026-11-29T19:22:16Z. --- 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. - Series X, 1440p, DLSS Quality. Frame generation and ray tracing off. - Every run starts from the same save, standing still in the house, for 300 s. - The figures are medians of the 5 s `victory_gpu::host` lines, after the first 60 s in the world. - The base is `829188e` plus #2392; without #2392, the memory guard stalls the world on this PC. - Jason lands in a different room each run, so runs are only compared at matching draws. - I was using the PC during some of these runs, so differences of ±1 fps are noise. **Same heavy room (about 7,000 draws a frame):** | Run | fps | frame | preparing | copying back | |---|---|---|---|---| | base | **23.4** | 42.7 ms | 31.6 ms | 12.6 ms | | `27d312d`'s `land.rs` half reverted (single-lock scoped pool back to before) | 21.0 | 47.7 ms | 39.0 ms | 10.2 ms | | #2655 | 22.5 | 44.5 ms | 33.9 ms | 12.4 ms | | base + `VICTORY_NARROW_WRITES=1` (an out-of-tree change of ours) | 23.9 | 41.8 ms | 32.3 ms | 12.4 ms | **At 5,000-6,500 draws a frame:** | Run | fps | frame | preparing | copying back | |---|---|---|---|---| | base, two runs | 22.4 / 22.9 | 44.6 / 43.6 ms | 33.8 / 32.6 ms | 12.8 / 12.6 ms | | #1853 with `VICTORY_GUARD_PARTS=4` | 22.4 | 44.7 ms | 33.0 ms | 11.5 ms | | `VICTORY_LIGHT_REFRESH=0` | 17.6 | 56.8 ms | 49.7 ms | 10.4 ms | **What this says, on this machine:** - **`27d312d` is 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 on `829188e` looks 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. - **The light refresh path is one of the bigger wins in the current tree.** Turning it off costs about 22% fps, with preparing up from about 33 to about 50 ms. - **#2655 and #1853 made no measurable difference in this scene.** #2655 targets streaming windows and #1853 descriptor heap writes, and a standing house shot has little of either. A driving or streaming route would test them better. Logs for every run are available if useful. --- Measured and written with an AI assistant (Claude Code); the runs were on my PC.
burber commented 2026-11-29 20:44:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-29T20:44:35Z.


@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:

  • Build it behind VICTORY_PROMOTE_ON_ALIAS=1, off by default, on 829188e + #2392.
  • The first version covers only the simple case. Pages mapped at one address get private memory with 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.
  • dyshay's census split decides how far it's worth going. If the single-mapped share of guarded work turns out to be small, I'll post that and stop.
  • I'll A/B it the same way as my last results: same exe and save, matched draws, 300 s runs. I'll also take screenshots in the middle of each run, since the two-frames-in-flight gain turned out to be a broken picture.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7262322006 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7262322006). Originally posted by [burber](https://github.com/burber) on 2026-11-29T20:44:35Z. --- @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:** - Build it behind `VICTORY_PROMOTE_ON_ALIAS=1`, off by default, on `829188e` + #2392. - The first version covers only the simple case. Pages mapped at one address get private memory with `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. - dyshay's census split decides how far it's worth going. If the single-mapped share of guarded work turns out to be small, I'll post that and stop. - I'll A/B it the same way as my last results: same exe and save, matched draws, 300 s runs. I'll also take screenshots in the middle of each run, since the two-frames-in-flight gain turned out to be a broken picture. 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 commented 2026-11-29 20:47:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-29T20:47:14Z.


@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.rs trace so they don't bite you on the first pass:

  1. Registering with watch.rs (TRACKED vs is_view):
    • Simply replacing a placeholder with MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH makes mbi.Type == MEM_PRIVATE (so it drops off the MEM_MAPPED guard path), but watch.rs only harvests GetWriteWatch bits for regions registered in its write-watch tracking (TRACKED / Tracked). Make sure promoted-in XMem regions are registered with watch.rs on map (and unregistered on unmap/promote-out) so copy_stale actually sees their 4 KiB dirty bits after frame 1.
  2. Coalesce contiguous single-mapped pages in XMemMapPhysicalPages where possible:
    • Because Windows GetWriteWatch refuses queries that cross AllocationBase boundaries (the 390 cross-reservation refusals @dyshay noted above), coalescing a contiguous run of fresh single-mapped 64 KiB pages into a single VirtualAlloc2(..., run_bytes, MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH) allocation (rather than one VirtualAlloc2 per 64 KiB page) gives the whole run one AllocationBase.
  3. Preserve dirty state across promote-out (MEM_WRITE_WATCH -> MapViewOfFile3):
    • Right before VirtualFree destroys the private MEM_WRITE_WATCH allocation during promote-out, harvest its GetWriteWatch dirty bits (or mark the page dirty in watch.rs) after copying the 64 KiB bytes into the backing section — otherwise any title writes made between the last submission and the promote-out would lose their kernel dirty bit when the private region is freed.
  4. Wrap promote-out in remapping_and_views / title_memory_remapping_of + 3-line VEH write retry:
    • Running the 3-step VirtualFree -> MEM_RESERVE_PLACEHOLDER -> MapViewOfFile3 inside watch::title_memory_remapping_of(&[(va, len)]) plus adding if ours.is_none() && came_back(at, true) { return EXCEPTION_CONTINUE_EXECUTION; } in the VEH write-fault branch (watch.rs:3974-4004) protects against both concurrent refresh and 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!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7262357331 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7262357331). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T20:47:14Z. --- @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.rs` trace so they don't bite you on the first pass: 1. **Registering with `watch.rs` (`TRACKED` vs `is_view`):** - Simply replacing a placeholder with `MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH` makes `mbi.Type == MEM_PRIVATE` (so it drops off the `MEM_MAPPED` guard path), **but** `watch.rs` only harvests `GetWriteWatch` bits for regions registered in its write-watch tracking (`TRACKED` / `Tracked`). Make sure promoted-in `XMem` regions are registered with `watch.rs` on map (and unregistered on unmap/promote-out) so `copy_stale` actually sees their 4 KiB dirty bits after frame 1. 2. **Coalesce contiguous single-mapped pages in `XMemMapPhysicalPages` where possible:** - Because Windows `GetWriteWatch` refuses queries that cross `AllocationBase` boundaries (the 390 cross-reservation refusals @dyshay noted above), coalescing a contiguous run of fresh single-mapped 64 KiB pages into a single `VirtualAlloc2(..., run_bytes, MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH)` allocation (rather than one `VirtualAlloc2` per 64 KiB page) gives the whole run one `AllocationBase`. 3. **Preserve dirty state across `promote-out` (`MEM_WRITE_WATCH -> MapViewOfFile3`):** - Right before `VirtualFree` destroys the private `MEM_WRITE_WATCH` allocation during `promote-out`, harvest its `GetWriteWatch` dirty bits (or mark the page dirty in `watch.rs`) after copying the 64 KiB bytes into the backing section — otherwise any title writes made between the last submission and the `promote-out` would lose their kernel dirty bit when the private region is freed. 4. **Wrap `promote-out` in `remapping_and_views` / `title_memory_remapping_of` + 3-line VEH write retry:** - Running the 3-step `VirtualFree -> MEM_RESERVE_PLACEHOLDER -> MapViewOfFile3` inside `watch::title_memory_remapping_of(&[(va, len)])` plus adding `if ours.is_none() && came_back(at, true) { return EXCEPTION_CONTINUE_EXECUTION; }` in the VEH write-fault branch (`watch.rs:3974-4004`) protects against both concurrent `refresh` and 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 commented 2026-11-29 20:47:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T20:47:30Z.


@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:

  • The census split is queued. It's three groups: single-mapped and never remapped, aliased or remapped, and no view known. It counts pages, guard faults, wait ms and MB copied for each, on the house scene in Series X and in Series S with RT. I'll post that table here as soon as it runs, so you have the share before you go past the simple case. Releases during loading count as remaps, so the single-mapped share is a lower bound.
  • Your VICTORY_LIGHT_REFRESH=0 result (-22 %) matches what we expected. Our same-exe run of it is queued too, as a cross-check on a 24 GB card.
  • A cost to know about when comparing bases: #2618 (buffer lookups past 64 entries) cost us ~4 ms a frame on both profiles (Series X 42.0 → 38.8 ms, Series S RT 51.5 → 46.6 ms with 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7262360749 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7262360749). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T20:47:30Z. --- @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: - **The census split is queued.** It's three groups: single-mapped and never remapped, aliased or remapped, and no view known. It counts pages, guard faults, wait ms and MB copied for each, on the house scene in Series X and in Series S with RT. I'll post that table here as soon as it runs, so you have the share before you go past the simple case. Releases during loading count as remaps, so the single-mapped share is a lower bound. - **Your `VICTORY_LIGHT_REFRESH=0` result** (-22 %) matches what we expected. Our same-exe run of it is queued too, as a cross-check on a 24 GB card. - **A cost to know about when comparing bases:** #2618 (buffer lookups past 64 entries) cost us ~4 ms a frame on both profiles (Series X 42.0 → 38.8 ms, Series S RT 51.5 → 46.6 ms with `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 commented 2026-11-29 21:16:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-29T21:16:47Z.


Bisect update for the slowdown on the 5900X + RTX 3090. The first-parent bisect of e1f2eb6..829188e couldn'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 on 568c5e5d, 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.

tip fps (median / 10th pct) p95 frame frame / preparing copying back frames over 100 ms
e1f2eb6 (earlier, two runs) 17-18 / 14 74-77 ms 58.8-61.1 / 44.0-44.8 ms 6.3-6.6 ms 12-21
wave-1 f53e1b87 (the title crashed while loading, a Breakpad crash in the game; will retry)
wave-2 38f23bc6 17 / 14 74.5 ms 58.5 / 48.4 ms 6.7 ms 20
wave-3 4111a0ed 16 / 12 83.6 ms 61.4 / 49.7 ms 6.4 ms 91
wave-4 b6212c33 13 / 5 323.8 ms 78.2 / 48.1 ms 10.1 ms 202
wave-5 6de00a4d 17 / 11 94.8 ms 57.6 / 44.7 ms 6.2 ms 175
wave-6 86a1681a 17 / 13 80.3 ms 58.7 / 45.7 ms 7.4 ms 27

Wave 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 testing fb0a48b6 (just before #1442), 42161359 (just after) and bb443567 (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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7262748872 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7262748872). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-29T21:16:47Z. --- Bisect update for the slowdown on the 5900X + RTX 3090. The first-parent bisect of `e1f2eb6..829188e` couldn'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 on `568c5e5d`, `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. | tip | fps (median / 10th pct) | p95 frame | frame / preparing | copying back | frames over 100 ms | |---|---|---|---|---|---| | `e1f2eb6` (earlier, two runs) | 17-18 / 14 | 74-77 ms | 58.8-61.1 / 44.0-44.8 ms | 6.3-6.6 ms | 12-21 | | wave-1 `f53e1b87` | (the title crashed while loading, a Breakpad crash in the game; will retry) | | | | | | wave-2 `38f23bc6` | 17 / 14 | 74.5 ms | 58.5 / 48.4 ms | 6.7 ms | 20 | | wave-3 `4111a0ed` | 16 / 12 | 83.6 ms | 61.4 / 49.7 ms | 6.4 ms | 91 | | **wave-4 `b6212c33`** | **13 / 5** | **323.8 ms** | **78.2 / 48.1 ms** | **10.1 ms** | **202** | | wave-5 `6de00a4d` | 17 / 11 | 94.8 ms | 57.6 / 44.7 ms | 6.2 ms | 175 | | wave-6 `86a1681a` | 17 / 13 | 80.3 ms | 58.7 / 45.7 ms | 7.4 ms | 27 | **Wave 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 testing `fb0a48b6` (just before #1442), `42161359` (just after) and `bb443567` (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 commented 2026-11-29 21:35:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-29T21:35:38Z.


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:

guard faults per 5 s in the world faults distinct 64 KiB pages
page at one address, mapped fresh ~37,000 ~650
page at one address, not fresh 0 0
page at several addresses ~24,000 300-1,000
no view of ours 0-250

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 in xmem.rs and watch.rs):

  • Fresh pages that XMemMapPhysicalPages maps at one address get VirtualAlloc2(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.
  • A promote copies the bytes back into the section, frees to the placeholder and maps the view. It happens before any second mapping (map_pages, alias_as, change/scatter), on unmap, and on the title's own VirtualFree there.
  • DirectStorage gets no window on private pages, and write_physical writes 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:

  • While loading, 6,351 private views were made, and 6,345 of them were promoted again, copying 6.6 GB back into sections. Streamed pool pages are almost all aliased soon after they're mapped. That added about 8 s to load time.
  • In the world, 6 views stay private, 185 MB in all: the title's 32-bit graphics heap. All of the removed faults were there, and no promotes happen during play.

A/B, same exe, alternating off/on/off/on, 300 s each:

draws fps preparing copying back
off (486) ~7,200 21.7 32.8 ms 13.0 ms
on (487) ~6,950 22.2 35.1 ms 12.8 ms
on (489) ~6,950 22.0 35.0 ms 12.2 ms
off (486 / 488) ~6,000 22.0 / 21.9 32.6 / 33.6 ms 11.7 / 11.5 ms

No measurable gain, and preparing may be a little higher with it on. My reading:

  • The faults removed were on the title's own threads, writing that heap. They don't sit on the submitting thread, which is what limits the frame here.
  • What the submitting thread spends on guarded memory is the re-guarding and asking, and the kernel asking over the 185 MB heap costs about the same.
  • The aliased ~40% (the GPU's tiled-heap copies) is untouched by design.

Next steps, if anyone wants to take this further:

  • Promote-on-Alias only pays off where the title's own threads are the limit, maybe on CPUs with fewer cores.
  • "Privatize-on-hot" (convert a single-view page only after it faults repeatedly) would avoid the 6.6 GB of promotes at load, but it wouldn't change the result above.
  • The census is cheap and might be worth keeping: 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, on 829188e + #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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7262998225 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7262998225). Originally posted by [burber](https://github.com/burber) on 2026-11-29T21:35:38Z. --- 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: | guard faults per 5 s in the world | faults | distinct 64 KiB pages | |---|---|---| | page at one address, mapped fresh | ~37,000 | ~650 | | page at one address, not fresh | 0 | 0 | | page at several addresses | ~24,000 | 300-1,000 | | no view of ours | 0-250 | | 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 in `xmem.rs` and `watch.rs`): - Fresh pages that `XMemMapPhysicalPages` maps at one address get `VirtualAlloc2(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. - A promote copies the bytes back into the section, frees to the placeholder and maps the view. It happens before any second mapping (`map_pages`, `alias_as`, `change`/scatter), on unmap, and on the title's own `VirtualFree` there. - DirectStorage gets no window on private pages, and `write_physical` writes 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:** - While loading, 6,351 private views were made, and 6,345 of them were promoted again, copying 6.6 GB back into sections. Streamed pool pages are almost all aliased soon after they're mapped. That added about 8 s to load time. - In the world, 6 views stay private, 185 MB in all: the title's 32-bit graphics heap. All of the removed faults were there, and no promotes happen during play. **A/B, same exe, alternating off/on/off/on, 300 s each:** | | draws | fps | preparing | copying back | |---|---|---|---|---| | off (486) | ~7,200 | 21.7 | 32.8 ms | 13.0 ms | | on (487) | ~6,950 | 22.2 | 35.1 ms | 12.8 ms | | on (489) | ~6,950 | 22.0 | 35.0 ms | 12.2 ms | | off (486 / 488) | ~6,000 | 22.0 / 21.9 | 32.6 / 33.6 ms | 11.7 / 11.5 ms | No measurable gain, and preparing may be a little higher with it on. My reading: - The faults removed were on the title's own threads, writing that heap. They don't sit on the submitting thread, which is what limits the frame here. - What the submitting thread spends on guarded memory is the re-guarding and asking, and the kernel asking over the 185 MB heap costs about the same. - The aliased ~40% (the GPU's tiled-heap copies) is untouched by design. **Next steps, if anyone wants to take this further:** - Promote-on-Alias only pays off where the title's own threads are the limit, maybe on CPUs with fewer cores. - "Privatize-on-hot" (convert a single-view page only after it faults repeatedly) would avoid the 6.6 GB of promotes at load, but it wouldn't change the result above. - The census is cheap and might be worth keeping: `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`, on `829188e` + #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 commented 2026-11-29 21:39:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T21:39:20Z.


@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 is VICTORY_LIGHT_REFRESH=0 on 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263046379 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7263046379). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T21:39:20Z. --- @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 is `VICTORY_LIGHT_REFRESH=0` on 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 commented 2026-11-29 21:44:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-29T21:44:23Z.


@burber @dyshay WAIT — don't write Promote-on-Alias off as a negative result just yet!

First, huge props for getting 79305c5 running 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 (6 contiguous MEM_WRITE_WATCH views for the 185 MB 32-bit graphics heap) + exact 4 KiB parts!

We just audited burber/victory-fork@79305c5 to understand why preparing went up (32.8 -> 35.1 ms) instead of down — and found a massive accidental regression inside 79305c5's watch.rs hook that explains the entire +2.3 ms (and masked the real savings!):

Why preparing rose 32.8 -> 35.1 ms in 79305c5

  1. VICTORY_LIGHT_REFRESH (nothing_new_with) is disabled on the entire 185 MB graphics heap:
    • In writes(), publish() is only called for guarded branches (if light() && !by_guard.is_empty() { publish(&by_guard); } and else if guards_asked && light() { publish(...); }).
    • Private pieces continue early and never call publish(), so nothing_new_with can never answer clean for those 185 MB — remember you just measured VICTORY_LIGHT_REFRESH itself as worth ~17 ms / 22% FPS on this exact scene!
  2. VICTORY_ASK_ONCE / ask_ahead is bypassed — raw GetWriteWatch runs on EVERY writes() call:
    • private_pieces(first, last) calls kernel_written(a, b)? (a raw GetWriteWatch syscall) + locks PRIVATE_NEW.lock() directly inside every writes() call rather than querying the 6 private views once per submission via ask_ahead and reading the snapshot in writes().
    • Plus private_pieces() takes PRIVATE.read() on every writes() call (even when there are no private ranges in play, or on every refresh).

5-second sanity check on your existing 486 vs 487 logs

Before even touching code, check the copies MB/frame and write watch: N askings, M ms lines in your existing 486 (off) vs 487 (on) logs:

  • Because 79305c5 did keep 4 KiB parts, copies MB/frame probably dropped significantly, while write watch askings & ms probably exploded from calling kernel_written per refresh without ask_ahead/publish()!

Tiny fix to test the real win of Promote-on-Alias

  1. Call publish(&pages) for private pieces just like guarded pieces so VICTORY_LIGHT_REFRESH stays active on the 185 MB heap.
  2. Feed those 6 private ranges into ask_ahead (1 batched GetWriteWatch per submission across 6 contiguous views instead of thousands per frame) and read from the ahead snapshot in writes().
  3. Gate private_pieces() with an atomic count/flag and clear PRIVATE_NEW once on first touch instead of locking a mutex per refresh.

If 79305c5 almost broke even (32.8 -> 35.1 ms) while bypassing both VICTORY_ASK_ONCE and VICTORY_LIGHT_REFRESH on the hottest 185 MB heap, wiring those 6 views into ask_ahead + publish() could swing preparing sharply into the green!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263112330 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7263112330). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T21:44:23Z. --- @burber @dyshay WAIT — don't write Promote-on-Alias off as a negative result just yet! First, huge props for getting `79305c5` running 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 (`6` contiguous `MEM_WRITE_WATCH` views for the `185 MB` 32-bit graphics heap) + exact 4 KiB `parts`! We just audited `burber/victory-fork@79305c5` to understand why `preparing` went **up** (`32.8 -> 35.1 ms`) instead of down — and found a **massive accidental regression inside `79305c5`'s `watch.rs` hook** that explains the entire `+2.3 ms` (and masked the real savings!): ### Why `preparing` rose `32.8 -> 35.1 ms` in `79305c5` 1. **`VICTORY_LIGHT_REFRESH` (`nothing_new_with`) is disabled on the entire 185 MB graphics heap:** - In `writes()`, `publish()` is only called for guarded branches (`if light() && !by_guard.is_empty() { publish(&by_guard); }` and `else if guards_asked && light() { publish(...); }`). - Private pieces `continue` early and **never call `publish()`**, so `nothing_new_with` can never answer clean for those 185 MB — remember you just measured `VICTORY_LIGHT_REFRESH` itself as worth **~17 ms / 22% FPS** on this exact scene! 2. **`VICTORY_ASK_ONCE` / `ask_ahead` is bypassed — raw `GetWriteWatch` runs on EVERY `writes()` call:** - `private_pieces(first, last)` calls `kernel_written(a, b)?` (a raw `GetWriteWatch` syscall) + locks `PRIVATE_NEW.lock()` **directly inside every `writes()` call** rather than querying the 6 private views **once per submission** via `ask_ahead` and reading the snapshot in `writes()`. - Plus `private_pieces()` takes `PRIVATE.read()` on every `writes()` call (even when there are no private ranges in play, or on every refresh). ### 5-second sanity check on your existing `486` vs `487` logs Before even touching code, check the `copies` MB/frame and `write watch: N askings, M ms` lines in your existing `486` (off) vs `487` (on) logs: - Because `79305c5` *did* keep 4 KiB `parts`, **`copies` MB/frame probably dropped significantly**, while **`write watch` askings & ms probably exploded** from calling `kernel_written` per refresh without `ask_ahead`/`publish()`! ### Tiny fix to test the real win of Promote-on-Alias 1. Call `publish(&pages)` for private pieces just like guarded pieces so `VICTORY_LIGHT_REFRESH` stays active on the 185 MB heap. 2. Feed those 6 private ranges into `ask_ahead` (1 batched `GetWriteWatch` per submission across 6 contiguous views instead of thousands per frame) and read from the ahead snapshot in `writes()`. 3. Gate `private_pieces()` with an atomic count/flag and clear `PRIVATE_NEW` once on first touch instead of locking a mutex per refresh. If `79305c5` almost broke even (`32.8 -> 35.1 ms`) *while bypassing both `VICTORY_ASK_ONCE` and `VICTORY_LIGHT_REFRESH` on the hottest 185 MB heap*, wiring those 6 views into `ask_ahead` + `publish()` could swing `preparing` sharply into the green!
burber commented 2026-11-29 21:47:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-29T21:47:37Z.


@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):

submissions asking the write watch title bytes under flights' writes refreshes refreshes known to copy nothing
off (486 / 488) 37.9 / 38.1 ms 3.6 / 3.6 ms 1.2 / 1.2 ms 12.8 / 13.4 ms 85% / 85%
on (487 / 489) 41.0 / 40.8 ms 4.1 / 4.2 ms 2.3 / 2.2 ms 14.6 / 14.4 ms 85% / 85%

So it costs the submitting thread about 3 ms with it on, as you guessed. The causes look different from yours, though:

  • The light refresh isn't lost. The share of refreshes known to copy nothing is 85% both ways. Private pieces are answered from the ahead snapshot like any write-watched memory, because writes() checks ahead before 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.
  • Where the 3 ms goes: about 1.1 ms more putting the title's bytes under flights' writes, about 0.5 ms more asking the write watch, and about 1.5 ms more in refreshes. My guess is that landing writes into the private heap now set its write-watch bits, so those pages read as written by the title and get sent up again. Guarded views avoid that by landing beside the guard.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263154717 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7263154717). Originally posted by [burber](https://github.com/burber) on 2026-11-29T21:47:37Z. --- @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): | | submissions | asking the write watch | title bytes under flights' writes | refreshes | refreshes known to copy nothing | |---|---|---|---|---|---| | off (486 / 488) | 37.9 / 38.1 ms | 3.6 / 3.6 ms | 1.2 / 1.2 ms | 12.8 / 13.4 ms | 85% / 85% | | on (487 / 489) | 41.0 / 40.8 ms | 4.1 / 4.2 ms | 2.3 / 2.2 ms | 14.6 / 14.4 ms | 85% / 85% | So it costs the submitting thread about 3 ms with it on, as you guessed. The causes look different from yours, though: - **The light refresh isn't lost.** The share of refreshes known to copy nothing is 85% both ways. Private pieces are answered from the ahead snapshot like any write-watched memory, because `writes()` checks `ahead` before 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. - **Where the 3 ms goes:** about 1.1 ms more putting the title's bytes under flights' writes, about 0.5 ms more asking the write watch, and about 1.5 ms more in refreshes. My guess is that landing writes into the private heap now set its write-watch bits, so those pages read as written by the title and get sent up again. Guarded views avoid that by landing beside the guard. 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 commented 2026-11-29 22:01:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-29T22:01:43Z.


@burber Great catch — thanks for pulling those exact lines from 486–489, and you're completely right on both points:

  1. Published requires read-only protection so private MEM_WRITE_WATCH pages can't use publish().
  2. The lack of a BESIDE section alias causing relay landing writes to dirty the private heap's write-watch bits (1.2 -> 2.3 ms under flights' writes + +1.5 ms refreshes) 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/frame blocks 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!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263343439 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7263343439). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T22:01:43Z. --- @burber Great catch — thanks for pulling those exact lines from `486–489`, and you're completely right on both points: 1. `Published` requires read-only protection so private `MEM_WRITE_WATCH` pages can't use `publish()`. 2. The lack of a `BESIDE` section alias causing relay landing writes to dirty the private heap's write-watch bits (`1.2 -> 2.3 ms` under flights' writes + `+1.5 ms` refreshes) 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/frame` blocks 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 commented 2026-11-29 22:39:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-29T22:39:08Z.


@burber @dyshay Traced both the 24 ms for 3.7 MB landing hot path (land.rs + shadow.rs on current main) and the ~4 ms/frame #2618 (VICTORY_LOOKUP_SPAN) cost — found exact code bottlenecks for both:

1. Where 24 ms for 3.7 MB goes in landing (~150 MB/s effective merge rate)

In #2858's breakdown (landing in all 24–29 ms: merging 8.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 than memcmp + memcpy because fixed per-piece overhead runs on every 64 KiB / 256 KiB slice instead of once per buffer:

  1. land.rs:423–438 (jobs()): splits a single Shadow into separate jobs every 256 KiB on 64 KiB boundaries, so one buffer is re-entered 4–16 times across worker jobs.
  2. shadow.rs:7188–7204 (land_card): every 256 KiB job re-acquires merging.read() (:7193), dirty.lock() + sent.lock() (:7197–7198), and allocates fresh skip (:7199) and parts (:7204) vectors.
  3. Per-64 KiB piece_at (shadow.rs:628–698 -> watch.rs:3196–3204, 2628–2641): each 64 KiB piece runs a full safecopy::differ pass, then calls watch::landing (acquiring the GUARDS lock + VirtualProtect per piece — the comment at land.rs:489–499 explicitly notes "5 000 changes of protection a frame, which wait for the address-space lock"), then a second for_pages + merge pass.
  4. Redundant HashSet allocations (shadow.rs:7666, 7698, 7713): allocates/hashes a HashSet even though pieces are already sorted/deduped at :7688–7689.

Fix idea (~80–100 lines): batch jobs() by Shadow (or larger spans) so merging/dirty/sent locks and skip/parts run once per buffer, coalesce the dirty ranges to call watch::landing once per contiguous span instead of per 64 KiB piece, and drop the redundant HashSet. 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 ms

In #2618's diff:

  • The fallback fires on every miss of the 64-entry window across extent, peek, lookup, and in_buffer.
  • On each miss it acquires a second BIG_BUFFERS: RwLock<BTreeMap<(u64, usize), u64>> (written under BUFFERS.write() on every register/unregister across 17 recording threads) and walks up to 64 entries doing a map.get() back into BUFFERS per candidate (~800–1,600 misses/frame × 2–5 µs = ~3.5–4.9 ms/frame).
  • Near-zero-cost alternative: keep two atomics (BIG_MIN_START / BIG_MAX_END) to reject out-of-range misses in 2 atomic loads with zero locks, backed by a small sorted Vec<(u64, u64, ...)> of the few dozen >= 1 MiB buffers with prefix_max_end (partition_point binary search in O(log K) with no secondary BTreeMap::get).
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263842965 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7263842965). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T22:39:08Z. --- @burber @dyshay Traced both the **24 ms for 3.7 MB landing** hot path (`land.rs` + `shadow.rs` on current `main`) and the **~4 ms/frame `#2618` (`VICTORY_LOOKUP_SPAN`)** cost — found exact code bottlenecks for both: ### 1. Where `24 ms` for `3.7 MB` goes in `landing` (~150 MB/s effective merge rate) In `#2858`'s breakdown (`landing in all` 24–29 ms: `merging` 8.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 than `memcmp + memcpy` because fixed per-piece overhead runs on every 64 KiB / 256 KiB slice instead of once per buffer: 1. **`land.rs:423–438` (`jobs()`):** splits a single `Shadow` into separate jobs every **256 KiB** on 64 KiB boundaries, so one buffer is re-entered 4–16 times across worker jobs. 2. **`shadow.rs:7188–7204` (`land_card`):** every 256 KiB job re-acquires `merging.read()` (`:7193`), `dirty.lock()` + `sent.lock()` (`:7197–7198`), and allocates fresh `skip` (`:7199`) and `parts` (`:7204`) vectors. 3. **Per-64 KiB `piece_at` (`shadow.rs:628–698` -> `watch.rs:3196–3204, 2628–2641`):** each 64 KiB piece runs a full `safecopy::differ` pass, then calls `watch::landing` (acquiring the `GUARDS` lock + `VirtualProtect` per piece — the comment at `land.rs:489–499` explicitly notes *"5 000 changes of protection a frame, which wait for the address-space lock"*), then a second `for_pages + merge` pass. 4. **Redundant `HashSet` allocations (`shadow.rs:7666, 7698, 7713`):** allocates/hashes a `HashSet` even though pieces are already sorted/deduped at `:7688–7689`. **Fix idea (~80–100 lines):** batch `jobs()` by `Shadow` (or larger spans) so `merging`/`dirty`/`sent` locks and `skip`/`parts` run once per buffer, coalesce the dirty ranges to call `watch::landing` once per contiguous span instead of per 64 KiB piece, and drop the redundant `HashSet`. 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 ms In `#2618`'s diff: - The fallback fires on **every miss** of the 64-entry window across `extent`, `peek`, `lookup`, and `in_buffer`. - On each miss it acquires a second `BIG_BUFFERS: RwLock<BTreeMap<(u64, usize), u64>>` (written under `BUFFERS.write()` on every `register`/`unregister` across 17 recording threads) and walks up to 64 entries doing a `map.get()` back into `BUFFERS` per candidate (~800–1,600 misses/frame × 2–5 µs = ~3.5–4.9 ms/frame). - **Near-zero-cost alternative:** keep two atomics (`BIG_MIN_START` / `BIG_MAX_END`) to reject out-of-range misses in 2 atomic loads with zero locks, backed by a small sorted `Vec<(u64, u64, ...)>` of the few dozen `>= 1 MiB` buffers with `prefix_max_end` (`partition_point` binary search in `O(log K)` with no secondary `BTreeMap::get`).
meonline42 commented 2026-11-29 22:39:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-29T22:39:17Z.


@dyshay #1442 (27d312d3) is not what slows this machine down. I merged it alone onto 568c5e5d (e1f2eb6's parent) and ran the same scene and method as the wave table above (829188e's launcher defaults, frame generation off, 240 s):

copying back frame preparing draws frames over 100 ms
e1f2eb6 (earlier) 6.3-6.6 ms 58.8-61.1 ms 44.0-44.8 ms 7,300-8,400 12-21
568c5e5d + #1442 alone 6.9 ms 55.2 ms 44.6 ms 6,194 17
wave-4 tip b6212c33 10.1 ms 78.2 ms 48.1 ms 6,392 202

So the VICTORY_LIGHT_REFRESH=0 check 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 of 568c5e5d. 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263844704 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7263844704). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-29T22:39:17Z. --- @dyshay #1442 (`27d312d3`) is **not** what slows this machine down. I merged it alone onto `568c5e5d` (`e1f2eb6`'s parent) and ran the same scene and method as the wave table above (`829188e`'s launcher defaults, frame generation off, 240 s): | | copying back | frame | preparing | draws | frames over 100 ms | |---|---|---|---|---|---| | `e1f2eb6` (earlier) | 6.3-6.6 ms | 58.8-61.1 ms | 44.0-44.8 ms | 7,300-8,400 | 12-21 | | `568c5e5d` + #1442 alone | 6.9 ms | 55.2 ms | 44.6 ms | 6,194 | 17 | | wave-4 tip `b6212c33` | 10.1 ms | 78.2 ms | 48.1 ms | 6,392 | 202 | So the `VICTORY_LIGHT_REFRESH=0` check 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 of `568c5e5d`. 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 commented 2026-11-29 22:39:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by DoubleD17 on 2026-11-29T22:39:48Z.


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:

  • RTX 5070 12 GB, Ryzen 7 5800X, 64 GB RAM, Windows 11;
  • main f72cec77, Series X, 1440p, DLSS Performance, frame generation and ray tracing off;
  • cache fully preloaded, same save, standing still;
  • 150 s per run, alternating control / port, medians of the 5 s host lines.

We also ran a burst picture check: 10 captures a second, counting one-frame artifacts.

control (2 runs) VICTORY_PORT_CONSTANTS=1 (3 runs)
fps (mean) 12.6 / 14.3 4.9 / 4.9 / 4.8
frame p95 96 / 84 ms 368 / 370 / 342 ms
card busy (GPU utilisation) 59 / 57 % 99 / 99 / 99 %
preparing, submitting thread 69 / 61 ms 87 / 81 / 81 ms
refresh time per frame 22.5 / 20.8 ms 15.5 / 13.4 / 13.8 ms
shared memory, steady 7.5 / 7.8 GB 8.1 / 7.4 / 8.2 GB
one-frame artifacts 0 / 80 0 / 380

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:

  • only ranges read once or twice per write (constants, upload rings) should go in place;
  • anything read many times per frame, such as skinning output or buffers several passes sample, should keep a card copy.

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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263851186 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7263851186). Originally posted by [DoubleD17](https://github.com/DoubleD17) on 2026-11-29T22:39:48Z. --- 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:** - RTX 5070 12 GB, Ryzen 7 5800X, 64 GB RAM, Windows 11; - main f72cec77, Series X, 1440p, DLSS Performance, frame generation and ray tracing off; - cache fully preloaded, same save, standing still; - 150 s per run, alternating control / port, medians of the 5 s host lines. We also ran a burst picture check: 10 captures a second, counting one-frame artifacts. | | control (2 runs) | `VICTORY_PORT_CONSTANTS=1` (3 runs) | |---|---|---| | fps (mean) | 12.6 / 14.3 | 4.9 / 4.9 / 4.8 | | frame p95 | 96 / 84 ms | 368 / 370 / 342 ms | | card busy (GPU utilisation) | 59 / 57 % | 99 / 99 / 99 % | | preparing, submitting thread | 69 / 61 ms | 87 / 81 / 81 ms | | refresh time per frame | 22.5 / 20.8 ms | 15.5 / 13.4 / 13.8 ms | | shared memory, steady | 7.5 / 7.8 GB | 8.1 / 7.4 / 8.2 GB | | one-frame artifacts | 0 / 80 | 0 / 380 | 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: - only ranges read once or twice per write (constants, upload rings) should go in place; - anything read many times per frame, such as skinning output or buffers several passes sample, should keep a card copy. 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 commented 2026-11-29 22:41:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T22:41:03Z.


Cross-check of VICTORY_LIGHT_REFRESH=0 on an RTX 4090 (i9, 64 GB), Series X house, same exe, 300 s:

median p95 preparing card
default (light refresh on) 40.7 ms 405 ms* 32.5 ms 20 ms
VICTORY_LIGHT_REFRESH=0 65.6 ms 105 ms 56.6 ms 23 ms

*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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263867255 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7263867255). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T22:41:03Z. --- Cross-check of `VICTORY_LIGHT_REFRESH=0` on an RTX 4090 (i9, 64 GB), Series X house, same exe, 300 s: | | median | p95 | preparing | card | |---|---|---|---|---| | default (light refresh on) | 40.7 ms | 405 ms* | 32.5 ms | 20 ms | | `VICTORY_LIGHT_REFRESH=0` | 65.6 ms | 105 ms | 56.6 ms | 23 ms | *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 commented 2026-11-29 22:48:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-29T22:48:15Z.


@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 on 5b66a1d0!):

1. Segment A (bb443567 .. 53c7e9e2): 8f0a0c24 turned VICTORY_WAVE_FOLDED=1 ON by default

  • Commit 8f0a0c24 ("Shaders: wave64 programs folded exactly onto 32-lane hosts (VICTORY_WAVE_FOLDED, on)", merged via #1504 at 0f0ec9d4) lands right in Segment A (bb443567 .. 53c7e9e2).
  • It folds 175 Wave64 programs onto 32-lane warps (2x shader work on the GPU), which saturates a 60%-busy RTX 3090 to 100% GPU-bound — leaving CPU preparing flat (44.6 -> 48.1 ms) while pushing frame from 55.2 -> 78.2 ms and p95 to 323.8 ms (202 frames > 100 ms)!
  • (Note: upstream main has already flipped VICTORY_WAVE_FOLDED back to off by default in fold.rs:55-63 because of this exact GPU cliff; on b6212c33 or 829188e you can test it directly with VICTORY_WAVE_FOLDED=0).

2. Segment D (3de2396d .. b6212c33): Correction on 5b66a1d0 — it DOES affect 24 GB cards (3090 / 4090) and explains copying back 6.5 -> 16.5 ms!

  • Correction to our earlier static check: in shadow.rs:294-305, 5b66a1d0 didn't only change the 12–20 GiB band — on >= 20 GiB cards (3090 / 4090), the floor was ALSO lowered from 4 MiB to 1 MiB ((1, (b / 4).clamp(512, 4096)))!
  • The comment at shadow.rs:294-302 literally 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."
  • Moving dozens of 1–4 MiB buffers onto the card on 24 GB GPUs is what added all those extra per-submission CARD_COMPARE + fetch + relay landing pieces (copying back 6.5 -> 16.5 ms, relay landing 17 -> 37 ms)!
  • Zero-rebuild test on 829188e right now:
    VICTORY_CARD_BUFFERS_MIN_MB=4
    Running 829188e with VICTORY_CARD_BUFFERS_MIN_MB=4 (and VICTORY_WAVE_FOLDED=0) restores the pre-5b66a1d0 4 MiB threshold and pre-8f0a0c24 Wave32 shaders with zero rebuilds!

(Note on checkpoint order: in the git graph 6b2b723d is actually an ancestor of 3de2396d, so the chain is bb443567 -> 53c7e9e2 -> 6b2b723d -> 3de2396d -> b6212c33.)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263961939 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7263961939). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T22:48:15Z. --- @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 on `5b66a1d0`!): ### 1. Segment A (`bb443567 .. 53c7e9e2`): `8f0a0c24` turned `VICTORY_WAVE_FOLDED=1` ON by default - Commit `8f0a0c24` (*"Shaders: wave64 programs folded exactly onto 32-lane hosts (`VICTORY_WAVE_FOLDED`, on)"*, merged via `#1504` at `0f0ec9d4`) lands right in Segment A (`bb443567 .. 53c7e9e2`). - It folds 175 Wave64 programs onto 32-lane warps (2x shader work on the GPU), which saturates a 60%-busy RTX 3090 to 100% GPU-bound — leaving CPU `preparing` flat (`44.6 -> 48.1 ms`) while pushing `frame` from `55.2 -> 78.2 ms` and `p95` to `323.8 ms` (`202` frames > 100 ms)! - *(Note: upstream `main` has already flipped `VICTORY_WAVE_FOLDED` back to **off by default** in `fold.rs:55-63` because of this exact GPU cliff; on `b6212c33` or `829188e` you can test it directly with **`VICTORY_WAVE_FOLDED=0`**).* ### 2. Segment D (`3de2396d .. b6212c33`): Correction on `5b66a1d0` — it DOES affect 24 GB cards (`3090` / `4090`) and explains `copying back 6.5 -> 16.5 ms`! - Correction to our earlier static check: in `shadow.rs:294-305`, `5b66a1d0` didn't only change the 12–20 GiB band — **on `>= 20 GiB` cards (`3090` / `4090`), the floor was ALSO lowered from `4 MiB` to `1 MiB` (`(1, (b / 4).clamp(512, 4096))`)!** - The comment at `shadow.rs:294-302` literally 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."** - Moving dozens of 1–4 MiB buffers onto the card on 24 GB GPUs is what added all those extra per-submission `CARD_COMPARE` + `fetch` + `relay landing` pieces (`copying back 6.5 -> 16.5 ms`, `relay landing 17 -> 37 ms`)! - **Zero-rebuild test on `829188e` right now:** **`VICTORY_CARD_BUFFERS_MIN_MB=4`** Running `829188e` with `VICTORY_CARD_BUFFERS_MIN_MB=4` (and `VICTORY_WAVE_FOLDED=0`) restores the pre-`5b66a1d0` 4 MiB threshold and pre-`8f0a0c24` Wave32 shaders with zero rebuilds! *(Note on checkpoint order: in the git graph `6b2b723d` is actually an ancestor of `3de2396d`, so the chain is `bb443567 -> 53c7e9e2 -> 6b2b723d -> 3de2396d -> b6212c33`.)*
dyshay commented 2026-11-29 23:05:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T23:05:21Z.


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:

region class (title's protection) refreshes time looked at sent askings (refused)
0x700000000 + 0x600000000 CPU-less (0x801) 1,473 49.1 ms 4.3 GB 22.9 MB 284 (284)
0xe7f0000 + 0x1b00000 write-combined, CPU only 39 4.4 ms 558 MB 9.9 MB 0 (99 guard faults)
0xd49400000 + 0x89700000 write-combined 2,824 0.2 ms 1.2 GB 0 73 (0)
all others < 1 ms each

Guarded memory by mapping, the split asked for:

64 KiB pages guard faults waiting MB taken
single-mapped, never remapped 2,961 195 0.55 ms 15.5
aliased or remapped 209,152 279 0.03 ms 26.7
no view known 0

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 CPU-less region dominates. Every write-watch asking there is refused (284/284), so each of its 1,473 refreshes falls back to the slow path: 49 ms a frame across the threads. The title's CPU can't read that memory on the console, and its writer is "nobody lately" by our per-page tracking. Still, 22.9 MB a frame is sent from it, so something does write it: likely DMA/copy-engine work that we perform on the CPU.
  • Two targeted steps follow:
    1. Stop the refusals: one asking per reservation (ScarlettPort c74db40), or an exact answer for this class.
    2. Item 1 for this class: find what writes it, and keep those writes on the card instead of refreshing 4.3 GB a frame.

The Series S + RT census run is next. I'll add it here.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7264185714 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7264185714). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T23:05:21Z. --- **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:** | region | class (title's protection) | refreshes | time | looked at | sent | askings (refused) | |---|---|---|---|---|---|---| | `0x700000000 + 0x600000000` | CPU-less (0x801) | 1,473 | **49.1 ms** | 4.3 GB | 22.9 MB | 284 (**284**) | | `0xe7f0000 + 0x1b00000` | write-combined, CPU only | 39 | 4.4 ms | 558 MB | 9.9 MB | 0 (99 guard faults) | | `0xd49400000 + 0x89700000` | write-combined | 2,824 | 0.2 ms | 1.2 GB | 0 | 73 (0) | | all others | | | < 1 ms each | | | | **Guarded memory by mapping**, the split asked for: | | 64 KiB pages | guard faults | waiting | MB taken | |---|---|---|---|---| | single-mapped, never remapped | 2,961 | 195 | 0.55 ms | 15.5 | | aliased or remapped | 209,152 | 279 | 0.03 ms | 26.7 | | no view known | | 0 | | | 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 CPU-less region dominates.** Every write-watch asking there is refused (284/284), so each of its 1,473 refreshes falls back to the slow path: 49 ms a frame across the threads. The title's CPU can't read that memory on the console, and its writer is "nobody lately" by our per-page tracking. Still, 22.9 MB a frame is sent from it, so something does write it: likely DMA/copy-engine work that we perform on the CPU. - Two targeted steps follow: 1. Stop the refusals: one asking per reservation (ScarlettPort c74db40), or an exact answer for this class. 2. Item 1 for this class: find what writes it, and keep those writes on the card instead of refreshing 4.3 GB a frame. The Series S + RT census run is next. I'll add it here.
burber commented 2026-11-29 23:39:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-29T23:39:03Z.


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):

ms
landing in all 23-24
…"the rest" (no named stage) 7.0
…read-backs and lists 2.8-3.4
…merging fetched pieces 2.3-2.6 (6-7 over 4 threads)
…waiting for fetches of card copies 2.6-2.8
…opening and noting guards 0.9-1.1
…waiting for the title's bytes going in 0.7-0.9
waiting for the card with nothing to land 16-19

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7264621174 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7264621174). Originally posted by [burber](https://github.com/burber) on 2026-11-29T23:39:03Z. --- 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): | | ms | |---|---| | landing in all | 23-24 | | …"the rest" (no named stage) | 7.0 | | …read-backs and lists | 2.8-3.4 | | …merging fetched pieces | 2.3-2.6 (6-7 over 4 threads) | | …waiting for fetches of card copies | 2.6-2.8 | | …opening and noting guards | 0.9-1.1 | | …waiting for the title's bytes going in | 0.7-0.9 | | waiting for the card with nothing to land | 16-19 | 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 commented 2026-11-29 23:39:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T23:39:20Z.


Thanks, all. Several things to fold in.

Corrections on our side:

  • @shiman1901 is right about 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=4 restores 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.
  • My census note above put the CPU-less region's cost on the refused askings. That was wrong for most of it. Those 284 refusals are only ~0.9 ms. The region is a 24 GiB runtime placeholder holding views of the title's physical pages, so GetWriteWatch always 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::landing per 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7264624808 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7264624808). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T23:39:20Z. --- Thanks, all. Several things to fold in. **Corrections on our side:** - @shiman1901 is right about 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=4` restores 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. - My census note above put the CPU-less region's cost on the refused askings. That was wrong for most of it. Those 284 refusals are only ~0.9 ms. The region is a 24 GiB runtime placeholder holding views of the title's physical pages, so `GetWriteWatch` always 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::landing` per 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 commented 2026-11-29 23:49:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by UlisesVoxer on 2026-11-29T23:49:30Z.


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 as
numbers 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:

  • The title's CPU cannot touch it (no CPU access), as you found.
  • All of its backed memory (about 3.2 GB in my run) was mapped at
    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.
  • Storage requests landed in it directly: about 4 MB a frame in my
    scene.
  • The layer's own reads of it were about 2.2 GB a frame, for texture
    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):

Buffer lives in Card reads at Shader stores at
Card memory 865 GB/s 133–134 GB/s
GPU upload heap same as card memory same as card memory
Host RAM (upload L0, custom write-back L0, opened in place) 19.5–20.6 GB/s 0.7 GB/s

(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:

  • The mapping can be placed at a chosen address (reserve the address
    space around a hole, then Map lands in it), so such a range
    could sit at the title's own address with no copy at all. Not run
    on the title yet.
  • A candidate: in my trace, the title's 2.2 GB write-combined range
    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_BAR put write-combined buffers in
CPU-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)

  • In my runs the title wrote about 14,000 constant-buffer views a
    frame at fresh addresses. A cache keyed on a table's contents will
    miss every frame because of those alone.
  • Buffer views in tables caused 72 % of all refreshes in one run,
    which may tie in with refresh count being what scales.
  • Suggestion: take constant buffers out of the table key first (root
    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

  • On my tree, same build and save, going from DDR4-2133 (XMP off)
    to 3200 took the frame from 179 to 122 ms and the submitting
    thread from 146 to 108 ms. No code change.
  • On this fork's v2026.11.29.02 at 3200, ray tracing off: 82 ms with
    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 a
frame 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7264754022 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7264754022). Originally posted by [UlisesVoxer](https://github.com/UlisesVoxer) on 2026-11-29T23:49:30Z. --- 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 as numbers 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: - The title's CPU cannot touch it (no CPU access), as you found. - All of its backed memory (about 3.2 GB in my run) was mapped at 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. - Storage requests landed in it directly: about 4 MB a frame in my scene. - The layer's own reads of it were about 2.2 GB a frame, for texture 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): | Buffer lives in | Card reads at | Shader stores at | |---|---|---| | Card memory | 865 GB/s | 133–134 GB/s | | GPU upload heap | same as card memory | same as card memory | | Host RAM (upload L0, custom write-back L0, opened in place) | 19.5–20.6 GB/s | 0.7 GB/s | (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: - The mapping can be placed at a chosen address (reserve the address space around a hole, then `Map` lands in it), so such a range could sit at the title's own address with no copy at all. Not run on the title yet. - A candidate: in my trace, the title's 2.2 GB write-combined range 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_BAR` put write-combined buffers in CPU-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) - In my runs the title wrote about 14,000 constant-buffer views a frame at fresh addresses. A cache keyed on a table's contents will miss every frame because of those alone. - Buffer views in tables caused 72 % of all refreshes in one run, which may tie in with refresh count being what scales. - Suggestion: take constant buffers out of the table key first (root 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 - On my tree, same build and save, going from DDR4-2133 (XMP off) to 3200 took the frame from 179 to 122 ms and the submitting thread from 146 to 108 ms. No code change. - On this fork's v2026.11.29.02 at 3200, ray tracing off: 82 ms with 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 a frame 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 commented 2026-11-29 23:54:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-29T23:54:10Z.


@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:

copying back frame preparing draws fps (bench median / 10th pct)
829188e 19.4 ms 65.3 ms 51.3 ms 6,897 15 / 7
829188e + VICTORY_WAVE_FOLDED=0 25.5 ms 81.0 ms 55.9 ms 10,422 (a heavier stretch) 14 / 8
829188e + WAVE_FOLDED=0 + CARD_BUFFERS_MIN_MB=4 20.3 ms 65.0 ms 51.5 ms 7,103 16 / 7
main 41adb551 (tonight's merges) 23.5 ms 59.9 ms 48.7 ms 6,844 17 / 7

Both suspects also land after where the copy-back growth already shows. Runs in my normal install, each built on 568c5e5d (e1f2eb6's parent):

copying back frame preparing
568c5e5d + #1442 alone 6.9 ms 55.2 ms 44.6 ms
wave-1 tip f53e1b87 (retry; the first run crashed while loading) 10.6 ms 68.7 ms 51.4 ms
wave-4 at fb0a48b6 (its first 9 merges: #1411 to #1441, before #1442 and #1504) 10.7 ms 61.0 ms 46.4 ms
wave-4 build-fix checkpoint bb443567 13.7 ms 64.7 ms 49.9 ms
wave-4 tip b6212c33 10.1 ms 78.2 ms 48.1 ms

So 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_FOLDED may 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 on 568c5e5d.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7264812792 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7264812792). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-29T23:54:10Z. --- @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: | | copying back | frame | preparing | draws | fps (bench median / 10th pct) | |---|---|---|---|---|---| | `829188e` | 19.4 ms | 65.3 ms | 51.3 ms | 6,897 | 15 / 7 | | `829188e` + `VICTORY_WAVE_FOLDED=0` | 25.5 ms | 81.0 ms | 55.9 ms | 10,422 (a heavier stretch) | 14 / 8 | | `829188e` + `WAVE_FOLDED=0` + `CARD_BUFFERS_MIN_MB=4` | 20.3 ms | 65.0 ms | 51.5 ms | 7,103 | 16 / 7 | | `main` `41adb551` (tonight's merges) | 23.5 ms | 59.9 ms | 48.7 ms | 6,844 | 17 / 7 | Both suspects also land **after** where the copy-back growth already shows. Runs in my normal install, each built on `568c5e5d` (`e1f2eb6`'s parent): | | copying back | frame | preparing | |---|---|---|---| | `568c5e5d` + #1442 alone | 6.9 ms | 55.2 ms | 44.6 ms | | wave-1 tip `f53e1b87` (retry; the first run crashed while loading) | 10.6 ms | 68.7 ms | 51.4 ms | | wave-4 at `fb0a48b6` (its first 9 merges: #1411 to #1441, before #1442 and #1504) | 10.7 ms | 61.0 ms | 46.4 ms | | wave-4 build-fix checkpoint `bb443567` | 13.7 ms | 64.7 ms | 49.9 ms | | wave-4 tip `b6212c33` | 10.1 ms | 78.2 ms | 48.1 ms | So 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_FOLDED` may 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 on `568c5e5d`. 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 commented 2026-11-30 00:12:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by DoubleD17 on 2026-11-30T00:12:35Z.


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:

  • Ryzen 7 5800X (8 cores), RTX 5070 12 GB, 64 GB RAM, Windows 11;
  • Series X, 1440p, DLSS Performance, frame generation and ray tracing off;
  • f72cec77 against 41adb551, alternating, 150 s each;
  • figures are medians of the 5 s host lines.

Method:

  • Every run starts from the same save, restored before each run. The title autosaves while it plays, so without that our runs drifted between night and day scenes, and that alone moved preparing by 10 ms or more.
  • The translator is unchanged between the two builds, so both run on the same preloaded cache (30–90 compiles per run on both).
f72cec77 (3 runs) 41adb551 (3 runs)
preparing, submitting thread 61.4 / 65.4 / 64.6 ms 60.6 / 66.3 / 60.9 ms
refresh time 20.4 / 20.7 / 20.0 ms 22.0 / 22.5 / 20.5 ms
fps (mean) 14.0 / 13.2 / 13.0 14.2 / 12.7 / 13.6
one-frame artifacts (burst, counted by eye) 0 / 0 / 0 0 / 0 / 0

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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7265063723 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7265063723). Originally posted by [DoubleD17](https://github.com/DoubleD17) on 2026-11-30T00:12:35Z. --- 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:** - Ryzen 7 5800X (8 cores), RTX 5070 12 GB, 64 GB RAM, Windows 11; - Series X, 1440p, DLSS Performance, frame generation and ray tracing off; - f72cec77 against 41adb551, alternating, 150 s each; - figures are medians of the 5 s host lines. **Method:** - Every run starts from the same save, restored before each run. The title autosaves while it plays, so without that our runs drifted between night and day scenes, and that alone moved preparing by 10 ms or more. - The translator is unchanged between the two builds, so both run on the same preloaded cache (30–90 compiles per run on both). | | f72cec77 (3 runs) | 41adb551 (3 runs) | |---|---|---| | preparing, submitting thread | 61.4 / 65.4 / 64.6 ms | 60.6 / 66.3 / 60.9 ms | | refresh time | 20.4 / 20.7 / 20.0 ms | 22.0 / 22.5 / 20.5 ms | | fps (mean) | 14.0 / 13.2 / 13.0 | 14.2 / 12.7 / 13.6 | | one-frame artifacts (burst, counted by eye) | 0 / 0 / 0 | 0 / 0 / 0 | 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 commented 2026-11-30 00:26:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-30T00:26:06Z.


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.rs that took the lock, via #[track_caller]). Per frame, all threads summed, from a 300 s diagnostics run:

taken at taken held ms waited ms
all ~550 5.0-5.9 18-29
guard(), first take ~150 0.2 9-15
guard(), retake for the scan and protect ~150 2.5-3.3 1.7-2.9
guard(), retake after each protect run ~110 1.7-2.1 0.2-1.1
publish() after the copy ~145 0.05 5-8
writing() ~20 0.1-0.2 1.3-2.2

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 at publish(), 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=50 is slower here. Release build, alternating, 300 s each, medians after the first minute in the world:

run switch fps draws
499 HOT=50 23.4 5,406
500 default 24.9 5,639
501 HOT=50 22.3 5,811
502 default 24.4 6,018

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7265265839 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7265265839). Originally posted by [burber](https://github.com/burber) on 2026-11-30T00:26:06Z. --- 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.rs` that took the lock, via `#[track_caller]`). Per frame, all threads summed, from a 300 s diagnostics run: | taken at | taken | held ms | waited ms | |---|---|---|---| | all | ~550 | 5.0-5.9 | 18-29 | | `guard()`, first take | ~150 | 0.2 | 9-15 | | `guard()`, retake for the scan and protect | ~150 | 2.5-3.3 | 1.7-2.9 | | `guard()`, retake after each protect run | ~110 | 1.7-2.1 | 0.2-1.1 | | `publish()` after the copy | ~145 | 0.05 | 5-8 | | `writing()` | ~20 | 0.1-0.2 | 1.3-2.2 | 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 at `publish()`, 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=50` is slower here.** Release build, alternating, 300 s each, medians after the first minute in the world: | run | switch | fps | draws | |---|---|---|---| | 499 | HOT=50 | 23.4 | 5,406 | | 500 | default | 24.9 | 5,639 | | 501 | HOT=50 | 22.3 | 5,811 | | 502 | default | 24.4 | 6,018 | 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 commented 2026-11-30 00:34:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T00:34:56Z.


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):

median p95 preparing copying back
default (1 MiB floor) 40.8 ms 72 ms 31.9 ms 8.7 ms
VICTORY_CARD_BUFFERS_MIN_MB=4 37.3 ms 54 ms 29.8 ms 8.7 ms

The 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7265396381 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7265396381). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T00:34:56Z. --- 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): | | median | p95 | preparing | copying back | |---|---|---|---|---| | default (1 MiB floor) | 40.8 ms | 72 ms | 31.9 ms | 8.7 ms | | `VICTORY_CARD_BUFFERS_MIN_MB=4` | 37.3 ms | 54 ms | 29.8 ms | 8.7 ms | The 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 commented 2026-11-30 00:39:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T00:39:09Z.


@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 current main behind one switch and A/B it in one run on the 4090, unless you're already rewriting guard(). 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7265458914 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7265458914). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T00:39:09Z. --- @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 current `main` behind one switch and A/B it in one run on the 4090, unless you're already rewriting `guard()`. 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 commented 2026-11-30 00:46:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T00:46:59Z.


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.

region class refreshes time sent
0x500000000 + 0x400000000 CPU-less (0x801) 1,298 52.4 ms 23.5 MB
0x16630000 + 0x1b00000 write-combined, CPU only 38 4.2 ms 8.4 MB
0xb94610000 + 0x6feb0000 write-combined 159 2.8 ms 7.4 MB
all others ≤ 1 ms each

Guarded memory by mapping:

64 KiB pages guard faults waiting MB taken
single-mapped, never remapped 3,936 205 0.52 ms 13.5
aliased or remapped 152,456 226 0.04 ms 30.2

It's the same picture as Series X. The Series S profile puts its CPU-less pool at 0x500000000 (16 GiB) instead of 0x700000000, 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 and publish()) 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:

  1. The convoy (claim per 64 KiB block, lock dropped while working), A/B'd in one run on a static save. Small effects drown in this cutscene's shot changes, so 30 s phases aren't enough below ~2 ms.
  2. Tracking by physical page for the aliased CPU-less views, as UlisesVoxer suggested.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7265572927 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7265572927). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T00:46:59Z. --- **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. | region | class | refreshes | time | sent | |---|---|---|---|---| | `0x500000000 + 0x400000000` | CPU-less (0x801) | 1,298 | **52.4 ms** | 23.5 MB | | `0x16630000 + 0x1b00000` | write-combined, CPU only | 38 | 4.2 ms | 8.4 MB | | `0xb94610000 + 0x6feb0000` | write-combined | 159 | 2.8 ms | 7.4 MB | | all others | | | ≤ 1 ms each | | Guarded memory by mapping: | | 64 KiB pages | guard faults | waiting | MB taken | |---|---|---|---|---| | single-mapped, never remapped | 3,936 | 205 | 0.52 ms | 13.5 | | aliased or remapped | 152,456 | 226 | 0.04 ms | 30.2 | It's the same picture as Series X. The Series S profile puts its CPU-less pool at `0x500000000` (16 GiB) instead of `0x700000000`, 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 and `publish()`) 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: 1. The convoy (claim per 64 KiB block, lock dropped while working), A/B'd in one run on a static save. Small effects drown in this cutscene's shot changes, so 30 s phases aren't enough below ~2 ms. 2. Tracking by physical page for the aliased CPU-less views, as UlisesVoxer suggested.
meonline42 commented 2026-11-30 01:04:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-30T01:04:42Z.


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.

draws copying back frame (median of 5 s lines) preparing p95 frame / 1% low (window title, per second)
568c5e5d r1 6,301 10.8 ms 63.4 ms 49.4 ms 86 ms / 11 fps
568c5e5d r2 8,857 11.5 ms 69.6 ms 52.9 ms 100 ms / 9 fps
829188e r1 9,180 22.9 ms 65.9 ms 52.3 ms 157 ms / 5 fps
829188e r2 8,474 21.0 ms 66.7 ms 53.7 ms 167 ms / 5 fps
41adb551 r1 9,320 26.0 ms 68.6 ms 53.9 ms 141 ms / 5 fps
41adb551 r2 7,584 (outlier: preparing 106 ms for the whole run, the card 33% busy; left out)

What holds up and what doesn't:

  • Copying back about doubles (11 → 21-26 ms). That part is real.
  • The tail is worse: p95 frame goes from 86-100 to 141-167 ms, and the 1% low from 9-11 to 5 fps.
  • The median frame barely moves at comparable draws (~66-70 ms in all three). My earlier "17-18 → 15-17 fps" figures mixed drifting scenes and overstated the median difference. Sorry for the noise.
  • The wave and #1442 tables I posted earlier used the same drifting method, so their small differences (around ±4 ms copying back) aren't reliable. The wave-4 tip's tail and its +20 ms frame were large enough that I'll re-check them the same way. I'm re-running the wave tips with the fixed save now and will post that table as the reliable one.

Measured and posted by Claude Code on behalf of the machine's owner.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7265821645 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7265821645). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-30T01:04:42Z. --- 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. | | draws | copying back | frame (median of 5 s lines) | preparing | p95 frame / 1% low (window title, per second) | |---|---|---|---|---|---| | `568c5e5d` r1 | 6,301 | 10.8 ms | 63.4 ms | 49.4 ms | 86 ms / 11 fps | | `568c5e5d` r2 | 8,857 | 11.5 ms | 69.6 ms | 52.9 ms | 100 ms / 9 fps | | `829188e` r1 | 9,180 | 22.9 ms | 65.9 ms | 52.3 ms | 157 ms / 5 fps | | `829188e` r2 | 8,474 | 21.0 ms | 66.7 ms | 53.7 ms | 167 ms / 5 fps | | `41adb551` r1 | 9,320 | 26.0 ms | 68.6 ms | 53.9 ms | 141 ms / 5 fps | | `41adb551` r2 | 7,584 | (outlier: preparing 106 ms for the whole run, the card 33% busy; left out) | | | | What holds up and what doesn't: - **Copying back about doubles** (11 → 21-26 ms). That part is real. - **The tail is worse:** p95 frame goes from 86-100 to 141-167 ms, and the 1% low from 9-11 to 5 fps. - **The median frame barely moves** at comparable draws (~66-70 ms in all three). My earlier "17-18 → 15-17 fps" figures mixed drifting scenes and overstated the median difference. Sorry for the noise. - The wave and #1442 tables I posted earlier used the same drifting method, so their small differences (around ±4 ms copying back) aren't reliable. The wave-4 tip's tail and its +20 ms frame were large enough that I'll re-check them the same way. I'm re-running the wave tips with the fixed save now and will post that table as the reliable one. Measured and posted by Claude Code on behalf of the machine's owner.
burber commented 2026-11-30 01:28:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-30T01:28:52Z.


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 in guard() fell from three per asking to one, as meant. But:

  • the lock was still held 5.3-6.5 ms a frame;
  • it was still waited for 27-37 ms a frame;
  • the threads' copying stayed at 9.5 ms.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7266172004 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7266172004). Originally posted by [burber](https://github.com/burber) on 2026-11-30T01:28:52Z. --- 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 in `guard()` fell from three per asking to one, as meant. But: - the lock was still held 5.3-6.5 ms a frame; - it was still waited for 27-37 ms a frame; - the threads' copying stayed at 9.5 ms. 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 commented 2026-11-30 01:36:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nikitronick-crypto on 2026-11-30T01:36:43Z.


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 at 41adb551 (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 %).

Per frame This PC 4090 / i9 figure above
Refreshes 45,000, asking about 42 GB 51.6k, 29 GB
"Checked" 14.5 GB, 99.3 % unchanged 11.6 GB, 99.5 %
Kernel askings 271, 3.4 ms, 2,500 written 4 KiB pages, 5 refused 271, 3.3 ms, 390 refused
Guard faults 826 (21 ms) 583
Blocks made read-only 1,164 (30 ms changing protections)
Waiting for the guards' lock, all threads 360 waits, 124 ms (83 ms on the asking line) 22-25 ms
Recording 65,750 list calls, 294 ms (4.5 µs each), 59 ms of it in guards ~45k calls, ~5 µs
Copied whole (memory not watched) 0 MB

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:

Per frame off 50
fps 13.6 13.0
Guard faults 826 771
Blocks made read-only 1,164 1,201
Waiting for the guards (lock-waits line) 124 ms 132 ms
Copies 36.5 ms, 91 MB 41.2 ms, 130 MB

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 at d148613: 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=1 on cec481f4, 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=0 removed 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=1 or 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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7266286675 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7266286675). Originally posted by [nikitronick-crypto](https://github.com/nikitronick-crypto) on 2026-11-30T01:36:43Z. --- 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 at 41adb551 (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 %). | Per frame | This PC | 4090 / i9 figure above | |---|---|---| | Refreshes | 45,000, asking about 42 GB | 51.6k, 29 GB | | "Checked" | 14.5 GB, 99.3 % unchanged | 11.6 GB, 99.5 % | | Kernel askings | 271, 3.4 ms, 2,500 written 4 KiB pages, 5 refused | 271, 3.3 ms, 390 refused | | Guard faults | 826 (21 ms) | 583 | | Blocks made read-only | 1,164 (30 ms changing protections) | | | Waiting for the guards' lock, all threads | 360 waits, 124 ms (83 ms on the asking line) | 22-25 ms | | Recording | 65,750 list calls, 294 ms (4.5 µs each), 59 ms of it in guards | ~45k calls, ~5 µs | | Copied whole (memory not watched) | 0 MB | | 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: | Per frame | off | 50 | |---|---|---| | fps | 13.6 | 13.0 | | Guard faults | 826 | 771 | | Blocks made read-only | 1,164 | 1,201 | | Waiting for the guards (lock-waits line) | 124 ms | 132 ms | | Copies | 36.5 ms, 91 MB | 41.2 ms, 130 MB | 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 at d148613: 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=1`** on cec481f4, 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=0` removed 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=1` or 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 commented 2026-11-30 01:39:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T01:39:19Z.


@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_GUARD did. 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 current main now (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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7266326327 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7266326327). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T01:39:19Z. --- @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_GUARD` did. 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 current `main` now (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 commented 2026-11-30 01:44:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nikitronick-crypto on 2026-11-30T01:44:29Z.


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() (retry try_lock for up to 50 µs when the lock is found held, behind VICTORY_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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7266399835 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7266399835). Originally posted by [nikitronick-crypto](https://github.com/nikitronick-crypto) on 2026-11-30T01:44:29Z. --- 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()` (retry `try_lock` for up to 50 µs when the lock is found held, behind `VICTORY_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 commented 2026-11-30 02:09:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nikitronick-crypto on 2026-11-30T02:09:18Z.


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(), on WouldBlock, retry try_lock in 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:

spin off spin 50 µs
guards lock waits, all threads 135 waits, 28.7 ms 210 waits, 15.2 ms
asking: ms waiting for the guards 19.9 9.0
recording: guards ms 26.9 16.2
preparing 40.0 ms 36.1 ms
process CPU (user + kernel) 561 + 73 ms 510 + 60 ms
on the GPU 6.8 ms 10.2 ms
frame 62.5 ms 63.7 ms
fps 16.0 15.7

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7266752667 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7266752667). Originally posted by [nikitronick-crypto](https://github.com/nikitronick-crypto) on 2026-11-30T02:09:18Z. --- 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()`, on `WouldBlock`, retry `try_lock` in 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: | | spin off | spin 50 µs | |---|---|---| | guards lock waits, all threads | 135 waits, 28.7 ms | 210 waits, 15.2 ms | | asking: ms waiting for the guards | 19.9 | 9.0 | | recording: guards ms | 26.9 | 16.2 | | preparing | 40.0 ms | 36.1 ms | | process CPU (user + kernel) | 561 + 73 ms | 510 + 60 ms | | on the GPU | 6.8 ms | 10.2 ms | | frame | 62.5 ms | 63.7 ms | | fps | 16.0 | 15.7 | 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 commented 2026-11-30 02:25:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-30T02:25:12Z.


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):

under the lock ms
held in all 6.2-7.8
VirtualProtect in protect_here (~150 calls, ~300 blocks) 1.6-1.9
cover (the other views of the pages) 0.3-0.8
settle (notes of faults that took no lock) 0.3
guard's scan for written blocks (~28,000 blocks) 0.1
share of the hold the holder was running (QueryThreadCycleTime against the TSC) 72-78%

A sampling profile (VICTORY_PROFILE, 1 ms, 60 s in the world, symbolized from the PDB) agrees. Under watch::guard:

  • ~80% of samples are waiting to take the lock;
  • ~8% are in protect;
  • ~7% are in cover, mostly inplace::shown_elsewhere_in's B-tree lookups;
  • the rest of guard barely 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 behind guard's takes and 2,228 behind publish's. Only ~10% are copying (memcpy and victory_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_GUARD plan: 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7266988984 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7266988984). Originally posted by [burber](https://github.com/burber) on 2026-11-30T02:25:12Z. --- 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): | under the lock | ms | |---|---| | held in all | 6.2-7.8 | | `VirtualProtect` in `protect_here` (~150 calls, ~300 blocks) | 1.6-1.9 | | `cover` (the other views of the pages) | 0.3-0.8 | | `settle` (notes of faults that took no lock) | 0.3 | | `guard`'s scan for written blocks (~28,000 blocks) | 0.1 | | share of the hold the holder was running (`QueryThreadCycleTime` against the TSC) | 72-78% | A sampling profile (`VICTORY_PROFILE`, 1 ms, 60 s in the world, symbolized from the PDB) agrees. Under `watch::guard`: - ~80% of samples are waiting to take the lock; - ~8% are in `protect`; - ~7% are in `cover`, mostly `inplace::shown_elsewhere_in`'s B-tree lookups; - the rest of `guard` barely 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 behind `guard`'s takes and 2,228 behind `publish`'s. Only ~10% are copying (`memcpy` and `victory_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_GUARD` plan: 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`](https://github.com/burber/victory-fork/commits/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 commented 2026-11-30 02:48:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-30T02:48:52Z.


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):

draws copying back frame preparing p95 / 1% low
base 568c5e5d (first / last run) 7,802 / 8,878 7.0 / 6.5 ms 68.5 / 66.7 ms 48.2 / 47.1 ms 85 / 79 ms, 11-12 fps
wave-1 f53e1b87 6,791 7.1 ms 60.9 ms 45.1 ms 79 ms, 12 fps
wave-2 38f23bc6 6,744 6.9 ms 58.3 ms 48.8 ms 79 ms, 11 fps
wave-3 4111a0ed 6,803 6.4 ms 60.0 ms 48.9 ms 80 ms, 12 fps
wave-4 b6212c33 6,687 9.7 ms 57.7 ms 44.3 ms 75 ms, 13 fps
wave-5 6de00a4d 6,718 6.4 ms 58.1 ms 45.5 ms 80 ms, 12 fps
wave-6 86a1681a 6,621 6.7 ms 57.0 ms 43.5 ms 78 ms, 12 fps

So 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):

copying back frame preparing p95
base 568c5e5d 6.7 ms 59.8 ms 47.2 ms 78.5 ms
combined without wave 4 (a347c633) 6.4 ms 65.2 ms 50.8 ms 86 ms
combined with wave 4 (1d5e66a8) 16.8 ms 61.3 ms 47.8 ms 84.7 ms
829188e (3 runs) 14.6-15.4 ms 59.1-60.5 ms 47.5-47.8 ms 80-86 ms
829188e + VICTORY_CARD_BUFFERS_MIN_MB=4 (2 runs) 15.3-15.5 ms 58.3-62.6 ms 45.8-48.9 ms 84-87 ms

What I take from it:

  • Copying back goes from ~6.5 to ~15-17 ms only when wave 4 is combined with the other waves. Wave 4 alone shows 9.7 ms, the others alone ~6.5 ms. So it's an interaction, and #1442 / 5b66a1d0 (MIN_MB=4 changes nothing here) aren't it on their own.
  • On this machine and scene, that extra copying back doesn't cost frame time: 829188e frames, 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.
  • I couldn't halve further tonight: partial wave-4 merges into a347c633 conflict 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7267340931 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7267340931). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-30T02:48:52Z. --- 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): | | draws | copying back | frame | preparing | p95 / 1% low | |---|---|---|---|---|---| | base `568c5e5d` (first / last run) | 7,802 / 8,878 | 7.0 / 6.5 ms | 68.5 / 66.7 ms | 48.2 / 47.1 ms | 85 / 79 ms, 11-12 fps | | wave-1 `f53e1b87` | 6,791 | 7.1 ms | 60.9 ms | 45.1 ms | 79 ms, 12 fps | | wave-2 `38f23bc6` | 6,744 | 6.9 ms | 58.3 ms | 48.8 ms | 79 ms, 11 fps | | wave-3 `4111a0ed` | 6,803 | 6.4 ms | 60.0 ms | 48.9 ms | 80 ms, 12 fps | | wave-4 `b6212c33` | 6,687 | 9.7 ms | 57.7 ms | 44.3 ms | 75 ms, 13 fps | | wave-5 `6de00a4d` | 6,718 | 6.4 ms | 58.1 ms | 45.5 ms | 80 ms, 12 fps | | wave-6 `86a1681a` | 6,621 | 6.7 ms | 57.0 ms | 43.5 ms | 78 ms, 12 fps | **So 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): | | copying back | frame | preparing | p95 | |---|---|---|---|---| | base `568c5e5d` | 6.7 ms | 59.8 ms | 47.2 ms | 78.5 ms | | combined **without** wave 4 (`a347c633`) | **6.4 ms** | 65.2 ms | 50.8 ms | 86 ms | | combined **with** wave 4 (`1d5e66a8`) | **16.8 ms** | 61.3 ms | 47.8 ms | 84.7 ms | | `829188e` (3 runs) | 14.6-15.4 ms | 59.1-60.5 ms | 47.5-47.8 ms | 80-86 ms | | `829188e` + `VICTORY_CARD_BUFFERS_MIN_MB=4` (2 runs) | 15.3-15.5 ms | 58.3-62.6 ms | 45.8-48.9 ms | 84-87 ms | What I take from it: - **Copying back goes from ~6.5 to ~15-17 ms only when wave 4 is combined with the other waves.** Wave 4 alone shows 9.7 ms, the others alone ~6.5 ms. So it's an interaction, and #1442 / `5b66a1d0` (`MIN_MB=4` changes nothing here) aren't it on their own. - **On this machine and scene, that extra copying back doesn't cost frame time:** `829188e` frames, 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. - I couldn't halve further tonight: partial wave-4 merges into `a347c633` conflict 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 commented 2026-11-30 03:10:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by autogenes-sudo on 2026-11-30T03:10:18Z.


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, or title-main) on it, re-applied every second with SetThreadSelectedCpuSets, 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:

  • 8 workers on 0-7;
  • title-main and 10 others on 8-12;
  • one thread on 13 alone;
  • 3 threads on 8-13;
  • 11 threads on 0-13.

VICTORY_TITLE_AFFINITY=fast passes 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.

  • Unattended play. A VICTORY_INPUT_REPLAY tape 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.
  • Same save every run. The saves folder (%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.
  • A/B and clean exit. VICTORY_AB=15,<switch>. After N phases in the world (draws > 3000), the window gets WM_CLOSE, so the pipeline library is saved and no save is touched.
  • Analysis. Neighbouring phases that differ only in the switch are compared, and the draw count is regressed out. Within a run: frame median ≈ 41-43 ms + 3.5-3.7 ms per 1,000 draws.
  • Controls. A switch nothing reads: -0.1 ms ± 0.4. The same build in two runs on the restored save: +0.1 ms ± 0.4. So two builds can be compared across runs to about half a millisecond.

Neutral or worse on this PC with that method (64 phases each):

Switch Effect
VICTORY_CBV_ONCE +23 ms ± 4
VICTORY_GUARD_HOT +4 to +12 ms
Guard rest x4 +2.6 ms
VICTORY_HEAP_LOOK_QUIET +1.6 ms ± 0.6
Helpers at THREAD_PRIORITY_HIGHEST +0.2 ms ± 0.6
Half the list translators resting +2.0 ms ± 2.5
Half the wide helpers woken +2.8 ms ± 2.5
VICTORY_STORE_BESIDE -0.8 ms ± 2.1
VICTORY_COPY_BESIDE +1.2 ms ± 2.1
VICTORY_RYZEN_PREP streaming copies 13.06 against 12.89 ms per 144 MiB

I 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7267649580 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7267649580). Originally posted by [autogenes-sudo](https://github.com/autogenes-sudo) on 2026-11-30T03:10:18Z. --- 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, or `title-main`) on it, re-applied every second with `SetThreadSelectedCpuSets`, 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`: - 8 workers on 0-7; - `title-main` and 10 others on 8-12; - one thread on 13 alone; - 3 threads on 8-13; - 11 threads on 0-13. `VICTORY_TITLE_AFFINITY=fast` passes 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.** - **Unattended play.** A `VICTORY_INPUT_REPLAY` tape 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. - **Same save every run.** The saves folder (`%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. - **A/B and clean exit.** `VICTORY_AB=15,<switch>`. After N phases in the world (draws > 3000), the window gets `WM_CLOSE`, so the pipeline library is saved and no save is touched. - **Analysis.** Neighbouring phases that differ only in the switch are compared, and the draw count is regressed out. Within a run: frame median ≈ 41-43 ms + 3.5-3.7 ms per 1,000 draws. - **Controls.** A switch nothing reads: -0.1 ms ± 0.4. The same build in two runs on the restored save: +0.1 ms ± 0.4. So two builds can be compared across runs to about half a millisecond. Neutral or worse on this PC with that method (64 phases each): | Switch | Effect | |---|---| | `VICTORY_CBV_ONCE` | +23 ms ± 4 | | `VICTORY_GUARD_HOT` | +4 to +12 ms | | Guard rest x4 | +2.6 ms | | `VICTORY_HEAP_LOOK_QUIET` | +1.6 ms ± 0.6 | | Helpers at `THREAD_PRIORITY_HIGHEST` | +0.2 ms ± 0.6 | | Half the list translators resting | +2.0 ms ± 2.5 | | Half the wide helpers woken | +2.8 ms ± 2.5 | | `VICTORY_STORE_BESIDE` | -0.8 ms ± 2.1 | | `VICTORY_COPY_BESIDE` | +1.2 ms ± 2.1 | | `VICTORY_RYZEN_PREP` streaming copies | 13.06 against 12.89 ms per 144 MiB | I 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 commented 2026-11-30 03:14:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T03:14:51Z.


@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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7267718946 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7267718946). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T03:14:51Z. --- @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 commented 2026-11-30 04:19:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-30T04:19:08Z.


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 only VICTORY_HELPER_PRIORITY=1 on top of the old launcher's switches. That means:

  • "Neither switch brings copying back near 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 under 829188e'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=4 and #3513's VICTORY_SPLIT_CCD with the fixed save, and will post those. Sorry for the noise.

Posted by Claude Code on behalf of the machine's owner.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7268665904 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7268665904). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-30T04:19:08Z. --- 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 only `VICTORY_HELPER_PRIORITY=1` on top of the old launcher's switches. That means: - **"Neither switch brings copying back near `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 under `829188e`'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=4` and #3513's `VICTORY_SPLIT_CCD` with the fixed save, and will post those. Sorry for the noise. Posted by Claude Code on behalf of the machine's owner.
burber commented 2026-11-30 04:43:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-30T04:43:30Z.


@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 says fast=12 of=20 for each).

switch 6k draws other bands refreshes on the submitting thread
VICTORY_FAST_CORES=1 (helpers no longer asked onto the P-cores) 23.5 / 23.2 7k: 23.4 / 23.2 12.6 / 13.3 ms
default 22.0 / 23.5 5k: 22.9 / 24.6 14.4 / 13.9 ms
VICTORY_WIDE_THREADS=3 (7 by default here) 23.8 / 24.1 7k: 23.7 11.4 / 13.0 ms
default 23.6 / 22.1 7k: 23.5 11.3 / 12.3 ms

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 with SetThreadSelectedCpuSets (and back), flippable by VICTORY_AB. With VICTORY_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-fork diag-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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7269026656 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7269026656). Originally posted by [burber](https://github.com/burber) on 2026-11-30T04:43:30Z. --- @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 says `fast=12 of=20` for each). | switch | 6k draws | other bands | refreshes on the submitting thread | |---|---|---|---| | `VICTORY_FAST_CORES=1` (helpers no longer asked onto the P-cores) | 23.5 / 23.2 | 7k: 23.4 / 23.2 | 12.6 / 13.3 ms | | default | 22.0 / 23.5 | 5k: 22.9 / 24.6 | 14.4 / 13.9 ms | | `VICTORY_WIDE_THREADS=3` (7 by default here) | 23.8 / 24.1 | 7k: 23.7 | 11.4 / 13.0 ms | | default | 23.6 / 22.1 | 7k: 23.5 | 11.3 / 12.3 ms | 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 with `SetThreadSelectedCpuSets` (and back), flippable by `VICTORY_AB`. With `VICTORY_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-fork `diag-copyback`](https://github.com/burber/victory-fork/commits/diag-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 commented 2026-11-30 04:48:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mexiscool on 2026-11-30T04:48:29Z.


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:

  • GPU-accessible RAM for CPU-intensive allocations.
  • CPU-accessible VRAM for GPU-intensive, primarily CPU-written allocations.
  • Native VRAM for GPU-only resources.
  • Mirrored memory as a fallback for incompatible or unclassified allocations.

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?

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7269099036 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7269099036). Originally posted by [mexiscool](https://github.com/mexiscool) on 2026-11-30T04:48:29Z. --- 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: - GPU-accessible RAM for CPU-intensive allocations. - CPU-accessible VRAM for GPU-intensive, primarily CPU-written allocations. - Native VRAM for GPU-only resources. - Mirrored memory as a fallback for incompatible or unclassified allocations. 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 commented 2026-11-30 05:06:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T05:06:21Z.


Follow-up on VICTORY_CARD_BUFFERS_MIN_MB=4 on the 4090 (Series X house, same exe): the repeat doesn't confirm the first pair.

pair default (1 MiB) =4
1 40.8 ms (p95 72) 37.3 ms (p95 54)
2 39.5 ms (p95 66) 39.4 ms (p95 79)

So, 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7269358963 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7269358963). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T05:06:21Z. --- Follow-up on `VICTORY_CARD_BUFFERS_MIN_MB=4` on the 4090 (Series X house, same exe): the repeat doesn't confirm the first pair. | pair | default (1 MiB) | `=4` | |---|---|---| | 1 | 40.8 ms (p95 72) | 37.3 ms (p95 54) | | 2 | 39.5 ms (p95 66) | 39.4 ms (p95 79) | So, 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 commented 2026-11-30 05:39:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T05:39:06Z.


@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:

  • Placement alone can't fix the biggest cost here. On both profiles, ~80 % of refresh time is one CPU-less pool whose pages are all aliased (the title's page-mapping copies write them through other addresses). That needs tracking by physical page, not a different home for the allocation.
  • Classes are mixed below allocation granularity. The 32-bit graphics heap mixes CPU-written constants with GPU-written skinning outputs, so a per-allocation map would have to go down to pages, and pages get remapped. A persisted map keyed by allocation site plus page offset could work for the stable heaps, though. If someone wants to prototype the profiling build, the census lines (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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7269871218 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7269871218). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T05:39:06Z. --- @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: - **Placement alone can't fix the biggest cost here.** On both profiles, ~80 % of refresh time is one CPU-less pool whose pages are all aliased (the title's page-mapping copies write them through other addresses). That needs tracking by physical page, not a different home for the allocation. - **Classes are mixed below allocation granularity.** The 32-bit graphics heap mixes CPU-written constants with GPU-written skinning outputs, so a per-allocation map would have to go down to pages, and pages get remapped. A persisted map keyed by allocation site plus page offset could work for the stable heaps, though. If someone wants to prototype the profiling build, the census lines (`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 commented 2026-11-30 05:40:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T05:40:27Z.


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).

effect of the switch
frame (phase median) −2.7 ± 1.2 ms
preparing, submitting thread −7.2 ± 2.1 ms

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; switch VICTORY_PORT_GUARD=1, A/B-able; diagnostics build prints the guards' lock per frame). A 6-core run with your method would be the most telling.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7269893342 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7269893342). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T05:40:27Z. --- **`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). | | effect of the switch | |---|---| | frame (phase median) | **−2.7 ± 1.2 ms** | | preparing, submitting thread | **−7.2 ± 2.1 ms** | 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 `VirtualProtect`s, 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`](https://github.com/dyshay/VIctory-NVIDIA/tree/port-guard) (on top of trustno1 main + our fixes; switch `VICTORY_PORT_GUARD=1`, A/B-able; diagnostics build prints `the guards' lock per frame`). A 6-core run with your method would be the most telling.
dyshay commented 2026-11-30 06:05:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T06:05:34Z.


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).

run frame (phase median) preparing
pg-x-ab −2.7 ± 1.2 ms −7.2 ± 2.1 ms
pg-x-ab2 −1.1 ± 1.3 ms −3.6 ± 1.8 ms
both ≈ −2.0 ± 0.9 ms ≈ −5.1 ± 1.3 ms

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-guard if you get a chance on the 6-core.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7270295439 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7270295439). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T06:05:34Z. --- **`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). | run | frame (phase median) | preparing | |---|---|---| | pg-x-ab | −2.7 ± 1.2 ms | −7.2 ± 2.1 ms | | pg-x-ab2 | −1.1 ± 1.3 ms | −3.6 ± 1.8 ms | | **both** | **≈ −2.0 ± 0.9 ms** | **≈ −5.1 ± 1.3 ms** | 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-guard`](https://github.com/dyshay/VIctory-NVIDIA/tree/port-guard) if you get a chance on the 6-core.
meonline42 commented 2026-11-30 06:14:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-30T06:14:22Z.


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 41adb551 with only my local keyboard-input changes (victory-hle, nothing in the GPU path), against my current e1f2eb6-based build. Per-second fps and frame times from the window title over 240 s:

runs draws fps median 10% / 1% low p95 frame
e1f2eb6-based 2 6,476-6,771 16 12 / 10-11 fps 85-88 ms
41adb551-based, 829188e's launcher defaults 2 6,353-7,119 14-16 6 / 5-6 fps 166-173 ms
41adb551-based, the older launcher's switches 2 9,275-11,132 14-15 7-8 / 6-7 fps 137-159 ms

So 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 +0x2215c35 hang 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7270443900 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7270443900). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-30T06:14:22Z. --- 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 `41adb551` with only my local keyboard-input changes (victory-hle, nothing in the GPU path), against my current `e1f2eb6`-based build. Per-second fps and frame times from the window title over 240 s: | | runs | draws | fps median | 10% / 1% low | p95 frame | |---|---|---|---|---|---| | `e1f2eb6`-based | 2 | 6,476-6,771 | 16 | 12 / 10-11 fps | 85-88 ms | | `41adb551`-based, `829188e`'s launcher defaults | 2 | 6,353-7,119 | 14-16 | 6 / 5-6 fps | 166-173 ms | | `41adb551`-based, the older launcher's switches | 2 | 9,275-11,132 | 14-15 | 7-8 / 6-7 fps | 137-159 ms | So 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 `+0x2215c35` hang 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 commented 2026-11-30 10:33:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nikitronick-crypto on 2026-11-30T10:33:45Z.


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_GUARD off on
guards' lock: waited / held 35.8 / 8.7 ms 10.5 / 3.2 ms
asking: ms waiting for the guards 23.0 7.4
recording: guards ms 31.7 15.6
blocks made read-only / ms changing protections 579 / 22.4 568 / 22.9
guard faults 570 (18.0 ms) 556 (18.6 ms)
faults' waits for claims - 128 (8.5 ms)
preparing 42.8 ms 40.6 ms
frame median / p95 53.6 / 68.0 ms 52.1 / 63.8 ms
fps 18.6 19.2
card busy 69 % 69 %

So 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 on 41adb551. The table above is with VICTORY_WAVE_FOLDED=0 in 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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7275770012 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7275770012). Originally posted by [nikitronick-crypto](https://github.com/nikitronick-crypto) on 2026-11-30T10:33:45Z. --- 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_GUARD` off | on | |---|---|---| | guards' lock: waited / held | 35.8 / 8.7 ms | 10.5 / 3.2 ms | | asking: ms waiting for the guards | 23.0 | 7.4 | | recording: guards ms | 31.7 | 15.6 | | blocks made read-only / ms changing protections | 579 / 22.4 | 568 / 22.9 | | guard faults | 570 (18.0 ms) | 556 (18.6 ms) | | faults' waits for claims | - | 128 (8.5 ms) | | preparing | 42.8 ms | 40.6 ms | | frame median / p95 | 53.6 / 68.0 ms | 52.1 / 63.8 ms | | fps | 18.6 | 19.2 | | card busy | 69 % | 69 % | So 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 on 41adb551. The table above is with `VICTORY_WAVE_FOLDED=0` in 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 commented 2026-11-30 10:38:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T10:38:22Z.


@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 from 05d1c564 for 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7275875525 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7275875525). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T10:38:22Z. --- @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 from `05d1c564` for 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 commented 2026-11-30 10:46:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-30T10:46:00Z.


@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. Your port-guard branch at ca21195b, a release build with only the ab feature 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:

effect of the switch
frame, neighbouring pairs (58) −1.2 ± 1.0 ms
frame, least squares with draws (2.4 ms per 1,000 draws) −0.4 ms
p90 frame, neighbouring pairs +5.0 ± 3.6 ms
raw phase medians 62.3 on / 63.4 off ms (on phases had ~330 fewer draws)

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7276049376 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7276049376). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-30T10:46:00Z. --- @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. Your `port-guard` branch at `ca21195b`, a release build with only the `ab` feature 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: | | effect of the switch | |---|---| | frame, neighbouring pairs (58) | −1.2 ± 1.0 ms | | frame, least squares with draws (2.4 ms per 1,000 draws) | −0.4 ms | | p90 frame, neighbouring pairs | +5.0 ± 3.6 ms | | raw phase medians | 62.3 on / 63.4 off ms (on phases had ~330 fewer draws) | 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 commented 2026-11-30 11:17:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by voidharbor on 2026-11-30T11:17:46Z.


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: main 41adb551 with a number of open pull requests merged locally (#3706, #2853, #2175 and #3592 among them) and ca21195b from @dyshay's port-guard branch 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:

effect of the switch (on minus off) medians off / on
frame (phase median) -0.8 ± 0.7 ms 59.6 / 58.1 ms
preparing, submitting thread -3.0 ± 0.5 ms 35.5 / 32.8 ms
submitting thread worked -1.9 ± 0.8 ms 61.0 / 58.3 ms
card time, all lists 0.0 ± 0.8 ms 42.0 / 40.6 ms

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:

kind share of refresh time ms (summed over threads) refreshes MB looked at MB taken
aliased, CPU-less 70 % 29.0 294 (240 took the guards' lock) 1,018 33
guarded, single-mapped 17 % 6.9 115 2,783 25
write watched 10.5 % 4.4 623 162 9.6
guarded, aliased 3 % 1.3 14 271 4.2
  • Refresh time summed over threads: 41 ms a frame.
  • Aliased memory, both kinds: 1,301 MB looked at, 994 MB of it distinct, so each physical page is looked at about 1.3 times a frame.
  • Guard faults a frame: 369 through aliased addresses, 475 on single-mapped views, 0 through CPU-less addresses.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7276825069 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7276825069). Originally posted by [voidharbor](https://github.com/voidharbor) on 2026-11-30T11:17:46Z. --- 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: main 41adb551 with a number of open pull requests merged locally (#3706, #2853, #2175 and #3592 among them) and ca21195b from @dyshay's `port-guard` branch 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: | | effect of the switch (on minus off) | medians off / on | |---|---|---| | frame (phase median) | -0.8 ± 0.7 ms | 59.6 / 58.1 ms | | preparing, submitting thread | -3.0 ± 0.5 ms | 35.5 / 32.8 ms | | submitting thread worked | -1.9 ± 0.8 ms | 61.0 / 58.3 ms | | card time, all lists | 0.0 ± 0.8 ms | 42.0 / 40.6 ms | 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: | kind | share of refresh time | ms (summed over threads) | refreshes | MB looked at | MB taken | |---|---|---|---|---|---| | aliased, CPU-less | 70 % | 29.0 | 294 (240 took the guards' lock) | 1,018 | 33 | | guarded, single-mapped | 17 % | 6.9 | 115 | 2,783 | 25 | | write watched | 10.5 % | 4.4 | 623 | 162 | 9.6 | | guarded, aliased | 3 % | 1.3 | 14 | 271 | 4.2 | - Refresh time summed over threads: 41 ms a frame. - Aliased memory, both kinds: 1,301 MB looked at, 994 MB of it distinct, so each physical page is looked at about 1.3 times a frame. - Guard faults a frame: 369 through aliased addresses, 475 on single-mapped views, 0 through CPU-less addresses. 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 commented 2026-11-30 11:21:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T11:21:07Z.


@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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7276902298 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7276902298). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T11:21:07Z. --- @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 commented 2026-11-30 11:41:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-30T11:41:26Z.


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 the ab feature. Frame times are per frame, negative is faster.

switch effect run
VICTORY_STORE_BESIDE=1 -1.70 ms ± 0.09 (34 pairs) 527
same, with COPY_BESIDE=1 on throughout -2.13 ms ± 0.08 (35 pairs) 528
VICTORY_COPY_BESIDE=1 -0.40 ms ± 0.12 (18 pairs) 527
VICTORY_FILL_TITLE=1 -1.56 ms ± 0.61 (28 pairs) 533
VICTORY_SETTLE_UNLOCKED=1 -0.20 ± 0.46, no effect 533
VICTORY_WAIT_SPIN=500 -0.45 ± 0.44 (median 0), no clear effect 533
STORE_BESIDE + COPY_BESIDE + FILL_TITLE, against none, same cycle -3.26 ms ± 0.69 (median -2.88), about +8 % 538

Outdoors 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).

switch effect outdoors
VICTORY_FILL_TITLE=1 -12.5 ms ± 0.7 (52 pairs)
VICTORY_STORE_BESIDE=1 -3.6 ms ± 1.1 (28 pairs)
VICTORY_COPY_BESIDE=1 +0.2 ± 0.6, nothing
all three against none, same cycle -15.6 ms ± 1.2: 66 → 51 ms, about 15 → 20 fps (+31 %)

Second round outdoors, with those three on throughout (run 541):

switch effect p90
VICTORY_TABLE_SAME=1 -1.48 ms ± 0.29 (28 pairs) about -4 ms
VICTORY_SETTLE_UNLOCKED=1 -1.06 ms ± 0.29 (26 pairs) 72 → 58 ms
VICTORY_WAIT_SPIN=500 +0.04 ± 0.20, nothing

With all five, outdoor frames are ~47 ms against ~66 with none, about 15 → 21 fps. SETTLE_UNLOCKED does little to the median but takes most of the slow frames out. (TABLE_SAME could only be flipped by VICTORY_AB in diagnostics builds. Commit 384340f3 lets ab builds 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-guard branch (current main, PORT_GUARD off), 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):

switch, on current code effect
FILL_TITLE=1 -3.0 ± 1.4 ms
STORE_BESIDE=1 -2.6 ± 1.3 ms
TABLE_SAME=1 -1.3 ± 1.4 ms (not clear)
SETTLE_UNLOCKED=1 +2.4 ± 1.3 (median +0.05), not clear
all four against none, same cycle -5.0 ± 0.14 ms (50.5 → 45.6 ms, about +11 %)

So on current code the set is worth about 10 %, mostly from FILL_TITLE and STORE_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=4096 together: worse, 20.6 / 20.8 fps against 21.3 / 21.4.
  • JOIN_PARTS=16 alone (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%:

  • driver calls ~19% (recording, ~3 sends a frame, ~1.4 ms of ExecuteCommandLists, MakeResident of upload buffers);
  • its own share of the refresh loop 12%;
  • write-watch kernel asks 6%;
  • step planning (card_steps::does_of) 3.5%;
  • the guards' lock 3%.

VICTORY_SUBMIT_SPLIT=1 (the sending thread that #3854 turns on by default), in-run on current code outdoors with the set plus PORT_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_TITLE on: card_steps::does_of -> read_blocked -> fill_is_titles -> watch::written_since_taken takes the guards' lock for every small fill, thousands a frame, on the submitting thread. Most of does_of's ~2,000 samples were waits for that lock. I tried asking the lock-free landed_lately first, answering "not written" from the PROTECTED bits 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_GUARD and 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=1 on 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_BESIDE carried the gain and #2842's five were worth only about +1.4 fps. Outdoors FILL_TITLE dominates. 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_UNLOCKED and WAIT_SPIN be flipped by VICTORY_AB. All three are read at every call already. It's commit 33fafa45 on burber/victory-fork diag-copyback. The beside switches could already be flipped.

In motion: a 600 s run on current code with the set plus PORT_GUARD on. The character walks a route with scripted keys (VICTORY_KEYS holds: W 8 s, J or L to turn, repeated) out of the garden, along the street and back. VICTORY_AB=15,VICTORY_FILL_TITLE flips 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_TITLE was -2.2 ± 0.4 ms (18 cycles), and the set ran at ~44.8 ms a frame, about 22 fps.

FILL_TITLE and STORE_BESIDE look 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7277378526 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7277378526). Originally posted by [burber](https://github.com/burber) on 2026-11-30T11:41:26Z. --- 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 the `ab` feature. Frame times are per frame, negative is faster. | switch | effect | run | |---|---|---| | `VICTORY_STORE_BESIDE=1` | **-1.70 ms ± 0.09** (34 pairs) | 527 | | same, with `COPY_BESIDE=1` on throughout | **-2.13 ms ± 0.08** (35 pairs) | 528 | | `VICTORY_COPY_BESIDE=1` | -0.40 ms ± 0.12 (18 pairs) | 527 | | `VICTORY_FILL_TITLE=1` | **-1.56 ms ± 0.61** (28 pairs) | 533 | | `VICTORY_SETTLE_UNLOCKED=1` | -0.20 ± 0.46, no effect | 533 | | `VICTORY_WAIT_SPIN=500` | -0.45 ± 0.44 (median 0), no clear effect | 533 | | **`STORE_BESIDE` + `COPY_BESIDE` + `FILL_TITLE`, against none, same cycle** | **-3.26 ms ± 0.69** (median -2.88), about +8 % | 538 | **Outdoors 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). | switch | effect outdoors | |---|---| | `VICTORY_FILL_TITLE=1` | **-12.5 ms ± 0.7** (52 pairs) | | `VICTORY_STORE_BESIDE=1` | -3.6 ms ± 1.1 (28 pairs) | | `VICTORY_COPY_BESIDE=1` | +0.2 ± 0.6, nothing | | **all three against none, same cycle** | **-15.6 ms ± 1.2**: 66 → 51 ms, about 15 → 20 fps (+31 %) | Second round outdoors, with those three on throughout (run 541): | switch | effect | p90 | |---|---|---| | `VICTORY_TABLE_SAME=1` | **-1.48 ms ± 0.29** (28 pairs) | about -4 ms | | `VICTORY_SETTLE_UNLOCKED=1` | **-1.06 ms ± 0.29** (26 pairs) | **72 → 58 ms** | | `VICTORY_WAIT_SPIN=500` | +0.04 ± 0.20, nothing | | With all five, outdoor frames are ~47 ms against ~66 with none, about 15 → 21 fps. `SETTLE_UNLOCKED` does little to the median but takes most of the slow frames out. (`TABLE_SAME` could only be flipped by `VICTORY_AB` in diagnostics builds. Commit 384340f3 lets `ab` builds 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-guard` branch (current main, `PORT_GUARD` off), 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): | switch, on current code | effect | |---|---| | `FILL_TITLE=1` | -3.0 ± 1.4 ms | | `STORE_BESIDE=1` | -2.6 ± 1.3 ms | | `TABLE_SAME=1` | -1.3 ± 1.4 ms (not clear) | | `SETTLE_UNLOCKED=1` | +2.4 ± 1.3 (median +0.05), not clear | | **all four against none, same cycle** | **-5.0 ± 0.14 ms** (50.5 → 45.6 ms, about +11 %) | So on current code the set is worth about 10 %, mostly from `FILL_TITLE` and `STORE_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=4096` together: **worse**, 20.6 / 20.8 fps against 21.3 / 21.4. - `JOIN_PARTS=16` alone (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%: - driver calls ~19% (recording, ~3 sends a frame, ~1.4 ms of `ExecuteCommandLists`, `MakeResident` of upload buffers); - its own share of the refresh loop 12%; - write-watch kernel asks 6%; - step planning (`card_steps::does_of`) 3.5%; - the guards' lock 3%. `VICTORY_SUBMIT_SPLIT=1` (the sending thread that #3854 turns on by default), in-run on current code outdoors with the set plus `PORT_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_TITLE` on: `card_steps::does_of` -> `read_blocked` -> `fill_is_titles` -> `watch::written_since_taken` takes the guards' lock for every small fill, thousands a frame, on the submitting thread. Most of `does_of`'s ~2,000 samples were waits for that lock. I tried asking the lock-free `landed_lately` first, answering "not written" from the `PROTECTED` bits 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_GUARD` and 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=1` on 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_BESIDE` carried the gain and #2842's five were worth only about +1.4 fps. Outdoors `FILL_TITLE` dominates. 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_UNLOCKED` and `WAIT_SPIN` be flipped by `VICTORY_AB`. All three are read at every call already. It's commit 33fafa45 on [burber/victory-fork `diag-copyback`](https://github.com/burber/victory-fork/commits/diag-copyback). The beside switches could already be flipped. **In motion:** a 600 s run on current code with the set plus `PORT_GUARD` on. The character walks a route with scripted keys (`VICTORY_KEYS` holds: W 8 s, J or L to turn, repeated) out of the garden, along the street and back. `VICTORY_AB=15,VICTORY_FILL_TITLE` flips 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_TITLE` was **-2.2 ± 0.4 ms** (18 cycles), and the set ran at ~44.8 ms a frame, about 22 fps. `FILL_TITLE` and `STORE_BESIDE` look 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 commented 2026-11-30 11:41:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-30T11:41:27Z.


@dyshay VICTORY_PORT_GUARD on the i5-13600K + RTX 4070 Ti. Your port-guard branch at ca21195b, release with ab, one warm-up run first. Then 900 s with VICTORY_AB=15,VICTORY_PORT_GUARD, standing in the garden outdoors (~11,900 draws a frame). STORE_BESIDE, COPY_BESIDE, FILL_TITLE, TABLE_SAME and SETTLE_UNLOCKED were on throughout (see my comment above for those).

effect of the switch
frame (neighbouring phases, draws regressed out, 55 pairs) −0.29 ± 0.08 ms
submitting thread in its submissions (5 s lines, by phase) 41.8 → 41.05 ms
its refreshes 11.3 → 10.3 ms

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_GUARD alone):

effect of the switch
frame (54 pairs) −1.42 ± 0.09 ms
submitting thread in its submissions 47.3 → 45.85 ms
its refreshes 14.6 → 12.4 ms

That's close to your 4090 numbers. So PORT_GUARD and the beside switches overlap: once STORE_BESIDE keeps the title's stores from faulting, fewer blocks are re-guarded, and there's less for PORT_GUARD to 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7277378861 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7277378861). Originally posted by [burber](https://github.com/burber) on 2026-11-30T11:41:27Z. --- @dyshay `VICTORY_PORT_GUARD` on the i5-13600K + RTX 4070 Ti. Your `port-guard` branch at ca21195b, release with `ab`, one warm-up run first. Then 900 s with `VICTORY_AB=15,VICTORY_PORT_GUARD`, standing in the garden outdoors (~11,900 draws a frame). `STORE_BESIDE`, `COPY_BESIDE`, `FILL_TITLE`, `TABLE_SAME` and `SETTLE_UNLOCKED` were on throughout (see my comment above for those). | | effect of the switch | |---|---| | frame (neighbouring phases, draws regressed out, 55 pairs) | **−0.29 ± 0.08 ms** | | submitting thread in its submissions (5 s lines, by phase) | 41.8 → 41.05 ms | | its refreshes | 11.3 → 10.3 ms | 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_GUARD` alone): | | effect of the switch | |---|---| | frame (54 pairs) | **−1.42 ± 0.09 ms** | | submitting thread in its submissions | 47.3 → 45.85 ms | | its refreshes | 14.6 → 12.4 ms | That's close to your 4090 numbers. So `PORT_GUARD` and the beside switches overlap: once `STORE_BESIDE` keeps the title's stores from faulting, fewer blocks are re-guarded, and there's less for `PORT_GUARD` to 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 commented 2026-11-30 12:36:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-30T12:36:41Z.


@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 is e1f2eb6-based plus my local keyboard-input changes. The A/B only works in its diagnostics build there (asked_for! reads VICTORY_AB only with diagnostics in 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.

switch neighbouring pairs least squares with draws p90, pairs
VICTORY_STORE_BESIDE=1 −0.9 ± 1.6 ms −2.1 ms −2.6 ± 1.7 ms
VICTORY_COPY_BESIDE=1 +0.2 ± 1.4 ms +0.9 ms −1.5 ± 1.9 ms

STORE_BESIDE was 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_BESIDE alone shows nothing here, as you found. FILL_TITLE reads 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7278677516 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7278677516). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-30T12:36:41Z. --- @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 is `e1f2eb6`-based plus my local keyboard-input changes. The A/B only works in its diagnostics build there (`asked_for!` reads `VICTORY_AB` only with `diagnostics` in 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. | switch | neighbouring pairs | least squares with draws | p90, pairs | |---|---|---|---| | `VICTORY_STORE_BESIDE=1` | −0.9 ± 1.6 ms | **−2.1 ms** | −2.6 ± 1.7 ms | | `VICTORY_COPY_BESIDE=1` | +0.2 ± 1.4 ms | +0.9 ms | −1.5 ± 1.9 ms | `STORE_BESIDE` was 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_BESIDE` alone shows nothing here, as you found. `FILL_TITLE` reads 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 commented 2026-11-30 12:40:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T12:40:09Z.


@burber thanks, these are big, especially FILL_TITLE outdoors. 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_BESIDE for 900 s, then FILL_TITLE in alternating separate runs, since it's read once in this tree. Your overlap finding with PORT_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 plus PORT_GUARD, measured together against the beside switches alone. I'll post the numbers.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7278758527 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7278758527). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T12:40:09Z. --- @burber thanks, these are big, especially `FILL_TITLE` outdoors. 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_BESIDE` for 900 s, then `FILL_TITLE` in alternating separate runs, since it's read once in this tree. Your overlap finding with `PORT_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 plus `PORT_GUARD`, measured together against the beside switches alone. I'll post the numbers.
nikitronick-crypto commented 2026-11-30 12:49:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nikitronick-crypto on 2026-11-30T12:49:59Z.


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, 41adb551 and port-guard ca21195b, Series X 1440p DLSS Balanced, FSR FG 2x). Short version:

  • Savings in "preparing" reach the frame at 0-70 %, never 100 %. That holds for every A/B in this thread. Two measurable reasons are below.
  • On a 12 GB 30-series card the frame is card-bound part of the time, because of one compute pair. When it is, CPU savings turn into waiting for the card, one for one.
  • About half the frame does not scale with draws. The floor is 27-40 ms here in release builds, and nobody has split it.
  • The submitting thread is on a CPU for only 59-72 % of its "preparing" time. The rest is blocked time, which is what PORT_GUARD removes and why its gain is small.

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

Change Who / machine Preparing Frame
VICTORY_LIGHT_REFRESH=0 dyshay, 4090 +24.1 ms +24.9 ms
VICTORY_LIGHT_REFRESH=0 burber, 4070 Ti +16 ms +12.7 ms
VICTORY_PORT_GUARD=1 dyshay, 4090 (2 runs) −5.1 ± 1.3 ms −2.0 ± 0.9 ms
VICTORY_PORT_GUARD=1 me, 3080 Ti, card 69 % busy −2.2 ms −1.5 ms
VICTORY_PORT_GUARD=1 meonline42, 5900X + 3090 not given −0.4 to −1.2 ms
spin before parking in guards() me, 41adb551, card ~80 % busy −3.9 ms +1.2 ms
Promote-on-Alias burber, 4070 Ti +3 ms no change
f72cec77 → 41adb551 (10 commits) DoubleD17, 5800X + 5070 63.8 → 62.6 ms 13.4 → 13.5 fps
earlier refresh speed-up (19-30 → 13-14 ms) dyshay lower no change
VICTORY_GUARD_HOT=50 burber, autogenes-sudo, me slower on all three
more helper threads me (12/8/6), Arian1192 (WIDE_THREADS=2 same fps) slower or equal

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 kernel gives the submitting thread's CPU time inside its submissions:

Run In submissions (wall) On a CPU Share
41adb551, outdoors, ~9k draws 66.7 ms 39.1 ms 59 %
41adb551 + spin, outdoors 64.4 ms 42.7 ms 66 %
41adb551, standing still 46.3 ms 31.3 ms 68 %
41adb551 + spin, standing still 41.4 ms 29.7 ms 72 %
port-guard, switch off 48.2 ms 30.4 ms 63 %
port-guard, switch on 46.1 ms 30.4 ms 66 %

PORT_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:

Pair Card busy Preparing "on the GPU" Frame
PORT_GUARD, folding forced off 69 % −2.2 ms +0.2 ms −1.5 ms
spin, 41adb551 80-83 % −3.9 ms +3.4 ms +1.2 ms
PORT_GUARD, folding on 99-100 % −4.1 ms +10.0 ms +9.1 ms

This 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:

  • The card meter reads 44-54 ms of card time a frame. The card clock says 80-83 % busy at the median, and 28-32 % of the seconds are at 95 % or more.
  • One kind of list is 18-19 ms of that: 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.
  • Second by second, frame time follows card time (r = 0.72 and 0.77 in two runs). In the third of the seconds with the least card time the frame is 56-59 ms; in the third with the most it is 77-83 ms.
  • The pair depends on the scene. In a 5-minute outdoor run it is absent from all 17 card-meter blocks, the card is 63 % busy, and frame time does not follow card time (r = 0.04).

The same spot under three translations of those programs:

Card time / frame The pair Mean frame p95 Frames over 100 ms
port-guard, folding on (its default; frame figures from one run) 75-116 ms 46-79 ms 101 ms 175 ms 45 %
41adb551 (folding off, last resort on) 44-54 ms 18-19 ms 66-71 ms 114-119 ms 9-12 %
port-guard, VICTORY_WAVE_FOLDED=0 28 ms not listed 54-56 ms 68-72 ms 0-0.3 %

The 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:

  1. Method. An A/B of a CPU-side switch on a card under 16 GB should report card time and card busy next to draws, and leave out or regress the card-bound seconds. Otherwise real CPU gains read as zero.
  2. A lever for these cards. At this spot that pair is worth up to 20-30 % mean fps (14.1-15.1 → 18.0-18.6) and most of the tail. It needs someone who knows the translator to say which form those two programs take on 41adb551 (VICTORY_WAVE_WHY=1) and whether a cheaper exact form exists.
  3. The direct test on 41adb551 (release, same save and spot, two runs ten minutes apart, only VICTORY_LEAVE_OUT differs):
Default Pair in VICTORY_LEAVE_OUT
fps (median of 5 s lines) 8.5 21.6
frame 117.4 ms 46.3 ms
card time / frame (card meter) 106.6 ms 22.9 ms
the pair 54-95 ms in 0.8-1.0 lists not run
card busy; seconds at 95 % or more 100 %; 79 % 67 %; 0 %
preparing 32.8 ms 38.3 ms
draws 6,160 (steady) 4,016 (2,100-6,400)
fps at 4,500+ draws only 8.4-8.5 18.8-18.9

Two 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):

Run Frame ≈ r
cec481f4 release, 24 min 29.0 ms + 4.5 ms per 1,000 draws 0.81
41adb551 release 29.7 + 3.9 0.82
41adb551 release, second run 39.8 + 3.4 0.69
41adb551 diagnostics (three runs) 44-48 + 3.8-4.1 0.56-0.76
autogenes-sudo, 5900X one channel 41-43 + 3.5-3.7
meonline42, 5900X + 3090 slope 2.4

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):

  • ~30,000 list calls (0.46) and ~20,000 refreshes (0.44) a frame;
  • 33.5 ms of preparing (0.76), of which the lists' steps are ~26 ms;
  • 11 ms of copying back (0.79);
  • ~12 ms of descriptor records (0.62), with 380,000-470,000 slots looked at;
  • lists reset in 10.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:

CPU Card Frame (preparing) Draws
i9-13900KF 4090 40.7 ms (32.5) house
i5-13600K 4070 Ti 42.7 ms (31.6) ~7,000
Ryzen 5 7500F, 6 cores 3080 Ti 53.6-62.5 ms (40.0-42.8) 6,500-6,900
Ryzen 9 5900X, 12 cores 3090 58.8-61.1 ms (44.0-44.8) 6,000-8,400
Ryzen 7 5800X 5070 70-79 ms (60.6-66.3) not given
i9-9900KF (Series S) 3080 72.9 ms (65.2) open world

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

  • Title affinities on hosts with fewer than 14 logical processors. remap_mask leaves 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=free against the default is the test, and a log line when SetThreadGroupAffinity fails would show it.
  • CPU burnt while waiting. Same spot, same draws: the process runs 454 ms user a frame when the frame is 54 ms (folding off) and 641 ms when the card holds it to 116 ms (folding on). About 190 ms a frame of CPU is spent in the extra waiting. I cannot say which threads; burber saw the title's job workers spin on Sleep(0).

What I would do next, in order

  1. Add card time and card busy to the A/B method for cards under 16 GB (section 3).
  2. Look at the 2561af9577c47289 / cabb87599722e59a pair on 30-series and 12 GB cards.
  3. Split the floor per submission and per list (section 4).
  4. Name what the submitting thread is blocked on once PORT_GUARD is in (section 2a).

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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7278984716 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7278984716). Originally posted by [nikitronick-crypto](https://github.com/nikitronick-crypto) on 2026-11-30T12:49:59Z. --- ## 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, 41adb551 and `port-guard` ca21195b, Series X 1440p DLSS Balanced, FSR FG 2x). Short version: - **Savings in "preparing" reach the frame at 0-70 %, never 100 %.** That holds for every A/B in this thread. Two measurable reasons are below. - **On a 12 GB 30-series card the frame is card-bound part of the time**, because of one compute pair. When it is, CPU savings turn into waiting for the card, one for one. - **About half the frame does not scale with draws.** The floor is 27-40 ms here in release builds, and nobody has split it. - **The submitting thread is on a CPU for only 59-72 % of its "preparing" time.** The rest is blocked time, which is what PORT_GUARD removes and why its gain is small. 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 | Change | Who / machine | Preparing | Frame | |---|---|---|---| | `VICTORY_LIGHT_REFRESH=0` | dyshay, 4090 | +24.1 ms | +24.9 ms | | `VICTORY_LIGHT_REFRESH=0` | burber, 4070 Ti | +16 ms | +12.7 ms | | `VICTORY_PORT_GUARD=1` | dyshay, 4090 (2 runs) | −5.1 ± 1.3 ms | −2.0 ± 0.9 ms | | `VICTORY_PORT_GUARD=1` | me, 3080 Ti, card 69 % busy | −2.2 ms | −1.5 ms | | `VICTORY_PORT_GUARD=1` | meonline42, 5900X + 3090 | not given | −0.4 to −1.2 ms | | spin before parking in `guards()` | me, 41adb551, card ~80 % busy | −3.9 ms | +1.2 ms | | Promote-on-Alias | burber, 4070 Ti | +3 ms | no change | | f72cec77 → 41adb551 (10 commits) | DoubleD17, 5800X + 5070 | 63.8 → 62.6 ms | 13.4 → 13.5 fps | | earlier refresh speed-up (19-30 → 13-14 ms) | dyshay | lower | no change | | `VICTORY_GUARD_HOT=50` | burber, autogenes-sudo, me | | slower on all three | | more helper threads | me (12/8/6), Arian1192 (`WIDE_THREADS=2` same fps) | | slower or equal | 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 kernel` gives the submitting thread's CPU time inside its submissions: | Run | In submissions (wall) | On a CPU | Share | |---|---|---|---| | 41adb551, outdoors, ~9k draws | 66.7 ms | 39.1 ms | 59 % | | 41adb551 + spin, outdoors | 64.4 ms | 42.7 ms | 66 % | | 41adb551, standing still | 46.3 ms | 31.3 ms | 68 % | | 41adb551 + spin, standing still | 41.4 ms | 29.7 ms | 72 % | | `port-guard`, switch off | 48.2 ms | 30.4 ms | 63 % | | `port-guard`, switch on | 46.1 ms | 30.4 ms | 66 % | PORT_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: | Pair | Card busy | Preparing | "on the GPU" | Frame | |---|---|---|---|---| | PORT_GUARD, folding forced off | 69 % | −2.2 ms | +0.2 ms | −1.5 ms | | spin, 41adb551 | 80-83 % | −3.9 ms | +3.4 ms | +1.2 ms | | PORT_GUARD, folding on | 99-100 % | −4.1 ms | +10.0 ms | +9.1 ms | This 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: - The card meter reads 44-54 ms of card time a frame. The card clock says 80-83 % busy at the median, and 28-32 % of the seconds are at 95 % or more. - **One kind of list is 18-19 ms of that:** `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. - Second by second, frame time follows card time (r = 0.72 and 0.77 in two runs). In the third of the seconds with the least card time the frame is 56-59 ms; in the third with the most it is 77-83 ms. - The pair depends on the scene. In a 5-minute outdoor run it is absent from all 17 card-meter blocks, the card is 63 % busy, and frame time does not follow card time (r = 0.04). The same spot under three translations of those programs: | | Card time / frame | The pair | Mean frame | p95 | Frames over 100 ms | |---|---|---|---|---|---| | `port-guard`, folding on (its default; frame figures from one run) | 75-116 ms | 46-79 ms | 101 ms | 175 ms | 45 % | | 41adb551 (folding off, last resort on) | 44-54 ms | 18-19 ms | 66-71 ms | 114-119 ms | 9-12 % | | `port-guard`, `VICTORY_WAVE_FOLDED=0` | 28 ms | not listed | 54-56 ms | 68-72 ms | 0-0.3 % | The 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: 1. **Method.** An A/B of a CPU-side switch on a card under 16 GB should report card time and card busy next to draws, and leave out or regress the card-bound seconds. Otherwise real CPU gains read as zero. 2. **A lever for these cards.** At this spot that pair is worth up to 20-30 % mean fps (14.1-15.1 → 18.0-18.6) and most of the tail. It needs someone who knows the translator to say which form those two programs take on 41adb551 (`VICTORY_WAVE_WHY=1`) and whether a cheaper exact form exists. 3. **The direct test on 41adb551** (release, same save and spot, two runs ten minutes apart, only `VICTORY_LEAVE_OUT` differs): | | Default | Pair in `VICTORY_LEAVE_OUT` | |---|---|---| | fps (median of 5 s lines) | 8.5 | 21.6 | | frame | 117.4 ms | 46.3 ms | | card time / frame (card meter) | 106.6 ms | 22.9 ms | | the pair | 54-95 ms in 0.8-1.0 lists | not run | | card busy; seconds at 95 % or more | 100 %; 79 % | 67 %; 0 % | | preparing | 32.8 ms | 38.3 ms | | draws | 6,160 (steady) | 4,016 (2,100-6,400) | | fps at 4,500+ draws only | 8.4-8.5 | 18.8-18.9 | Two 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): | Run | Frame ≈ | r | |---|---|---| | cec481f4 release, 24 min | 29.0 ms + 4.5 ms per 1,000 draws | 0.81 | | 41adb551 release | 29.7 + 3.9 | 0.82 | | 41adb551 release, second run | 39.8 + 3.4 | 0.69 | | 41adb551 diagnostics (three runs) | 44-48 + 3.8-4.1 | 0.56-0.76 | | autogenes-sudo, 5900X one channel | 41-43 + 3.5-3.7 | | | meonline42, 5900X + 3090 | slope 2.4 | | 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): - ~30,000 list calls (0.46) and ~20,000 refreshes (0.44) a frame; - 33.5 ms of preparing (0.76), of which the lists' steps are ~26 ms; - 11 ms of copying back (0.79); - ~12 ms of descriptor records (0.62), with 380,000-470,000 slots looked at; - `lists reset in` 10.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: | CPU | Card | Frame (preparing) | Draws | |---|---|---|---| | i9-13900KF | 4090 | 40.7 ms (32.5) | house | | i5-13600K | 4070 Ti | 42.7 ms (31.6) | ~7,000 | | Ryzen 5 7500F, 6 cores | 3080 Ti | 53.6-62.5 ms (40.0-42.8) | 6,500-6,900 | | Ryzen 9 5900X, 12 cores | 3090 | 58.8-61.1 ms (44.0-44.8) | 6,000-8,400 | | Ryzen 7 5800X | 5070 | 70-79 ms (60.6-66.3) | not given | | i9-9900KF (Series S) | 3080 | 72.9 ms (65.2) | open world | 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 - **Title affinities on hosts with fewer than 14 logical processors.** `remap_mask` leaves 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=free` against the default is the test, and a log line when `SetThreadGroupAffinity` fails would show it. - **CPU burnt while waiting.** Same spot, same draws: the process runs 454 ms user a frame when the frame is 54 ms (folding off) and 641 ms when the card holds it to 116 ms (folding on). About 190 ms a frame of CPU is spent in the extra waiting. I cannot say which threads; burber saw the title's job workers spin on `Sleep(0)`. ### What I would do next, in order 1. Add card time and card busy to the A/B method for cards under 16 GB (section 3). 2. Look at the `2561af9577c47289` / `cabb87599722e59a` pair on 30-series and 12 GB cards. 3. Split the floor per submission and per list (section 4). 4. Name what the submitting thread is blocked on once PORT_GUARD is in (section 2a). 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 commented 2026-11-30 13:25:55 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-30T13:25:55Z.


VICTORY_FILL_TITLE=1 on the 5900X + RTX 3090, the same e1f2eb6-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.

copying back preparing frames over 100 ms p95 frame 10% low
off (4 runs) 11.0-11.9 ms 47.7-51.2 ms 74 / 203 / 110 / 91 86-95 ms 11-12 fps
on (3 runs) 7.6-8.0 ms 48.4-49.5 ms 52 / 58 / 33 81-84 ms 12-13 fps

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 +0x2215c35 hang 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7279835204 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7279835204). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-30T13:25:55Z. --- `VICTORY_FILL_TITLE=1` on the 5900X + RTX 3090, the same `e1f2eb6`-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. | | copying back | preparing | frames over 100 ms | p95 frame | 10% low | |---|---|---|---|---|---| | off (4 runs) | 11.0-11.9 ms | 47.7-51.2 ms | 74 / 203 / 110 / 91 | 86-95 ms | 11-12 fps | | on (3 runs) | **7.6-8.0 ms** | 48.4-49.5 ms | **52 / 58 / 33** | **81-84 ms** | 12-13 fps | 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 `+0x2215c35` hang 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 commented 2026-11-30 13:30:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-30T13:30:44Z.


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-submit is busy for practically the whole frame. It's the limit.
  • The eight victory-list-* recording threads spend about half their samples idle in list::thin::start. More or faster recording won't move the frame here.
  • On the submitting thread nothing is over ~12%: driver calls ~19% in total, its own chunks of 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:

  1. Refresh ahead: run submission N+1's refresh on the helpers while the submitting thread records and sends N. That changes when title memory is captured, so it needs a rule for writes that land between the early capture and the submission. The write-watch already sees those writes.
  2. Fewer driver calls on the submitting thread: about 19% is ExecuteCommandLists, residency and recording calls. SUBMIT_SPLIT moved 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7279950991 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7279950991). Originally posted by [burber](https://github.com/burber) on 2026-11-30T13:30:44Z. --- 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-submit` is busy for practically the whole frame. It's the limit. - The eight `victory-list-*` recording threads spend about half their samples idle in `list::thin::start`. More or faster recording won't move the frame here. - On the submitting thread nothing is over ~12%: driver calls ~19% in total, its own chunks of `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: 1. **Refresh ahead:** run submission N+1's refresh on the helpers while the submitting thread records and sends N. That changes when title memory is captured, so it needs a rule for writes that land between the early capture and the submission. The write-watch already sees those writes. 2. **Fewer driver calls on the submitting thread:** about 19% is `ExecuteCommandLists`, residency and recording calls. `SUBMIT_SPLIT` moved 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 commented 2026-11-30 13:37:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by m335671 on 2026-11-30T13:37:57Z.


A small data point on the GPU side, in case someone weighs porting it: foxhound's VICTORY_HOST_FLOAT (readmet3xt-lab/foxhound 03ab739) and its water tile-light fix (85b56b9), cherry-picked onto 829188e. 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_FLOAT writes 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_nvidia export, the water module next to mesh_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.

scene A (~4,100 draws) fps submitting thread "preparing" card time, title's lists
829188e 24.1 / 23.8 32.6 / 33.0 ms 27.4 / 27.4 ms
+ the two ports 25.0 (*) 32.2 ms (*) 26.8 / 26.8 ms

(*) The first ported run was still translating shaders, so only its card time is counted.

What we saw:

  • About 0.6 ms (~2 %) less card time per frame, the same in both ported runs. foxhound reports 8-10 ms in a night city capture, where the light passes it speeds up are heavy; this indoor scene has little of that, so a small effect here is not surprising.
  • No change in fps. This scene is bound by the submitting thread on this CPU, so the card's saving doesn't show.
  • Water: we also ran a save that goes into a boat cutscene with a lot of water. We saw no dark blocks in either build in the captures we looked at, so we can't confirm or rule out the fix from this. The cutscene's timing differed between runs (2-3k draws), so its numbers aren't comparable.
  • One ported run stopped at 158 s with 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_FLOAT looks 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7280125358 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7280125358). Originally posted by [m335671](https://github.com/m335671) on 2026-11-30T13:37:57Z. --- A small data point on the GPU side, in case someone weighs porting it: foxhound's `VICTORY_HOST_FLOAT` (readmet3xt-lab/foxhound `03ab739`) and its water tile-light fix (`85b56b9`), cherry-picked onto `829188e`. 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_FLOAT` writes 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_nvidia` export, the water module next to `mesh_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. | scene A (~4,100 draws) | fps | submitting thread "preparing" | card time, title's lists | |---|---|---|---| | `829188e` | 24.1 / 23.8 | 32.6 / 33.0 ms | 27.4 / 27.4 ms | | + the two ports | 25.0 (*) | 32.2 ms (*) | 26.8 / 26.8 ms | (*) The first ported run was still translating shaders, so only its card time is counted. What we saw: - **About 0.6 ms (~2 %) less card time per frame**, the same in both ported runs. foxhound reports 8-10 ms in a night city capture, where the light passes it speeds up are heavy; this indoor scene has little of that, so a small effect here is not surprising. - **No change in fps.** This scene is bound by the submitting thread on this CPU, so the card's saving doesn't show. - **Water:** we also ran a save that goes into a boat cutscene with a lot of water. We saw no dark blocks in either build in the captures we looked at, so we can't confirm or rule out the fix from this. The cutscene's timing differed between runs (2-3k draws), so its numbers aren't comparable. - One ported run stopped at 158 s with `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_FLOAT` looks 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 commented 2026-11-30 13:49:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-11-30T13:49:42Z.


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-submit used 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_scoped itself, ~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.
  • heap reallocs, ~7 %: most of it is card_steps::does_of growing its step vectors (sizing them up front gave nothing measurable, see above), then watch::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 plus PORT_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_TITLE on 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7280421505 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7280421505). Originally posted by [burber](https://github.com/burber) on 2026-11-30T13:49:42Z. --- 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-submit` used 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_scoped` itself, ~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. - heap reallocs, ~7 %: most of it is `card_steps::does_of` growing its step vectors (sizing them up front gave nothing measurable, see above), then `watch::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 plus `PORT_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_TITLE` on 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 commented 2026-11-30 13:52:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nikitronick-crypto on 2026-11-30T13:52:08Z.


@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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7280486085 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7280486085). Originally posted by [nikitronick-crypto](https://github.com/nikitronick-crypto) on 2026-11-30T13:52:08Z. --- @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 commented 2026-11-30 14:23:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T14:23:11Z.


Results on our side (RTX 4090 + i9-13900KF, our fork's main = trustno1 main + PORT_GUARD default, Series S + hardware RT, 15 s in-run phases, draws regressed out):

switch scene effect on the frame
STORE_BESIDE + COPY_BESIDE (AB of both) outdoor parking, 900 s STORE_BESIDE −1.67 ± 0.52; both −1.56 ± 0.53 (COPY_BESIDE adds nothing)
STORE_BESIDE static motel, 660 s −0.30 ± 0.89 (neutral)
STORE_BESIDE outdoor parking again, 900 s, 49 pairs −1.12 ± 0.25
FILL_TITLE (read once: 2 off/on pairs, 300 s, same save) outdoor parking worse here: 38.0/38.2 → 40.0/41.0 ms median, p95 46.7 → 51.5/63.7, preparing +2 ms, draws equal in pair b

So STORE_BESIDE stacks with PORT_GUARD on this machine (unlike burber's overlap), and we've made it the default in our fork. FILL_TITLE doesn'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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7281290335 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7281290335). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T14:23:11Z. --- Results on our side (RTX 4090 + i9-13900KF, our fork's main = trustno1 main + `PORT_GUARD` default, Series S + hardware RT, 15 s in-run phases, draws regressed out): | switch | scene | effect on the frame | |---|---|---| | `STORE_BESIDE` + `COPY_BESIDE` (AB of both) | outdoor parking, 900 s | `STORE_BESIDE` −1.67 ± 0.52; both −1.56 ± 0.53 (`COPY_BESIDE` adds nothing) | | `STORE_BESIDE` | static motel, 660 s | −0.30 ± 0.89 (neutral) | | `STORE_BESIDE` | outdoor parking again, 900 s, 49 pairs | **−1.12 ± 0.25** | | `FILL_TITLE` (read once: 2 off/on pairs, 300 s, same save) | outdoor parking | **worse here**: 38.0/38.2 → 40.0/41.0 ms median, p95 46.7 → 51.5/63.7, preparing +2 ms, draws equal in pair b | So `STORE_BESIDE` stacks with `PORT_GUARD` on this machine (unlike burber's overlap), and we've made it the default in our fork. `FILL_TITLE` doesn'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 commented 2026-11-30 14:55:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Damix49 on 2026-11-30T14:55:12Z.


Data point from a mid-range PC: Ryzen 9 5900X + RTX 3070 Ti (8 GB) + 32 GB DDR4-3600 CL20

Build: main at 41adb551, release + diag builds. 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):

  • Submitting thread: ~59 ms of work in ~22 submissions per frame, plus ~10 ms waiting for the submission lock.
  • Write-watch checks: ~36 ms per frame (432 askings, ~9.5 GB checked, 99.4% unchanged).
  • Waits for the guards' lock: ~41 ms per frame summed over all threads (201 waits); 439 write faults, 13.4 ms.
  • List resets: ~23 ms per frame.
  • Recording: ~39 ms per thread on 8 threads.
  • The process uses ~950 ms user time per 95 ms frame, so about 10 of the 12 cores are busy. On this CPU the wall is total core time as well as the submitting thread.

Switches tried one per run (release build, same spot; CPU "preparing" time per frame):

  • Baseline: ~59 ms
  • 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)
  • A/B in one run, VICTORY_JOIN_PARTS 8 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:

  • With the cap, the advisor's "video memory is full" line stays on permanently, because it compares total use against the capped budget.
  • -More on play-nvidia.ps1 doesn't survive "save and restart" from F1. Putting the switch in victory-settings.txt does.

Happy to run a specific build or A/B on this machine if a mid-range data point helps (PR #3760, for example).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7282137330 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7282137330). Originally posted by [Damix49](https://github.com/Damix49) on 2026-11-30T14:55:12Z. --- **Data point from a mid-range PC: Ryzen 9 5900X + RTX 3070 Ti (8 GB) + 32 GB DDR4-3600 CL20** Build: `main` at `41adb551`, release + `diag` builds. 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):** - Submitting thread: ~59 ms of work in ~22 submissions per frame, plus ~10 ms waiting for the submission lock. - Write-watch checks: ~36 ms per frame (432 askings, ~9.5 GB checked, 99.4% unchanged). - Waits for the guards' lock: ~41 ms per frame summed over all threads (201 waits); 439 write faults, 13.4 ms. - List resets: ~23 ms per frame. - Recording: ~39 ms per thread on 8 threads. - The process uses ~950 ms user time per 95 ms frame, so about 10 of the 12 cores are busy. On this CPU the wall is total core time as well as the submitting thread. **Switches tried one per run (release build, same spot; CPU "preparing" time per frame):** - Baseline: ~59 ms - `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) - A/B in one run, `VICTORY_JOIN_PARTS` 8 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: - With the cap, the advisor's "video memory is full" line stays on permanently, because it compares total use against the capped budget. - `-More` on `play-nvidia.ps1` doesn't survive "save and restart" from F1. Putting the switch in `victory-settings.txt` does. Happy to run a specific build or A/B on this machine if a mid-range data point helps (PR #3760, for example).
meonline42 commented 2026-11-30 17:00:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-30T17:00:19Z.


A frame-pacing regression on this CPU-bound 5900X + RTX 3090, from e1f2eb6 to 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. The e1f2eb6-based runs used the older launcher's switches; the new ones as listed:

runs fps (median) frame submitting thread worked title waited at presents p95 frames over 100 ms
e1f2eb6-based 3 16-18 56-62 ms 50.7 ms 11.6 ms 72-76 ms 13-26
c71899d9, play-foxhound.ps1 defaults 3 13 74-77 ms ~41 ms 30.3 ms 91-100 ms 502-655
c71899d9 + play.rs's 2026-11-30 bench set 3 14-15 69-74 ms 41.3 ms 30.3 ms 86-90 ms 662-674
c71899d9 + that set + step 1 (SUBMIT_FRAMES=2 etc.) 2 15 68-69 ms 40-43 ms 0.0 ms 81-82 ms 603-653
c71899d9 with exactly the older switch set 2 14 74 ms 46-49 ms 35 ms 92-97 ms 518-659

So 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 829188e combine already showed it here as a worse tail, so it's somewhere in e1f2eb6..829188e or 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 +0x2215c35 hang 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7285568259 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7285568259). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-30T17:00:19Z. --- A frame-pacing regression on this CPU-bound 5900X + RTX 3090, from `e1f2eb6` to 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. The `e1f2eb6`-based runs used the older launcher's switches; the new ones as listed: | | runs | fps (median) | frame | submitting thread worked | **title waited at presents** | p95 | frames over 100 ms | |---|---|---|---|---|---|---|---| | `e1f2eb6`-based | 3 | 16-18 | 56-62 ms | 50.7 ms | **11.6 ms** | 72-76 ms | 13-26 | | `c71899d9`, `play-foxhound.ps1` defaults | 3 | 13 | 74-77 ms | ~41 ms | 30.3 ms | 91-100 ms | 502-655 | | `c71899d9` + play.rs's 2026-11-30 bench set | 3 | 14-15 | 69-74 ms | 41.3 ms | 30.3 ms | 86-90 ms | 662-674 | | `c71899d9` + that set + step 1 (`SUBMIT_FRAMES=2` etc.) | 2 | 15 | 68-69 ms | 40-43 ms | 0.0 ms | 81-82 ms | 603-653 | | `c71899d9` with **exactly the older switch set** | 2 | 14 | 74 ms | 46-49 ms | **35 ms** | 92-97 ms | 518-659 | So 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 `829188e` combine already showed it here as a worse tail, so it's somewhere in `e1f2eb6..829188e` or 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 `+0x2215c35` hang 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 commented 2026-11-30 17:39:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T17:39:26Z.


@meonline42 we see the same regression on c71899d9, worse on our side (RTX 4090 + i9, 32 GB RAM, our merge of c71899d9): 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, and pipeline library: slow load ... ms=7990 ... loaded=false repeats 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7286648397 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7286648397). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T17:39:26Z. --- @meonline42 we see the same regression on c71899d9, worse on our side (RTX 4090 + i9, 32 GB RAM, our merge of c71899d9): 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, and `pipeline library: slow load ... ms=7990 ... loaded=false` repeats 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 commented 2026-11-30 17:57:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-30T17:57:11Z.


@dyshay I checked my logs for that. No slow load lines and no 3 s compute-pipeline waits here (64 GB RAM; the library loads 0.8 GB on the old base, 1.0 GB on c71899d9, 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 pipeline per run (16 + 13 at two slot addresses).
  • c71899d9-based: none of those. Instead several a 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 then in 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_OUTOFMEMORY retries 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7287092981 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7287092981). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-30T17:57:11Z. --- @dyshay I checked my logs for that. No `slow load` lines and no 3 s compute-pipeline waits here (64 GB RAM; the library loads 0.8 GB on the old base, 1.0 GB on `c71899d9`, 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 pipeline` per run (16 + 13 at two slot addresses). - **`c71899d9`-based:** none of those. Instead several `a 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 then`** in 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_OUTOFMEMORY` retries 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 commented 2026-11-30 18:50:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Damix49 on 2026-11-30T18:50:58Z.


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 with scripts\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.

build fps rendered (median) process memory textures notes
e1f2eb6 (28/11) 11.5-16 ~21 GB all fine GPU waits p90 < 9 ms, no crash
41adb551 (29/11) 12-15 ~22-25 GB fine occasional long GPU waits in heavy scenes
c71899d9 (30/11) 13-15 ~48 GB, then crash at ~15 min yellow light bands on walls and legs, flat walls, speckled hair details in #4079
84bd61e2 (30/11) ~12 ~30 GB, 0.2 GB RAM free ~20,000 textures waiting (white ground, skin, bushes) after -Preload and -WarmUsed

On 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 e1f2eb6 the 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 implemented on e1f2eb6, so part of its speed may be skipped work. I haven't spotted a missing effect in play yet, though.

Staying on e1f2eb6 for now, and happy to A/B a candidate fix on this 32 GB machine.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7288457189 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7288457189). Originally posted by [Damix49](https://github.com/Damix49) on 2026-11-30T18:50:58Z. --- **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 with `scripts\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. | build | fps rendered (median) | process memory | textures | notes | |---|---|---|---|---| | `e1f2eb6` (28/11) | 11.5-16 | ~21 GB | all fine | GPU waits p90 < 9 ms, no crash | | `41adb551` (29/11) | 12-15 | ~22-25 GB | fine | occasional long GPU waits in heavy scenes | | `c71899d9` (30/11) | 13-15 | **~48 GB**, then crash at ~15 min | yellow light bands on walls and legs, flat walls, speckled hair | details in #4079 | | `84bd61e2` (30/11) | ~12 | **~30 GB**, 0.2 GB RAM free | **~20,000 textures waiting** (white ground, skin, bushes) | after `-Preload` and `-WarmUsed` | **On 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 `e1f2eb6` the 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 implemented` on `e1f2eb6`, so part of its speed may be skipped work. I haven't spotted a missing effect in play yet, though. Staying on `e1f2eb6` for now, and happy to A/B a candidate fix on this 32 GB machine.
dyshay commented 2026-11-30 19:18:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T19:18:24Z.


Cause found for the c71899d9 regression on our side, and it may be what others see too: since 38671a8b, victory shaders / warm / preload call play::apply_defaults(), which fills every unset variable with victory 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 with victory run without those switches (e.g. play-foxhound.ps1) gets a game whose translation key differs from the preload's: we logged fixed=84859d46… in every warm process vs fixed=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 set VICTORY_MENU_FILE (play's prepare, play-foxhound.ps1, F1 restarts); a bare victory preload keeps 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 uses victory run with its own switch set, checking for a shader translations keyed mismatch (or cache misses right after a preload) would tell whether you hit the same thing.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7289176250 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7289176250). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T19:18:24Z. --- Cause found for the c71899d9 regression on our side, and it may be what others see too: since 38671a8b, `victory shaders` / `warm` / `preload` call `play::apply_defaults()`, which fills every unset variable with `victory 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 with `victory run` without those switches (e.g. `play-foxhound.ps1`) gets a game whose translation key differs from the preload's: we logged `fixed=84859d46…` in every warm process vs `fixed=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 set `VICTORY_MENU_FILE` (play's `prepare`, play-foxhound.ps1, F1 restarts); a bare `victory preload` keeps 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 uses `victory run` with its own switch set, checking for a `shader translations keyed` mismatch (or cache misses right after a preload) would tell whether you hit the same thing.
davemathews12 commented 2026-11-30 19:42:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-11-30T19:42:04Z.


@dyshay I read port-guard (ca21195b, the watch.rs part) for the two things that would bite in a lock split like this, and both hold:

  • No lost writes. A block is noted clean under the lock and made read-only after it's let go, but guard() runs planned.make() before it returns written, 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() includes BUSY), so nobody skips a copy on the strength of a protection that isn't in place yet.
  • No deadlock. A claimant only ever try_locks GUARDS (in make()), never waits on it. Lock holders wait for claims while running apply_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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7289804135 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7289804135). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-11-30T19:42:04Z. --- @dyshay I read `port-guard` (ca21195b, the `watch.rs` part) for the two things that would bite in a lock split like this, and both hold: - **No lost writes.** A block is noted clean under the lock and made read-only after it's let go, but `guard()` runs `planned.make()` before it returns `written`, 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()` includes `BUSY`), so nobody skips a copy on the strength of a protection that isn't in place yet. - **No deadlock.** A claimant only ever `try_lock`s `GUARDS` (in `make()`), never waits on it. Lock holders wait for claims while running `apply_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 commented 2026-11-30 19:45:25 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nikitronick-crypto on 2026-11-30T19:45:25Z.


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 lines

About 600 pages a frame are made no-access. Who touches them first:

first touch share of watched pages
the title reads 0.7 %
the title writes 0.8 %
our own code reads 87.1 %
nobody (landed in again untouched) 11.4 %

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:

stack share
Shadow::update_free > copy_stale/take_all > take_landed (shadow.rs:7592) > host::copy_mapped 76 %
the same, take_landed's not-noted branch > Shadow::copy 10 %
land helper > merge_page_under_writes > host::read_into 7 %
Host::submit > stale_under_flights > stale_of > merge_under_writes 7 %

So 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_LEAVE file from one run does not carry to the next.

4. Leaving them on the card: works, picture fine, no frame gain

Local patch: leave matches 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.

same-day runs without it with it
pieces left on the card per frame 0 106-131 (2.9-3.7 MB)
pieces landed per frame 340-370 220-245
copying back 12-19 ms 15.9 ms
frame, ~9,500 draws, frame generation off 57-59 ms 65.0 ms median (21 lines, 53-77)

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

  • A census leaves the run slower after it stops. In all four runs with 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.
  • Per operation this CPU is 1.4-2.9x slower than #4248's 275HX at about the same counts:
    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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7289892894 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7289892894). Originally posted by [nikitronick-crypto](https://github.com/nikitronick-crypto) on 2026-11-30T19:45:25Z. --- ## 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 lines About 600 pages a frame are made no-access. Who touches them first: | first touch | share of watched pages | |---|---| | the title reads | 0.7 % | | the title writes | 0.8 % | | our own code reads | 87.1 % | | nobody (landed in again untouched) | 11.4 % | 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: | stack | share | |---|---| | `Shadow::update_free` > `copy_stale`/`take_all` > `take_landed` (shadow.rs:7592) > `host::copy_mapped` | 76 % | | the same, `take_landed`'s not-noted branch > `Shadow::copy` | 10 % | | `land` helper > `merge_page_under_writes` > `host::read_into` | 7 % | | `Host::submit` > `stale_under_flights` > `stale_of` > `merge_under_writes` | 7 % | So 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_LEAVE` file from one run does not carry to the next. ### 4. Leaving them on the card: works, picture fine, no frame gain Local patch: `leave` matches 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. | | same-day runs without it | with it | |---|---|---| | pieces left on the card per frame | 0 | 106-131 (2.9-3.7 MB) | | pieces landed per frame | 340-370 | 220-245 | | copying back | 12-19 ms | 15.9 ms | | frame, ~9,500 draws, frame generation off | 57-59 ms | 65.0 ms median (21 lines, 53-77) | 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 - **A census leaves the run slower after it stops.** In all four runs with `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. - **Per operation this CPU is 1.4-2.9x slower than #4248's 275HX** at about the same counts: 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 commented 2026-11-30 20:39:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T20:39:42Z.


@davemathews12 thank you for reading it that closely. That's the reasoning behind the split: the block is in the copy before written returns, claimed blocks read as written, and claimants only try_lock. It's good to have it checked by someone else.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7291277037 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7291277037). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T20:39:42Z. --- @davemathews12 thank you for reading it that closely. That's the reasoning behind the split: the block is in the copy before `written` returns, claimed blocks read as written, and claimants only `try_lock`. It's good to have it checked by someone else.
MrDenn commented 2026-11-30 23:26:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by MrDenn on 2026-11-30T23:26:27Z.


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=1 the 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:

per frame RT off RT on
fetched from card copies 10–15 MB 89–97 MB
pieces compared on the card 3,600–4,000 12,900–13,100
relay thread landing 9–12 ms 28–31 ms
submitting thread 28–34 ms 45–49 ms
frame 46 ms (~22 fps) 66–70 ms (14–16 fps)

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)

  • 7,500–9,500 pages made no-access per frame (30–37 MB).
  • First touches per frame: the title reads 3–4 and writes 5–16. Our own code reads ~4,800. About 180–490 are landed in again untouched, and ~3,000–3,600 are changed by something else first. First touches come 0.2–0.3 frames after the landing.
  • 63 % of watched pages (17.4 M of 27.8 M) lie in MiB the title never touched, the same share you found. The 16 biggest such ranges cover 87 % of them.

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 in 0xd…/0xe… graphics memory)

per frame without (same day) with 14 ranges
fetched from card copies 95 MB 39 MB
relay thread landing 31 ms 22 ms
submitting thread 52 ms 40 ms
sent up to card copies 94 MB 63 MB

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+0x400000 and 0x7700000+0x200000 (next to 0x6400000, 0x6500000 and 0x7600000, 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 #4526 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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7295119435 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7295119435). Originally posted by [MrDenn](https://github.com/MrDenn) on 2026-11-30T23:26:27Z. --- ## 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](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7289892894). With `VICTORY_HW_RT=1` the 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`: | per frame | RT off | RT on | |---|---|---| | fetched from card copies | 10–15 MB | 89–97 MB | | pieces compared on the card | 3,600–4,000 | 12,900–13,100 | | relay thread landing | 9–12 ms | 28–31 ms | | submitting thread | 28–34 ms | 45–49 ms | | frame | 46 ms (~22 fps) | 66–70 ms (14–16 fps) | 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) - 7,500–9,500 pages made no-access per frame (30–37 MB). - First touches per frame: **the title reads 3–4 and writes 5–16**. Our own code reads ~4,800. About 180–490 are landed in again untouched, and ~3,000–3,600 are changed by something else first. First touches come 0.2–0.3 frames after the landing. - **63 %** of watched pages (17.4 M of 27.8 M) lie in MiB the title never touched, the same share you found. The 16 biggest such ranges cover 87 % of them. ### 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 in `0xd…`/`0xe…` graphics memory) | per frame | without (same day) | with 14 ranges | |---|---|---| | fetched from card copies | 95 MB | **39 MB** | | relay thread landing | 31 ms | **22 ms** | | submitting thread | 52 ms | **40 ms** | | sent up to card copies | 94 MB | **63 MB** | 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+0x400000` and `0x7700000+0x200000` (next to `0x6400000`, `0x6500000` and `0x7600000`, 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 #4526 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 commented 2026-11-30 23:39:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T23:39:08Z.


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:

  • A leave list should not be trusted blind. A left range stays no-access on the CPU side, and the first title access faults, lands that range in full and drops it from the list (the #4526 pattern). Rare readers then cost one fault, not a broken shadow.
  • Our own code should read the card copy, not the landed one, so leaving a range never changes what our checks see.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7295371846 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7295371846). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T23:39:08Z. --- 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: - A leave list should not be trusted blind. A left range stays no-access on the CPU side, and the first title access faults, lands that range in full and drops it from the list (the #4526 pattern). Rare readers then cost one fault, not a broken shadow. - Our own code should read the card copy, not the landed one, so leaving a range never changes what our checks see. 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 commented 2026-11-30 23:42:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by m335671 on 2026-11-30T23:42:39Z.


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 829188e and of main at e1251c31 (unmodified), Series X, 1440p output, frame generation off. Both started with victory run and exactly the same switches, including the three shader-key ones that main's warm now 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.

build fps p10 fps submitting thread "preparing" card time peak committed / card memory
829188e 21.7 / 23.0 15.5 / 17.3 36.5 / 35.0 ms 31.1 / 30.7 ms 31.7 / 10.3-10.4 GB
e1251c31 26.0 / 26.6 21.5 / 18.7 28.2 / 25.5 ms 31.4 / 31.4 ms 33.2-33.6 / 10.8 GB

What we saw:

  • Main was faster here, not slower: about +3.5 fps and 8-10 ms less preparing per frame, in both runs. Card time was the same.
  • Memory went up a little: about 2 GB more committed and ~450 MB more on the card at peak. On this 31 GB PC it stayed below the point where things fall apart, but it points the same way as @Damix49's 32 GB report.
  • Both builds logged the same 13 DeserializeComputePipelineStateX lines per run. No E_OUTOFMEMORY, no slow 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 829188e numbers are lower than in my earlier comments because the three shader-key switches are now on for it too.)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7295438056 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7295438056). Originally posted by [m335671](https://github.com/m335671) on 2026-11-30T23:42:39Z. --- 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 `829188e` and of main at `e1251c31` (unmodified), Series X, 1440p output, frame generation off. Both started with `victory run` and **exactly the same switches**, including the three shader-key ones that main's `warm` now 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. | build | fps | p10 fps | submitting thread "preparing" | card time | peak committed / card memory | |---|---|---|---|---|---| | `829188e` | 21.7 / 23.0 | 15.5 / 17.3 | 36.5 / 35.0 ms | 31.1 / 30.7 ms | 31.7 / 10.3-10.4 GB | | `e1251c31` | **26.0 / 26.6** | 21.5 / 18.7 | **28.2 / 25.5 ms** | 31.4 / 31.4 ms | 33.2-33.6 / 10.8 GB | What we saw: - **Main was faster here, not slower:** about +3.5 fps and 8-10 ms less preparing per frame, in both runs. Card time was the same. - **Memory went up a little:** about 2 GB more committed and ~450 MB more on the card at peak. On this 31 GB PC it stayed below the point where things fall apart, but it points the same way as @Damix49's 32 GB report. - Both builds logged the same 13 `DeserializeComputePipelineStateX` lines per run. No `E_OUTOFMEMORY`, no `slow 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 `829188e` numbers are lower than in my earlier comments because the three shader-key switches are now on for it too.)
davemathews12 commented 2026-12-01 02:15:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-12-01T02:15:10Z.


@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.rs pages_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_written calls per range (or log the ranges pages_written names), 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?

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7298408023 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7298408023). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-12-01T02:15:10Z. --- @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.rs `pages_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_written` calls per range (or log the ranges `pages_written` names), 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 commented 2026-12-01 02:33:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by burber on 2026-12-01T02:33:30Z.


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 own VirtualProtect and every title_memory_* change take blocks out.

  • Kernel askings over ~1,470 MB a frame → ~400 MB (~10 MB of it actually written); kernel time 4.7 → 2.6 ms; ~0.5 cold blocks reopened by a write fault a frame.
  • In-run A/B, release: −1.42 ± 0.63 ms (20 pairs); −1.73 ± 1.22 in a second run. Picture fine in motion (walking, fast camera turns).
  • Two gotchas worth knowing if anyone does similar: 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 saturated fread length reaches writing.

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.

  • Refreshes 11.5 → ~9.2 ms a frame, the helper wait 5.5 → ~3.9 ms, ~22 MB a frame pulled in ~180 copies.
  • But more object flicker by eye (objects disappearing for a frame), not fixed by waiting for the pull list right after sending it, and one run removed the device ~1.5 min in (the card idle 5.4 s, then "device removed"; an earlier 3-min run was clean). Cause not found; I've stopped testing it on this PC. If someone with a crash-tolerant setup wants to look, the open questions are what the card's copy from an opened view reads when the title changes those pages, and which consumer of the heap's card side sees bytes it should not.

Also: VIctory-NVIDIA main 7d93ee07 runs 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7298744948 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7298744948). Originally posted by [burber](https://github.com/burber) on 2026-12-01T02:33:30Z. --- 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 own `VirtualProtect` and every `title_memory_*` change take blocks out. - Kernel askings over ~1,470 MB a frame → ~400 MB (~10 MB of it actually written); kernel time 4.7 → 2.6 ms; ~0.5 cold blocks reopened by a write fault a frame. - In-run A/B, release: **−1.42 ± 0.63 ms** (20 pairs); −1.73 ± 1.22 in a second run. Picture fine in motion (walking, fast camera turns). - Two gotchas worth knowing if anyone does similar: `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 saturated `fread` length reaches `writing`. **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. - Refreshes 11.5 → ~9.2 ms a frame, the helper wait 5.5 → ~3.9 ms, ~22 MB a frame pulled in ~180 copies. - **But** more object flicker by eye (objects disappearing for a frame), not fixed by waiting for the pull list right after sending it, and one run removed the device ~1.5 min in (the card idle 5.4 s, then "device removed"; an earlier 3-min run was clean). Cause not found; I've stopped testing it on this PC. If someone with a crash-tolerant setup wants to look, the open questions are what the card's copy from an opened view reads when the title changes those pages, and which consumer of the heap's card side sees bytes it should not. Also: VIctory-NVIDIA main 7d93ee07 runs 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 commented 2026-12-01 02:39:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-12-01T02:39:08Z.


@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, warm fills in play's defaults (BVH_MISS, NAN_SCRUB, SAMPLED_MARKS), which are part of the shader key. A title started with victory run without 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 than 829188e.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7298846165 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7298846165). Originally posted by [dyshay](https://github.com/dyshay) on 2026-12-01T02:39:08Z. --- @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, `warm` fills in play's defaults (`BVH_MISS`, `NAN_SCRUB`, `SAMPLED_MARKS`), which are part of the shader key. A title started with `victory run` without 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 than `829188e`. 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 commented 2026-12-01 03:59:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by m335671 on 2026-12-01T03:59:44Z.


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_DEPTH set by hand on warm and run). Each PR merged cleanly onto e1251c31 and built in release. Opt-in switches were set where a PR has one: #4489 SUBMIT_PIPE=1, #4558 SWEEP_OFF_THREAD=1 (their log lines show up, so they were active); #3760 is on by default; #4488 and #4532 have no switch. "all" is #4489 + #4488 + #3760 + #4558 together (#4532 conflicts with that set in watch.rs). Each exe warmed once, then scene A (240 s, ~4,000-4,200 draws), three rounds: forward, reverse, forward.

build fps r1 / r2 / r3 mean fps mean p10 mean "preparing" card time
main e1251c31 26.7 / 27.1 / 26.7 26.8 21.1 24.1 ms 31.1-31.4 ms
#4489 26.2 / 27.4 / 26.9 26.8 21.2 24.5 ms 31.0-31.2 ms
#4488 26.6 / 26.8 / 27.5 27.0 22.6 24.9 ms 31.1-31.4 ms
#4532 26.2 / 26.1 / 27.2 26.5 20.7 25.2 ms 31.1-31.4 ms
#3760 26.9 / 27.4 / 27.8 27.4 23.8 22.8 ms 31.1-31.4 ms
#4558 26.1 / 27.3 / 27.1 26.8 21.2 25.0 ms 31.1-31.4 ms
all four 27.2 / 26.9 / 27.0 27.0 20.7 23.5 ms 31.0-31.4 ms

What we saw:

  • Everything is inside the ±1.5 fps we see between identical runs. Nothing got worse, nothing clearly moved the average.
  • #3760 is the only one that was ahead in all three rounds against main: +0.2 to +1.1 fps and 0.2 to 2.0 ms less preparing per round (p10 higher in two rounds of three). Small, but it never went the other way.
  • Card time is ~31 ms everywhere, while frames are ~37 ms and preparing is now ~23-25 ms. On this 12-core CPU, main has already brought preparing below the card time in this scene, so a further CPU gain may not show as fps here. A slower CPU or a heavier outdoor scene would probably separate these PRs better than this one does.
  • No stops, no did not close, no E_OUTOFMEMORY, no device removed in any of the 21 runs. One slow load line 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 e1251c31 with UAV_FOLD=1 and 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7300269894 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7300269894). Originally posted by [m335671](https://github.com/m335671) on 2026-12-01T03:59:44Z. --- 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_DEPTH` set by hand on warm and run). Each PR merged cleanly onto `e1251c31` and built in release. Opt-in switches were set where a PR has one: #4489 `SUBMIT_PIPE=1`, #4558 `SWEEP_OFF_THREAD=1` (their log lines show up, so they were active); #3760 is on by default; #4488 and #4532 have no switch. "all" is #4489 + #4488 + #3760 + #4558 together (#4532 conflicts with that set in `watch.rs`). Each exe warmed once, then scene A (240 s, ~4,000-4,200 draws), three rounds: forward, reverse, forward. | build | fps r1 / r2 / r3 | mean fps | mean p10 | mean "preparing" | card time | |---|---|---|---|---|---| | main `e1251c31` | 26.7 / 27.1 / 26.7 | 26.8 | 21.1 | 24.1 ms | 31.1-31.4 ms | | #4489 | 26.2 / 27.4 / 26.9 | 26.8 | 21.2 | 24.5 ms | 31.0-31.2 ms | | #4488 | 26.6 / 26.8 / 27.5 | 27.0 | 22.6 | 24.9 ms | 31.1-31.4 ms | | #4532 | 26.2 / 26.1 / 27.2 | 26.5 | 20.7 | 25.2 ms | 31.1-31.4 ms | | #3760 | 26.9 / 27.4 / 27.8 | **27.4** | **23.8** | **22.8 ms** | 31.1-31.4 ms | | #4558 | 26.1 / 27.3 / 27.1 | 26.8 | 21.2 | 25.0 ms | 31.1-31.4 ms | | all four | 27.2 / 26.9 / 27.0 | 27.0 | 20.7 | 23.5 ms | 31.0-31.4 ms | What we saw: - **Everything is inside the ±1.5 fps we see between identical runs.** Nothing got worse, nothing clearly moved the average. - **#3760 is the only one that was ahead in all three rounds** against main: +0.2 to +1.1 fps and 0.2 to 2.0 ms less preparing per round (p10 higher in two rounds of three). Small, but it never went the other way. - **Card time is ~31 ms everywhere**, while frames are ~37 ms and preparing is now ~23-25 ms. On this 12-core CPU, main has already brought preparing below the card time in this scene, so a further CPU gain may not show as fps here. A slower CPU or a heavier outdoor scene would probably separate these PRs better than this one does. - No stops, no `did not close`, no `E_OUTOFMEMORY`, no device removed in any of the 21 runs. One `slow load` line 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 `e1251c31` with `UAV_FOLD=1` and 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 commented 2026-12-01 04:18:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by upipibi on 2026-12-01T04:18:32Z.


@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, main 5fabb46e; no runs.

Why. A refresh writes the copy's CPU side, and there is one per host copy, not one per submission. Host::submit holds 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 its card_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 what SUBMIT_SPLIT already 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 single wide_each_scoped slot, 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 of VICTORY_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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7300598528 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7300598528). Originally posted by [upipibi](https://github.com/upipibi) on 2026-12-01T04:18:32Z. --- @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, `main` 5fabb46e; no runs. **Why.** A refresh writes the copy's CPU side, and there is one per host copy, not one per submission. `Host::submit` holds 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 its `card_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 what `SUBMIT_SPLIT` already 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 single `wide_each_scoped` slot, 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 of `VICTORY_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 commented 2026-12-01 05:03:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CuteBooty on 2026-12-01T05:03:18Z.


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 + #4581, 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).

scene draws frame (ms) submitting thread busy in submissions list steps refreshes waiting on the card
near-empty hotel hallway 550-1,200 27-33 27-32 19.5-24 11-14 7-8.5 ~0
city, 5-9k draws (other sessions the same day) 5,000-9,000 55-57 54-55 38-41 23-24 15-16 ~0.3
  • The submitting thread is the frame on this CPU, in both cases: it is busy for nearly the whole frame, and the card is almost never waited on.
  • With about 550 draws it still needs about 27 ms a frame. Going from ~1,000 to ~7,000 draws adds only about 25-28 ms. So about half of the busy time in the city is a per-frame cost that does not depend on draws: refreshes, list steps and the submission path. That caps this CPU at about 37 rendered fps even in an empty room.
  • For reference, two changes that lowered parts of this did not lower the frame. #4530 (VICTORY_TEXTURE_HASH_EVERY=64 + VICTORY_TEXTURE_TURN_SPREAD=1) and #4294, 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.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7301375119 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7301375119). Originally posted by [CuteBooty](https://github.com/CuteBooty) on 2026-12-01T05:03:18Z. --- 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 + #4581, 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). | scene | draws | frame (ms) | submitting thread busy | in submissions | list steps | refreshes | waiting on the card | |---|---:|---:|---:|---:|---:|---:|---:| | near-empty hotel hallway | 550-1,200 | 27-33 | 27-32 | 19.5-24 | 11-14 | 7-8.5 | ~0 | | city, 5-9k draws (other sessions the same day) | 5,000-9,000 | 55-57 | 54-55 | 38-41 | 23-24 | 15-16 | ~0.3 | - The submitting thread is the frame on this CPU, in both cases: it is busy for nearly the whole frame, and the card is almost never waited on. - With about 550 draws it still needs about 27 ms a frame. Going from ~1,000 to ~7,000 draws adds only about 25-28 ms. So about half of the busy time in the city is a per-frame cost that does not depend on draws: refreshes, list steps and the submission path. That caps this CPU at about 37 rendered fps even in an empty room. - For reference, two changes that lowered parts of this did not lower the frame. #4530 (`VICTORY_TEXTURE_HASH_EVERY=64` + `VICTORY_TEXTURE_TURN_SPREAD=1`) and #4294, 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 commented 2026-12-01 09:36:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-12-01T09:36:03Z.


@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).

  • main 7d93ee07 with the launcher defaults plus BVH_MISS=1, NAN_SCRUB=1, SAMPLED_MARKS=1 (all three confirmed in the run's switch list)
  • against our own build (merge of e1f2eb6 + mouse/keyboard), its own launcher defaults
run fps median 10% low frame ms preparing ms copying back ms draws frames > 100 ms
main r1 13 12 75.5 40.8 17.2 7351 660
main r2 12 10 81.0 43.5 19.3 8106 683
ours r1 18 13 57.1 44.3 6.7 6827 69
ours r2 18 14 56.7 44.7 6.8 6703 33
  • No translation misses in main's measured runs: pipeline failures: 0 ... untranslated=0, nothing "being made".
  • Main draws ~10-20 % more here, but frame time is up ~35-40 % and frames over 100 ms are ~10-20x. So it is not only the extra draws.
  • From the submitting thread's breakdown (last 5 s window of r2 each):
    • in submissions: 65.0 vs 52.0 ms
    • list steps: 38.5 vs 31.8 ms
    • refreshes: 24.2 vs 20.2 ms
    • refreshes run on several threads: 4,213 vs 7,947 of ~9-10k flushes. Main spreads about half as many across the helpers.
    • copying back: 17-19 vs 6.7 ms, as in our earlier wave runs.
    • Main's process also sits at ~41 GB private / 71 GB committed.

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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7306934179 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7306934179). Originally posted by [meonline42](https://github.com/meonline42) on 2026-12-01T09:36:03Z. --- @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). - main `7d93ee07` with the launcher defaults plus `BVH_MISS=1`, `NAN_SCRUB=1`, `SAMPLED_MARKS=1` (all three confirmed in the run's switch list) - against our own build (merge of `e1f2eb6` + mouse/keyboard), its own launcher defaults | run | fps median | 10% low | frame ms | preparing ms | copying back ms | draws | frames > 100 ms | |---|---:|---:|---:|---:|---:|---:|---:| | main r1 | 13 | 12 | 75.5 | 40.8 | 17.2 | 7351 | 660 | | main r2 | 12 | 10 | 81.0 | 43.5 | 19.3 | 8106 | 683 | | ours r1 | 18 | 13 | 57.1 | 44.3 | 6.7 | 6827 | 69 | | ours r2 | 18 | 14 | 56.7 | 44.7 | 6.8 | 6703 | 33 | - No translation misses in main's measured runs: `pipeline failures: 0 ... untranslated=0`, nothing "being made". - Main draws ~10-20 % more here, but frame time is up ~35-40 % and frames over 100 ms are ~10-20x. So it is not only the extra draws. - From the submitting thread's breakdown (last 5 s window of r2 each): - in submissions: 65.0 vs 52.0 ms - list steps: 38.5 vs 31.8 ms - refreshes: 24.2 vs 20.2 ms - refreshes run on several threads: **4,213 vs 7,947** of ~9-10k flushes. Main spreads about half as many across the helpers. - copying back: 17-19 vs 6.7 ms, as in our earlier wave runs. - Main's process also sits at ~41 GB private / 71 GB committed. 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 commented 2026-12-01 09:40:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-12-01T09:40:04Z.


@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:

  • copying back is 2.5-3x yours (17-19 vs 6.7 ms) while draws are only 10-20 % higher;
  • main sits at ~41 GB private / 71 GB committed. If that PC has 32 GB, the frames over 100 ms may be hard page faults: Resource Monitor's hard faults/s, or the free RAM the 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 between e1f2eb6 and 7d93ee07) 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7307030845 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7307030845). Originally posted by [dyshay](https://github.com/dyshay) on 2026-12-01T09:40:04Z. --- @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: - copying back is 2.5-3x yours (17-19 vs 6.7 ms) while draws are only 10-20 % higher; - main sits at ~41 GB private / 71 GB committed. If that PC has 32 GB, the frames over 100 ms may be hard page faults: Resource Monitor's hard faults/s, or the `free RAM` the 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 between `e1f2eb6` and `7d93ee07`) 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 commented 2026-12-01 09:51:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by m335671 on 2026-12-01T09:51:12Z.


@meonline42 @dyshay Two counters from the same runs as my comment above (7900, scene A, 829188e vs main e1251c31, 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).

run copying back (relay "landing in all") refreshes flushes on several threads
829188e r1 16.7 ms 12.9 ms 5,240 of 10,575 (50 %)
main r1 11.3 ms 11.4 ms 5,230 of 10,626 (49 %)
main r2 9.6 ms 8.1 ms 5,350 of 10,631 (50 %)
829188e r2 16.1 ms 12.0 ms 5,159 of 10,479 (49 %)
  • Here main's copy-back went down (about 10 vs 16 ms), and the helper share stayed at ~50 % on both builds. That's the opposite of what the 5900X shows (17-19 ms copy-back on main, the helper share halved).
  • This PC peaked at 33.2-33.6 GB committed on main with 31 GB of RAM and stayed out of trouble, in a lighter scene (~4,100 draws against your ~7,000-8,000).

So 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7307300638 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7307300638). Originally posted by [m335671](https://github.com/m335671) on 2026-12-01T09:51:12Z. --- @meonline42 @dyshay Two counters from the same runs as my comment above (7900, scene A, `829188e` vs main `e1251c31`, 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). | run | copying back (relay "landing in all") | refreshes | flushes on several threads | |---|---:|---:|---:| | `829188e` r1 | 16.7 ms | 12.9 ms | 5,240 of 10,575 (50 %) | | main r1 | 11.3 ms | 11.4 ms | 5,230 of 10,626 (49 %) | | main r2 | 9.6 ms | 8.1 ms | 5,350 of 10,631 (50 %) | | `829188e` r2 | 16.1 ms | 12.0 ms | 5,159 of 10,479 (49 %) | - Here main's copy-back went **down** (about 10 vs 16 ms), and the helper share stayed at ~50 % on both builds. That's the opposite of what the 5900X shows (17-19 ms copy-back on main, the helper share halved). - This PC peaked at 33.2-33.6 GB committed on main with 31 GB of RAM and stayed out of trouble, in a lighter scene (~4,100 draws against your ~7,000-8,000). So 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 commented 2026-12-01 10:14:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Damix49 on 2026-12-01T10:14:41Z.


@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, no VICTORY_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 logged Win32_PerfFormattedData_PerfOS_Memory once 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) e1f2eb6
fps (median of 5 s windows) 13 15.6
frame ms (median) 76.8 64.0
preparing ms (median) 44.2 48.5
copying back ms (median) 17.0 12.5
GPU wait ms (median) 0.0 0.3
draws (median) 5,742 5,406
process private (max) 39.7 GB 25.0 GB
system committed (max) 64.5 GB 49.5 GB
RAM available (min) 124 MB 2,175 MB
pages read from disk/s (median / mean / max) 1,925 / 2,683 / 41,574 467 / 783 / 11,058
  • The submitting thread prepares no more on main (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).
  • On main the 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).
  • In the one 5 s window on main over 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7307889189 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7307889189). Originally posted by [Damix49](https://github.com/Damix49) on 2026-12-01T10:14:41Z. --- @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, no `VICTORY_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 logged `Win32_PerfFormattedData_PerfOS_Memory` once 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`) | `e1f2eb6` | |---|---:|---:| | fps (median of 5 s windows) | 13 | 15.6 | | frame ms (median) | 76.8 | 64.0 | | preparing ms (median) | 44.2 | 48.5 | | copying back ms (median) | **17.0** | **12.5** | | GPU wait ms (median) | 0.0 | 0.3 | | draws (median) | 5,742 | 5,406 | | process private (max) | **39.7 GB** | **25.0 GB** | | system committed (max) | 64.5 GB | 49.5 GB | | RAM available (min) | **124 MB** | 2,175 MB | | pages read from disk/s (median / mean / max) | **1,925 / 2,683 / 41,574** | 467 / 783 / 11,058 | - The submitting thread prepares no more on `main` (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). - On `main` the 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). - In the one 5 s window on `main` over 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 commented 2026-12-01 10:39:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-12-01T10:39:02Z.


@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 e1f2eb6 and 5fabb46e names the commit range.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7308504672 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7308504672). Originally posted by [dyshay](https://github.com/dyshay) on 2026-12-01T10:39:02Z. --- @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 `e1f2eb6` and `5fabb46e` names the commit range.
davemathews12 commented 2026-12-01 12:39:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-12-01T12:39:28Z.


@Damix49 @meonline42 @dyshay: the extra ~15 GB on main may be #4127's leak. e1f2eb6 and 829188e are before 97593f46 (#2469); 5fabb46e and 7d93ee07 contain 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 (#4630). If your main play log has "D3D12 returned E_OUTOFMEMORY", could you run #4694's branch (davemathews12:fix/driver-oom-retry-backoff) on the same route? It stopped the growth for nick0451 and YounesAH15.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7311456845 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7311456845). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-12-01T12:39:28Z. --- @Damix49 @meonline42 @dyshay: the extra ~15 GB on main may be #4127's leak. e1f2eb6 and 829188e are before 97593f46 (#2469); 5fabb46e and 7d93ee07 contain 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 (#4630). If your main play log has "D3D12 returned E_OUTOFMEMORY", could you run #4694's branch (davemathews12:fix/driver-oom-retry-backoff) on the same route? It stopped the growth for nick0451 and YounesAH15.
meonline42 commented 2026-12-01 12:53:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-12-01T12:53:46Z.


@davemathews12 Yes, that fits our runs. From the same main 7d93ee07 logs as in my comment above (RTX 3090, driver 610.88, 64 GB):

  • Each main run has host pipeline not made: D3D12 returned E_OUTOFMEMORY for compute 098fc28e44347a00 (10 such lines per run).

  • The process's private memory climbs steadily through each run:

    • r1: 11,579 → 42,393 MB over 57 procmem samples (about 6 minutes)
    • r2: 11,679 → 41,536 MB over 60 samples

    That is roughly 5 GB/min, more than nick0451's figure.

  • Our own build (e1f2eb6 merge, 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 #4694'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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7311804762 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7311804762). Originally posted by [meonline42](https://github.com/meonline42) on 2026-12-01T12:53:46Z. --- @davemathews12 Yes, that fits our runs. From the same main `7d93ee07` logs as in my comment above (RTX 3090, driver 610.88, 64 GB): - Each main run has `host pipeline not made: D3D12 returned E_OUTOFMEMORY` for `compute 098fc28e44347a00` (10 such lines per run). - The process's private memory climbs steadily through each run: - r1: 11,579 → 42,393 MB over 57 `procmem` samples (about 6 minutes) - r2: 11,679 → 41,536 MB over 60 samples That is roughly 5 GB/min, more than nick0451's figure. - Our own build (`e1f2eb6` merge, 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 #4694'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 commented 2026-12-01 12:55:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Damix49 on 2026-12-01T12:55:49Z.


@davemathews12 Yes, the same here: the main run from my paging comment above (5fabb46e, RTX 3070 Ti, driver 617.42, 32 GB).

  • 11× host pipeline not made: D3D12 returned E_OUTOFMEMORY; it is tried again 1000 ms later, for compute 098fc28e44347a00 (the same one @meonline42 sees) and compute b3e7781d53ff8326.
  • Private memory from the procmem lines: 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: no E_OUTOFMEMORY line, ~25 GB private at the end.
  • Also on this PC, foxhound (297f58a), three runs: no E_OUTOFMEMORY line, ~19-20 GB private.

I can run #4694's branch on the same route with the same once-a-second memory sampler and post the numbers.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7311854096 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7311854096). Originally posted by [Damix49](https://github.com/Damix49) on 2026-12-01T12:55:49Z. --- @davemathews12 Yes, the same here: the `main` run from my paging comment above (`5fabb46e`, RTX 3070 Ti, driver 617.42, 32 GB). - 11× `host pipeline not made: D3D12 returned E_OUTOFMEMORY; it is tried again 1000 ms later`, for `compute 098fc28e44347a00` (the same one @meonline42 sees) and `compute b3e7781d53ff8326`. - Private memory from the `procmem` lines: **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: no `E_OUTOFMEMORY` line, ~25 GB private at the end. - Also on this PC, foxhound (`297f58a`), three runs: no `E_OUTOFMEMORY` line, ~19-20 GB private. I can run #4694's branch on the same route with the same once-a-second memory sampler and post the numbers.
davemathews12 commented 2026-12-01 12:59:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-12-01T12:59:38Z.


@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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7311946182 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7311946182). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-12-01T12:59:38Z. --- @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 commented 2026-12-01 13:17:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Damix49 on 2026-12-01T13:17:21Z.


@davemathews12 #4694 on the 32 GB 5900X: the growth stops.

Branch pr-4694 = main 5fabb46e + #4694's head (38c4a9e5), merged with no conflicts, so the base is the same as my main run 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.

main 5fabb46e main + #4694
E_OUTOFMEMORY lines 11 9
"not tried again this run" (gave up after 6) 0 3 (b3e7781d53ff8326, f7c4f227a2a4c4b2, one more)
time in game 6.8 min 9.5 min
private bytes, in game (procmem) 24.4 → 39.4 GB 23.5 → 26.2 GB
growth in game ~2.2 GB/min ~0.29 GB/min
page-ins/s (sampler, median) 1,925 541
copy-back ms (median) 17.0 12.2
  • With #4694 the three refused pipelines are dropped after their sixth refusal, and private bytes stay flat at ~25-26 GB. That's the same level as e1f2eb6 (~25 GB) in my earlier run.
  • One caveat: this run stood in a lighter spot (~2,700 draws against ~5,700), so don't compare its fps (18.8 against 13) with the main run. The memory figures don't depend on that.
  • RAM still dipped to ~130 MB free once during the run, so 32 GB stays tight, but it no longer drifts.
  • What #4694 does not fix: the white/flat surfaces I reported in #4079 and #1944 are still there. Textures waiting (median of the texture line): main ~21,000, main + #4694 ~15,100, e1f2eb6 ~5,700 in the same profile. So the texture queue staying full is a separate problem from the leak.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7312387741 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7312387741). Originally posted by [Damix49](https://github.com/Damix49) on 2026-12-01T13:17:21Z. --- @davemathews12 #4694 on the 32 GB 5900X: **the growth stops.** Branch `pr-4694` = `main` `5fabb46e` + #4694's head (`38c4a9e5`), merged with no conflicts, so the base is the same as my `main` run 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. | | `main` `5fabb46e` | `main` + #4694 | |---|---:|---:| | `E_OUTOFMEMORY` lines | 11 | 9 | | "not tried again this run" (gave up after 6) | 0 | **3** (`b3e7781d53ff8326`, `f7c4f227a2a4c4b2`, one more) | | time in game | 6.8 min | 9.5 min | | private bytes, in game (`procmem`) | 24.4 → **39.4 GB** | 23.5 → **26.2 GB** | | growth in game | **~2.2 GB/min** | **~0.29 GB/min** | | page-ins/s (sampler, median) | 1,925 | 541 | | copy-back ms (median) | 17.0 | 12.2 | - With #4694 the three refused pipelines are dropped after their sixth refusal, and private bytes stay flat at ~25-26 GB. That's the same level as `e1f2eb6` (~25 GB) in my earlier run. - One caveat: this run stood in a lighter spot (~2,700 draws against ~5,700), so don't compare its fps (18.8 against 13) with the `main` run. The memory figures don't depend on that. - RAM still dipped to ~130 MB free once during the run, so 32 GB stays tight, but it no longer drifts. - What #4694 does **not** fix: the white/flat surfaces I reported in #4079 and #1944 are still there. Textures waiting (median of the texture line): `main` ~21,000, `main` + #4694 **~15,100**, `e1f2eb6` ~5,700 in the same profile. So the texture queue staying full is a separate problem from the leak.
davemathews12 commented 2026-12-01 14:03:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-12-01T14:03:34Z.


@Damix49 thanks, that's the proof for #4694. On the texture queue (~5,700 waiting on e1f2eb6 vs ~15,100 on main + #4694): four switches that decide texture room are new since e1f2eb6 and on by default. A cheap check, one at a time on the same main + #4694 build, route and sampler:

  • VICTORY_ROOM_REAL=0: my first suspect. Within 256 MiB of the card's budget it says "no room" and new textures wait. Your main log already shows whether it fires: look for "room for textures by what lies free in texture blocks alone" (its times= counts the refusals).
  • VICTORY_SMALL_WHEN_FULL=0
  • VICTORY_SLOT_EVICT_KEPT=0
  • VICTORY_SLOT_EVICT_ASIDE=0

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7313626666 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7313626666). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-12-01T14:03:34Z. --- @Damix49 thanks, that's the proof for #4694. On the texture queue (~5,700 waiting on e1f2eb6 vs ~15,100 on main + #4694): four switches that decide texture room are new since e1f2eb6 and on by default. A cheap check, one at a time on the same main + #4694 build, route and sampler: - VICTORY_ROOM_REAL=0: my first suspect. Within 256 MiB of the card's budget it says "no room" and new textures wait. Your main log already shows whether it fires: look for "room for textures by what lies free in texture blocks alone" (its `times=` counts the refusals). - VICTORY_SMALL_WHEN_FULL=0 - VICTORY_SLOT_EVICT_KEPT=0 - VICTORY_SLOT_EVICT_ASIDE=0 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 commented 2026-12-01 15:08:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Damix49 on 2026-12-01T15:08:36Z.


@davemathews12 VICTORY_ROOM_REAL doesn'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 + #4694, 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 + #4694 build, the same route and profile, with the sampler: a baseline at a fixed spot, then VICTORY_SMALL_WHEN_FULL=0, VICTORY_SLOT_EVICT_KEPT=0 and VICTORY_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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7315415797 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7315415797). Originally posted by [Damix49](https://github.com/Damix49) on 2026-12-01T15:08:36Z. --- @davemathews12 `VICTORY_ROOM_REAL` doesn'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` + #4694, `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` + #4694 build, the same route and profile, with the sampler: a baseline at a fixed spot, then `VICTORY_SMALL_WHEN_FULL=0`, `VICTORY_SLOT_EVICT_KEPT=0` and `VICTORY_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 commented 2026-12-01 15:42:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Damix49 on 2026-12-01T15:42:47Z.


@davemathews12 The four runs, all on main 5fabb46e + #4694, 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:

run textures waiting (median / max) white/flat surfaces black textures fps draws private device removed
baseline 21,207 / 22,176 yes no 14.2 8,948 26.7 → 27.2 GB no
VICTORY_SMALL_WHEN_FULL=0 19,470 / 20,624 yes, same no 12.3 12,012 27.6 → 27.9 GB no
VICTORY_SLOT_EVICT_KEPT=0 22,602 / 24,689 yes yes, whole objects 14.4 7,875 27.1 → 27.5 GB no
VICTORY_SLOT_EVICT_ASIDE=0 22,714 / 23,586 yes yes, same as above 14.7 7,362 26.9 → 27.9 GB no
for reference, e1f2eb6 (earlier run) ~5,700 no no 15.6 5,406 ~25 GB no
  • None of the three brings the queue near e1f2eb6's. SMALL_WHEN_FULL=0 is ~8% lower, which looks the same on screen. SLOT_EVICT_KEPT=0 and SLOT_EVICT_ASIDE=0 make it worse: more waiting, and whole objects turn black. So those two help rather than cause it.
  • VICTORY_ROOM_REAL never fires here (see above), so none of the four new switches explains the difference.
  • Caveat: the scene wasn't identical across runs (7,400-12,000 draws), so treat a ±10% difference in the waiting count as noise. The black textures in runs 3 and 4 were plain to see.
  • #4694 held in all four: private bytes flat at ~27 GB, 8 E_OUTOFMEMORY lines each, no growth.

So the texture-queue gap between e1f2eb6 and main is somewhere else.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7316379579 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7316379579). Originally posted by [Damix49](https://github.com/Damix49) on 2026-12-01T15:42:47Z. --- @davemathews12 The four runs, all on `main` `5fabb46e` + #4694, 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: | run | textures waiting (median / max) | white/flat surfaces | black textures | fps | draws | private | device removed | |---|---:|---|---|---:|---:|---|---| | baseline | 21,207 / 22,176 | yes | no | 14.2 | 8,948 | 26.7 → 27.2 GB | no | | `VICTORY_SMALL_WHEN_FULL=0` | 19,470 / 20,624 | yes, same | no | 12.3 | 12,012 | 27.6 → 27.9 GB | no | | `VICTORY_SLOT_EVICT_KEPT=0` | 22,602 / 24,689 | yes | **yes**, whole objects | 14.4 | 7,875 | 27.1 → 27.5 GB | no | | `VICTORY_SLOT_EVICT_ASIDE=0` | 22,714 / 23,586 | yes | **yes**, same as above | 14.7 | 7,362 | 26.9 → 27.9 GB | no | | for reference, `e1f2eb6` (earlier run) | ~5,700 | no | no | 15.6 | 5,406 | ~25 GB | no | - None of the three brings the queue near `e1f2eb6`'s. `SMALL_WHEN_FULL=0` is ~8% lower, which looks the same on screen. `SLOT_EVICT_KEPT=0` and `SLOT_EVICT_ASIDE=0` make it worse: more waiting, and whole objects turn black. So those two help rather than cause it. - `VICTORY_ROOM_REAL` never fires here (see above), so none of the four new switches explains the difference. - Caveat: the scene wasn't identical across runs (7,400-12,000 draws), so treat a ±10% difference in the waiting count as noise. The black textures in runs 3 and 4 were plain to see. - #4694 held in all four: private bytes flat at ~27 GB, 8 `E_OUTOFMEMORY` lines each, no growth. So the texture-queue gap between `e1f2eb6` and `main` is somewhere else.
davemathews12 commented 2026-12-01 16:42:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-12-01T16:42:31Z.


@Damix49 thanks, that clears all four (and SLOT_EVICT_KEPT/ASIDE clearly help, so they stay). The texture line's text is identical in e1f2eb6 and 5fabb46e, 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.

git bisect start --first-parent 5fabb46e e1f2eb6

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7318077259 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7318077259). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-12-01T16:42:31Z. --- @Damix49 thanks, that clears all four (and SLOT_EVICT_KEPT/ASIDE clearly help, so they stay). The texture line's text is identical in e1f2eb6 and 5fabb46e, 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. git bisect start --first-parent 5fabb46e e1f2eb6 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 commented 2026-12-01 16:49:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Damix49 on 2026-12-01T16:49:44Z.


@davemathews12 Thanks. Nine full runs are a lot for me right now, so yes please: pick out the texture and descriptor commits in e1f2eb6..5fabb46e and I'll test those first, one build each, in your order.

How I'll run each one, so the calls are comparable:

  • the same PC and profile as before (5900X, RTX 3070 Ti, 32 GB, Series X 1080p to 1440p, DLSS Performance, no frame generation, no VRAM cap), with the same once-a-second sampler;
  • a fixed spot with the camera still, judged in the first 3-4 minutes as you suggest, so the #2469 leak can't fill RAM first;
  • for each: good/bad on white/flat surfaces, the median of textures waiting, fps, draws, and private memory.

If one of them flips it, a short bisect around it should finish the job.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7318302624 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7318302624). Originally posted by [Damix49](https://github.com/Damix49) on 2026-12-01T16:49:44Z. --- @davemathews12 Thanks. Nine full runs are a lot for me right now, so yes please: pick out the texture and descriptor commits in `e1f2eb6..5fabb46e` and I'll test those first, one build each, in your order. How I'll run each one, so the calls are comparable: - the same PC and profile as before (5900X, RTX 3070 Ti, 32 GB, Series X 1080p to 1440p, DLSS Performance, no frame generation, no VRAM cap), with the same once-a-second sampler; - a fixed spot with the camera still, judged in the first 3-4 minutes as you suggest, so the #2469 leak can't fill RAM first; - for each: good/bad on white/flat surfaces, the median of textures waiting, fps, draws, and private memory. If one of them flips it, a short bisect around it should finish the job.
davemathews12 commented 2026-12-01 17:02:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-12-01T17:02:26Z.


@Damix49 here's the order, cheapest first.

  1. No run: in your baseline main + #4694 log, find "slots that showed a texture and were written with another, since the start: ...". At its end, "moved ones checked: N with the same bytes kept, M with other bytes shown neutral (VICTORY_KEEP_SHOWN=checked)": a large M is my lead.
  2. One run, same build: VICTORY_KEEP_SHOWN=1. #2102 (8c5000ac) made "checked" the default: a slot written with a same-size texture whose bytes differ shows the neutral texture until the upload lands, where e1f2eb6 kept 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.
  3. If 1 changes nothing, builds at these first-parent commits in order, the first bad one bounds it, then a short bisect inside:
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7318653031 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7318653031). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-12-01T17:02:26Z. --- @Damix49 here's the order, cheapest first. 0. No run: in your baseline main + #4694 log, find "slots that showed a texture and were written with another, since the start: ...". At its end, "moved ones checked: N with the same bytes kept, M with other bytes shown neutral (VICTORY_KEEP_SHOWN=checked)": a large M is my lead. 1. One run, same build: VICTORY_KEEP_SHOWN=1. #2102 (8c5000ac) made "checked" the default: a slot written with a same-size texture whose bytes differ shows the neutral texture until the upload lands, where e1f2eb6 kept 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. 2. If 1 changes nothing, builds at these first-parent commits in order, the first bad one bounds it, then a short bisect inside: - 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 commented 2026-12-01 17:23:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-12-01T17:23:39Z.


@davemathews12 A data point for step 0 from our main 7d93ee07 run (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=1 yet.

Claude Code on behalf of the machine's owner

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7319227915 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7319227915). Originally posted by [meonline42](https://github.com/meonline42) on 2026-12-01T17:23:39Z. --- @davemathews12 A data point for step 0 from our main `7d93ee07` run (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=1` yet. Claude Code on behalf of the machine's owner
Damix49 commented 2026-12-01 17:46:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Damix49 on 2026-12-01T17:46:42Z.


@davemathews12 Steps 0 and 1 on the same main 5fabb46e + #4694 build, PC and profile as before.

Step 0 (logs only): M is large here too.

run kept (same bytes) shown neutral (other bytes)
main + #4694, baseline of the four runs 3,633 9,212
main + #4694, the leak-check run 1,475 15,043
main, morning run 11,679 6,195
e1f2eb6 0 0 (no such check there)

Step 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 at d7c2d8a7, 8c5000ac, f689cb23, ed8bb2e0 and 49af026c, in order, judged in the first 3-4 minutes.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7319834537 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7319834537). Originally posted by [Damix49](https://github.com/Damix49) on 2026-12-01T17:46:42Z. --- @davemathews12 Steps 0 and 1 on the same `main` `5fabb46e` + #4694 build, PC and profile as before. **Step 0 (logs only):** M is large here too. | run | kept (same bytes) | shown neutral (other bytes) | |---|---:|---:| | `main` + #4694, baseline of the four runs | 3,633 | **9,212** | | `main` + #4694, the leak-check run | 1,475 | **15,043** | | `main`, morning run | 11,679 | 6,195 | | `e1f2eb6` | 0 | 0 (no such check there) | **Step 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 at d7c2d8a7, 8c5000ac, f689cb23, ed8bb2e0 and 49af026c, in order, judged in the first 3-4 minutes.
davemathews12 commented 2026-12-01 18:02:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-12-01T18:02:01Z.


@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: test 49af026c (252) next, then ed8bb2e0 (200). If it's bad, the cause is earlier: test 8c5000ac (73) next, then d7c2d8a7 (36). Two or three builds then bound it, and a short git bisect --first-parent between the last good and first bad finishes it.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7320287987 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2415#issuecomment-7320287987). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-12-01T18:02:01Z. --- @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: test 49af026c (252) next, then ed8bb2e0 (200). If it's bad, the cause is earlier: test 8c5000ac (73) next, then d7c2d8a7 (36). Two or three builds then bound it, and a short git bisect --first-parent between the last good and first bad finishes it.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA#2415
No description provided.