[RFC] Architectural roadmap to 2 frames in flight + benchmarked GPU-Side Dirty Bitmap (slot 251) & low-risk RAM/VRAM trims #756

Closed
opened 2026-11-28 05:05:06 +00:00 by shiman1901 · 28 comments
shiman1901 commented 2026-11-28 05:05:06 +00:00 (Migrated from github.com)
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T05:05:06Z.


Hi! Did a deep read-only audit of commit 8fc22547 focused on two goals: (1) cutting host RAM/VRAM pressure on 12 GB GPUs / 16–32 GB systems, and (2) unblocking true end-to-end 2 frames in flight (docs/findings.md:170-177).

Full disclosure upfront: we do not have game assets to run live captures, so all performance numbers below are either cited directly from the repo's own logs or measured on a standalone D3D12 repro benchmark on an RTX 3060 12 GB (Win11 26300, driver 621.35) modeling the exact 174 MiB (0xAE00000) / 11-dispatch scenario from docs/findings.md and shadow.rs:147.

Posting this as a concise technical map + standalone benchmark in case any of these pieces help prioritize upcoming PRs.


1. Three quick, zero-render-risk memory wins (especially for 12 GB VRAM / 16–32 GB RAM)

  1. Auto-trim idle host lists under commit pressure (list.rs:303-341, host.rs:436-464, 1459-1500):
    • docs/findings.md:95 notes host-list command allocators hold up to ~9 GB private memory after loading spikes (IDLE_MOST = 512, 2 allocators each).
    • allocator_trim and idle_trim already exist, just gated behind env vars. Triggering a trim down to e.g. IDLE_TIGHT = 64 inside Host::sweep() when residency::pressured() || residency::critical_commit() should drop post-load commit peaks by ~0.5–2.5 GB with zero rendering risk (list recreation is already measured at ~0.2 ms in list.rs:297-299).
  2. Scale pool.rs SPARE_KEPT with VRAM budget (pool.rs:30-77):
    • SPARE_KEPT = 64 × 64 MiB holds up to 4 GiB of empty VRAM as a constant until usage crosses 85%. On 8–12 GB GPUs that's 33–50% of local VRAM tied up in empty chunks, causing oscillation between 4 GiB and 128 MiB around the 85% threshold. Capping it as a fraction of DXGI budget (e.g. budget / 32, clamped [2, 64]) fixes this cleanly.
  3. Pool read_back_buffer for texback.rs (host.rs:9513-9550, texback.rs:144-198):
    • Currently allocates a fresh CreateCommittedResource (~310 µs/alloc per pool.rs:5-7) on every readback. A small power-of-two reuse pool (mirroring send.rs::SPARE) removes that hot-path allocation overhead.

2. Standalone RTX 3060 benchmark: GPU-Side Dirty Bitmap (shadow.rs:3444)

shadow.rs:3444-3446 explicitly notes a GPU-side dirty mask as an unimplemented shortcut. Checking the shader compiler, everything needed to emit it is already in place:

  • Free root UAV slot: SLOT_DIRTY = 251 (victory-shader/src/emit/shader.rs:26-73, where 252–255 are taken; add to ours in victory-pipeline/src/host.rs:523-529, guard against the 64 root-param limit).
  • Store instrumentation points: emit/lower.rs:12797-12882 (buffer stores), :3710-3724 (global stores), :12713-12739 (narrow), :12767-12795 (atomics). atomicBinOp.i32 (opcode 78, op 2 = Or) is already emitted at lower.rs:3766-3773.
  • Map size: 1 bit per 64 KiB page → 348 bytes (4 KiB alloc) for the 174 MiB heap (vs 174 MiB CPU before snapshot, or 44.6 KB hash + 11.1 KB differs in CARD_COMPARE).
  • Safety: clamp word with an overflow bit (overflow → mark copy all-dirty), use a small per-flight pool (e.g. 8 × 4 KiB) or 32-bit page generation for LATE_WAIT, and fall back to existing before/CARD_COMPARE for multi-copy draws or image stores.

Measured results on RTX 3060 12 GB (174 MiB UAV, 11 compute dispatches, medians of 21 warm runs)

Tested 3 paths honestly — including the actual default VRAM CARD_COMPARE hash path (host.rs:2461-2541), not just the worst-case CPU before path:

  • A (before + readback + 8-thread AVX2 diff) — fallback when a copy doesn't fit in VRAM (card_room_for refusal / VICTORY_CARD_BUFFERS=0 / small copies).
  • C (CARD_COMPARE GPU hash) — current default for carded 174 MiB copies.
  • D (GPU Dirty Bitmap) — worst-case SM 5.0 per-thread InterlockedOr (no WaveActiveBitOr coalescing yet; SM 6.6 DXIL with WaveActiveBitOr will be equal or faster) + 4 KiB map readback + targeted page fetch + AVX2 merge.
Path Scenario GPU (ms) wait1 (ms) wait2 / fetch (ms) CPU work (ms) Snapshot (ms) Total (ms)
A (before + AVX2) sparse (16 pages / 1 MiB) 0.004 17.520 — 8.532 8.417 34.871
A (before + AVX2) dense (256 pages / 16 MiB) 0.004 17.116 — 8.214 7.984 33.571
C (CARD_COMPARE default) sparse (16 pages) 0.487 0.561 0.139 0.037 — 0.774
C (CARD_COMPARE default) dense (256 pages) 0.501 0.604 1.356 1.016 — 3.241
D (GPU Dirty Bitmap) sparse (16 pages) 0.005 0.070 0.136 0.036 — 0.272
D (GPU Dirty Bitmap) dense (256 pages) 0.005 0.097 1.339 0.727 — 2.308
  • Accuracy validation: 48 full validation rounds (133,632 page decisions, 254,592 dword checks) — 0 misses, 0 false positives, 0 data errors.
  • Realistic scope: On carded copies (C), D saves ~0.5–0.9 ms and 55 KB VRAM; on non-carded copies (A, common on 12 GB cards), it drops ~34 ms → 0.27–2.31 ms and eliminates the 174 MiB snapshot (snapshot pool up to 512 MiB). Crucially, it does not eliminate waiting on an in-flight dispatch (the bitmap is only known after execution), but it unblocks multi-flight / 2-frames-in-flight without duplicating 174 MiB CPU Shadow::before snapshots (which are currently single-per-copy at shadow.rs:60-64) and narrows line.written / copied_read post-landing.

3. What actually blocks true "2 Frames In Flight" end-to-end

Tracing queue/behind.rs, host.rs, fence.rs, and draw.rs, most of the async machinery is already built and active via scripts/play-foxhound.ps1 (THIN=1, RELAY=2, CARD_STEPS=2, late_stage() == 3, non-blocking title fences via late_signal). The remaining concrete blockers appear to be:

  1. Present window & swapchain depth (the main choke point):
    • frames_most() defaults to 1 (queue/behind.rs:733-739, VICTORY_SUBMIT_FRAMES isn't set in play-foxhound.ps1), and BUFFERS = 2 (host.rs:9620).
    • Moving to VICTORY_SUBMIT_FRAMES=2 + BUFFERS = 3 also requires handling HostTexture.state (currently a single AtomicU32 at resource.rs:2897-2904, which can race if two presents/frames touch the same source texture).
  2. Intra-frame settles & card_steps refusals (biggest single CPU-wait win):
    • The 226–326 ms settle on 12 GB configs (findings.md:125-131, 32 B upload fill colliding with the declared 174 MiB heap) can't be solved by dirty bitmaps alone while the skinning dispatches are still in flight — card_steps is supposed to run that fill on the GPU behind the flight, so checking why it refuses via card_steps::REFUSALS (card_steps.rs:1012-1043) looks like the fastest single win.
    • Secondary intra-frame settles to eliminate before 2-frame overlap: dynamic descriptor fallback settle_for_fence() (draw.rs:2240,2314,4627), synchronous decoration bake execute_sync_internal (host.rs:5662) + texture/ahead.rs:155 drain(), and synchronous CopyPageMappingsBatchX (queue.rs:1193-1251).
  3. Per-flight CPU Shadow::before (shadow.rs:60-64):
    • Carded paths already have per-flight CardPlan, but non-carded CPU Shadow::before is one Mutex<Option<Vec<u8>>> per copy. Replacing it with a per-flight DirtyMap pool (Section 2) prevents 2×–3× RAM blowup and cross-flight contamination when two frames overlap.

Suggested order of attack

  1. Measure baseline first (0 code): capture logs with VICTORY_SUBMIT_FRAMES=2, VICTORY_SUBMIT_DEPTH=128, VICTORY_LATE_WAIT_LISTS=512, VICTORY_BURY_LAG=8 and inspect card_steps::REFUSALS, at presents, and DynamicRefused.
  2. Stage 1: fix the top card_steps refusal on the 174 MiB fill + eliminate intra-frame settles (dynamic slots / async bake) + land the 3 quick memory trims.
  3. Stage 2: implement SLOT_DIRTY = 251 GPU Dirty Bitmap with a VICTORY_DIRTY_CHECK=1 parallel validation switch.
  4. Stage 3: BUFFERS = 3, frames_most = 2, per-flight HostTexture state/copy handling → based on the timelines in docs/findings.md, this should move RTX 5080 from ~28.4 ms (~35 FPS) toward ~20–22 ms (~45–50 rendered FPS) and reclaim substantial CPU idle/memory headroom on 12 GB cards.

Happy to share the standalone D3D12 C++ benchmark source (bench.cpp) or help draft clean unit-tested PRs for the memory trims / SLOT_DIRTY scaffolding if any of this aligns with your current branch priorities!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:6659484583 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-28T05:05:06Z. --- Hi! Did a deep read-only audit of commit `8fc22547` focused on two goals: (1) cutting host RAM/VRAM pressure on 12 GB GPUs / 16–32 GB systems, and (2) unblocking true end-to-end 2 frames in flight (`docs/findings.md:170-177`). Full disclosure upfront: we do **not** have game assets to run live captures, so all performance numbers below are either cited directly from the repo's own logs or measured on a standalone D3D12 repro benchmark on an RTX 3060 12 GB (Win11 26300, driver 621.35) modeling the exact 174 MiB (`0xAE00000`) / 11-dispatch scenario from `docs/findings.md` and `shadow.rs:147`. Posting this as a concise technical map + standalone benchmark in case any of these pieces help prioritize upcoming PRs. --- ### 1. Three quick, zero-render-risk memory wins (especially for 12 GB VRAM / 16–32 GB RAM) 1. **Auto-trim idle host lists under commit pressure (`list.rs:303-341`, `host.rs:436-464`, `1459-1500`):** - `docs/findings.md:95` notes host-list command allocators hold up to ~9 GB private memory after loading spikes (`IDLE_MOST = 512`, 2 allocators each). - `allocator_trim` and `idle_trim` already exist, just gated behind env vars. Triggering a trim down to e.g. `IDLE_TIGHT = 64` inside `Host::sweep()` when `residency::pressured() || residency::critical_commit()` should drop post-load commit peaks by ~0.5–2.5 GB with zero rendering risk (list recreation is already measured at ~0.2 ms in `list.rs:297-299`). 2. **Scale `pool.rs` `SPARE_KEPT` with VRAM budget (`pool.rs:30-77`):** - `SPARE_KEPT = 64` × 64 MiB holds up to **4 GiB of empty VRAM** as a constant until usage crosses 85%. On 8–12 GB GPUs that's 33–50% of local VRAM tied up in empty chunks, causing oscillation between 4 GiB and 128 MiB around the 85% threshold. Capping it as a fraction of DXGI budget (e.g. `budget / 32`, clamped `[2, 64]`) fixes this cleanly. 3. **Pool `read_back_buffer` for `texback.rs` (`host.rs:9513-9550`, `texback.rs:144-198`):** - Currently allocates a fresh `CreateCommittedResource` (~310 µs/alloc per `pool.rs:5-7`) on every readback. A small power-of-two reuse pool (mirroring `send.rs::SPARE`) removes that hot-path allocation overhead. --- ### 2. Standalone RTX 3060 benchmark: GPU-Side Dirty Bitmap (`shadow.rs:3444`) `shadow.rs:3444-3446` explicitly notes a GPU-side dirty mask as an unimplemented shortcut. Checking the shader compiler, **everything needed to emit it is already in place**: - **Free root UAV slot:** `SLOT_DIRTY = 251` (`victory-shader/src/emit/shader.rs:26-73`, where 252–255 are taken; add to `ours` in `victory-pipeline/src/host.rs:523-529`, guard against the 64 root-param limit). - **Store instrumentation points:** `emit/lower.rs:12797-12882` (buffer stores), `:3710-3724` (global stores), `:12713-12739` (narrow), `:12767-12795` (atomics). `atomicBinOp.i32` (opcode 78, op `2` = Or) is already emitted at `lower.rs:3766-3773`. - **Map size:** 1 bit per 64 KiB page → **348 bytes** (4 KiB alloc) for the 174 MiB heap (vs 174 MiB CPU `before` snapshot, or 44.6 KB hash + 11.1 KB differs in `CARD_COMPARE`). - **Safety:** clamp `word` with an overflow bit (overflow → mark copy all-dirty), use a small per-flight pool (e.g. 8 × 4 KiB) or 32-bit page generation for `LATE_WAIT`, and fall back to existing `before`/`CARD_COMPARE` for multi-copy draws or image stores. #### Measured results on RTX 3060 12 GB (174 MiB UAV, 11 compute dispatches, medians of 21 warm runs) Tested **3 paths** honestly — including the actual default VRAM `CARD_COMPARE` hash path (`host.rs:2461-2541`), not just the worst-case CPU `before` path: - **A (`before` + readback + 8-thread AVX2 diff)** — fallback when a copy doesn't fit in VRAM (`card_room_for` refusal / `VICTORY_CARD_BUFFERS=0` / small copies). - **C (`CARD_COMPARE` GPU hash)** — current default for carded 174 MiB copies. - **D (`GPU Dirty Bitmap`)** — worst-case SM 5.0 per-thread `InterlockedOr` (no `WaveActiveBitOr` coalescing yet; SM 6.6 DXIL with `WaveActiveBitOr` will be equal or faster) + 4 KiB map readback + targeted page fetch + AVX2 merge. | Path | Scenario | GPU (ms) | wait1 (ms) | wait2 / fetch (ms) | CPU work (ms) | Snapshot (ms) | **Total (ms)** | | :--- | :--- | ---: | ---: | ---: | ---: | ---: | ---: | | **A (`before` + AVX2)** | sparse (16 pages / 1 MiB) | 0.004 | 17.520 | — | 8.532 | 8.417 | **34.871** | | **A (`before` + AVX2)** | dense (256 pages / 16 MiB) | 0.004 | 17.116 | — | 8.214 | 7.984 | **33.571** | | **C (`CARD_COMPARE` default)** | sparse (16 pages) | 0.487 | 0.561 | 0.139 | 0.037 | — | **0.774** | | **C (`CARD_COMPARE` default)** | dense (256 pages) | 0.501 | 0.604 | 1.356 | 1.016 | — | **3.241** | | **D (`GPU Dirty Bitmap`)** | sparse (16 pages) | 0.005 | 0.070 | 0.136 | 0.036 | — | **0.272** | | **D (`GPU Dirty Bitmap`)** | dense (256 pages) | 0.005 | 0.097 | 1.339 | 0.727 | — | **2.308** | - **Accuracy validation:** 48 full validation rounds (133,632 page decisions, 254,592 dword checks) — **0 misses, 0 false positives, 0 data errors**. - **Realistic scope:** On carded copies (C), D saves ~0.5–0.9 ms and 55 KB VRAM; on non-carded copies (A, common on 12 GB cards), it drops **~34 ms → 0.27–2.31 ms** and eliminates the 174 MiB snapshot (snapshot pool up to 512 MiB). Crucially, it **does not** eliminate waiting on an in-flight dispatch (the bitmap is only known after execution), **but** it unblocks multi-flight / 2-frames-in-flight without duplicating 174 MiB CPU `Shadow::before` snapshots (which are currently single-per-copy at `shadow.rs:60-64`) and narrows `line.written` / `copied_read` post-landing. --- ### 3. What actually blocks true "2 Frames In Flight" end-to-end Tracing `queue/behind.rs`, `host.rs`, `fence.rs`, and `draw.rs`, most of the async machinery is **already built and active** via `scripts/play-foxhound.ps1` (`THIN=1`, `RELAY=2`, `CARD_STEPS=2`, `late_stage() == 3`, non-blocking title fences via `late_signal`). The remaining concrete blockers appear to be: 1. **Present window & swapchain depth (the main choke point):** - `frames_most()` defaults to `1` (`queue/behind.rs:733-739`, `VICTORY_SUBMIT_FRAMES` isn't set in `play-foxhound.ps1`), and `BUFFERS = 2` (`host.rs:9620`). - Moving to `VICTORY_SUBMIT_FRAMES=2` + `BUFFERS = 3` also requires handling `HostTexture.state` (currently a single `AtomicU32` at `resource.rs:2897-2904`, which can race if two presents/frames touch the same source texture). 2. **Intra-frame settles & `card_steps` refusals (biggest single CPU-wait win):** - The 226–326 ms `settle` on 12 GB configs (`findings.md:125-131`, 32 B upload fill colliding with the declared 174 MiB heap) can't be solved by dirty bitmaps alone while the skinning dispatches are still in flight — **`card_steps` is supposed to run that fill on the GPU behind the flight**, so checking why it refuses via `card_steps::REFUSALS` (`card_steps.rs:1012-1043`) looks like the fastest single win. - Secondary intra-frame settles to eliminate before 2-frame overlap: dynamic descriptor fallback `settle_for_fence()` (`draw.rs:2240,2314,4627`), synchronous decoration bake `execute_sync_internal` (`host.rs:5662`) + `texture/ahead.rs:155` `drain()`, and synchronous `CopyPageMappingsBatchX` (`queue.rs:1193-1251`). 3. **Per-flight CPU `Shadow::before` (`shadow.rs:60-64`):** - Carded paths already have per-flight `CardPlan`, but non-carded CPU `Shadow::before` is one `Mutex<Option<Vec<u8>>>` per copy. Replacing it with a per-flight `DirtyMap` pool (Section 2) prevents 2×–3× RAM blowup and cross-flight contamination when two frames overlap. ### Suggested order of attack 1. **Measure baseline first (0 code):** capture logs with `VICTORY_SUBMIT_FRAMES=2`, `VICTORY_SUBMIT_DEPTH=128`, `VICTORY_LATE_WAIT_LISTS=512`, `VICTORY_BURY_LAG=8` and inspect `card_steps::REFUSALS`, `at presents`, and `DynamicRefused`. 2. **Stage 1:** fix the top `card_steps` refusal on the 174 MiB fill + eliminate intra-frame settles (dynamic slots / async bake) + land the 3 quick memory trims. 3. **Stage 2:** implement `SLOT_DIRTY = 251` GPU Dirty Bitmap with a `VICTORY_DIRTY_CHECK=1` parallel validation switch. 4. **Stage 3:** `BUFFERS = 3`, `frames_most = 2`, per-flight `HostTexture` state/copy handling → based on the timelines in `docs/findings.md`, this should move RTX 5080 from ~28.4 ms (~35 FPS) toward ~20–22 ms (~45–50 rendered FPS) and reclaim substantial CPU idle/memory headroom on 12 GB cards. Happy to share the standalone D3D12 C++ benchmark source (`bench.cpp`) or help draft clean unit-tested PRs for the memory trims / `SLOT_DIRTY` scaffolding if any of this aligns with your current branch priorities!
github-actions[bot] commented 2026-11-28 05:05:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by github-actions[bot] on 2026-11-28T05:05:13Z.


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:7234447253 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7234447253). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T05:05:13Z. --- 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)
nick0451 commented 2026-11-28 07:05:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-28T07:05:58Z.


