Keep alias-safe VICTORY_WC_NO_BACK under VICTORY_HW_RT and always copy back DXR postbuild sizes #4760

Closed
github-bot wants to merge 1 commit from github-bot/gh-4759 into main AGit
Owner

@⁠steven-seagull27 on GitHub · 2026-12-01 05:47 UTC · original
steven-seagull27:perf/hwrt-wc-noback-postbuild → main · +211 −39 · 2 files · 1 commits · closed without merging

What it changes

Commit 9a427c14 disabled both VICTORY_UNIFIED_BACK and VICTORY_WC_NO_BACK whenever VICTORY_HW_RT=1 is requested (!crate::hwrt::requested()), forcing all declared shader writes into >= 1 MiB write-combined GPU buffers through readback and compare passes under hardware ray tracing. In addition, HwRtManager::emit_postbuild (crates/victory-gpu/src/hwrt.rs) recorded its 8-byte compacted BLAS postbuild size answers through Shadow::gpu_writes rather than an explicit CPU-readback path.

  1. Shadow::gpu_writes_back for HwRtManager::emit_postbuild (hwrt.rs, shadow.rs): Routes DXR postbuild size writes through Shadow::gpu_writes_back so host-emitted compacted BLAS size answers are always scheduled for CPU copy-back even when their destination lies inside a large write-combined buffer pool.
  2. Alias-safe VICTORY_WC_NO_BACK under VICTORY_HW_RT=1 (shadow.rs): Re-allows VICTORY_WC_NO_BACK=1 under VICTORY_HW_RT=1 via VICTORY_HWRT_WC_NO_BACK (1 by default: leaves >= VICTORY_WC_NO_BACK_MIN_KB pure write-combined shader writes on the GPU unless has_smaller_overlap detects a smaller registered sub-buffer or loose window overlapping the written range; 2: leaves all >= min WC shader writes on the GPU; 0: restores full copy-back). has_smaller_overlap scans the BTreeMap buffer table and LOOSE windows without heap allocation, catching inner sub-buffers even before their Shadow copy has been lazily instantiated.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): Synthetic unit tests on Windows 11 x64 (NVIDIA GeForce RTX 5080 16 GB, driver 621.40, 32 GB RAM); standalone gameplay runs on bare origin/main + this commit alone were not recorded here.
  • Before: wc_no_back() unconditionally returned false when crate::hwrt::requested() was true, and HwRtManager::emit_postbuild called sh.gpu_writes.
  • After: VICTORY_WC_NO_BACK=1 remains active for non-aliased >= min write-combined buffers under VICTORY_HW_RT=1 (VICTORY_HWRT_WC_NO_BACK=0 opts out), inner sub-buffer overlaps fall back to copy-back, and emit_postbuild always copies back postbuild sizes.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes).
  • cargo test passed for the crates it touches: yes (targeted suites on ec5e14f7, based on 5fabb46e):
    • cargo test --locked -p victory-gpu --lib overlapping_tests: 3 passed, 0 failed (including hwrt_wc_mode_and_smaller_overlap_detect_inner_subbuffers).
    • cargo test --locked -p victory-gpu --lib hwrt::tests: 19 passed, 0 failed.
    • cargo clippy --locked -p victory-gpu --lib --tests: 0 warnings in hwrt.rs and shadow.rs (origin/main 5fabb46e currently has 5 pre-existing warnings in host/{font,menu,panel}.rs from #4634, tracked in #4679 / #4707).
    • cargo run --locked -p xtask -- policy: 464 files ok (git diff --check origin/main...HEAD clean; full --workspace suite not run).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3706, #4144, #4338, #4579, #4527, #4528 (none re-enables VICTORY_WC_NO_BACK under VICTORY_HW_RT or routes emit_postbuild through gpu_writes_back).
**@⁠steven-seagull27** on GitHub · 2026-12-01 05:47 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4759) `steven-seagull27:perf/hwrt-wc-noback-postbuild` → `main` · +211 −39 · 2 files · 1 commits · closed without merging ## What it changes Commit `9a427c14` disabled both `VICTORY_UNIFIED_BACK` and `VICTORY_WC_NO_BACK` whenever `VICTORY_HW_RT=1` is requested (`!crate::hwrt::requested()`), forcing all declared shader writes into `>= 1 MiB` write-combined GPU buffers through readback and compare passes under hardware ray tracing. In addition, `HwRtManager::emit_postbuild` (`crates/victory-gpu/src/hwrt.rs`) recorded its 8-byte compacted BLAS postbuild size answers through `Shadow::gpu_writes` rather than an explicit CPU-readback path. 1. **`Shadow::gpu_writes_back` for `HwRtManager::emit_postbuild` (`hwrt.rs`, `shadow.rs`):** Routes DXR postbuild size writes through `Shadow::gpu_writes_back` so host-emitted compacted BLAS size answers are always scheduled for CPU copy-back even when their destination lies inside a large write-combined buffer pool. 2. **Alias-safe `VICTORY_WC_NO_BACK` under `VICTORY_HW_RT=1` (`shadow.rs`):** Re-allows `VICTORY_WC_NO_BACK=1` under `VICTORY_HW_RT=1` via `VICTORY_HWRT_WC_NO_BACK` (`1` by default: leaves `>= VICTORY_WC_NO_BACK_MIN_KB` pure write-combined shader writes on the GPU unless `has_smaller_overlap` detects a smaller registered sub-buffer or loose window overlapping the written range; `2`: leaves all `>= min` WC shader writes on the GPU; `0`: restores full copy-back). `has_smaller_overlap` scans the `BTreeMap` buffer table and `LOOSE` windows without heap allocation, catching inner sub-buffers even before their `Shadow` copy has been lazily instantiated. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): Synthetic unit tests on Windows 11 x64 (NVIDIA GeForce RTX 5080 16 GB, driver 621.40, 32 GB RAM); standalone gameplay runs on bare `origin/main` + this commit alone were not recorded here. - Before: `wc_no_back()` unconditionally returned `false` when `crate::hwrt::requested()` was `true`, and `HwRtManager::emit_postbuild` called `sh.gpu_writes`. - After: `VICTORY_WC_NO_BACK=1` remains active for non-aliased `>= min` write-combined buffers under `VICTORY_HW_RT=1` (`VICTORY_HWRT_WC_NO_BACK=0` opts out), inner sub-buffer overlaps fall back to copy-back, and `emit_postbuild` always copies back postbuild sizes. - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes). - `cargo test` passed for the crates it touches: yes (targeted suites on `ec5e14f7`, based on `5fabb46e`): - `cargo test --locked -p victory-gpu --lib overlapping_tests`: 3 passed, 0 failed (including `hwrt_wc_mode_and_smaller_overlap_detect_inner_subbuffers`). - `cargo test --locked -p victory-gpu --lib hwrt::tests`: 19 passed, 0 failed. - `cargo clippy --locked -p victory-gpu --lib --tests`: 0 warnings in `hwrt.rs` and `shadow.rs` (`origin/main` `5fabb46e` currently has 5 pre-existing warnings in `host/{font,menu,panel}.rs` from `#4634`, tracked in `#4679` / `#4707`). - `cargo run --locked -p xtask -- policy`: 464 files ok (`git diff --check origin/main...HEAD` clean; full `--workspace` suite not run). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3706, #4144, #4338, #4579, #4527, #4528 (none re-enables `VICTORY_WC_NO_BACK` under `VICTORY_HW_RT` or routes `emit_postbuild` through `gpu_writes_back`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 05:52:55 +00:00
Author
Owner

