GPU: the BVH builder runs whole or not at all #2116

Open
0xkn0wh3r3 wants to merge 3 commits from upstream-pr/2118 into main
0xkn0wh3r3 commented 2026-11-25 05:24:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T05:24:43Z.


The problem

A frame can run only part of the title's ray-tracing structure builder. The stages that run then write wrong results into title memory. In fxceless/victory-fork this wrote garbage bounds and crashed the title.

The title's BVH builder (XboxBvhBuilder.dll) builds and refits its ray-tracing structures in title memory through about fifty compute dispatches a frame. A dispatch without a host pipeline is dropped on its own while the rest of the list runs (State::dispatch). Some builder pipelines lack one:

  • refused on NVIDIA (they ask for 64-lane waves);
  • not translated;
  • still being made.

So the stages that do run work on data the missing stages never produced.

The fix

Builder dispatches run only in frames where every builder pipeline has its host pipeline. Otherwise none run, and the structures keep what they held. The decision is made once per frame (pipeline::builder::runs), so no frame runs part of the builder.

  • Builder pipelines are recognised by origin: their bytecode lies in the builder DLL's image, or the builder's code is among the callers when the pipeline is created. run registers the DLL's range when it maps it (note_title_dll, at start and when the title loads it later).
  • They start compiling as soon as they are created, so the per-frame wait budget does not hold the builder back.
  • Both direct dispatches and indirect dispatches (execute_indirect) of a held-back builder pipeline are dropped.
  • A builder dispatch dropped at dispatch time although its pipeline is made (State::bind fails, e.g. a root view's offset it cannot place; or an indirect dispatch's arguments, count or signature are missing) also holds the builder back: at once for the rest of the frame, then for as long as the title keeps that pipeline. It is not retried on a timer, since the drops seen recur every frame and each retry would be another partial frame. A builder pipeline created after the frame's decision and not yet made holds only the rest of that frame; the next frame's check sees it as missing. Skipped pipelines (VICTORY_SKIP_PIPELINES, diagnostics) were already covered: they count as refused.
  • The log says when the builder starts or stops running, and why (dropped= counts pipelines held for a dropped dispatch). The first dropped dispatch is logged with its reason.

On NVIDIA this keeps the builder off until 64-lane programs run there, instead of running it partly. Pipelines from other code are not affected. The rule comes from fxceless/victory-fork's notes; the code is new.

Testing

Four new tests (no game data):

  • pipeline::builder::tests::the_builder_runs_only_with_every_pipeline_made: the all-or-none decision. One pipeline refused or still being made holds all back.
  • pipeline::builder::tests::builder_pipelines_are_known_by_their_origin: recognising builder pipelines by bytecode and by caller.
  • pipeline::tests::builder_dispatches_wait_for_every_builder_pipeline: end to end through create_compute, a refused builder pipeline holds back builder dispatches, while other pipelines are unaffected.
  • pipeline::tests::a_dropped_builder_dispatch_holds_the_builder: a made builder pipeline runs; once a dispatch of it is dropped, the builder is held back in that frame and later ones, and runs again once the pipeline is released. It fails without the change.

