Shaders, GPU: on 32-lane hosts, wave64 halves act as waves; the BVH builder waits (stacked on #2176, #2118) #2711

Open
github-bot wants to merge 8 commits from github-bot/gh-2711 into main AGit
Owner

@⁠moe-miau on GitHub · 2026-11-25 18:37 UTC · original
moe-miau:port/wave32-halves → main · +610 −18 · 20 files · 8 commits · open

Stacked on #2176 (n-romanovich) and #2118 (0xkn0wh3r3). Their commits are in this branch (#2176 at fb99078, #2118 at af8b9ad), on current main (f3578e3). The change to review is the last two commits, d13565e and 681076d. I'll rebase once they're merged. If either author would rather take this into their own PR, I'll close this one.

Problem

On NVIDIA (32-lane waves only), main refuses every compute pipeline that asks for WaveSize(64): 166 of them on an RTX 4070 SUPER in the first 6 minutes. That includes exposure, lighting and culling passes, so the world that #2464 brings back is heavily overexposed and blocky.

#2176 runs a wave64 program as two 32-lane host waves, with each host wave standing for one half. That clears every refusal here. It still leaves 118 programs untranslated, though, because they do three things it refuses on purpose:

  • 80: a 64-bit wave mask read as data on a 32-lane host
  • 32: a cross-half operation on a 32-lane host
  • a few: a cross-half wave scan on a 32-lane host

Change

  • Shaders (emit/lower.rs): those three cases now translate, with the meaning #2176 already gives a host wave: its ballot's high dword is 0, and host_lane keeps lanes within the half. That is exact for programs whose waves only work within themselves (compaction, reductions, prefix sums followed by one atomic per wave). It is approximate where the console exchanged across the halves. Zettrox/ztrx's default wave-local fallback makes the same trade, and that fork runs the prologue on NVIDIA.
  • GPU (pipeline/builder.rs): the BVH builder's programs do exchange across the halves. With them translated this way, the builder hung the GPU within 2 minutes (0x887A0006; the hung submission held 14394a32 and 28918b71). On a host that runs 64-lane programs as halves, the builder now stays held back (opens), and the log says why. That is where main leaves it today, because its programs are refused there.
  • #2176's test wave64_cross_half_readlane_is_refused_on_wave32_host becomes wave64_readlane_reads_its_own_half_on_wave32_host. The builder test also covers the new condition.
  • Hosts with 64-lane waves (AMD) are unchanged: host_wave32() is false there.
  • #2176's newer refusal, a wave64 program of one wave (64 threads or fewer) that shares LDS, stays: a program like that has no barrier between its halves, so running them as two waves would race.

Tested

RTX 4070 SUPER, driver 32.0.16.1742, Windows 11 26300. Title 1.0.2.1, Series X profile, diag build, scripted Enter presses. The base stack is main 67e8ae1 + #1906 + #2098 + #2626 + #2628 + #2464.

refused not translated device removed picture
base 166 7 no world draws, heavily overexposed and blocky
base + #189 (Emulate) 98 2 no similar
base + #2176 0 118 no credits artwork right, world partly missing
base + #2176, refusals lifted, no builder hold 0 0 at 110 s
base + this PR 0 4 no credits complete over a lit city skyline, normal exposure

A 15-minute run of the same stack had no device removal, 0 refused and 8 untranslated. It got past the opening credits into the prologue's cell (no letterbox, steady 4,900 draws a frame at about 1.2 fps), with green artifacts and banding still to fix.

  • cargo test -p victory-gpu --locked: 196 passed. The 2 failures are the NVIDIA heap-cap tests that also fail on main here (#2628 fixes them).
  • cargo test -p victory-shader --lib: 267 passed, 3 failed (a_heap_buffer_read_by_element_takes_the_views_stride, a_heap_buffer_read_where_no_buffer_view_is_reads_zeros, gathers_at_a_level_match_the_hardware), the same as main with NVIDIA. heap_direct_texture_reads_mark_their_heap_index is skipped because it crashes the test process on main here too.
  • cargo clippy --workspace --all-targets --locked -- -D warnings, also with --all-features: clean. cargo xtask policy: ok.

AI-assisted (Claude Code). Runs done on my machine.

🤖 Generated with Claude Code

**@⁠moe-miau** on GitHub · 2026-11-25 18:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711) `moe-miau:port/wave32-halves` → `main` · +610 −18 · 20 files · 8 commits · open **Stacked on #2176 (n-romanovich) and #2118 (0xkn0wh3r3).** Their commits are in this branch (#2176 at `fb99078`, #2118 at `af8b9ad`), on current `main` (`f3578e3`). The change to review is the last two commits, `d13565e` and `681076d`. I'll rebase once they're merged. If either author would rather take this into their own PR, I'll close this one. ## Problem On NVIDIA (32-lane waves only), `main` refuses every compute pipeline that asks for `WaveSize(64)`: 166 of them on an RTX 4070 SUPER in the first 6 minutes. That includes exposure, lighting and culling passes, so the world that #2464 brings back is heavily overexposed and blocky. #2176 runs a wave64 program as two 32-lane host waves, with each host wave standing for one half. That clears every refusal here. It still leaves 118 programs untranslated, though, because they do three things it refuses on purpose: - 80: `a 64-bit wave mask read as data on a 32-lane host` - 32: `a cross-half operation on a 32-lane host` - a few: `a cross-half wave scan on a 32-lane host` ## Change - **Shaders (`emit/lower.rs`):** those three cases now translate, with the meaning #2176 already gives a host wave: its ballot's high dword is 0, and `host_lane` keeps lanes within the half. That is exact for programs whose waves only work within themselves (compaction, reductions, prefix sums followed by one atomic per wave). It is approximate where the console exchanged across the halves. Zettrox/ztrx's default wave-local fallback makes the same trade, and that fork runs the prologue on NVIDIA. - **GPU (`pipeline/builder.rs`):** the BVH builder's programs do exchange across the halves. With them translated this way, the builder hung the GPU within 2 minutes (`0x887A0006`; the hung submission held `14394a32` and `28918b71`). On a host that runs 64-lane programs as halves, the builder now stays held back (`opens`), and the log says why. That is where `main` leaves it today, because its programs are refused there. - #2176's test `wave64_cross_half_readlane_is_refused_on_wave32_host` becomes `wave64_readlane_reads_its_own_half_on_wave32_host`. The builder test also covers the new condition. - Hosts with 64-lane waves (AMD) are unchanged: `host_wave32()` is false there. - #2176's newer refusal, a wave64 program of one wave (64 threads or fewer) that shares LDS, stays: a program like that has no barrier between its halves, so running them as two waves would race. ## Tested RTX 4070 SUPER, driver 32.0.16.1742, Windows 11 26300. Title 1.0.2.1, Series X profile, diag build, scripted Enter presses. The base stack is `main` `67e8ae1` + #1906 + #2098 + #2626 + #2628 + #2464. | | refused | not translated | device removed | picture | |---|---|---|---|---| | base | 166 | 7 | no | world draws, heavily overexposed and blocky | | base + #189 (Emulate) | 98 | 2 | no | similar | | base + #2176 | 0 | 118 | no | credits artwork right, world partly missing | | base + #2176, refusals lifted, no builder hold | 0 | 0 | **at 110 s** | | | **base + this PR** | **0** | **4** | **no** | credits complete over a lit city skyline, normal exposure | A 15-minute run of the same stack had no device removal, 0 refused and 8 untranslated. It got past the opening credits into the prologue's cell (no letterbox, steady 4,900 draws a frame at about 1.2 fps), with green artifacts and banding still to fix. - `cargo test -p victory-gpu --locked`: 196 passed. The 2 failures are the NVIDIA heap-cap tests that also fail on `main` here (#2628 fixes them). - `cargo test -p victory-shader --lib`: 267 passed, 3 failed (`a_heap_buffer_read_by_element_takes_the_views_stride`, `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`, `gathers_at_a_level_match_the_hardware`), the same as `main` with NVIDIA. `heap_direct_texture_reads_mark_their_heap_index` is skipped because it crashes the test process on `main` here too. - `cargo clippy --workspace --all-targets --locked -- -D warnings`, also with `--all-features`: clean. `cargo xtask policy`: ok. AI-assisted (Claude Code). Runs done on my machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The title's acceleration-structure builder (`XboxBvhBuilder.dll`) builds
and refits the ray-tracing structures in title memory every frame through
some fifty compute dispatches. A dispatch without a host pipeline is
dropped on its own (`State::dispatch`, `execute_indirect`), and some of
the builder's lack one for a long time or for good: refused on hosts of
32-lane waves (they ask for 64-lane waves), not translated, or still being
made. The stages that do run then work on data the missing ones never
wrote, and write the result into title memory. On fxceless/victory-fork,
where this happened, the builder wrote garbage bounds that crashed the
title; that fork's rule is the one taken here.

Its dispatches now run only in frames where every pipeline the builder
has created has its host pipeline; otherwise none run, and the structures
keep what they held. The decision is made once per frame, so a frame
never runs part of the builder. Its pipelines are known by origin: bytecode
in the builder's image, or a return address in it on the stack when the
pipeline is created (`run` passes the DLL's range as it maps it, at start
and when the title loads it). They are started at once, so no frame's
wait budget holds the builder back.

New tests (no game data):
- `pipeline::builder::tests::the_builder_runs_only_with_every_pipeline_made`
- `pipeline::builder::tests::builder_pipelines_are_known_by_their_origin`
- `pipeline::tests::builder_dispatches_wait_for_every_builder_pipeline`:
  a compute pipeline created from bytecode in the registered image is the
  builder's, is started at once, is refused (no shader container), and
  holds back builder dispatches; another pipeline is not held back.
With wave64 programs run as two 32-lane host waves (#2176), 118 of the
title's programs were still refused here: 80 read a wave mask as data,
32 exchange lanes, a few scan across the wave. Each host wave already
stands for one half (its ballot's high dword is 0, `host_lane` keeps
lanes in the half), so those now translate with that meaning: exact
for programs whose waves work within themselves (compaction, reductions,
one atomic per wave), approximate where the console exchanged across
the halves.

The BVH builder's programs do exchange across them, and run that way
they hung the GPU within two minutes on an RTX 4070 SUPER. So on such
hosts the builder stays held back (#2118), as it is today where its
programs are refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a 32-lane host, read_lane takes console lane hi as the host wave's
own lane (hi & 31), but the ballot check still read word hi / 32, which
is always 0 there for hi >= 32. The packed high half then took the
identity even where that lane ran. The check now uses the same lane
(ballot_bit). Found by DrDarkDK in review.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:12:34 +00:00
Triage asked for #2176's refusals to stay the default: lifting them makes
programs that combine work across the two halves silently approximate
(Venom2054's ballot test counts 128 where the console counts 138). The
three refusals (cross-half lane operations, 64-bit wave masks read as data,
cross-half scans) are back unless emit::Options::wave32_approx is set; the
GPU sets it with VICTORY_WAVE32_APPROX=1 on a 32-lane host, and the shader
cache key includes it. The test checks both: refused by default,
translated when approximate. The BVH builder stays held back on such hosts
either way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 18:56 UTC · original

The approximation is honest and the safety rail is the important part. Read through the whole stack:

  • host_lane() masking console lanes 32-63 to the half keeps the refusal-to-approximation swap consistent everywhere lanes are named (readlane, permute, mbcnt replace), and high-dword-empty ballot halves match the documented 'each host wave stands for one half' model.
  • The BVH hold-back is the right shape: the builder runs whole or not at all, decided once per frame (DECIDED cache), so a frame can never run a subset of its dispatches. Identification by bytecode-pointers-in-image plus caller return addresses is a reasonable heuristic for how these get created, and note() forces immediate make so builder pipelines don't sit in the budget queue.
  • Gating held_back specifically on host_wave32 for the builder is precise - on wave64-capable hosts its programs get exact translation and it opens.
  • The tests pin both the refusal removal and the held-back accounting.

One structural note for maintainers: this ships an approximation whose wrong cases are cross-half exchanges in programs other than the builder. The description is upfront that these can be wrong-but-running rather than refused - the builder's known-bad user is fenced, but the residual risk is subtle numerical differences in unclassified wave64 programs. Whether that trade beats 166 refused pipelines is a maintainer call; the mechanics here look sound either way.

**@⁠kotekompotek** on GitHub · 2026-11-25 18:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7171610759) The approximation is honest and the safety rail is the important part. Read through the whole stack: - host_lane() masking console lanes 32-63 to the half keeps the refusal-to-approximation swap consistent everywhere lanes are named (readlane, permute, mbcnt replace), and high-dword-empty ballot halves match the documented 'each host wave stands for one half' model. - The BVH hold-back is the right shape: the builder runs whole or not at all, decided once per frame (DECIDED cache), so a frame can never run a subset of its dispatches. Identification by bytecode-pointers-in-image plus caller return addresses is a reasonable heuristic for how these get created, and note() forces immediate make so builder pipelines don't sit in the budget queue. - Gating held_back specifically on host_wave32 for the builder is precise - on wave64-capable hosts its programs get exact translation and it opens. - The tests pin both the refusal removal and the held-back accounting. One structural note for maintainers: this ships an approximation whose wrong cases are cross-half exchanges in programs other than the builder. The description is upfront that these can be wrong-but-running rather than refused - the builder's known-bad user is fenced, but the residual risk is subtle numerical differences in unclassified wave64 programs. Whether that trade beats 166 refused pipelines is a maintainer call; the mechanics here look sound either way.
Author
Owner

@⁠moe-miau on GitHub · 2026-11-25 19:02 UTC · original

@⁠DrDarkDK Thanks, you're right. Fixed in cfcadf6. The ballot check now asks about the same lane that read_lane reads, through ballot_bit(hi, host_wave), which returns the word and bit of hi & (host_wave - 1). On a 32-lane host, hi = 33 checks bit 1 of word 0, the lane the read takes, so the packed high half survives where that lane ran and takes the identity where it didn't. 64-lane hosts are unchanged (ballot_bit(33, 64) == (1, 1)).

On the test: a_half_scans_ballot_bit_is_the_lane_it_reads covers the lane mapping on both host widths. A full GPU regression would need a hand-built GFX10 v_add_f16 half-scan sequence with a wave64 header, and the shader tests have no builder for that pattern yet, so I kept the test at the mapping. If you'd rather have the end-to-end version, I'll add it.

victory-shader --lib: 268 passed, with the same 3 NVIDIA failures as main. Clippy is clean in both configurations.

**@⁠moe-miau** on GitHub · 2026-11-25 19:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7171746964) @⁠DrDarkDK Thanks, you're right. Fixed in `cfcadf6`. The ballot check now asks about the same lane that `read_lane` reads, through `ballot_bit(hi, host_wave)`, which returns the word and bit of `hi & (host_wave - 1)`. On a 32-lane host, `hi = 33` checks bit 1 of word 0, the lane the read takes, so the packed high half survives where that lane ran and takes the identity where it didn't. 64-lane hosts are unchanged (`ballot_bit(33, 64) == (1, 1)`). On the test: `a_half_scans_ballot_bit_is_the_lane_it_reads` covers the lane mapping on both host widths. A full GPU regression would need a hand-built GFX10 `v_add_f16` half-scan sequence with a wave64 header, and the shader tests have no builder for that pattern yet, so I kept the test at the mapping. If you'd rather have the end-to-end version, I'll add it. `victory-shader --lib`: 268 passed, with the same 3 NVIDIA failures as `main`. Clippy is clean in both configurations.
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-25 19:27 UTC · original

I ran a synthetic counting test twice on an RTX 5070 Ti at cfcadf6, with host_wave32 enabled. One 256-thread group represents four console waves. In wave w, lanes below 33 + w vote. Each wave leader publishes its count to group-shared memory. All threads cross a group barrier and read the counts.

Operation Expected per wave GPU readback Expected / actual total
Store known counts directly, without a ballot 33, 34, 35, 36 33, 34, 35, 36 138 / 138
Count the ballot in all four waves 33, 34, 35, 36 32, 32, 32, 32 138 / 128
Only alternate waves vote 33, 0, 35, 0 32, 0, 32, 0 68 / 64

Consuming the ballot under the wave-leader guard gave the same 128 total. All four shaders passed DXIL validation and executed. All 256 returned words matched the CPU expectation for the shared-memory control, and all 256 differed in each ballot case. The BVH setting was unchanged. This gives a concrete case where a classifier that consumes a numerical ballot undercounts work. The packed half-scan change and its effect on an in-game frame were outside this test.

**@⁠Venom2054** on GitHub · 2026-11-25 19:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7172316677) I ran a synthetic counting test twice on an RTX 5070 Ti at `cfcadf6`, with `host_wave32` enabled. One 256-thread group represents four console waves. In wave w, lanes below 33 + w vote. Each wave leader publishes its count to group-shared memory. All threads cross a group barrier and read the counts. | Operation | Expected per wave | GPU readback | Expected / actual total | | --- | --- | --- | --- | | Store known counts directly, without a ballot | 33, 34, 35, 36 | 33, 34, 35, 36 | 138 / 138 | | Count the ballot in all four waves | 33, 34, 35, 36 | 32, 32, 32, 32 | 138 / 128 | | Only alternate waves vote | 33, 0, 35, 0 | 32, 0, 32, 0 | 68 / 64 | Consuming the ballot under the wave-leader guard gave the same 128 total. All four shaders passed DXIL validation and executed. All 256 returned words matched the CPU expectation for the shared-memory control, and all 256 differed in each ballot case. The BVH setting was unchanged. This gives a concrete case where a classifier that consumes a numerical ballot undercounts work. The packed half-scan change and its effect on an in-game frame were outside this test.
Author
Owner

@⁠moe-miau on GitHub · 2026-11-25 19:33 UTC · original

@⁠Venom2054 Thanks, that's a clean measurement of the approximate case. It is what this PR trades for running at all: each 32-lane host wave stands for one half of the console's wave, so a ballot only sees its own half's lanes, and a per-wave count capped at 32 is the expected result. In your test, a wave of 33–36 voting lanes undercounts by the lanes in the other half. When only the lower half's leader publishes, those lanes are lost from the total (138 → 128).

That's the residual risk the description and kotekompotek's note point at: wrong-but-running instead of refused, for programs that combine work across the two halves. The BVH builder is the known case that hangs, and it is held back. Counting classifiers like this one can undercount instead.

Two ways to narrow it, both beyond this PR:

  • Exchange through group-shared memory for the patterns that combine a whole wave's ballot (count, then one leader publishes): each half writes its part and both read the sum after a barrier. That's ztrx's lds_meetings direction. It needs a classifier, plus GPU tests like yours as regressions.
  • Make the approximation opt-in (keep #2176's refusals by default, lift them with a switch), if the maintainers would rather not ship wrong-but-running by default.

If maintainers prefer the second, I can make that change here. I'd keep your test case as the reference for the first.

AI-assisted (Claude Code).

**@⁠moe-miau** on GitHub · 2026-11-25 19:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7172456730) @⁠Venom2054 Thanks, that's a clean measurement of the approximate case. It is what this PR trades for running at all: each 32-lane host wave stands for one half of the console's wave, so a ballot only sees its own half's lanes, and a per-wave count capped at 32 is the expected result. In your test, a wave of 33–36 voting lanes undercounts by the lanes in the other half. When only the lower half's leader publishes, those lanes are lost from the total (138 → 128). That's the residual risk the description and kotekompotek's note point at: wrong-but-running instead of refused, for programs that combine work across the two halves. The BVH builder is the known case that hangs, and it is held back. Counting classifiers like this one can undercount instead. Two ways to narrow it, both beyond this PR: - Exchange through group-shared memory for the patterns that combine a whole wave's ballot (count, then one leader publishes): each half writes its part and both read the sum after a barrier. That's ztrx's `lds_meetings` direction. It needs a classifier, plus GPU tests like yours as regressions. - Make the approximation opt-in (keep #2176's refusals by default, lift them with a switch), if the maintainers would rather not ship wrong-but-running by default. If maintainers prefer the second, I can make that change here. I'd keep your test case as the reference for the first. AI-assisted (Claude Code).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 19:51 UTC · original