@⁠KruIN689 on GitHub · 2026-12-01 09:29 UTC · original

Independent in-game test: a clear gain with hardware RT on a CPU-bound PC. This is the first in-game run of this PR.

Setup

  • Hardware: RTX 5080 16 GB, Ryzen 9 9950X3D, Windows 11.
  • Builds: release builds of Lyrnc/palmlight main 12a25580, which carries upstream 84bd61e2's hardware RT and 9a427c14. One build as is ("main"); one with this PR's ec5e14f7 cherry-picked, which applies cleanly.
  • Settings: VICTORY_HW_RT=1, Series X native 1440p, our play defaults (VICTORY_WC_NO_BACK=1, VICTORY_WC_NO_BACK_MIN_KB=1024).
  • Arms: "PR" is the PR's default mode (VICTORY_HWRT_WC_NO_BACK unset = 1); "PR m2" is VICTORY_HWRT_WC_NO_BACK=2.
  • Runs: the same save, then 6 minutes of scripted walking and driving per run, six runs in one session in turns (PR, main, PR m2, PR, main, PR m2). Gameplay seconds only.
run fps ms/frame submitting thread refreshes copies frames over 50 ms per 1000 p99 BLAS built
PR 29.5 33.9 30.2 ms 11.6 ms 13.6 ms / 81.5 MB 21.3 52.6 ms 16.1 k
main 25.4 39.3 35.3 ms 13.6 ms 15.6 ms / 127.5 MB 24.8 49.4 ms 17.3 k
PR m2 31.9 31.4 25.4 ms 9.7 ms 11.0 ms / 66.8 MB 30.7 50.6 ms 23.0 k
PR 29.3 34.1 27.9 ms 10.2 ms 11.5 ms / 75.8 MB 98.5 61.7 ms 18.1 k
main 22.2 45.0 36.7 ms 11.9 ms 13.5 ms / 107.2 MB 304.5 77.3 ms 11.8 k
PR m2 26.4 37.9 27.8 ms 10.0 ms 11.4 ms / 72.2 MB 126.4 69.6 ms 21.6 k