Runs (rebased on main 63bcca4, NVIDIA):

  • cargo test -p victory-gpu --lib: all pass except descriptor::host::tests::dynamic_slots_are_held_until_released and memory::tests::lists_share_a_table_and_copies_keep_their_views, which already fail on main from the NVIDIA heap cap (#1835), and the flaky frame::tests::waits_end_on_ticks_and_count_frames. Same with --features diagnostics.
  • cargo test -p victory: pass.
  • cargo clippy --workspace --all-targets -- -D warnings, with and without --all-features: clean.
  • cargo xtask policy: ok.

Not covered

Not run with a game (no game data here).

<!-- greyfinch-sync:Marvisak/VIctory:issue:5485697517 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-25T05:24:43Z. --- ## The problem A frame can run only part of the title's ray-tracing structure builder. The stages that run then write wrong results into title memory. In fxceless/victory-fork this wrote garbage bounds and crashed the title. The title's BVH builder (`XboxBvhBuilder.dll`) builds and refits its ray-tracing structures in title memory through about fifty compute dispatches a frame. A dispatch without a host pipeline is dropped on its own while the rest of the list runs (`State::dispatch`). Some builder pipelines lack one: - refused on NVIDIA (they ask for 64-lane waves); - not translated; - still being made. So the stages that do run work on data the missing stages never produced. ## The fix Builder dispatches run only in frames where every builder pipeline has its host pipeline. Otherwise none run, and the structures keep what they held. The decision is made once per frame (`pipeline::builder::runs`), so no frame runs part of the builder. - Builder pipelines are recognised by origin: their bytecode lies in the builder DLL's image, or the builder's code is among the callers when the pipeline is created. `run` registers the DLL's range when it maps it (`note_title_dll`, at start and when the title loads it later). - They start compiling as soon as they are created, so the per-frame wait budget does not hold the builder back. - Both direct dispatches and indirect dispatches (`execute_indirect`) of a held-back builder pipeline are dropped. - A builder dispatch dropped at dispatch time although its pipeline is made (`State::bind` fails, e.g. a root view's offset it cannot place; or an indirect dispatch's arguments, count or signature are missing) also holds the builder back: at once for the rest of the frame, then for as long as the title keeps that pipeline. It is not retried on a timer, since the drops seen recur every frame and each retry would be another partial frame. A builder pipeline created after the frame's decision and not yet made holds only the rest of that frame; the next frame's check sees it as missing. Skipped pipelines (`VICTORY_SKIP_PIPELINES`, diagnostics) were already covered: they count as refused. - The log says when the builder starts or stops running, and why (`dropped=` counts pipelines held for a dropped dispatch). The first dropped dispatch is logged with its reason. On NVIDIA this keeps the builder off until 64-lane programs run there, instead of running it partly. Pipelines from other code are not affected. The rule comes from fxceless/victory-fork's notes; the code is new. ## Testing Four new tests (no game data): - `pipeline::builder::tests::the_builder_runs_only_with_every_pipeline_made`: the all-or-none decision. One pipeline refused or still being made holds all back. - `pipeline::builder::tests::builder_pipelines_are_known_by_their_origin`: recognising builder pipelines by bytecode and by caller. - `pipeline::tests::builder_dispatches_wait_for_every_builder_pipeline`: end to end through `create_compute`, a refused builder pipeline holds back builder dispatches, while other pipelines are unaffected. - `pipeline::tests::a_dropped_builder_dispatch_holds_the_builder`: a made builder pipeline runs; once a dispatch of it is dropped, the builder is held back in that frame and later ones, and runs again once the pipeline is released. It fails without the change. Runs (rebased on `main` `63bcca4`, NVIDIA): - `cargo test -p victory-gpu --lib`: all pass except `descriptor::host::tests::dynamic_slots_are_held_until_released` and `memory::tests::lists_share_a_table_and_copies_keep_their_views`, which already fail on `main` from the NVIDIA heap cap (#1835), and the flaky `frame::tests::waits_end_on_ticks_and_count_frames`. Same with `--features diagnostics`. - `cargo test -p victory`: pass. - `cargo clippy --workspace --all-targets -- -D warnings`, with and without `--all-features`: clean. - `cargo xtask policy`: ok. ## Not covered Not run with a game (no game data here).
DenRakEiw commented 2026-11-25 05:36:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T05:36:54Z.

Review: APPROVED


Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu --lib pipeline:: — 18 passed, 0 failed (including builder_dispatches_wait_for_every_builder_pipeline)
  • cargo clippy -p victory-gpu -p victory --all-targets — 0 warnings
  • cargo xtask policy — ok (184 files ok)

Clean gating ensuring BVH builder dispatches wait for all builder pipelines before running. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6052374376 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#pullrequestreview-6052374376). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T05:36:54Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`940d32f`, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu --lib pipeline::` — **18 passed, 0 failed** (including `builder_dispatches_wait_for_every_builder_pipeline`) - `cargo clippy -p victory-gpu -p victory --all-targets` — 0 warnings - `cargo xtask policy` — ok (`184 files ok`) Clean gating ensuring BVH builder dispatches wait for all builder pipelines before running. Looks good. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 05:48:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T05:48:58Z.

Review: COMMENTED


Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

BVH builder all-or-nothing — build atomicity fix; relates to #2040's 64-bit BVH pointers and #1794's BVH a16 work.

<!-- greyfinch-sync:Marvisak/VIctory:review:6052483851 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#pullrequestreview-6052483851). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T05:48:58Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. BVH builder all-or-nothing — build atomicity fix; relates to #2040's 64-bit BVH pointers and #1794's BVH a16 work.
r4tedx commented 2026-11-25 10:07:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-25T09:59:31Z.


In-game run of this PR (head 60632d3f) on an RTX 5070 (driver 616.92, Windows 11). This used my local copy of the title (1.0.2.1); only the log lines, counts and timings below are reported.

Build: main 940d32f plus a stack of open PRs, with this one merged in: r4tedx/VIctory@gpu-run/layer1-2118 (2fde53b3). The stack includes #1763, #2136, #2147, #1819 (loop limit 2^14) and #2168. Diagnostics build, VICTORY_D3D12_DRED=1, 10 minutes, about 8 minutes of it in the world.

What this PR did:

  • BVH builder mapped base=0x7ffdfc610000 size=909312
  • At the world's first frame (1503): BVH builder held back: not all its pipelines are made pipelines=53 made=48 refused=5. The builder stayed off for the rest of the run.

Against the same tree without it: without this PR, CS_IrradianceCache_ShadowTrace_WithFar (f607780aa8e502d0, a ray-traced probe shadow trace) removed the device about 70 s after world entry. DRED put the stop at its indirect dispatch, and the System log had nvlddmkm event 153. That run was on main 940d32f + #1763. With this PR: no hang in 10 minutes, no device removal, and no System log events. The trace program itself still runs (it was not skipped).

For comparison: a cruder gate. The fxceless fork / ztrx recognise builder programs by their root signature not fitting the user SGPRs (parameters read from a table at user data 16). I tried a gate built on that rule on the same tree. It also kept the hang away, but it dropped a mean of 518 dispatches a frame (up to 950), against this PR's 53 builder pipelines. So that rule takes more than the builder. Recognising the builder by where its code lies, as here, is the sharper rule. I am not opening that gate as a PR.

Not this PR's doing: the GPU time fell from 4.4-6.2 s a frame to 320-410 ms (frames 0.85-1.07 s, 2,200-4,300 draws a frame). But #1819 is in the same build, and the 4.1 s submissions that made most of the old frame time are gone with it. The scenes also differ. I am not claiming that drop for #2118.

Not checked: an AMD host, where the builder's 64-lane programs are not refused, so the builder could run whole. In this run sky, fog and atmosphere are lit, but surfaces stay dark. I have not looked at whether this PR plays any part in that.

AI-assisted

<!-- greyfinch-sync:Marvisak/VIctory:comment:7159075700 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7159075700). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-25T09:59:31Z. --- In-game run of this PR (head `60632d3f`) on an RTX 5070 (driver 616.92, Windows 11). This used my local copy of the title (1.0.2.1); only the log lines, counts and timings below are reported. **Build:** `main` 940d32f plus a stack of open PRs, with this one merged in: [`r4tedx/VIctory@gpu-run/layer1-2118`](https://github.com/r4tedx/VIctory/tree/gpu-run/layer1-2118) (`2fde53b3`). The stack includes #1763, #2136, #2147, #1819 (loop limit 2^14) and #2168. Diagnostics build, `VICTORY_D3D12_DRED=1`, 10 minutes, about 8 minutes of it in the world. **What this PR did:** - `BVH builder mapped base=0x7ffdfc610000 size=909312` - At the world's first frame (1503): `BVH builder held back: not all its pipelines are made pipelines=53 made=48 refused=5`. The builder stayed off for the rest of the run. **Against the same tree without it:** without this PR, `CS_IrradianceCache_ShadowTrace_WithFar` (`f607780aa8e502d0`, a ray-traced probe shadow trace) removed the device about 70 s after world entry. DRED put the stop at its indirect dispatch, and the System log had nvlddmkm event 153. That run was on `main` 940d32f + #1763. With this PR: no hang in 10 minutes, no device removal, and no System log events. The trace program itself still runs (it was not skipped). **For comparison: a cruder gate.** The fxceless fork / ztrx recognise builder programs by their root signature not fitting the user SGPRs (parameters read from a table at user data 16). I tried a gate built on that rule on the same tree. It also kept the hang away, but it dropped a mean of 518 dispatches a frame (up to 950), against this PR's 53 builder pipelines. So that rule takes more than the builder. Recognising the builder by where its code lies, as here, is the sharper rule. I am not opening that gate as a PR. **Not this PR's doing:** the GPU time fell from 4.4-6.2 s a frame to 320-410 ms (frames 0.85-1.07 s, 2,200-4,300 draws a frame). But #1819 is in the same build, and the 4.1 s submissions that made most of the old frame time are gone with it. The scenes also differ. I am not claiming that drop for #2118. **Not checked:** an AMD host, where the builder's 64-lane programs are not refused, so the builder could run whole. In this run sky, fog and atmosphere are lit, but surfaces stay dark. I have not looked at whether this PR plays any part in that. AI-assisted
Marvisak commented 2026-11-25 11:05:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:45:14Z.


Automated triage for the maintainers.

Verdict: merge candidate (kept). Head af8b9ad is unchanged and still merges cleanly into main. The gate in pipeline::builder::runs (crates/victory-gpu/src/pipeline/builder.rs) and the two drop sites in draw.rs are as reviewed before.

On the latest reply: noted. The Windows Ampere run with #2703 is a new data point. Without this PR the device was removed at 133 s and 81 s. With it, both runs lasted 10 minutes with the builder held back. If #2703 lands, this PR should land with it or before it. The host_wave32() condition still belongs to whichever of this PR and #2176 lands second.

CI: passing (check). Recommending a look, not approving.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7160125909 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7160125909). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T10:45:14Z. --- <!-- victory-triage v1 head=af8b9ada41c47fc2748e72cf119e09a8185a0cfc verdict=merge-candidate at=2026-11-26T03:19:04Z --> Automated triage for the maintainers. **Verdict: merge candidate (kept).** Head `af8b9ad` is unchanged and still merges cleanly into `main`. The gate in `pipeline::builder::runs` (`crates/victory-gpu/src/pipeline/builder.rs`) and the two drop sites in `draw.rs` are as reviewed before. On the latest reply: noted. The Windows Ampere run with #2703 is a new data point. Without this PR the device was removed at 133 s and 81 s. With it, both runs lasted 10 minutes with the builder held back. If #2703 lands, this PR should land with it or before it. The `host_wave32()` condition still belongs to whichever of this PR and #2176 lands second. CI: passing (`check`). Recommending a look, not approving. --- _Generated by [Claude Code](https://claude.ai/code)_
desplmfao commented 2026-11-25 12:03:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by desplmfao on 2026-11-25T11:45:39Z.


