GPU: a root constant's dword 4 is a value, not a view offset (#2699) #2701

Open
Calvix2k wants to merge 1 commit from upstream-pr/2703 into main
Calvix2k commented 2026-11-25 18:28:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T18:28:26Z.


Fixes #2699.

In the user-data loop, a dword numbered ROOT_VIEW_OFFSET (4) was taken for a root view's offset without asking whether the parameter was a root descriptor at all. Root constants with five or more dwords have a real dword 4; it was looked up as a root view, none was found, and the draw or dispatch was refused (a root view's offset: no root view, or outside title buffers) with no log line. The ray-tracing builder's dispatches were among the casualties.

Ask u.root == RootType::Descriptor too, through a helper beside is_root_view, so a root constant's dword 4 goes to the title's user data as the value it is.

The test pins the predicate: a descriptor's dword 4 is an offset; constants' and tables' dword 4 are not.

Tests: cargo test -p victory-gpu --lib --locked only_a_root_descriptors_dword_four (pass), cargo clippy -p victory-gpu --all-targets clean.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5496899512 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T18:28:26Z. --- Fixes #2699. In the user-data loop, a dword numbered `ROOT_VIEW_OFFSET` (4) was taken for a root view's offset without asking whether the parameter was a root descriptor at all. Root constants with five or more dwords have a real dword 4; it was looked up as a root view, none was found, and the draw or dispatch was refused (`a root view's offset: no root view, or outside title buffers`) with no log line. The ray-tracing builder's dispatches were among the casualties. Ask `u.root == RootType::Descriptor` too, through a helper beside `is_root_view`, so a root constant's dword 4 goes to the title's user data as the value it is. The test pins the predicate: a descriptor's dword 4 is an offset; constants' and tables' dword 4 are not. Tests: `cargo test -p victory-gpu --lib --locked only_a_root_descriptors_dword_four` (pass), `cargo clippy -p victory-gpu --all-targets` clean.
andrewpozdnakov7-jpg commented 2026-11-25 19:06:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T18:48:50Z.


The same WARP shader goes through VIctory's dispatch and reads a user-data word into a buffer. A root constant at dword 4 leaves the output at 0 on main 13f91caee2 and writes 1.25 on 7bb3ebaf46. The control puts a real root view 16 bytes into its buffer and reads the offset 16 on both revisions. Six paired runs across both debug settings reproduced this.

The serial GPU suite had 200 passes and one ignored in each setting. Strict GPU Clippy in both configurations and asset policy passed.

Test-only commit c4e53db is directly on your current head and checks the dispatch and readback in addition to the predicate. Please keep the Git author if you cherry-pick it, or add this trailer if folding it into another commit:

Co-authored-by: andrewpozdnakov7-jpg [email protected]

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171435334 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7171435334). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-25T18:48:50Z. --- The same WARP shader goes through VIctory's dispatch and reads a user-data word into a buffer. A root constant at dword 4 leaves the output at 0 on main 13f91caee25f2fdf2c062be5f7a27f058e51cbca and writes 1.25 on 7bb3ebaf46081958a6546cd74bd8290cd3a3b715. The control puts a real root view 16 bytes into its buffer and reads the offset 16 on both revisions. Six paired runs across both debug settings reproduced this. The serial GPU suite had 200 passes and one ignored in each setting. Strict GPU Clippy in both configurations and asset policy passed. [Test-only commit c4e53db](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/c4e53db58857e548a6409a53be55028c252eeddc) is directly on your current head and checks the dispatch and readback in addition to the predicate. Please keep the Git author if you cherry-pick it, or add this trailer if folding it into another commit: Co-authored-by: andrewpozdnakov7-jpg <[email protected]>
kotekompotek commented 2026-11-25 19:06:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T18:50:06Z.


Real bug, minimal fix - dword 4 is ROOT_VIEW_OFFSET only in the root-descriptor encoding; a constants param has a genuine value there. Gating on root == Descriptor matches how is_root_view already treats the namespace. The predicate test pins all three root types.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171464662 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7171464662). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T18:50:06Z. --- Real bug, minimal fix - dword 4 is ROOT_VIEW_OFFSET only in the root-descriptor encoding; a constants param has a genuine value there. Gating on root == Descriptor matches how is_root_view already treats the namespace. The predicate test pins all three root types.
fuzeofficlal commented 2026-11-25 19:06:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T18:51:29Z.


Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and full-repo audit of 7bb3ebaf (on 13f91ca):

Verification (rustc 1.98.1 MSVC)

  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings and --features diagnostics: 0 warnings.
  • RTX 5090: cargo test --locked -p victory-gpu --features diagnostics --lib draw: 14 passed, 0 failed (including only_a_root_descriptors_dword_four_is_a_view_offset).
  • WARP (VICTORY_D3D12_WARP=1): cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1: 199 passed, 0 failed, 1 ignored.

Code Review & Repo Audit

  • Audited all remaining references to ROOT_VIEW_OFFSET, ROOT_SRV_VIEW, ROOT_UAV_VIEW, RootType, and user_data across victory-gpu and victory-shader: no other call site conflates RootType::Constants / RootType::Table dword 4 with a root view offset (user_value, is_root_view, and lower.rs all gate on RootType::Descriptor).
  • Looks clean and ready to merge (cherry-picking @andrewpozdnakov7-jpg's c4e53db end-to-end dispatch test would be a nice bonus, though not blocking; also supersedes older #2295 on current main).
<!-- greyfinch-sync:Marvisak/VIctory:comment:7171498482 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7171498482). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T18:51:29Z. --- Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and full-repo audit of `7bb3ebaf` (on `13f91ca`): ### Verification (`rustc 1.98.1` MSVC) - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` and `--features diagnostics`: **0 warnings**. - **RTX 5090:** `cargo test --locked -p victory-gpu --features diagnostics --lib draw`: **14 passed, 0 failed** (including `only_a_root_descriptors_dword_four_is_a_view_offset`). - **WARP (`VICTORY_D3D12_WARP=1`):** `cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1`: **199 passed, 0 failed, 1 ignored**. ### Code Review & Repo Audit - Audited all remaining references to `ROOT_VIEW_OFFSET`, `ROOT_SRV_VIEW`, `ROOT_UAV_VIEW`, `RootType`, and `user_data` across `victory-gpu` and `victory-shader`: no other call site conflates `RootType::Constants` / `RootType::Table` dword 4 with a root view offset (`user_value`, `is_root_view`, and `lower.rs` all gate on `RootType::Descriptor`). - Looks clean and ready to merge (cherry-picking @andrewpozdnakov7-jpg's `c4e53db` end-to-end dispatch test would be a nice bonus, though not blocking; also supersedes older #2295 on current `main`).
oni-swr commented 2026-11-25 19:06:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T18:56:56Z.


Independent WARP/CPU verification (claim: Marvisak/VIctory#1633)

  • PR head: 7bb3ebaf46081958a6546cd74bd8290cd3a3b715 / origin/main: 13f91caee25f2fdf2c062be5f7a27f058e51cbca
  • State: OPEN, non-draft; git merge-tree --write-tree origin/main <head> merges cleanly; no prior oni-swr comment on this head.
  • Environment: Windows 11 Pro 10.0.26200, VICTORY_WARP=1 + VICTORY_D3D12_WARP=1 (WARP only, no physical GPU, no game files/dumps/retail hashes), dxil.dll 1.8.2502.11 (Windows SDK 10.0.26100.0, via VICTORY_DXIL), rustc 1.98.1 (48a229cea 2026-09-01), debug profile, --locked.

Commands / results (baseline = origin/main, same environment)

cargo test -p victory-shader --locked
cargo test -p victory-gpu --locked
cargo clippy -p victory-gpu --locked --all-targets
  • victory-gpu: 196 passed / 0 failed / 1 ignored (+1 vs baseline 195). New draw::tests::only_a_root_descriptors_dword_four_is_a_view_offset ok.
  • victory-shader: 267 / 3 / 3, identical to baseline (the same 3 pre-existing WARP failures; unaffected by this PR).
  • clippy -p victory-gpu: 0 warnings, 0 errors (baseline 0).

Negative control: with the predicate loosened back to the old condition (u.dword == ROOT_VIEW_OFFSET, root type ignored), the new test FAILS; reverted afterwards.

Code review: No bugs found. Minimal fix: the offset substitution now requires RootType::Descriptor, so a root constant's dword 4 stays a value. The test is a unit test of the predicate (Descriptor/Constants/Table); it does not exercise the surrounding fill loop end to end.

Not tested: physical GPU hardware (RX 7800 XT or any), retail game run, release build, other crates.

AI use: Claude Code (Claude Sonnet 5.5) ran the commands and reviewed the diff; the results above are from the actual runs.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171619262 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7171619262). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T18:56:56Z. --- **Independent WARP/CPU verification** (claim: Marvisak/VIctory#1633) - PR head: `7bb3ebaf46081958a6546cd74bd8290cd3a3b715` / `origin/main`: `13f91caee25f2fdf2c062be5f7a27f058e51cbca` - State: OPEN, non-draft; `git merge-tree --write-tree origin/main <head>` merges cleanly; no prior `oni-swr` comment on this head. - Environment: Windows 11 Pro 10.0.26200, `VICTORY_WARP=1` + `VICTORY_D3D12_WARP=1` (WARP only, no physical GPU, no game files/dumps/retail hashes), `dxil.dll` 1.8.2502.11 (Windows SDK 10.0.26100.0, via `VICTORY_DXIL`), rustc 1.98.1 (48a229cea 2026-09-01), debug profile, `--locked`. **Commands / results** (baseline = `origin/main`, same environment) ``` cargo test -p victory-shader --locked cargo test -p victory-gpu --locked cargo clippy -p victory-gpu --locked --all-targets ``` - victory-gpu: 196 passed / 0 failed / 1 ignored (+1 vs baseline 195). New `draw::tests::only_a_root_descriptors_dword_four_is_a_view_offset` ok. - victory-shader: 267 / 3 / 3, identical to baseline (the same 3 pre-existing WARP failures; unaffected by this PR). - clippy -p victory-gpu: 0 warnings, 0 errors (baseline 0). **Negative control:** with the predicate loosened back to the old condition (`u.dword == ROOT_VIEW_OFFSET`, root type ignored), the new test FAILS; reverted afterwards. **Code review:** No bugs found. Minimal fix: the offset substitution now requires `RootType::Descriptor`, so a root constant's dword 4 stays a value. The test is a unit test of the predicate (Descriptor/Constants/Table); it does not exercise the surrounding fill loop end to end. **Not tested:** physical GPU hardware (RX 7800 XT or any), retail game run, release build, other crates. **AI use:** Claude Code (Claude Sonnet 5.5) ran the commands and reviewed the diff; the results above are from the actual runs.
Marvisak commented 2026-11-25 23:06:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:21:18Z.


Automated triage for the maintainers.

Merge candidate (recommend a look). This is a real bug fix. In the user-data loop of State (crates/victory-gpu/src/draw.rs), any UserData with dword == ROOT_VIEW_OFFSET (4) was treated as a root view's offset. The translator (Lower::user_dword in emit/lower.rs) also emits dword: 4 for the fifth dword of a root constants parameter, so such draws and dispatches were refused. The new is_root_view_offset also requires RootType::Descriptor, the only root type for which Lower::root_view_offset emits that dword. The test pins the predicate. A contributor's comment adds an end-to-end WARP readback (main 0, this branch 1.25). It fixes the same thing as the older #2295 (needs work) and merges cleanly, so this is the one to take.

CI: check passing on this head.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7176257384 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7176257384). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T22:21:18Z. --- <!-- victory-triage v1 head=7bb3ebaf46081958a6546cd74bd8290cd3a3b715 verdict=merge-candidate at=2026-11-25T22:23:30Z --> Automated triage for the maintainers. **Merge candidate (recommend a look).** This is a real bug fix. In the user-data loop of `State` (`crates/victory-gpu/src/draw.rs`), any `UserData` with `dword == ROOT_VIEW_OFFSET` (4) was treated as a root view's offset. The translator (`Lower::user_dword` in `emit/lower.rs`) also emits `dword: 4` for the fifth dword of a root *constants* parameter, so such draws and dispatches were refused. The new `is_root_view_offset` also requires `RootType::Descriptor`, the only root type for which `Lower::root_view_offset` emits that dword. The test pins the predicate. A contributor's comment adds an end-to-end WARP readback (main 0, this branch 1.25). It fixes the same thing as the older #2295 (needs work) and merges cleanly, so this is the one to take. CI: `check` passing on this head. --- _Generated by [Claude Code](https://claude.ai/code)_
Anzymanz commented 2026-11-26 00:03:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Anzymanz on 2026-11-25T23:10:13Z.


From a tester working with Claude (AI-assisted, Claude Code): a second machine where this is the biggest drop class in the world.

Setup: RX 9070 XT, RADV (Mesa 26.3.1) through vkd3d-proton (GE-Proton 11-14), CachyOS; diagnostics build of main 13f91ca + #1997 + #454, Series X, 1.0.2.1; Microsoft's d3dcompiler_47 in the prefix so the indirect clamp builds.