What I read from it

  • fps:
    • Mode 1: +4.1 and +7.1 fps over the main run next to it (29.5 / 29.3 against 25.4 / 22.2).
    • Mode 2: 31.9 / 26.4.
    • The PR's runs met as much or more new geometry than main's: 16–23 k BLASes built against 12–17 k. So the gain isn't an easier route.
  • The submitting thread loses 5–9 ms a frame (28–30 ms against 35–37 ms). The data the copies move per frame falls from 107–128 MB to 67–82 MB. This matches frametrace's 5090 numbers in #4756: on this CPU-bound PC most of the hardware RT tax is this copy back.
  • has_smaller_overlap's lookup costs nothing visible. Mode 1 sits close to mode 2.
  • Long frames: fewer than main in the second pair (98 vs 305 per 1000), level in the first.
  • No lost device or hang in any run. The log's error/warning line count is the same on both sides (86–87). cargo test -p victory-gpu --lib overlapping_tests gives 3 passed.
  • Picture, the reason for 9a427c14:
    • With diagnostics builds and VICTORY_CAPTURE (every 8th frame, standing still at the save, outdoors in daylight, VICTORY_HW_RT=1), the PR's frames show the same lighting from capture to capture: no swap between two lighting states, and no corruption.
    • The main run's capture caught a different camera angle, so I have no pixel-for-pixel comparison. This is one outdoor scene, and like frametrace's prologue check it is not proof the flicker can't come back somewhere else.
    • Whoever saw the original flicker should look at that scene with this PR.
  • One logging caveat: the per-frame "MB declared written in write-combined memory left on the card" figure reads 21–40 GB with the PR. It counts declared ranges on every write, not unique bytes, so treat it as "much is now left on the card" and not as a size.

I'm porting this to our fork with authorship kept (it goes in only after review there). Thanks for picking up #4756 so quickly.

Tested with the help of Claude Code (Claude Opus 5.5).