A data point from the title on NVIDIA under Linux, where this fixed real corruption for us. RTX 5080, Proton with vkd3d-proton 3.2.0, our stack with #439, #2167 and #2311.

Without this PR: #2167 makes the rehydration passes (Box32Rehydration, Box16Rehydration, DecompressHeader) fast enough to run, but on our stack five builder pipelines are missing. RadixCount 14394a322f6dd5c2 and RadixAlloc e63d22c4def9ba6a don't translate (wave64 in groups of more than 64 threads), and the same goes for PrefixSum1024 and up. So the builder ran half its stages, and the title broke:

  • the player character lost her head;
  • triangles stretched across the whole screen;
  • after about 140 s the title crashed reading a pointer 0x7c007c00fc00fc00.

That pointer is the fp16 −∞/+∞ empty-child constant Box16Rehydration writes into its nodes, so a box node had been written over a live CPU object.

With this PR: BVH builder held back: not all its pipelines are made … pipelines=53 made=48 refused=5. The head is back, the stretched triangles are gone, and the run had no crash.

How it was found: the title's crash log gave the faulting read. Disassembling the title at that address showed the load, and the loaded value matched the constant in Box16Rehydration's GCN. An agent translating all 52 builder containers from XboxBvhBuilder.dll found the ones that don't translate. Before that, the GPU breadcrumbs from #2310 had shown the rehydration list itself timing out, which #2167 fixed.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7161463504 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7161463504). Originally posted by [desplmfao](https://github.com/desplmfao) on 2026-11-25T11:45:39Z. --- A data point from the title on NVIDIA under Linux, where this fixed real corruption for us. RTX 5080, Proton with vkd3d-proton 3.2.0, our stack with #439, #2167 and #2311. **Without this PR:** #2167 makes the rehydration passes (`Box32Rehydration`, `Box16Rehydration`, `DecompressHeader`) fast enough to run, but on our stack five builder pipelines are missing. `RadixCount` `14394a322f6dd5c2` and `RadixAlloc` `e63d22c4def9ba6a` don't translate (wave64 in groups of more than 64 threads), and the same goes for PrefixSum1024 and up. So the builder ran half its stages, and the title broke: - the player character lost her head; - triangles stretched across the whole screen; - after about 140 s the title crashed reading a pointer `0x7c007c00fc00fc00`. That pointer is the fp16 −∞/+∞ empty-child constant `Box16Rehydration` writes into its nodes, so a box node had been written over a live CPU object. **With this PR:** `BVH builder held back: not all its pipelines are made … pipelines=53 made=48 refused=5`. The head is back, the stretched triangles are gone, and the run had no crash. **How it was found:** the title's crash log gave the faulting read. Disassembling the title at that address showed the load, and the loaded value matched the constant in `Box16Rehydration`'s GCN. An agent translating all 52 builder containers from `XboxBvhBuilder.dll` found the ones that don't translate. Before that, the GPU breadcrumbs from #2310 had shown the rehydration list itself timing out, which #2167 fixed.
moe-miau commented 2026-11-25 19:06:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by moe-miau on 2026-11-25T18:30:15Z.


Data point from an RTX 4070 SUPER: with #2176 (wave64 programs as two 32-lane halves), once its cross-half refusals are lifted, all 53 builder pipelines get made, and the builder then hangs the GPU within 2 minutes (0x887A0006; the hung submission held 14394a32 and 28918b71). With this PR and one more condition, holding the builder back when the host runs 64-lane programs as halves (all_made(&states) && !victory_shader::emit::host_wave32()), a 6-minute run had no removal, and the log showed BVH builder held back ... pipelines=53 made=53 refused=0 as intended. So this PR's gate is what keeps those hosts alive once their pipelines all get made. Details and the stack used are on #2176.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7170996858 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7170996858). Originally posted by [moe-miau](https://github.com/moe-miau) on 2026-11-25T18:30:15Z. --- Data point from an RTX 4070 SUPER: with #2176 (wave64 programs as two 32-lane halves), once its cross-half refusals are lifted, all 53 builder pipelines get made, and the builder then hangs the GPU within 2 minutes (`0x887A0006`; the hung submission held 14394a32 and 28918b71). With this PR and one more condition, holding the builder back when the host runs 64-lane programs as halves (`all_made(&states) && !victory_shader::emit::host_wave32()`), a 6-minute run had no removal, and the log showed `BVH builder held back ... pipelines=53 made=53 refused=0` as intended. So this PR's gate is what keeps those hosts alive once their pipelines all get made. Details and the stack used are on #2176.
0xkn0wh3r3 commented 2026-11-25 19:06:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T18:37:13Z.


Thanks for the runs. @r4tedx, the comparison with the root-signature rule (53 pipelines against about 518 dispatches a frame) is the argument for recognising the builder by where its code lies. @desplmfao, the fp16 ±∞ pointer tracing back to Box16Rehydration is a very clear way to show what a half-run builder does.

@moe-miau, host_wave32() only exists with #2176, so that extra condition belongs in #2176. When it lands, a host that runs 64-lane programs as halves should hold the builder back even with all 53 made, which is what your run shows. If #2176 lands first I'll add it here, or it can go in #2176 itself.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171159992 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7171159992). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-25T18:37:13Z. --- Thanks for the runs. @r4tedx, the comparison with the root-signature rule (53 pipelines against about 518 dispatches a frame) is the argument for recognising the builder by where its code lies. @desplmfao, the fp16 ±∞ pointer tracing back to `Box16Rehydration` is a very clear way to show what a half-run builder does. @moe-miau, `host_wave32()` only exists with #2176, so that extra condition belongs in #2176. When it lands, a host that runs 64-lane programs as halves should hold the builder back even with all 53 made, which is what your run shows. If #2176 lands first I'll add it here, or it can go in #2176 itself.
fuzeofficlal commented 2026-11-26 01:04:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T00:41:30Z.