Drops (a root view's offset: no root view, or outside title buffers, highest per-frame rate of each program over one world run): 3b90165a77d95cdf 1,014, f6e47efa50226beb 768, 6f6a359d1166bb27 314, 5e68767498c57eb6 298, and ffd93c8a029ff016, c42a31951201f9a0, 5062bc7a48e842f8, 190fbf0ebe040169, c85822de2e41cfaa 10-58 each. That is more than the being made drops (839) in the same run.

Why, checked offline: all of these are compute programs from XboxBvhBuilder.dll, and translating them (emit::translate_with) gives each a user-data entry with root: Constants, dword: 4 (3b90165a77d95cdf slot 2, f6e47efa50226beb slot 8, 6f6a359d1166bb27 and 5e68767498c57eb6 slot 0), which the ROOT_VIEW_OFFSET arm takes for a root view. So the RDNA4/Linux drops are this bug too. I haven't run the title with this PR yet; I'll post the A/B when I have it.

No game data here: hashes and counts only.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7177224259 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7177224259). Originally posted by [Anzymanz](https://github.com/Anzymanz) on 2026-11-25T23:10:13Z. --- From a tester working with Claude (AI-assisted, Claude Code): a second machine where this is the biggest drop class in the world. **Setup:** RX 9070 XT, RADV (Mesa 26.3.1) through vkd3d-proton (GE-Proton 11-14), CachyOS; diagnostics build of `main` `13f91ca` + #1997 + #454, Series X, 1.0.2.1; Microsoft's `d3dcompiler_47` in the prefix so the indirect clamp builds. **Drops** (`a root view's offset: no root view, or outside title buffers`, highest per-frame rate of each program over one world run): `3b90165a77d95cdf` 1,014, `f6e47efa50226beb` 768, `6f6a359d1166bb27` 314, `5e68767498c57eb6` 298, and `ffd93c8a029ff016`, `c42a31951201f9a0`, `5062bc7a48e842f8`, `190fbf0ebe040169`, `c85822de2e41cfaa` 10-58 each. That is more than the `being made` drops (839) in the same run. **Why, checked offline:** all of these are compute programs from `XboxBvhBuilder.dll`, and translating them (`emit::translate_with`) gives each a user-data entry with `root: Constants, dword: 4` (`3b90165a77d95cdf` slot 2, `f6e47efa50226beb` slot 8, `6f6a359d1166bb27` and `5e68767498c57eb6` slot 0), which the `ROOT_VIEW_OFFSET` arm takes for a root view. So the RDNA4/Linux drops are this bug too. I haven't run the title with this PR yet; I'll post the A/B when I have it. No game data here: hashes and counts only.
Anzymanz commented 2026-11-26 00:03:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Anzymanz on 2026-11-25T23:35:27Z.


The A/B I promised above, same machine (RX 9070 XT, RADV/Mesa 26.3.1 via vkd3d-proton, GE-Proton 11-14), same base (13f91ca + #1997 + #454 + #2644), diagnostics builds, warm shader cache, one run per arm, 30 s in the world each (the opening cutscene), VICTORY_GPU_TIMING=1:

base base + this PR
a root view's offset summary lines 56 0
draws and dispatches dropped per frame, world intervals 192 / 619 / 346 / 473 54 / 808 / 16 / 4 / 4
per-dispatch GPU time of the two costliest builder kernels (caa78b8ca62bc3d6, 28918b7150a7aad5) 0.37 / 0.77 ms 0.35 / 0.81 ms

So on RDNA4 under Linux this PR removes that drop class completely, and the ray-tracing builder's other programs now run; no new fault in the 30 s. Frame times aren't comparable between the two runs (different cutscene moments, and the timing mode serialises lists), so I'm not quoting them. The one 808 interval is right after the world loaded (pipelines still being made).

AI-assisted (Claude Code, Claude Opus 5.5); no game data, hashes and counts only.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7177774596 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7177774596). Originally posted by [Anzymanz](https://github.com/Anzymanz) on 2026-11-25T23:35:27Z. --- The A/B I promised above, same machine (RX 9070 XT, RADV/Mesa 26.3.1 via vkd3d-proton, GE-Proton 11-14), same base (`13f91ca` + #1997 + #454 + #2644), diagnostics builds, warm shader cache, one run per arm, 30 s in the world each (the opening cutscene), `VICTORY_GPU_TIMING=1`: | | base | base + this PR | |---|---|---| | `a root view's offset` summary lines | 56 | **0** | | draws and dispatches dropped per frame, world intervals | 192 / 619 / 346 / 473 | 54 / 808 / 16 / 4 / 4 | | per-dispatch GPU time of the two costliest builder kernels (`caa78b8ca62bc3d6`, `28918b7150a7aad5`) | 0.37 / 0.77 ms | 0.35 / 0.81 ms | So on RDNA4 under Linux this PR removes that drop class completely, and the ray-tracing builder's other programs now run; no new fault in the 30 s. Frame times aren't comparable between the two runs (different cutscene moments, and the timing mode serialises lists), so I'm not quoting them. The one 808 interval is right after the world loaded (pipelines still being made). AI-assisted (Claude Code, Claude Opus 5.5); no game data, hashes and counts only.
davesousa commented 2026-11-26 01:04:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by davesousa on 2026-11-26T00:59:36Z.


NVIDIA in-game A/B: RTX 3070 Ti 8 GB (Ampere), driver 621.40, Windows 11 26200, TDR delay 8 s. diag build, warm caches. Base: main 63bcca4 + #2319 + #2178 + #2634 (what this card needs to reach the world). Then the same with this PR (7bb3eba, merges cleanly; only_a_root_descriptors_dword_four_is_a_view_offset passes here). Scripted input walks in the prologue from 150 s.

base base + this PR
runs 1 2
end stopped by me at 6 min, no removal 0x887A0006 at 133 s and at 81 s
a root view's offset drops per frame 259 0
world frame, median (frames with no pipelines being made) 815 ms (GPU 421 ms) 2.5-4 s (GPU 2.0-3.1 s), 2 samples before the removal
longest host submission 6 slow ones, all short 14.9 s and 15.5 s, each 2 lists

So the fix does what it says on NVIDIA too: the drop class is gone, and the builder programs the thread names (3b90165a77d95cdf, f6e47efa50226beb, 6f6a359d1166bb27, 5e68767498c57eb6 and the rest) run. But on this card what they then submit does not fit the timeout. In the second run, with VICTORY_D3D12_DRED=1, the removal follows a 2-list submission of 17,406 commands (the first list alone 11,969). DRED's stop is at an ordinary texture upload in that first list, so I read it as where the GPU was at 8 s, not as the cause. Three nvlddmkm resets at the moment of removal; no event 13.

That matches the 5080/Linux report in #1968's thread of the builder list running past the timeout until #2167. So on NVIDIA this PR seems to need the builder's work cut into smaller submissions (or made cheaper) to land without turning a running world into a hang. I haven't tried #2167 or #2214 with it yet.

AI-assisted (Claude Code); the runs are on my machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179317530 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7179317530). Originally posted by [davesousa](https://github.com/davesousa) on 2026-11-26T00:59:36Z. --- NVIDIA in-game A/B: RTX 3070 Ti 8 GB (Ampere), driver 621.40, Windows 11 26200, TDR delay 8 s. `diag` build, warm caches. Base: `main` `63bcca4` + #2319 + #2178 + #2634 (what this card needs to reach the world). Then the same with this PR (`7bb3eba`, merges cleanly; `only_a_root_descriptors_dword_four_is_a_view_offset` passes here). Scripted input walks in the prologue from 150 s. | | base | base + this PR | |---|---|---| | runs | 1 | 2 | | end | stopped by me at 6 min, no removal | `0x887A0006` at 133 s and at 81 s | | `a root view's offset` drops per frame | 259 | 0 | | world frame, median (frames with no pipelines being made) | 815 ms (GPU 421 ms) | 2.5-4 s (GPU 2.0-3.1 s), 2 samples before the removal | | longest host submission | 6 slow ones, all short | 14.9 s and 15.5 s, each 2 lists | So the fix does what it says on NVIDIA too: the drop class is gone, and the builder programs the thread names (`3b90165a77d95cdf`, `f6e47efa50226beb`, `6f6a359d1166bb27`, `5e68767498c57eb6` and the rest) run. But on this card what they then submit does not fit the timeout. In the second run, with `VICTORY_D3D12_DRED=1`, the removal follows a 2-list submission of 17,406 commands (the first list alone 11,969). DRED's stop is at an ordinary texture upload in that first list, so I read it as where the GPU was at 8 s, not as the cause. Three `nvlddmkm` resets at the moment of removal; no event 13. That matches the 5080/Linux report in #1968's thread of the builder list running past the timeout until #2167. So on NVIDIA this PR seems to need the builder's work cut into smaller submissions (or made cheaper) to land without turning a running world into a hang. I haven't tried #2167 or #2214 with it yet. AI-assisted (Claude Code); the runs are on my machine.
crashbashash commented 2026-11-26 02:06:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by crashbashash on 2026-11-26T01:13:55Z.


AMD data point for comparison with the RTX 3070 Ti above: RX 6800 XT (RDNA2), Linux, Mesa RADV 26.2.6,
vkd3d-proton 71cae091b (GE-Proton11-14 with a newer vkd3d-proton), diag build of main 219878a plus our Linux
commits, the same prison scene from a save, 120 s in the world, idle machine.

without this PR with it
runs 2 2
draws and dispatches dropped per frame (median) 254, 355 2, 4
world frame, median 700, 779 ms 794, 746 ms
GPU time per frame, median 205, 214 ms 221, 210 ms
device removals or hangs none none

So on RDNA2 the builder's work lands at most at a small GPU cost (a few ms a frame, within run-to-run noise here),
unlike on Ampere. In the same runs nothing in the picture changed that I could attribute to it.

AI-assisted (Claude Code). No game data attached.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179565016 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7179565016). Originally posted by [crashbashash](https://github.com/crashbashash) on 2026-11-26T01:13:55Z. --- AMD data point for comparison with the RTX 3070 Ti above: RX 6800 XT (RDNA2), Linux, Mesa RADV 26.2.6, vkd3d-proton `71cae091b` (GE-Proton11-14 with a newer vkd3d-proton), `diag` build of `main` `219878a` plus our Linux commits, the same prison scene from a save, 120 s in the world, idle machine. | | without this PR | with it | |---|---|---| | runs | 2 | 2 | | draws and dispatches dropped per frame (median) | 254, 355 | 2, 4 | | world frame, median | 700, 779 ms | 794, 746 ms | | GPU time per frame, median | 205, 214 ms | 221, 210 ms | | device removals or hangs | none | none | So on RDNA2 the builder's work lands at most at a small GPU cost (a few ms a frame, within run-to-run noise here), unlike on Ampere. In the same runs nothing in the picture changed that I could attribute to it. AI-assisted (Claude Code). No game data attached.
davesousa commented 2026-11-26 02:07:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by davesousa on 2026-11-26T01:21:18Z.


Follow-up: the same card and base, with this PR and #2167 (3cb308d, rebased on 63bcca4, merges cleanly; its mark and memory tests pass here), shader cache and pipelines rebuilt.

this PR this PR + #2167
end 0x887A0006 at 133 s and 81 s 0x887A0006 at 101 s (1 run)
the long 2-list submission 14.9 s, 15.5 s 11.1 s
commands in it 17,406 19,268

So #2167 takes about a quarter off, but not enough for an 8 s TDR here.

With VICTORY_GPU_TIMING=1 (each list run on its own; its times are inflated, FIND-29), a single list of 10,730 commands is what removes the device: slow host list ms=21168. DRED's stop is inside a barrier-free run of about 400 commands (1,267..1,668) that starts at dispatch 4x1x1 [compute f6e47efa50226beb], one of the builder programs this PR lets through. The per-command times in that list came back 0 because the device was gone, so I can't single out one dispatch. On this card the builder's work needs to reach the GPU in more than one submission (or with barriers that let the timeout breathe) before this PR can land without a hang on NVIDIA.

AI-assisted (Claude Code); the runs are on my machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179690286 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7179690286). Originally posted by [davesousa](https://github.com/davesousa) on 2026-11-26T01:21:18Z. --- Follow-up: the same card and base, with this PR and #2167 (`3cb308d`, rebased on `63bcca4`, merges cleanly; its mark and memory tests pass here), shader cache and pipelines rebuilt. | | this PR | this PR + #2167 | |---|---|---| | end | `0x887A0006` at 133 s and 81 s | `0x887A0006` at 101 s (1 run) | | the long 2-list submission | 14.9 s, 15.5 s | 11.1 s | | commands in it | 17,406 | 19,268 | So #2167 takes about a quarter off, but not enough for an 8 s TDR here. With `VICTORY_GPU_TIMING=1` (each list run on its own; its times are inflated, FIND-29), a single list of 10,730 commands is what removes the device: `slow host list ms=21168`. DRED's stop is inside a barrier-free run of about 400 commands (1,267..1,668) that starts at `dispatch 4x1x1 [compute f6e47efa50226beb]`, one of the builder programs this PR lets through. The per-command times in that list came back 0 because the device was gone, so I can't single out one dispatch. On this card the builder's work needs to reach the GPU in more than one submission (or with barriers that let the timeout breathe) before this PR can land without a hang on NVIDIA. AI-assisted (Claude Code); the runs are on my machine.
davesousa commented 2026-11-26 03:05:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by davesousa on 2026-11-26T02:34:52Z.


Follow-up 2: the same card and base (63bcca4 + #2319 + #2178 + #2634), this PR with #2118 and, separately, with #2841. Scripted walking from 150 s, 10-minute runs, warm caches (the #2841 build got its own shader cache and pipelines first). Both merge cleanly on this stack; #2118's three tests pass here.

this PR + #2118 (af8b9ad) + #2841 (274cdad)
runs 2 2 (one with DRED) 2 (one with DRED and VICTORY_GPU_TIMING=1)
end 0x887A0006 at 133 s and 81 s no removal, both stopped by me at 10 min GPU lost at 97 s (0x887A0006) and at about 90 s
longest host submission 14.9 s, 15.5 s 1.3 s, 0.64 s 13.1 s; in the timing run one list of 10,747 commands, 14.0 s
a root view's offset drops 0 0 0
world frame, median (2 samples, 2.5-4 s) 809 ms (GPU 430), 702 ms (GPU 352) (did not get that far)

For comparison, the base without this PR, summarised the same way: 835 ms median (GPU 431), longest submission 0.78 s. My first comment's 815 ms picked its frames slightly differently.

With #2118 the builder never starts on this card: BVH builder held back: not all its pipelines are made pipelines=53 made=44 refused=9 at the first world frame, and it stays held back for the whole run. The 9 are programs this card cannot make (its wave64 ones; the driver returns 0x80070057). So the resets need the builder dispatches this PR lets through, and on a 32-lane NVIDIA card those run without the 9, which is the case #2118 is for. With #2118, this PR lands here without a reset and keeps its drop count at 0.

#2841 on its own does not change that. Its thread-count path does run here (4ddd6f9702fab2a7 and 5062bc7a48e842f8 get their cut-short pipelines), but the long submission and the reset stay. The timing run has no DRED stop: VIctory crashed while writing its device-removed report.

Not tested here: the builder running whole on NVIDIA, which needs the wave64 work in #439/#2214. So whether its whole work fits the timeout on this card is still open.

AI-assisted (Claude Code); the runs are on my machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7180933443 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7180933443). Originally posted by [davesousa](https://github.com/davesousa) on 2026-11-26T02:34:52Z. --- Follow-up 2: the same card and base (`63bcca4` + #2319 + #2178 + #2634), this PR with #2118 and, separately, with #2841. Scripted walking from 150 s, 10-minute runs, warm caches (the #2841 build got its own shader cache and pipelines first). Both merge cleanly on this stack; #2118's three tests pass here. | | this PR | + #2118 (`af8b9ad`) | + #2841 (`274cdad`) | |---|---|---|---| | runs | 2 | 2 (one with DRED) | 2 (one with DRED and `VICTORY_GPU_TIMING=1`) | | end | `0x887A0006` at 133 s and 81 s | **no removal**, both stopped by me at 10 min | GPU lost at 97 s (`0x887A0006`) and at about 90 s | | longest host submission | 14.9 s, 15.5 s | 1.3 s, 0.64 s | 13.1 s; in the timing run one list of 10,747 commands, 14.0 s | | `a root view's offset` drops | 0 | 0 | 0 | | world frame, median | (2 samples, 2.5-4 s) | 809 ms (GPU 430), 702 ms (GPU 352) | (did not get that far) | For comparison, the base without this PR, summarised the same way: 835 ms median (GPU 431), longest submission 0.78 s. My first comment's 815 ms picked its frames slightly differently. With #2118 the builder never starts on this card: `BVH builder held back: not all its pipelines are made pipelines=53 made=44 refused=9` at the first world frame, and it stays held back for the whole run. The 9 are programs this card cannot make (its wave64 ones; the driver returns 0x80070057). So the resets need the builder dispatches this PR lets through, and on a 32-lane NVIDIA card those run without the 9, which is the case #2118 is for. With #2118, this PR lands here without a reset and keeps its drop count at 0. #2841 on its own does not change that. Its thread-count path does run here (`4ddd6f9702fab2a7` and `5062bc7a48e842f8` get their cut-short pipelines), but the long submission and the reset stay. The timing run has no DRED stop: VIctory crashed while writing its device-removed report. Not tested here: the builder running whole on NVIDIA, which needs the wave64 work in #439/#2214. So whether its whole work fits the timeout on this card is still open. AI-assisted (Claude Code); the runs are on my machine.
Dukestar69 commented 2026-11-26 04:23:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T04:23:36Z.

Review: APPROVED


Tested merged onto origin/main (63bcca4) on Windows 11 x64:

  • cargo test -p victory-gpu --lib draw::tests::only_a_root_descriptors_dword_four_is_a_view_offset: 1 passed, 0 failed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6068526454 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#pullrequestreview-6068526454). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T04:23:36Z. **Review:** APPROVED --- Tested merged onto `origin/main` (`63bcca4`) on Windows 11 x64: - `cargo test -p victory-gpu --lib draw::tests::only_a_root_descriptors_dword_four_is_a_view_offset`: **1 passed, 0 failed**. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
lhnizdo commented 2026-11-26 09:06:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-26T08:04:05Z.


A data point from a 32-lane NVIDIA card, in case it helps: with this change, the first frames in the world became heavy enough here to trip Windows' 2-second GPU timeout.

  • Setup: RTX 2080 (driver 32.0.16.1742), Windows 10 19045, TdrDelay at its default (2 s), a story save that loads straight into the world.
  • Stack: main 63bcca4 plus #2460, #2461, #2464 and some local work that isn't upstream: #1960 and an experimental console mode for wave64 programs on 32-lane hosts. So this isn't plain main. The only difference between the two sets of runs is #2703.
  • Without #2703: two 10-minute runs reached the world with no device removal. The slowest single submission was 1.1 s.
  • With #2703: six runs on the same stack all lost the device (DXGI_ERROR_DEVICE_HUNG) as the world appeared. Right before it, a single submission took 2.9–3.5 s, once 12 s. DRED's in-flight command moved from run to run (e30970f1727063fd, 3b90165a77d95cdf, cb9647e77864cb3a): the GPU was simply past the timeout, not stuck on one command.

My reading is that the change makes programs that read a root constant's dword 4 get their real value and do their real work, which is presumably correct (@Anzymanz saw fewer dropped draws with it). On a slower card the first world frames then cross 2 s, so raising TdrDelay (as victory_gpu::tdr's warning suggests) would be needed. I haven't measured it with a raised TdrDelay yet.

AI-assisted (Claude Code); the runs were on my machine. No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7186146968 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7186146968). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-26T08:04:05Z. --- A data point from a 32-lane NVIDIA card, in case it helps: with this change, the first frames in the world became heavy enough here to trip Windows' 2-second GPU timeout. - **Setup:** RTX 2080 (driver 32.0.16.1742), Windows 10 19045, `TdrDelay` at its default (2 s), a story save that loads straight into the world. - **Stack:** `main` `63bcca4` plus #2460, #2461, #2464 and some local work that isn't upstream: #1960 and an experimental console mode for wave64 programs on 32-lane hosts. So this isn't plain `main`. The only difference between the two sets of runs is #2703. - **Without #2703:** two 10-minute runs reached the world with no device removal. The slowest single submission was 1.1 s. - **With #2703:** six runs on the same stack all lost the device (`DXGI_ERROR_DEVICE_HUNG`) as the world appeared. Right before it, a single submission took 2.9–3.5 s, once 12 s. DRED's in-flight command moved from run to run (`e30970f1727063fd`, `3b90165a77d95cdf`, `cb9647e77864cb3a`): the GPU was simply past the timeout, not stuck on one command. My reading is that the change makes programs that read a root constant's dword 4 get their real value and do their real work, which is presumably correct (@Anzymanz saw fewer dropped draws with it). On a slower card the first world frames then cross 2 s, so raising `TdrDelay` (as `victory_gpu::tdr`'s warning suggests) would be needed. I haven't measured it with a raised `TdrDelay` yet. AI-assisted (Claude Code); the runs were on my machine. No game data.
arogan178 commented 2026-11-26 11:04:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by arogan178 on 2026-11-26T10:39:23Z.


Confirmed in game: this removes almost all dropped draws and dispatches on AMD under Proton, with no new translation failures.

Setup: GTA VI 1.0.2.1, RX 9070 XT, Linux/Proton (vkd3d-proton). Diag builds of main 63bcca4 with and without this PR. #1722 was applied locally in both runs for the pipeline library.

Heavy scenes (>3000 draws/frame), ~20 five-second reports per run:

main main + #2703
dropped draws + dispatches/frame 288 5
fps 1.50 1.53
GPU ms/frame 155 164
  • On main, nearly all of the heavy-scene drops (~285/frame) were a root view's offset: no root view, or outside title buffers, across 11 compute shaders. With this PR that reason never appears.
  • Both runs log the same 7 shader does not translate hashes. None are new.
  • GPU time rises ~6% because that work now runs. fps is unchanged; the GPU is not the limit in this setup.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7189655192 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7189655192). Originally posted by [arogan178](https://github.com/arogan178) on 2026-11-26T10:39:23Z. --- Confirmed in game: this removes almost all dropped draws and dispatches on AMD under Proton, with no new translation failures. Setup: GTA VI 1.0.2.1, RX 9070 XT, Linux/Proton (vkd3d-proton). Diag builds of `main` 63bcca4 with and without this PR. #1722 was applied locally in both runs for the pipeline library. Heavy scenes (>3000 draws/frame), ~20 five-second reports per run: | | main | main + #2703 | |---|---|---| | dropped draws + dispatches/frame | 288 | 5 | | fps | 1.50 | 1.53 | | GPU ms/frame | 155 | 164 | - On `main`, nearly all of the heavy-scene drops (~285/frame) were `a root view's offset: no root view, or outside title buffers`, across 11 compute shaders. With this PR that reason never appears. - Both runs log the same 7 `shader does not translate` hashes. None are new. - GPU time rises ~6% because that work now runs. fps is unchanged; the GPU is not the limit in this setup.
fuzeofficlal commented 2026-11-26 11:04:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T11:04:56Z.

Review: APPROVED


Verified 7bb3ebaf locally on Windows 11 (RTX 5090 and WARP, with VICTORY_D3D12_DEBUG=1):

  • cargo xtask policy and cargo clippy -p victory-gpu --tests -- -D warnings (default and --all-features): clean.
  • draw::tests (12/12, including only_a_root_descriptors_dword_four_is_a_view_offset): passed on RTX 5090, RTX 5090 + VICTORY_D3D12_DEBUG=1, and WARP + VICTORY_D3D12_DEBUG=1.

Checked every other ROOT_VIEW_OFFSET / ROOT_SRV_VIEW / ROOT_UAV_VIEW / is_root_view site across the workspace; this branch in State::bind was the only place missing the RootType::Descriptor guard (matching is_root_view). Clean, minimal fix — ready to merge.

<!-- greyfinch-sync:Marvisak/VIctory:review:6073016298 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#pullrequestreview-6073016298). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T11:04:56Z. **Review:** APPROVED --- Verified `7bb3ebaf` locally on Windows 11 (RTX 5090 and WARP, with `VICTORY_D3D12_DEBUG=1`): - `cargo xtask policy` and `cargo clippy -p victory-gpu --tests -- -D warnings` (default and `--all-features`): clean. - `draw::tests` (12/12, including `only_a_root_descriptors_dword_four_is_a_view_offset`): passed on RTX 5090, RTX 5090 + `VICTORY_D3D12_DEBUG=1`, and WARP + `VICTORY_D3D12_DEBUG=1`. Checked every other `ROOT_VIEW_OFFSET` / `ROOT_SRV_VIEW` / `ROOT_UAV_VIEW` / `is_root_view` site across the workspace; this branch in `State::bind` was the only place missing the `RootType::Descriptor` guard (matching `is_root_view`). Clean, minimal fix — ready to merge.
lhnizdo commented 2026-11-26 12:05:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-26T11:09:29Z.


Follow-up to my comment above, now measured with a raised TdrDelay: on this 32-lane card the change needs #2118 alongside it, and with both there is no reset.

  • Setup: RTX 2080 (driver 32.0.16.1742), Windows 10 19045, TdrDelay 10 s and TdrDdiDelay 20 s. Same stack as before (main 63bcca4 plus #2460, #2461, #2464 and the local wave64 work), same story save that loads straight into the world. 12-minute runs.
without this PR this PR + #2118 (af8b9ad)
device removal none none
longest host submission 2.4 s 2.5 s
dropped a root view's offset: no root view, or outside title buffers ~248 a frame (7 compute programs) 0
all dropped draws and dispatches ~526 a frame ~285 a frame
BVH builder — held back the whole run: pipelines=53 made=45 refused=8

So @davesousa's reading holds here too. My earlier resets with this PR (submissions of 2.9–12 s) look like the builder running without the 8 wave64 programs this card refuses. With #2118 holding the builder back, the submissions stay where they were without this PR. The rest of the drops in the right column are local diagnostics skipping programs on purpose, plus ~20 a frame for programs that don't translate here. None of it comes from this PR.

One unrelated note in case it saves someone time: with TdrDelay at 10 s, the programs I had blamed for hangs earlier ran fine. They had just been over 2 s. Raising it is worth doing before reading a device removal on a slower card as a stuck program.

AI-assisted (Claude Code); the runs were on my machine. No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7190349186 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7190349186). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-26T11:09:29Z. --- Follow-up to my comment above, now measured with a raised `TdrDelay`: on this 32-lane card the change needs #2118 alongside it, and with both there is no reset. - **Setup:** RTX 2080 (driver 32.0.16.1742), Windows 10 19045, `TdrDelay` 10 s and `TdrDdiDelay` 20 s. Same stack as before (`main` `63bcca4` plus #2460, #2461, #2464 and the local wave64 work), same story save that loads straight into the world. 12-minute runs. | | without this PR | this PR + #2118 (`af8b9ad`) | |---|---:|---:| | device removal | none | **none** | | longest host submission | 2.4 s | 2.5 s | | dropped `a root view's offset: no root view, or outside title buffers` | ~248 a frame (7 compute programs) | **0** | | all dropped draws and dispatches | ~526 a frame | ~285 a frame | | BVH builder | — | held back the whole run: `pipelines=53 made=45 refused=8` | So @davesousa's reading holds here too. My earlier resets with this PR (submissions of 2.9–12 s) look like the builder running without the 8 wave64 programs this card refuses. With #2118 holding the builder back, the submissions stay where they were without this PR. The rest of the drops in the right column are local diagnostics skipping programs on purpose, plus ~20 a frame for programs that don't translate here. None of it comes from this PR. One unrelated note in case it saves someone time: with `TdrDelay` at 10 s, the programs I had blamed for hangs earlier ran fine. They had just been over 2 s. Raising it is worth doing before reading a device removal on a slower card as a stuck program. AI-assisted (Claude Code); the runs were on my machine. No game data.
JurajSimicevic commented 2026-11-26 14:01:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by JurajSimicevic on 2026-11-26T13:15:20Z.


Blackwell data point: this PR with #2118, on top of #2461

Setup:

  • RTX 5080 (32-lane waves), driver 617.42, Windows 11 26200.
  • Diag build of main 63bcca4 + #2178 + #2461 (6544a52), with and without this PR (7bb3eba) and #2118 (af8b9ad). All of them merge cleanly.
  • #1968's program A skipped, VICTORY_D3D12_DRED=1, warm caches.
  • One run per build, about 6 minutes in the world, camera turning.
without this PR + #2118
a root view's offset: no root view, or outside title buffers report lines in the world 509 0
a dispatch of the BVH builder held back — logged at the world's first frames
longest slow host submission 4.8 s 4.6 s
most draws in a frame 10,190 11,690
device removed no no

This matches lhnizdo's RTX 2080 and davesousa's RTX 3070 Ti results above. The root-view drops are gone, and with the builder held back, no submission gets longer than before. I didn't run this PR without #2118 on this card.

Local diagnostics only. No game data: log counts only.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7193086066 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7193086066). Originally posted by [JurajSimicevic](https://github.com/JurajSimicevic) on 2026-11-26T13:15:20Z. --- **Blackwell data point: this PR with #2118, on top of #2461** Setup: - RTX 5080 (32-lane waves), driver 617.42, Windows 11 26200. - Diag build of `main` `63bcca4` + #2178 + #2461 (`6544a52`), with and without this PR (`7bb3eba`) and #2118 (`af8b9ad`). All of them merge cleanly. - #1968's program A skipped, `VICTORY_D3D12_DRED=1`, warm caches. - One run per build, about 6 minutes in the world, camera turning. | | without | this PR + #2118 | |---|---:|---:| | `a root view's offset: no root view, or outside title buffers` report lines in the world | 509 | **0** | | `a dispatch of the BVH builder held back` | — | logged at the world's first frames | | longest slow host submission | 4.8 s | 4.6 s | | most draws in a frame | 10,190 | 11,690 | | device removed | no | no | This matches lhnizdo's RTX 2080 and davesousa's RTX 3070 Ti results above. The root-view drops are gone, and with the builder held back, no submission gets longer than before. I didn't run this PR without #2118 on this card. Local diagnostics only. No game data: log counts only. AI-assisted.
Jackster commented 2026-11-26 15:02:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T14:30:31Z.


A named program this restores, and the scale of the effect on the title

On the retail build (RX 7900 XTX, driver 32.0.32029.2010, Windows 10 26300.10075, 300 s world runs, diagnostics build at 63bcca4 plus a stack of open PRs), the difference this makes on one program and on the frame:

  • On unpatched main, compute c85822de2e41cfaa translates and makes its pipeline, then is dropped at dispatch with: a root view's offset: no root view, or outside title buffers [compute c85822de2e41cfaa], about 5 draws/frame. With this PR in the tree the same program binds and the drop disappears.
  • Across the frame, the "a root view's offset" refusals went from 336 logged lines over 11 programs (up to 402 draws dropped in a frame) to 0, and dropped/frame from 431 (1,216 still being made) to 64 and then 0 as the queue drained. Shaders translated in the run rose from 500 to 1,711 because those programs now reach the device.

Those numbers are from a 300 s A/B on the same save with this PR as the only difference in the second step; the per-program line above is from a VICTORY_LOG=victory=info run and is reproducible by grepping for the hash.

The per-program name is the part this PR's description does not have, and it is the same class as #3094's report — a root constant's dword 4 read as a view offset.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7194920613 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7194920613). Originally posted by [Jackster](https://github.com/Jackster) on 2026-11-26T14:30:31Z. --- **A named program this restores, and the scale of the effect on the title** On the retail build (RX 7900 XTX, driver 32.0.32029.2010, Windows 10 26300.10075, 300 s world runs, diagnostics build at `63bcca4` plus a stack of open PRs), the difference this makes on one program and on the frame: - On unpatched `main`, compute `c85822de2e41cfaa` translates and makes its pipeline, then is dropped at dispatch with: `a root view's offset: no root view, or outside title buffers [compute c85822de2e41cfaa]`, about 5 draws/frame. With this PR in the tree the same program binds and the drop disappears. - Across the frame, the "a root view's offset" refusals went from 336 logged lines over 11 programs (up to 402 draws dropped in a frame) to 0, and `dropped/frame` from 431 (1,216 still being made) to 64 and then 0 as the queue drained. Shaders translated in the run rose from 500 to 1,711 because those programs now reach the device. Those numbers are from a 300 s A/B on the same save with this PR as the only difference in the second step; the per-program line above is from a `VICTORY_LOG=victory=info` run and is reproducible by grepping for the hash. The per-program name is the part this PR's description does not have, and it is the same class as #3094's report — a root constant's dword 4 read as a view offset. Written with an AI assistant.
zed6000 commented 2026-11-26 16:45:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by zed6000 on 2026-11-26T16:45:39Z.


Tried in the game: this removes every a root view's offset drop in the intro, on AMD.

Setup: RX 7900 XTX (RDNA3), driver 32.0.32029.2010, Windows 11 26200, Ryzen 9 7900X3D; diag builds (--profile diag --features diagnostics), Series X profile, played by hand from boot into the intro cutscene. Warm caches (the counts below exclude the AMD driver's first-run compile).

build report windows dispatch: a root view's offset: no root view, or outside title buffers other drops, once warm fps, warm
main 63bcca4 21 in 9 windows: 60 to 1,060 dispatches/frame (median about 560), 11 compute pipelines indirect "no host pipeline", 8 shaders that do not translate 1–2
the #1247 shader stack + this PR (7bb3ebaf cherry-picked cleanly) 104 none 0 dropped draws/frame and 0 dropped indirect in every warm window 1.4–2.4

The release build of the stack without this PR still dropped 200–370 draws/frame in the same scene (posted on #400), and its shaders all translate, so this reason accounted for most of what remained there. No new warnings and no hang. The intro draws far more of the scene; some surfaces (skin) still look too dark, which this PR would not be expected to change.

#2295 makes the same change, so it should behave the same; I only ran this one.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7198060620 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7198060620). Originally posted by [zed6000](https://github.com/zed6000) on 2026-11-26T16:45:39Z. --- **Tried in the game: this removes every `a root view's offset` drop in the intro, on AMD.** **Setup:** RX 7900 XTX (RDNA3), driver 32.0.32029.2010, Windows 11 26200, Ryzen 9 7900X3D; diag builds (`--profile diag --features diagnostics`), Series X profile, played by hand from boot into the intro cutscene. Warm caches (the counts below exclude the AMD driver's first-run compile). | build | report windows | `dispatch: a root view's offset: no root view, or outside title buffers` | other drops, once warm | fps, warm | |---|---:|---|---|---:| | `main` `63bcca4` | 21 | in 9 windows: 60 to 1,060 dispatches/frame (median about 560), 11 compute pipelines | indirect "no host pipeline", 8 shaders that do not translate | 1–2 | | the #1247 shader stack + this PR (`7bb3ebaf` cherry-picked cleanly) | 104 | **none** | **0 dropped draws/frame** and 0 dropped indirect in every warm window | 1.4–2.4 | The release build of the stack *without* this PR still dropped 200–370 draws/frame in the same scene (posted on #400), and its shaders all translate, so this reason accounted for most of what remained there. No new warnings and no hang. The intro draws far more of the scene; some surfaces (skin) still look too dark, which this PR would not be expected to change. #2295 makes the same change, so it should behave the same; I only ran this one.
lhnizdo commented 2026-11-26 16:51:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-26T16:51:17Z.