**@⁠KruIN689** on GitHub · 2026-12-01 09:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4759#issuecomment-7306772899) **Independent in-game test: a clear gain with hardware RT on a CPU-bound PC.** This is the first in-game run of this PR. **Setup** - Hardware: RTX 5080 16 GB, Ryzen 9 9950X3D, Windows 11. - Builds: release builds of Lyrnc/palmlight main 12a25580, which carries upstream 84bd61e2's hardware RT and 9a427c14. One build as is ("main"); one with this PR's ec5e14f7 cherry-picked, which applies cleanly. - Settings: `VICTORY_HW_RT=1`, Series X native 1440p, our play defaults (`VICTORY_WC_NO_BACK=1`, `VICTORY_WC_NO_BACK_MIN_KB=1024`). - Arms: "PR" is the PR's default mode (`VICTORY_HWRT_WC_NO_BACK` unset = 1); "PR m2" is `VICTORY_HWRT_WC_NO_BACK=2`. - Runs: the same save, then 6 minutes of scripted walking and driving per run, six runs in one session in turns (PR, main, PR m2, PR, main, PR m2). Gameplay seconds only. | run | fps | ms/frame | submitting thread | refreshes | copies | frames over 50 ms per 1000 | p99 | BLAS built | |---|---|---|---|---|---|---|---|---| | PR | 29.5 | 33.9 | 30.2 ms | 11.6 ms | 13.6 ms / 81.5 MB | 21.3 | 52.6 ms | 16.1 k | | main | 25.4 | 39.3 | 35.3 ms | 13.6 ms | 15.6 ms / 127.5 MB | 24.8 | 49.4 ms | 17.3 k | | PR m2 | 31.9 | 31.4 | 25.4 ms | 9.7 ms | 11.0 ms / 66.8 MB | 30.7 | 50.6 ms | 23.0 k | | PR | 29.3 | 34.1 | 27.9 ms | 10.2 ms | 11.5 ms / 75.8 MB | 98.5 | 61.7 ms | 18.1 k | | main | 22.2 | 45.0 | 36.7 ms | 11.9 ms | 13.5 ms / 107.2 MB | 304.5 | 77.3 ms | 11.8 k | | PR m2 | 26.4 | 37.9 | 27.8 ms | 10.0 ms | 11.4 ms / 72.2 MB | 126.4 | 69.6 ms | 21.6 k | **What I read from it** - **fps:** - Mode 1: +4.1 and +7.1 fps over the main run next to it (29.5 / 29.3 against 25.4 / 22.2). - Mode 2: 31.9 / 26.4. - The PR's runs met as much or more new geometry than main's: 16–23 k BLASes built against 12–17 k. So the gain isn't an easier route. - **The submitting thread loses 5–9 ms a frame** (28–30 ms against 35–37 ms). The data the copies move per frame falls from 107–128 MB to 67–82 MB. This matches frametrace's 5090 numbers in #4756: on this CPU-bound PC most of the hardware RT tax is this copy back. - **`has_smaller_overlap`'s lookup costs nothing visible.** Mode 1 sits close to mode 2. - **Long frames:** fewer than main in the second pair (98 vs 305 per 1000), level in the first. - **No lost device or hang in any run.** The log's error/warning line count is the same on both sides (86–87). `cargo test -p victory-gpu --lib overlapping_tests` gives 3 passed. - **Picture, the reason for 9a427c14:** - With diagnostics builds and `VICTORY_CAPTURE` (every 8th frame, standing still at the save, outdoors in daylight, `VICTORY_HW_RT=1`), the PR's frames show the same lighting from capture to capture: no swap between two lighting states, and no corruption. - The main run's capture caught a different camera angle, so I have no pixel-for-pixel comparison. This is one outdoor scene, and like frametrace's prologue check it is not proof the flicker can't come back somewhere else. - Whoever saw the original flicker should look at that scene with this PR. - **One logging caveat:** the per-frame "MB declared written in write-combined memory left on the card" figure reads 21–40 GB with the PR. It counts declared ranges on every write, not unique bytes, so treat it as "much is now left on the card" and not as a size. I'm porting this to our fork with authorship kept (it goes in only after review there). Thanks for picking up #4756 so quickly. *Tested with the help of Claude Code (Claude Opus 5.5).*
Author
Owner

@⁠cafeoh on GitHub · 2026-12-01 10:01 UTC · original

Tested on Turing: RTX 2080 Ti 11 GB (driver 617.14), Ryzen 7 7800X3D, Windows 10 22H2, Series S, DLSS off, ray tracing on with VICTORY_HW_RT=1, release build, the launcher's defaults (VICTORY_WC_NO_BACK=1, VICTORY_WC_NO_BACK_MIN_KB=1024), pipelines made beforehand, the same scripted prologue run, PresentMon over the last 40 s, two runs a side. Base: e1251c319 plus #4568's revert and a structure-size copy fix of ours, the same on every side.

fps card ms/frame p99 ms
without this PR (copy-back forced under hardware RT) 16.98 / 16.76 56.2 / 56.5 140 / 174
this PR, default (mode 1) 19.24 / 18.84 50.5 / 52.3 129 / 131
a local switch that keeps the rule for every buffer (like mode 2) 19.84 / 19.94 49.6 / 49.2 139 / 134

About +2.2 fps on this card with the default. Mode 2 may be a little faster, but the gap is within this scene's noise (about ±1 fps). No lost device. A recorded run with the mode-2-like switch showed no one-frame flashes over about 1,900 frames (café, cell).

Tested: the above, one scene. Not tested: the picture with mode 1 itself, other scenes, long sessions.

**@⁠cafeoh** on GitHub · 2026-12-01 10:01 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4759#issuecomment-7307547270) Tested on Turing: RTX 2080 Ti 11 GB (driver 617.14), Ryzen 7 7800X3D, Windows 10 22H2, Series S, DLSS off, ray tracing on with `VICTORY_HW_RT=1`, release build, the launcher's defaults (`VICTORY_WC_NO_BACK=1`, `VICTORY_WC_NO_BACK_MIN_KB=1024`), pipelines made beforehand, the same scripted prologue run, PresentMon over the last 40 s, two runs a side. Base: e1251c319 plus #4568's revert and a structure-size copy fix of ours, the same on every side. | | fps | card ms/frame | p99 ms | |---|---|---|---| | without this PR (copy-back forced under hardware RT) | 16.98 / 16.76 | 56.2 / 56.5 | 140 / 174 | | this PR, default (mode 1) | 19.24 / 18.84 | 50.5 / 52.3 | 129 / 131 | | a local switch that keeps the rule for every buffer (like mode 2) | 19.84 / 19.94 | 49.6 / 49.2 | 139 / 134 | About +2.2 fps on this card with the default. Mode 2 may be a little faster, but the gap is within this scene's noise (about ±1 fps). No lost device. A recorded run with the mode-2-like switch showed no one-frame flashes over about 1,900 frames (café, cell). Tested: the above, one scene. Not tested: the picture with mode 1 itself, other scenes, long sessions.
Author
Owner