Code review and RTX 5090 + WARP verification at head af8b9ada41c4 merged cleanly onto main (63bcca43c6a0):

  • Code review: pipeline/builder.rs records the title acceleration-structure builder DLL range from both initial mapping and LateDlls in apps/victory/src/run.rs, tags compute pipelines created from that range (via bytecode pointer or RtlCaptureStackBackTrace), eagerly schedules compilation via make::begin, and gates both compute dispatch sites in draw.rs (State::dispatch line 1105 and execute_indirect line 1743) via pipeline::held_back until every live builder pipeline in PIPELINES reports Some(true). Graphics/stream pipelines pass &[] and remain unaffected.
  • Minor edge note (non-blocking): DECIDED caches (frame, open) for the rest of the frame. If runs() already cached true earlier in a frame and the title creates a brand-new uncompiled builder pipeline later in the same frame, the new pipeline itself is still held by host_pipeline while existing builder pipelines keep running for the remainder of that frame; gating catches the full set starting on the next frame (minimal practical impact since builder pipelines are typically created ahead of dispatch).
  • Verified (Windows 11, NVIDIA RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1, Rust 1.98.1):
    • cargo xtask policy: 192 files ok; cargo clippy --locked -p victory-gpu -p victory --tests -- -D warnings (default + --features diagnostics): 0 warnings
    • victory-gpu (pipeline:: draw::tests): 46/46 passed default on RTX 5090; 49/49 passed (--features diagnostics) on both RTX 5090 and WARP (including all 3 new builder tests)
    • victory crate tests: 18/18 passed (14 unit + 4 integration).