@zed6000, thanks, that matches what I saw on NVIDIA. On an RTX 2080 in the world, root-view drops went from about 248 dispatches a frame to 0.

One note for anyone trying this on a 32-lane NVIDIA card: there it needs #2118 alongside. Without it, the BVH builder's dispatches run while the card refuses some of its wave64 programs. On the RTX 2080 that gave single submissions of 12–15 s and a device reset in the world, and @davesousa saw the same on an RTX 3070 Ti. With #2118 holding the builder back, the longest submission stayed at about 2.5 s, the same as without this PR. JurajSimicevic's RTX 5080 run with both agrees. On your RX 7900 XTX the builder's programs all run, so the PR stands on its own there.

AI-assisted (Claude Code). No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7198180658 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7198180658). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-26T16:51:17Z. --- @zed6000, thanks, that matches what I saw on NVIDIA. On an RTX 2080 in the world, root-view drops went from about 248 dispatches a frame to 0. One note for anyone trying this on a **32-lane NVIDIA card**: there it needs #2118 alongside. Without it, the BVH builder's dispatches run while the card refuses some of its wave64 programs. On the RTX 2080 that gave single submissions of 12–15 s and a device reset in the world, and @davesousa saw the same on an RTX 3070 Ti. With #2118 holding the builder back, the longest submission stayed at about 2.5 s, the same as without this PR. JurajSimicevic's RTX 5080 run with both agrees. On your RX 7900 XTX the builder's programs all run, so the PR stands on its own there. AI-assisted (Claude Code). No game data.
AIcelos commented 2026-11-26 21:37:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AIcelos on 2026-11-26T21:37:21Z.