Independent Windows 11 + NVIDIA GeForce RTX 5090 (32-lane host) + WARP + dxil.dll verification and code review of cfcadf6 (clean zero-conflict git merge-tree with 13f91ca):

Verification (rustc 1.98.1 MSVC, Windows SDK 10.0.26100.0 dxil.dll)

  • cargo xtask policy: 185 files ok.
  • cargo clippy --locked -p victory-shader -p victory-gpu -p victory --all-targets -- -D warnings (plus --features host and --features diagnostics): 0 warnings.
  • victory-shader (RTX 5090 32-lane hardware + dxil.dll):
    • wave64_readlane_reads_its_own_half_on_wave32_host: 1 passed.
    • a_half_scans_ballot_bit_is_the_lane_it_reads: 1 passed.
    • emit::tests (18 passed), emit::lower::tests (28 passed), emit::diff_tests (5 passed), emit::synthetic_tests (6 passed, 1 pre-existing RTX 5090 baseline failure in gathers_at_a_level_match_the_hardware).
  • victory-gpu:
    • WARP (VICTORY_D3D12_WARP=1, --features diagnostics): 201 passed, 0 failed, 1 ignored.
    • RTX 5090: pipeline:: 19 passed, 0 failed (including builder_dispatches_wait_for_every_builder_pipeline); shader_cache:: 3 passed, 0 failed (including updated the_key_covers_translator_encoding_and_settings).

Review Notes

  • The 32-lane half-wave lowering (PSV0 WaveSize(32, 32), thread_id masking on wave_size, host_lane masking to host_wave - 1, ballot_bit(hi, host_wave) fix for v_add_f16 half-scan, shader_cache::key "host wave32" isolation) and per-frame builder::runs() gating on both dispatch and execute_indirect look solid.
  • Two minor non-blocking notes:
    • pipeline.rs::create_stream passes &[] as code to hand_out, so !code.is_empty() && builder::created_by_builder(code) would skip builder detection if a compute pipeline were ever created through CreatePipelineState rather than create_compute/create_compute_x.
    • builder::runs() checks victory_shader::emit::host_wave32() (initialized on first shader_cache::build()) rather than crate::host::host_wave32() directly; calling crate::host::host_wave32() makes the initial frame's diagnostic reason consistent before the first shader translates.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 19:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7172849363) Independent Windows 11 + NVIDIA GeForce RTX 5090 (32-lane host) + WARP + `dxil.dll` verification and code review of `cfcadf6` (clean zero-conflict `git merge-tree` with `13f91ca`): ### Verification (`rustc 1.98.1` MSVC, Windows SDK `10.0.26100.0` `dxil.dll`) - `cargo xtask policy`: **185 files ok**. - `cargo clippy --locked -p victory-shader -p victory-gpu -p victory --all-targets -- -D warnings` (plus `--features host` and `--features diagnostics`): **0 warnings**. - **`victory-shader` (RTX 5090 32-lane hardware + `dxil.dll`):** - `wave64_readlane_reads_its_own_half_on_wave32_host`: **1 passed**. - `a_half_scans_ballot_bit_is_the_lane_it_reads`: **1 passed**. - `emit::tests` (**18 passed**), `emit::lower::tests` (**28 passed**), `emit::diff_tests` (**5 passed**), `emit::synthetic_tests` (**6 passed, 1 pre-existing RTX 5090 baseline failure** in `gathers_at_a_level_match_the_hardware`). - **`victory-gpu`:** - **WARP (`VICTORY_D3D12_WARP=1`, `--features diagnostics`):** **201 passed, 0 failed, 1 ignored**. - **RTX 5090:** `pipeline::` **19 passed, 0 failed** (including `builder_dispatches_wait_for_every_builder_pipeline`); `shader_cache::` **3 passed, 0 failed** (including updated `the_key_covers_translator_encoding_and_settings`). ### Review Notes - The 32-lane half-wave lowering (`PSV0` `WaveSize(32, 32)`, `thread_id` masking on `wave_size`, `host_lane` masking to `host_wave - 1`, `ballot_bit(hi, host_wave)` fix for `v_add_f16` half-scan, `shader_cache::key` `"host wave32"` isolation) and per-frame `builder::runs()` gating on both `dispatch` and `execute_indirect` look solid. - Two minor non-blocking notes: - `pipeline.rs::create_stream` passes `&[]` as `code` to `hand_out`, so `!code.is_empty() && builder::created_by_builder(code)` would skip builder detection if a compute pipeline were ever created through `CreatePipelineState` rather than `create_compute`/`create_compute_x`. - `builder::runs()` checks `victory_shader::emit::host_wave32()` (initialized on first `shader_cache::build()`) rather than `crate::host::host_wave32()` directly; calling `crate::host::host_wave32()` makes the initial frame's diagnostic reason consistent before the first shader translates.