@⁠KruIN689 on GitHub · 2026-12-01 11:24 UTC · original

Picture check by a human player, same PC (RTX 5080), VICTORY_HW_RT=1, real driving and walking:

  • With this PR (mode 1, default): distant lights blink on and off. This looks like the DXR flicker 9a427c14 was about.
  • Same build, same places, VICTORY_HWRT_WC_NO_BACK=0: the lights don't blink. fps is lower again: 14.6 fps in the first minute of driving, against 20.4–29.5 with the PR.
  • In both, some distant patches show black until approached. That one is not this PR; it looks like BLAS eviction or streaming.

So the flicker is real with the alias-safe mode too. Some write that the title, or our own CPU side, reads back for the lights still needs the copy back. Next I'm trying to find which copies those are, to keep the copy back only for them. If anyone already knows which buffer the light pass reads back, say so here.

Tested with the help of Claude Code (Claude Opus 5.5).

**@⁠KruIN689** on GitHub · 2026-12-01 11:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4759#issuecomment-7309602353) **Picture check by a human player, same PC (RTX 5080), `VICTORY_HW_RT=1`, real driving and walking:** - **With this PR (mode 1, default):** distant lights blink on and off. This looks like the DXR flicker 9a427c14 was about. - **Same build, same places, `VICTORY_HWRT_WC_NO_BACK=0`:** the lights don't blink. fps is lower again: 14.6 fps in the first minute of driving, against 20.4–29.5 with the PR. - **In both,** some distant patches show black until approached. That one is not this PR; it looks like BLAS eviction or streaming. So the flicker is real with the alias-safe mode too. Some write that the title, or our own CPU side, reads back for the lights still needs the copy back. Next I'm trying to find which copies those are, to keep the copy back only for them. If anyone already knows which buffer the light pass reads back, say so here. *Tested with the help of Claude Code (Claude Opus 5.5).*
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 11:32 UTC · original

The RTX 5080 report shows distant lights flicker with mode 1 on this PR. Setting VICTORY_HWRT_WC_NO_BACK=0 in the same build and scenes removed the flicker.

4227a69ccefca884e4378f787245acc82c8cd47e makes that copy-back mode the default when hardware RT is requested. Modes 1 and 2 stay available explicitly, invalid values fall back to 0, and the separate DXR postbuild-size copy-back fix stays in place. The change is in one function and its doc comment on top of ec5e14f7. Review commit

I exercised the exact selector on Windows with unset, 0, 1, 2, an out-of-range number, and a malformed value. The commit keeps the non-RT behavior and matches explicit 0 for unset and invalid values. The staged policy passed. The in-game result above is from KruIN689's run with explicit 0. Keeping the faster modes opt-in lets the team continue isolating the buffer that needs copy-back.

Please keep the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change in.

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 11:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4759#issuecomment-7309774481) [The RTX 5080 report](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4760) shows distant lights flicker with mode 1 on this PR. Setting `VICTORY_HWRT_WC_NO_BACK=0` in the same build and scenes removed the flicker. 4227a69ccefca884e4378f787245acc82c8cd47e makes that copy-back mode the default when hardware RT is requested. Modes 1 and 2 stay available explicitly, invalid values fall back to 0, and the separate DXR postbuild-size copy-back fix stays in place. The change is in one function and its doc comment on top of `ec5e14f7`. [Review commit](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/4227a69ccefca884e4378f787245acc82c8cd47e) I exercised the exact selector on Windows with unset, 0, 1, 2, an out-of-range number, and a malformed value. The commit keeps the non-RT behavior and matches explicit 0 for unset and invalid values. The staged policy passed. The in-game result above is from KruIN689's run with explicit 0. Keeping the faster modes opt-in lets the team continue isolating the buffer that needs copy-back. Please keep the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change in. AI-assisted with OpenAI Codex.
Author
Owner