Tested on Linux + NVIDIA (Wine) — this stack now boots GTA VI v1.0.2.1 to a running game window.

Setup that works today (merged all open PRs in branch nvidia-wine):

  • Cross-build from Linux: cargo xwin build --profile diag -p victory --features diagnostics --target x86_64-pc-windows-msvc
  • Wine 10 prefix + vkd3d-proton d3d12.dll/d3d12core.dll and DXVK dxgi.dll from GE-Proton 11-14 copied to system32/, WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n,builtin"
  • Do NOT copy dxil.dll: Wine's built-in (Wine-mono) DXBC builder works; NVIDIA's Windows dxil.dll cannot load under Wine and blocks vkd3d-proton. (The team gist "remove all D3D12/DXGI/DXIL + builtin override" fails on stock wine — wine 10 ships no d3d12.dll of its own.)
  • Fixes in this branch that made it work: versioned dxcompiler_NN.dll fallback (Wine's is unversioned), IDxcContainerBuilder v1→v2→v3 retry, root-signature fallback, VICTORY_CACHE_DIR.

Result on RTX 5090: window appears, swapchain presents (frame 2048+ in 90 s ≈ 20 fps diag build), all 49 ttpf + packs open via dstorage, XUserAddAsync offline user, 52 shaders translated through Wine's dxil→DXBC path. No crash.

The "XCL requires Windows" premise is wrong: the whole layer runs under Wine with vkd3d-proton; only the host tooling assumed Windows.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7203902874 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7203902874). Originally posted by [AIcelos](https://github.com/AIcelos) on 2026-11-26T21:37:21Z. --- **Tested on Linux + NVIDIA (Wine) — this stack now boots GTA VI v1.0.2.1 to a running game window.** Setup that works today (merged all open PRs in branch `nvidia-wine`): - Cross-build from Linux: `cargo xwin build --profile diag -p victory --features diagnostics --target x86_64-pc-windows-msvc` - Wine 10 prefix + vkd3d-proton `d3d12.dll`/`d3d12core.dll` and DXVK `dxgi.dll` from GE-Proton 11-14 copied to `system32/`, `WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n,builtin"` - **Do NOT copy `dxil.dll`**: Wine's built-in (Wine-mono) DXBC builder works; NVIDIA's Windows `dxil.dll` cannot load under Wine and blocks vkd3d-proton. (The team gist "remove all D3D12/DXGI/DXIL + builtin override" fails on stock wine — wine 10 ships no `d3d12.dll` of its own.) - Fixes in this branch that made it work: versioned `dxcompiler_NN.dll` fallback (Wine's is unversioned), `IDxcContainerBuilder` v1→v2→v3 retry, root-signature fallback, `VICTORY_CACHE_DIR`. Result on RTX 5090: window appears, swapchain presents (frame 2048+ in 90 s ≈ 20 fps diag build), all 49 ttpf + packs open via dstorage, XUserAddAsync offline user, 52 shaders translated through Wine's dxil→DXBC path. No crash. The "XCL requires Windows" premise is wrong: the whole layer runs under Wine with vkd3d-proton; only the *host tooling* assumed Windows.
latentdev commented 2026-11-26 22:05:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by latentdev on 2026-11-26T22:05:04Z.


RTX 4090, the case after the gate: every builder pipeline made, with this PR

As on the 2080 above, #2118 holds the builder on a 32-lane card as long as any stage is refused. This is the next case, which #2118's author suggested raising here: every stage exists, so the builder runs whole.

Tree:

  • main 63bcca4 + #439 without e2d3cfd's limit, so the 7 stages it refuses translate (console flow in halves);
  • #2118 at 999a8f6;
  • this PR's condition (u.root == Descriptor);
  • #2121, #2312, #3102 and others.

Without a loop cap (with #2118's previous head af8b9ad; the gate is open either way when nothing is dropped). BVH builder runs ... made=53 refused=0 dropped=0. Seven frames into the world the device hangs (0x887A0006, nvlddmkm event 153). The list stops in dispatch 1075x1x1 [compute 5552dac6a2b7a1fd]. That program (wave32, [32,1,1]) is a bottom-up refit:

  • each thread buffer_atomic_add ... glc on its node's arrival counter;
  • the first arrival stops;
  • the second reads the node with glc dlc loads and climbs to the parent.

That loop can only fail to end if the parent links form a cycle.

With VICTORY_SHADER_LOOP_LIMIT=4096.

  • The builder runs whole, never held back, with no hang in 9 + 7 minute runs.
  • The ray-traced lighting that reads the structures comes on (screen-probe ray tracing ~33 ms/frame, a light-probe gather ~47 ms, ped skinning for the structures ~55 ms), about +100 ms/frame in all.
  • In the cell window shot, though, the character and the whole room go pure black, where the same shot with the builder held shows them dimly lit. The cap applies to every shader, so it may play a part in that too.

My reading. The hang isn't this PR. A builder stage writes a wrong structure (parent links with a cycle), and the refit is where that shows. The suspects are the stages this PR un-drops (f6e47efa, 3b90165a and the rest of the 11) and the 7 that e2d3cfd keeps out (LDS and sections in console-flow halves). I haven't separated the two groups yet. A per-stage dump of the node buffers would be the next step.

Until then, on a 32-lane card the safe combination stays as above: #439 with e2d3cfd's limit, so #2118 holds the builder.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7204344413 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7204344413). Originally posted by [latentdev](https://github.com/latentdev) on 2026-11-26T22:05:04Z. --- ### RTX 4090, the case after the gate: every builder pipeline made, with this PR As on the 2080 above, #2118 holds the builder on a 32-lane card as long as any stage is refused. This is the next case, which #2118's author suggested raising here: every stage exists, so the builder runs whole. **Tree:** - `main` 63bcca4 + #439 without e2d3cfd's limit, so the 7 stages it refuses translate (console flow in halves); - #2118 at 999a8f6; - this PR's condition (`u.root == Descriptor`); - #2121, #2312, #3102 and others. **Without a loop cap** (with #2118's previous head af8b9ad; the gate is open either way when nothing is dropped). `BVH builder runs ... made=53 refused=0 dropped=0`. Seven frames into the world the device hangs (`0x887A0006`, nvlddmkm event 153). The list stops in `dispatch 1075x1x1 [compute 5552dac6a2b7a1fd]`. That program (wave32, `[32,1,1]`) is a bottom-up refit: - each thread `buffer_atomic_add ... glc` on its node's arrival counter; - the first arrival stops; - the second reads the node with `glc dlc` loads and climbs to the parent. That loop can only fail to end if the parent links form a cycle. **With `VICTORY_SHADER_LOOP_LIMIT=4096`.** - The builder runs whole, never held back, with no hang in 9 + 7 minute runs. - The ray-traced lighting that reads the structures comes on (screen-probe ray tracing ~33 ms/frame, a light-probe gather ~47 ms, ped skinning for the structures ~55 ms), about +100 ms/frame in all. - In the cell window shot, though, the character and the whole room go pure black, where the same shot with the builder held shows them dimly lit. The cap applies to every shader, so it may play a part in that too. **My reading.** The hang isn't this PR. A builder stage writes a wrong structure (parent links with a cycle), and the refit is where that shows. The suspects are the stages this PR un-drops (`f6e47efa`, `3b90165a` and the rest of the 11) and the 7 that e2d3cfd keeps out (LDS and sections in console-flow halves). I haven't separated the two groups yet. A per-stage dump of the node buffers would be the next step. Until then, on a 32-lane card the safe combination stays as above: #439 with e2d3cfd's limit, so #2118 holds the builder.
lhnizdo commented 2026-11-26 22:21:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-26T22:21:38Z.


@latentdev, this matches what I see on an RTX 2080 (32-lane), and I have part of the per-stage answer, from running the builder's own wave64 programs against CPU references.

Setup. I dumped the builder's 53 containers at run time and lowered each wave64 one the way our stack does on 32-lane hosts (the split into two host waves, close to #3147). I ran the real container on the 2080 through title memory, over random input, and compared with a CPU reference of what the program computes. It's synthetic input only, and no game data leaves the machine.

Found and fixed: two split bugs. Together they made lanes 32–63 of every console wave read 0 in the builder's block-wide prefix sums (39321a95, 77360df2, 9fc111d3, 256/512 threads; and f6eb6498, 5e19e7c7, 64 threads):

  • A ds_swizzle checked whether its source lane was active by its console lane in the host wave's 32-lane ballot, so every upper-half source looked inactive.
  • A lane mask written as two s_mov_b32 (s0 = 0, s1 = -1, the scan's "add lane 31" step) was tested by its low dword in both halves.

After the fix all five match their references exactly. 39321a95, 77360df2 and 9fc111d3 are three of the 7 stages e2d3cfd keeps out, so they may be worth checking on your translation too.

Checked and correct on ours: the radix sort pass e63d22c4 (a local 8-bit sort of 2,048 pairs, then the scatter) and the radix histogram 14394a32 (64-lane compare masks used as data).

Not changed by a split at all (no cross-lane operations; LDS only behind barriers): the bitonic steps 198f6dfd/9205d265, and cb9647e7, 894c9165, 4b5aedc0, a63e2dfc, 5e687674. The tree build itself (a197f50c, f28a33a8, count-leading-zeros on the codes) and the refits are native wave32.

But the hang stays. With all of that fixed, the whole builder still hangs in its first frame here, in a 14.9 s submission. Two wave64 stages are still unverified on my side: 28918b71 and caa78b8c (64 threads; a full-wave scan with dpp8/row_shr/v_permlanex16 and direct exec_lo/exec_hi writes, then node encoding). Those run in our console mode. I'm looking at them next, and at reading the parent buffer back before the refit, to see whether the cycle is already there.

The harness is three local tests in wave64_console_tests.rs on my stack (one_container_block_scan_…, one_container_radix_pass_…, one_container_radix_histogram_…, each taking a container path by env var). I can push them to a branch if they'd help with your translation.

AI-assisted (Claude Code). No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7204605995 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7204605995). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-26T22:21:38Z. --- @latentdev, this matches what I see on an RTX 2080 (32-lane), and I have part of the per-stage answer, from running the builder's own wave64 programs against CPU references. **Setup.** I dumped the builder's 53 containers at run time and lowered each wave64 one the way our stack does on 32-lane hosts (the split into two host waves, close to #3147). I ran the real container on the 2080 through title memory, over random input, and compared with a CPU reference of what the program computes. It's synthetic input only, and no game data leaves the machine. **Found and fixed: two split bugs.** Together they made lanes 32–63 of every console wave read 0 in the builder's block-wide prefix sums (`39321a95`, `77360df2`, `9fc111d3`, 256/512 threads; and `f6eb6498`, `5e19e7c7`, 64 threads): - A `ds_swizzle` checked whether its source lane was active by its console lane in the host wave's 32-lane ballot, so every upper-half source looked inactive. - A lane mask written as two `s_mov_b32` (`s0 = 0`, `s1 = -1`, the scan's "add lane 31" step) was tested by its low dword in both halves. After the fix all five match their references exactly. `39321a95`, `77360df2` and `9fc111d3` are three of the 7 stages e2d3cfd keeps out, so they may be worth checking on your translation too. **Checked and correct on ours:** the radix sort pass `e63d22c4` (a local 8-bit sort of 2,048 pairs, then the scatter) and the radix histogram `14394a32` (64-lane compare masks used as data). **Not changed by a split at all** (no cross-lane operations; LDS only behind barriers): the bitonic steps `198f6dfd`/`9205d265`, and `cb9647e7`, `894c9165`, `4b5aedc0`, `a63e2dfc`, `5e687674`. The tree build itself (`a197f50c`, `f28a33a8`, count-leading-zeros on the codes) and the refits are native wave32. **But the hang stays.** With all of that fixed, the whole builder still hangs in its first frame here, in a 14.9 s submission. Two wave64 stages are still unverified on my side: `28918b71` and `caa78b8c` (64 threads; a full-wave scan with `dpp8`/`row_shr`/`v_permlanex16` and direct `exec_lo`/`exec_hi` writes, then node encoding). Those run in our console mode. I'm looking at them next, and at reading the parent buffer back before the refit, to see whether the cycle is already there. The harness is three local tests in `wave64_console_tests.rs` on my stack (`one_container_block_scan_…`, `one_container_radix_pass_…`, `one_container_radix_histogram_…`, each taking a container path by env var). I can push them to a branch if they'd help with your translation. AI-assisted (Claude Code). No game data.
JurajSimicevic commented 2026-11-26 22:59:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by JurajSimicevic on 2026-11-26T22:59:14Z.


@latentdev @lhnizdo one data point from the other side of the gate, in case it helps you read the picture once the builder works. On a 32-lane card, the combination that is safe from hangs is not safe for the picture.

RTX 5080 tree: main 63bcca4 + #2098, #2626, #2628, #2464, #2118 and #439 at e2d3cfd with its limit; this PR is not in it. That is the combination recommended above: the builder is held back every frame (53 pipelines, 46 made, 7 refused).

What it does in the cell:

  • The cell shows a strong green and red cast.
  • By bisecting with VICTORY_SKIP_PIPELINES, the cast rides on one indirect-lighting chain. Skipping the pass that starts it leaves the cell clean but nearly black, like the room in latentdev's run. Details: #2711 (https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7205018417).
  • In the same part of the frame, 18 consecutive indirect dispatches of that work are dropped. All 18 are refused with the same message as 5 of the builder's 7 refused stages: console wave64 lanes in a group of more than 64 threads.

My reading (not proven): those 18 are the ray-traced lighting stages that come on in latentdev's run once that limit is lifted.

  • With the limit: the chain runs without them, and the stages that do run read data nobody wrote that frame. Result: green.
  • Without the limit: they run on a wrong structure. Result: black.

If that's right, the cell should come out right only when both are in place:

  • wave64 groups of more than 64 threads translate correctly;
  • the builder builds a correct structure.

Until then, an all-or-none rule for that lighting work, like #2118's for the builder, would give a dark but clean cell instead of a green one.

If you push the split fixes or the builder work to a branch, I can run the same cell measurement on the RTX 5080: the lighting buffer's green share at a fixed world frame, plus a screenshot that stays local.

Local diagnostics only. No game data: counts and roles.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7205155608 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7205155608). Originally posted by [JurajSimicevic](https://github.com/JurajSimicevic) on 2026-11-26T22:59:14Z. --- @latentdev @lhnizdo one data point from the other side of the gate, in case it helps you read the picture once the builder works. **On a 32-lane card, the combination that is safe from hangs is not safe for the picture.** **RTX 5080 tree:** `main` `63bcca4` + #2098, #2626, #2628, #2464, #2118 and #439 at `e2d3cfd` with its limit; this PR is not in it. That is the combination recommended above: the builder is held back every frame (53 pipelines, 46 made, 7 refused). **What it does in the cell:** - The cell shows a strong green and red cast. - By bisecting with `VICTORY_SKIP_PIPELINES`, the cast rides on one indirect-lighting chain. Skipping the pass that starts it leaves the cell clean but nearly black, like the room in latentdev's run. Details: #2711 (https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7205018417). - In the same part of the frame, 18 consecutive indirect dispatches of that work are dropped. All 18 are refused with the same message as 5 of the builder's 7 refused stages: `console wave64 lanes in a group of more than 64 threads`. **My reading (not proven):** those 18 are the ray-traced lighting stages that come on in latentdev's run once that limit is lifted. - **With the limit:** the chain runs without them, and the stages that do run read data nobody wrote that frame. Result: green. - **Without the limit:** they run on a wrong structure. Result: black. If that's right, the cell should come out right only when both are in place: - wave64 groups of more than 64 threads translate correctly; - the builder builds a correct structure. Until then, an all-or-none rule for that lighting work, like #2118's for the builder, would give a dark but clean cell instead of a green one. If you push the split fixes or the builder work to a branch, I can run the same cell measurement on the RTX 5080: the lighting buffer's green share at a fixed world frame, plus a screenshot that stays local. Local diagnostics only. No game data: counts and roles. AI-assisted.
latentdev commented 2026-11-26 23:08:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by latentdev on 2026-11-26T23:08:13Z.


@lhnizdo thanks, that's a big step. I checked both patterns on our translation (#439's console flow plus #2214's multi-wave groups) with two hardware tests. Each runs one group of 64 on the RTX 4090 (split into 32-lane halves) and on the 7950X3D's Radeon iGPU (native wave64), and compares every lane.

  • A mask written as two dwords (s_mov_b32 s10, 0, s_mov_b32 s11, -1), used as a v_cndmask_b32 mask and as exec: exact on both; lanes 32-63 see the high dword.
  • ds_swizzle_b32 xor 16 (BITMASK_PERM) in the console flow, with all lanes active and with lanes 48-63 inactive: identical on both. Lanes 32-47 read 0 when their source lane is inactive.

So neither bug is what breaks the structure in our tree; it has to come from somewhere else. Your harness would help a lot. Running 39321a95, 77360df2, 9fc111d3, 28918b71 and caa78b8c against your CPU references with our lowering would show whether one of them is it. If you push the tests to a branch, I'll run them here on both adapters and report back.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7205285281 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7205285281). Originally posted by [latentdev](https://github.com/latentdev) on 2026-11-26T23:08:13Z. --- @lhnizdo thanks, that's a big step. I checked both patterns on our translation (#439's console flow plus #2214's multi-wave groups) with two hardware tests. Each runs one group of 64 on the RTX 4090 (split into 32-lane halves) and on the 7950X3D's Radeon iGPU (native wave64), and compares every lane. - **A mask written as two dwords** (`s_mov_b32 s10, 0`, `s_mov_b32 s11, -1`), used as a `v_cndmask_b32` mask and as `exec`: exact on both; lanes 32-63 see the high dword. - **`ds_swizzle_b32` xor 16** (BITMASK_PERM) in the console flow, with all lanes active and with lanes 48-63 inactive: identical on both. Lanes 32-47 read 0 when their source lane is inactive. So neither bug is what breaks the structure in our tree; it has to come from somewhere else. Your harness would help a lot. Running `39321a95`, `77360df2`, `9fc111d3`, `28918b71` and `caa78b8c` against your CPU references with our lowering would show whether one of them is it. If you push the tests to a branch, I'll run them here on both adapters and report back.
latentdev commented 2026-11-27 00:51:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by latentdev on 2026-11-27T00:51:16Z.


Follow-up, going further on the stages you named. I ran the builder's own code for their cross-lane parts. For each stage I took its instruction words and replaced only the memory loads and stores with a known input and the test output. I then compared every lane between the RTX 4090 (split) and the Radeon iGPU (native wave64).

  • 39321a95 / 77360df2 (the same scan core): the five masked ds_swizzle steps, the lane-31 carry, the per-wave totals in LDS and the loop over earlier waves, at 64, 128, 256 and 512 threads. I also ran the tail that picks the group's last thread to store the total (s_cselect_b64 exec, 0 and vcc, then s_and_saveexec_b64), with the flag set and clear. Exact on both.
  • 28918b71 (caa78b8c is the same block with other registers): the wave sum of the counts (dpp8, row_mirror, permlanex16, a read of lane 32), and the exclusive prefix sums of the counts and of the popcounts (row_shr, permlanex16 under exec 0xffff0000:0xffff0000, the lane-31 carry). Exact on both.

9fc111d3, f6eb6498 and 5e19e7c7 repeat the same swizzle scan with other registers; I haven't run them separately.

So on our tree the wave-level arithmetic of these stages is right, and the wrong structure comes from somewhere else. Our whole-builder run only finished with VICTORY_SHADER_LOOP_LIMIT=4096, so some loop doesn't end on its own, and a loop cut short would leave a wrong structure by itself. I'll look for which stage's loop that is, and why it doesn't end (bad input from an earlier stage, or a stage's writes not reaching the next).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7206807729 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7206807729). Originally posted by [latentdev](https://github.com/latentdev) on 2026-11-27T00:51:16Z. --- Follow-up, going further on the stages you named. I ran the builder's own code for their cross-lane parts. For each stage I took its instruction words and replaced only the memory loads and stores with a known input and the test output. I then compared every lane between the RTX 4090 (split) and the Radeon iGPU (native wave64). - **`39321a95` / `77360df2`** (the same scan core): the five masked `ds_swizzle` steps, the lane-31 carry, the per-wave totals in LDS and the loop over earlier waves, at 64, 128, 256 and 512 threads. I also ran the tail that picks the group's last thread to store the total (`s_cselect_b64 exec, 0` and `vcc`, then `s_and_saveexec_b64`), with the flag set and clear. Exact on both. - **`28918b71`** (`caa78b8c` is the same block with other registers): the wave sum of the counts (`dpp8`, `row_mirror`, `permlanex16`, a read of lane 32), and the exclusive prefix sums of the counts and of the popcounts (`row_shr`, `permlanex16` under `exec` 0xffff0000:0xffff0000, the lane-31 carry). Exact on both. `9fc111d3`, `f6eb6498` and `5e19e7c7` repeat the same swizzle scan with other registers; I haven't run them separately. So on our tree the wave-level arithmetic of these stages is right, and the wrong structure comes from somewhere else. Our whole-builder run only finished with `VICTORY_SHADER_LOOP_LIMIT=4096`, so some loop doesn't end on its own, and a loop cut short would leave a wrong structure by itself. I'll look for which stage's loop that is, and why it doesn't end (bad input from an earlier stage, or a stage's writes not reaching the next).
pickles976 commented 2026-11-27 03:55:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-27T03:55:07Z.


Verified the real root-constant dispatch/readback on Linux/Wine 11.0, RTX 4060 Laptop GPU 8 GiB, 16 GiB system RAM, NVIDIA 590.48.1. This uses the previously disclosed diagnostic-relaxed vkd3d-proton 2576c0b4adfae4a+, not stock certification.

Provenance: your production head 7bb3ebaf46081958a6546cd74bd8290cd3a3b715, via @andrewpozdnakov7-jpg's test-only child c4e53db58857e548a6409a53be55028c252eeddc. Two local test-only changes: require a real host instead of the fixture's early-return skip, and print the final readbacks. Production unchanged. Fresh compile from VIctory-pr2703-fixture confirmed, 8.34 s.

cargo test --locked --target x86_64-pc-windows-msvc -p victory-gpu --lib   pipeline::tests::a_dispatch_reads_root_constant_four_and_a_real_view_offset   -- --exact --nocapture --test-threads=1

root constant / descriptor-offset GPU readback: [1067450368, 16]
1 passed; 0 failed; 0 ignored; 0.71 s

1067450368 == 0x3fa00000, the exact bits of 1.25f32; the actual descriptor-offset control remains 16 bytes. These are executed GPU dispatch/readbacks through State::dispatch, not just the predicate test. The physical RTX 4060 was enumerated; this is not a WARP comparison. No matched-parent rerun here.

This matters to our actual black-prologue run: dropped hashes 3b90165a77d95cdf, f6e47efa50226beb, 6f6a359d1166bb27 match the BVH programs discussed here. However, we have not integrated this into the title stack or trialed it alone, given the recorded NVIDIA partial-builder hangs. #2118's gate is the next isolated verification; even a passing gate does not establish correct Wave64 BVH output or solve the remaining black scene.

Evidence: .compat-runtime/logs/verify-pr2703-root-constant-readback-20261127T035357Z/ (command, exact ref/dirty provenance, console, timings, resource samples). Scope 9 GiB / swap 512 MiB, unchanged external GPU/RAM/disk guards. No game data or imagery attached.

Paired-stack follow-through (2026-11-27 04:08 UTC): #2703's binding change + #2118's full builder gate are now locally integrated together onto our dirty 3ed7d725 rendering/memory stack (previous Wave64, descriptor paging, scoped-file copy-only XMem, #1722 and #2723 preserved). Six targeted tests pass, 0 ignored, 0.75 s, fresh intended-worktree compilation 9.65 s on the physical RTX 4060/Wine/relaxed-vkd3d stack.

The extended GPU fixture registers its synthetic shader bytecode as a builder image so the successful dispatches really pass through held_back(). It reads [1067450368, 16], then deliberately binds a descriptor address with no registered backing and calls State::dispatch. That actual bind failure engages the persistent gate; resetting the frame decision does not release it, retiring the pipeline does. This improves on directly calling not_dispatched in the owner fixture. It is still not a title BVH build/output test.

Evidence: .compat-runtime/logs/verify-paired-builder-root-20261127T040838Z/; paired fixture crates/victory-gpu/src/pipeline/builder_pair_tests.rs kept locally. No title outcome claimed in this update.

Paired title attempt (04:12:48 UTC), not a rendering success: fresh mixed-stack diagnostics release (42.66 s), same scoped-file copy-only XMem configuration and unchanged 9 GiB scope / 6000 MiB GPU / 2048 MiB available-RAM guards. The 180 s wall limit ended it normally (137); GPU peak 3581 MiB, minimum available RAM 3234.6 MiB, scope peak 8814.2 MiB. Screens at 45/120/150/170 s remained loading artwork; 90 s was a dark artwork transition. No scene or gameplay.

A bounded target-capture smoke at frame 256 really read back account-picker targets, but the subsequent 500-draw scene trigger never fired (maximum logged 15 draws/frame). Thus this attempt cannot answer scene colour/depth versus final-composite causality. There were 347 logged native host-pipeline creations, no native creation refusal, 65 intentional unsupported Wave64 translation refusals, and 1200 unfinished pipeline builds at the end. The cached early-start list contained 1583 pipelines. The builder image was identified, but there was no logged builder gate decision/dispatch; absence of the old root-offset warning is not title-path proof of #2703. No matched performance/regression inference: caches and instrumentation differ, and the preceding pre-pair capture attempt also remained loading.

Evidence: .compat-runtime/logs/20261127T041248Z-{console.log,resources.csv}, paired-scene-trial-20261127T041205Z/summary.json. Raw captures remain local. Kernel journal had no entries for the interval. Next investigation: shader build admission/backlog on the 9 GiB scope before another scene capture; no guard or Wave64-safety bypass.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7209374076 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7209374076). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T03:55:07Z. --- Verified the real root-constant dispatch/readback on **Linux/Wine 11.0, RTX 4060 Laptop GPU 8 GiB, 16 GiB system RAM**, NVIDIA 590.48.1. This uses the previously disclosed diagnostic-relaxed vkd3d-proton `2576c0b4adfae4a+`, not stock certification. **Provenance:** your production head `7bb3ebaf46081958a6546cd74bd8290cd3a3b715`, via @andrewpozdnakov7-jpg's test-only child `c4e53db58857e548a6409a53be55028c252eeddc`. Two local test-only changes: require a real host instead of the fixture's early-return skip, and print the final readbacks. Production unchanged. Fresh compile from `VIctory-pr2703-fixture` confirmed, 8.34 s. ``` cargo test --locked --target x86_64-pc-windows-msvc -p victory-gpu --lib pipeline::tests::a_dispatch_reads_root_constant_four_and_a_real_view_offset -- --exact --nocapture --test-threads=1 root constant / descriptor-offset GPU readback: [1067450368, 16] 1 passed; 0 failed; 0 ignored; 0.71 s ``` `1067450368 == 0x3fa00000`, the exact bits of `1.25f32`; the actual descriptor-offset control remains **16 bytes**. These are executed GPU dispatch/readbacks through `State::dispatch`, not just the predicate test. The physical RTX 4060 was enumerated; this is not a WARP comparison. No matched-parent rerun here. This matters to our actual black-prologue run: dropped hashes `3b90165a77d95cdf`, `f6e47efa50226beb`, `6f6a359d1166bb27` match the BVH programs discussed here. However, **we have not integrated this into the title stack or trialed it alone**, given the recorded NVIDIA partial-builder hangs. #2118's gate is the next isolated verification; even a passing gate does not establish correct Wave64 BVH output or solve the remaining black scene. Evidence: `.compat-runtime/logs/verify-pr2703-root-constant-readback-20261127T035357Z/` (command, exact ref/dirty provenance, console, timings, resource samples). Scope 9 GiB / swap 512 MiB, unchanged external GPU/RAM/disk guards. No game data or imagery attached. **Paired-stack follow-through (2026-11-27 04:08 UTC):** #2703's binding change + #2118's full builder gate are now locally integrated together onto our dirty `3ed7d725` rendering/memory stack (previous Wave64, descriptor paging, scoped-file copy-only XMem, #1722 and #2723 preserved). Six targeted tests pass, 0 ignored, 0.75 s, fresh intended-worktree compilation 9.65 s on the physical RTX 4060/Wine/relaxed-vkd3d stack. The extended GPU fixture registers its synthetic shader bytecode as a builder image so the successful dispatches really pass through `held_back()`. It reads `[1067450368, 16]`, then deliberately binds a descriptor address with no registered backing and calls **`State::dispatch`**. That actual bind failure engages the persistent gate; resetting the frame decision does not release it, retiring the pipeline does. This improves on directly calling `not_dispatched` in the owner fixture. It is still not a title BVH build/output test. Evidence: `.compat-runtime/logs/verify-paired-builder-root-20261127T040838Z/`; paired fixture `crates/victory-gpu/src/pipeline/builder_pair_tests.rs` kept locally. No title outcome claimed in this update. **Paired title attempt (04:12:48 UTC), not a rendering success:** fresh mixed-stack diagnostics release (42.66 s), same scoped-file copy-only XMem configuration and unchanged 9 GiB scope / 6000 MiB GPU / 2048 MiB available-RAM guards. The 180 s wall limit ended it normally (137); GPU peak 3581 MiB, minimum available RAM 3234.6 MiB, scope peak 8814.2 MiB. Screens at 45/120/150/170 s remained loading artwork; 90 s was a dark artwork transition. No scene or gameplay. A bounded target-capture smoke at frame 256 really read back account-picker targets, but the subsequent 500-draw scene trigger never fired (maximum logged 15 draws/frame). Thus this attempt cannot answer scene colour/depth versus final-composite causality. There were 347 logged native host-pipeline creations, no native creation refusal, 65 intentional unsupported Wave64 translation refusals, and 1200 unfinished pipeline builds at the end. The cached early-start list contained 1583 pipelines. The builder image was identified, but there was no logged builder gate decision/dispatch; absence of the old root-offset warning is **not** title-path proof of #2703. No matched performance/regression inference: caches and instrumentation differ, and the preceding pre-pair capture attempt also remained loading. Evidence: `.compat-runtime/logs/20261127T041248Z-{console.log,resources.csv}`, `paired-scene-trial-20261127T041205Z/summary.json`. Raw captures remain local. Kernel journal had no entries for the interval. Next investigation: shader build admission/backlog on the 9 GiB scope before another scene capture; no guard or Wave64-safety bypass.
lhnizdo commented 2026-11-27 05:37:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-27T05:37:48Z.


@latentdev, thanks for checking both patterns and the stages' cross-lane parts on both adapters. Between your runs and mine, the wave-level arithmetic of the scans, 28918b71 and caa78b8c is right. So the broken structure comes from somewhere else.

Branch. lhnizdo:diag/bvh-builder (c6bb593). It's my full test stack, so take only the pieces you want. Everything below is behind --features diagnostics:

  • The harness: three local tests in crates/victory-shader/src/emit/wave64_console_tests.rs. Each takes a container path by env var:
    • one_container_block_scan_matches_its_reference (VICTORY_SCAN_CONTAINER, plus _THREADS and _ELEMS);
    • one_container_radix_pass_matches_its_reference (VICTORY_RADIX_CONTAINER);
    • one_container_radix_histogram_matches_its_reference (VICTORY_HISTOGRAM_CONTAINER).
  • Getting the containers: VICTORY_DUMP_BUILDER_DIR=<dir> writes all 53 builder containers at run time. They stay on your machine.
  • Run-time switches:
    • VICTORY_BUILDER_DROP=<hash,…> drops those builder programs' dispatches while #2118's gate stays open.
    • VICTORY_BUILDER_CHECK=<hash> reads the tree back at the start of that program's dispatches, after the earlier stages have run (first 40). It logs tree check lines: roots, out-of-range links, cycles and child links that don't point back. The tree is the header (count at +12), parents (2n−1) and children (2(n−1)) in root slots 0, 2 and 3, as the refit 5552dac6a2b7a1fd binds them.

What I see here that differs from yours. On the RTX 2080 the builder still hangs with VICTORY_SHADER_LOOP_LIMIT=4096, even with the refit dropped and the tree walkers skipped (a 25.5 s submission). So on my tree it isn't only a loop that never ends. I bisected by dropping stages:

  • dropping the 12 wave64 stages, or just the 6 unverified ones: no hang;
  • dropping 28918b71, caa78b8c and 5e687674: no hang;
  • dropping only 28918b71 and caa78b8c: hang.

So the hang needs 5e687674. That stage has no loops, cross-lane operations or LDS; it gathers geometry into the 64-byte leaf records. It probably just feeds the stage that hangs, rather than hanging itself. The builder's compute dispatches are all direct, so it isn't a huge indirect count either.

Request, for a native-wave64 reference. Since you have the Radeon iGPU beside the 4090, could you run the whole builder on it once with VICTORY_BUILDER_CHECK=5552dac6a2b7a1fd and post the tree check lines? A well-formed tree there (one root, no cycles, every child pointing back) would tell us what a correct build looks like at the refit's start. The same lines from the 4090 with your 4,096 limit would show whether the tree is already broken before the refit. On mine the device is lost before the check can read the tree. If the iGPU can't carry the game that far, the three tests on both adapters would still help.

@JurajSimicevic, the split fixes are on that branch, and on #3147 as lhnizdo:pr/split-upper-half, if you want to run your cell measurement on the 5080. The builder still hangs on 32-lane cards here, though, so expect it held or lost.

AI-assisted (Claude Code). No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7210799901 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7210799901). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-27T05:37:48Z. --- @latentdev, thanks for checking both patterns and the stages' cross-lane parts on both adapters. Between your runs and mine, the wave-level arithmetic of the scans, `28918b71` and `caa78b8c` is right. So the broken structure comes from somewhere else. **Branch.** `lhnizdo:diag/bvh-builder` (`c6bb593`). It's my full test stack, so take only the pieces you want. Everything below is behind `--features diagnostics`: - **The harness:** three local tests in `crates/victory-shader/src/emit/wave64_console_tests.rs`. Each takes a container path by env var: - `one_container_block_scan_matches_its_reference` (`VICTORY_SCAN_CONTAINER`, plus `_THREADS` and `_ELEMS`); - `one_container_radix_pass_matches_its_reference` (`VICTORY_RADIX_CONTAINER`); - `one_container_radix_histogram_matches_its_reference` (`VICTORY_HISTOGRAM_CONTAINER`). - **Getting the containers:** `VICTORY_DUMP_BUILDER_DIR=<dir>` writes all 53 builder containers at run time. They stay on your machine. - **Run-time switches:** - `VICTORY_BUILDER_DROP=<hash,…>` drops those builder programs' dispatches while #2118's gate stays open. - `VICTORY_BUILDER_CHECK=<hash>` reads the tree back at the start of that program's dispatches, after the earlier stages have run (first 40). It logs `tree check` lines: roots, out-of-range links, cycles and child links that don't point back. The tree is the header (count at +12), parents (2n−1) and children (2(n−1)) in root slots 0, 2 and 3, as the refit `5552dac6a2b7a1fd` binds them. **What I see here that differs from yours.** On the RTX 2080 the builder still hangs with `VICTORY_SHADER_LOOP_LIMIT=4096`, even with the refit dropped and the tree walkers skipped (a 25.5 s submission). So on my tree it isn't only a loop that never ends. I bisected by dropping stages: - dropping the 12 wave64 stages, or just the 6 unverified ones: no hang; - dropping `28918b71`, `caa78b8c` and `5e687674`: no hang; - dropping only `28918b71` and `caa78b8c`: hang. So the hang needs `5e687674`. That stage has no loops, cross-lane operations or LDS; it gathers geometry into the 64-byte leaf records. It probably just feeds the stage that hangs, rather than hanging itself. The builder's compute dispatches are all direct, so it isn't a huge indirect count either. **Request, for a native-wave64 reference.** Since you have the Radeon iGPU beside the 4090, could you run the whole builder on it once with `VICTORY_BUILDER_CHECK=5552dac6a2b7a1fd` and post the `tree check` lines? A well-formed tree there (one root, no cycles, every child pointing back) would tell us what a correct build looks like at the refit's start. The same lines from the 4090 with your 4,096 limit would show whether the tree is already broken before the refit. On mine the device is lost before the check can read the tree. If the iGPU can't carry the game that far, the three tests on both adapters would still help. @JurajSimicevic, the split fixes are on that branch, and on #3147 as `lhnizdo:pr/split-upper-half`, if you want to run your cell measurement on the 5080. The builder still hangs on 32-lane cards here, though, so expect it held or lost. AI-assisted (Claude Code). No game data.
lhnizdo commented 2026-11-27 10:13:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-27T10:13:47Z.


A correction to my last comment: the stage that hangs here is not the console pair 28918b71/caa78b8c, it's the radix pass e63d22c4.

What changed first. Every title-memory store set its dirty mark with a per-lane atomic into a bitmap in system memory, so the builder (nothing but such stores) ran at 36–75 ms per dispatch on the RTX 2080. With the marks coalesced (the same idea as #2755), a full builder frame went from 3.7–5.1 s to about 0.2 s. With that in place, the device is still lost in the first builder frame, which made a cleaner bisect possible.

Why the pair looked guilty. Without barriers between the builder's dispatches, the breadcrumbs stop wherever the front end has run ahead to. That was always somewhere in the pair's long stretches (dozens of 28918b71/caa78b8c dispatches between two barriers).

With a barrier after every builder dispatch (VICTORY_BUILDER_BARRIERS=1, diagnostics, on lhnizdo:diag/bvh-builder at 652d58d, which now also carries #2958 and the coalesced memory marks), refit 5552dac6 dropped: the list stops at a lone e63d22c4 dispatch (17 groups), with two barriers before it and one after. Dropping the refit and the pair instead runs the full builder for 5 minutes without a loss, so e63d22c4 likely hangs only on what the pair writes.

What doesn't explain it:

  • The console program has no loops: 17 s_barriers, each reached by all threads, and short forward execz skips.
  • Our translation of it, with 32-lane host waves (the console waves split in halves, view_marks on as the game builds it), has no back edge in its 401 blocks. All 228 barriers (17 plus the halves' exchanges) are in blocks on every path from entry to exit.
  • Its local test with synthetic keys (one_container_radix_pass_matches_its_reference) passes on the 2080.

So a loopless, barrier-uniform shader doesn't finish on some real inputs. A memory access that stalls rather than faults seems more likely than control flow; DRED reports no page fault. Next I'll capture that dispatch's inputs and run it alone.

@latentdev, your builder finishes on the 4090 with a cap of 4,096. If you still have that tree, does e63d22c4 run as split halves there too (512 threads on 32-lane waves)? And does the full builder still finish with VICTORY_BUILDER_BARRIERS=1 if you cherry-pick it? That would say whether the difference is in our trees or our cards. @ZeOs360's runs on an RX 7800 XT (#3277), where the builder runs for 20 minutes, fit "only when split".

AI-assisted (Claude Code). No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7215631326 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7215631326). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-27T10:13:47Z. --- A correction to my last comment: the stage that hangs here is not the console pair `28918b71`/`caa78b8c`, it's the radix pass `e63d22c4`. **What changed first.** Every title-memory store set its dirty mark with a per-lane atomic into a bitmap in system memory, so the builder (nothing but such stores) ran at 36–75 ms per dispatch on the RTX 2080. With the marks coalesced (the same idea as #2755), a full builder frame went from 3.7–5.1 s to about 0.2 s. With that in place, the device is still lost in the first builder frame, which made a cleaner bisect possible. **Why the pair looked guilty.** Without barriers between the builder's dispatches, the breadcrumbs stop wherever the front end has run ahead to. That was always somewhere in the pair's long stretches (dozens of 28918b71/caa78b8c dispatches between two barriers). **With a barrier after every builder dispatch** (`VICTORY_BUILDER_BARRIERS=1`, diagnostics, on `lhnizdo:diag/bvh-builder` at `652d58d`, which now also carries #2958 and the coalesced memory marks), refit `5552dac6` dropped: the list stops at a lone `e63d22c4` dispatch (17 groups), with two barriers before it and one after. Dropping the refit and the pair instead runs the full builder for 5 minutes without a loss, so `e63d22c4` likely hangs only on what the pair writes. **What doesn't explain it:** - The console program has no loops: 17 `s_barrier`s, each reached by all threads, and short forward `execz` skips. - Our translation of it, with 32-lane host waves (the console waves split in halves, `view_marks` on as the game builds it), has no back edge in its 401 blocks. All 228 barriers (17 plus the halves' exchanges) are in blocks on every path from entry to exit. - Its local test with synthetic keys (`one_container_radix_pass_matches_its_reference`) passes on the 2080. So a loopless, barrier-uniform shader doesn't finish on some real inputs. A memory access that stalls rather than faults seems more likely than control flow; DRED reports no page fault. Next I'll capture that dispatch's inputs and run it alone. @latentdev, your builder finishes on the 4090 with a cap of 4,096. If you still have that tree, does `e63d22c4` run as split halves there too (512 threads on 32-lane waves)? And does the full builder still finish with `VICTORY_BUILDER_BARRIERS=1` if you cherry-pick it? That would say whether the difference is in our trees or our cards. @ZeOs360's runs on an RX 7800 XT (#3277), where the builder runs for 20 minutes, fit "only when split". AI-assisted (Claude Code). No game data.
borosf commented 2026-11-27 11:05:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T11:05:45Z.


Intel Arc B580: the drops this fixes go to zero (199 + 177 a frame), but 2 of my 3 runs ended in the title's own crash handler — I cannot tell yet whether that is this PR

No Intel report in the thread, so here is one, with the uncomfortable part first.

Setup: Windows 11 x64, Intel Arc B580 12 GB, Ryzen 5 5600, 32 GB, retail 1.0.2.1, my own dump, --console series-x, diag build, VICTORY_GPU_TIMING=1 VICTORY_D3D12_DRED=1. Tree: main 63bcca4 + #2958 (the mark-coalescing change, unrelated) + this PR's one commit 7bb3ebaf applied on top (clean, 23 lines in draw.rs).

The drops, which is what the PR is for:

before (same tree, no #2703) after (#2703), 3 runs
dropped 199.2/frame … dispatch: a root view's offset … [compute 3b90165a77d95cdf] 0
dropped 177.0/frame … dispatch: a root view's offset … [compute f6e47efa50226beb] 0

Zero matching lines in all three runs, so the arm is no longer reached on this card at all — consistent with the ~240 -> 18 a frame you saw on the 3080 Ti, and on this dump it is about 380 dispatches a frame that now run instead of being refused. No device removed in any of the three runs either, which is worth saying because this machine does remove the device intermittently on unrelated builds.

The uncomfortable part: run 1 (200 s) and run 2 (130 s) both ended early with the title's crash handler, not ours — BacktraceBreakpad: … URL: https://submit.backtrace.io/paradise/…, payload 56 MB, title: BacktraceBreakpad repeated, then a segfault in our process 40-60 s in, before the world loaded. Run 3 ran to the 130 s timeout with 19 frame reports and no crash.

That is 2 of 3, and it is exactly what you would expect if the dispatches this PR un-refuses now run and then hit something else we do not handle. It is also what you would expect from a machine that has been removing its GPU device on and off all afternoon. I am not claiming it is the PR — I have not run the control enough times in this state to separate them, and my baseline tree has its own intermittent page fault at 0x8000… removals.

What would settle it, and I can run whichever you prefer: 5 runs of this tree against 5 of the same tree without the commit, counting title crashes rather than removals, or a crash dump from the title handler if the backtrace it uploaded is reachable from your side. Tell me which is more useful and I will do that before anyone merges on my numbers.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7216672523 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7216672523). Originally posted by [borosf](https://github.com/borosf) on 2026-11-27T11:05:45Z. --- **Intel Arc B580: the drops this fixes go to zero (199 + 177 a frame), but 2 of my 3 runs ended in the title's own crash handler — I cannot tell yet whether that is this PR** No Intel report in the thread, so here is one, with the uncomfortable part first. **Setup:** Windows 11 x64, Intel Arc B580 12 GB, Ryzen 5 5600, 32 GB, retail 1.0.2.1, my own dump, `--console series-x`, `diag` build, `VICTORY_GPU_TIMING=1 VICTORY_D3D12_DRED=1`. Tree: `main` `63bcca4` + #2958 (the mark-coalescing change, unrelated) + this PR's one commit `7bb3ebaf` applied on top (clean, 23 lines in `draw.rs`). **The drops, which is what the PR is for:** | before (same tree, no #2703) | after (#2703), 3 runs | |---|---| | `dropped 199.2/frame … dispatch: a root view's offset … [compute 3b90165a77d95cdf]` | **0** | | `dropped 177.0/frame … dispatch: a root view's offset … [compute f6e47efa50226beb]` | **0** | Zero matching lines in all three runs, so the arm is no longer reached on this card at all — consistent with the ~240 -> 18 a frame you saw on the 3080 Ti, and on this dump it is about 380 dispatches a frame that now run instead of being refused. No `device removed` in any of the three runs either, which is worth saying because this machine does remove the device intermittently on unrelated builds. **The uncomfortable part:** run 1 (200 s) and run 2 (130 s) both ended early with the *title's* crash handler, not ours — `BacktraceBreakpad: … URL: https://submit.backtrace.io/paradise/…`, payload 56 MB, `title: BacktraceBreakpad` repeated, then a segfault in our process 40-60 s in, before the world loaded. Run 3 ran to the 130 s timeout with 19 frame reports and no crash. That is 2 of 3, and it is exactly what you would expect if the dispatches this PR un-refuses now run and then hit something else we do not handle. It is also what you would expect from a machine that has been removing its GPU device on and off all afternoon. **I am not claiming it is the PR** — I have not run the control enough times in this state to separate them, and my baseline tree has its own intermittent `page fault at 0x8000…` removals. What would settle it, and I can run whichever you prefer: 5 runs of this tree against 5 of the same tree without the commit, counting title crashes rather than removals, or a crash dump from the title handler if the backtrace it uploaded is reachable from your side. Tell me which is more useful and I will do that before anyone merges on my numbers.
borosf commented 2026-11-27 12:31:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T12:31:13Z.


Game-measured on Intel Arc B580, in the world, and together with #3419 (both touch descriptor/host.rs; they merge cleanly in either order, nothing to reconcile).

tree max draws/frame root view's offset events in a 300 s run
63bcca4 + #2958 7,648 44
+ this PR + #3419 + a stack of my open PRs 502 (ended early on the known guest fault) 0

That matches what I reported earlier from a shorter capture (199.2 + 177.0 per frame → 0 across four runs), now with a run that actually reaches the world: the offset lines go to zero and the slot count reported per frame stops leaking into the "empty or past its host copy" path.

The capture needed a fixed harness to get there, which is worth recording because it explains why my earlier numbers came from menu-only runs: the title's first screen is mouse-driven — a click on the PLAYER label at ~(0.90, 0.945) advances it and Enter (pad A) does not — and the runtime only reads the keyboard while its own window is the foreground window (gameinput.rs:1238), so an unattended run needs that click plus a local build flag to lift the focus gate. Both are measurement tools on my machine, not proposals for the tree.

Caveat: the stack run ended at 502 draws on victory-image-b99f876b74d4a77f.dll+0x23cf683 (0xc0000005 write 0x0), the same pre-existing guest fault my main controls show (#2671), so the zero counters come from fewer world frames than the base row. Roughly one run in three dies that way here regardless of tree; the drop counters are the per-frame facts, the timings from one pair of runs would not be.

Synthetic tests only in the tree; the run is my own dump. Machine: Windows 11 x64, Ryzen 5 5600, 32 GB, Arc B580 12 GB.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7218338400 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7218338400). Originally posted by [borosf](https://github.com/borosf) on 2026-11-27T12:31:13Z. --- Game-measured on Intel Arc B580, in the world, and together with **#3419** (both touch `descriptor/host.rs`; they merge cleanly in either order, nothing to reconcile). | tree | max draws/frame | `root view's offset` events in a 300 s run | |---|---|---| | `63bcca4` + #2958 | **7,648** | **44** | | + this PR + #3419 + a stack of my open PRs | 502 (ended early on the known guest fault) | **0** | That matches what I reported earlier from a shorter capture (199.2 + 177.0 per frame → 0 across four runs), now with a run that actually reaches the world: the offset lines go to zero and the slot count reported per frame stops leaking into the "empty or past its host copy" path. The capture needed a fixed harness to get there, which is worth recording because it explains why my earlier numbers came from menu-only runs: the title's first screen is mouse-driven — a click on the **PLAYER** label at ~(0.90, 0.945) advances it and Enter (pad A) does not — and the runtime only reads the keyboard while its own window is the foreground window (`gameinput.rs:1238`), so an unattended run needs that click plus a local build flag to lift the focus gate. Both are measurement tools on my machine, not proposals for the tree. Caveat: the stack run ended at 502 draws on `victory-image-b99f876b74d4a77f.dll+0x23cf683` (`0xc0000005 write 0x0`), the same pre-existing guest fault my `main` controls show (#2671), so the zero counters come from fewer world frames than the base row. Roughly one run in three dies that way here regardless of tree; the drop counters are the per-frame facts, the timings from one pair of runs would not be. Synthetic tests only in the tree; the run is my own dump. Machine: Windows 11 x64, Ryzen 5 5600, 32 GB, Arc B580 12 GB.
borosf commented 2026-11-27 15:20:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T15:20:23Z.


In-world evidence for this one, on a tree that differs from the control by nothing but this commit.

Setup. Windows 11 x64, Intel Arc B580 12 GB, Ryzen 5 5600, 32 GB; --console series-x, diag build with --features diagnostics, warm shader cache, four-minute runs, the menus driven by a harness through the prologue into the prison yard. Both trees are the same stack of open PRs; the control is that stack with git revert -m 1 of this PR's merge commit, so the only difference is these 24 lines in draw.rs.

tree a root view's offset refusals per frame line max draws/frame reached
stack with #2703 0, 0 0.0 9,145 · 10,802
stack minus #2703 248, 237 6.2 · 5.9 8,226 · 8,794
main + #2958 86, 249 — 4,479 · 7,594

The control reaches the same scenes (same order of draws/frame) and refuses work there; with the commit the line is never printed, not once, across both runs.

What it was costing, from the control's frame line: dropped 327.7/frame without a host pipeline: dispatch: a root view's offset: no root view, or outside title buffers. The per-frame figure climbs through the yard into the hundreds, so this is not a rare miss — it is the ray-tracing builder's dispatches being discarded wholesale in the frames where they matter.

Two honest limits. It is a count of refusals, not a matched frame-time A/B: that machine is GPU-bound (1.3 s/frame in the yard), so I would not claim an fps win here, only that the work is no longer thrown away. And the main row is not a control for this PR — it lacks many other open PRs — it is there only to show the refusal is not something the stack invented.

AI use: Mistral Vibe (agent) — harness, builds and log counts on the machine above.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7221934084 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7221934084). Originally posted by [borosf](https://github.com/borosf) on 2026-11-27T15:20:23Z. --- In-world evidence for this one, on a tree that differs from the control by nothing but this commit. **Setup.** Windows 11 x64, Intel Arc B580 12 GB, Ryzen 5 5600, 32 GB; `--console series-x`, `diag` build with `--features diagnostics`, warm shader cache, four-minute runs, the menus driven by a harness through the prologue into the prison yard. Both trees are the same stack of open PRs; the control is that stack with `git revert -m 1` of this PR's merge commit, so the only difference is these 24 lines in `draw.rs`. | tree | `a root view's offset` refusals | per frame line | max draws/frame reached | |---|---|---|---| | stack with #2703 | **0**, **0** | 0.0 | 9,145 · 10,802 | | stack minus #2703 | **248**, **237** | 6.2 · 5.9 | 8,226 · 8,794 | | `main` + #2958 | 86, 249 | — | 4,479 · 7,594 | The control reaches the same scenes (same order of draws/frame) and refuses work there; with the commit the line is never printed, not once, across both runs. What it was costing, from the control's frame line: `dropped 327.7/frame without a host pipeline: dispatch: a root view's offset: no root view, or outside title buffers`. The per-frame figure climbs through the yard into the hundreds, so this is not a rare miss — it is the ray-tracing builder's dispatches being discarded wholesale in the frames where they matter. Two honest limits. It is a count of refusals, not a matched frame-time A/B: that machine is GPU-bound (1.3 s/frame in the yard), so I would not claim an fps win here, only that the work is no longer thrown away. And the `main` row is not a control for this PR — it lacks many other open PRs — it is there only to show the refusal is not something the stack invented. _AI use: Mistral Vibe (agent) — harness, builds and log counts on the machine above._
lhnizdo commented 2026-11-27 19:59:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-27T19:59:45Z.


A correction to my earlier comments here: the radix pass e63d22c4 isn't the culprit. The builder's device loss on 32-lane cards had two causes, both now fixed and both outside this PR. The barrier breadcrumbs misled me twice. Our own breadcrumbs (one written to system memory after each builder dispatch, read after the loss) put the hang in the right place.

1. The console pair's waterfall loops never ended (28918b71/caa78b8c).

  • The shape: the console compiler's waterfall goes round through a block that only narrows EXEC again and jumps back to the loop's start.
  • The bug: console mode only parked lanes (kept them in the loop with nothing to run, as the console's EXEC does) at a branch straight back to the loop's start. So in this shape, lanes already done, and lanes that never entered, voted to go round and ran the body.
  • The effect: a loop that leaves when its counter equals each lane's count ran to the iteration limit, about 2^20 heavy rounds a wave, and the device was removed.
  • Fixed in #2920 (ef794e8). It has hardware tests, now verified on an RX 5700 XT and an RTX 4060 as well.

2. The treelet pass ffd93c8a broke the trees it optimizes.

  • What happened: it reads back, with glc, the boxes its own climb has just written. We read title memory through each page's raw SRV, and that read doesn't see this dispatch's writes, so the pass worked from boxes as they were before the dispatch. In one 23,011-leaf tree, about 2,300 child links ended up wrong, with cycles.
  • The effect: the refit after it (5552dac6) climbs to the root with a counter per node, and it never finished on such a tree. That looked like a hang.
  • How I found it: a captured dispatch replayed on the 2080, against a CPU reference interpreter of the program (lockstep wave32).
  • The fix is #3584: a program that stores reads title memory through the UAVs it writes, and glc accesses get coherent handles. The tree then comes out valid, with 0 broken links.

In the game, with both (RTX 2080, Windows 10): the builder now runs whole, with the refit, no caps and no builder program dropped. It ran 6 minutes without a device loss, with 23,002 instances and 57,253 nodes at the stop.

@borosf, your B580 numbers fit this. With this PR, about 330 builder dispatches a frame that were refused now run, so more machines will reach these two bugs:

  • the first on cards with 32-lane waves;
  • the second wherever an SRV read doesn't see the same dispatch's writes, as on the 2080.

AI-assisted (Claude Code). No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7227071260 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7227071260). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-27T19:59:45Z. --- A correction to my earlier comments here: the radix pass `e63d22c4` isn't the culprit. The builder's device loss on 32-lane cards had two causes, both now fixed and both outside this PR. The barrier breadcrumbs misled me twice. Our own breadcrumbs (one written to system memory after each builder dispatch, read after the loss) put the hang in the right place. **1. The console pair's waterfall loops never ended (`28918b71`/`caa78b8c`).** - **The shape:** the console compiler's waterfall goes round through a block that only narrows EXEC again and jumps back to the loop's start. - **The bug:** console mode only parked lanes (kept them in the loop with nothing to run, as the console's EXEC does) at a branch straight back to the loop's start. So in this shape, lanes already done, and lanes that never entered, voted to go round and ran the body. - **The effect:** a loop that leaves when its counter equals each lane's count ran to the iteration limit, about 2^20 heavy rounds a wave, and the device was removed. - **Fixed in #2920** (`ef794e8`). It has hardware tests, now verified on an RX 5700 XT and an RTX 4060 as well. **2. The treelet pass `ffd93c8a` broke the trees it optimizes.** - **What happened:** it reads back, with `glc`, the boxes its own climb has just written. We read title memory through each page's raw SRV, and that read doesn't see this dispatch's writes, so the pass worked from boxes as they were before the dispatch. In one 23,011-leaf tree, about 2,300 child links ended up wrong, with cycles. - **The effect:** the refit after it (`5552dac6`) climbs to the root with a counter per node, and it never finished on such a tree. That looked like a hang. - **How I found it:** a captured dispatch replayed on the 2080, against a CPU reference interpreter of the program (lockstep wave32). - **The fix is #3584:** a program that stores reads title memory through the UAVs it writes, and `glc` accesses get coherent handles. The tree then comes out valid, with 0 broken links. **In the game, with both** (RTX 2080, Windows 10): the builder now runs whole, with the refit, no caps and no builder program dropped. It ran 6 minutes without a device loss, with 23,002 instances and 57,253 nodes at the stop. @borosf, your B580 numbers fit this. With this PR, about 330 builder dispatches a frame that were refused now run, so more machines will reach these two bugs: - the first on cards with 32-lane waves; - the second wherever an SRV read doesn't see the same dispatch's writes, as on the 2080. AI-assisted (Claude Code). No game data.
omarsaifuddin commented 2026-11-28 16:33:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by omarsaifuddin on 2026-11-28T16:33:59Z.


Tested this on an RTX 3070 Ti (Windows 11, GTA VI scripted through the prologue) and it does what it says: on main plus the stack below, the "a root view's offset: no root view, or outside title buffers" drops went from about 466 dispatches to 0. In that log the dropped dispatches were the heaviest drop source, roughly twice the weight of the shaders the translator refuses.

One thing to know when merging it on NVIDIA. By itself it turned a stable run into a device removal: in two runs the host GPU device was removed about 3 minutes in (the failing dispatch was a different 1x1x1 compute each time). Without this PR, the same stack ran 16 minutes without a removal. With #2118 stacked on top, the same scripted run lasted the full 10 minutes with no removal. That fits what #2118 describes: this change lets builder dispatches that were silently dropped run again, and on NVIDIA some builder pipelines are still refused, so a partial builder runs. I haven't confirmed that the failing dispatches are the builder's, only the timing.

Runs: main + #3226, #2323, #2885, #3518, #3016, #2348, #3670, #3496, #3587, #3588, #189, #3200, then + this PR (device removed twice), then + this PR and #2118 (no removal in 10 minutes). Small caveat: only one GPU and one scripted path.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7242340715 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7242340715). Originally posted by [omarsaifuddin](https://github.com/omarsaifuddin) on 2026-11-28T16:33:59Z. --- Tested this on an RTX 3070 Ti (Windows 11, GTA VI scripted through the prologue) and it does what it says: on `main` plus the stack below, the "a root view's offset: no root view, or outside title buffers" drops went from about 466 dispatches to 0. In that log the dropped dispatches were the heaviest drop source, roughly twice the weight of the shaders the translator refuses. One thing to know when merging it on NVIDIA. By itself it turned a stable run into a device removal: in two runs the host GPU device was removed about 3 minutes in (the failing dispatch was a different 1x1x1 compute each time). Without this PR, the same stack ran 16 minutes without a removal. With #2118 stacked on top, the same scripted run lasted the full 10 minutes with no removal. That fits what #2118 describes: this change lets builder dispatches that were silently dropped run again, and on NVIDIA some builder pipelines are still refused, so a partial builder runs. I haven't confirmed that the failing dispatches are the builder's, only the timing. Runs: main + #3226, #2323, #2885, #3518, #3016, #2348, #3670, #3496, #3587, #3588, #189, #3200, then + this PR (device removed twice), then + this PR and #2118 (no removal in 10 minutes). Small caveat: only one GPU and one scripted path.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2703:upstream-pr/2703'
git switch 'upstream-pr/2703'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2703'
git switch 'upstream-pr/2703'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2703'
git switch 'upstream-pr/2703'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2703'
git switch 'main'
git merge --squash 'upstream-pr/2703'
git switch 'main'
git merge --ff-only 'upstream-pr/2703'
git switch 'main'
git merge 'upstream-pr/2703'
git push origin 'main'
Sign in to join this conversation.
No reviewers
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
Marvisak/VIctory!2701
No description provided.