Author
Owner

@⁠tippythetaidum on GitHub · 2026-11-25 20:13 UTC · original

Some data for the residual-risk question, from victory-fork, which runs the same title on 32-lane NVIDIA cards a different way. It names four programs where the cross-half behaviour shows on screen. The program hashes are the title's, so they can be checked against this PR's list of approximated programs.

In victory-fork (fxceless/victory-fork#823), these four compute programs needed an exact cross-half form to run on a 32-lane host, and were refused without it:

Hash Program
5dc3b25986622949 water_shading:CS_TransmissionVolumetrics_Tiled
6f225b641c5b0708 water_shading:CS_TransmissionVolumetrics_Tiled_LocalLights
369cbe906ea72764 GpuParticleUpdate:CS_Visibility
2cc4c197ee29e291 sr_tracing:CS_Tiling_Generate_Opaque

Three more needed it across several console waves of a group and stayed refused there: 2da4beb386509b77 (alpha transmission prefilter), and 02384a60fda6f2d0 and 6b82bc7d22016cb5 (vfx triangle clip).

What they did to the picture on an RTX 5080 (600 s runs through the prologue, compared shot by shot with console footage of the same scenes):

  • The tiling program 2cc4c197ee29e291 is the one close-up lighting depends on. With it exact, characters near the camera get their shading and the shadows on their clothes. With it not run (everything else the same), close characters look flat and unlit while distant ones look right. It's a classifier that builds tile lists from wave-wide counts, so it's the kind of program that would undercount, as in @⁠Venom2054's measurement, if it is approximated here.
  • With the tiling exact but no BVH, the passes it schedules trace structures that were never built. Reflections then show the sky indoors (blue-violet irises, sky in glass and picture frames, oily-looking floors). This PR holds the builder back on 32-lane hosts, so with the tiling right those artifacts may appear, and they're expected until the builder runs.
  • Cost: the four together were about a quarter of the frame (median 7.4 fps without them, 5.7 with them). The tiling alone isn't the expensive one.

One more data point for the builder: in victory-fork, turning the exact form on for every program at once lost the card (its runs 121-124). That's why the fork allows it per program. It's the same direction as the builder hold here.

AI-assisted (Claude Code, Claude Opus 5.5): runs and log reading on my machine; descriptions and counts only.

**@⁠tippythetaidum** on GitHub · 2026-11-25 20:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7173355290) Some data for the residual-risk question, from victory-fork, which runs the same title on 32-lane NVIDIA cards a different way. It names four programs where the cross-half behaviour shows on screen. The program hashes are the title's, so they can be checked against this PR's list of approximated programs. In victory-fork (fxceless/victory-fork#823), these four compute programs needed an exact cross-half form to run on a 32-lane host, and were refused without it: | Hash | Program | |---|---| | `5dc3b25986622949` | `water_shading:CS_TransmissionVolumetrics_Tiled` | | `6f225b641c5b0708` | `water_shading:CS_TransmissionVolumetrics_Tiled_LocalLights` | | `369cbe906ea72764` | `GpuParticleUpdate:CS_Visibility` | | `2cc4c197ee29e291` | `sr_tracing:CS_Tiling_Generate_Opaque` | Three more needed it across several console waves of a group and stayed refused there: `2da4beb386509b77` (alpha transmission prefilter), and `02384a60fda6f2d0` and `6b82bc7d22016cb5` (vfx triangle clip). What they did to the picture on an RTX 5080 (600 s runs through the prologue, compared shot by shot with console footage of the same scenes): - **The tiling program `2cc4c197ee29e291` is the one close-up lighting depends on.** With it exact, characters near the camera get their shading and the shadows on their clothes. With it not run (everything else the same), close characters look flat and unlit while distant ones look right. It's a classifier that builds tile lists from wave-wide counts, so it's the kind of program that would undercount, as in @⁠Venom2054's measurement, if it is approximated here. - **With the tiling exact but no BVH,** the passes it schedules trace structures that were never built. Reflections then show the sky indoors (blue-violet irises, sky in glass and picture frames, oily-looking floors). This PR holds the builder back on 32-lane hosts, so with the tiling right those artifacts may appear, and they're expected until the builder runs. - Cost: the four together were about a quarter of the frame (median 7.4 fps without them, 5.7 with them). The tiling alone isn't the expensive one. One more data point for the builder: in victory-fork, turning the exact form on for every program at once lost the card (its runs 121-124). That's why the fork allows it per program. It's the same direction as the builder hold here. AI-assisted (Claude Code, Claude Opus 5.5): runs and log reading on my machine; descriptions and counts only.
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-25 20:38 UTC · original

I checked the opaque tiling shader in the fourth row against this PR at cfcadf62. It does take the approximate half-wave path. I translated the same 8 × 8 × 1 compute program twice with the PR's translator, changing only host_wave32. The emitted DXIL declares WaveSize=64 with the option off and WaveSize=32 with it on. Both variants contain 13 static waveActiveBallot call sites.

In our earlier RTX 5070 Ti prison-window capture on a separate integration, this program had a host pipeline and a recorded dispatch of 160 × 90 × 1 groups. That identifies a pass we can compare. The synthetic ballot undercount reported above was measured on a different program. The tile-list contents and effect on character lighting for this specific shader are still unmeasured on the 5070 Ti.

**@⁠Venom2054** on GitHub · 2026-11-25 20:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7173980834) I checked the opaque tiling shader in the fourth row against this PR at `cfcadf62`. It does take the approximate half-wave path. I translated the same 8 × 8 × 1 compute program twice with the PR's translator, changing only `host_wave32`. The emitted DXIL declares `WaveSize=64` with the option off and `WaveSize=32` with it on. Both variants contain 13 static `waveActiveBallot` call sites. In our earlier RTX 5070 Ti prison-window capture on a separate integration, this program had a host pipeline and a recorded dispatch of 160 × 90 × 1 groups. That identifies a pass we can compare. The synthetic ballot undercount reported above was measured on a different program. The tile-list contents and effect on character lighting for this specific shader are still unmeasured on the 5070 Ti.
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-25 21:09 UTC · original

I tested the execution-versus-omission comparison for the opaque classifier (2cc4c197ee29e291) at the prison window on an RTX 5070 Ti. Both runs used the same local executable, save, seeded caches and ambient-light override. The local translator already exchanges values across the two halves of the wave. I toggled only its bound 160 × 90 × 1 Dispatch. This was a separate integration from the approximate path in this PR.

The 1280 × 720 R32_UINT output went from 0/921,600 nonzero texels with the shader skipped to 921,600/921,600 with it running. Seven downstream indirect dispatches matched the classifier counter buffers. With it skipped all had X=0. With it running, four had X=9,970, one 19,940, one 39,880 and one stayed zero. Y and Z stayed 1 throughout. Both hair-lighting draws issued 720 vertices in each run.

Across 16 window-frame pairs matched by camera and shoulder outline with no frame reused, the courtyard wall was about 68/255 brighter with the shader running (median paired change in display luma). Lucia’s crown changed by −1.9/255, the left shirt patch by +4.5 and the right by +1.8. The ponytail was visible in both. The left shirt patch was brighter in all 16 pairs, but its change was within observed single-run variation. The classifier schedules substantial work and the courtyard changes visibly. The close-up remained dark with this ambient override. The right interior also differed between the two runs, so I can’t separate a lighting change there from a streaming difference.

**@⁠Venom2054** on GitHub · 2026-11-25 21:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7174700047) I tested the execution-versus-omission comparison for the opaque classifier (2cc4c197ee29e291) at the prison window on an RTX 5070 Ti. Both runs used the same local executable, save, seeded caches and ambient-light override. The local translator already exchanges values across the two halves of the wave. I toggled only its bound 160 × 90 × 1 Dispatch. This was a separate integration from the approximate path in this PR. The 1280 × 720 R32_UINT output went from 0/921,600 nonzero texels with the shader skipped to 921,600/921,600 with it running. Seven downstream indirect dispatches matched the classifier counter buffers. With it skipped all had X=0. With it running, four had X=9,970, one 19,940, one 39,880 and one stayed zero. Y and Z stayed 1 throughout. Both hair-lighting draws issued 720 vertices in each run. Across 16 window-frame pairs matched by camera and shoulder outline with no frame reused, the courtyard wall was about 68/255 brighter with the shader running (median paired change in display luma). Lucia’s crown changed by −1.9/255, the left shirt patch by +4.5 and the right by +1.8. The ponytail was visible in both. The left shirt patch was brighter in all 16 pairs, but its change was within observed single-run variation. The classifier schedules substantial work and the courtyard changes visibly. The close-up remained dark with this ambient override. The right interior also differed between the two runs, so I can’t separate a lighting change there from a streaming difference.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:16 UTC · original · edited 2026-11-26 05:27 UTC

Automated triage for the maintainers.

Thanks for the follow-up. Reviewed the new commit f896d26. It does what the last triage asked: in emit/lower.rs the three refusals (cross-half wave scan, 64-bit wave mask read as data, cross-half lane operation) are back unless Parts::wave32_approx is set. host::wave32_approx turns that on only with VICTORY_WAVE32_APPROX=1 on a 32-lane host, and shader_cache::key includes it. CI: passing.

What is still open:

  • The BVH builder hold is still keyed to the host, not the new switch. pipeline/builder.rs runs passes crate::host::host_wave32() to opens, so the builder is held back on every 32-lane host, even in the default mode. The default mode no longer approximates anything: a builder program that crosses halves is refused, so #2118's all-or-none rule already holds the builder back. A builder whose programs are wave-local now translates exactly, but it would still be blocked. Keying the hold to wave32_approx() (and updating the log reason) would match the new default.
  • The stack. The branch still carries #2176 and #2118, both open, so it can only land after them and a rebase down to your commits.
  • The ballot undercount case from @⁠Venom2054 would make a good regression test for the default refusal once the shader words are available, as you said.

