Shaders: one lane of a whole-wave section's value, read after the section #3402

Open
Lyrnc wants to merge 1 commit from upstream-pr/3402 into main
Lyrnc commented 2026-11-26 22:25:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Lyrnc on 2026-11-26T22:25:19Z.


What was refused

Three wave64 compute programs of the title's FidelityFX upscaler DLL (amd_fidelityfx_upscaler_xbox.dll):
17af85f170e66f30, 477b52e73ddeb6f2, 8b437ab61d8008fe. On main they stop earlier, at
a lane mask read as data (fixed by #3401); past that, each stops at
a whole-wave section step the simulation does not follow, at its final store.

Each ends with a wave OR reduction of the form the console compiler writes for wave64 (as this PR's test
writes it):

    s_or_saveexec_b64   s[14:15], -1
    v_cndmask_b32       v7, 0, v6, s[14:15]
    v_or_b32            v7, v7, v7 quad_perm:[1,0,3,2]
    v_or_b32            v7, v7, v7 quad_perm:[2,3,0,1]
    v_or_b32            v7, v7, v7 row_half_mirror
    v_or_b32            v7, v7, v7 row_mirror
    v_permlanex16_b32   v3, v7, 0, 0
    v_or_b32            v7, v3, v7          ; each half holds its own 32 lanes' OR
    v_readlane_b32      s16, v7, 0
    v_or_b32            v7, s16, v7         ; the high half now holds the whole wave's
    s_mov_b64           exec, s[14:15]
    v_readlane_b32      s16, v7, 63         ; read after the section

The section simulation lowers a value that leaves the section only where every lane agrees on one shape.
Here the low half holds its own lanes' OR and the high half the whole wave's, so v7 had no shape, and the
read at lane 63 after the section was refused.

What changed

  • emit/wave.rs: Section::lanes keeps, for a value whose lanes differ, what each lane holds where that does not
    depend on the lane reading it: a reduction over all lanes, a constant, a uniform value (never a lane's own value
    of a VGPR). Values with one shape are unchanged.
  • emit/lower.rs: a v_readlane_b32 at a constant lane, outside the section, of such a value is lowered by that
    lane's shape (shape(), the same lowering as a section value with one shape). A lane without one (here lane 0,
    which holds only the low half's OR) is still refused.

Tests

  • wave::tests::a_wave64_reduction_finished_in_the_high_half_is_known_per_lane (no GPU): the sequence above;
    lanes 32-63 are the reduction over the wave, lanes 0-31 have no lane-independent shape, the value no shape.
  • crosslane_tests::whole_wave_section_read_at_one_lane_after_it_on_gpu (wave32, 32 lanes, hardware adapter):
    the same idea within one wave32: rows reduced with DPP, row 0's result (lane 0) ORed in, so only row 1 holds the
    whole wave's, read at lane 31 after EXEC is restored; under a branch on three of four lanes, on 1 << lane, so
    the answer (0x77777777) differs from a dropped row (half of it) and from counting inactive lanes (0xFFFFFFFF).
  • crosslane_tests::wave64_section_read_at_lane_63_after_it: the wave64 sequence above under a branch on the lanes
    with lane & 2 == 0, on 1 << (lane >> 1): 0x55555555 (a dropped half gives 0x5555 or 0x55550000, inactive
    lanes counted 0xFFFFFFFF). Lowered and validated everywhere, run where the host has 64-lane waves.

Results:

  • RTX 5080 (the default adapter): all three pass; the wave64 test is lowered and validated (no 64-lane waves on
    NVIDIA).
  • AMD Radeon iGPU (RDNA2 gfx1036, picked with a local adapter filter that is not part of this PR): all three pass,
    the wave64 program dispatched on 64-lane waves.
  • With main's wave.rs and lower.rs the two GPU tests fail at lowering with
    a whole-wave section step the simulation does not follow.
  • RDNA2 hardware (gfx1036 through a hardware oracle running hand-written GFX10 assembly, 64 rows): both test
    sequences run natively give 0x77777777 (wave32, read at lane 31) and 0x55555555 (wave64, read at lane 63) in
    every running lane: 0 differences from the tests' expected values.
  • cargo clippy -p victory-shader --lib --tests -- -D warnings: clean. cargo xtask policy: 191 files ok.
  • cargo test -p victory-shader --lib -- --test-threads=1 on the RTX 5080, skipping
    heap_direct_texture_reads_mark_their_heap_index (it kills the test process here, as #2571 reports): 301 passed,
    3 failed, 3 ignored; the three (stride_tests::a_heap_buffer_read_* twice,
    synthetic_tests::gathers_at_a_level_match_the_hardware) fail the same way on main 63bcca4 here.

Census (offline, the title's shader pack, exe and DLLs)

translate --list --validate over shaders.rpf, the executable, XboxBvhBuilder.dll and
amd_fidelityfx_upscaler_xbox.dll, validator dxc 1.9.2609 dxil.dll, compared program by program:

main 63bcca4 this branch this branch + #3401
compute programs validated 1,985 1,985 1,989
all programs validated 24,937 24,937 24,941
  • Alone, this branch changes no outcome and no emitted program by a byte (every emitted program's DXIL compared by
    hash): the three programs stop at the earlier refusal first.
  • With #3401: all four FidelityFX programs of the two refusals validate (8e614708143ef917,
    17af85f170e66f30, 477b52e73ddeb6f2, 8b437ab61d8008fe); against #3401 alone, exactly the
    three wave64 ones change, from a whole-wave section step the simulation does not follow to validated, and no
    other program changes outcome or DXIL. The five new tests of both branches pass together on the RTX 5080.

Both this and #3401 append tests at the end of emit/crosslane_tests.rs; whichever merges
second has a trivial conflict there (keep both blocks; git takes the closing brace as shared, so check it).

Not tested

  • No live run (the title's own upscaler runs only in Series S mode without VICTORY_FIDELITYFX_DIR; the game was
    not started).
  • The three programs declare a wave size of 64: NVIDIA hosts refuse their pipelines whatever this change does.

AI use: Claude Code (Claude Opus 5.5) found the refusal in the offline census, wrote the change, the tests and
this text, and ran the checks on our machine; Lyrnc reviews what goes out. No game data is included (hashes,
counts and error text only; the sequence above is the test's, written by hand).

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5517978141 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3402). Originally posted by [Lyrnc](https://github.com/Lyrnc) on 2026-11-26T22:25:19Z. --- ## What was refused Three wave64 compute programs of the title's FidelityFX upscaler DLL (`amd_fidelityfx_upscaler_xbox.dll`): `17af85f170e66f30`, `477b52e73ddeb6f2`, `8b437ab61d8008fe`. On main they stop earlier, at `a lane mask read as data` (fixed by #3401); past that, each stops at `a whole-wave section step the simulation does not follow`, at its final store. Each ends with a wave OR reduction of the form the console compiler writes for wave64 (as this PR's test writes it): ``` s_or_saveexec_b64 s[14:15], -1 v_cndmask_b32 v7, 0, v6, s[14:15] v_or_b32 v7, v7, v7 quad_perm:[1,0,3,2] v_or_b32 v7, v7, v7 quad_perm:[2,3,0,1] v_or_b32 v7, v7, v7 row_half_mirror v_or_b32 v7, v7, v7 row_mirror v_permlanex16_b32 v3, v7, 0, 0 v_or_b32 v7, v3, v7 ; each half holds its own 32 lanes' OR v_readlane_b32 s16, v7, 0 v_or_b32 v7, s16, v7 ; the high half now holds the whole wave's s_mov_b64 exec, s[14:15] v_readlane_b32 s16, v7, 63 ; read after the section ``` The section simulation lowers a value that leaves the section only where every lane agrees on one shape. Here the low half holds its own lanes' OR and the high half the whole wave's, so `v7` had no shape, and the read at lane 63 after the section was refused. ## What changed - `emit/wave.rs`: `Section::lanes` keeps, for a value whose lanes differ, what each lane holds where that does not depend on the lane reading it: a reduction over all lanes, a constant, a uniform value (never a lane's own value of a VGPR). Values with one shape are unchanged. - `emit/lower.rs`: a `v_readlane_b32` at a constant lane, outside the section, of such a value is lowered by that lane's shape (`shape()`, the same lowering as a section value with one shape). A lane without one (here lane 0, which holds only the low half's OR) is still refused. ## Tests - `wave::tests::a_wave64_reduction_finished_in_the_high_half_is_known_per_lane` (no GPU): the sequence above; lanes 32-63 are the reduction over the wave, lanes 0-31 have no lane-independent shape, the value no shape. - `crosslane_tests::whole_wave_section_read_at_one_lane_after_it_on_gpu` (wave32, 32 lanes, hardware adapter): the same idea within one wave32: rows reduced with DPP, row 0's result (lane 0) ORed in, so only row 1 holds the whole wave's, read at lane 31 after EXEC is restored; under a branch on three of four lanes, on `1 << lane`, so the answer (0x77777777) differs from a dropped row (half of it) and from counting inactive lanes (0xFFFFFFFF). - `crosslane_tests::wave64_section_read_at_lane_63_after_it`: the wave64 sequence above under a branch on the lanes with `lane & 2 == 0`, on `1 << (lane >> 1)`: 0x55555555 (a dropped half gives 0x5555 or 0x55550000, inactive lanes counted 0xFFFFFFFF). Lowered and validated everywhere, run where the host has 64-lane waves. Results: - RTX 5080 (the default adapter): all three pass; the wave64 test is lowered and validated (no 64-lane waves on NVIDIA). - AMD Radeon iGPU (RDNA2 gfx1036, picked with a local adapter filter that is not part of this PR): all three pass, the wave64 program dispatched on 64-lane waves. - With main's `wave.rs` and `lower.rs` the two GPU tests fail at lowering with `a whole-wave section step the simulation does not follow`. - RDNA2 hardware (gfx1036 through a hardware oracle running hand-written GFX10 assembly, 64 rows): both test sequences run natively give 0x77777777 (wave32, read at lane 31) and 0x55555555 (wave64, read at lane 63) in every running lane: 0 differences from the tests' expected values. - `cargo clippy -p victory-shader --lib --tests -- -D warnings`: clean. `cargo xtask policy`: 191 files ok. - `cargo test -p victory-shader --lib -- --test-threads=1` on the RTX 5080, skipping `heap_direct_texture_reads_mark_their_heap_index` (it kills the test process here, as #2571 reports): 301 passed, 3 failed, 3 ignored; the three (`stride_tests::a_heap_buffer_read_*` twice, `synthetic_tests::gathers_at_a_level_match_the_hardware`) fail the same way on main `63bcca4` here. ## Census (offline, the title's shader pack, exe and DLLs) `translate --list --validate` over `shaders.rpf`, the executable, `XboxBvhBuilder.dll` and `amd_fidelityfx_upscaler_xbox.dll`, validator dxc 1.9.2609 `dxil.dll`, compared program by program: | | main `63bcca4` | this branch | this branch + #3401 | |---|---:|---:|---:| | compute programs validated | 1,985 | 1,985 | 1,989 | | all programs validated | 24,937 | 24,937 | 24,941 | - Alone, this branch changes no outcome and no emitted program by a byte (every emitted program's DXIL compared by hash): the three programs stop at the earlier refusal first. - With #3401: all four FidelityFX programs of the two refusals validate (`8e614708143ef917`, `17af85f170e66f30`, `477b52e73ddeb6f2`, `8b437ab61d8008fe`); against #3401 alone, exactly the three wave64 ones change, from `a whole-wave section step the simulation does not follow` to validated, and no other program changes outcome or DXIL. The five new tests of both branches pass together on the RTX 5080. Both this and #3401 append tests at the end of `emit/crosslane_tests.rs`; whichever merges second has a trivial conflict there (keep both blocks; git takes the closing brace as shared, so check it). ## Not tested - No live run (the title's own upscaler runs only in Series S mode without `VICTORY_FIDELITYFX_DIR`; the game was not started). - The three programs declare a wave size of 64: NVIDIA hosts refuse their pipelines whatever this change does. AI use: Claude Code (Claude Opus 5.5) found the refusal in the offline census, wrote the change, the tests and this text, and ran the checks on our machine; Lyrnc reviews what goes out. No game data is included (hashes, counts and error text only; the sequence above is the test's, written by hand). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Dukestar69 commented 2026-11-26 22:27:19 +00:00 (Migrated from github.com)

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

Review: APPROVED


LGTM — verified on RTX 5090 and VICTORY_WARP=1 (Windows / D3D12) against origin/main (63bcca4).

  • Tracking per-lane results of a whole-wave section so a subsequent single-lane read (including lane 63 of a wave64 reduction) lowers accurately passes cleanly on both RTX 5090 and WARP.
  • cargo test -p victory-shader --lib emit::wave:: -- --test-threads=1: 8 passed, 0 failed (a_wave64_reduction_finished_in_the_high_half_is_known_per_lane).
  • cargo test -p victory-shader --lib emit::crosslane_tests:: -- --test-threads=1: 7 passed, 0 failed on RTX 5090 and 7 passed, 0 failed on VICTORY_WARP=1 (whole_wave_section_read_at_one_lane_after_it_on_gpu, wave64_section_read_at_lane_63_after_it).
  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

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

<!-- greyfinch-sync:Marvisak/VIctory:review:6081119189 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3402#pullrequestreview-6081119189). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T22:27:19Z. **Review:** APPROVED --- LGTM — verified on RTX 5090 and `VICTORY_WARP=1` (Windows / D3D12) against `origin/main` (`63bcca4`). - Tracking per-lane results of a whole-wave section so a subsequent single-lane read (including lane 63 of a wave64 reduction) lowers accurately passes cleanly on both RTX 5090 and WARP. - `cargo test -p victory-shader --lib emit::wave:: -- --test-threads=1`: 8 passed, 0 failed (`a_wave64_reduction_finished_in_the_high_half_is_known_per_lane`). - `cargo test -p victory-shader --lib emit::crosslane_tests:: -- --test-threads=1`: 7 passed, 0 failed on RTX 5090 and 7 passed, 0 failed on `VICTORY_WARP=1` (`whole_wave_section_read_at_one_lane_after_it_on_gpu`, `wave64_section_read_at_lane_63_after_it`). - `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Aniseto commented 2026-11-26 22:39:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Aniseto on 2026-11-26T22:39:58Z.


Ran the whole-wave-section tests at d1158c9 on an NVIDIA Blackwell desktop part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build.

cargo test -p victory-shader --lib -- whole_wave_section_read_at_one_lane_after_it_on_gpu a_wave64_reduction_finished_in_the_high_half_is_known_per_lane --test-threads=1
2 passed; 0 failed; 0 ignored; 0 measured; 306 filtered out      (exit 0)

Both pass: the wave32 fixture ran a dispatch on the real 32-lane adapter, and the wave64 reduction test passed at translation level. I did not run wave64_section_read_at_lane_63_after_it, which needs a 64-lane host. The PR has no comments yet; the author tested on an RTX 5080, so this adds a second NVIDIA datapoint on driver 32.0.16.2124.

Not tested: the wave64 GPU dispatch, the title's FidelityFX shaders, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7204879464 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3402#issuecomment-7204879464). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-26T22:39:58Z. --- Ran the whole-wave-section tests at `d1158c9` on an NVIDIA Blackwell desktop part: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build. ``` cargo test -p victory-shader --lib -- whole_wave_section_read_at_one_lane_after_it_on_gpu a_wave64_reduction_finished_in_the_high_half_is_known_per_lane --test-threads=1 2 passed; 0 failed; 0 ignored; 0 measured; 306 filtered out (exit 0) ``` Both pass: the wave32 fixture ran a dispatch on the real 32-lane adapter, and the wave64 reduction test passed at translation level. I did not run `wave64_section_read_at_lane_63_after_it`, which needs a 64-lane host. The PR has no comments yet; the author tested on an RTX 5080, so this adds a second NVIDIA datapoint on driver 32.0.16.2124. Not tested: the wave64 GPU dispatch, the title's FidelityFX shaders, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
fuzeofficlal commented 2026-11-26 22:47:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T22:47:15Z.

Review: CHANGES_REQUESTED


Tracking per-lane Shape in Section::lanes for whole-wave Wave64 split-half reductions is a very clean idea, and both new tests pass validation (with Wave32 GPU readback passing on RTX 5090, 48/48 tests green).

However, there is one P1 regression in how section_lane materializes the read shape:

  • Unlike shapes — which calls self.shape(sh) immediately at section_inst (crates/victory-shader/src/emit/lower.rs:1162) while self.cur is still in the section's block — section_lanes defers calling self.shape(shape) until the v_readlane_b32 consumer (lower.rs:6682-6686).
  • If there is a divergent branch between the whole-wave section and the v_readlane_b32 (for example, the section computes an all-lane Op::Or reduction 0xFFFFFFFF before an even-lane branch, and v_readlane_b32 s15, v7, 31 executes inside that even-lane branch), self.shape(shape) emits waveActiveBit at the divergent branch block (self.cur), which only sees the even lanes and silently returns 0x55555555 instead of 0xFFFFFFFF.

Materializing (and caching) the needed section_lanes shapes eagerly at section_inst (just like shapes) — or rejecting deferred reads across divergent control flow — would close this cleanly.

Non-blocking notes:

  • P1 (pre-existing): v_readfirstlane_b32 (lower.rs:6715) does not consult section_lanes and can pick host lane 0 when restored EXEC excludes lane 0.
  • P2: dynamic/SGPR lane indices, out-of-range indices (>= wave_size), and values flowing through a non-trivial VGPR phi before v_readlane_b32 miss section_lanes and fall back to Val::Missing.
<!-- greyfinch-sync:Marvisak/VIctory:review:6081236997 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3402#pullrequestreview-6081236997). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T22:47:15Z. **Review:** CHANGES_REQUESTED --- Tracking per-lane `Shape` in `Section::lanes` for whole-wave Wave64 split-half reductions is a very clean idea, and both new tests pass validation (with Wave32 GPU readback passing on RTX 5090, 48/48 tests green). However, there is one **P1 regression** in how `section_lane` materializes the read shape: - Unlike `shapes` — which calls `self.shape(sh)` immediately at `section_inst` (`crates/victory-shader/src/emit/lower.rs:1162`) while `self.cur` is still in the section's block — `section_lanes` defers calling `self.shape(shape)` until the `v_readlane_b32` consumer (`lower.rs:6682-6686`). - If there is a divergent branch between the whole-wave section and the `v_readlane_b32` (for example, the section computes an all-lane `Op::Or` reduction `0xFFFFFFFF` before an even-lane branch, and `v_readlane_b32 s15, v7, 31` executes inside that even-lane branch), `self.shape(shape)` emits `waveActiveBit` at the divergent branch block (`self.cur`), which only sees the even lanes and silently returns `0x55555555` instead of `0xFFFFFFFF`. Materializing (and caching) the needed `section_lanes` shapes eagerly at `section_inst` (just like `shapes`) — or rejecting deferred reads across divergent control flow — would close this cleanly. Non-blocking notes: - P1 (pre-existing): `v_readfirstlane_b32` (`lower.rs:6715`) does not consult `section_lanes` and can pick host lane 0 when restored `EXEC` excludes lane 0. - P2: dynamic/SGPR lane indices, out-of-range indices (`>= wave_size`), and values flowing through a non-trivial VGPR phi before `v_readlane_b32` miss `section_lanes` and fall back to `Val::Missing`.
andrewpozdnakov7-jpg commented 2026-11-27 00:20:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T00:20:09Z.


Following up on the Wave64 runtime check, I combined this exact head d1158c9 with #3401 at d9ed313. The tested merge resolves the shared test-file conflict and adds a regression for the ordered pair.

The regression runs the two patterns in a single synthetic shader. The first true comparison is in lane 63 on iteration 2 of a bounded poll. The shader then performs the whole-wave OR and reads lane 63 after restoring EXEC. Readback must contain 0x55555557 in the 32 participating lanes and the original sentinel 7 in the other 32.

With the identical fixture, #3402 alone stops at a lane mask read as data and #3401 alone stops at a whole-wave section step the simulation does not follow. The combined branch validated and dispatched the Wave64 shader in three fresh WARP 1.0.22 processes, with all 64 words matching each time. The cross-lane and wave suites reported 18 passed. This WARP runtime skipped Wave32 dispatches. Strict clippy with default and all features and the 192-file asset-policy check passed.

The merge retains both parent commits and both sets of tests. It moves the mask-SCC helpers to keep lower.rs below the size limit. Maintainers can use the composition when ordering the two PRs. If folding the new regression into another commit, please retain the Git author or add Co-authored-by: andrewpozdnakov7-jpg.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7206374398 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3402#issuecomment-7206374398). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T00:20:09Z. --- Following up on the Wave64 runtime check, I combined this exact head `d1158c9` with #3401 at `d9ed313`. The [tested merge](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/ff810291b3c4baf339200de62988e6bc0a1c865b) resolves the shared test-file conflict and adds a regression for the ordered pair. The regression runs the two patterns in a single synthetic shader. The first true comparison is in lane 63 on iteration 2 of a bounded poll. The shader then performs the whole-wave OR and reads lane 63 after restoring EXEC. Readback must contain `0x55555557` in the 32 participating lanes and the original sentinel 7 in the other 32. With the identical fixture, #3402 alone stops at `a lane mask read as data` and #3401 alone stops at `a whole-wave section step the simulation does not follow`. The combined branch validated and dispatched the Wave64 shader in three fresh WARP 1.0.22 processes, with all 64 words matching each time. The cross-lane and wave suites reported 18 passed. This WARP runtime skipped Wave32 dispatches. Strict clippy with default and all features and the 192-file asset-policy check passed. The merge retains both parent commits and both sets of tests. It moves the mask-SCC helpers to keep `lower.rs` below the size limit. Maintainers can use the composition when ordering the two PRs. If folding the new regression into another commit, please retain the Git author or add `Co-authored-by: andrewpozdnakov7-jpg`.
andrewpozdnakov7-jpg commented 2026-11-27 06:57:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T06:57:11Z.


@Lyrnc f9e2015 is directly on d1158c9. It materializes only the statically requested lane values while lowering the whole-wave section, then reuses them at the later read.

I reproduced the review case on app-local WARP. An all-lane OR followed by a read inside an even-lane branch returned 0x55555555 in 16 lanes. On the follow-up all 16 readers return 0xFFFFFFFF and the other 16 retain the old destination. The original branched case and the Wave64 lane-63 test also passed. Strict shader Clippy passed in both configurations.

If you take the patch, please retain Git authorship when cherry-picking or rebasing. If folded into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

AI-assisted with Codex. Synthetic shaders only.

I also resolved the test-file overlap and the shader file-size limit in c75cc68, which combines the two reviewed follow-ups. Both SCC regressions and both section-lane tests passed in the combined app-local WARP build.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7212000555 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3402#issuecomment-7212000555). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T06:57:11Z. --- @Lyrnc [f9e2015](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/f9e2015af0db03fb44c8197d11064c56b9be0a12) is directly on `d1158c9`. It materializes only the statically requested lane values while lowering the whole-wave section, then reuses them at the later read. I reproduced the review case on app-local WARP. An all-lane OR followed by a read inside an even-lane branch returned `0x55555555` in 16 lanes. On the follow-up all 16 readers return `0xFFFFFFFF` and the other 16 retain the old destination. The original branched case and the Wave64 lane-63 test also passed. Strict shader Clippy passed in both configurations. If you take the patch, please retain Git authorship when cherry-picking or rebasing. If folded into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with Codex. Synthetic shaders only. I also resolved the test-file overlap and the shader file-size limit in [c75cc68](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/c75cc689ddec4bd86f94e179dfd6e540c09dc27a), which combines the two reviewed follow-ups. Both SCC regressions and both section-lane tests passed in the combined app-local WARP build.
ColorMeBoom commented 2026-11-27 13:33:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ColorMeBoom on 2026-11-27T13:33:25Z.


AMD run: RX 5700 XT (RDNA1, 32–64 lanes, so the 64-lane cases run instead of being "lowered and validated only"), driver 32.0.21045.29003, Windows 11 26200, Rust 1.98.1. Each tree was merged onto main 63bcca4 and run on the native adapter (VICTORY_WARP unset), no game files.

Tree wave64_section_read_at_lane_63_after_it whole_wave_section_read_at_one_lane_after_it_on_gpu crosslane Full suite Clippy
Head d1158c9 pass 1/1 7 passed 305 passed, 0 failed clean
Head + @andrewpozdnakov7-jpg's f9e2015 pass 2/2 (adds "an all-lane OR reduction read later by even lanes only") 7 passed 305 passed, 0 failed clean
ff81029 (#3401 at d9ed313 + this PR) pass 1/1 10 passed 308 passed, 0 failed clean
  • The lane-63 test dispatched on 64-lane hardware in all three trees; it never printed "lowered and validated only". The NVIDIA run above is 32-lane only, so this is the first time it ran rather than only being validated.
  • DPP16 18/18, DPP8/DPP8FI 5/5 and ds_swizzle_b32 6/6 in every tree. "Full suite" is cargo test -p victory-shader --lib --features host, 3 ignored in each.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7219635083 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3402#issuecomment-7219635083). Originally posted by [ColorMeBoom](https://github.com/ColorMeBoom) on 2026-11-27T13:33:25Z. --- **AMD run: RX 5700 XT** (RDNA1, 32–64 lanes, so the 64-lane cases run instead of being "lowered and validated only"), driver 32.0.21045.29003, Windows 11 26200, Rust 1.98.1. Each tree was merged onto `main` `63bcca4` and run on the native adapter (`VICTORY_WARP` unset), no game files. | Tree | `wave64_section_read_at_lane_63_after_it` | `whole_wave_section_read_at_one_lane_after_it_on_gpu` | `crosslane` | Full suite | Clippy | | --- | --- | --- | --- | --- | --- | | Head `d1158c9` | pass | 1/1 | 7 passed | 305 passed, 0 failed | clean | | Head + @andrewpozdnakov7-jpg's `f9e2015` | pass | 2/2 (adds "an all-lane OR reduction read later by even lanes only") | 7 passed | 305 passed, 0 failed | clean | | `ff81029` (#3401 at `d9ed313` + this PR) | pass | 1/1 | 10 passed | 308 passed, 0 failed | clean | - The lane-63 test **dispatched on 64-lane hardware** in all three trees; it never printed "lowered and validated only". The NVIDIA run above is 32-lane only, so this is the first time it ran rather than only being validated. - DPP16 18/18, DPP8/DPP8FI 5/5 and `ds_swizzle_b32` 6/6 in every tree. "Full suite" is `cargo test -p victory-shader --lib --features host`, 3 ignored in each. AI use: Claude Code (Claude Opus 5.5).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.

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

git switch 'main'
git merge --no-ff 'upstream-pr/3402'
git switch 'upstream-pr/3402'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3402'
git switch 'upstream-pr/3402'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3402'
git switch 'main'
git merge --squash 'upstream-pr/3402'
git switch 'main'
git merge --ff-only 'upstream-pr/3402'
git switch 'main'
git merge 'upstream-pr/3402'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!3402
No description provided.