@⁠MrDenn on GitHub · 2026-12-01 12:44 UTC · original

A data point from a weaker CPU, where hardware RT is most CPU-bound. The copy-back cut works here too, but the fps gain is smaller than on the 9950X3D.

Setup

  • Hardware: RTX 5080 16 GB (driver 621.40), Ryzen 7 9700X, 32 GB DDR5-6400, Windows 11 24H2.
  • Build: v2026.11.30.03 (e1251c31) plus only ec5e14f7, which cherry-picks cleanly. Release build, warm caches.
  • Settings: VICTORY_HW_RT=1, Series X, native 1440p, DLSS Performance, no frame cap, play defaults (VICTORY_WC_NO_BACK=1, MIN_KB=1024), no leave list.
  • Runs: one exe, VICTORY_HWRT_WC_NO_BACK set at start. Runs in the order 0, 1, 2, 0, 1, 2. The routes were free play and not identical, and the second round's runs were short. Gameplay seconds only.
run play fps median >100 ms /min submitting thread copied back fetched uploads card busy
mode 0 7.6 min 13.9 69.2 ms 93 47.4 ms 30.6 MB 93 MB 174 MB 62 %
mode 1 7.2 min 15.8 61.1 ms 52 38.2 ms 6.4 MB 23 MB 119 MB 65 %
mode 2 5.3 min 15.6 61.1 ms 49 37.8 ms 3.5 MB 20 MB 116 MB 53 %
mode 0 0.9 min 16.0 62.3 ms 11 45.7 ms 34.6 MB 98 MB 173 MB 79 %
mode 1 1.2 min 17.7 56.7 ms 5 36.7 ms 8.6 MB 26 MB 112 MB 69 %
mode 2 2.4 min 14.7 65.0 ms 43 41.6 ms 5.2 MB 21 MB 110 MB 90 %

(Per frame. "Copied back" and "uploads" are from the host stats line, "fetched" from the host copies line.)

What I read from it

  • The copy back falls by about 80 %: about 31-35 MB a frame to 4-9, and fetched from 93-98 to 20-26 MB. The relay's landing drops from about 32 to 19 ms a frame.
  • The submitting thread gets 7-10 ms back, in line with the 5-9 ms on the 9950X3D.
  • fps rises only about 1.5-2 (about +12 %), against +4 to +7 on the 9950X3D. After the cut, the card sits idle 17-23 ms a frame, and the submitting thread still spends 37-42 ms. That time goes to the refreshes (11-12 ms), card copies (6-7 ms) and the uploads (about 115 MB a frame).
  • The last mode 2 run was card-bound (card busy 90 %, title lists 55 ms against 34-36 elsewhere), probably a heavier scene. So don't read anything into mode 1 against mode 2 here.
  • For comparison, a hand-made static leave list (16 ranges, 134 MB, VICTORY_LAND_LEAVE) on the plain release earlier gave 17.5 fps with 16.5 MB copied back. This PR gets more of the copy back off the thread, with no list.
  • No device lost and no hang in any run. The kinds of warnings are the same in all modes.

Picture.

  • What I saw: in all three modes, the ocean seen from the surface had strong flicker and noise running along the waves. Shadows were also less stable than in my earlier plain-release runs.
  • The control: a run of the plain v2026.11.30.03 release at the same spot shows the same water noise, so it isn't this PR. It's a hardware RT problem at sea, and I'll open its own issue: .
  • My impression across modes was that mode 0 looked worst. Mode 0 is v30.03's path, so that's scene and route, not the mode.
  • I can't confirm or rule out KruIN689's blinking distant lights. I didn't drive at night in a way that would show them.

(Analysis done with Claude Code.)