Clean and well-scoped; LGTM.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179017081 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7179017081). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T00:41:30Z. --- Code review and RTX 5090 + WARP verification at head `af8b9ada41c4` merged cleanly onto `main` (`63bcca43c6a0`): - **Code review**: `pipeline/builder.rs` records the title acceleration-structure builder DLL range from both initial mapping and `LateDlls` in `apps/victory/src/run.rs`, tags compute pipelines created from that range (via bytecode pointer or `RtlCaptureStackBackTrace`), eagerly schedules compilation via `make::begin`, and gates both compute dispatch sites in `draw.rs` (`State::dispatch` line 1105 and `execute_indirect` line 1743) via `pipeline::held_back` until every live builder pipeline in `PIPELINES` reports `Some(true)`. Graphics/stream pipelines pass `&[]` and remain unaffected. - **Minor edge note (non-blocking)**: `DECIDED` caches `(frame, open)` for the rest of the frame. If `runs()` already cached `true` earlier in a frame and the title creates a brand-new uncompiled builder pipeline later in the *same* frame, the new pipeline itself is still held by `host_pipeline` while existing builder pipelines keep running for the remainder of that frame; gating catches the full set starting on the next frame (minimal practical impact since builder pipelines are typically created ahead of dispatch). - **Verified (Windows 11, NVIDIA RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`, Rust 1.98.1)**: - `cargo xtask policy`: `192 files ok`; `cargo clippy --locked -p victory-gpu -p victory --tests -- -D warnings` (default + `--features diagnostics`): 0 warnings - `victory-gpu` (`pipeline:: draw::tests`): **46/46 passed** default on RTX 5090; **49/49 passed** (`--features diagnostics`) on both RTX 5090 and WARP (including all 3 new builder tests) - `victory` crate tests: **18/18 passed** (14 unit + 4 integration). Clean and well-scoped; LGTM.
0xkn0wh3r3 commented 2026-11-26 02:06:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T01:05:44Z.


@fuzeofficlal thanks for the review and the 5090 + WARP runs. On the DECIDED note: right, the decision is made once a frame, so a builder pipeline created after the frame's first dispatch only gates the set from the next frame. The new pipeline itself is held anyway, because it has no host pipeline until it's made. So for the rest of that frame, the builder runs without that one stage, which is what this PR prevents. The title creates its builder pipelines at load, long before the first dispatch, so I've left it per-frame rather than re-checking on every dispatch. I can tighten it if the maintainer prefers.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179426605 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7179426605). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-26T01:05:44Z. --- @fuzeofficlal thanks for the review and the 5090 + WARP runs. On the `DECIDED` note: right, the decision is made once a frame, so a builder pipeline created after the frame's first dispatch only gates the set from the next frame. The new pipeline itself is held anyway, because it has no host pipeline until it's made. So for the rest of that frame, the builder runs without that one stage, which is what this PR prevents. The title creates its builder pipelines at load, long before the first dispatch, so I've left it per-frame rather than re-checking on every dispatch. I can tighten it if the maintainer prefers.
neonbyte1 commented 2026-11-26 02:07:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T01:27:19Z.


Tested af8b9ada on an RTX 5090 (driver 620.73.04) under Linux: Wine 11.22, vkd3d-proton 3.1-83 (GE-Proton11-14), DXVK dxgi, diagnostics build. The base is main 219878a plus #2723, #1129, #1548, #233, #320, #439 and a one-back-edge-per-block workaround for HansKristian-Work/dxil-spirv#380.

On that base, #439 makes 28918b7150a7aad5 (the builder program at XboxBvhBuilder.dll+0x25c40) translate, while its sibling 14394a322f6dd5c2 stays refused ("console wave64 lanes in a group of more than 64 threads"). So the builder ran half its stages:

Build Runs Result
base, no #2118 2 (cold, warm) title crash at +0x23cf683 (write to 0) during loading, frames 626 and 1211
base, 28918b7150a7aad5 skipped 2 (7 and 12 min) no crash
base + #2118 1 (10 min) no crash, reached gameplay (frame 1744), no Xid

A bisect over the 72 shaders #439 newly translates narrowed the crash to that one program. With #2118, the refused sibling holds the set as intended, and nothing in the log points at the builder afterwards.

AI-assisted (Claude); measured on my machine, no game data shared.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179788584 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7179788584). Originally posted by [neonbyte1](https://github.com/neonbyte1) on 2026-11-26T01:27:19Z. --- Tested `af8b9ada` on an RTX 5090 (driver 620.73.04) under Linux: Wine 11.22, vkd3d-proton 3.1-83 (GE-Proton11-14), DXVK `dxgi`, diagnostics build. The base is `main` `219878a` plus #2723, #1129, #1548, #233, #320, #439 and a one-back-edge-per-block workaround for HansKristian-Work/dxil-spirv#380. On that base, #439 makes `28918b7150a7aad5` (the builder program at `XboxBvhBuilder.dll`+0x25c40) translate, while its sibling `14394a322f6dd5c2` stays refused ("console wave64 lanes in a group of more than 64 threads"). So the builder ran half its stages: | Build | Runs | Result | |---|---|---| | base, no #2118 | 2 (cold, warm) | title crash at `+0x23cf683` (write to 0) during loading, frames 626 and 1211 | | base, `28918b7150a7aad5` skipped | 2 (7 and 12 min) | no crash | | base + #2118 | 1 (10 min) | no crash, reached gameplay (frame 1744), no Xid | A bisect over the 72 shaders #439 newly translates narrowed the crash to that one program. With #2118, the refused sibling holds the set as intended, and nothing in the log points at the builder afterwards. _AI-assisted (Claude); measured on my machine, no game data shared._
0xkn0wh3r3 commented 2026-11-26 02:07:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T01:29:57Z.


@neonbyte1 thanks, that's a clean demonstration. Bisecting #439's 72 newly translated programs down to 28918b7150a7aad5, then showing the crash gone either by skipping it or by holding the builder back while its sibling 14394a322f6dd5c2 is refused, is exactly the case this gate is for: a builder running only some of its stages corrupts memory. It's good to have it on Linux/vkd3d-proton too.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179831271 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7179831271). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-26T01:29:57Z. --- @neonbyte1 thanks, that's a clean demonstration. Bisecting #439's 72 newly translated programs down to `28918b7150a7aad5`, then showing the crash gone either by skipping it or by holding the builder back while its sibling `14394a322f6dd5c2` is refused, is exactly the case this gate is for: a builder running only some of its stages corrupts memory. It's good to have it on Linux/vkd3d-proton too.
davesousa commented 2026-11-26 03:05:13 +00:00 (Migrated from github.com)

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


Windows NVIDIA in-game result for this PR together with #2703, which lets most of the builder's dispatches through: RTX 3070 Ti 8 GB (Ampere, 32-lane waves), driver 621.40, Windows 11 26200, TDR delay 8 s. 63bcca4 + #2319 + #2178 + #2634 + #2703, diag build, warm caches, scripted walking from 150 s. This PR at af8b9ad merges cleanly on that stack, and its three tests pass here.

+ #2703 + #2703 + this PR
runs 2 2 (one with DRED)
end 0x887A0006 at 133 s and 81 s no removal, both stopped by me at 10 min
longest host submission 14.9 s, 15.5 s 1.3 s, 0.64 s
world frame, median (2 samples, 2.5-4 s) 809 ms, 702 ms

At the first world frame: BVH builder held back: not all its pipelines are made pipelines=53 made=44 refused=9, and it never opened. So on Windows Ampere this PR is what lets #2703 land without a GPU reset. Details, and a comparison with #2841 (which does not stop the reset on its own), are on #2703.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7180949785 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7180949785). Originally posted by [davesousa](https://github.com/davesousa) on 2026-11-26T02:35:56Z. --- Windows NVIDIA in-game result for this PR together with #2703, which lets most of the builder's dispatches through: RTX 3070 Ti 8 GB (Ampere, 32-lane waves), driver 621.40, Windows 11 26200, TDR delay 8 s. `63bcca4` + #2319 + #2178 + #2634 + #2703, `diag` build, warm caches, scripted walking from 150 s. This PR at `af8b9ad` merges cleanly on that stack, and its three tests pass here. | | + #2703 | + #2703 + this PR | |---|---|---| | runs | 2 | 2 (one with DRED) | | end | `0x887A0006` at 133 s and 81 s | no removal, both stopped by me at 10 min | | longest host submission | 14.9 s, 15.5 s | 1.3 s, 0.64 s | | world frame, median | (2 samples, 2.5-4 s) | 809 ms, 702 ms | At the first world frame: `BVH builder held back: not all its pipelines are made pipelines=53 made=44 refused=9`, and it never opened. So on Windows Ampere this PR is what lets #2703 land without a GPU reset. Details, and a comparison with #2841 (which does not stop the reset on its own), are on #2703. AI-assisted (Claude Code); the runs are on my machine.
0xkn0wh3r3 commented 2026-11-26 03:05:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T02:36:27Z.


@davesousa thanks, that's the Windows confirmation. With #2703 letting most of the builder through, the device reset at 133 s and 81 s, with 15 s submissions, without this PR. With it, both runs went 10 minutes with the longest submission at 1.3 s, because the builder was held back with 9 of its 53 pipelines refused. So whichever of #2703 and this PR lands, the other should go with it.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7180957725 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7180957725). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-26T02:36:27Z. --- @davesousa thanks, that's the Windows confirmation. With #2703 letting most of the builder through, the device reset at 133 s and 81 s, with 15 s submissions, without this PR. With it, both runs went 10 minutes with the longest submission at 1.3 s, because the builder was held back with 9 of its 53 pipelines refused. So whichever of #2703 and this PR lands, the other should go with it.
fuzeofficlal commented 2026-11-26 15:37:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T15:37:59Z.

Review: APPROVED


Reviewed af8b9ada41c47fc2748e72cf119e09a8185a0cfc (merged cleanly onto 63bcca43c6a00a758510398fa43096ce7e4f7df0) and verified on Windows 11 with an NVIDIA GeForce RTX 5090, WARP, and D3D12 Debug Layer.

Audit

  • Origin detection & eager compilation (apps/victory/src/run.rs:122, :390; crates/victory-gpu/src/pipeline/builder.rs:31, :45, :85; crates/victory-gpu/src/pipeline/make.rs:209, :217): both initial and late-loaded title DLL ranges are registered under the existing #[cfg(windows)] loader paths, created_by_builder checks both bytecode ranges and caller frames (RtlCaptureStackBackTrace) against XboxBvhBuilder.dll (case-insensitively), and builder::note kicks off compilation via make::begin without being throttled by the per-frame wait budget.
  • All-or-nothing dispatch gating & isolation (crates/victory-gpu/src/pipeline/builder.rs:98, :139; crates/victory-gpu/src/pipeline.rs:267, :794; crates/victory-gpu/src/draw.rs:1084, :1722): all_made prunes dropped Weak<Pending> entries, caches the per-frame decision in DECIDED, and holds back builder dispatches in both dispatch and execute_indirect until every live builder pipeline is ready while leaving non-builder and graphics pipelines untouched.

Verification

  • Clean merge onto 63bcca43c6a00a758510398fa43096ce7e4f7df0 + cargo run -p xtask -- policy (192 files ok)
  • cargo clippy -p victory-gpu -p victory --all-targets -- -D warnings (default & --all-features)
  • cargo test -p victory: 18/18 passed (14 unit + census + census_unreadable + translate)
  • victory-gpu pipeline:: + draw:: with VICTORY_D3D12_DEBUG=1: 46/46 passed on RTX 5090; 49/49 passed (--features diagnostics) on WARP (including all three new builder tests).
<!-- greyfinch-sync:Marvisak/VIctory:review:6076886826 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#pullrequestreview-6076886826). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T15:37:59Z. **Review:** APPROVED --- Reviewed `af8b9ada41c47fc2748e72cf119e09a8185a0cfc` (merged cleanly onto `63bcca43c6a00a758510398fa43096ce7e4f7df0`) and verified on Windows 11 with an NVIDIA GeForce RTX 5090, WARP, and D3D12 Debug Layer. ### Audit - **Origin detection & eager compilation** (`apps/victory/src/run.rs:122`, `:390`; `crates/victory-gpu/src/pipeline/builder.rs:31`, `:45`, `:85`; `crates/victory-gpu/src/pipeline/make.rs:209`, `:217`): both initial and late-loaded title DLL ranges are registered under the existing `#[cfg(windows)]` loader paths, `created_by_builder` checks both bytecode ranges and caller frames (`RtlCaptureStackBackTrace`) against `XboxBvhBuilder.dll` (case-insensitively), and `builder::note` kicks off compilation via `make::begin` without being throttled by the per-frame wait budget. - **All-or-nothing dispatch gating & isolation** (`crates/victory-gpu/src/pipeline/builder.rs:98`, `:139`; `crates/victory-gpu/src/pipeline.rs:267`, `:794`; `crates/victory-gpu/src/draw.rs:1084`, `:1722`): `all_made` prunes dropped `Weak<Pending>` entries, caches the per-frame decision in `DECIDED`, and holds back builder dispatches in both `dispatch` and `execute_indirect` until every live builder pipeline is ready while leaving non-builder and graphics pipelines untouched. ### Verification - Clean merge onto `63bcca43c6a00a758510398fa43096ce7e4f7df0` + `cargo run -p xtask -- policy` (`192 files ok`) - `cargo clippy -p victory-gpu -p victory --all-targets -- -D warnings` (default & `--all-features`) - `cargo test -p victory`: **18/18 passed** (14 unit + `census` + `census_unreadable` + `translate`) - `victory-gpu` `pipeline::` + `draw::` with `VICTORY_D3D12_DEBUG=1`: **46/46 passed** on RTX 5090; **49/49 passed** (`--features diagnostics`) on WARP (including all three new builder tests).
latentdev commented 2026-11-26 17:09:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by latentdev on 2026-11-26T17:09:58Z.


When every builder pipeline exists: the gate opens, and two things follow (RTX 4090)

This is a case the gate doesn't see yet. The tree is #439 without e2d3cfd's limit plus #180-style quad gradients, so for the first time here all 53 builder pipelines translate and are made. Also in the tree: the title-memory and views' page bitmaps moved to video memory (#2175/#2465's approach), #2118 at af8b9ad, and #3102.

1. Without #2703, the gate opens and the builder runs only partly. The log says BVH builder runs frame=1017 pipelines=53 made=53 refused=0, but 11 builder programs are still dropped at dispatch with "a root view's offset: no root view, or outside title buffers" (the dword-4 bug, #2699): 190fbf0e, 35e51bb2, 3b90165a, 5062bc7a, 5e687674, 6f6a359d, c42a3195, c85822de, f6e47efa, f94e5d8b, ffd93c8a, all in XboxBvhBuilder.dll. The gate only counts pipelines that are missing, not dispatches dropped for other reasons. The run went 9.5 minutes without a hang, but it is the partial build this PR exists to prevent.

2. With #2703, the whole builder runs and hangs. It hung 7 frames into the world: 0x887A0006 with nvlddmkm event 153. The list stopped at dispatch 1075x1x1 [compute 5552dac6a2b7a1fd], also a builder program. So once nothing is refused, the next blocker on this card is that program, not the gate.

Suggestions:

  • Have runs() hold the builder while any builder dispatch is dropped at dispatch time, not only while a pipeline is missing. Root-view checks and skips are two such cases.
  • Until 5552dac6 runs, it may be worth treating it as a held builder pipeline on 32-lane hosts.

The combination you described stays the safe one on this card: with e2d3cfd, 7 builder stages are refused, so the gate holds the whole builder.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7198591229 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7198591229). Originally posted by [latentdev](https://github.com/latentdev) on 2026-11-26T17:09:58Z. --- ### When every builder pipeline exists: the gate opens, and two things follow (RTX 4090) This is a case the gate doesn't see yet. The tree is #439 without e2d3cfd's limit plus #180-style quad gradients, so for the first time here all 53 builder pipelines translate and are made. Also in the tree: the title-memory and views' page bitmaps moved to video memory (#2175/#2465's approach), #2118 at af8b9ad, and #3102. **1. Without #2703, the gate opens and the builder runs only partly.** The log says `BVH builder runs frame=1017 pipelines=53 made=53 refused=0`, but 11 builder programs are still dropped at dispatch with "a root view's offset: no root view, or outside title buffers" (the dword-4 bug, #2699): `190fbf0e`, `35e51bb2`, `3b90165a`, `5062bc7a`, `5e687674`, `6f6a359d`, `c42a3195`, `c85822de`, `f6e47efa`, `f94e5d8b`, `ffd93c8a`, all in `XboxBvhBuilder.dll`. The gate only counts pipelines that are missing, not dispatches dropped for other reasons. The run went 9.5 minutes without a hang, but it is the partial build this PR exists to prevent. **2. With #2703, the whole builder runs and hangs.** It hung 7 frames into the world: `0x887A0006` with nvlddmkm event 153. The list stopped at `dispatch 1075x1x1 [compute 5552dac6a2b7a1fd]`, also a builder program. So once nothing is refused, the next blocker on this card is that program, not the gate. Suggestions: - Have `runs()` hold the builder while any builder dispatch is dropped at dispatch time, not only while a pipeline is missing. Root-view checks and skips are two such cases. - Until `5552dac6` runs, it may be worth treating it as a held builder pipeline on 32-lane hosts. The combination you described stays the safe one on this card: with e2d3cfd, 7 builder stages are refused, so the gate holds the whole builder.
0xkn0wh3r3 commented 2026-11-26 18:18:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T18:18:54Z.


@latentdev thanks, that's a real hole: the gate only looked at missing pipelines, so with all 53 made it opened even though 11 builder dispatches were still dropped at bind time.

Fixed in 999a8f67 (branch rebased on main 63bcca4). A builder dispatch dropped at dispatch time now holds the builder back. That covers a State::bind failure (the root-view offset case you hit, no dynamic slots, no view heap, ...) and an indirect dispatch whose arguments, count or signature are missing. The hold starts at once, for the rest of that frame, and stays while the title keeps the dropped pipeline. A title usually keeps its pipelines, so in practice one dropped builder dispatch holds the builder for the rest of the run. It isn't retried on a timer, because these drops recur every frame and each retry would be another partial frame. The first drop is logged with its reason, and the BVH builder held back line now has a dropped= count. Skips were already covered: a skipped pipeline counts as refused, so the old gate held it.

New test: pipeline::tests::a_dropped_builder_dispatch_holds_the_builder. A made builder pipeline runs. Once one of its dispatches is dropped, the builder is held in that frame and in later ones, and it runs again once the pipeline is released. The test fails without the change.

On the hang with #2703 at 5552dac6 on the 4090: I'd keep that out of the gate. It's a device hang in one program that should be looked into on its own (in #2703, or in its own issue). Hard-coding a title shader hash here isn't an option, and a per-program rule would hide the bug rather than fix it. The gate should only encode "all of the builder or none of it".

<!-- greyfinch-sync:Marvisak/VIctory:comment:7200312538 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7200312538). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-26T18:18:54Z. --- @latentdev thanks, that's a real hole: the gate only looked at missing pipelines, so with all 53 made it opened even though 11 builder dispatches were still dropped at bind time. Fixed in `999a8f67` (branch rebased on `main` `63bcca4`). A builder dispatch dropped at dispatch time now holds the builder back. That covers a `State::bind` failure (the root-view offset case you hit, no dynamic slots, no view heap, ...) and an indirect dispatch whose arguments, count or signature are missing. The hold starts at once, for the rest of that frame, and stays while the title keeps the dropped pipeline. A title usually keeps its pipelines, so in practice one dropped builder dispatch holds the builder for the rest of the run. It isn't retried on a timer, because these drops recur every frame and each retry would be another partial frame. The first drop is logged with its reason, and the `BVH builder held back` line now has a `dropped=` count. Skips were already covered: a skipped pipeline counts as refused, so the old gate held it. New test: `pipeline::tests::a_dropped_builder_dispatch_holds_the_builder`. A made builder pipeline runs. Once one of its dispatches is dropped, the builder is held in that frame and in later ones, and it runs again once the pipeline is released. The test fails without the change. On the hang with #2703 at `5552dac6` on the 4090: I'd keep that out of the gate. It's a device hang in one program that should be looked into on its own (in #2703, or in its own issue). Hard-coding a title shader hash here isn't an option, and a per-program rule would hide the bug rather than fix it. The gate should only encode "all of the builder or none of it".
latentdev commented 2026-11-26 19:31:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by latentdev on 2026-11-26T19:31:48Z.