Verdict: needs work. CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 22:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7176152972) · edited 2026-11-26 05:27 UTC <!-- victory-triage v1 head=f896d26e8919581a740f46478dc14fe18a646e84 verdict=needs-work at=2026-11-26T05:27:40Z --> Automated triage for the maintainers. Thanks for the follow-up. Reviewed the new commit `f896d26`. It does what the last triage asked: in `emit/lower.rs` the three refusals (cross-half wave scan, 64-bit wave mask read as data, cross-half lane operation) are back unless `Parts::wave32_approx` is set. `host::wave32_approx` turns that on only with `VICTORY_WAVE32_APPROX=1` on a 32-lane host, and `shader_cache::key` includes it. CI: passing. What is still open: - **The BVH builder hold is still keyed to the host, not the new switch.** `pipeline/builder.rs` `runs` passes `crate::host::host_wave32()` to `opens`, so the builder is held back on every 32-lane host, even in the default mode. The default mode no longer approximates anything: a builder program that crosses halves is refused, so #2118's all-or-none rule already holds the builder back. A builder whose programs are wave-local now translates exactly, but it would still be blocked. Keying the hold to `wave32_approx()` (and updating the log reason) would match the new default. - **The stack.** The branch still carries #2176 and #2118, both open, so it can only land after them and a rebase down to your commits. - The ballot undercount case from @⁠Venom2054 would make a good regression test for the default refusal once the shader words are available, as you said. **Verdict: needs work.** CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠moe-miau on GitHub · 2026-11-26 04:30 UTC · original

Done as suggested in f896d26: #2176's three refusals are the default again, and the approximate halves are opt-in with VICTORY_WAVE32_APPROX=1 (emit::Options::wave32_approx, in the shader cache key). wave64_cross_half_readlane_is_refused_unless_approximate_on_wave32_host checks both ways. I don't have Venom2054's synthetic ballot program to add as a test; if @⁠Venom2054 can share its words, I'll add it asserting the refusal by default. The builder hold (opens) is unchanged. Tests: shader wave64/ballot 8 passed; victory-gpu --lib 229 passed, 2 failed (the heap-cap pair #2628 fixes); clippy and policy clean.

**@⁠moe-miau** on GitHub · 2026-11-26 04:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7182651078) Done as suggested in `f896d26`: #2176's three refusals are the default again, and the approximate halves are opt-in with `VICTORY_WAVE32_APPROX=1` (`emit::Options::wave32_approx`, in the shader cache key). `wave64_cross_half_readlane_is_refused_unless_approximate_on_wave32_host` checks both ways. I don't have Venom2054's synthetic ballot program to add as a test; if @⁠Venom2054 can share its words, I'll add it asserting the refusal by default. The builder hold (`opens`) is unchanged. Tests: shader `wave64`/`ballot` 8 passed; `victory-gpu --lib` 229 passed, 2 failed (the heap-cap pair #2628 fixes); clippy and policy clean.
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-26 06:18 UTC · original

Here are the 41 little-endian GFX10 dwords from the synthetic UniformBallot case I ran on f896d26. The fixture generates these words directly.

[
    0xbe810380, 0xf4080100, 0xfa000000, 0x2c020086, 0x360400bf, 0x4a0602a1,
    0x340c0282, 0x34140082, 0xd4c10008, 0x00020702, 0xbe901008, 0xd4c2000c,
    0x00020480, 0xbe8a240c, 0xbf880003, 0x7e0a0210, 0xd8340000, 0x00000506,
    0xbefe040a, 0xbf8c0000, 0xbf8a0000, 0x7e0e0280, 0xd8d80000, 0x0c000007,
    0xd8d80004, 0x0d000007, 0xd8d80008, 0x0e000007, 0xd8d8000c, 0x0f000007,
    0xd8d80000, 0x0b000006, 0xbf8c0000, 0x4a18190d, 0x4a18190e, 0x4a18190f,
    0x34181888, 0x4a18190b, 0xe0701000, 0x80010c0a, 0xbf810000,
]

Fixture setup: HwStage::Cs, wave64=true, vgprs=32, threads=[256,1,1], rsrc2=0x8002. One root table at slot 0 (user_data=0, sgprs=1, base register and table offset 0), one raw output UAV at table offset 0 (dwords=4, stride=0). Dispatch one group. In guest wave w, lanes below 33+w vote. Each wave leader writes its count to LDS. After a group barrier, each output element holds 256 * sum_of_counts + its_wave_count.

On the RTX 5070 Ti, with host_wave32=true and the default wave32_approx=false, this case is refused at 0x40 with a 64-bit wave mask read as data on a 32-lane host is not supported. That is the regression assertion I would use. With wave32_approx=true, it validates and runs. The four leaders all read back 32800 (32 votes per wave, total 128). The reference is 33, 34, 35 and 36 (total 138). The control that writes those four counts directly into LDS matched all 256 output words in both modes.

**@⁠Venom2054** on GitHub · 2026-11-26 06:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7184295917) Here are the 41 little-endian GFX10 dwords from the synthetic `UniformBallot` case I ran on `f896d26`. The fixture generates these words directly. ```rust [ 0xbe810380, 0xf4080100, 0xfa000000, 0x2c020086, 0x360400bf, 0x4a0602a1, 0x340c0282, 0x34140082, 0xd4c10008, 0x00020702, 0xbe901008, 0xd4c2000c, 0x00020480, 0xbe8a240c, 0xbf880003, 0x7e0a0210, 0xd8340000, 0x00000506, 0xbefe040a, 0xbf8c0000, 0xbf8a0000, 0x7e0e0280, 0xd8d80000, 0x0c000007, 0xd8d80004, 0x0d000007, 0xd8d80008, 0x0e000007, 0xd8d8000c, 0x0f000007, 0xd8d80000, 0x0b000006, 0xbf8c0000, 0x4a18190d, 0x4a18190e, 0x4a18190f, 0x34181888, 0x4a18190b, 0xe0701000, 0x80010c0a, 0xbf810000, ] ``` Fixture setup: `HwStage::Cs`, `wave64=true`, `vgprs=32`, `threads=[256,1,1]`, `rsrc2=0x8002`. One root table at slot 0 (`user_data=0`, `sgprs=1`, base register and table offset 0), one raw output UAV at table offset 0 (`dwords=4`, `stride=0`). Dispatch one group. In guest wave `w`, lanes below `33+w` vote. Each wave leader writes its count to LDS. After a group barrier, each output element holds `256 * sum_of_counts + its_wave_count`. On the RTX 5070 Ti, with `host_wave32=true` and the default `wave32_approx=false`, this case is refused at `0x40` with `a 64-bit wave mask read as data on a 32-lane host is not supported`. That is the regression assertion I would use. With `wave32_approx=true`, it validates and runs. The four leaders all read back 32800 (32 votes per wave, total 128). The reference is 33, 34, 35 and 36 (total 138). The control that writes those four counts directly into LDS matched all 256 output words in both modes.
Author
Owner

@⁠DrDarkDK on GitHub · 2026-11-25 18:40 UTC · original · requested changes

In Shape::Half, the ballot check and the lane read use different numbering on a 32-lane host. For example, with hi = 33, the ballot check reads word 1, which is always zero. read_lane(x, 33) maps to host lane 1, but the select uses the identity even when that lane participates. That drops the packed high 16 bits in both halves.

Could the ballot check use the same host-local lane as the read? A regression with nonzero high bits in local lane 1 would check that they survive when that lane participates and that the identity is still used when it doesn’t.

AI-assisted with Codex.

**@⁠DrDarkDK** on GitHub · 2026-11-25 18:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#pullrequestreview-6063057108) · **requested changes** In `Shape::Half`, the ballot check and the lane read use different numbering on a 32-lane host. For example, with `hi = 33`, the ballot check reads word 1, which is always zero. `read_lane(x, 33)` maps to host lane 1, but the select uses the identity even when that lane participates. That drops the packed high 16 bits in both halves. Could the ballot check use the same host-local lane as the read? A regression with nonzero high bits in local lane 1 would check that they survive when that lane participates and that the identity is still used when it doesn’t. *AI-assisted with Codex.*
Author
Owner

@⁠DrDarkDK on GitHub · 2026-11-25 19:06 UTC · original · approved these changes

Thanks, cfcadf6 addresses my finding. The ballot now checks the same host-local lane that read_lane uses, and the mapping test covers lane 33 on both host widths. The focused test is enough to resolve my review.

AI-assisted with Codex.

**@⁠DrDarkDK** on GitHub · 2026-11-25 19:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#pullrequestreview-6063397804) · **approved these changes** Thanks, `cfcadf6` addresses my finding. The ballot now checks the same host-local lane that `read_lane` uses, and the mapping test covers lane 33 on both host widths. The focused test is enough to resolve my review. *AI-assisted with Codex.*
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-26 13:33 UTC · original

Follow-up on the alpha transmission prefilter (2da4beb386509b77) mentioned above. I tested the per-instruction lane-guard change from CGBJ’s preserved source in a local VIctory build on an RTX 5070 Ti. The original Wave64 DXIL passed validation, but D3D12 refused the pipeline. The exact Wave32 translation passed validation, created the pipeline and recorded two 40 × 23 × 1 dispatches in a captured prologue frame. Only this shader cache entry changed between the two runs.

At two points in the same camera view, the wire mesh and courtyard tower looked softer through the glass. In a separate fixed view of the reading NPC, I toggled only this dispatch (skipped from launch, executed, then skipped again). The book stayed dark and her forearm kept its color in all three phases. The glass stayed brighter after the final toggle. These results cover the exact translation on this GPU. The approximate path in this PR still needs its own test. Codex assisted with the tests and measurements.

**@⁠Venom2054** on GitHub · 2026-11-26 13:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7193509535) Follow-up on the alpha transmission prefilter (`2da4beb386509b77`) mentioned above. I tested the per-instruction lane-guard change from [CGBJ’s preserved source](https://github.com/Pavl3000/cgbj-fork/blob/f4b48ad766ddbec1a1867022cd42f7645b0dd55e/crates/victory-shader/src/resource.rs) in a local VIctory build on an RTX 5070 Ti. The original Wave64 DXIL passed validation, but D3D12 refused the pipeline. The exact Wave32 translation passed validation, created the pipeline and recorded two 40 × 23 × 1 dispatches in a captured prologue frame. Only this shader cache entry changed between the two runs. At two points in the same camera view, the wire mesh and courtyard tower looked softer through the glass. In a separate fixed view of the reading NPC, I toggled only this dispatch (skipped from launch, executed, then skipped again). The book stayed dark and her forearm kept its color in all three phases. The glass stayed brighter after the final toggle. These results cover the exact translation on this GPU. The approximate path in this PR still needs its own test. Codex assisted with the tests and measurements.
Author
Owner

@⁠frenziedcoder on GitHub · 2026-11-26 15:59 UTC · original

RTX 5080 (Blackwell), driver 621.40, title run of f896d26 with VICTORY_WAVE32_APPROX=1 in the NVIDIA stack: no device removal in 600 s, the run reaches the first interactive moment (an on-screen control prompt), and the approximate path builds exactly the pipelines the earlier local wave32_approx patch did.

Tree: main 63bcca4 + #1906 (a554b15), #2098 (543d868), #2626 (c8cc83e), #2628 (e2cdafe), #2464 (b9dc4b0) and this PR (f896d26, which brings #2176 and #2118). No local changes. One conflict, with #2628 in emit::Options and shader_cache::key, resolved by keeping both sides: Options carries portable_views, host_wave32 and wave32_approx, and the key hashes the view-heap limit, the wave32 flag and the approximation flag. Workspace tests build; shader_cache (4) and wave (15) tests pass. Diag build, VICTORY_D3D12_DRED=1, scripted Enter, 600 s, sandboxed.

translate --cache --pipelines with VICTORY_WAVE32_APPROX=1: 420 programs refused; pipelines skipped because the compute / pixel / mesh shader does not translate: 219 / 1 / 0; 0 new pipelines to make, 26,940 already in the library. The library was built yesterday by a tree carrying @⁠moe-miau's local version of this change (the wave32_approx diff from #2176's thread plus the BVH-builder hold-back), so this PR's approximate path compiles to the same pipelines.

In the title, against that earlier local-patch tree (one run each):