In-game numbers for the late-wait stages, since you have no assets to run.

Setup: release build of main at 63b902f, victory.exe play with its defaults. RTX 3090 24 GB (driver 610.88), i9-14900K, 32 GB, Windows 11. Series S, DLSS Performance, frame generation off. The same save in an interior (about 5,800-6,000 draws a frame). Stages were run alternately, two runs each, and the figures are medians of the last 12 frame lines in the world.

VICTORY_LATE_WAIT fps frame preparing card busy
unset (stage 3: late_stage() falls to 3 when the relay is on, which the launcher sets) 23.8 / 23.1 42.0 / 43.3 ms 23.4 / 23.6 ms ~92%
2 18.2 / 18.7 54.8 / 53.5 ms 33.3 / 34.0 ms ~73%
1 14.9 / 14.6 67.2 / 68.7 ms 30.2 / 31.5 ms ~57%
0 (an earlier session in the same room) 11.1 / 11.4 89.7 / 88.0 ms 34.9 / 34.7 ms ~41%

Notes:

  • As you traced, stage 3 is already what players get. Setting VICTORY_LATE_WAIT=0 explicitly turns late wait off, so A/B runs against =0 measure the wrong baseline. (I made that mistake first; these numbers are against the real default.)
  • With the default, this card is about 92% busy in this room, so here the frame is the card's, not the submitting thread's. In a diagnostics build in a lighter room the card was about 67% busy and the submitting thread was the wall (#699). Whether two frames in flight would gain much on this PC depends on the scene.
  • I also compared screenshots across stages at the same point in each run. A lampshade in the room was drawn in 1 run of 8, with stage 0 and with the default alike, so it is not related to late wait.

If it helps your step 1, I can run your baseline switches (VICTORY_SUBMIT_FRAMES=2, VICTORY_SUBMIT_DEPTH=128, VICTORY_LATE_WAIT_LISTS=512, VICTORY_BURY_LAG=8) here and post the card_steps refusals and the at-presents lines.

Measured with an AI assistant (Claude Code); every number above is from this PC's logs.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7235714653 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7235714653). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-28T07:05:58Z. --- In-game numbers for the late-wait stages, since you have no assets to run. **Setup:** release build of main at `63b902f`, `victory.exe play` with its defaults. RTX 3090 24 GB (driver 610.88), i9-14900K, 32 GB, Windows 11. Series S, DLSS Performance, frame generation off. The same save in an interior (about 5,800-6,000 draws a frame). Stages were run alternately, two runs each, and the figures are medians of the last 12 frame lines in the world. | `VICTORY_LATE_WAIT` | fps | frame | preparing | card busy | |---|---|---|---|---| | unset (stage 3: `late_stage()` falls to 3 when the relay is on, which the launcher sets) | **23.8 / 23.1** | 42.0 / 43.3 ms | 23.4 / 23.6 ms | ~92% | | `2` | 18.2 / 18.7 | 54.8 / 53.5 ms | 33.3 / 34.0 ms | ~73% | | `1` | 14.9 / 14.6 | 67.2 / 68.7 ms | 30.2 / 31.5 ms | ~57% | | `0` (an earlier session in the same room) | 11.1 / 11.4 | 89.7 / 88.0 ms | 34.9 / 34.7 ms | ~41% | Notes: - As you traced, stage 3 is already what players get. Setting `VICTORY_LATE_WAIT=0` explicitly turns late wait off, so A/B runs against `=0` measure the wrong baseline. (I made that mistake first; these numbers are against the real default.) - With the default, this card is about 92% busy in this room, so here the frame is the card's, not the submitting thread's. In a diagnostics build in a lighter room the card was about 67% busy and the submitting thread was the wall (#699). Whether two frames in flight would gain much on this PC depends on the scene. - I also compared screenshots across stages at the same point in each run. A lampshade in the room was drawn in 1 run of 8, with stage 0 and with the default alike, so it is not related to late wait. If it helps your step 1, I can run your baseline switches (`VICTORY_SUBMIT_FRAMES=2`, `VICTORY_SUBMIT_DEPTH=128`, `VICTORY_LATE_WAIT_LISTS=512`, `VICTORY_BURY_LAG=8`) here and post the `card_steps` refusals and the at-presents lines. Measured with an AI assistant (Claude Code); every number above is from this PC's logs.
shiman1901 commented 2026-11-28 13:28:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T13:28:00Z.


@nick0451 Huge thanks for running those A/B numbers — that's super clean data, and great catch on 92% vs 67% GPU busy (#699). You're completely right: in a 92%-busy room, overlapping submissions has at most ~5–8% headroom, whereas the ~67%-busy scene is where the submitting thread is actually the wall.

Yes, running the Step 1 switches would be massively helpful! If you have time for a quick A/B against your real default (ideally in that lighter ~67%-busy scene from #699, or both if convenient):

VICTORY_SUBMIT_FRAMES=2
VICTORY_SUBMIT_DEPTH=128
VICTORY_LATE_WAIT_LISTS=512
VICTORY_BURY_LAG=8

The specific lines from the log that would settle the biggest open questions from our static audit are:

  1. at presents / queue line (submissions prepared ... presents ... in the line ... at presents) + card busy % / frame / preparing — tells us right away whether SUBMIT_FRAMES=2 immediately stalls on the 2-buffer swapchain (BUFFERS = 2) or actually lifts FPS when the card is ~67% busy (and whether you notice any visual flicker/tearing from 2 frames sharing HostTexture.state).
  2. card_steps refusals (steps done on the card ... submissions refused) — shows which refusal reason is actually firing in practice.
  3. DynamicRefused / tables asked, N refused and stood waiting — shows if dynamic slots or intra-frame settles spike when pushing 2 frames ahead.
  4. (Optional, if easy in one diag run) VICTORY_MEMORY_MAP=1 on your 32 GB system — would give a real live baseline for how much commit idle host lists + CARD_COMPARE / non-carded before snapshots actually hold on main @ 63b902f before anyone writes a PR for trim_idle or SLOT_DIRTY.

Really appreciate you testing this live — once we see those lines, we'll know immediately whether Stage 1 (card_steps + intra-frame settles) or Stage 3 (BUFFERS = 3 + per-flight HostTexture.state) is the real bottleneck on current main!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7239954624 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7239954624). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-28T13:28:00Z. --- @nick0451 Huge thanks for running those A/B numbers — that's super clean data, and great catch on `92%` vs `67%` GPU busy (#699). You're completely right: in a 92%-busy room, overlapping submissions has at most ~5–8% headroom, whereas the ~67%-busy scene is where the submitting thread is actually the wall. Yes, running the Step 1 switches would be massively helpful! If you have time for a quick A/B against your real default (ideally in that lighter ~67%-busy scene from #699, or both if convenient): VICTORY_SUBMIT_FRAMES=2 VICTORY_SUBMIT_DEPTH=128 VICTORY_LATE_WAIT_LISTS=512 VICTORY_BURY_LAG=8 The specific lines from the log that would settle the biggest open questions from our static audit are: 1. **`at presents` / queue line** (`submissions prepared ... presents ... in the line ... at presents`) + `card busy %` / `frame` / `preparing` — tells us right away whether `SUBMIT_FRAMES=2` immediately stalls on the 2-buffer swapchain (`BUFFERS = 2`) or actually lifts FPS when the card is ~67% busy (and whether you notice any visual flicker/tearing from 2 frames sharing `HostTexture.state`). 2. **`card_steps` refusals** (`steps done on the card ... submissions refused`) — shows which refusal reason is actually firing in practice. 3. **`DynamicRefused` / `tables asked, N refused`** and **`stood waiting`** — shows if dynamic slots or intra-frame settles spike when pushing 2 frames ahead. 4. *(Optional, if easy in one diag run)* **`VICTORY_MEMORY_MAP=1`** on your 32 GB system — would give a real live baseline for how much commit `idle host lists` + `CARD_COMPARE` / non-carded `before` snapshots actually hold on `main @ 63b902f` before anyone writes a PR for `trim_idle` or `SLOT_DIRTY`. Really appreciate you testing this live — once we see those lines, we'll know immediately whether Stage 1 (`card_steps` + intra-frame settles) or Stage 3 (`BUFFERS = 3` + per-flight `HostTexture.state`) is the real bottleneck on current `main`!
nick0451 commented 2026-11-28 16:27:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-28T16:27:41Z.


Step 1 switches, run here: VICTORY_SUBMIT_FRAMES=2, VICTORY_SUBMIT_DEPTH=128, VICTORY_LATE_WAIT_LISTS=512, VICTORY_BURY_LAG=8.

Caveat first: this is not the lighter scene. My save has moved since #699, and the frozen save I benchmark from is outdoors on a balcony by the water, where the card is about 95% busy. So this answers "does it stall or break", not "does it lift fps where the submitting thread is the wall". I'll add the lighter scene when I have a save there.

Setup: release build of main at 63b902f, victory.exe play, RTX 3090 24 GB, i9-14900K, 32 GB, Windows 11, Series S, DLSS Performance, frame generation off. The same frozen save for every run, standing still. One warm-up start per variant, then default and step 1 in turn, three rounds each. Each run is 40 s to settle, 60 s measured. The figures are medians of each run's lines, then the median of the three runs.

default step 1
fps (runs) 24.1 (23.9, 24.1, 24.4) 24.6 (24.8, 24.2, 24.6)
frame / preparing 41.5 / 25.6 ms 40.7 / 26.8 ms
queue: submissions per frame / in the line when one was added 42.0 / 11.1 42.0 / 10.6
that thread worked 39.5 ms 39.0 ms
title waited for room in the line 0.0 ms 0.0 ms
title waited at presents 6.7 ms 0.0 ms
waits not met at a present 0.00 0.00
card steps: fills per frame 9,409 9,657
card steps: submissions refused and waited 0.12 0.08
card busy / idle behind the submitting thread 95% / 1.9 ms 95% / 1.8 ms
submitting thread stood waiting for the card 3.6 ms 3.4 ms

On your questions:

  1. at presents: the second frame takes the title's 6.7 ms a frame of waiting at presents to zero, and nothing stalls on the swap chain: no waits for room, no unmet waits at a present, the same depth in the line. The fps difference (+2%) is inside the 2-3% noise of this setup (main A/A). With the card at 95%, there is no room for it to show. I saw no flicker or tearing in end-of-run screenshots of all six runs, but a still frame cannot rule out a one-frame flicker.
  2. card_steps refusals: only one reason fires, in both variants: "a copy at its place in a list writes what it reads, or reads or writes what it writes", 0.12 (default) and 0.08 (step 1) per frame. So refusals are rare here, and the 174 MiB fill case from findings.md does not appear in this scene.
  3. DynamicRefused / tables refused / no free dynamic slots: none in any measured window of either variant.
  4. VICTORY_MEMORY_MAP=1 (diagnostics build of 63b902f, one warmed run, default switches), committed / in memory:
    • the title's heaps 3,093 / 1,754 MB; views of the title's pages 3,847 / 2,474 MB;
    • the title's page pool section 3,977 / 0 MB;
    • process heap segments 1,261 / 1,212 MB; windows of title memory and other 4 MiB allocations 3,041 / 2,386 MB;
    • write-combined (buffers shared with the card) 8,630 / 1,545 MB;
    • other private ≥ 1 MB 4,596 / 4,180 MB; files and mappings 5,313 / 3,401 MB; programs 607 / 250 MB.
    • Biggest groups: 65 × 64 MB write-combined (4,158 MB), 94 × 32 MB write-combined (2,664 MB), 3 × 1,024 MB (2,234 MB), 27 × 32 MB (837 MB).
    • Texture blocks 3,712 MB plus 320 MB staging; shader containers 189 MB, translations 129 MB, pipeline library 90 MB.

Raw logs are available if you want other lines.

Measured with an AI assistant (Claude Code); every number above is from this PC's logs.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7242260365 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7242260365). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-28T16:27:41Z. --- Step 1 switches, run here: `VICTORY_SUBMIT_FRAMES=2`, `VICTORY_SUBMIT_DEPTH=128`, `VICTORY_LATE_WAIT_LISTS=512`, `VICTORY_BURY_LAG=8`. **Caveat first:** this is not the lighter scene. My save has moved since #699, and the frozen save I benchmark from is outdoors on a balcony by the water, where the card is about 95% busy. So this answers "does it stall or break", not "does it lift fps where the submitting thread is the wall". I'll add the lighter scene when I have a save there. **Setup:** release build of main at `63b902f`, `victory.exe play`, RTX 3090 24 GB, i9-14900K, 32 GB, Windows 11, Series S, DLSS Performance, frame generation off. The same frozen save for every run, standing still. One warm-up start per variant, then default and step 1 in turn, three rounds each. Each run is 40 s to settle, 60 s measured. The figures are medians of each run's lines, then the median of the three runs. | | default | step 1 | |---|---|---| | fps (runs) | 24.1 (23.9, 24.1, 24.4) | 24.6 (24.8, 24.2, 24.6) | | frame / preparing | 41.5 / 25.6 ms | 40.7 / 26.8 ms | | **queue:** submissions per frame / in the line when one was added | 42.0 / 11.1 | 42.0 / 10.6 | | that thread worked | 39.5 ms | 39.0 ms | | title waited for room in the line | 0.0 ms | 0.0 ms | | **title waited at presents** | **6.7 ms** | **0.0 ms** | | waits not met at a present | 0.00 | 0.00 | | **card steps:** fills per frame | 9,409 | 9,657 | | card steps: submissions refused and waited | 0.12 | 0.08 | | card busy / idle behind the submitting thread | 95% / 1.9 ms | 95% / 1.8 ms | | submitting thread stood waiting for the card | 3.6 ms | 3.4 ms | On your questions: 1. **`at presents`:** the second frame takes the title's 6.7 ms a frame of waiting at presents to zero, and nothing stalls on the swap chain: no waits for room, no unmet waits at a present, the same depth in the line. The fps difference (+2%) is inside the 2-3% noise of this setup (main A/A). With the card at 95%, there is no room for it to show. I saw no flicker or tearing in end-of-run screenshots of all six runs, but a still frame cannot rule out a one-frame flicker. 2. **`card_steps` refusals:** only one reason fires, in both variants: "a copy at its place in a list writes what it reads, or reads or writes what it writes", 0.12 (default) and 0.08 (step 1) per frame. So refusals are rare here, and the 174 MiB fill case from `findings.md` does not appear in this scene. 3. **`DynamicRefused` / tables refused / no free dynamic slots:** none in any measured window of either variant. 4. **`VICTORY_MEMORY_MAP=1`** (diagnostics build of `63b902f`, one warmed run, default switches), committed / in memory: - the title's heaps 3,093 / 1,754 MB; views of the title's pages 3,847 / 2,474 MB; - **the title's page pool section 3,977 / 0 MB**; - process heap segments 1,261 / 1,212 MB; windows of title memory and other 4 MiB allocations 3,041 / 2,386 MB; - **write-combined (buffers shared with the card) 8,630 / 1,545 MB**; - other private ≥ 1 MB 4,596 / 4,180 MB; files and mappings 5,313 / 3,401 MB; programs 607 / 250 MB. - Biggest groups: 65 × 64 MB write-combined (4,158 MB), 94 × 32 MB write-combined (2,664 MB), 3 × 1,024 MB (2,234 MB), 27 × 32 MB (837 MB). - Texture blocks 3,712 MB plus 320 MB staging; shader containers 189 MB, translations 129 MB, pipeline library 90 MB. Raw logs are available if you want other lines. Measured with an AI assistant (Claude Code); every number above is from this PC's logs.
shiman1901 commented 2026-11-28 16:37:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T16:37:13Z.


@nick0451 Massive thanks for running that clean 3-round A/B and pulling VICTORY_MEMORY_MAP=1 — both results are super informative!

Two big takeaways from your numbers:

  1. VICTORY_SUBMIT_FRAMES=2 completely eliminated title waited at presents (6.7 ms -> 0.0 ms) with zero swapchain stalls, zero DynamicRefused, and zero unmet waits even on BUFFERS = 2. Obviously at 95% GPU busy it can't move FPS, so seeing the same switch on a ~65–70%-busy CPU-bound scene (where #699 showed 19.5 ms waiting at presents!) will be the real test — plus watching out for any 1-frame flicker in motion from HostTexture.state.
  2. Huge signal in your VICTORY_MEMORY_MAP=1 dump: write-combined (buffers shared with the card) is holding 8,630 MB committed vs only 1,545 MB resident (65 × 64 MB + 94 × 32 MB = 6.8 GB of commit alone, over 7 GB of uncommitted/cold WC overhead!). On 16–32 GB systems that looks like the single biggest remaining commit pressure point on 63b902f, even bigger than host-list allocators now that memory stack is on by default.

Also reassuring that card_steps refusals are down to 0.08–0.12/frame on your 24 GB setup. Whenever you get a save in a lighter CPU-bound spot, that SUBMIT_FRAMES=2 A/B will be super interesting — and meanwhile we'll dig into where those 65 × 64 MB + 94 × 32 MB WC shared buffers come from!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7242382165 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7242382165). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-28T16:37:13Z. --- @nick0451 Massive thanks for running that clean 3-round A/B and pulling `VICTORY_MEMORY_MAP=1` — both results are super informative! Two big takeaways from your numbers: 1. **`VICTORY_SUBMIT_FRAMES=2` completely eliminated `title waited at presents` (`6.7 ms -> 0.0 ms`)** with zero swapchain stalls, zero `DynamicRefused`, and zero unmet waits even on `BUFFERS = 2`. Obviously at 95% GPU busy it can't move FPS, so seeing the same switch on a ~65–70%-busy CPU-bound scene (where `#699` showed `19.5 ms` waiting at presents!) will be the real test — plus watching out for any 1-frame flicker in motion from `HostTexture.state`. 2. **Huge signal in your `VICTORY_MEMORY_MAP=1` dump:** `write-combined (buffers shared with the card)` is holding **8,630 MB committed vs only 1,545 MB resident** (`65 × 64 MB` + `94 × 32 MB` = **6.8 GB** of commit alone, over **7 GB of uncommitted/cold WC overhead**!). On 16–32 GB systems that looks like the single biggest remaining commit pressure point on `63b902f`, even bigger than host-list allocators now that `memory stack` is on by default. Also reassuring that `card_steps` refusals are down to `0.08–0.12/frame` on your 24 GB setup. Whenever you get a save in a lighter CPU-bound spot, that `SUBMIT_FRAMES=2` A/B will be super interesting — and meanwhile we'll dig into where those `65 × 64 MB` + `94 × 32 MB` WC shared buffers come from!
shiman1901 commented 2026-11-28 17:51:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T17:51:21Z.


@nick0451 Quick follow-up on the 8,630 MB write-combined / 1,545 MB resident mystery from your dump — turns out my initial impression ("7 GB of cold shared upload overhead") was mostly a WDDM / NVIDIA driver quirk, and we nailed it down empirically!

We ran an isolated D3D12 VirtualQuery + QueryWorkingSetEx probe (mirroring copystat.rs) across 21 test cases on an RTX 3060 (driver 621.35):

65 × 64.00 MB (4,158 MB) is mostly VRAM (pool::TEXTURES), NOT host staging buffers:

On NVIDIA driver 621.35, CreateHeap(D3D12_HEAP_TYPE_DEFAULT, 64 MiB) with pool.rs:826-835's exact flags (ALLOW_ONLY_NON_RT_DS_TEXTURES | CREATE_NOT_RESIDENT) shows up in VirtualQuery as 64.00 MB PAGE_WRITECOMBINE, committed = 64.00 MB, resident = 0.00 MB.
That matches your log almost to the block: 58 × 64 MB (pool::TEXTURES = 3,712 MB VRAM) + 5 × 64 MB (pool::STAGING = 320 MB) + 2 allocated between the two unsynchronized log prints = 65 × 64.00 MB!
Also ruled out ID3D12CommandAllocator (32 allocators × 50,000 commands = 0 bytes of PAGE_WRITECOMBINE) and shared_buffer (CUSTOM / WRITE_BACK / L0 = 0 bytes WC).
94 × 32.00 MB (2,664 MB, avg 28.34 MB) is NVIDIA's 32 MiB small-resource arena fragmentation:

Resources ≥ 4 MiB get dedicated bases of their exact size (no rounding to 32/64 MiB), whereas small ≤ ~2 MiB UPLOAD resources are sub-allocated by the driver into 32.00 MiB WC arenas.
Reproducing churn (1,500 × 1 MiB UPLOAD -> 48 × 32.00 MB arenas at 31.64 MB avg commit -> freeing every 2nd buffer) kept the exact same 48 × 32.00 MB arenas while the driver MEM_DECOMMITted the holes down to 26.30 MB avg commit (whole = 32.00 MB, committed < 32 MB, regions > 1).
Why 8,630 MB committed vs 1,545 MB in memory makes total sense:

~3.7+ GB is pure DEFAULT VRAM (resident = 0 by definition), and cold UPLOAD pages are trimmed out of the working set by Windows while keeping their commit charge (verified with EmptyWorkingSet: 2.68 GB committed -> 1.5 MB resident, commit unchanged).
Practical takeaway
So there is no 7 GB host-RAM leak hiding in that write-combined line — actual host RAM there is ~1.5 GB (and touching pool::TEXTURES wouldn't save RAM).
Tiny diagnostic win for copystat.rs:727-740: because NVIDIA exposes DEFAULT VRAM heaps as PAGE_WRITECOMBINE (resident = 0), the label "write-combined (buffers shared with the card)" mixes pure VRAM with host upload buffers. Printing per-group present (in memory) next to committed would instantly make 65 of 64.00 MB (320 MB in memory) self-explanatory in future memory-map dumps.
For real host RAM / commit savings on 16–32 GB rigs (a realistic ~0.5–1 GB), the actual knobs are capping idle texture staging (texture.rs:538) + trimming STAGING_KEPT (pool.rs:37, 8 -> 2), host/send.rs:123 (768 -> 256 MB), and scratch SPARE_KEPT (host.rs:2244, 1 GB -> 256 MB) — easy to cross-check against the staging of textures: N alive X MB line in a memory-map log.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243339273 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7243339273). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-28T17:51:21Z. --- @nick0451 Quick follow-up on the 8,630 MB write-combined / 1,545 MB resident mystery from your dump — turns out my initial impression ("7 GB of cold shared upload overhead") was mostly a WDDM / NVIDIA driver quirk, and we nailed it down empirically! We ran an isolated D3D12 VirtualQuery + QueryWorkingSetEx probe (mirroring copystat.rs) across 21 test cases on an RTX 3060 (driver 621.35): 65 × 64.00 MB (4,158 MB) is mostly VRAM (pool::TEXTURES), NOT host staging buffers: On NVIDIA driver 621.35, CreateHeap(D3D12_HEAP_TYPE_DEFAULT, 64 MiB) with pool.rs:826-835's exact flags (ALLOW_ONLY_NON_RT_DS_TEXTURES | CREATE_NOT_RESIDENT) shows up in VirtualQuery as 64.00 MB PAGE_WRITECOMBINE, committed = 64.00 MB, resident = 0.00 MB. That matches your log almost to the block: 58 × 64 MB (pool::TEXTURES = 3,712 MB VRAM) + 5 × 64 MB (pool::STAGING = 320 MB) + 2 allocated between the two unsynchronized log prints = 65 × 64.00 MB! Also ruled out ID3D12CommandAllocator (32 allocators × 50,000 commands = 0 bytes of PAGE_WRITECOMBINE) and shared_buffer (CUSTOM / WRITE_BACK / L0 = 0 bytes WC). 94 × 32.00 MB (2,664 MB, avg 28.34 MB) is NVIDIA's 32 MiB small-resource arena fragmentation: Resources ≥ 4 MiB get dedicated bases of their exact size (no rounding to 32/64 MiB), whereas small ≤ ~2 MiB UPLOAD resources are sub-allocated by the driver into 32.00 MiB WC arenas. Reproducing churn (1,500 × 1 MiB UPLOAD -> 48 × 32.00 MB arenas at 31.64 MB avg commit -> freeing every 2nd buffer) kept the exact same 48 × 32.00 MB arenas while the driver MEM_DECOMMITted the holes down to 26.30 MB avg commit (whole = 32.00 MB, committed < 32 MB, regions > 1). Why 8,630 MB committed vs 1,545 MB in memory makes total sense: ~3.7+ GB is pure DEFAULT VRAM (resident = 0 by definition), and cold UPLOAD pages are trimmed out of the working set by Windows while keeping their commit charge (verified with EmptyWorkingSet: 2.68 GB committed -> 1.5 MB resident, commit unchanged). Practical takeaway So there is no 7 GB host-RAM leak hiding in that write-combined line — actual host RAM there is ~1.5 GB (and touching pool::TEXTURES wouldn't save RAM). Tiny diagnostic win for copystat.rs:727-740: because NVIDIA exposes DEFAULT VRAM heaps as PAGE_WRITECOMBINE (resident = 0), the label "write-combined (buffers shared with the card)" mixes pure VRAM with host upload buffers. Printing per-group present (in memory) next to committed would instantly make 65 of 64.00 MB (320 MB in memory) self-explanatory in future memory-map dumps. For real host RAM / commit savings on 16–32 GB rigs (a realistic ~0.5–1 GB), the actual knobs are capping idle texture staging (texture.rs:538) + trimming STAGING_KEPT (pool.rs:37, 8 -> 2), host/send.rs:123 (768 -> 256 MB), and scratch SPARE_KEPT (host.rs:2244, 1 GB -> 256 MB) — easy to cross-check against the staging of textures: N alive X MB line in a memory-map log.
tippythetaidum commented 2026-11-28 18:27:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tippythetaidum on 2026-11-28T18:27:17Z.


Some in-game numbers for the "2 frames in flight" question, on a PC where the submitting thread was thought to be the wall. RTX 5080 + Ryzen 7 9800X3D (8 cores, one CCD), 32 GB, Windows 11 26200. 63b902f with #1014, #1066, #1133, #1134 and #393. Series X 2560x1440, DLSS Quality, frame generation off, relay 2 + relay copy on, indoors, the same save restored before each run (5,000 to 7,500 draws a frame).

Where a frame of ~45 ms goes (the card's clock line and queue::behind):

  • card busy about 50 % (~23 ms);
  • card idle ~12 ms "while the submitting thread was working" and ~10 ms "while the title had not submitted";
  • lane thread "worked" 33 to 35 ms; title threads waited 11 to 16 ms at presents.

VICTORY_SUBMIT_SPLIT=1 + VICTORY_OFF_LINE=1 (#1066), two alternating pairs of runs: the lane thread's work drops 4 to 6 ms (to 28 to 31 ms), and the sender works 3.8 ms. The title's waits at presents and the frame rate stayed the same (20 to 22 fps).

VICTORY_SUBMIT_FRAMES=2 with the split on: the waits at presents go to 0.0 ms, but the lane thread's work goes up to 41 to 44 ms a frame. The settles for "lists in the air" take 4 to 14 ms a frame. The median frame stays at 46 ms. So with this tree, a second frame in the line moves the wait into the submitting thread instead of removing it.

VICTORY_PORT_CONSTANTS=1 (16 GB card): 7.7 fps, median frame 159 ms. Far worse, as the README warns for 12 GB.

What did help on this card was #1271's swap-chain sizing, with frame generation on. With 2 back buffers the present call held the presenting thread ~32 ms a frame at 4x, and the rendered rate sat at exactly 14.0. With 8 back buffers the present takes 0.1 ms.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243802092 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7243802092). Originally posted by [tippythetaidum](https://github.com/tippythetaidum) on 2026-11-28T18:27:17Z. --- Some in-game numbers for the "2 frames in flight" question, on a PC where the submitting thread was thought to be the wall. RTX 5080 + Ryzen 7 9800X3D (8 cores, one CCD), 32 GB, Windows 11 26200. `63b902f` with #1014, #1066, #1133, #1134 and #393. Series X 2560x1440, DLSS Quality, frame generation off, relay 2 + relay copy on, indoors, the same save restored before each run (5,000 to 7,500 draws a frame). **Where a frame of ~45 ms goes** (the card's clock line and `queue::behind`): - card busy about 50 % (~23 ms); - card idle ~12 ms "while the submitting thread was working" and ~10 ms "while the title had not submitted"; - lane thread "worked" 33 to 35 ms; title threads waited 11 to 16 ms at presents. **`VICTORY_SUBMIT_SPLIT=1` + `VICTORY_OFF_LINE=1`** (#1066), two alternating pairs of runs: the lane thread's work drops 4 to 6 ms (to 28 to 31 ms), and the sender works 3.8 ms. The title's waits at presents and the frame rate stayed the same (20 to 22 fps). **`VICTORY_SUBMIT_FRAMES=2`** with the split on: the waits at presents go to 0.0 ms, but the lane thread's work goes up to 41 to 44 ms a frame. The settles for "lists in the air" take 4 to 14 ms a frame. The median frame stays at 46 ms. So with this tree, a second frame in the line moves the wait into the submitting thread instead of removing it. **`VICTORY_PORT_CONSTANTS=1`** (16 GB card): 7.7 fps, median frame 159 ms. Far worse, as the README warns for 12 GB. What did help on this card was #1271's swap-chain sizing, with frame generation on. With 2 back buffers the present call held the presenting thread ~32 ms a frame at 4x, and the rendered rate sat at exactly 14.0. With 8 back buffers the present takes 0.1 ms.
shiman1901 commented 2026-11-28 18:37:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T18:37:56Z.


@tippythetaidum Huge thanks for bringing real 50%-GPU-busy numbers on a 9800X3D + RTX 5080 — that "lists in the air" line (4 to 14 ms per frame!) is a huge smoking gun!

Checking host.rs:3046-3051 and host.rs:5725-5750, "lists in the air" (WHY_MOST) is the default VICTORY_LATE_WAIT_LISTS = 256 cap — and flying counts command lists (*flying += order.len()), not submissions, so 40–60 submissions × 1–3 lists/submission hits 256 at ~1.5–2 frames and forces relay_wait/settle(WHY_MOST) right on the lane thread! (And right behind it sits VICTORY_SUBMIT_DEPTH, default 64 at queue/behind.rs:728-731.)

If you have a minute to re-test VICTORY_SUBMIT_FRAMES=2 (with #1066 split on) together with:

VICTORY_SUBMIT_FRAMES=2
VICTORY_LATE_WAIT_LISTS=512
VICTORY_SUBMIT_DEPTH=128

— that should clear those 4–14 ms "lists in the air" settles (just watch dynamic slots: N tables asked, M refused in the log, since holding 2 frames of lists at once can pressure dynamic slots — which #821 / VICTORY_DYNAMIC_WAIT addresses).

Also great validation on #1271 (BUFFERS = 2 holding present for ~32 ms at 4x FG -> 0.1 ms with 8 back buffers) — confirms our Stage 3 BUFFERS = 2 choke point from live data too!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243937946 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7243937946). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-28T18:37:56Z. --- @tippythetaidum Huge thanks for bringing real 50%-GPU-busy numbers on a 9800X3D + RTX 5080 — that `"lists in the air"` line (`4 to 14 ms` per frame!) is a huge smoking gun! Checking `host.rs:3046-3051` and `host.rs:5725-5750`, `"lists in the air"` (`WHY_MOST`) is the default **`VICTORY_LATE_WAIT_LISTS = 256`** cap — and `flying` counts **command lists** (`*flying += order.len()`), not submissions, so 40–60 submissions × 1–3 lists/submission hits `256` at ~1.5–2 frames and forces `relay_wait`/`settle(WHY_MOST)` right on the lane thread! (And right behind it sits `VICTORY_SUBMIT_DEPTH`, default `64` at `queue/behind.rs:728-731`.) If you have a minute to re-test `VICTORY_SUBMIT_FRAMES=2` (with `#1066` split on) **together with**: VICTORY_SUBMIT_FRAMES=2 VICTORY_LATE_WAIT_LISTS=512 VICTORY_SUBMIT_DEPTH=128 — that should clear those `4–14 ms` `"lists in the air"` settles (just watch `dynamic slots: N tables asked, M refused` in the log, since holding 2 frames of lists at once can pressure dynamic slots — which `#821` / `VICTORY_DYNAMIC_WAIT` addresses). Also great validation on `#1271` (`BUFFERS = 2` holding present for `~32 ms` at 4x FG -> `0.1 ms` with 8 back buffers) — confirms our Stage 3 `BUFFERS = 2` choke point from live data too!
nick0451 commented 2026-11-28 20:22:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-28T20:22:19Z.


The indoor run, as promised. The step 1 switches (VICTORY_SUBMIT_FRAMES=2, VICTORY_SUBMIT_DEPTH=128, VICTORY_LATE_WAIT_LISTS=512, VICTORY_BURY_LAG=8) against the default, in the living room of the same house.

Setup: release build of main at 32ecacf (current), victory.exe play, RTX 3090 24 GB, i9-14900K, Windows 11, Series S, DLSS Performance, frame generation off. The save can't be made indoors (it reloads on the balcony), so every run replays the same recorded walk into the living room (keyboard keys through VICTORY_KEYS_FILE), then stands still. Each run is checked by screenshot: all 6 measured runs ended inside, and two stopped at a slightly different spot (about 8,600 draws against 7,700-8,000) and are left out. One warm-up start per variant, then the variants in turn, three rounds. Each run is 40 s to settle, 60 s measured.

default step 1
fps (runs in the common spot) 21.4 (21.7, 21.0) 21.6 (21.6, 21.7)
frame / preparing 46.9 / 29.4 ms 46.2 / 30.4 ms
submissions per frame / in the line 42.0 / 13.0 42.0 / 13.0
that thread worked 43.5 ms 44.2 ms
title waited at presents 7.5 ms 0.0 ms
title waited for room / waits not met at a present 0.0 / 0.00 0.0 / 0.00
card steps: fills / refused and waited 13,488 / 0.00 12,974 / 0.00
card busy / idle behind the submitting thread 94% / 2.8 ms 93% / 3.4 ms
submitting thread stood waiting for the card 0.0 ms 0.0 ms
  • The same picture as on the balcony: the second frame takes the title's wait at presents to zero (7.5 ms here), with no stalls. There are no card-steps refusals, and no dynamic-slot refusals or other waits in any window. The screenshots look the same as the default's.
  • This room is not the lighter scene I hoped for. It has more on screen than the balcony (about 7,900 draws against 5,900), and the card is still about 94% busy. So on an RTX 3090 neither scene is bound by the submitting thread, and the gain can't show as fps (+1%, inside this setup's 2-3% noise). tippythetaidum's 50%-busy RTX 5080 numbers above are the better test of the fps side.

So, from this PC: step 1 is clean in two scenes on current main, and the fps question needs a faster card or a CPU-bound scene.

Measured with an AI assistant (Claude Code); every number above is from this PC's logs.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7245236843 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7245236843). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-28T20:22:19Z. --- The indoor run, as promised. The step 1 switches (`VICTORY_SUBMIT_FRAMES=2`, `VICTORY_SUBMIT_DEPTH=128`, `VICTORY_LATE_WAIT_LISTS=512`, `VICTORY_BURY_LAG=8`) against the default, in the living room of the same house. **Setup:** release build of main at `32ecacf` (current), `victory.exe play`, RTX 3090 24 GB, i9-14900K, Windows 11, Series S, DLSS Performance, frame generation off. The save can't be made indoors (it reloads on the balcony), so every run replays the same recorded walk into the living room (keyboard keys through `VICTORY_KEYS_FILE`), then stands still. Each run is checked by screenshot: all 6 measured runs ended inside, and two stopped at a slightly different spot (about 8,600 draws against 7,700-8,000) and are left out. One warm-up start per variant, then the variants in turn, three rounds. Each run is 40 s to settle, 60 s measured. | | default | step 1 | |---|---|---| | fps (runs in the common spot) | 21.4 (21.7, 21.0) | 21.6 (21.6, 21.7) | | frame / preparing | 46.9 / 29.4 ms | 46.2 / 30.4 ms | | submissions per frame / in the line | 42.0 / 13.0 | 42.0 / 13.0 | | that thread worked | 43.5 ms | 44.2 ms | | **title waited at presents** | **7.5 ms** | **0.0 ms** | | title waited for room / waits not met at a present | 0.0 / 0.00 | 0.0 / 0.00 | | card steps: fills / refused and waited | 13,488 / 0.00 | 12,974 / 0.00 | | card busy / idle behind the submitting thread | 94% / 2.8 ms | 93% / 3.4 ms | | submitting thread stood waiting for the card | 0.0 ms | 0.0 ms | - The same picture as on the balcony: the second frame takes the title's wait at presents to zero (7.5 ms here), with no stalls. There are no card-steps refusals, and no dynamic-slot refusals or other waits in any window. The screenshots look the same as the default's. - **This room is not the lighter scene I hoped for.** It has more on screen than the balcony (about 7,900 draws against 5,900), and the card is still about 94% busy. So on an RTX 3090 neither scene is bound by the submitting thread, and the gain can't show as fps (+1%, inside this setup's 2-3% noise). tippythetaidum's 50%-busy RTX 5080 numbers above are the better test of the fps side. So, from this PC: step 1 is clean in two scenes on current main, and the fps question needs a faster card or a CPU-bound scene. Measured with an AI assistant (Claude Code); every number above is from this PC's logs.
shiman1901 commented 2026-11-28 20:53:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T20:53:59Z.


@nick0451 Awesome — clean 2/2 scenes on 32ecacf with 0.0 ms present waits and 0 refusals! Agreed, @tippythetaidum's 50%-busy 5080 with LATE_WAIT_LISTS=512 + SUBMIT_DEPTH=128 will be the real FPS test.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7245625039 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7245625039). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-28T20:53:59Z. --- @nick0451 Awesome — clean 2/2 scenes on 32ecacf with 0.0 ms present waits and 0 refusals! Agreed, @tippythetaidum's 50%-busy 5080 with LATE_WAIT_LISTS=512 + SUBMIT_DEPTH=128 will be the real FPS test.
meonline42 commented 2026-11-29 10:03:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-29T10:03:45Z.


A CPU-bound data point for step 1 (VICTORY_SUBMIT_FRAMES=2, VICTORY_SUBMIT_DEPTH=128, VICTORY_LATE_WAIT_LISTS=512, VICTORY_BURY_LAG=8): the card here is only about 60% busy, so this is the kind of scene the fps question needed.

Setup: Ryzen 9 5900X (12 cores, thermally limited: ~3.7 GHz average, Tctl 74-83 °C), RTX 3090 24 GB at 350 W, 64 GB DDR4-3200, Windows 11. Release build of main at e1f2eb6, plus a local keyboard-input patch (victory-hle only). Series X, 1080p rendered to 1440p, DLSS Performance, frame generation off. Each run starts unattended from the same outdoor save and stands still. Variants alternate, two rounds each. Figures are averages of the 5-second log lines over the last ~150 s of each run (29 lines per run).

default r1 step 1 r1 default r2 step 1 r2
fps 16.6 16.5 17.2 17.4
frame / preparing 61.1 / 44.8 ms 61.5 / 44.9 ms 58.8 / 44.0 ms 58.2 / 43.8 ms
draws/frame 8,372 7,548 7,329 7,236
that thread worked 55.7 ms 55.6 ms 54.5 ms 54.8 ms
title waited at presents 11.7 ms 0.0 ms 10.0 ms 0.0 ms
waited for room / waits not met at a present 0.0 / 0.00 0.0 / 0.00 0.0 / 0.00 0.0 / 0.00
card busy / idle while the submitting thread worked 61% / 22.2 ms 59% / 22.5 ms 61% / 21.4 ms 62% / 21.7 ms
submitting thread stood waiting for the card 1.3 ms 2.3 ms 1.9 ms 1.0 ms
  • Step 1 again takes the title's wait at presents to zero, here from 10-12 ms, more than on the 3090 + 14900K (7.5 ms). There were no waits for room and no unmet waits, all 4 runs finished, and nothing looked wrong.
  • fps doesn't move (16.6 → 16.5, 17.2 → 17.4). On this CPU, the submitting thread works 55 ms of a 58-61 ms frame. The title's threads waiting less at presents just means they wait somewhere else: the frame is the submitting thread, and the card sits idle ~22 ms behind it.
  • So, at least on a 12-core Zen 3 without X3D cache, step 1 is safe, but the fps gain has to come from making the submitting thread itself cheaper (here preparing ~44 ms, of which copies are ~24-28 ms for 60-70 MB per frame), or from splitting its work across threads.
  • On the same machine I also tried #1403 #1279 #2049 #1937 #1988 and #128 stacked together: ~3-5 ms a frame at most, close to the noise. Details are in a comment on each of those PRs.

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:7254181308 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7254181308). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-29T10:03:45Z. --- A CPU-bound data point for step 1 (`VICTORY_SUBMIT_FRAMES=2`, `VICTORY_SUBMIT_DEPTH=128`, `VICTORY_LATE_WAIT_LISTS=512`, `VICTORY_BURY_LAG=8`): the card here is only about 60% busy, so this is the kind of scene the fps question needed. **Setup:** Ryzen 9 5900X (12 cores, thermally limited: ~3.7 GHz average, Tctl 74-83 °C), RTX 3090 24 GB at 350 W, 64 GB DDR4-3200, Windows 11. Release build of `main` at `e1f2eb6`, plus a local keyboard-input patch (victory-hle only). Series X, 1080p rendered to 1440p, DLSS Performance, frame generation off. Each run starts unattended from the same outdoor save and stands still. Variants alternate, two rounds each. Figures are averages of the 5-second log lines over the last ~150 s of each run (29 lines per run). | | default r1 | step 1 r1 | default r2 | step 1 r2 | |---|---|---|---|---| | fps | 16.6 | 16.5 | 17.2 | 17.4 | | frame / preparing | 61.1 / 44.8 ms | 61.5 / 44.9 ms | 58.8 / 44.0 ms | 58.2 / 43.8 ms | | draws/frame | 8,372 | 7,548 | 7,329 | 7,236 | | that thread worked | 55.7 ms | 55.6 ms | 54.5 ms | 54.8 ms | | **title waited at presents** | **11.7 ms** | **0.0 ms** | **10.0 ms** | **0.0 ms** | | waited for room / waits not met at a present | 0.0 / 0.00 | 0.0 / 0.00 | 0.0 / 0.00 | 0.0 / 0.00 | | card busy / idle while the submitting thread worked | 61% / 22.2 ms | 59% / 22.5 ms | 61% / 21.4 ms | 62% / 21.7 ms | | submitting thread stood waiting for the card | 1.3 ms | 2.3 ms | 1.9 ms | 1.0 ms | - Step 1 again takes the title's wait at presents to zero, here from 10-12 ms, more than on the 3090 + 14900K (7.5 ms). There were no waits for room and no unmet waits, all 4 runs finished, and nothing looked wrong. - **fps doesn't move** (16.6 → 16.5, 17.2 → 17.4). On this CPU, the submitting thread works 55 ms of a 58-61 ms frame. The title's threads waiting less at presents just means they wait somewhere else: the frame is the submitting thread, and the card sits idle ~22 ms behind it. - So, at least on a 12-core Zen 3 without X3D cache, step 1 is safe, but the fps gain has to come from making the submitting thread itself cheaper (here `preparing` ~44 ms, of which copies are ~24-28 ms for 60-70 MB per frame), or from splitting its work across threads. - On the same machine I also tried #1403 #1279 #2049 #1937 #1988 and #128 stacked together: ~3-5 ms a frame at most, close to the noise. Details are in a comment on each of those PRs. Measured and posted by Claude Code on behalf of the machine's owner; every number is from this PC's logs.
shiman1901 commented 2026-11-29 13:24:12 +00:00 (Migrated from github.com)
Author
Contributor

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


@meonline42 Awesome data point — that settles the Step 1 FPS question cleanly!

Three independent machines (3090 + 14900K, 5080 + 9800X3D, 3090 + 5900X) now confirm VICTORY_SUBMIT_FRAMES=2 zeroes title waited at presents (7–12 ms -> 0.0 ms) cleanly with zero stalls, but when victory-submit itself burns 55 ms of a 59 ms frame, freeing the title's threads doesn't move FPS — the wall is strictly the serial CPU cost inside victory-submit (~24–28 ms to copy 60–70 MB/frame = only ~2.5 GB/s effective!).


Follow-up on @nick0451's 8,630 MB write-combined commit mystery (63b902f / 9ce3cf9)

We traced where those 65 × 64 MB (4,158 MB) + 94 × 32 MB (2,664 MB) write-combined buffers (8,630 MB committed vs only 1,545 MB resident) come from on current main:

  1. Root cause (pool.rs:233 -> texture.rs:2183):
    • pool::staging() calls Pool::take_ripe(..., Ripe::ALL) (ahead == 0), which rejects any allocation len > BLOCK / 2 (> 32 MiB).
    • So texture.rs:2183 falls back to a direct host.upload_buffer(total) (CreateCommittedResource(D3D12_HEAP_TYPE_UPLOAD) -> PAGE_WRITECOMBINE), committing the full padded GetCopyableFootprints size (32–64 MiB) for every large texture.
    • Because Staging stays alive in the STAGING map (texture.rs:875-884) even when uploaded && !dirty && !baking (kept around for digest/serial checks), those 60+ × 64 MiB and 94 × 32 MiB upload buffers pile up as ~6.8 GB of mostly untouched commit charge (7.1 GB non-resident).
  2. Low-risk fix (should cut ~5–6 GB of dead commit on 16–32 GB hosts with ~0 FPS cost):
    • For large Staging entries (bytes > 32 MiB), release the backing D3D12_HEAP_TYPE_UPLOAD buffer once uploaded && !dirty && !baking && Arc::strong_count == 1 while retaining only its digest/serial metadata (re-allocating staging only if title memory actually changes), capped behind an opt-in budget like VICTORY_STAGING_MB=512.
    • Shrink small-texture pool::STAGING block size (64 MiB -> 8–16 MiB) so small uploads don't pin 64 MiB committed blocks, and trim host/send.rs kept() (768 MiB -> 256 MiB) under 16–32 GB pressure.

Happy to spin that 8.6 GB large-staging commit finding out into a dedicated focused issue (or draft PR) if helpful — and next we'll look into why copies inside preparing is taking 24–28 ms for 60–70 MB on Zen 3!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256511368 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7256511368). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T13:24:12Z. --- @meonline42 Awesome data point — that settles the Step 1 FPS question cleanly! Three independent machines (`3090 + 14900K`, `5080 + 9800X3D`, `3090 + 5900X`) now confirm `VICTORY_SUBMIT_FRAMES=2` zeroes `title waited at presents` (`7–12 ms -> 0.0 ms`) cleanly with zero stalls, **but** when `victory-submit` itself burns `55 ms` of a `59 ms` frame, freeing the title's threads doesn't move FPS — the wall is strictly the serial CPU cost inside `victory-submit` (`~24–28 ms` to copy `60–70 MB/frame` = only `~2.5 GB/s` effective!). --- ### Follow-up on @nick0451's `8,630 MB` write-combined commit mystery (`63b902f` / `9ce3cf9`) We traced where those **`65 × 64 MB` (`4,158 MB`) + `94 × 32 MB` (`2,664 MB`)** write-combined buffers (`8,630 MB` committed vs only `1,545 MB` resident) come from on current `main`: 1. **Root cause (`pool.rs:233` -> `texture.rs:2183`):** - `pool::staging()` calls `Pool::take_ripe(..., Ripe::ALL)` (`ahead == 0`), which rejects any allocation `len > BLOCK / 2` (**`> 32 MiB`**). - So `texture.rs:2183` falls back to a direct `host.upload_buffer(total)` (`CreateCommittedResource(D3D12_HEAP_TYPE_UPLOAD)` -> `PAGE_WRITECOMBINE`), committing the full padded `GetCopyableFootprints` size (32–64 MiB) for every large texture. - Because `Staging` stays alive in the `STAGING` map (`texture.rs:875-884`) even when `uploaded && !dirty && !baking` (kept around for digest/serial checks), those 60+ × 64 MiB and 94 × 32 MiB upload buffers pile up as **~6.8 GB of mostly untouched commit charge** (7.1 GB non-resident). 2. **Low-risk fix (should cut ~5–6 GB of dead commit on 16–32 GB hosts with ~0 FPS cost):** - For large `Staging` entries (`bytes > 32 MiB`), release the backing `D3D12_HEAP_TYPE_UPLOAD` buffer once `uploaded && !dirty && !baking && Arc::strong_count == 1` while retaining only its `digest`/`serial` metadata (re-allocating staging only if title memory actually changes), capped behind an opt-in budget like `VICTORY_STAGING_MB=512`. - Shrink small-texture `pool::STAGING` block size (`64 MiB -> 8–16 MiB`) so small uploads don't pin 64 MiB committed blocks, and trim `host/send.rs` `kept()` (`768 MiB -> 256 MiB`) under 16–32 GB pressure. Happy to spin that `8.6 GB` large-staging commit finding out into a dedicated focused issue (or draft PR) if helpful — and next we'll look into why `copies` inside `preparing` is taking `24–28 ms` for `60–70 MB` on Zen 3!
m335671 commented 2026-11-29 13:24:25 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by m335671 on 2026-11-29T13:24:25Z.


A CPU-bound data point from a 12 GB card, plus switches that did not help here, so nobody re-tests them blind. AI-assisted (Claude Code); runs and numbers are from my machine.

Setup: Ryzen 9 7900 (12 cores), RTX 4070 12 GB (driver 621.40), 32 GB DDR5, Windows 11 26300. Release build of main at 829188e (v2026.11.29.01) plus one local ambient-light switch that does not touch submission. Series X, 2560x1440 output, DLSS Quality (scene 1706x960), frame generation off. Each run starts unattended from the same save, plays the opening cutscene and the first room for 240 s. Figures are averages of the 5-second log lines with more than 500 draws (34-37 lines per run).

Where the frame goes (default switches, second run after the preload):

fps 24.9 (median 25.4)
draws/frame ~4,150
card busy ~81 % (7.5 ms a frame with nothing of ours queued)
submitting thread preparing 34.4 ms
of which lists' steps 18.4 ms (refreshes 11.4 ms in 40 flushes of ~10,500, ~9,300 known to copy nothing)
write watch 3.6 ms
copies in the card's memory 4.6 ms
planning steps done on the card 2.2 ms
heaps' records and sweep 1.9 ms (+0.9 waiting for them at the end)
sending the lists 1.2 ms
title waited at presents 5.8 ms
list calls translated by our threads ~41,000 in 163 ms (all threads)

Over a longer play session on the same machine, frame time follows the draw count closely: roughly 25 ms + 5 ms per 1,000 draws. Driving in the city (17,000-19,000 draws) drops to 7-9 fps, and there the card is also full (46-50 ms of GPU time), so that scene is bound on both sides.

Step 1 on this machine (VICTORY_SUBMIT_FRAMES=2, VICTORY_SUBMIT_DEPTH=128, VICTORY_LATE_WAIT_LISTS=512, VICTORY_BURY_LAG=8):

default r1 step 1 r1 default r2 step 1 r2
fps, mean 23.6 25.4 24.4 25.7
fps, median 25.5 25.2 25.2 25.9
fps, 10th percentile of the 5 s lines 16.7 21.6 19.9 23.0
draws/frame 4,269 4,017 4,150 4,052
submitting thread preparing 32.3 ms 37.0 ms 36.5 ms 34.2 ms
card busy 85 % 75 % 77 % 81 %
title waited at presents 3.6 ms 0.0 ms 8.2 ms 0.0 ms
dynamic slot refusals logged none none none none

Same picture as nick0451's and meonline42's: step 1 takes the present wait to zero, and here that shows as fewer slow stretches (the slowest 10 % of the 5-second lines are 3-5 fps higher), about +1.5 fps on the mean, and no change to the median. Whatever bounds the steady frame here is not the present wait. Runs 121-124 were made one after the other on the same build after a warm-up; draw counts differ by up to 6 % because the cutscene's loading varies between runs.

Switches tried that did not help here (same scene, on the build before the combine, 64d4931 plus the same local switch; identical runs differ by up to ±1.5 fps, so each baseline was repeated):

switch fps baseline what happened
VICTORY_WIDE_THREADS=12 23.2 23.6 no change
VICTORY_THIN_THREADS=12 (alone or with the one above) 23.0-23.2 23.6 no change
VICTORY_CARD_STEPS=1 19.5 23.6 slower
VICTORY_PORT_CONSTANTS=1 18.4 23.7-25.2 preparing copies fell from 15 to 10 ms (50 to 33 MB), but the GPU wait rose to ~20 ms: the card reads the ~185 MB region from system memory over PCIe. A loss on this PC
VICTORY_INPLACE=1 23.0 23.7-25.2 neutral: it covered a single 4 MB window

One thing worth knowing for anyone measuring: the first run after a new build or preload is cold here (21.3 against 23.6 fps for the same switches a run later), so a single unrepeated baseline makes almost any switch look like a 2 fps win.

A lead I am looking at next (diagnostics build, same scene, 829188e plus the two diagnostics compile fixes the open PRs carry): of the ~12 ms of refreshes, sifting out the ~9,500 known to copy nothing costs only 1.2 ms. The rest is copying the ~1,200 that do: about 8 ms on the threads. The frame line says 49 MB a frame goes up in copies (15 ms), while the write watch finds only ~2,400 written pages of 4 KiB (~10 MB) per frame. Refreshes send whole 64 KiB pages; VICTORY_SEND_CHANGED=1 (dword-exact) exists but is off because it broke geometry and indirect light (the comment in shadow.rs). I want to measure whether sending the written 4 KiB pages whole, a middle step, keeps the picture right and cuts that volume. Also seen in the same lines, per frame: 21.7 ms (all threads) waiting for the guards and 8.2 ms changing protections, and 10 ms copying back 0.9 MB.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256514139 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7256514139). Originally posted by [m335671](https://github.com/m335671) on 2026-11-29T13:24:25Z. --- A CPU-bound data point from a 12 GB card, plus switches that did **not** help here, so nobody re-tests them blind. AI-assisted (Claude Code); runs and numbers are from my machine. **Setup:** Ryzen 9 7900 (12 cores), RTX 4070 12 GB (driver 621.40), 32 GB DDR5, Windows 11 26300. Release build of `main` at `829188e` (v2026.11.29.01) plus one local ambient-light switch that does not touch submission. Series X, 2560x1440 output, DLSS Quality (scene 1706x960), frame generation off. Each run starts unattended from the same save, plays the opening cutscene and the first room for 240 s. Figures are averages of the 5-second log lines with more than 500 draws (34-37 lines per run). **Where the frame goes (default switches, second run after the preload):** | | | |---|---| | fps | 24.9 (median 25.4) | | draws/frame | ~4,150 | | card busy | ~81 % (7.5 ms a frame with nothing of ours queued) | | submitting thread preparing | 34.4 ms | | of which lists' steps | 18.4 ms (refreshes 11.4 ms in 40 flushes of ~10,500, ~9,300 known to copy nothing) | | write watch | 3.6 ms | | copies in the card's memory | 4.6 ms | | planning steps done on the card | 2.2 ms | | heaps' records and sweep | 1.9 ms (+0.9 waiting for them at the end) | | sending the lists | 1.2 ms | | title waited at presents | 5.8 ms | | list calls translated by our threads | ~41,000 in 163 ms (all threads) | Over a longer play session on the same machine, frame time follows the draw count closely: roughly 25 ms + 5 ms per 1,000 draws. Driving in the city (17,000-19,000 draws) drops to 7-9 fps, and there the card is also full (46-50 ms of GPU time), so that scene is bound on both sides. **Step 1 on this machine** (`VICTORY_SUBMIT_FRAMES=2`, `VICTORY_SUBMIT_DEPTH=128`, `VICTORY_LATE_WAIT_LISTS=512`, `VICTORY_BURY_LAG=8`): | | default r1 | step 1 r1 | default r2 | step 1 r2 | |---|---|---|---|---| | fps, mean | 23.6 | 25.4 | 24.4 | 25.7 | | fps, median | 25.5 | 25.2 | 25.2 | 25.9 | | fps, 10th percentile of the 5 s lines | 16.7 | 21.6 | 19.9 | 23.0 | | draws/frame | 4,269 | 4,017 | 4,150 | 4,052 | | submitting thread preparing | 32.3 ms | 37.0 ms | 36.5 ms | 34.2 ms | | card busy | 85 % | 75 % | 77 % | 81 % | | **title waited at presents** | **3.6 ms** | **0.0 ms** | **8.2 ms** | **0.0 ms** | | dynamic slot refusals logged | none | none | none | none | Same picture as nick0451's and meonline42's: step 1 takes the present wait to zero, and here that shows as fewer slow stretches (the slowest 10 % of the 5-second lines are 3-5 fps higher), about +1.5 fps on the mean, and no change to the median. Whatever bounds the steady frame here is not the present wait. Runs 121-124 were made one after the other on the same build after a warm-up; draw counts differ by up to 6 % because the cutscene's loading varies between runs. **Switches tried that did not help here** (same scene, on the build before the combine, `64d4931` plus the same local switch; identical runs differ by up to ±1.5 fps, so each baseline was repeated): | switch | fps | baseline | what happened | |---|---|---|---| | `VICTORY_WIDE_THREADS=12` | 23.2 | 23.6 | no change | | `VICTORY_THIN_THREADS=12` (alone or with the one above) | 23.0-23.2 | 23.6 | no change | | `VICTORY_CARD_STEPS=1` | 19.5 | 23.6 | slower | | `VICTORY_PORT_CONSTANTS=1` | 18.4 | 23.7-25.2 | preparing copies fell from 15 to 10 ms (50 to 33 MB), but the GPU wait rose to ~20 ms: the card reads the ~185 MB region from system memory over PCIe. A loss on this PC | | `VICTORY_INPLACE=1` | 23.0 | 23.7-25.2 | neutral: it covered a single 4 MB window | One thing worth knowing for anyone measuring: the first run after a new build or preload is cold here (21.3 against 23.6 fps for the same switches a run later), so a single unrepeated baseline makes almost any switch look like a 2 fps win. **A lead I am looking at next (diagnostics build, same scene, `829188e` plus the two diagnostics compile fixes the open PRs carry):** of the ~12 ms of refreshes, sifting out the ~9,500 known to copy nothing costs only 1.2 ms. The rest is copying the ~1,200 that do: about 8 ms on the threads. The frame line says 49 MB a frame goes up in copies (15 ms), while the write watch finds only ~2,400 written pages of 4 KiB (~10 MB) per frame. Refreshes send whole 64 KiB pages; `VICTORY_SEND_CHANGED=1` (dword-exact) exists but is off because it broke geometry and indirect light (the comment in `shadow.rs`). I want to measure whether sending the written 4 KiB pages whole, a middle step, keeps the picture right and cuts that volume. Also seen in the same lines, per frame: 21.7 ms (all threads) waiting for the guards and 8.2 ms changing protections, and 10 ms copying back 0.9 MB.
m335671 commented 2026-11-29 13:24:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by m335671 on 2026-11-29T13:24:34Z.


Proposal: one way to measure, so the CPU numbers in this thread add up. AI-assisted (Claude Code); the runs behind it are mine.

The step 1 data points so far are good, but each one comes from a different scene, length and averaging (a recorded walk indoors, standing still outside, a cutscene), and some baselines were run once. Identical runs differ by up to ±1.5 fps on my machine, and the first run after a new build or preload was 2.3 fps slower than the same run repeated. So a 1-2 fps difference between two posts here says nothing yet. The repository already has the tool for this, scripts/bench.ps1 (#1099): unattended runs from a fixed copy of the saves, a warm-up left out, medians, and fps grouped by draws per frame. What is missing is an agreement on how we all use it.

Note first: on main since d2c2a2bc the frame line says "dropped N draws or dispatches" instead of "dropped N without a host pipeline", and bench.ps1 and summarize-frame-log.py only match the old text, so they find no frame line at all (0 samples). A two-line fix is in #2475. bench.ps1 also runs the diagnostics build, which does not compile on main since the combine; several open PRs fix that (#2048, #2208, #2386).

The proposal:

  1. Build: the diagnostics build bench.ps1 asks for, of a named commit of main. Say which commit and which switches differ from the default, nothing else.
  2. Scenes: three, each from your own save at the same point of the story, so everyone measures the same kind of load:
    • A, the opening (deterministic, no input): the first cutscene and the first room. Mixed CPU and GPU load, around 4,000 draws.
    • B, standing in a busy street in the first open area, no input after loading. CPU-bound on most cards.
    • C, a short drive on a fixed -Route (W plus turning keys), the heaviest case: 15,000-19,000 draws, where 12 GB cards also run out of GPU time. Route files are plain text, so they can be shared in this thread.
  3. Runs: one warm-up run after any build, preload or driver change, thrown away. Then alternate the variants, A/B/A/B, two rounds at least, from the same -Seed. Nothing else on the GPU (a music player's visualiser cost me 22 % of the card once).
  4. Report: CPU, GPU, RAM, driver, Windows build, console profile, resolution, DLSS mode, frame generation off. Then bench.ps1's summary for each run: fps by draw band, plus three numbers from the log's last minute: the submitting thread's "preparing" total, "the card about N % busy", and "title waited at presents". With those three we can tell a CPU win, a GPU win and a pacing change apart.

I can run A on an RTX 4070 12 GB / Ryzen 9 7900 for every candidate posted here, and B and C as soon as my save gets there. If people agree, I would also add the scene list and the report template to docs/ (no game data, text only).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256515991 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7256515991). Originally posted by [m335671](https://github.com/m335671) on 2026-11-29T13:24:34Z. --- **Proposal: one way to measure, so the CPU numbers in this thread add up.** AI-assisted (Claude Code); the runs behind it are mine. The step 1 data points so far are good, but each one comes from a different scene, length and averaging (a recorded walk indoors, standing still outside, a cutscene), and some baselines were run once. Identical runs differ by up to ±1.5 fps on my machine, and the first run after a new build or preload was 2.3 fps slower than the same run repeated. So a 1-2 fps difference between two posts here says nothing yet. The repository already has the tool for this, `scripts/bench.ps1` (#1099): unattended runs from a fixed copy of the saves, a warm-up left out, medians, and fps grouped by draws per frame. What is missing is an agreement on how we all use it. **Note first:** on `main` since d2c2a2bc the frame line says "dropped N draws or dispatches" instead of "dropped N without a host pipeline", and `bench.ps1` and `summarize-frame-log.py` only match the old text, so they find no frame line at all (0 samples). A two-line fix is in #2475. `bench.ps1` also runs the diagnostics build, which does not compile on `main` since the combine; several open PRs fix that (#2048, #2208, #2386). **The proposal:** 1. **Build:** the diagnostics build `bench.ps1` asks for, of a named commit of `main`. Say which commit and which switches differ from the default, nothing else. 2. **Scenes:** three, each from your own save at the same point of the story, so everyone measures the same kind of load: - **A, the opening** (deterministic, no input): the first cutscene and the first room. Mixed CPU and GPU load, around 4,000 draws. - **B, standing in a busy street** in the first open area, no input after loading. CPU-bound on most cards. - **C, a short drive** on a fixed `-Route` (W plus turning keys), the heaviest case: 15,000-19,000 draws, where 12 GB cards also run out of GPU time. Route files are plain text, so they can be shared in this thread. 3. **Runs:** one warm-up run after any build, preload or driver change, thrown away. Then alternate the variants, A/B/A/B, two rounds at least, from the same `-Seed`. Nothing else on the GPU (a music player's visualiser cost me 22 % of the card once). 4. **Report:** CPU, GPU, RAM, driver, Windows build, console profile, resolution, DLSS mode, frame generation off. Then `bench.ps1`'s summary for each run: fps by draw band, plus three numbers from the log's last minute: the submitting thread's "preparing" total, "the card about N % busy", and "title waited at presents". With those three we can tell a CPU win, a GPU win and a pacing change apart. I can run A on an RTX 4070 12 GB / Ryzen 9 7900 for every candidate posted here, and B and C as soon as my save gets there. If people agree, I would also add the scene list and the report template to `docs/` (no game data, text only).
shiman1901 commented 2026-11-29 13:36:13 +00:00 (Migrated from github.com)
Author
Contributor

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


@m335671 Huge +1 on the shared benchmark protocol (Scenes A / B / C via scripts/bench.ps1 once #2475 + the diag build fix land, warm-up discarded, alternating A/B/A/B). Having consistent draw-band medians + preparing / card busy / title waited at presents across machines will cut out almost all the ±1.5 fps run-to-run noise — huge thanks for offering to run candidates on your RTX 4070 12 GB!

Also super encouraging to see Step 1 (VICTORY_SUBMIT_FRAMES=2) now clean across 4 machines with 0.0 ms present wait and a real +3–5 fps lift on the 10th-percentile slow stretches (16.7 -> 21.6, 19.9 -> 23.0) on your mixed scene.

Your last paragraph looks like the exact smoking gun behind @meonline42's 24–28 ms copies wall on Zen 3 too:

  • ~5x write amplification (~10 MB of 4 KiB dirty pages from GetWriteWatch -> 49–70 MB copied as 64 KiB chunks): Unlike dword-exact VICTORY_SEND_CHANGED=1 (which diffs against a shadow copy and can tear structs or miss GPU-overwritten same-value dwords), sending whole coalesced 4 KiB OS pages straight from GetWriteWatch is hardware-exact — zero diffing, zero partial-struct tearing, ~3–5x less copied volume!
  • 21.7 ms waiting on guards + 8.2 ms protection flips (matching @nick0451's #699 breakdown on 14900K).
  • 10 ms copying back 0.9 MB (curious if that's non-carded before/diff scan or land/texback — and whether @Starchaser1024's fixed 481afd8 in #849 with VICTORY_DIRTY_BITMAP=1 moves it!).

We're about to audit shadow.rs / watch.rs on current main (829188e) specifically for (1) what's coupled to 64 KiB granularity vs cleanly movable to coalesced 4 KiB pages, (2) the 21.7 ms guards lock, and (3) where 10 ms for 0.9 MB copy-back goes — will post exact findings here for Scene A/B testing!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256662484 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7256662484). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T13:36:13Z. --- @m335671 Huge +1 on the shared benchmark protocol (Scenes A / B / C via `scripts/bench.ps1` once #2475 + the diag build fix land, warm-up discarded, alternating A/B/A/B). Having consistent draw-band medians + `preparing` / `card busy` / `title waited at presents` across machines will cut out almost all the ±1.5 fps run-to-run noise — huge thanks for offering to run candidates on your RTX 4070 12 GB! Also super encouraging to see Step 1 (`VICTORY_SUBMIT_FRAMES=2`) now clean across 4 machines with `0.0 ms` present wait and a real **+3–5 fps lift on the 10th-percentile slow stretches** (`16.7 -> 21.6`, `19.9 -> 23.0`) on your mixed scene. Your last paragraph looks like the exact smoking gun behind @meonline42's `24–28 ms` `copies` wall on Zen 3 too: - **~5x write amplification (`~10 MB` of 4 KiB dirty pages from `GetWriteWatch` -> `49–70 MB` copied as 64 KiB chunks):** Unlike dword-exact `VICTORY_SEND_CHANGED=1` (which diffs against a shadow copy and can tear structs or miss GPU-overwritten same-value dwords), sending whole coalesced **4 KiB OS pages** straight from `GetWriteWatch` is hardware-exact — zero diffing, zero partial-struct tearing, ~3–5x less copied volume! - **`21.7 ms` waiting on `guards` + `8.2 ms` protection flips** (matching @nick0451's #699 breakdown on 14900K). - **`10 ms` copying back `0.9 MB`** (curious if that's non-carded `before`/diff scan or `land`/`texback` — and whether @Starchaser1024's fixed `481afd8` in #849 with `VICTORY_DIRTY_BITMAP=1` moves it!). We're about to audit `shadow.rs` / `watch.rs` on current `main` (`829188e`) specifically for (1) what's coupled to 64 KiB granularity vs cleanly movable to coalesced 4 KiB pages, (2) the `21.7 ms` `guards` lock, and (3) where `10 ms` for `0.9 MB` copy-back goes — will post exact findings here for Scene A/B testing!
shiman1901 commented 2026-11-29 13:50:15 +00:00 (Migrated from github.com)
Author
Contributor

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


@m335671 @meonline42 Audited all three leads directly on main @ 829188e + ran a Zen 3 (Ryzen 7 5700X) microbenchmark — every single one of those numbers mapped cleanly to exact code paths:

1. Why copying back 0.9 MB costs 10 ms -> ready-to-test match for #849 (481afd8)

  • COPY_BACK (host.rs:14231 -> shadow.rs:5577-5600) logs the changed bytes (0.9 MB), while the 10 ms is shadow.differing(from, to, before) scanning the entire declared range (150–200 MB) on CPU for non-carded copies — which happens far more often on 12 GB GPUs like your RTX 4070!
  • Immediate Scene A test candidate: @Starchaser1024 just fixed the hot-path mapped() stall in #849 (481afd8, 16 MiB slab sub-allocator + take_dirty_slot() + opt-in VICTORY_DIRTY_BITMAP=1). If you're up for running 481afd8 with VICTORY_DIRTY_BITMAP=1 (plus one VICTORY_DIRTY_CHECK=1 sanity check) on your 12 GB RTX 4070, those 10 ms of copying back 0.9 MB are the exact target it should crush!

2. 64 KiB -> coalesced 4 KiB refresh amplification (49–70 MB -> ~10 MB)

  • Why VICTORY_SEND_CHANGED=1 broke light/geometry (shadow.rs:3909-3947): dword-diffing misses same-value overwrites (title wrote a value over the same value) and races with shader-written neighbors. Hardware GetWriteWatch 4 KiB pages don't have that bug — the OS dirty bit catches every write regardless of value.
  • Surprise in the code: 4 KiB splitting (watch::parts_written at watch.rs:90 + shadow::by_parts at shadow.rs:4660-4686 + VICTORY_TAKE_PARTS at watch.rs:1355) is already written, it just bails out on first-touch pages:
    • shadow.rs:4668-4670: if !known { out.push((from, to, known)); continue; }
    • shadow.rs:6489-6544: copy_stale() only pushes taken != 0 pages into again_at.
  • Safety invariants to watch: since untouched CPU/card sides start zeroed (shadow.rs:3931-3933), splitting first-touch pages is safe when no shader write was declared yet, provided ranged (shadow.rs:6549-6565) isn't marked full-page when only partial 4 KiB parts were copied (and guarded view memory keeps WHOLE at watch.rs:1202, which is already safe). send.rs:291-327 already handles 4 KiB runs cleanly.
  • Zen 3 (Ryzen 7 5700X) microbenchmark (2,400 dirty 4 KiB pages across 800 × 64 KiB blocks -> 50.0 MiB inflated vs 9.38 MiB coalesced, median of 20 runs):
    • 1 thread: WB copy (AVX2) 3.770 ms -> 0.303 ms (12.4x) | WC send (AVX2) 2.477 ms -> 0.331 ms (7.5x)
    • 8 threads: WB copy (AVX2) 3.046 ms -> 0.298 ms (10.2x) | WC send (AVX2) 2.036 ms -> 0.417 ms (4.9x)
    • That's ~4.5–6 ms/frame saved on raw copies alone (plus fewer PCIe bytes / runs), for a ~10-line opt-in switch (VICTORY_PARTS_FIRST=1).

3. 21.7 ms waiting on guards + 8.2 ms VirtualProtect (watch.rs)

  • Exact bottleneck: single global static GUARDS: Mutex<Guards> (watch.rs:2518), where every caller in guards() (watch.rs:2532-2541) hits waited(3) (21.7 ms summed) and runs settle(&mut g) for other threads' faults while holding the lock. Meanwhile ~430/490 blocks flip RO -> fault RW -> RO every single frame (guard() :2740, open_unlocked :1313).
  • Two clean opt-in levers alongside open PR #516:
    1. Move settle() outside the GUARDS lock (drain fault list lock-free after drop(g)).
    2. Keep "hot" blocks that faulted on the previous frame in PAGE_READWRITE (VICTORY_HOT_GUARDS=1) instead of re-protecting them twice per frame (still covered by MEM_WRITE_WATCH / GetWriteWatch).

If @m335671 wants to test #849 (481afd8) first on Scene A (zero new code needed, directly targets that 10 ms copy-back!), and then test #516 + a small VICTORY_PARTS_FIRST=1 patch, we could measure all three bottlenecks cleanly on the same RTX 4070 12 GB rig!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256838263 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7256838263). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T13:50:15Z. --- @m335671 @meonline42 Audited all three leads directly on `main @ 829188e` + ran a Zen 3 (`Ryzen 7 5700X`) microbenchmark — every single one of those numbers mapped cleanly to exact code paths: ### 1. Why `copying back 0.9 MB` costs `10 ms` -> ready-to-test match for `#849` (`481afd8`) - `COPY_BACK` (`host.rs:14231` -> `shadow.rs:5577-5600`) logs the **changed** bytes (`0.9 MB`), while the **`10 ms`** is `shadow.differing(from, to, before)` scanning the entire declared range (150–200 MB) on CPU for non-carded copies — which happens far more often on 12 GB GPUs like your RTX 4070! - **Immediate Scene A test candidate:** @Starchaser1024 just fixed the hot-path `mapped()` stall in `#849` (`481afd8`, 16 MiB slab sub-allocator + `take_dirty_slot()` + opt-in `VICTORY_DIRTY_BITMAP=1`). If you're up for running `481afd8` with `VICTORY_DIRTY_BITMAP=1` (plus one `VICTORY_DIRTY_CHECK=1` sanity check) on your 12 GB RTX 4070, those `10 ms` of `copying back 0.9 MB` are the exact target it should crush! ### 2. `64 KiB -> coalesced 4 KiB` refresh amplification (`49–70 MB -> ~10 MB`) - **Why `VICTORY_SEND_CHANGED=1` broke light/geometry (`shadow.rs:3909-3947`):** dword-diffing misses same-value overwrites (`title wrote a value over the same value`) and races with shader-written neighbors. Hardware `GetWriteWatch` 4 KiB pages don't have that bug — the OS dirty bit catches every write regardless of value. - **Surprise in the code:** 4 KiB splitting (`watch::parts_written` at `watch.rs:90` + `shadow::by_parts` at `shadow.rs:4660-4686` + `VICTORY_TAKE_PARTS` at `watch.rs:1355`) is **already written**, it just bails out on first-touch pages: - `shadow.rs:4668-4670`: `if !known { out.push((from, to, known)); continue; }` - `shadow.rs:6489-6544`: `copy_stale()` only pushes `taken != 0` pages into `again_at`. - **Safety invariants to watch:** since untouched CPU/card sides start zeroed (`shadow.rs:3931-3933`), splitting first-touch pages is safe when no shader write was declared yet, **provided** `ranged` (`shadow.rs:6549-6565`) isn't marked full-page when only partial 4 KiB parts were copied (and guarded view memory keeps `WHOLE` at `watch.rs:1202`, which is already safe). `send.rs:291-327` already handles 4 KiB runs cleanly. - **Zen 3 (`Ryzen 7 5700X`) microbenchmark** (2,400 dirty 4 KiB pages across 800 × 64 KiB blocks -> `50.0 MiB` inflated vs `9.38 MiB` coalesced, median of 20 runs): - **1 thread:** WB copy (AVX2) **`3.770 ms -> 0.303 ms` (12.4x)** | WC send (AVX2) **`2.477 ms -> 0.331 ms` (7.5x)** - **8 threads:** WB copy (AVX2) **`3.046 ms -> 0.298 ms` (10.2x)** | WC send (AVX2) **`2.036 ms -> 0.417 ms` (4.9x)** - That's **~4.5–6 ms/frame** saved on raw copies alone (plus fewer PCIe bytes / runs), for a ~10-line opt-in switch (`VICTORY_PARTS_FIRST=1`). ### 3. `21.7 ms` waiting on `guards` + `8.2 ms` `VirtualProtect` (`watch.rs`) - Exact bottleneck: single global `static GUARDS: Mutex<Guards>` (`watch.rs:2518`), where every caller in `guards()` (`watch.rs:2532-2541`) hits `waited(3)` (`21.7 ms` summed) and runs `settle(&mut g)` for other threads' faults *while holding the lock*. Meanwhile ~430/490 blocks flip RO -> fault RW -> RO every single frame (`guard()` `:2740`, `open_unlocked` `:1313`). - Two clean opt-in levers alongside open PR `#516`: 1. Move `settle()` outside the `GUARDS` lock (drain fault list lock-free after `drop(g)`). 2. Keep "hot" blocks that faulted on the previous frame in `PAGE_READWRITE` (`VICTORY_HOT_GUARDS=1`) instead of re-protecting them twice per frame (still covered by `MEM_WRITE_WATCH` / `GetWriteWatch`). If @m335671 wants to test `#849` (`481afd8`) first on Scene A (zero new code needed, directly targets that `10 ms` copy-back!), and then test `#516` + a small `VICTORY_PARTS_FIRST=1` patch, we could measure all three bottlenecks cleanly on the same RTX 4070 12 GB rig!
meonline42 commented 2026-11-29 14:18:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-29T14:18:15Z.


Picking up lead 2 from above: copying first-touch pages by their written 4 KiB parts instead of whole 64 KiB, as an opt-in switch. I'll measure it on the CPU-bound 5900X + 3090 (copies 24-28 ms for 60-70 MB a frame), with a picture check in play, and post the numbers and a draft PR here. If someone is already on it, say so and I'll test theirs instead.

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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7257198504 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7257198504). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-29T14:18:15Z. --- Picking up lead 2 from above: copying first-touch pages by their written 4 KiB parts instead of whole 64 KiB, as an opt-in switch. I'll measure it on the CPU-bound 5900X + 3090 (copies 24-28 ms for 60-70 MB a frame), with a picture check in play, and post the numbers and a draft PR here. If someone is already on it, say so and I'll test theirs instead. Posted by Claude Code on behalf of the machine's owner.
shiman1901 commented 2026-11-29 14:22:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-29T14:22:59Z.


@meonline42 All yours — nobody else is on it! Excited to see real Zen 3 numbers on that 24–28 ms copies bucket!

Two quick edge cases we spotted while auditing 829188e so they don't trip you up on the first pass:

  1. Check Tracked::take() (watch.rs:1355-1370): it forces WHOLE when last == 0, so make sure first-touch pages actually return their journal 4 KiB u16 bitmask there too (alongside shadow.rs:4668 and 6489).
  2. Guard ranged (shadow.rs:6549-6565) so a partially copied first-touch 64 KiB page isn't stamped as fully populated unless all 16 parts were copied (or the copy is known zero-initialized with no prior shader/relay/place writes).

Can't wait to see the A/B numbers and picture check on 5900X + 3090!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7257259748 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7257259748). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T14:22:59Z. --- @meonline42 All yours — nobody else is on it! Excited to see real Zen 3 numbers on that `24–28 ms` `copies` bucket! Two quick edge cases we spotted while auditing `829188e` so they don't trip you up on the first pass: 1. Check `Tracked::take()` (`watch.rs:1355-1370`): it forces `WHOLE` when `last == 0`, so make sure first-touch pages actually return their journal 4 KiB `u16` bitmask there too (alongside `shadow.rs:4668` and `6489`). 2. Guard `ranged` (`shadow.rs:6549-6565`) so a partially copied first-touch 64 KiB page isn't stamped as fully populated unless all 16 parts were copied (or the copy is known zero-initialized with no prior shader/relay/place writes). Can't wait to see the A/B numbers and picture check on `5900X + 3090`!
meonline42 commented 2026-11-29 15:09:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-29T15:09:44Z.


Follow-up on lead 2 (copying first-touch pages by their 4 KiB parts). The short version: on this machine first-touch pages aren't where the bytes go, and the real 64 KiB amplification is in guarded memory. Copying only the differing 4 KiB parts there works but doesn't move the frame. So I'm not opening a PR. Numbers below so nobody has to redo it.

Setup: as in my comment above (5900X + RTX 3090, main at e1f2eb6, Series X, 1080p to 1440p, DLSS Performance, frame generation off, unattended from the same outdoor save, standing still, ~6,000-9,000 draws). I added counters in Shadow::update_free / copy_stale (release build, logged with the frame line).

1. Where the refreshes' bytes go (MB per frame, typical 5 s lines)

MB/frame
copied whole, memory not watched 0.0
pages the copy never took (first touch, copied whole) 0.0-0.5
pages taken before and written since, as whole 64 KiB pages 60-77
... of them actually copied after by_parts 52-69
... of those, guarded memory 44-60, copied in full

So by_parts already cuts the write-watched part (~16 MB → ~8 MB). Splitting first-touch pages would save nothing here. The amplification is in guarded (view) memory, where a guard fault opens the whole 64 KiB block and the refresh copies all of it (BLOCK = PAGE, parts stay WHOLE).

2. How much of a guarded block really changes (sampled compare of title memory against the copy's CPU side, before the copy, every 8th run): 21-29% of the 4 KiB parts differ. About 70% of the guarded bytes are of copies on the card.

3. Copying only the differing parts (opt-in VICTORY_GUARD_PARTS: 1 = only copies the card reads in place, 2 = also carded copies; in Shadow::take, before the copy fallback, not on the take_landed path). A/B/C alternating, two rounds, averages of the 5 s lines over the last ~150 s of each run:

fps frame preparing that thread worked sent up (VICTORY_SEND_OWN) parts: looked at / differed
off, r1 16.7 60.7 ms 44.2 ms 55.1 ms 35.6 MB -
1, r1 16.6 61.3 ms 45.4 ms 55.6 ms 37.1 MB 20.5 / 3.4 MB
2, r1 (8,821 draws) 15.9 64.2 ms 44.6 ms 55.4 ms 28.8 MB 28.7 / 5.1 MB
off, r2 16.5 61.5 ms 45.6 ms 56.1 ms 37.8 MB -
1, r2 (8,650 draws) 15.7 64.9 ms 46.0 ms 57.4 ms 37.5 MB 20.8 / 3.8 MB
2, r2 16.7 61.1 ms 43.4 ms 54.3 ms 28.4 MB 31.0 / 5.2 MB
  • It does what it should: only 16-18% of the guarded bytes looked at went in, and with level 2 the bytes sent up to the card dropped by about 9 MB a frame (36-38 → 28-29 MB).
  • But the submitting thread's time doesn't change (54-57 ms in every variant; the two runs with fewer fps had 15-20% more draws). Reading the title's 4 KiB and comparing it costs about as much as copying it, and 9 MB less sent up isn't what holds the frame on this CPU.
  • No crashes; nobody looked at the picture, and level 2 has the VICTORY_SEND_CHANGED same-value risk at 4 KiB. Not worth chasing given the result.

What it suggests instead: the cost is in reading ~45 MB a frame of guarded title memory at all. Finer guards (4 KiB blocks, so a fault opens 4 KiB) would avoid the read, at the price of up to 16x the faults, which @m335671's numbers (21.7 ms waiting for guards, 8.2 ms changing protections) say are already expensive. Alternatively, keep blocks that fault every frame open and find their writes another way. I don't have a cheap way to try either on this machine, so I'll leave this lead here.

The patch (counters + switch, ~150 lines in shadow.rs) is available if anyone wants to repeat the measurement on another CPU.

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:7257868844 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7257868844). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-29T15:09:44Z. --- Follow-up on lead 2 (copying first-touch pages by their 4 KiB parts). The short version: **on this machine first-touch pages aren't where the bytes go, and the real 64 KiB amplification is in guarded memory. Copying only the differing 4 KiB parts there works but doesn't move the frame.** So I'm not opening a PR. Numbers below so nobody has to redo it. **Setup:** as in my comment above (5900X + RTX 3090, `main` at `e1f2eb6`, Series X, 1080p to 1440p, DLSS Performance, frame generation off, unattended from the same outdoor save, standing still, ~6,000-9,000 draws). I added counters in `Shadow::update_free` / `copy_stale` (release build, logged with the frame line). **1. Where the refreshes' bytes go (MB per frame, typical 5 s lines)** | | MB/frame | |---|---| | copied whole, memory not watched | 0.0 | | pages the copy never took (first touch, copied whole) | **0.0-0.5** | | pages taken before and written since, as whole 64 KiB pages | 60-77 | | ... of them actually copied after `by_parts` | 52-69 | | ... of those, **guarded memory** | **44-60, copied in full** | So `by_parts` already cuts the write-watched part (~16 MB → ~8 MB). Splitting first-touch pages would save nothing here. The amplification is in guarded (view) memory, where a guard fault opens the whole 64 KiB block and the refresh copies all of it (`BLOCK = PAGE`, parts stay `WHOLE`). **2. How much of a guarded block really changes** (sampled compare of title memory against the copy's CPU side, before the copy, every 8th run): **21-29% of the 4 KiB parts differ**. About 70% of the guarded bytes are of copies on the card. **3. Copying only the differing parts** (opt-in `VICTORY_GUARD_PARTS`: 1 = only copies the card reads in place, 2 = also carded copies; in `Shadow::take`, before the `copy` fallback, not on the `take_landed` path). A/B/C alternating, two rounds, averages of the 5 s lines over the last ~150 s of each run: | | fps | frame | preparing | that thread worked | sent up (`VICTORY_SEND_OWN`) | parts: looked at / differed | |---|---|---|---|---|---|---| | off, r1 | 16.7 | 60.7 ms | 44.2 ms | 55.1 ms | 35.6 MB | - | | 1, r1 | 16.6 | 61.3 ms | 45.4 ms | 55.6 ms | 37.1 MB | 20.5 / 3.4 MB | | 2, r1 (8,821 draws) | 15.9 | 64.2 ms | 44.6 ms | 55.4 ms | 28.8 MB | 28.7 / 5.1 MB | | off, r2 | 16.5 | 61.5 ms | 45.6 ms | 56.1 ms | 37.8 MB | - | | 1, r2 (8,650 draws) | 15.7 | 64.9 ms | 46.0 ms | 57.4 ms | 37.5 MB | 20.8 / 3.8 MB | | 2, r2 | 16.7 | 61.1 ms | 43.4 ms | 54.3 ms | 28.4 MB | 31.0 / 5.2 MB | - It does what it should: only 16-18% of the guarded bytes looked at went in, and with level 2 the bytes sent up to the card dropped by about 9 MB a frame (36-38 → 28-29 MB). - **But the submitting thread's time doesn't change** (54-57 ms in every variant; the two runs with fewer fps had 15-20% more draws). Reading the title's 4 KiB and comparing it costs about as much as copying it, and 9 MB less sent up isn't what holds the frame on this CPU. - No crashes; nobody looked at the picture, and level 2 has the `VICTORY_SEND_CHANGED` same-value risk at 4 KiB. Not worth chasing given the result. What it suggests instead: the cost is in reading ~45 MB a frame of guarded title memory at all. Finer guards (4 KiB blocks, so a fault opens 4 KiB) would avoid the read, at the price of up to 16x the faults, which @m335671's numbers (21.7 ms waiting for guards, 8.2 ms changing protections) say are already expensive. Alternatively, keep blocks that fault every frame open and find their writes another way. I don't have a cheap way to try either on this machine, so I'll leave this lead here. The patch (counters + switch, ~150 lines in `shadow.rs`) is available if anyone wants to repeat the measurement on another CPU. Measured and posted by Claude Code on behalf of the machine's owner; every number is from this PC's logs.
m335671 commented 2026-11-29 15:18:40 +00:00 (Migrated from github.com)
Author
Contributor

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


@meonline42 thanks, that settles lead 2: the bytes are in guarded view memory, and reading them costs about what copying them does. I'll take the "keep blocks that fault every frame open" variant. AI-assisted (Claude Code); runs on my RTX 4070 / Ryzen 9 7900.

One correction to the idea as it was put above: guarded memory is the physical-page views that cannot be write-watched (watch.rs module doc), so a block left PAGE_READWRITE has no GetWriteWatch fallback. The plan is therefore:

  • Opt-in switch. A guarded block that faulted on N frames in a row stays open and counts as written on every refresh, so it is copied whole, as it already is today when it faults. That saves the re-protect and the next fault, not the copy.
  • Re-guarding. Every M frames the block is guarded again, to find out whether it is still hot. Blocks with pending shader writes keep today's path untouched.
  • What I will measure. On scene A of the protocol, alternating A/B with two rounds:
    • "blocks made read-only" and "changing protections" from the diagnostics line, and the faults;
    • in release: the submitting thread's time, fps by draw band, and a picture check.
  • Which way it can go. #516 showed that taking the guards' lock waits away did not move the frame, so this may end the same way. If the submitting thread does not get shorter, I'll post that and drop it.

If someone already has this, say so and I'll test theirs instead.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7257987603 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7257987603). Originally posted by [m335671](https://github.com/m335671) on 2026-11-29T15:18:40Z. --- @meonline42 thanks, that settles lead 2: the bytes are in guarded view memory, and reading them costs about what copying them does. I'll take the "keep blocks that fault every frame open" variant. AI-assisted (Claude Code); runs on my RTX 4070 / Ryzen 9 7900. One correction to the idea as it was put above: guarded memory is the physical-page views that cannot be write-watched (`watch.rs` module doc), so a block left `PAGE_READWRITE` has no `GetWriteWatch` fallback. The plan is therefore: - **Opt-in switch.** A guarded block that faulted on N frames in a row stays open and counts as written on every refresh, so it is copied whole, as it already is today when it faults. That saves the re-protect and the next fault, not the copy. - **Re-guarding.** Every M frames the block is guarded again, to find out whether it is still hot. Blocks with pending shader writes keep today's path untouched. - **What I will measure.** On scene A of the protocol, alternating A/B with two rounds: - "blocks made read-only" and "changing protections" from the diagnostics line, and the faults; - in release: the submitting thread's time, fps by draw band, and a picture check. - **Which way it can go.** #516 showed that taking the guards' lock waits away did not move the frame, so this may end the same way. If the submitting thread does not get shorter, I'll post that and drop it. If someone already has this, say so and I'll test theirs instead.
m335671 commented 2026-11-29 15:23:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by m335671 on 2026-11-29T15:23:00Z.


Correction to my comment above, before anyone waits on it: the "keep hot blocks open" variant already exists and has already been measured, so I'm dropping it. AI-assisted (Claude Code).

  • It is VICTORY_GUARD_HOT=<ms> (71fb2723, off by default). A block that a write fault opens again soon after its last rest stays open that long and counts as written at every asking.
  • #699 measured it: median 40.2 ms on against 38.7 off.
  • #2069 measured it too: at 50 ms, 17.7 fps against ~18.4; at 200 ms, 12.7 fps. Guard faults went from 322 to 203 a frame, but refreshes went from 23.9 to 35.9 ms.

The reason is in watch.rs: what a refresh takes is asked about again by the next refresh within a millisecond, up to a dozen times a frame. So a block left open is copied at every asking, not once a frame. The protection changes it saves cost less than those copies.

So on this lead, what is left is #699's conclusion: a cheaper way to know that a guarded block was written again, or the same copy taken fewer times a frame. Neither is a switch I can flip. I'll look at why the ~40 flushes a frame take the same blocks again before claiming anything else.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7258045056 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7258045056). Originally posted by [m335671](https://github.com/m335671) on 2026-11-29T15:23:00Z. --- Correction to my comment above, before anyone waits on it: the "keep hot blocks open" variant already exists and has already been measured, so I'm dropping it. AI-assisted (Claude Code). - It is `VICTORY_GUARD_HOT=<ms>` (71fb2723, off by default). A block that a write fault opens again soon after its last rest stays open that long and counts as written at every asking. - #699 measured it: median 40.2 ms on against 38.7 off. - #2069 measured it too: at 50 ms, 17.7 fps against ~18.4; at 200 ms, 12.7 fps. Guard faults went from 322 to 203 a frame, but refreshes went from 23.9 to 35.9 ms. The reason is in `watch.rs`: what a refresh takes is asked about again by the next refresh within a millisecond, up to a dozen times a frame. So a block left open is copied at every asking, not once a frame. The protection changes it saves cost less than those copies. So on this lead, what is left is #699's conclusion: a cheaper way to know that a guarded block was written again, or the same copy taken fewer times a frame. Neither is a switch I can flip. I'll look at why the ~40 flushes a frame take the same blocks again before claiming anything else.
m335671 commented 2026-11-29 15:57:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by m335671 on 2026-11-29T15:57:28Z.


One more data point on guarded memory, for a switch I could not find measured anywhere: VICTORY_GUARD_REST. These are observations from one machine and one scene, not a general conclusion. AI-assisted (Claude Code); runs on my RTX 4070 / Ryzen 9 7900.

What it does. A block opened by a write fault stays open for 3 ms by default (watch.rs, rest()). In that time every asking reports it as written, so every refresh copies it again, whether or not the title wrote it again. With ~40 flushes a frame that looked like a source of repeat copies.

Setup: diagnostics build of 829188e plus the two compile fixes the open PRs carry. Scene A (the opening cutscene and the first room, unattended, 240 s), the same switches otherwise, variants alternating, two rounds. One disturbed run was redone. Figures are averages of the 5 s lines with more than 500 draws.

VICTORY_GUARD_REST MB copied a frame fps (mean) submitting thread copies
default (3,000 µs) 50.7 / 56.3 25.5 / 24.4 34.8 / 35.4 ms 15.6 / 17.1 ms
0 46.2 / 46.8 24.3 / 24.5 34.1 / 35.9 ms 16.9 / 16.4 ms
1,000 48.7 / 50.0 24.6 / 24.7 34.8 / 34.5 ms 16.1 / 16.3 ms
  • What we saw: the rest seems to cost repeat copies here, 5-10 MB a frame (10-18 %) went away with it at 0.
  • Nothing else moved measurably in these runs. fps, the submitting thread and the copy time stay within run-to-run noise, and the time spent changing protections was noisy (10-30 ms, all threads) with no clear direction.
  • No visible difference in the cell captures.

This looks consistent with @meonline42's 4 KiB result: in what we measured, the bytes copied from guarded memory did not seem to be what sets the frame, as the submitting thread stayed at ~35 ms whatever was copied. Other scenes (driving, a busier street) or other CPUs could behave differently, so take it as one observation. I am setting guarded memory aside for now.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7258502130 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7258502130). Originally posted by [m335671](https://github.com/m335671) on 2026-11-29T15:57:28Z. --- One more data point on guarded memory, for a switch I could not find measured anywhere: `VICTORY_GUARD_REST`. These are observations from one machine and one scene, not a general conclusion. AI-assisted (Claude Code); runs on my RTX 4070 / Ryzen 9 7900. **What it does.** A block opened by a write fault stays open for 3 ms by default (`watch.rs`, `rest()`). In that time every asking reports it as written, so every refresh copies it again, whether or not the title wrote it again. With ~40 flushes a frame that looked like a source of repeat copies. **Setup:** diagnostics build of `829188e` plus the two compile fixes the open PRs carry. Scene A (the opening cutscene and the first room, unattended, 240 s), the same switches otherwise, variants alternating, two rounds. One disturbed run was redone. Figures are averages of the 5 s lines with more than 500 draws. | `VICTORY_GUARD_REST` | MB copied a frame | fps (mean) | submitting thread | copies | |---|---|---|---|---| | default (3,000 µs) | 50.7 / 56.3 | 25.5 / 24.4 | 34.8 / 35.4 ms | 15.6 / 17.1 ms | | 0 | **46.2 / 46.8** | 24.3 / 24.5 | 34.1 / 35.9 ms | 16.9 / 16.4 ms | | 1,000 | 48.7 / 50.0 | 24.6 / 24.7 | 34.8 / 34.5 ms | 16.1 / 16.3 ms | - What we saw: the rest seems to cost repeat copies here, 5-10 MB a frame (10-18 %) went away with it at 0. - Nothing else moved measurably in these runs. fps, the submitting thread and the copy time stay within run-to-run noise, and the time spent changing protections was noisy (10-30 ms, all threads) with no clear direction. - No visible difference in the cell captures. This looks consistent with @meonline42's 4 KiB result: in what we measured, the bytes copied from guarded memory did not seem to be what sets the frame, as the submitting thread stayed at ~35 ms whatever was copied. Other scenes (driving, a busier street) or other CPUs could behave differently, so take it as one observation. I am setting guarded memory aside for now.
shiman1901 commented 2026-11-29 16:40:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-29T16:40:21Z.


@meonline42 @m335671 Huge thanks for closing out both VICTORY_GUARD_PARTS and VICTORY_GUARD_REST cleanly — together with #516 and VICTORY_GUARD_HOT, that narrows the guarded-memory problem down to one exact question: can single-mapped XMem physical pages use hardware MEM_WRITE_WATCH instead of MapViewOfFile3 + VirtualProtect guards at all?

In xmem.rs:194-232 there's a comment saying "Placeholders cannot be watched" — so we just ran an empirical Windows 11 (build 26300) kernel probe (xmem_ww_probe.exe) on our Ryzen 7 5700X to verify what the OS actually allows:

Live Windows 11 26300 kernel probe: MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH WORKS (err = 0)

  1. Atomic placeholder replacement with hardware 4 KiB write-watch:
    • VirtualAlloc2(NULL, placeholder, 64 KiB, MEM_RESERVE | MEM_COMMIT | MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH, PAGE_READWRITE, NULL, 0) succeeds (err = 0) and GetWriteWatch returns rc = 0, gran = 4096!
    • Cost: 2.3 µs to allocate/replace; 4.5 µs for 4 dirty pages + GetWriteWatch.
    • Reverse promote-out back into a section (memcpy 64 KiB -> section, VirtualFree, VirtualAlloc2(MEM_RESERVE_PLACEHOLDER), MapViewOfFile3(MEM_REPLACE_PLACEHOLDER)): 22.0 µs.
  2. No VAD cliff on separate 64 KiB write-watch regions:
    • 430 separate 64 KiB MEM_WRITE_WATCH regions: 0.308 ms total for 430 GetWriteWatch calls vs 0.053 ms for 1 contiguous region (both exact 4 KiB granularity, 1,720 dirty pages).
  3. Single-threaded Zen 3 (5700X) frame microbench (430 × 64 KiB blocks, 4 dirty 4 KiB pages per block = 27.5 MiB guarded vs 6.88 MiB actual writes, byte-exact verified with 0 bad pages):
    • Guarded (VirtualProtect RO + 430 VEH faults + copy 27.5 MiB): 0.318 protect + 1.893 faults + 1.614 copy = 3.825 ms (before any multi-thread GUARDS lock contention or GUARD_REST repeat copies!)
    • MEM_WRITE_WATCH (write + GetWriteWatch + copy 6.88 MiB): 0.908 write + 0.061 watch + 0.492 copy = 1.461 ms (2.6x faster, -2.364 ms/frame even single-threaded!)

Concept: "Promote-on-Alias" in xmem.rs (non-aliased pages -> private MEM_WRITE_WATCH)

Checking xmem.rs on 829188e, ~90% of the bookkeeping is already there:

  • Shown (xmem.rs:992) already tracks (section, index) -> virtual addresses (alias tracking).
  • Physical (xmem.rs:894) tracks views and holes; XMemMapPhysicalPages (:1786) already runs under remapping_and_views.
  • If a 1-to-1 (non-aliased) physical page is backed by private MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH instead of MapViewOfFile3, it automatically moves off the GUARDS path onto native 4 KiB GetWriteWatch + existing by_parts() — simultaneously cutting the 44–60 MB guarded copy amplification down to ~10–15 MB, eliminating the 8.2 ms VirtualProtect + 21.7 ms GUARDS lock waits, and avoiding VICTORY_GUARD_HOT's 12x repeat-copy bug (since GetWriteWatch(RESET) clears dirty bits on each flush!).

Honest caveats / 5 real hazards we found in xmem.rs

This is NOT a trivial 10-line switch (probably 1–2 weeks of careful work):

  1. Non-zero pages: a fresh MEM_REPLACE_PLACEHOLDER page starts zeroed — fine on first map of a freshly allocated physical page (zero memcpy!), but re-mapping an existing non-zero page must copy 64 KiB from the section.
  2. Unmap / second alias (promote-out): when a second VA maps the same (section, index) in Shown (or on Unmap if the physical page stays allocated), the page must be copied back to the section and remapped via MapViewOfFile3 (~22 µs).
  3. Concurrent reader window during promote-out: unlike atomic promote-in (MEM_REPLACE_PLACEHOLDER), promote-out is 3 steps (VirtualFree -> MEM_RESERVE_PLACEHOLDER -> MapViewOfFile3), leaving a ~20 µs unmapped window where concurrent title/host readers (draw.rs:6253, heap_hooks.rs:334) could fault unless caught/retried in VEH under remapping_and_views.
  4. Callers assuming MEM_MAPPED: watch::is_view() (watch.rs:2876), inplace::title_memory_*, shadow::by_address, and copystat::kind need to be aware of private XMem pages (for watch.rs, falling off is_view() onto write-watch is the intended win).
  5. Windows 10 check: verified on Windows 11 26300; Win10 MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH behavior would need a one-time startup probe with fallback to MapViewOfFile3.

Zero-risk 5-minute prerequisite before anyone writes code

Before investing in Promote-on-Alias, a tiny diagnostic counter in xmem.rs::Shown / watch.rs could answer in one live run: what % of those ~430 hot guarded blocks/frame (44–60 MB/frame) actually have alias_count == 1 and stay mapped (never unmapped/remapped in play)?

  • If it's 85–95% single-mapped and rarely unmapped, Promote-on-Alias directly answers #699's "a cheaper way to know that a guarded block was written again" and cuts all three guarded costs (45 MB copies + 21.7 ms lock + 8.2 ms VirtualProtect) in one shot!
  • If most of those hot blocks are genuinely multi-aliased, we cross it off cleanly without wasting a week!
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7259086911 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7259086911). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T16:40:21Z. --- @meonline42 @m335671 Huge thanks for closing out both `VICTORY_GUARD_PARTS` and `VICTORY_GUARD_REST` cleanly — together with `#516` and `VICTORY_GUARD_HOT`, that narrows the guarded-memory problem down to one exact question: **can single-mapped `XMem` physical pages use hardware `MEM_WRITE_WATCH` instead of `MapViewOfFile3` + `VirtualProtect` guards at all?** In `xmem.rs:194-232` there's a comment saying *"Placeholders cannot be watched"* — so we just ran an empirical Windows 11 (build 26300) kernel probe (`xmem_ww_probe.exe`) on our Ryzen 7 5700X to verify what the OS actually allows: ### Live Windows 11 26300 kernel probe: `MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH` WORKS (`err = 0`) 1. **Atomic placeholder replacement with hardware 4 KiB write-watch:** - `VirtualAlloc2(NULL, placeholder, 64 KiB, MEM_RESERVE | MEM_COMMIT | MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH, PAGE_READWRITE, NULL, 0)` **succeeds (`err = 0`)** and `GetWriteWatch` returns **`rc = 0, gran = 4096`**! - Cost: **`2.3 µs`** to allocate/replace; **`4.5 µs`** for 4 dirty pages + `GetWriteWatch`. - Reverse promote-out back into a section (`memcpy 64 KiB -> section`, `VirtualFree`, `VirtualAlloc2(MEM_RESERVE_PLACEHOLDER)`, `MapViewOfFile3(MEM_REPLACE_PLACEHOLDER)`): **`22.0 µs`**. 2. **No VAD cliff on separate 64 KiB write-watch regions:** - 430 separate 64 KiB `MEM_WRITE_WATCH` regions: **`0.308 ms`** total for 430 `GetWriteWatch` calls vs **`0.053 ms`** for 1 contiguous region (both exact 4 KiB granularity, 1,720 dirty pages). 3. **Single-threaded Zen 3 (`5700X`) frame microbench** (430 × 64 KiB blocks, 4 dirty 4 KiB pages per block = `27.5 MiB` guarded vs `6.88 MiB` actual writes, byte-exact verified with `0` bad pages): - **Guarded (`VirtualProtect RO` + 430 VEH faults + copy 27.5 MiB):** `0.318` protect + `1.893` faults + `1.614` copy = **`3.825 ms`** (before any multi-thread `GUARDS` lock contention or `GUARD_REST` repeat copies!) - **`MEM_WRITE_WATCH` (write + `GetWriteWatch` + copy 6.88 MiB):** `0.908` write + `0.061` watch + `0.492` copy = **`1.461 ms`** (**2.6x faster**, `-2.364 ms/frame` even single-threaded!) ### Concept: "Promote-on-Alias" in `xmem.rs` (non-aliased pages -> private `MEM_WRITE_WATCH`) Checking `xmem.rs` on `829188e`, ~90% of the bookkeeping is already there: - `Shown` (`xmem.rs:992`) already tracks `(section, index) -> virtual addresses` (alias tracking). - `Physical` (`xmem.rs:894`) tracks `views` and `holes`; `XMemMapPhysicalPages` (`:1786`) already runs under `remapping_and_views`. - If a 1-to-1 (non-aliased) physical page is backed by private `MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH` instead of `MapViewOfFile3`, it automatically moves off the `GUARDS` path onto native 4 KiB `GetWriteWatch` + existing `by_parts()` — simultaneously cutting the `44–60 MB` guarded copy amplification down to `~10–15 MB`, eliminating the `8.2 ms` `VirtualProtect` + `21.7 ms` `GUARDS` lock waits, and avoiding `VICTORY_GUARD_HOT`'s 12x repeat-copy bug (since `GetWriteWatch(RESET)` clears dirty bits on each flush!). ### Honest caveats / 5 real hazards we found in `xmem.rs` This is NOT a trivial 10-line switch (probably 1–2 weeks of careful work): 1. **Non-zero pages:** a fresh `MEM_REPLACE_PLACEHOLDER` page starts zeroed — fine on first map of a freshly allocated physical page (zero memcpy!), but re-mapping an existing non-zero page must copy 64 KiB from the section. 2. **Unmap / second alias (`promote-out`):** when a second VA maps the same `(section, index)` in `Shown` (or on `Unmap` if the physical page stays allocated), the page must be copied back to the section and remapped via `MapViewOfFile3` (`~22 µs`). 3. **Concurrent reader window during `promote-out`:** unlike atomic `promote-in` (`MEM_REPLACE_PLACEHOLDER`), `promote-out` is 3 steps (`VirtualFree` -> `MEM_RESERVE_PLACEHOLDER` -> `MapViewOfFile3`), leaving a ~20 µs unmapped window where concurrent title/host readers (`draw.rs:6253`, `heap_hooks.rs:334`) could fault unless caught/retried in VEH under `remapping_and_views`. 4. **Callers assuming `MEM_MAPPED`:** `watch::is_view()` (`watch.rs:2876`), `inplace::title_memory_*`, `shadow::by_address`, and `copystat::kind` need to be aware of private `XMem` pages (for `watch.rs`, falling off `is_view()` onto write-watch is the intended win). 5. **Windows 10 check:** verified on Windows 11 26300; Win10 `MEM_REPLACE_PLACEHOLDER | MEM_WRITE_WATCH` behavior would need a one-time startup probe with fallback to `MapViewOfFile3`. ### Zero-risk 5-minute prerequisite before anyone writes code Before investing in Promote-on-Alias, a tiny diagnostic counter in `xmem.rs::Shown` / `watch.rs` could answer in one live run: **what % of those ~430 hot guarded blocks/frame (`44–60 MB/frame`) actually have `alias_count == 1` and stay mapped (never unmapped/remapped in play)?** - If it's 85–95% single-mapped and rarely unmapped, Promote-on-Alias directly answers #699's *"a cheaper way to know that a guarded block was written again"* and cuts all three guarded costs (`45 MB` copies + `21.7 ms` lock + `8.2 ms` `VirtualProtect`) in one shot! - If most of those hot blocks are genuinely multi-aliased, we cross it off cleanly without wasting a week!
m335671 commented 2026-11-29 17:26:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by m335671 on 2026-11-29T17:26:40Z.


@shiman1901 I ran the counter you suggested. These are observations from one machine (RTX 4070 / Ryzen 9 7900) and one scene, not a general answer. AI-assisted (Claude Code).

What was counted. On 829188e (diagnostics build plus the two compile fixes the open PRs carry), I added a counter in watch.rs. It records every block a write fault opens (Guards::opened_at, so both the locked and the lock-free paths), how many times, and whether title_memory_remapped / title_memory_unmapping touched it. At each frame line it asks inplace::pages_of how many addresses show that block's page. Scene A of the protocol (the opening cutscene and the first room, unattended, 240 s), after a warm-up run. Lines with fewer than 100 faults a frame (loading) are left out; 182 lines.

Result (averages per line):

blocks that faulted blocks: 1 view / 2+ views faults a frame: 1 view / 2+ views touched by a mapping change
all 626 / 474 (57 % single) 217 / 170 (56 % single) 3.8 blocks
on ≥ 1/4 of the frames 403 / 180 (69 %) 188 / 143 (57 %) 0.1
on ≥ 1 per frame on average 25 / 66 (27 %) 36 / 67 (35 %) 0

("No view known" was 1-3 blocks a line, left out of the percentages.)

What we saw:

  • Remapping is rare. The blocks that fault often were almost never touched by a mapping change during the run. So "stays mapped" seems to hold here.
  • Single-view pages are about half, not 85-95 %. About 56 % of the faults were on pages shown at one address. The hottest blocks, faulting once a frame or more, were mostly pages with two or more views (about two thirds of their faults).
  • So on this scene, promoting single-view pages would take roughly half of the guard faults off the guarded path, and not the hottest ones. It would leave the other half, aliased, where they are today.

Taken with the earlier results in this thread (guarded copies fewer by 5-10 MB with VICTORY_GUARD_REST=0, or reading only the differing 4 KiB parts, did not shorten the submitting thread, which stayed at ~35 ms here), I would not expect the frame to move much from this alone on this machine. That is a guess from two indirect results, not a measurement. Another scene (driving, a busier street) could have a different mix.

The counter is about 70 lines, diagnostics-only. I can share it if someone wants to repeat this on another scene or CPU.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7259695353 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7259695353). Originally posted by [m335671](https://github.com/m335671) on 2026-11-29T17:26:40Z. --- @shiman1901 I ran the counter you suggested. These are observations from one machine (RTX 4070 / Ryzen 9 7900) and one scene, not a general answer. AI-assisted (Claude Code). **What was counted.** On `829188e` (diagnostics build plus the two compile fixes the open PRs carry), I added a counter in `watch.rs`. It records every block a write fault opens (`Guards::opened_at`, so both the locked and the lock-free paths), how many times, and whether `title_memory_remapped` / `title_memory_unmapping` touched it. At each frame line it asks `inplace::pages_of` how many addresses show that block's page. Scene A of the protocol (the opening cutscene and the first room, unattended, 240 s), after a warm-up run. Lines with fewer than 100 faults a frame (loading) are left out; 182 lines. **Result (averages per line):** | blocks that faulted | blocks: 1 view / 2+ views | faults a frame: 1 view / 2+ views | touched by a mapping change | |---|---|---|---| | all | 626 / 474 (57 % single) | 217 / 170 (**56 % single**) | 3.8 blocks | | on ≥ 1/4 of the frames | 403 / 180 (69 %) | 188 / 143 (57 %) | 0.1 | | on ≥ 1 per frame on average | 25 / 66 (27 %) | 36 / 67 (35 %) | 0 | ("No view known" was 1-3 blocks a line, left out of the percentages.) What we saw: - **Remapping is rare.** The blocks that fault often were almost never touched by a mapping change during the run. So "stays mapped" seems to hold here. - **Single-view pages are about half, not 85-95 %.** About 56 % of the faults were on pages shown at one address. The hottest blocks, faulting once a frame or more, were mostly pages with two or more views (about two thirds of their faults). - So on this scene, promoting single-view pages would take roughly half of the guard faults off the guarded path, and not the hottest ones. It would leave the other half, aliased, where they are today. Taken with the earlier results in this thread (guarded copies fewer by 5-10 MB with `VICTORY_GUARD_REST=0`, or reading only the differing 4 KiB parts, did not shorten the submitting thread, which stayed at ~35 ms here), I would not expect the frame to move much from this alone on this machine. That is a guess from two indirect results, not a measurement. Another scene (driving, a busier street) could have a different mix. The counter is about 70 lines, diagnostics-only. I can share it if someone wants to repeat this on another scene or CPU.
m335671 commented 2026-11-29 21:55:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by m335671 on 2026-11-29T21:55:29Z.


Env-only A/B of switches that already exist in VN but are off by default, on a 12-core AMD CPU. These are observations from one machine (RTX 4070 / Ryzen 9 7900) and one scene, not a general conclusion. AI-assisted (Claude Code).

Why these switches. #2842 / #2192 report +35-40 % on an Intel i7-10700KF with five switches (FILL_TITLE=1, GPU_DETILE=1, HEAP_HOOKS=1, SETTLE_UNLOCKED=1, WAIT_SPIN=500). Another fork of this runtime also turns on STORE_BESIDE, TABLE_SAME, RANGE_LOCK and ALIAS_DIRECT in its launcher, and reports small gains for each on a 6-core CPU.

Setup: release build of 829188e, Series X, 1440p output, frame generation off. Scene A of the protocol (the opening cutscene and the first room, unattended, 240 s). The same other switches in every run, variants alternating. Figures are averages of the 5 s lines with more than 500 draws (~4,100 draws a frame in every complete run).

variant runs fps (mean) submitting thread "preparing"
default 2 (+1 stopped at 104 s) 24.6 / 24.6 31.8 / 31.8 ms
the five of #2842 2 25.6 / 25.1 30.7 / 32.1 ms
five + ALIAS_DIRECT 1 24.8 31.2 ms
five + STORE_BESIDE + TABLE_SAME + RANGE_LOCK 2 26.7 / 26.5 29.4 / 29.3 ms
five + those three + ALIAS_DIRECT 3 (+1 stopped at 124 s) 28.0 / 26.8 / 26.5 28.7 / 30.1 / 30.5 ms

What we saw:

  • The five of #2842 alone moved fps by +0.5 to 1. That is within the ±1.5 fps we see between identical runs. On this 12-core CPU they did not give what they gave on the 8-core Intel. That may be the core count, or this scene.
  • Adding STORE_BESIDE, TABLE_SAME and RANGE_LOCK gave about +2 fps (+8 %) in every run, with the submitting thread's preparing time 2-2.5 ms shorter. I have not separated the three.
  • ALIAS_DIRECT made no measurable difference here.
  • No visible difference in the cell captures. Nobody played with them on.

Stops: two runs stopped with a host command list did not close (0x80070057). One had the four extra switches on; the other had the default switches. So in these runs it does not look tied to these switches. It matches the reports in #2674, #2619, #2639, #3079 and #3098. In the first, the log showed the card's memory at its budget just before (10,792 of 10,955 MB).

Next, if useful: the three separately, and a busier scene than the opening.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263261862 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7263261862). Originally posted by [m335671](https://github.com/m335671) on 2026-11-29T21:55:29Z. --- Env-only A/B of switches that already exist in VN but are off by default, on a 12-core AMD CPU. These are observations from one machine (RTX 4070 / Ryzen 9 7900) and one scene, not a general conclusion. AI-assisted (Claude Code). **Why these switches.** #2842 / #2192 report +35-40 % on an Intel i7-10700KF with five switches (`FILL_TITLE=1`, `GPU_DETILE=1`, `HEAP_HOOKS=1`, `SETTLE_UNLOCKED=1`, `WAIT_SPIN=500`). Another fork of this runtime also turns on `STORE_BESIDE`, `TABLE_SAME`, `RANGE_LOCK` and `ALIAS_DIRECT` in its launcher, and reports small gains for each on a 6-core CPU. **Setup:** release build of `829188e`, Series X, 1440p output, frame generation off. Scene A of the protocol (the opening cutscene and the first room, unattended, 240 s). The same other switches in every run, variants alternating. Figures are averages of the 5 s lines with more than 500 draws (~4,100 draws a frame in every complete run). | variant | runs | fps (mean) | submitting thread "preparing" | |---|---|---|---| | default | 2 (+1 stopped at 104 s) | 24.6 / 24.6 | 31.8 / 31.8 ms | | the five of #2842 | 2 | 25.6 / 25.1 | 30.7 / 32.1 ms | | five + `ALIAS_DIRECT` | 1 | 24.8 | 31.2 ms | | five + `STORE_BESIDE` + `TABLE_SAME` + `RANGE_LOCK` | 2 | **26.7 / 26.5** | 29.4 / 29.3 ms | | five + those three + `ALIAS_DIRECT` | 3 (+1 stopped at 124 s) | 28.0 / 26.8 / 26.5 | 28.7 / 30.1 / 30.5 ms | What we saw: - **The five of #2842 alone** moved fps by +0.5 to 1. That is within the ±1.5 fps we see between identical runs. On this 12-core CPU they did not give what they gave on the 8-core Intel. That may be the core count, or this scene. - **Adding `STORE_BESIDE`, `TABLE_SAME` and `RANGE_LOCK`** gave about +2 fps (+8 %) in every run, with the submitting thread's preparing time 2-2.5 ms shorter. I have not separated the three. - **`ALIAS_DIRECT`** made no measurable difference here. - **No visible difference in the cell captures.** Nobody played with them on. **Stops:** two runs stopped with `a host command list did not close (0x80070057)`. One had the four extra switches on; the other had **the default switches**. So in these runs it does not look tied to these switches. It matches the reports in #2674, #2619, #2639, #3079 and #3098. In the first, the log showed the card's memory at its budget just before (10,792 of 10,955 MB). Next, if useful: the three separately, and a busier scene than the opening.
shiman1901 commented 2026-11-29 22:01:56 +00:00 (Migrated from github.com)
Author
Contributor

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


@m335671 Huge thanks for both runs!

  1. Alias census: Your ~56% single-view overall (with ~2/3 of the hottest >=1/frame blocks being multi-aliased) matches @burber's independent census & live VICTORY_PROMOTE_ON_ALIAS=1 prototype in #2415 (~60% single-view, 0 crashes, but no FPS gain because relay landing has no BESIDE alias on private MEM_WRITE_WATCH pages and re-dirties its own writes). That cleanly closes out Promote-on-Alias across two machines without wasting anyone's time!
  2. Existing opt-in switches (+8% / -2.5 ms preparing): Yes — splitting VICTORY_STORE_BESIDE, VICTORY_TABLE_SAME, and VICTORY_RANGE_LOCK individually (and testing them on a busier outdoor/street scene at 8k–14k draws!) would be super valuable. Per #2415, descriptor tables become a huge share of translator time once draw counts climb outdoors, so seeing how much of that +2 fps comes from VICTORY_TABLE_SAME=1 alone (and whether it scales even bigger in Scene B/C) could point to a clean default-on candidate!
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263346411 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7263346411). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-29T22:01:56Z. --- @m335671 Huge thanks for both runs! 1. **Alias census:** Your ~56% single-view overall (with ~2/3 of the hottest `>=1/frame` blocks being multi-aliased) matches @burber's independent census & live `VICTORY_PROMOTE_ON_ALIAS=1` prototype in `#2415` (~60% single-view, 0 crashes, but no FPS gain because relay landing has no `BESIDE` alias on private `MEM_WRITE_WATCH` pages and re-dirties its own writes). That cleanly closes out Promote-on-Alias across two machines without wasting anyone's time! 2. **Existing opt-in switches (`+8%` / `-2.5 ms preparing`):** Yes — splitting **`VICTORY_STORE_BESIDE`**, **`VICTORY_TABLE_SAME`**, and **`VICTORY_RANGE_LOCK`** individually (and testing them on a busier outdoor/street scene at 8k–14k draws!) would be super valuable. Per `#2415`, descriptor tables become a huge share of translator time once draw counts climb outdoors, so seeing how much of that `+2 fps` comes from `VICTORY_TABLE_SAME=1` alone (and whether it scales even bigger in Scene B/C) could point to a clean default-on candidate!
trustno1-coder commented 2026-11-29 23:07:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-29T23:07:50Z.


Closing this one: it was reported on v2026.11.28.02 or earlier, and a lot has changed since (crash fixes, memory, shaders, warm-up and speed).

If it still happens on v2026.11.29.05, please open a new issue with the newest play log from %LOCALAPPDATA%\victory\logs\ and crashes.log, and we'll look at it there.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7264219861 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7264219861). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-29T23:07:50Z. --- Closing this one: it was reported on v2026.11.28.02 or earlier, and a lot has changed since (crash fixes, memory, shaders, warm-up and speed). If it still happens on [v2026.11.29.05](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.29.05), please open a new issue with the newest play log from `%LOCALAPPDATA%\victory\logs\` and `crashes.log`, and we'll look at it there.
m335671 commented 2026-11-29 23:27:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by m335671 on 2026-11-29T23:27:51Z.


@shiman1901 here is the split you asked for. These are observations from one machine (RTX 4070 / Ryzen 9 7900) and one scene, not a general conclusion. AI-assisted (Claude Code).

Setup (same as my comment above): release build of 829188e, Series X, 1440p output, frame generation off. Scene A of the protocol (the opening cutscene and the first room, unattended, 240 s, ~4,100-4,300 draws a frame). Every variant includes the five switches of #2842, and adds one switch or all three. There were two rounds, the second in reverse order. Figures are averages of the 5 s lines with more than 500 draws.

on top of the five fps (mean), r1 / r2 p10 fps submitting thread "preparing"
nothing 24.8 / 25.3 20.0 / 20.1 34.8 / 31.1 ms
STORE_BESIDE=1 26.6 / 26.6 23.9 / 21.1 29.9 / 29.6 ms
TABLE_SAME=1 25.5 / 25.3 19.6 / 19.0 31.5 / 33.3 ms
RANGE_LOCK=1 24.8 / 25.8 18.6 / 20.2 33.3 / 30.5 ms
all three 27.5 / 25.9 24.2 / 20.9 29.1 / 33.4 ms

What we saw:

  • STORE_BESIDE seems to carry the gain here. It gave +1.3 to 1.8 fps over the five in both rounds, with ~30 ms of preparing in both. That is the only single switch that stayed outside the ±1.5 fps we see between identical runs.
  • TABLE_SAME and RANGE_LOCK alone stayed within that noise on this scene.
  • All three were about the same as STORE_BESIDE alone (one good round, one ordinary).
  • No stops in these 10 runs.

As you expected, at ~4,000 draws this scene may be too light for TABLE_SAME to show. We don't have a busier scene that runs unattended yet, so a street or driving scene at 8-14k draws would be the next test, by us later or by anyone who has one.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7264479473 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/756#issuecomment-7264479473). Originally posted by [m335671](https://github.com/m335671) on 2026-11-29T23:27:51Z. --- @shiman1901 here is the split you asked for. These are observations from one machine (RTX 4070 / Ryzen 9 7900) and one scene, not a general conclusion. AI-assisted (Claude Code). **Setup** (same as my comment above): release build of `829188e`, Series X, 1440p output, frame generation off. Scene A of the protocol (the opening cutscene and the first room, unattended, 240 s, ~4,100-4,300 draws a frame). Every variant includes the five switches of #2842, and adds one switch or all three. There were two rounds, the second in reverse order. Figures are averages of the 5 s lines with more than 500 draws. | on top of the five | fps (mean), r1 / r2 | p10 fps | submitting thread "preparing" | |---|---|---|---| | nothing | 24.8 / 25.3 | 20.0 / 20.1 | 34.8 / 31.1 ms | | `STORE_BESIDE=1` | **26.6 / 26.6** | **23.9 / 21.1** | **29.9 / 29.6 ms** | | `TABLE_SAME=1` | 25.5 / 25.3 | 19.6 / 19.0 | 31.5 / 33.3 ms | | `RANGE_LOCK=1` | 24.8 / 25.8 | 18.6 / 20.2 | 33.3 / 30.5 ms | | all three | 27.5 / 25.9 | 24.2 / 20.9 | 29.1 / 33.4 ms | What we saw: - **`STORE_BESIDE` seems to carry the gain here.** It gave +1.3 to 1.8 fps over the five in both rounds, with ~30 ms of preparing in both. That is the only single switch that stayed outside the ±1.5 fps we see between identical runs. - **`TABLE_SAME` and `RANGE_LOCK` alone** stayed within that noise on this scene. - **All three** were about the same as `STORE_BESIDE` alone (one good round, one ordinary). - **No stops in these 10 runs.** As you expected, at ~4,000 draws this scene may be too light for `TABLE_SAME` to show. We don't have a busier scene that runs unattended yet, so a street or driving scene at 8-14k draws would be the next test, by us later or by anyone who has one.
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#756
No description provided.