Checked 999a8f6 in the title on the RTX 4090, in the case I reported: all 53 builder pipelines made (#439 without e2d3cfd's limit) and #2703 not applied, so the dword-4 stages are dropped at bind time. The builder is no longer forced off.

BVH builder runs frame=1237 pipelines=53 made=53 refused=0 dropped=0
BVH builder held back: a dispatch of it was dropped frame=1237 why="a root view's offset: no root view, or outside title buffers"

It stayed held for the rest of an 8-minute run, which ended at the time limit with no hang or device removal. The cutscene frames I captured look as they do with the builder off. Its own test passes here too, with the other three builder tests.

One small thing: the first hold also logs draw.rs's once! warning, which still reads "a dispatch of the BVH builder held back: not all its pipelines are made". In this case every pipeline was made, so that text may want to name the reason, or point to the builder's own line.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7201688265 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7201688265). Originally posted by [latentdev](https://github.com/latentdev) on 2026-11-26T19:31:48Z. --- Checked 999a8f6 in the title on the RTX 4090, in the case I reported: all 53 builder pipelines made (#439 without e2d3cfd's limit) and #2703 not applied, so the dword-4 stages are dropped at bind time. The builder is no longer forced off. ``` BVH builder runs frame=1237 pipelines=53 made=53 refused=0 dropped=0 BVH builder held back: a dispatch of it was dropped frame=1237 why="a root view's offset: no root view, or outside title buffers" ``` It stayed held for the rest of an 8-minute run, which ended at the time limit with no hang or device removal. The cutscene frames I captured look as they do with the builder off. Its own test passes here too, with the other three builder tests. One small thing: the first hold also logs draw.rs's `once!` warning, which still reads "a dispatch of the BVH builder held back: not all its pipelines are made". In this case every pipeline was made, so that text may want to name the reason, or point to the builder's own line.
AIcelos commented 2026-11-26 21:37:19 +00:00 (Migrated from github.com)

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


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:7203902424 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7203902424). Originally posted by [AIcelos](https://github.com/AIcelos) on 2026-11-26T21:37:19Z. --- **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.
pickles976 commented 2026-11-27 03:57:53 +00:00 (Migrated from github.com)

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


Focused verification of production head 999a8f67125865fcc0b3aa23cdc8a93b10ef9974 on Linux/Wine 11.0, RTX 4060 Laptop 8 GiB, 16 GiB system RAM, NVIDIA 590.48.1. Diagnostic-relaxed vkd3d-proton 2576c0b4adfae4a+, not stock certification. Production unchanged; the only local source edit replaces the made-host-pipeline test's early return with a failure unless a native PSO really builds.

cargo test --locked --target x86_64-pc-windows-msvc -p victory-gpu --lib builder   -- --nocapture --test-threads=1

4 passed; 0 failed; 0 ignored; 0.68 s

Fresh victory-shader and victory-gpu compilation from the intended worktree: 8.01 s. Physical RTX 4060 enumerated. The four exercised paths were:

  • origin identification by bytecode / current-thread stack;
  • policy waits for every registered builder pipeline;
  • a refused builder stage holds the builder while leaving unrelated work unaffected;
  • a successfully created native no-op PSO, followed by the dispatch-drop gate: current-frame hold, persistent hold while that pipeline lives, release after retirement.

The latter proves a real host pipeline was available to the gate fixture; it does not dispatch an actual BVH build or validate its output. Source behavior also matters: dropped() stops subsequent work/rest of the frame; it cannot roll back builder commands already executed before the first bind failure. I am not treating this as transactional rollback or as proof that a fully enabled builder is correct.

Separately, #2703's contributor GPU fixture passed here with the exact root-constant / descriptor-offset output [1067450368, 16]: https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7209374076 . Our title's dropped hashes overlap the BVH programs reported in that thread. Neither change is integrated into our title stack yet; no #2703-alone title run, no Wave64 guard lifting. The next meaningful rendering gate is combined binding + builder-output correctness, not merely absence of PSO creation errors.

Evidence: .compat-runtime/logs/verify-pr2118-builder-gates-fresh-shader-20261127T035624Z/. GPU peak 277 MiB; minimum available RAM 12,322.8 MiB; scope 9 GiB / swap 512 MiB, external guards unchanged.

Lab provenance caveat: the first invocation failed before running tests because the shared cross-worktree Cargo target reused the preceding checkout's victory-shader metadata, which lacked Host::from_device. The selected source does contain it; touching/rebuilding that dependency resolved the mismatch without a production edit. That first compiler error is not a PR defect. No matched-parent or title result claimed.

Paired-stack follow-through (2026-11-27 04:08 UTC): #2703 + this full 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.

Actual scene-target follow-through (2026-11-27 04:32:20 UTC), still a black final window: same dirty paired production stack/hardware and unchanged guards, but temporarily withheld the cached early-pipelines.txt list while retaining native/shader caches; restored the original list after the trial. This is not a matched performance comparison. The scene trigger finally fired at frame 2193 (529 draws), and frame 2194 produced recognizable street/building geometry in colour/G-buffer-like targets with matching depth. These are intermediate, normalized diagnostic images kept locally—not a final rendered scene, colour-correctness proof, or controllable gameplay.

The title now actually exercises the gate: at frames 2187/2188 it reports 53 pipelines, 51 made, 2 refused, 0 dropped and holds the builder. Two early translation refusals are caa78b8ca62bc3d6 at GFX10 offset 0x298 and 28918b7150a7aad5 at 0x280, both LDS accesses without a uniform LDS fence in split wave64. Startup creation order makes these strong candidates for the two gate refusals, but the gate log does not print membership, so that association is not yet proved. Nor does this establish that these two cause the black final image. No Wave64 guard or builder gate was bypassed.

The run ended after ~136 s with an invalid-format diagnostic followed by a 103079215080-byte allocation failure during target dumping, exit 9; not a normal loading-RAM-floor stop and not a completed runtime pass. The kernel logged that refused allocation. The captured resource samples peaked at GPU 3851 MiB / scope 8980.3 MiB, minimum available RAM 4409.5 MiB. Local capture now validates footprints/bounds before allocating; malformed-input and existing pixel decoding tests pass 13/13 (CPU tests, not GPU certification). Exact capture-failure causality is still being checked; no ordinary title OOM claim from this diagnostic failure.

Evidence: .compat-runtime/logs/20261127T043220Z-{console.log,resources.csv}, demand-scene-trial-20261127T043219Z/, and local cap-demand-scene-20261127T043219Z/frame-2194-* targets. The game window at 120 s remained black. Next diagnostic: trace the populated geometry/depth through lighting and final composition with bounded target readbacks and pipeline identity, rather than assume no scene rendering occurred.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7209410011 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7209410011). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T03:57:53Z. --- Focused verification of production head **`999a8f67125865fcc0b3aa23cdc8a93b10ef9974`** on Linux/Wine 11.0, RTX 4060 Laptop 8 GiB, **16 GiB system RAM**, NVIDIA 590.48.1. Diagnostic-relaxed vkd3d-proton `2576c0b4adfae4a+`, not stock certification. Production unchanged; the only local source edit replaces the made-host-pipeline test's early return with a failure unless a native PSO really builds. ``` cargo test --locked --target x86_64-pc-windows-msvc -p victory-gpu --lib builder -- --nocapture --test-threads=1 4 passed; 0 failed; 0 ignored; 0.68 s ``` Fresh `victory-shader` and `victory-gpu` compilation from the intended worktree: **8.01 s**. Physical RTX 4060 enumerated. The four exercised paths were: - origin identification by bytecode / current-thread stack; - policy waits for every registered builder pipeline; - a refused builder stage holds the builder while leaving unrelated work unaffected; - a **successfully created native no-op PSO**, followed by the dispatch-drop gate: current-frame hold, persistent hold while that pipeline lives, release after retirement. The latter proves a real host pipeline was available to the gate fixture; **it does not dispatch an actual BVH build or validate its output**. Source behavior also matters: `dropped()` stops subsequent work/rest of the frame; it cannot roll back builder commands already executed before the first bind failure. I am not treating this as transactional rollback or as proof that a fully enabled builder is correct. Separately, #2703's contributor GPU fixture passed here with the exact root-constant / descriptor-offset output `[1067450368, 16]`: https://github.com/Marvisak/VIctory/pull/2703#issuecomment-7209374076 . Our title's dropped hashes overlap the BVH programs reported in that thread. **Neither change is integrated into our title stack yet; no #2703-alone title run, no Wave64 guard lifting.** The next meaningful rendering gate is combined binding + builder-output correctness, not merely absence of PSO creation errors. Evidence: `.compat-runtime/logs/verify-pr2118-builder-gates-fresh-shader-20261127T035624Z/`. GPU peak 277 MiB; minimum available RAM 12,322.8 MiB; scope 9 GiB / swap 512 MiB, external guards unchanged. Lab provenance caveat: the first invocation failed before running tests because the shared cross-worktree Cargo target reused the preceding checkout's `victory-shader` metadata, which lacked `Host::from_device`. The selected source does contain it; touching/rebuilding that dependency resolved the mismatch without a production edit. That first compiler error is **not a PR defect**. No matched-parent or title result claimed. **Paired-stack follow-through (2026-11-27 04:08 UTC):** #2703 + this full 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. **Actual scene-target follow-through (2026-11-27 04:32:20 UTC), still a black final window:** same dirty paired production stack/hardware and unchanged guards, but temporarily withheld the cached `early-pipelines.txt` list while retaining native/shader caches; restored the original list after the trial. This is not a matched performance comparison. The scene trigger finally fired at frame 2193 (529 draws), and frame 2194 produced recognizable street/building geometry in colour/G-buffer-like targets with matching depth. These are intermediate, normalized diagnostic images kept locally—not a final rendered scene, colour-correctness proof, or controllable gameplay. The title now actually exercises the gate: at frames 2187/2188 it reports **53 pipelines, 51 made, 2 refused, 0 dropped** and holds the builder. Two early translation refusals are `caa78b8ca62bc3d6` at GFX10 offset `0x298` and `28918b7150a7aad5` at `0x280`, both `LDS accesses without a uniform LDS fence in split wave64`. Startup creation order makes these strong candidates for the two gate refusals, but the gate log does not print membership, so that association is not yet proved. Nor does this establish that these two cause the black final image. No Wave64 guard or builder gate was bypassed. The run ended after ~136 s with an invalid-format diagnostic followed by a **103079215080-byte allocation failure** during target dumping, exit 9; not a normal loading-RAM-floor stop and not a completed runtime pass. The kernel logged that refused allocation. The captured resource samples peaked at GPU 3851 MiB / scope 8980.3 MiB, minimum available RAM 4409.5 MiB. Local capture now validates footprints/bounds before allocating; malformed-input and existing pixel decoding tests pass 13/13 (CPU tests, not GPU certification). Exact capture-failure causality is still being checked; no ordinary title OOM claim from this diagnostic failure. Evidence: `.compat-runtime/logs/20261127T043220Z-{console.log,resources.csv}`, `demand-scene-trial-20261127T043219Z/`, and local `cap-demand-scene-20261127T043219Z/frame-2194-*` targets. The game window at 120 s remained black. Next diagnostic: trace the populated geometry/depth through lighting and final composition with bounded target readbacks and pipeline identity, rather than assume no scene rendering occurred.
omarsaifuddin commented 2026-11-28 16:34:00 +00:00 (Migrated from github.com)

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