local patch (main 842b0cb tree) this PR
host pipelines refused 0 0
programs whose draws are dropped 85 (84 compute, 1 pixel) 85 (84 compute, 1 pixel)
device removed in 600 s no no
world's first frame frame 1,268 (52 s) frame 1,367 (54 s)
frame 2,048 reached at 528 s 475 s
last captured frame still in the opening cutscene first interactive moment, with the control prompt drawn over the lit room

How far a run gets also depends on the scripted presses and timing, so I'd read the last row as "this PR gets there without trouble" rather than as a difference between the two.

Not tested: VICTORY_WAVE32_APPROX unset (the default) in the title; more than one run; this PR without the rest of the stack.

AI use: Claude Code (Claude Opus 5.5) merged the tree, resolved the conflict, ran the title on my machine (sandboxed at Low integrity, game folder read-only), read the logs and frame captures, and wrote this report.

**@⁠frenziedcoder** on GitHub · 2026-11-26 15:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7197039399) **RTX 5080 (Blackwell), driver 621.40, title run of `f896d26` with `VICTORY_WAVE32_APPROX=1` in the NVIDIA stack: no device removal in 600 s, the run reaches the first interactive moment (an on-screen control prompt), and the approximate path builds exactly the pipelines the earlier local `wave32_approx` patch did.** **Tree:** `main` `63bcca4` + #1906 (`a554b15`), #2098 (`543d868`), #2626 (`c8cc83e`), #2628 (`e2cdafe`), #2464 (`b9dc4b0`) and this PR (`f896d26`, which brings #2176 and #2118). No local changes. One conflict, with #2628 in `emit::Options` and `shader_cache::key`, resolved by keeping both sides: `Options` carries `portable_views`, `host_wave32` and `wave32_approx`, and the key hashes the view-heap limit, the wave32 flag and the approximation flag. Workspace tests build; `shader_cache` (4) and `wave` (15) tests pass. Diag build, `VICTORY_D3D12_DRED=1`, scripted `Enter`, 600 s, sandboxed. **`translate --cache --pipelines`** with `VICTORY_WAVE32_APPROX=1`: 420 programs refused; pipelines skipped because the compute / pixel / mesh shader does not translate: 219 / 1 / 0; **0 new pipelines to make, 26,940 already in the library**. The library was built yesterday by a tree carrying @⁠moe-miau's local version of this change (the `wave32_approx` diff from #2176's thread plus the BVH-builder hold-back), so this PR's approximate path compiles to the same pipelines. **In the title, against that earlier local-patch tree (one run each):** | | local patch (`main` `842b0cb` tree) | this PR | |---|---|---| | host pipelines refused | 0 | 0 | | programs whose draws are dropped | 85 (84 compute, 1 pixel) | 85 (84 compute, 1 pixel) | | device removed in 600 s | no | no | | world's first frame | frame 1,268 (52 s) | frame 1,367 (54 s) | | frame 2,048 reached at | 528 s | 475 s | | last captured frame | still in the opening cutscene | **first interactive moment, with the control prompt drawn** over the lit room | How far a run gets also depends on the scripted presses and timing, so I'd read the last row as "this PR gets there without trouble" rather than as a difference between the two. **Not tested:** `VICTORY_WAVE32_APPROX` unset (the default) in the title; more than one run; this PR without the rest of the stack. *AI use: Claude Code (Claude Opus 5.5) merged the tree, resolved the conflict, ran the title on my machine (sandboxed at Low integrity, game folder read-only), read the logs and frame captures, and wrote this report.*
Author
Owner

@⁠JurajSimicevic on GitHub · 2026-11-26 16:17 UTC · original

The green cast on the NVIDIA stack comes from one program the approximate halves translate: the tile classifier. Skipping only that program removes the green: 51% green-dominant pixels in the lighting output drop to 0%.

This answers @⁠frenziedcoder's report on #2925 (#2925), where the source was not pinned. @⁠moe-miau, you claimed the green in the cell this morning (#1633); I only saw that after my own claim. If you are already on a fix, it's yours. Otherwise I can take it.

Setup: RTX 5080, driver 617.42, Windows 11 26200.

  • Tree: main 63bcca4 + #2098, #2626, #2628, #2464, this PR at f896d26, and #2925 at fd180a6. The conflicts in emit::Options and shader_cache::key were resolved by keeping all settings.
  • Diag build, VICTORY_D3D12_DRED=1, warm caches.
  • The scene is the first world shot (the cell with its window), with the camera held on the window and the walls.
  • VICTORY_DUMP_TARGETS at world frame +150. The measure is the share of pixels where green exceeds both red and blue by more than 24/255, in the HDR target the main deferred lighting pass writes, dumped right after its submission. One run per row.
run VICTORY_WAVE32_APPROX skipped (VICTORY_SKIP_PIPELINES) green-dominant pixels picture
1 1 none 51% lit, strong green on walls and frame edges, blocky colour patches
2 unset none 0% no lighting: the lighting pass itself is refused
3 1 five approximate-only programs that feed the lighting pass 0% lit, warm, no blocks
4 1 two of the five (a half-resolution HDR pass and a transmission prefilter) 16% green and blocks back
5 1 only the tile classifier 0% lit, warm, no blocks
  • What the classifier is: a full-screen compute with one group per 16x16 tile (160x90 groups at 2560x1440). It writes the tile buffers at 1/16 resolution and two R32 targets. Without the approximation it is refused with a cross-half operation on a 32-lane host, so this PR's approximate path is what runs it.
  • What stays fine: the main lighting pass also runs only through the approximation (it reads a 64-bit wave mask as data), and so do the two mask-as-data programs still running in run 5, and the half-resolution HDR pass and transmission prefilter, which are cross-half too. None of them brings the green back in this scene. So it isn't the approximation as a whole, but what it does to this classifier's cross-half exchange. That fits @⁠Venom2054's ballot undercount: a classifier that decides per tile from data of both halves gets one half's view.
  • Approximation off is no alternative here: 97 programs the scene uses are refused then (60 mask-as-data, 32 cross-half, 5 pixel/mesh), the lighting pass among them, and the picture goes back to the unlit, frozen one.

Suggestion: this classifier needs its cross-half exchange to be exact. Until then it is better refused, even with the approximation on: it is the only program in this scene whose approximate translation visibly breaks the picture. An exact path may already exist. On #320, r4tedx lists this classifier among the lighting programs that #439's console flow translates, validates and makes pipelines for on an RTX 5070. neonbyte1's stack with #439 under the halves on #2925 doesn't mention a green cast. So keeping this program on #439's path, instead of the approximate halves, might be enough. I haven't run that.

Not tested: more than one run per row; other scenes; this PR without #2925 (the green may be latent there, because the interior only gets lit with #2925).

Local diagnostics only (target dumps, frame captures). No game data: pixel statistics and counts.

AI-assisted.

**@⁠JurajSimicevic** on GitHub · 2026-11-26 16:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7197451871) **The green cast on the NVIDIA stack comes from one program the approximate halves translate: the tile classifier. Skipping only that program removes the green: 51% green-dominant pixels in the lighting output drop to 0%.** This answers @⁠frenziedcoder's report on #2925 (https://git.gtahub.st/github/Marvisak--VIctory/pulls/2925), where the source was not pinned. @⁠moe-miau, you claimed the green in the cell this morning (https://git.gtahub.st/github/Marvisak--VIctory/issues/1633); I only saw that after my own claim. If you are already on a fix, it's yours. Otherwise I can take it. **Setup:** RTX 5080, driver 617.42, Windows 11 26200. - Tree: `main` `63bcca4` + #2098, #2626, #2628, #2464, this PR at `f896d26`, and #2925 at `fd180a6`. The conflicts in `emit::Options` and `shader_cache::key` were resolved by keeping all settings. - Diag build, `VICTORY_D3D12_DRED=1`, warm caches. - The scene is the first world shot (the cell with its window), with the camera held on the window and the walls. - `VICTORY_DUMP_TARGETS` at world frame +150. The measure is the share of pixels where green exceeds both red and blue by more than 24/255, in the HDR target the main deferred lighting pass writes, dumped right after its submission. One run per row. | run | `VICTORY_WAVE32_APPROX` | skipped (`VICTORY_SKIP_PIPELINES`) | green-dominant pixels | picture | |---|---|---|---|---| | 1 | 1 | none | **51%** | lit, strong green on walls and frame edges, blocky colour patches | | 2 | unset | none | 0% | no lighting: the lighting pass itself is refused | | 3 | 1 | five approximate-only programs that feed the lighting pass | **0%** | lit, warm, no blocks | | 4 | 1 | two of the five (a half-resolution HDR pass and a transmission prefilter) | **16%** | green and blocks back | | 5 | 1 | **only the tile classifier** | **0%** | lit, warm, no blocks | - **What the classifier is:** a full-screen compute with one group per 16x16 tile (160x90 groups at 2560x1440). It writes the tile buffers at 1/16 resolution and two R32 targets. Without the approximation it is refused with `a cross-half operation on a 32-lane host`, so this PR's approximate path is what runs it. - **What stays fine:** the main lighting pass also runs only through the approximation (it reads a 64-bit wave mask as data), and so do the two mask-as-data programs still running in run 5, and the half-resolution HDR pass and transmission prefilter, which are cross-half too. None of them brings the green back in this scene. So it isn't the approximation as a whole, but what it does to this classifier's cross-half exchange. That fits @⁠Venom2054's ballot undercount: a classifier that decides per tile from data of both halves gets one half's view. - **Approximation off is no alternative here:** 97 programs the scene uses are refused then (60 mask-as-data, 32 cross-half, 5 pixel/mesh), the lighting pass among them, and the picture goes back to the unlit, frozen one. **Suggestion:** this classifier needs its cross-half exchange to be exact. Until then it is better refused, even with the approximation on: it is the only program in this scene whose approximate translation visibly breaks the picture. An exact path may already exist. On #320, r4tedx lists this classifier among the lighting programs that #439's console flow translates, validates and makes pipelines for on an RTX 5070. neonbyte1's stack with #439 under the halves on #2925 doesn't mention a green cast. So keeping this program on #439's path, instead of the approximate halves, might be enough. I haven't run that. **Not tested:** more than one run per row; other scenes; this PR without #2925 (the green may be latent there, because the interior only gets lit with #2925). Local diagnostics only (target dumps, frame captures). No game data: pixel statistics and counts. AI-assisted.
Author
Owner

@⁠davesousa on GitHub · 2026-11-26 16:22 UTC · original

Default mode (VICTORY_WAVE32_APPROX unset) in the title, on Ampere: RTX 3070 Ti 8 GB (32-lane waves), driver 621.40, Windows 11 26200, TDR delay 8 s. 63bcca4 + #2319 + #2178 + #2634 + #2703 + #2118, with and without this PR at f896d26. The only conflict was the shader cache key with #2178 (kept all three flags). diag build, warm caches, two 10-minute runs per arm with scripted walking from 150 s, one of each with DRED.

per world frame, median without with this PR
device removal in 10 min 0 of 2 0 of 2
compute programs the driver refuses 174 0
programs not translated 8 177
compute dispatches dropped, no pipeline 233 / 222 187 / 193
mesh draws dropped, no pipeline 0 / 0 24 / 8
world frame 809 / 702 ms 748 / 741 ms

Of the 177: 78 one-wave LDS, 56 64-bit mask as data, 31 cross-half (all compute), and 9 pixel or mesh programs with a 64-bit mask as data. So in the default mode most of the driver's refusals become translation refusals, and 13-20% of the dropped compute work comes back.

On the open triage point about opens: in every default-mode run the builder logs held back: 64-lane programs run as 32-lane halves here ... pipelines=53 made=44 refused=9. With no driver refusals in these runs, its 9 refused programs are ones the translator refuses, so #2118's all-or-none rule alone already keeps it off here. On this card, keying the hold to wave32_approx() would leave the default mode's behaviour unchanged.

