VICTORY_WC_BAR=runs: write only the dwords the title changed into the mapped copy (fixes the #553 flicker) #1927

Open
github-bot wants to merge 1 commit from github-bot/gh-1927 into main AGit
Owner

@⁠vdkipnis on GitHub · 2026-11-29 03:07 UTC · original
vdkipnis:wc-bar-runs → main · +201 −1 · 1 files · 1 commits · draft

Fixes #553

Please read first: this was vibe coded with an AI assistant (Claude) by just some guy, not a graphics or engine
developer. It ran in the game on one PC and passed two small unit tests, and that's all. Don't take it seriously, or
merge it, without proper testing and review by someone who knows this code. The mechanism is sound as far as I can
tell (reasoning and limits below); the coverage is one machine.

What it changes

#553 found that VICTORY_WC_BAR=1 takes a large share of host-copy cost away, but the whole screen flickers. The cause is the one wc_bar()'s own doc comment names:

  • the mapped copy has no CPU side, so a refresh writes the title's pages whole into the mapping;
  • what shaders wrote into those pages is left on the card, because write-combined results are not copied back;
  • so the title's stale bytes go back over the shaders' writes, every refresh.

#553 suggested writing only what the title wrote, not whole pages. This builds that, as a new value: VICTORY_WC_BAR=runs. =1 is unchanged.

  • Reference copy: each mapped write-combined copy gets a reference in the PC's memory holding the title's bytes as last written into the mapping (Reference in shadow.rs).
  • Changed dwords only: Shadow::copy of such a copy goes to copy_changed. It compares title memory with the reference using the existing word_runs (AVX2 where it can), and writes only the differing dwords into the mapping and the reference.
    • Write-watch ranges would not do: they are whole 4 to 64 KiB pages, the granularity that flickers.
  • First touch: the first time a page is taken, it goes whole (a bit per page).
  • placed_copy: puts the bytes into the reference too, because the submission writes them into the mapping.
  • Small buffers: under =runs, only copies of at least VICTORY_WC_NO_BACK_MIN_KB are mapped. Smaller ones the title reads back keep two sides, for the reason in #355; this is the same cutoff #481 proposes for =1.
  • Log line: every 5 s, "WC BAR runs ... MB compared with the reference, ... MB of it changed and written to the card, ... MB written whole as first seen".
  • Reads: nothing of ours reads the mapping; the compare reads the reference in PC memory.

Why it should be right

  • The invariant: for every page already taken, the reference holds exactly what the title last put into the mapping, through a refresh or a placed copy.
  • The mapping differs from the reference only where shaders wrote.
  • So a dword where title memory differs from the reference is one the title changed since. That is the only thing written, and every other byte the shaders left stays.
  • Where the title rewrote a dword a shader had also written, the title's value wins, as with the two-sided copies.

Limits and known gaps

  • Same-value rewrites: a title write of the value the reference already holds is invisible. If the title resets something the GPU changes back to the same value it wrote last time (a counter cleared to 0 every frame, say), the reset does not reach the card. This is the blind spot send_changed() documents, and VICTORY_SEND_CHANGED is off by default since a run where it broke a room's light and geometry. I did not see such breakage here, but one run cannot rule it out. If it shows up, the buffer it happens in needs to stay on two sides.
  • Inherited from =1, not new:
    • It assumes the title never reads write-combined memory back.
    • Overlapping refreshes of the same range on two threads race as before. The reference heals on the next refresh of the range, as whole pages did.
  • First touch: shader writes made before a page's first refresh are overwritten once, as with =1.
  • Depends on the cutoff: it relies on VICTORY_WC_NO_BACK_MIN_KB. The launchers set 1024; unset it is 0, and small read-back buffers would be mapped too.
  • Memory: PC memory equal to the mapped copies (471 MB for 76 copies of 1 to 50 MB in my run, committed as touched). =1 used none; the default two-sided path uses the same.
  • Hardware, tested only on: RTX 4060 Ti 16 GB (Ada, 32 MB L2), PCIe 4.0 x8, Resizable BAR on (BAR1 16 GiB), i7-13700K, 32 GB, Windows 11 23H2, driver 621.40.
  • Hardware, not tested:
    • AMD: #1231 saw =1 go black with white flicker on an RX 7800 XT; whether that is the same cause and whether =runs helps there is unknown.
    • 8 GB cards: #553's card; wc_mapped_for maps only while a fifth of the budget is free.
    • Cards without Resizable BAR: mapped_card_buffer returns none and the copies stay on the default path. I read that path but did not run it.
    • Windows 10, Linux/Proton.
  • Where the gain shows depends on the bottleneck:
    • Here the card barely waits (1 to 2 ms a frame), so the gain is CPU time: preparing and copying.
    • On #553's card the GPU wait was the wall, and that is where =1 helped. I have not measured =runs there.
  • Interplay with other switches:
    • With VICTORY_PORT_CONSTANTS=1 on top, this card got much slower (frame 70 ms against 48, the card waiting about 17 ms a frame on PCIe reads, as in #1223). I take that to be port #1 on a x8 link, not this change, but the two were not separated.
    • Not checked with VICTORY_INPLACE, VICTORY_WINDOWS_BAR_MB or VICTORY_SEND_CHANGED.

How it was tested

  • GPU and profile: as above. Series S profile, 1080p to 1440p, DLSS balanced, DLSS frame generation 2x, 60 fps cap, ray tracing off.
  • Build: the change was run in the game on d4b5d51 plus two local switches, both on in the before and the after runs:
    • VICTORY_LDS_WRITE_ONLY_OK=1: without it, #43's analysis refuses the InstanceCulling:CS_Tree_BatchCull_* programs on this 32-lane host, and trees are culled until right in front of you.
    • A local switch that keeps frame generation on while in-world Bink movies play.
    • This branch is the same commit cherry-picked onto 568c5e5d. The only conflict there was both sides adding a test module at the end of shadow.rs.
  • Before (VICTORY_WC_BAR unset), 4 min, 31 frame lines with 500+ draws:
    • 18.2 fps median (p10 16.5), 51.2 ms a frame;
    • the submitting thread preparing 26.5 ms;
    • copies 11.5 ms / 64.2 MB a frame, copying back 5.3 ms, waiting for the card 1.8 ms.
  • After (VICTORY_WC_BAR=runs), 10 min, 77 lines, same save and route:
    • 21.4 fps median (p10 17.4), 47.6 ms a frame;
    • preparing 19.6 ms;
    • copies 8.3 ms / 46.5 MB, copying back 4.0 ms, waiting 1.0 ms.
    • 76 copies mapped (smallest exactly 1024 KiB, so the cutoff held). Every 5 s, 12.3 MB compared with the reference and about 3.6 MB written; nothing re-seeded after the start.
    • No flicker and a stable picture. Nothing seen missing that the run without it drew (a few missing textures are there in both).
  • What the numbers do and don't show:
    • The drop in bytes copied and in preparing time is the mechanism working.
    • The fps difference is one run each, both recorded with OBS, and the before run short. Take it as roughly +3 fps on this machine, not a measurement.
    • Dropped draws were 2.3% before and 4.3% after; I did not trace that, and it may be the route.
  • Wave sizes: not a shader change.
  • cargo test: passed for the crates it touches. cargo test --locked --release -p victory-gpu --lib -- wc_bar_runs_tests write_combined gives 3 passed:
    • two new tests check that take_changed_into keeps shader writes outside the changed dwords, on aligned and unaligned stretches;
    • plus the existing write_combined_regions.
    • The full workspace suite was not run. cargo clippy -p victory-gpu gives no warning in the changed code.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related:
    • #481: the write-back cutoff for =1, also in wc_bar; compatible, and =runs applies the same cutoff.
    • #355, #553, #1223.
    • #1231: WC_BAR on AMD, not tested here.

Vibe coded with an AI assistant (Claude); one run on one PC. Treat it as unreviewed until someone who knows shadow.rs has tested it properly.

🤖 Generated with Claude Code

**@⁠vdkipnis** on GitHub · 2026-11-29 03:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1927) `vdkipnis:wc-bar-runs` → `main` · +201 −1 · 1 files · 1 commits · draft Fixes #553 > **Please read first:** this was vibe coded with an AI assistant (Claude) by just some guy, not a graphics or engine > developer. It ran in the game on one PC and passed two small unit tests, and that's all. Don't take it seriously, or > merge it, without proper testing and review by someone who knows this code. The mechanism is sound as far as I can > tell (reasoning and limits below); the coverage is one machine. ## What it changes #553 found that `VICTORY_WC_BAR=1` takes a large share of host-copy cost away, but the whole screen flickers. The cause is the one `wc_bar()`'s own doc comment names: - the mapped copy has no CPU side, so a refresh writes the title's pages whole into the mapping; - what shaders wrote into those pages is left on the card, because write-combined results are not copied back; - so the title's stale bytes go back over the shaders' writes, every refresh. #553 suggested writing only what the title wrote, not whole pages. This builds that, as a new value: `VICTORY_WC_BAR=runs`. `=1` is unchanged. - **Reference copy:** each mapped write-combined copy gets a reference in the PC's memory holding the title's bytes as last written into the mapping (`Reference` in `shadow.rs`). - **Changed dwords only:** `Shadow::copy` of such a copy goes to `copy_changed`. It compares title memory with the reference using the existing `word_runs` (AVX2 where it can), and writes only the differing dwords into the mapping and the reference. - Write-watch ranges would not do: they are whole 4 to 64 KiB pages, the granularity that flickers. - **First touch:** the first time a page is taken, it goes whole (a bit per page). - **`placed_copy`:** puts the bytes into the reference too, because the submission writes them into the mapping. - **Small buffers:** under `=runs`, only copies of at least `VICTORY_WC_NO_BACK_MIN_KB` are mapped. Smaller ones the title reads back keep two sides, for the reason in #355; this is the same cutoff #481 proposes for `=1`. - **Log line:** every 5 s, "WC BAR runs ... MB compared with the reference, ... MB of it changed and written to the card, ... MB written whole as first seen". - **Reads:** nothing of ours reads the mapping; the compare reads the reference in PC memory. ### Why it should be right - **The invariant:** for every page already taken, the reference holds exactly what the title last put into the mapping, through a refresh or a placed copy. - The mapping differs from the reference only where shaders wrote. - So a dword where title memory differs from the reference is one the title changed since. That is the only thing written, and every other byte the shaders left stays. - Where the title rewrote a dword a shader had also written, the title's value wins, as with the two-sided copies. ## Limits and known gaps - **Same-value rewrites:** a title write of the value the reference already holds is invisible. If the title resets something the GPU changes back to the same value it wrote last time (a counter cleared to 0 every frame, say), the reset does not reach the card. This is the blind spot `send_changed()` documents, and `VICTORY_SEND_CHANGED` is off by default since a run where it broke a room's light and geometry. I did not see such breakage here, but one run cannot rule it out. If it shows up, the buffer it happens in needs to stay on two sides. - **Inherited from `=1`, not new:** - It assumes the title never reads write-combined memory back. - Overlapping refreshes of the same range on two threads race as before. The reference heals on the next refresh of the range, as whole pages did. - **First touch:** shader writes made before a page's first refresh are overwritten once, as with `=1`. - **Depends on the cutoff:** it relies on `VICTORY_WC_NO_BACK_MIN_KB`. The launchers set 1024; unset it is 0, and small read-back buffers would be mapped too. - **Memory:** PC memory equal to the mapped copies (471 MB for 76 copies of 1 to 50 MB in my run, committed as touched). `=1` used none; the default two-sided path uses the same. - **Hardware, tested only on:** RTX 4060 Ti 16 GB (Ada, 32 MB L2), PCIe 4.0 x8, Resizable BAR on (BAR1 16 GiB), i7-13700K, 32 GB, Windows 11 23H2, driver 621.40. - **Hardware, not tested:** - AMD: #1231 saw `=1` go black with white flicker on an RX 7800 XT; whether that is the same cause and whether `=runs` helps there is unknown. - 8 GB cards: #553's card; `wc_mapped_for` maps only while a fifth of the budget is free. - Cards without Resizable BAR: `mapped_card_buffer` returns none and the copies stay on the default path. I read that path but did not run it. - Windows 10, Linux/Proton. - **Where the gain shows depends on the bottleneck:** - Here the card barely waits (1 to 2 ms a frame), so the gain is CPU time: preparing and copying. - On #553's card the GPU wait was the wall, and that is where `=1` helped. I have not measured `=runs` there. - **Interplay with other switches:** - With `VICTORY_PORT_CONSTANTS=1` on top, this card got much slower (frame 70 ms against 48, the card waiting about 17 ms a frame on PCIe reads, as in #1223). I take that to be port #1 on a x8 link, not this change, but the two were not separated. - Not checked with `VICTORY_INPLACE`, `VICTORY_WINDOWS_BAR_MB` or `VICTORY_SEND_CHANGED`. ## How it was tested - **GPU and profile:** as above. Series S profile, 1080p to 1440p, DLSS balanced, DLSS frame generation 2x, 60 fps cap, ray tracing off. - **Build:** the change was run in the game on `d4b5d51` plus two local switches, both on in the before and the after runs: - `VICTORY_LDS_WRITE_ONLY_OK=1`: without it, #43's analysis refuses the `InstanceCulling:CS_Tree_BatchCull_*` programs on this 32-lane host, and trees are culled until right in front of you. - A local switch that keeps frame generation on while in-world Bink movies play. - This branch is the same commit cherry-picked onto `568c5e5d`. The only conflict there was both sides adding a test module at the end of `shadow.rs`. - **Before** (`VICTORY_WC_BAR` unset), 4 min, 31 frame lines with 500+ draws: - 18.2 fps median (p10 16.5), 51.2 ms a frame; - the submitting thread preparing 26.5 ms; - copies 11.5 ms / 64.2 MB a frame, copying back 5.3 ms, waiting for the card 1.8 ms. - **After** (`VICTORY_WC_BAR=runs`), 10 min, 77 lines, same save and route: - 21.4 fps median (p10 17.4), 47.6 ms a frame; - preparing 19.6 ms; - copies 8.3 ms / 46.5 MB, copying back 4.0 ms, waiting 1.0 ms. - 76 copies mapped (smallest exactly 1024 KiB, so the cutoff held). Every 5 s, 12.3 MB compared with the reference and about 3.6 MB written; nothing re-seeded after the start. - No flicker and a stable picture. Nothing seen missing that the run without it drew (a few missing textures are there in both). - **What the numbers do and don't show:** - The drop in bytes copied and in preparing time is the mechanism working. - The fps difference is one run each, both recorded with OBS, and the before run short. Take it as roughly +3 fps on this machine, not a measurement. - Dropped draws were 2.3% before and 4.3% after; I did not trace that, and it may be the route. - **Wave sizes:** not a shader change. - **`cargo test`:** passed for the crates it touches. `cargo test --locked --release -p victory-gpu --lib -- wc_bar_runs_tests write_combined` gives 3 passed: - two new tests check that `take_changed_into` keeps shader writes outside the changed dwords, on aligned and unaligned stretches; - plus the existing `write_combined_regions`. - The full workspace suite was not run. `cargo clippy -p victory-gpu` gives no warning in the changed code. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: - #481: the write-back cutoff for `=1`, also in `wc_bar`; compatible, and `=runs` applies the same cutoff. - #355, #553, #1223. - #1231: `WC_BAR` on AMD, not tested here. Vibe coded with an AI assistant (Claude); one run on one PC. Treat it as unreviewed until someone who knows `shadow.rs` has tested it properly. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
WC_BAR=1 rewrote whole pages of write-combined buffers mapped on the card and took back what shaders wrote (upstream #553). =runs compares title memory with a reference and writes changed dwords only; copies below VICTORY_WC_NO_BACK_MIN_KB keep two sides (#355/#481).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 03:12:20 +00:00
Author
Owner

@⁠vdkipnis on GitHub · 2026-11-29 03:14 UTC · original

Update: textures look broken on my end. Please treat this as unconfirmed.

In a longer session with VICTORY_WC_BAR=runs, a lot of textures simply stopped loading. We don't know yet whether this change caused it.

  • What the AI assistant thinks: it's my own launcher's VICTORY_TEXTURE_BUDGET_MB=9000, not this change.
    • The log shows first-upload room decisions: 0 allowed, ~50,000 refused by an explicit byte limit every 5 s once texture copies reach that cap.
    • In resource.rs, an explicit limit is absolute and doesn't count the mapped buffers.
    • A 13-minute run without this change, on the same build, hit the same refusals from about 4 minutes in.
  • What I think: I'm not convinced yet. The assistant may be right and I may be wrong, but I'd rather not lean on that until it's tested.
  • Next: a run with =runs and the texture cap removed, so the build's own guards handle texture memory. If textures load there, the cap was the problem. If they don't, this change is the suspect.

The goal is to get this working without breaking textures, if that's possible at all. Whether the approach is feasible is still an open question. I'll report back here either way. Until then, please don't rely on the performance numbers above.

**@⁠vdkipnis** on GitHub · 2026-11-29 03:14 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1927#issuecomment-7249922576) **Update: textures look broken on my end.** Please treat this as unconfirmed. In a longer session with `VICTORY_WC_BAR=runs`, a lot of textures simply stopped loading. We don't know yet whether this change caused it. - **What the AI assistant thinks:** it's my own launcher's `VICTORY_TEXTURE_BUDGET_MB=9000`, not this change. - The log shows `first-upload room decisions: 0 allowed, ~50,000 refused by an explicit byte limit` every 5 s once texture copies reach that cap. - In `resource.rs`, an explicit limit is absolute and doesn't count the mapped buffers. - A 13-minute run without this change, on the same build, hit the same refusals from about 4 minutes in. - **What I think:** I'm not convinced yet. The assistant may be right and I may be wrong, but I'd rather not lean on that until it's tested. - **Next:** a run with `=runs` and the texture cap removed, so the build's own guards handle texture memory. If textures load there, the cap was the problem. If they don't, this change is the suspect. The goal is to get this working without breaking textures, if that's possible at all. Whether the approach is feasible is still an open question. I'll report back here either way. Until then, please don't rely on the performance numbers above.
Author
Owner

@⁠POMXARK on GitHub · 2026-11-29 03:45 UTC · original

@⁠vdkipnis Quick testing heads-up for anyone A/B testing VICTORY_WC_BAR=runs on this PR:

Before collecting A/B numbers, check nvidia-smi -q | findstr /I "BAR1" and confirm the log prints card memory the CPU maps supported=true.

On our RTX 5080 test rig, BIOS Resizable BAR was off by default (BAR1 Total : 256 MiB instead of 16384 MiB), which makes D3D12_FEATURE_D3D12_OPTIONS16::GPUUploadHeapSupported return false and causes VICTORY_WC_BAR to silently fall back to standard staged copies!

Enabling Above 4G Decoding + Re-Size BAR Support (with CSM disabled) in BIOS expands BAR1 to full VRAM and unlocks Tier A D3D12_HEAP_TYPE_GPU_UPLOAD (direct CPU writes into GDDR for the ~4.46 GB write-combined pools).

We opened a central community testing thread to collect ReBAR-ON vs ReBAR-OFF numbers (plus Tier B OpenExistingHeapFromAddress fallback benchmarks for 256 MiB BAR1 systems): https://github.com/trustno1-coder/VIctory-NVIDIA/discussions/1947

**@⁠POMXARK** on GitHub · 2026-11-29 03:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1927#issuecomment-7250239675) @⁠vdkipnis Quick testing heads-up for anyone A/B testing `VICTORY_WC_BAR=runs` on this PR: Before collecting A/B numbers, check `nvidia-smi -q | findstr /I "BAR1"` and confirm the log prints `card memory the CPU maps supported=true`. On our RTX 5080 test rig, BIOS Resizable BAR was off by default (`BAR1 Total : 256 MiB` instead of `16384 MiB`), which makes `D3D12_FEATURE_D3D12_OPTIONS16::GPUUploadHeapSupported` return `false` and causes `VICTORY_WC_BAR` to silently fall back to standard staged copies! Enabling **Above 4G Decoding + Re-Size BAR Support** (with CSM disabled) in BIOS expands BAR1 to full VRAM and unlocks Tier A `D3D12_HEAP_TYPE_GPU_UPLOAD` (direct CPU writes into GDDR for the ~4.46 GB write-combined pools). We opened a central community testing thread to collect ReBAR-ON vs ReBAR-OFF numbers (plus Tier B `OpenExistingHeapFromAddress` fallback benchmarks for `256 MiB` BAR1 systems): https://github.com/trustno1-coder/VIctory-NVIDIA/discussions/1947
Author
Owner

@⁠vdkipnis on GitHub · 2026-11-29 05:54 UTC · original

Follow-up, as promised: parking this.

I ran the test from my last comment: =runs with the texture cap removed, so the build's own guards manage texture memory. Results on an RTX 4060 Ti 16 GB, PCIe 4.0 x8, ReBAR on (supported=true in every WC_BAR run):

  • No cap, WC_BAR=runs: textures loaded properly. After about 6 minutes the card ran out of VRAM: DLSS reported "out of VRAM", the gun menu flickered, then nvlddmkm event 153 and the device was lost. It did the same with the texture line lowered to 70%, after about 13 minutes.
  • No cap, without this change: no crash, but textures were missing or slow and frame generation kept dropping out.
  • 9 GB cap (my earlier runs): textures stopped loading.

On my setup, the texture memory in latest upstream (d4b5d51) is unusable whether or not this change is applied. That rules out a clean test of this PR here. The mapped buffers are a constant ~471 MB, which may be what tipped the no-cap runs over, but I can't separate that from upstream's own texture overflow.

So I'm leaving this as an open draft and not working on it further. The flicker fix and the fps gain looked real to me (ReBAR verified active), but treat this as unproven until someone tests it on a build with stable texture memory. The diff is small (shadow.rs, off unless VICTORY_WC_BAR=runs), if anyone wants to pick it up.

**@⁠vdkipnis** on GitHub · 2026-11-29 05:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1927#issuecomment-7251527524) **Follow-up, as promised: parking this.** I ran the test from my last comment: `=runs` with the texture cap removed, so the build's own guards manage texture memory. Results on an RTX 4060 Ti 16 GB, PCIe 4.0 x8, ReBAR on (`supported=true` in every `WC_BAR` run): - **No cap, `WC_BAR=runs`:** textures loaded properly. After about 6 minutes the card ran out of VRAM: DLSS reported "out of VRAM", the gun menu flickered, then nvlddmkm event 153 and the device was lost. It did the same with the texture line lowered to 70%, after about 13 minutes. - **No cap, without this change:** no crash, but textures were missing or slow and frame generation kept dropping out. - **9 GB cap (my earlier runs):** textures stopped loading. On my setup, the texture memory in latest upstream (`d4b5d51`) is unusable whether or not this change is applied. That rules out a clean test of this PR here. The mapped buffers are a constant ~471 MB, which may be what tipped the no-cap runs over, but I can't separate that from upstream's own texture overflow. So I'm leaving this as an open draft and not working on it further. The flicker fix and the fps gain looked real to me (ReBAR verified active), but treat this as unproven until someone tests it on a build with stable texture memory. The diff is small (`shadow.rs`, off unless `VICTORY_WC_BAR=runs`), if anyone wants to pick it up.
Author
Owner

@⁠POMXARK on GitHub · 2026-11-29 06:07 UTC · original

@⁠vdkipnis Tested PR #1927 (VICTORY_WC_BAR=runs) live in-game on Ryzen 7 5700X + RTX 5080 16 GB (BIOS ReBAR ON, BAR1 = 16,384 MiB, Agility SDK 1.614.1, PCIe 3.0 x16, DLSS Quality + FG 4x) vs identical ReBAR-OFF baseline (10-minute matched runs; note: tested on our local fork branch with SETTLE_UNLOCKED, DUE_WHEEL, AHEAD_GAP_KB=512, XMEM_CPU_UNWATCHED, CARD_MULTI_BATCH, LIST_VIEWS_FRAME; only variable changed was ReBAR ON + VICTORY_WC_BAR=runs):

  • Unit tests: wc_bar_runs_tests 2/2 PASS.
  • Confirmed active: card memory the CPU maps supported=true, 102 WC BAR runs windows (comparing 450–613 MB/5 s, writing only 6–22 MB changed dwords — 95–98% skipped).
  • Stability & #553 Flicker Fix: 0 errors, 0 DeviceRemoved, 0 exceptions, 172/172 Responding, and ZERO #553 screen flicker across interior, face close-up, and open-world street scenes!
  • Draw-Count-Matched 3D Results (ReBAR OFF -> ReBAR ON + VICTORY_WC_BAR=runs):
    • ALL 3D: 12.00 -> 15.00 FPS (+25.0%, 82.8 -> 68.1 ms)
    • 1k–4k: 15.00 -> 21.00 FPS (+40.0%, 67.5 -> 46.8 ms)
    • 4k–7k: 13.00 -> 15.50 FPS (+19.2%, 75.8 -> 65.6 ms)
    • 7k–10k: 8.00 -> 8.00 FPS (125.5 -> 123.8 ms)
    • >=10k: 10.50 -> 11.00 FPS (+4.8%, 96.8 -> 94.3 ms)
    • LATE 3D (last 30): 9.2 -> 10.4 FPS (+13.0% p50 / +19.5% mean), Prep 91.5 -> 72.0 ms, copies 53.3 -> 42.2 ms (-20.8%), write watch 4.7 -> 2.3 ms (-51%)
    • Memory: DXGI Shared med 7,417 -> 6,165 MB (-1.25 GB), buf_card_mb 1,097 -> 420 MB, MinRAM 0.29 -> 1.10 GB, VRAM max 12,265 -> 12,807 MiB; trade-off: Commit max 29,322 -> 30,277 MB (+955 MB) due to the CPU Reference copy.

Full write-up also posted in #1947 — awesome fix for #553!

**@⁠POMXARK** on GitHub · 2026-11-29 06:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1927#issuecomment-7251660226) @⁠vdkipnis Tested PR #1927 (`VICTORY_WC_BAR=runs`) live in-game on **Ryzen 7 5700X + RTX 5080 16 GB (BIOS ReBAR ON, `BAR1 = 16,384 MiB`, Agility SDK `1.614.1`, PCIe 3.0 x16, DLSS Quality + FG 4x)** vs identical ReBAR-OFF baseline (10-minute matched runs; note: tested on our local fork branch with `SETTLE_UNLOCKED`, `DUE_WHEEL`, `AHEAD_GAP_KB=512`, `XMEM_CPU_UNWATCHED`, `CARD_MULTI_BATCH`, `LIST_VIEWS_FRAME`; only variable changed was ReBAR ON + `VICTORY_WC_BAR=runs`): - **Unit tests:** `wc_bar_runs_tests` 2/2 PASS. - **Confirmed active:** `card memory the CPU maps supported=true`, `102` `WC BAR runs` windows (comparing `450–613 MB`/5 s, writing only `6–22 MB` changed dwords — 95–98% skipped). - **Stability & #553 Flicker Fix:** **0 errors, 0 DeviceRemoved, 0 exceptions, 172/172 Responding, and ZERO #553 screen flicker** across interior, face close-up, and open-world street scenes! - **Draw-Count-Matched 3D Results (ReBAR OFF -> ReBAR ON + `VICTORY_WC_BAR=runs`):** - **ALL 3D:** `12.00 -> 15.00 FPS` (**`+25.0%`**, `82.8 -> 68.1 ms`) - **`1k–4k`:** `15.00 -> 21.00 FPS` (**`+40.0%`**, `67.5 -> 46.8 ms`) - **`4k–7k`:** `13.00 -> 15.50 FPS` (**`+19.2%`**, `75.8 -> 65.6 ms`) - **`7k–10k`:** `8.00 -> 8.00 FPS` (`125.5 -> 123.8 ms`) - **`>=10k`:** `10.50 -> 11.00 FPS` (**`+4.8%`**, `96.8 -> 94.3 ms`) - **LATE 3D (last 30):** `9.2 -> 10.4 FPS` (**`+13.0%` p50 / `+19.5%` mean**), `Prep 91.5 -> 72.0 ms`, **`copies 53.3 -> 42.2 ms (-20.8%)`**, `write watch 4.7 -> 2.3 ms (-51%)` - **Memory:** `DXGI Shared` med **`7,417 -> 6,165 MB (-1.25 GB)`**, `buf_card_mb 1,097 -> 420 MB`, `MinRAM 0.29 -> 1.10 GB`, VRAM max `12,265 -> 12,807 MiB`; trade-off: Commit max `29,322 -> 30,277 MB (+955 MB)` due to the CPU `Reference` copy. Full write-up also posted in #1947 — awesome fix for #553!
Author
Owner

@⁠Bazovsky on GitHub · 2026-11-29 11:00 UTC · original

A data point from an RTX 5090 (32 GB) + Ryzen 9 9950X3D: 2560x1440, DLSS Quality, frame generation off, ray tracing off, started with victory play (so VICTORY_WC_NO_BACK_MIN_KB=1024).

e1f2eb6 with this PR merged in, one exe, the switch alone changed, 190 s runs in turn with other variants. A loaded save standing in the first playable scene (about 4,800 draws a frame), seconds 60 to 140 of 3D counted:

frames a second, per run "for copies in the card's memory" taking the bytes out of the CPU sides
default 39.0 / 38.3 / 38.3 / 37.0 / 37.9 / 35.4 3.85 ms a frame 1.7 ms
VICTORY_WC_BAR=runs 39.5 / 39.1 / 33.8 3.40 ms a frame 1.4 ms
  • The submitting thread's time for copies in the card's memory falls by about 0.45 ms a frame.
  • The frame rate stays within the spread of the runs.
  • The 5 s line reads about 1,000 MB compared with the reference and 30 MB of it written to the card.
  • No device loss and no early exit in the three runs. They were unattended, so I cannot say anything about the picture, which is the part that matters for #553.

Measured unattended by an AI assistant (Claude Code) on my PC.

**@⁠Bazovsky** on GitHub · 2026-11-29 11:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1927#issuecomment-7254821021) A data point from an RTX 5090 (32 GB) + Ryzen 9 9950X3D: 2560x1440, DLSS Quality, frame generation off, ray tracing off, started with `victory play` (so `VICTORY_WC_NO_BACK_MIN_KB=1024`). `e1f2eb6` with this PR merged in, one exe, the switch alone changed, 190 s runs in turn with other variants. A loaded save standing in the first playable scene (about 4,800 draws a frame), seconds 60 to 140 of 3D counted: | | frames a second, per run | "for copies in the card's memory" | taking the bytes out of the CPU sides | |---|---|---|---| | default | 39.0 / 38.3 / 38.3 / 37.0 / 37.9 / 35.4 | 3.85 ms a frame | 1.7 ms | | `VICTORY_WC_BAR=runs` | 39.5 / 39.1 / 33.8 | 3.40 ms a frame | 1.4 ms | - The submitting thread's time for copies in the card's memory falls by about 0.45 ms a frame. - The frame rate stays within the spread of the runs. - The 5 s line reads about 1,000 MB compared with the reference and 30 MB of it written to the card. - No device loss and no early exit in the three runs. They were unattended, so I cannot say anything about the picture, which is the part that matters for #553. Measured unattended by an AI assistant (Claude Code) on my PC.
Author
Owner

@⁠Headache3318 on GitHub · 2026-11-29 17:55 UTC · original

Data point from 3x RTX 4090 (24 GB, ReBAR verified 32 GiB BAR1 via pci=nocrs, driver 620.73) + Arch, bare Proton GE11-14, leak v1.0.2.1, fork v2026.11.28.03 → 29.01 (AI-assisted: Hermes Agent).

VICTORY_WC_BAR=runs was the single biggest CPU-side win we measured before the wall moved to the GPU: the per-frame report line "texture refreshes per frame" went 36.2 ms → 3.2 ms when we added it (with VICTORY_SETTLE_UNLOCKED=1 VICTORY_AHEAD_GAP_KB=512 VICTORY_WIDE_THREADS=8). Same story as @⁠Bazovsky's "taking the bytes out of the CPU sides" column, at much larger absolute scale — on this title the copy path was the first wall; after runs the GPU became the limiter at last.

One multi-GPU warning for anyone following this thread's earlier nvidia-smi budget talk: nvidia-smi budget is not ground truth here — a second card parked at 23 GB by other apps (our case: an LLM host on card 2) while the game sits on a free card, and the title still logs budget 590 MB for the right adapter (own_memory_mb=24564 in the same log). Trust lspci -vv BAR sizes, never the budget line — and note the F2 advisor on 29.01 stopped blaming copies entirely once the shader backlog drained; on our box the copy wall became invisible behind the compile storm, which may be why others see smaller deltas.

Full Linux multi-GPU recipe (nocrs + ReBAR, vkd3d device pinning, gamescope index trap, preload) is in #1898.

**@⁠Headache3318** on GitHub · 2026-11-29 17:55 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1927#issuecomment-7260065648) Data point from **3x RTX 4090 (24 GB, ReBAR verified 32 GiB BAR1 via `pci=nocrs`, driver 620.73) + Arch, bare Proton GE11-14**, leak v1.0.2.1, fork v2026.11.28.03 → 29.01 (AI-assisted: Hermes Agent). `VICTORY_WC_BAR=runs` was the single biggest CPU-side win we measured before the wall moved to the GPU: the per-frame report line **"texture refreshes per frame" went 36.2 ms → 3.2 ms** when we added it (with `VICTORY_SETTLE_UNLOCKED=1 VICTORY_AHEAD_GAP_KB=512 VICTORY_WIDE_THREADS=8`). Same story as @⁠Bazovsky's "taking the bytes out of the CPU sides" column, at much larger absolute scale — on this title the copy path was the first wall; after `runs` the GPU became the limiter at last. One multi-GPU warning for anyone following this thread's earlier `nvidia-smi` budget talk: **`nvidia-smi` budget is not ground truth here** — a second card parked at 23 GB by other apps (our case: an LLM host on card 2) while the game sits on a free card, and the title still logs `budget 590 MB` for the *right* adapter (`own_memory_mb=24564` in the same log). Trust `lspci -vv` BAR sizes, never the budget line — and note the F2 advisor on 29.01 stopped blaming copies entirely once the shader backlog drained; on our box the copy wall became invisible behind the compile storm, which may be why others see smaller deltas. Full Linux multi-GPU recipe (nocrs + ReBAR, vkd3d device pinning, gamescope index trap, preload) is in #1898.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/shadow.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1927/head:github-bot/gh-1927'
git switch 'github-bot/gh-1927'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1927'
git switch 'github-bot/gh-1927'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1927'
git switch 'github-bot/gh-1927'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1927'
git switch 'main'
git merge --squash 'github-bot/gh-1927'
git switch 'main'
git merge --ff-only 'github-bot/gh-1927'
git switch 'main'
git merge 'github-bot/gh-1927'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1927
No description provided.