Tested on an RTX 3070 Ti: this is what keeps #2703 safe on NVIDIA.

Stack: main + #3226, #2323, #2885, #3518, #3016, #2348, #3670, #3496, #3587, #3588, #189, #3200 + #2703.

  • With #2703 and without this PR: the host GPU device was removed about 3 minutes into a scripted prologue run, twice in a row.
  • With #2703 and this PR: the same run lasted its full 10 minutes with no device removal. Late frame time was about the same as the run without #2703 (about 1.2 s/frame, about 500 ms of it on the GPU), so the builder isn't what makes those frames slow.

I didn't verify which dispatches faulted, only that adding this PR removed the failure. Late in the run about 425 draws/dispatches per frame are still dropped, nearly all of them refused compute shaders.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7242340940 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2118#issuecomment-7242340940). Originally posted by [omarsaifuddin](https://github.com/omarsaifuddin) on 2026-11-28T16:34:00Z. --- Tested on an RTX 3070 Ti: this is what keeps #2703 safe on NVIDIA. Stack: main + #3226, #2323, #2885, #3518, #3016, #2348, #3670, #3496, #3587, #3588, #189, #3200 + #2703. - With #2703 and without this PR: the host GPU device was removed about 3 minutes into a scripted prologue run, twice in a row. - With #2703 and this PR: the same run lasted its full 10 minutes with no device removal. Late frame time was about the same as the run without #2703 (about 1.2 s/frame, about 500 ms of it on the GPU), so the builder isn't what makes those frames slow. I didn't verify which dispatches faulted, only that adding this PR removed the failure. Late in the run about 425 draws/dispatches per frame are still dropped, nearly all of them refused compute shaders.
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/2118:upstream-pr/2118'
git switch 'upstream-pr/2118'

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/2118'
git switch 'upstream-pr/2118'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2118'
git switch 'upstream-pr/2118'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2118'
git switch 'main'
git merge --squash 'upstream-pr/2118'
git switch 'main'
git merge --ff-only 'upstream-pr/2118'
git switch 'main'
git merge 'upstream-pr/2118'
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!2116
No description provided.