Whole pack (translate --cache --pipelines, wave32=true): pipelines the driver refuses 397 -> 1; skipped because a shader does not translate, compute / pixel / mesh: 24 / 1 / 0 -> 391 / 328 / 67. That matches the RTX 5080 figures on #2176, so the pixel and mesh scope point there holds on Ampere too.

Not tested: VICTORY_WAVE32_APPROX=1 on this card. In three of the four runs the largest loss is draws and dispatches dropped for lack of dynamic descriptor slots (#747; median 66 to 681 a frame, depending on the scene), which this PR does not touch.

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

**@⁠davesousa** on GitHub · 2026-11-26 16:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7197558140) Default mode (`VICTORY_WAVE32_APPROX` unset) in the title, on Ampere: RTX 3070 Ti 8 GB (32-lane waves), driver 621.40, Windows 11 26200, TDR delay 8 s. `63bcca4` + #2319 + #2178 + #2634 + #2703 + #2118, with and without this PR at `f896d26`. The only conflict was the shader cache key with #2178 (kept all three flags). `diag` build, warm caches, two 10-minute runs per arm with scripted walking from 150 s, one of each with DRED. | per world frame, median | without | with this PR | |---|---:|---:| | device removal in 10 min | 0 of 2 | 0 of 2 | | compute programs the driver refuses | 174 | 0 | | programs not translated | 8 | 177 | | compute dispatches dropped, no pipeline | 233 / 222 | 187 / 193 | | mesh draws dropped, no pipeline | 0 / 0 | 24 / 8 | | world frame | 809 / 702 ms | 748 / 741 ms | Of the 177: 78 one-wave LDS, 56 64-bit mask as data, 31 cross-half (all compute), and 9 pixel or mesh programs with a 64-bit mask as data. So in the default mode most of the driver's refusals become translation refusals, and 13-20% of the dropped compute work comes back. On the open triage point about `opens`: in every default-mode run the builder logs `held back: 64-lane programs run as 32-lane halves here ... pipelines=53 made=44 refused=9`. With no driver refusals in these runs, its 9 refused programs are ones the translator refuses, so #2118's all-or-none rule alone already keeps it off here. On this card, keying the hold to `wave32_approx()` would leave the default mode's behaviour unchanged. Whole pack (`translate --cache --pipelines`, `wave32=true`): pipelines the driver refuses 397 -> 1; skipped because a shader does not translate, compute / pixel / mesh: 24 / 1 / 0 -> 391 / 328 / 67. That matches the RTX 5080 figures on #2176, so the pixel and mesh scope point there holds on Ampere too. Not tested: `VICTORY_WAVE32_APPROX=1` on this card. In three of the four runs the largest loss is draws and dispatches dropped for lack of dynamic descriptor slots (#747; median 66 to 681 a frame, depending on the scene), which this PR does not touch. AI-assisted (Claude Code); the runs are on my machine.
Author
Owner

@⁠JurajSimicevic on GitHub · 2026-11-26 17:13 UTC · original

Correction to my comment above: the approximation is not what turns the cell green. With #439 translating the tile classifier, the green is still there.

Setup: same machine, scene and measure as above.

  • Tree: main 63bcca4 + #2098, #2626, #2628, #2464, #2118 and #439 at e2d3cfd, without #2176, this PR or #2925. The conflicts with #2628 (emit::Options, shader_cache, lower) were resolved by keeping both the view limit and the host target.
  • In this run the tile classifier translates through #439's console flow and runs, and so does the main lighting pass. The two mask-as-data programs and the transmission prefilter don't translate.

Result:

tree tile classifier green-dominant pixels in the lighting pass's HDR output
halves, approximation on (run 1 above) runs 51%
halves, approximation on (run 5 above) skipped 0%
#439, no halves (this run) runs 58.6%

So the green follows the tile classifier running, under either translation, not the approximation. Two explanations fit:

  • both 32-lane translations get the classifier wrong in the same way;
  • what the classifier turns on is wrong. That would be the per-tile paths in the lighting pass, which is itself translated for 32 lanes in both trees.

The README's lit prologue on an RX 6700 XT, where both run natively, suggests the title's own lighting is fine. My "better refused" suggestion above doesn't hold as stated: refusing the classifier hides the symptom by switching that lighting off, it doesn't fix it. I'll try to tell the two explanations apart from the classifier's tile outputs.

Local diagnostics only. No game data: pixel statistics and counts.

AI-assisted.

**@⁠JurajSimicevic** on GitHub · 2026-11-26 17:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7198666157) **Correction to my comment above: the approximation is not what turns the cell green. With #439 translating the tile classifier, the green is still there.** **Setup:** same machine, scene and measure as above. - Tree: `main` `63bcca4` + #2098, #2626, #2628, #2464, #2118 and #439 at `e2d3cfd`, without #2176, this PR or #2925. The conflicts with #2628 (`emit::Options`, `shader_cache`, `lower`) were resolved by keeping both the view limit and the host target. - In this run the tile classifier translates through #439's console flow and runs, and so does the main lighting pass. The two mask-as-data programs and the transmission prefilter don't translate. **Result:** | tree | tile classifier | green-dominant pixels in the lighting pass's HDR output | |---|---|---| | halves, approximation on (run 1 above) | runs | 51% | | halves, approximation on (run 5 above) | skipped | 0% | | #439, no halves (this run) | runs | **58.6%** | So the green follows the tile classifier running, under either translation, not the approximation. Two explanations fit: - both 32-lane translations get the classifier wrong in the same way; - what the classifier turns on is wrong. That would be the per-tile paths in the lighting pass, which is itself translated for 32 lanes in both trees. The README's lit prologue on an RX 6700 XT, where both run natively, suggests the title's own lighting is fine. My "better refused" suggestion above doesn't hold as stated: refusing the classifier hides the symptom by switching that lighting off, it doesn't fix it. I'll try to tell the two explanations apart from the classifier's tile outputs. Local diagnostics only. No game data: pixel statistics and counts. AI-assisted.
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-26 17:17 UTC · original

I measured the two native R32 outputs of CS_MaterialTilesInitial (bad01f53f53248e5) on an RTX 5070 Ti with a local Series S renderer fork. Two fresh launches used the same save and warmed pipeline library. Only the classifier cache entry changed, to the console-flow translation from #439 (e2d3cfd). Both versions executed the classifier in the 1280 × 720 prison-window view.

In the smaller 80 × 45 tile mask, both versions had 3,395 nonzero words out of 3,600. Values greater than 0x00ffffff fell from 264 to 102. In the 160 × 90 mask, nonzero words went from 12,431 to 12,336 out of 14,400. The captures were six seconds apart relative to world start, so animation can account for some differences. These counts show what changed in the masks. We do not have native reference values for them.

On this stack, the deferred-lighting target already had zero green-dominant pixels in the control at the 24/255 threshold. It still had zero with #439 (six control PNG readbacks and two candidate readbacks). Wall, frame and photograph patches stayed within one 8-bit luma level in the matched final view. That gives a comparison case where the classifier runs and both masks are populated without reproducing the green seen on the 5080 stack.

Codex assisted with the tests and measurements.

**@⁠Venom2054** on GitHub · 2026-11-26 17:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7198789225) I measured the two native R32 outputs of `CS_MaterialTilesInitial` (`bad01f53f53248e5`) on an RTX 5070 Ti with a local Series S renderer fork. Two fresh launches used the same save and warmed pipeline library. Only the classifier cache entry changed, to the console-flow translation from #439 (`e2d3cfd`). Both versions executed the classifier in the 1280 × 720 prison-window view. In the smaller 80 × 45 tile mask, both versions had 3,395 nonzero words out of 3,600. Values greater than `0x00ffffff` fell from 264 to 102. In the 160 × 90 mask, nonzero words went from 12,431 to 12,336 out of 14,400. The captures were six seconds apart relative to world start, so animation can account for some differences. These counts show what changed in the masks. We do not have native reference values for them. On this stack, the deferred-lighting target already had zero green-dominant pixels in the control at the 24/255 threshold. It still had zero with #439 (six control PNG readbacks and two candidate readbacks). Wall, frame and photograph patches stayed within one 8-bit luma level in the matched final view. That gives a comparison case where the classifier runs and both masks are populated without reproducing the green seen on the 5080 stack. Codex assisted with the tests and measurements.
Author
Owner

@⁠reboot0000-cmd on GitHub · 2026-11-26 17:27 UTC · original

For anyone judging this from the offline translation run: on that command the PR changes nothing, and that is the tool, not the PR. Plus whole-archive numbers for both modes on a 32-lane host, to sit beside the two reports above.

1. translate --pipelines without --cache never consults either switch.

apps/victory/src/translate.rs:571 builds emit::Options { view_marks: true, ..Default::default() }, and host_wave32 / wave32_approx both default to false. The only call sites are victory-gpu/src/shader_cache.rs:99-100 — the runtime path, which --cache uses.

I measured the consequence before reading the code, so the behaviour is on record too: PR at f896d26, translate --validate --pipelines --list --jobs 8 over the title's archive (26,503 containers, 26,084 programs), against a control built at that PR's own base (f3578e38) so no unrelated commit is in either tree.

driver refusals compute emitted host pipelines made
control at f3578e38 396 2,658 25,273
+ this PR, as it stands 396 2,658 25,273

Identical to the program. On the same command, #189's change is visible — so the asymmetry is real, and anyone using the offline run to triage this family will read "no effect" off a PR that works. Worth either setting the two options there from the same device query, or a line in the PR/README saying --cache is required to measure it.

2. Both modes, archive scale, cold pipeline library. Windows 10 19044.7846, RTX 4090 (32-lane waves), validator DXC 1.8.2502.8, same command, same base, my one-line local change so the CLI can pass the flags through (env-gated: VICTORY_HOST_WAVE32, VICTORY_WAVE32_APPROX; nothing else touched).

refusals compute emitted pipelines made net vs control
control 396 2,658 25,273 —
host waves, default mode 0 2,291 24,832 −441
host waves + approximation 0 2,463 25,474 +201

Both rows reconcile exactly against the 396: default mode declines 367 of them at translate and makes 29 new pipelines; approximation declines 195 and makes 201. The 195 are a single reason — wave64 compute shader sharing LDS within one wave on a 32-lane host — which the description says stays by design, so this is the first count of how big that designed-away class actually is across the title: 195 programs, 191 of which translate and validate today and are then refused at creation. Across all stages the approximation costs exactly those 195 (25,669 emitted on the control against 25,474), so everything the default mode gave up beyond them comes back.

Default mode's loss by reason: 573 a 64-bit wave mask read as data, 195 the LDS class, 69 a cross-half operation.

3. It agrees with the other card. @⁠davesousa's Ampere whole-pack run at the same default mode: refusals 397→1, newly not-translating 391 compute / 328 pixel / 67 mesh ≈ 786, against my 837 on Ada and Windows 10, with the same ordering of causes (mask-as-data first, LDS second, cross-half smallest). Two independent hosts, same magnitude, so the ~800 figure is not a one-machine artifact — and the approximation recovers essentially all of it except the 195.

4. Same axis as the emulation route. Re-measured today at #189's current head (3e39e340, now rebased onto current main), against a control at 63bcca43 which reports the same 396 / 2,658 / 25,273 as the f3578e38 control, so the two routes are comparable across that 3-commit gap:

route refusals cleared programs declined at translate net pipelines
#189 emulation 396 269 +127
this PR, default mode 396 367 −441
this PR, approximation 396 195 +201

On programs reaching a host pipeline — not gameplay, which depends on which of them the title dispatches — the split-halves route with the approximation on leads by 74 programs. The two controls agree exactly on all three tallies above, so the 3-commit gap between them is not doing any work here. Counts and reason strings only; no game files.