**@⁠MrDenn** on GitHub · 2026-12-01 12:44 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4759#issuecomment-7311566915) A data point from a weaker CPU, where hardware RT is most CPU-bound. **The copy-back cut works here too, but the fps gain is smaller than on the 9950X3D.** **Setup** - **Hardware:** RTX 5080 16 GB (driver 621.40), Ryzen 7 9700X, 32 GB DDR5-6400, Windows 11 24H2. - **Build:** v2026.11.30.03 (`e1251c31`) plus only `ec5e14f7`, which cherry-picks cleanly. Release build, warm caches. - **Settings:** `VICTORY_HW_RT=1`, Series X, native 1440p, DLSS Performance, no frame cap, play defaults (`VICTORY_WC_NO_BACK=1`, `MIN_KB=1024`), no leave list. - **Runs:** one exe, `VICTORY_HWRT_WC_NO_BACK` set at start. Runs in the order 0, 1, 2, 0, 1, 2. The routes were free play and not identical, and the second round's runs were short. Gameplay seconds only. | run | play | fps | median | >100 ms /min | submitting thread | copied back | fetched | uploads | card busy | |---|---:|---:|---:|---:|---:|---:|---:|---:|---:| | mode 0 | 7.6 min | 13.9 | 69.2 ms | 93 | 47.4 ms | 30.6 MB | 93 MB | 174 MB | 62 % | | mode 1 | 7.2 min | 15.8 | 61.1 ms | 52 | 38.2 ms | 6.4 MB | 23 MB | 119 MB | 65 % | | mode 2 | 5.3 min | 15.6 | 61.1 ms | 49 | 37.8 ms | 3.5 MB | 20 MB | 116 MB | 53 % | | mode 0 | 0.9 min | 16.0 | 62.3 ms | 11 | 45.7 ms | 34.6 MB | 98 MB | 173 MB | 79 % | | mode 1 | 1.2 min | 17.7 | 56.7 ms | 5 | 36.7 ms | 8.6 MB | 26 MB | 112 MB | 69 % | | mode 2 | 2.4 min | 14.7 | 65.0 ms | 43 | 41.6 ms | 5.2 MB | 21 MB | 110 MB | 90 % | (Per frame. "Copied back" and "uploads" are from the host stats line, "fetched" from the host copies line.) **What I read from it** - **The copy back falls by about 80 %:** about 31-35 MB a frame to 4-9, and fetched from 93-98 to 20-26 MB. The relay's landing drops from about 32 to 19 ms a frame. - **The submitting thread gets 7-10 ms back,** in line with the 5-9 ms on the 9950X3D. - **fps rises only about 1.5-2 (about +12 %),** against +4 to +7 on the 9950X3D. After the cut, the card sits idle 17-23 ms a frame, and the submitting thread still spends 37-42 ms. That time goes to the refreshes (11-12 ms), card copies (6-7 ms) and the uploads (about 115 MB a frame). - **The last mode 2 run was card-bound** (card busy 90 %, title lists 55 ms against 34-36 elsewhere), probably a heavier scene. So don't read anything into mode 1 against mode 2 here. - **For comparison, a hand-made static leave list** (16 ranges, 134 MB, `VICTORY_LAND_LEAVE`) on the plain release earlier gave 17.5 fps with 16.5 MB copied back. This PR gets more of the copy back off the thread, with no list. - **No device lost and no hang** in any run. The kinds of warnings are the same in all modes. **Picture.** - **What I saw:** in all three modes, the ocean seen from the surface had strong flicker and noise running along the waves. Shadows were also less stable than in my earlier plain-release runs. - **The control:** a run of the plain v2026.11.30.03 release at the same spot shows the same water noise, so it isn't this PR. It's a hardware RT problem at sea, and I'll open its own issue: <link>. - **My impression across modes** was that mode 0 looked worst. Mode 0 is v30.03's path, so that's scene and route, not the mode. - **I can't confirm or rule out KruIN689's blinking distant lights.** I didn't drive at night in a way that would show them. (Analysis done with Claude Code.)
github-bot force-pushed github-bot/gh-4759 from ec5e14f7c1 to 5c310421cd 2026-12-01 16:51:45 +00:00 Compare
Author
Owner

@⁠paales on GitHub · 2026-12-01 17:17 UTC · original

Written by 🤖:

With this PR and VICTORY_HW_RT=1 the light goes wrong: in the first scene of a save (two officers at a car, evening) the picture is dark and red, the white car pinkish. RTX 5070 Ti, Series X 1440p, DLSS Performance, cherry-picked onto a build of main from 30 Nov with #4338, #4579, #4171 and #4144.

The mean colour (R/G/B, 0-255) of the captures from 0.5 to 2.5 s measures it:

run colour
without this PR, VICTORY_HW_RT=1 65.1 / 50.9 / 45.9
VICTORY_BVH_BUILDER=1 (the console walk) 68.6 / 56.9 / 53.2
with this PR, VICTORY_HW_RT=1 50.9 / 41.1 / 38.2
with this PR, VICTORY_HWRT_WC_NO_BACK=0 65.4 / 51.1 / 46.2
with this PR, VICTORY_WC_NO_BACK_MIN_KB=4096 51.3 / 41.4 / 38.3
with this PR, VICTORY_WC_NO_BACK_MIN_KB=16384 63.9 / 50.1 / 45.3