**@⁠reboot0000-cmd** on GitHub · 2026-11-26 17:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7199052939) **For anyone judging this from the offline translation run: on that command the PR changes nothing, and that is the tool, not the PR.** Plus whole-archive numbers for both modes on a 32-lane host, to sit beside the two reports above. **1. `translate --pipelines` without `--cache` never consults either switch.** `apps/victory/src/translate.rs:571` builds `emit::Options { view_marks: true, ..Default::default() }`, and `host_wave32` / `wave32_approx` both default to `false`. The only call sites are `victory-gpu/src/shader_cache.rs:99-100` — the runtime path, which `--cache` uses. I measured the consequence before reading the code, so the behaviour is on record too: PR at `f896d26`, `translate --validate --pipelines --list --jobs 8` over the title's archive (26,503 containers, 26,084 programs), against a control built at that PR's own base (`f3578e38`) so no unrelated commit is in either tree. | | driver refusals | compute emitted | host pipelines made | |---|---:|---:|---:| | control at `f3578e38` | 396 | 2,658 | 25,273 | | + this PR, as it stands | **396** | **2,658** | **25,273** | Identical to the program. On the same command, #189's change is visible — so the asymmetry is real, and anyone using the offline run to triage this family will read "no effect" off a PR that works. Worth either setting the two options there from the same device query, or a line in the PR/README saying `--cache` is required to measure it. **2. Both modes, archive scale, cold pipeline library.** Windows 10 19044.7846, RTX 4090 (32-lane waves), validator DXC `1.8.2502.8`, same command, same base, my one-line local change so the CLI can pass the flags through (env-gated: `VICTORY_HOST_WAVE32`, `VICTORY_WAVE32_APPROX`; nothing else touched). | | refusals | compute emitted | pipelines made | net vs control | |---|---:|---:|---:|---:| | control | 396 | 2,658 | 25,273 | — | | host waves, default mode | 0 | 2,291 | 24,832 | **−441** | | host waves + approximation | 0 | 2,463 | 25,474 | **+201** | Both rows reconcile exactly against the 396: default mode declines 367 of them at translate and makes 29 new pipelines; approximation declines 195 and makes 201. The 195 are a single reason — `wave64 compute shader sharing LDS within one wave on a 32-lane host` — which the description says stays by design, so this is the first count of how big that designed-away class actually is across the title: 195 programs, 191 of which translate and validate today and are then refused at creation. Across all stages the approximation costs exactly those 195 (25,669 emitted on the control against 25,474), so everything the default mode gave up beyond them comes back. Default mode's loss by reason: 573 `a 64-bit wave mask read as data`, 195 the LDS class, 69 `a cross-half operation`. **3. It agrees with the other card.** @⁠davesousa's Ampere whole-pack run at the same default mode: refusals 397→1, newly not-translating 391 compute / 328 pixel / 67 mesh ≈ 786, against my 837 on Ada and Windows 10, with the same ordering of causes (mask-as-data first, LDS second, cross-half smallest). Two independent hosts, same magnitude, so the ~800 figure is not a one-machine artifact — and the approximation recovers essentially all of it except the 195. **4. Same axis as the emulation route.** Re-measured today at #189's current head (`3e39e340`, now rebased onto current main), against a control at `63bcca43` which reports the same 396 / 2,658 / 25,273 as the `f3578e38` control, so the two routes are comparable across that 3-commit gap: | route | refusals cleared | programs declined at translate | net pipelines | |---|---:|---:|---:| | #189 emulation | 396 | 269 | **+127** | | this PR, default mode | 396 | 367 | **−441** | | this PR, approximation | 396 | 195 | **+201** | On programs reaching a host pipeline — not gameplay, which depends on which of them the title dispatches — the split-halves route with the approximation on leads by 74 programs. The two controls agree exactly on all three tallies above, so the 3-commit gap between them is not doing any work here. Counts and reason strings only; no game files.
Author
Owner

@⁠reboot0000-cmd on GitHub · 2026-11-26 17:39 UTC · original

One reproducibility detail I should have stated with the table rather than left implicit: on Windows 10 these runs need the app-local runtime staging from #463 — D3D12\D3D12Core.dll beside the executable plus the two linker exports in apps/victory/build.rs. Without it the in-box runtime caps the shader model and this OS cannot give the census a shader-model 6.6 device, so no host pipelines can be created at all and the "pipelines made" column would not mean anything. That staging touches no recompiler logic; the only source change in these runs is the one line in translate.rs above.

**@⁠reboot0000-cmd** on GitHub · 2026-11-26 17:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7199390123) One reproducibility detail I should have stated with the table rather than left implicit: on Windows 10 these runs need the app-local runtime staging from #463 — `D3D12\D3D12Core.dll` beside the executable plus the two linker exports in `apps/victory/build.rs`. Without it the in-box runtime caps the shader model and this OS cannot give the census a shader-model 6.6 device, so no host pipelines can be created at all and the "pipelines made" column would not mean anything. That staging touches no recompiler logic; the only source change in these runs is the one line in `translate.rs` above.
Author
Owner

@⁠reboot0000-cmd on GitHub · 2026-11-26 18:08 UTC · original

One refinement to our table above, which changes how it should be read — and the tile classifier, which does not run under this PR alone on our host.

Which of the losses are real. Our table counted programs that stop translating. The question that matters more is how many of them work today. Re-cutting the same runs against the control's per-program state:

programs it declines of those, ones making a pipeline on main previously-refused programs that now make one net
host waves, default mode 837 470 — 430 pixel, 40 mesh 29 −441
host waves + approximation 195 0 201 +201

So the two modes are not on a spectrum. In default mode 367 of what disappears was already dead, but 470 programs that translate, validate and hold a host pipeline today stop translating — pixel and mesh programs, which is what a partly-missing world looks like counted up, and consistent with the "world partly missing" row in the description for the base pull request. With VICTORY_WAVE32_APPROX=1 every one of the 195 declines is a program the driver already refuses, and 201 previously-refused programs come back: no regression, only gain. The flag is the difference between a net loss with collateral and a strict improvement.

@⁠davesousa's whole-pack numbers may already show this and I want to credit it if so — the shape holds across machines: they counted 328 pixel / 67 mesh newly not translating on Ampere and Windows 11, I count 430 pixel / 40 mesh on Ada and Windows 10, in the same default mode.

The tile classifier. @⁠Venom2054 and @⁠JurajSimicevic are reasoning from the classifier running under the approximation. In our archive it is tiled_lighting:CS_MaterialTilesInitial_62659891 at shaders.rpf@0xf39bc25, and on this host:

  • main: DXIL validates, then the driver refuses the pipeline — The parameter is incorrect., and with the debug layer on (this week's #2562): id 622: CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32. It never runs here today.
  • this PR, host waves on: declined at translate, at 0x0 emit: wave64 compute shader sharing LDS within one wave on a 32-lane host.
  • this PR with VICTORY_WAVE32_APPROX=1: declined, the same reason — the approximation does not reach it; it is in the class the description says stays.
  • #189 emulation: declined, different reason — at 0x1f24 emit: a 64-lane wave ballot in divergent control flow.

So on main + this PR alone this program cannot be the source of anything drawn on a 32-lane host. Where it is observed running — @⁠Venom2054's local Series S fork, @⁠JurajSimicevic's #439 tree, the reports stacking #2925 — something else is translating it. One caveat so nobody over-reads this: I cannot join their program id bad01f53f53248e5 to our archive name, so if that is a different variant of the classifier, the comparison may not transfer.

That also makes the 195 a concrete target rather than an abstraction: they are all compute programs, all currently refused, and #2925's new emit/lower/lds.rs keys on exactly this case (host_wave32 with lds_dwords > 0). We are running this PR merged with #2925 on the whole archive now, in both modes, to see how many of the 195 come back and whether this classifier is one of them — the merge is clean, no conflicts, and the only local change is the same translate.rs line disclosed above. Will post the result here rather than guess at it.

**@⁠reboot0000-cmd** on GitHub · 2026-11-26 18:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7200091472) **One refinement to our table above, which changes how it should be read — and the tile classifier, which does not run under this PR alone on our host.** **Which of the losses are real.** Our table counted programs that stop translating. The question that matters more is how many of them work today. Re-cutting the same runs against the control's per-program state: | | programs it declines | **of those, ones making a pipeline on main** | previously-refused programs that now make one | net | |---|---:|---:|---:|---:| | host waves, default mode | 837 | **470** — 430 pixel, 40 mesh | 29 | −441 | | host waves + approximation | 195 | **0** | 201 | +201 | So the two modes are not on a spectrum. In default mode 367 of what disappears was already dead, but **470 programs that translate, validate and hold a host pipeline today stop translating** — pixel and mesh programs, which is what a partly-missing world looks like counted up, and consistent with the "world partly missing" row in the description for the base pull request. With `VICTORY_WAVE32_APPROX=1` every one of the 195 declines is a program the driver already refuses, and 201 previously-refused programs come back: no regression, only gain. The flag is the difference between a net loss with collateral and a strict improvement. @⁠davesousa's whole-pack numbers may already show this and I want to credit it if so — the shape holds across machines: they counted 328 pixel / 67 mesh newly not translating on Ampere and Windows 11, I count 430 pixel / 40 mesh on Ada and Windows 10, in the same default mode. **The tile classifier.** @⁠Venom2054 and @⁠JurajSimicevic are reasoning from the classifier running under the approximation. In our archive it is `tiled_lighting:CS_MaterialTilesInitial_62659891` at `shaders.rpf@0xf39bc25`, and on this host: - **main:** DXIL validates, then the driver refuses the pipeline — `The parameter is incorrect.`, and with the debug layer on (this week's #2562): `id 622: CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32`. It never runs here today. - **this PR, host waves on:** declined at translate, `at 0x0 emit: wave64 compute shader sharing LDS within one wave on a 32-lane host`. - **this PR with `VICTORY_WAVE32_APPROX=1`:** declined, **the same reason** — the approximation does not reach it; it is in the class the description says stays. - **#189 emulation:** declined, different reason — `at 0x1f24 emit: a 64-lane wave ballot in divergent control flow`. So on `main + this PR` alone this program cannot be the source of anything drawn on a 32-lane host. Where it is observed running — @⁠Venom2054's local Series S fork, @⁠JurajSimicevic's #439 tree, the reports stacking #2925 — something else is translating it. One caveat so nobody over-reads this: I cannot join their program id `bad01f53f53248e5` to our archive name, so if that is a different variant of the classifier, the comparison may not transfer. That also makes the 195 a concrete target rather than an abstraction: they are all compute programs, all currently refused, and #2925's new `emit/lower/lds.rs` keys on exactly this case (`host_wave32` with `lds_dwords > 0`). We are running this PR merged with #2925 on the whole archive now, in both modes, to see how many of the 195 come back and whether this classifier is one of them — the merge is clean, no conflicts, and the only local change is the same `translate.rs` line disclosed above. Will post the result here rather than guess at it.
Author
Owner

@⁠davesousa on GitHub · 2026-11-26 18:28 UTC · original

@⁠JurajSimicevic a third pattern, on Ampere, measured your way: on this card the green is not in the lighting output and does not follow the tile classifier. It appears at the colour-grading step.

RTX 3070 Ti (32-lane), driver 621.40, Windows 11 26200. 63bcca4 + #3097, #2703, #1906, #2098, #2464, #2626, #2628, this PR at f896d26 (with #2176, #2118), #2634, #2925 fd180a6, #2928; VICTORY_WAVE32_APPROX=1, diag build, warm caches. The first world view held still (no input after the menus), VICTORY_CAPTURE_WORLD=100 with VICTORY_DUMP_TARGETS=1, one run per arm. Green-dominant: green above both red and blue by more than 24/255.

tile classifier runs skipped (VICTORY_SKIP_PIPELINES)
the 9 full-size HDR targets (RGBA16F, R11G11B10F) 0.08% at most 0.05% at most
the 33³ grading tables (slice 0) the same in both the same in both
the first 10-bit colour target after them (2560×1440) 21.5% 21.6%
presented frame 21.2% 20.8%

The HDR targets are warm in both arms (red above green above blue). The identity grading tables are exact; the two graded ones are the same in both arms, and I can't tell yet whether they or their lookup in the grading pass are what turns the picture green. Either way, on this stack the green is downstream of the classifier and of lighting, unlike the 5080 run where the lighting output itself was 51% green. Whoever holds NEW-357 / NEW-454 may want to check the grading step on their card too.

Not tested: more than one run per arm, other scenes, other stacks. Counts only; the captures stay local.

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

**@⁠davesousa** on GitHub · 2026-11-26 18:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7200504867) @⁠JurajSimicevic a third pattern, on Ampere, measured your way: on this card the green is not in the lighting output and does not follow the tile classifier. It appears at the colour-grading step. RTX 3070 Ti (32-lane), driver 621.40, Windows 11 26200. `63bcca4` + #3097, #2703, #1906, #2098, #2464, #2626, #2628, this PR at `f896d26` (with #2176, #2118), #2634, #2925 `fd180a6`, #2928; `VICTORY_WAVE32_APPROX=1`, `diag` build, warm caches. The first world view held still (no input after the menus), `VICTORY_CAPTURE_WORLD=100` with `VICTORY_DUMP_TARGETS=1`, one run per arm. Green-dominant: green above both red and blue by more than 24/255. | | tile classifier runs | skipped (`VICTORY_SKIP_PIPELINES`) | |---|---:|---:| | the 9 full-size HDR targets (RGBA16F, R11G11B10F) | 0.08% at most | 0.05% at most | | the 33³ grading tables (slice 0) | the same in both | the same in both | | the first 10-bit colour target after them (2560×1440) | 21.5% | 21.6% | | presented frame | 21.2% | 20.8% | The HDR targets are warm in both arms (red above green above blue). The identity grading tables are exact; the two graded ones are the same in both arms, and I can't tell yet whether they or their lookup in the grading pass are what turns the picture green. Either way, on this stack the green is downstream of the classifier and of lighting, unlike the 5080 run where the lighting output itself was 51% green. Whoever holds NEW-357 / NEW-454 may want to check the grading step on their card too. Not tested: more than one run per arm, other scenes, other stacks. Counts only; the captures stay local. AI-assisted (Claude Code); the runs are on my machine.
Author
Owner

@⁠reboot0000-cmd on GitHub · 2026-11-26 19:02 UTC · original

Result of the run I said I'd finish: the tile classifier gets a host pipeline only when this PR is merged with #2925 and VICTORY_WAVE32_APPROX=1. Neither change does it alone.

Same host, archive, validator and command as my posts above. The merge of f896d26 with #2925 at fd180a6 was clean — no conflicts, no edits beyond the one translate.rs line already disclosed.

driver refusals compute emitted pipelines made net vs control programs declined that work today
control at f3578e38 396 2,658 25,273 — —
#189 emulation 0 2,389 25,400 +127 2
this PR, approximation 0 2,463 25,474 +201 0
this PR + #2925, default 0 2,331 24,872 −401 470
this PR + #2925, approximation 0 2,516 25,527 +254 0

Last column is the number I should have published alongside the first version of this table: of the 269 programs the emulation route declines, 2 hold a working host pipeline on main (129 previously-refused programs come back, minus those 2, which is where +127 comes from). The approximation routes lose none.

The classifier, step by step (tiled_lighting:CS_MaterialTilesInitial_62659891 at shaders.rpf@0xf39bc25):

  1. main: DXIL validates, driver refuses — The parameter is incorrect., and via the debug layer id 622: Shader wants wave lane count of 64 but maximum wave lane count for device is 32.
  2. this PR, host waves on: declined at translate, wave64 compute shader sharing LDS within one wave on a 32-lane host. The approximation does not change this — same reason, still declined.
  3. + #2925: declined, but now for a different reason: a 64-bit wave mask read as data on a 32-lane host. The barrier work cleared its LDS problem and exposed the mask problem underneath.
  4. + #2925 and the approximation: translated, validated, host pipeline created. It runs.

That is a mechanism for @⁠JurajSimicevic's observation, and it is not a driver bug. Per #2176's own description, what the approximation substitutes for a 64-lane ballot read as data is that the high dword is 0 — so on a program declared for 64 lanes and split into two host halves, lanes 32-63 read zero. @⁠davesousa's colour-grading result doesn't contradict it on our host: with the approximation on, zero pixel and zero mesh programs change state at all (every one of the 142 remaining declines is a compute program the driver already refuses), so a colour-grading difference on Ampere is not coming from shader availability here. Their #439 comparison also can't rule it out — I have no #439 tree, and that is a different translation entirely.

What #2925 adds under the approximation: 53 compute programs, every one of them driver-refused on main, none of them working today. All compute; no graphics stage involved. Grouped by pipeline:

InstanceCulling 6, RiverSimPacket 6, GpuParticleUpdate 5, tiled_lighting 4, sr_tracing 3, scattering_transmittance_system 3, water_compressed_simulation_rendertarget 3, deferred_tiled 2, shadowmask 2, alphaResolve 2, indirect_light_probes 2, WindNew 2, shader_binning_utils 2, and one each of TAA2, TAA_Utilities, BilateralGrid, height_buffer_offset, terrainshadows, weatherParticle, vfx_lightningStrike, ShallowWaterSim, water_shading, deferred_mirror, deferred_studio_shot.

Among them, the ones most likely to show up as an image difference rather than a missing object, since they feed lighting and culling decisions: CS_MaterialTilesInitial and CS_MaterialTiles, CS_ShadowRevealTilesInitial and CS_ShadowRevealTiles, cs_generate_material_tiles in the mirror and studio-shot deferred pipelines, CS_DepthProcessing/CS_DepthProcessingHBO, the six CS_Slod_BatchCull* variants, CS_DenoiseShadowMaskPoissonDisc(+Packed), CS_IrradianceCache_Shade and …_Secondary, and CS_ComputeLuminanceBilateralGrid.

142 programs stay declined in that configuration, all with the single reason one-wave LDS on a 32-lane host: no point all threads reach between a write…, and all 142 were refused on main too — so on this measure the combination is the best of everything on this list, +254 pipelines with nothing working given up.

Caveats unchanged from before: this counts programs reaching a host pipeline offline, not dispatches in a running frame; Windows 10, Ada, validator DXC 1.8.2502.8; and I still cannot join your 16-hex program ids to our archive's name_hash/offset pairs, so if your classifier variant differs from CS_MaterialTilesInitial_62659891 the step-by-step may not transfer. Counts, offsets, names and driver text only.

**@⁠reboot0000-cmd** on GitHub · 2026-11-26 19:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/2711#issuecomment-7201132877) **Result of the run I said I'd finish: the tile classifier gets a host pipeline only when this PR is merged with #2925 *and* `VICTORY_WAVE32_APPROX=1`. Neither change does it alone.** Same host, archive, validator and command as my posts above. The merge of `f896d26` with #2925 at `fd180a6` was clean — no conflicts, no edits beyond the one `translate.rs` line already disclosed. | | driver refusals | compute emitted | pipelines made | net vs control | programs declined that work today | |---|---:|---:|---:|---:|---:| | control at `f3578e38` | 396 | 2,658 | 25,273 | — | — | | #189 emulation | 0 | 2,389 | 25,400 | +127 | 2 | | this PR, approximation | 0 | 2,463 | 25,474 | +201 | **0** | | this PR + #2925, default | 0 | 2,331 | 24,872 | −401 | 470 | | **this PR + #2925, approximation** | **0** | **2,516** | **25,527** | **+254** | **0** | Last column is the number I should have published alongside the first version of this table: of the 269 programs the emulation route declines, **2 hold a working host pipeline on main** (129 previously-refused programs come back, minus those 2, which is where +127 comes from). The approximation routes lose none. **The classifier, step by step** (`tiled_lighting:CS_MaterialTilesInitial_62659891` at `shaders.rpf@0xf39bc25`): 1. **main:** DXIL validates, driver refuses — `The parameter is incorrect.`, and via the debug layer `id 622: Shader wants wave lane count of 64 but maximum wave lane count for device is 32`. 2. **this PR, host waves on:** declined at translate, `wave64 compute shader sharing LDS within one wave on a 32-lane host`. The approximation does not change this — same reason, still declined. 3. **+ #2925:** declined, but now for a **different** reason: `a 64-bit wave mask read as data on a 32-lane host`. The barrier work cleared its LDS problem and exposed the mask problem underneath. 4. **+ #2925 and the approximation:** **translated, validated, host pipeline created.** It runs. That is a mechanism for @⁠JurajSimicevic's observation, and it is not a driver bug. Per #2176's own description, what the approximation substitutes for a 64-lane ballot read as data is that the **high dword is 0** — so on a program declared for 64 lanes and split into two host halves, lanes 32-63 read zero. @⁠davesousa's colour-grading result doesn't contradict it on our host: with the approximation on, **zero pixel and zero mesh programs change state at all** (every one of the 142 remaining declines is a compute program the driver already refuses), so a colour-grading difference on Ampere is not coming from shader availability here. Their #439 comparison also can't rule it out — I have no #439 tree, and that is a different translation entirely. **What #2925 adds under the approximation: 53 compute programs, every one of them driver-refused on main, none of them working today.** All compute; no graphics stage involved. Grouped by pipeline: `InstanceCulling` 6, `RiverSimPacket` 6, `GpuParticleUpdate` 5, `tiled_lighting` 4, `sr_tracing` 3, `scattering_transmittance_system` 3, `water_compressed_simulation_rendertarget` 3, `deferred_tiled` 2, `shadowmask` 2, `alphaResolve` 2, `indirect_light_probes` 2, `WindNew` 2, `shader_binning_utils` 2, and one each of `TAA2`, `TAA_Utilities`, `BilateralGrid`, `height_buffer_offset`, `terrainshadows`, `weatherParticle`, `vfx_lightningStrike`, `ShallowWaterSim`, `water_shading`, `deferred_mirror`, `deferred_studio_shot`. Among them, the ones most likely to show up as an image difference rather than a missing object, since they feed lighting and culling decisions: `CS_MaterialTilesInitial` and `CS_MaterialTiles`, `CS_ShadowRevealTilesInitial` and `CS_ShadowRevealTiles`, `cs_generate_material_tiles` in the mirror and studio-shot deferred pipelines, `CS_DepthProcessing`/`CS_DepthProcessingHBO`, the six `CS_Slod_BatchCull*` variants, `CS_DenoiseShadowMaskPoissonDisc(+Packed)`, `CS_IrradianceCache_Shade` and `…_Secondary`, and `CS_ComputeLuminanceBilateralGrid`. 142 programs stay declined in that configuration, all with the single reason `one-wave LDS on a 32-lane host: no point all threads reach between a write…`, and all 142 were refused on main too — so on this measure the combination is the best of everything on this list, +254 pipelines with nothing working given up. Caveats unchanged from before: this counts programs reaching a host pipeline offline, not dispatches in a running frame; Windows 10, Ada, validator DXC `1.8.2502.8`; and I still cannot join your 16-hex program ids to our archive's `name_hash`/offset pairs, so if your classifier variant differs from `CS_MaterialTilesInitial_62659891` the step-by-step may not transfer. Counts, offsets, names and driver text only.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2711'
git switch 'github-bot/gh-2711'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2711'
git switch 'github-bot/gh-2711'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2711'
git switch 'main'
git merge --squash 'github-bot/gh-2711'
git switch 'main'
git merge --ff-only 'github-bot/gh-2711'
git switch 'main'
git merge 'github-bot/gh-2711'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2711
No description provided.