The same 73 ranges keep their shader writes on the card with and without ray tracing; without it the picture is right. So in its ray tracing mode the title reads back some of them: by the sizes, the copies of 11.8 to 12.6 MB (one of 12,600,000 bytes, two of 12,582,912, seven of 11.8 MB). The note on wc_no_back_min describes the same failure (exposure read back stale). Telling the structure builder's own CPU reads apart did not help (the colour stayed 54 / 44 / 40).

What I run now: a minimum of its own under hardware ray tracing, VICTORY_HWRT_WC_NO_BACK_MIN_KB (16 MB by default), so the 1 MB minimum without ray tracing stays. Median frame in the save with hardware ray tracing: 45.2 ms with it and the right colour, 51.3 ms with VICTORY_HWRT_WC_NO_BACK=0, 36.0 ms with this PR's default and the wrong colour. A rule by size may not hold in every scene; the real fix is to know which copies the title reads back.

**@⁠paales** on GitHub · 2026-12-01 17:17 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4759#issuecomment-7319075125) _Written by 🤖:_ With this PR and `VICTORY_HW_RT=1` the light goes wrong: in the first scene of a save (two officers at a car, evening) the picture is dark and red, the white car pinkish. RTX 5070 Ti, Series X 1440p, DLSS Performance, cherry-picked onto a build of `main` from 30 Nov with #4338, #4579, #4171 and #4144. The mean colour (R/G/B, 0-255) of the captures from 0.5 to 2.5 s measures it: | run | colour | |---|---| | without this PR, `VICTORY_HW_RT=1` | 65.1 / 50.9 / 45.9 | | `VICTORY_BVH_BUILDER=1` (the console walk) | 68.6 / 56.9 / 53.2 | | with this PR, `VICTORY_HW_RT=1` | 50.9 / 41.1 / 38.2 | | with this PR, `VICTORY_HWRT_WC_NO_BACK=0` | 65.4 / 51.1 / 46.2 | | with this PR, `VICTORY_WC_NO_BACK_MIN_KB=4096` | 51.3 / 41.4 / 38.3 | | with this PR, `VICTORY_WC_NO_BACK_MIN_KB=16384` | 63.9 / 50.1 / 45.3 | The same 73 ranges keep their shader writes on the card with and without ray tracing; without it the picture is right. So in its ray tracing mode the title reads back some of them: by the sizes, the copies of 11.8 to 12.6 MB (one of 12,600,000 bytes, two of 12,582,912, seven of 11.8 MB). The note on `wc_no_back_min` describes the same failure (exposure read back stale). Telling the structure builder's own CPU reads apart did not help (the colour stayed 54 / 44 / 40). What I run now: a minimum of its own under hardware ray tracing, `VICTORY_HWRT_WC_NO_BACK_MIN_KB` (16 MB by default), so the 1 MB minimum without ray tracing stays. Median frame in the save with hardware ray tracing: 45.2 ms with it and the right colour, 51.3 ms with `VICTORY_HWRT_WC_NO_BACK=0`, 36.0 ms with this PR's default and the wrong colour. A rule by size may not hold in every scene; the real fix is to know which copies the title reads back.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 17:25 UTC · original

The mode-0 run matches the new default. At current head 5c310421, an unset VICTORY_HWRT_WC_NO_BACK already takes the mode-0 copy-back path when hardware RT is enabled. The PR description still says mode 1 is the default, which makes a test with no explicit override hard to interpret. Current selector

Could you include the patch SHA and effective mode in the report? For the next comparison, the most useful pair is the same scene at current head with the switch unset and with mode 1 explicitly set. The existing figures already show the red shift with the earlier behavior and its recovery at mode 0.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 17:25 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4759#issuecomment-7319283931) The mode-0 run matches the new default. At current head `5c310421`, an unset `VICTORY_HWRT_WC_NO_BACK` already takes the mode-0 copy-back path when hardware RT is enabled. The PR description still says mode 1 is the default, which makes a test with no explicit override hard to interpret. [Current selector](https://github.com/trustno1-coder/VIctory-NVIDIA/blob/5c310421cd9ad3c7d927815f045e255efc21b7cb/crates/victory-gpu/src/shadow.rs) Could you include the patch SHA and effective mode in the report? For the next comparison, the most useful pair is the same scene at current head with the switch unset and with mode 1 explicitly set. The existing figures already show the red shift with the earlier behavior and its recovery at mode 0.
github-bot closed this pull request 2026-12-01 18:36:39 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:32 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4759#issuecomment-7321122302) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

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!4760
No description provided.