Shaders: half-local cross-lane operations run for wave64 on 32-lane hosts (FIND-7) #3115

Open
github-bot wants to merge 4 commits from github-bot/gh-3115 into main AGit
Owner

@⁠Creaa on GitHub · 2026-11-26 08:38 UTC · original
Creaa:shaders/wave64-half-local-cross-lane → main · +429 −21 · 15 files · 4 commits · open

Stacked on #2176; only the top commit (be8c887) belongs here. Claimed as FIND-7 in #1633.

On a host of 32-lane waves, #2176 refuses every cross-lane operation that is not quad-local as "a cross-half operation on a 32-lane host". DPP rows (16 lanes), DPP8 (8 lanes), ds_swizzle_b32 in its group-of-32 mode and ds_bpermute_b32 (each 32-lane half on its own, RDNA2 ISA 10.4.4, as the code's own comment says) only read lanes of their own half, which one host wave holds whole. They now run.

What is in it

  • crates/victory-shader/src/emit/lower.rs: cross_lane gets cross_lanes_within(quad, lanes), the size of the group an operation reads in; refused only when the host wave is smaller than that group, quad operations included (their DPP row mask still numbers the wave's rows; found by @⁠fuzeofficlal in review). Swizzle and bpermute pass 32, DPP8 8, DPP rows 16 when the row write mask has the same bits for both halves (0xF, 0x5, 0xA, 0x0), else the wave: the mask numbers the wave's four rows, and a 32-lane host wave sees only rows 0 and 1 of its half. v_readlane/v_writelane/v_mbcnt and other cross-lane paths are unchanged.
  • crates/victory-shader/src/emit/crosslane_tests.rs: half_local_cross_lane_ops_of_wave64_match_rdna2_on_a_wave32_host runs a wave64 program of 64 threads, translated for a 32-lane host, on a hardware device and checks all 64 lanes against RDNA2 for row_ror:4, row_mirror, row_share:3, DPP8, ds_swizzle_b32 SWAP(16) and ds_bpermute_b32, and with only the even lanes active (v_cmpx) for row_ror:4 with fi:0 and ds_bpermute_b32 (inactive sources read 0). The wave32 builder and dispatch were split into shader_of and dispatch_lanes::<N> for it; the existing wave32 tests use them unchanged.
  • crates/victory-shader/src/emit/mod.rs: wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half: row_shr:1 with row masks 0xF and 0x5 emits, 0x1 is refused as cross-half; quad_perm with 0xF emits, with 0x1 is refused.

Tested

  • RTX 4070 12 GB (driver 617.14, 32-lane waves), i7-13700F, 32 GB RAM, Windows 11 build 26300, Rust 1.98.1 (pinned); on #2176's head fb99078.
  • The two new tests pass (8 hardware cases); with lower.rs reverted both fail with "a cross-half operation on a 32-lane host". The existing cross-lane GPU tests (DPP16 18, DPP8 5, swizzle 6 cases) pass.
  • cargo test -q --locked -p victory-shader --lib -- --skip heap_direct_texture_reads_mark_their_heap_index: 302 passed, 3 failed, 3 ignored; #2176 alone: 300 passed, the same 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 hardware failures of #1744). The skipped test kills the process on this card on #2176's base (#2571, fixed on main by #2596/#2587).
  • cargo test --workspace --locked --no-fail-fast: the other crates 565 passed, 2 failed (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views: the capped-heap failures #2461 fixes), 7 ignored.
  • cargo clippy --workspace --all-targets --locked -- -D warnings and with --all-features: clean. cargo xtask policy: 190 files ok.
  • Offline victory translate --list of the title's shader pack with host_wave32 on (a one-line local change to the translate command to pass it, not in this PR): "a cross-half operation on a 32-lane host" 69 -> 51 programs; compute emitted 2291 -> 2309. The 18: the 2D and array mip-chain programs of levels 2-3 (16), a cascade-shadow min/max and a trail-map mip program.
  • A 12-minute run of the title (diag build, the opening cutscene into its first 3D shots) on this card with #2176 + #2461 + #2464 and the three programs of #1968 skipped (VICTORY_SKIP_PIPELINES), with and without this commit: programs refused as cross-half while playing 28 -> 23, no new refusals, no errors and no device removal in either run; frame rate the same (median about 1.3-1.4 fps there).

Not tested

  • AMD and Intel cards (their hosts take wave64, so the path is not used there), WARP's 32-lane mode.
  • The 51 programs still refused cross the halves for real (v_readlane of another half and the like); not changed here.

AI use

  • Claude Code (Claude Opus 5.5) found the cases, wrote the change and the tests, ran the measurements and drafted this description; I checked it.

🤖 Generated with Claude Code

**@⁠Creaa** on GitHub · 2026-11-26 08:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/3115) `Creaa:shaders/wave64-half-local-cross-lane` → `main` · +429 −21 · 15 files · 4 commits · open Stacked on #2176; only the top commit (`be8c887`) belongs here. Claimed as FIND-7 in #1633. On a host of 32-lane waves, #2176 refuses every cross-lane operation that is not quad-local as "a cross-half operation on a 32-lane host". DPP rows (16 lanes), DPP8 (8 lanes), `ds_swizzle_b32` in its group-of-32 mode and `ds_bpermute_b32` (each 32-lane half on its own, RDNA2 ISA 10.4.4, as the code's own comment says) only read lanes of their own half, which one host wave holds whole. They now run. **What is in it** - `crates/victory-shader/src/emit/lower.rs`: `cross_lane` gets `cross_lanes_within(quad, lanes)`, the size of the group an operation reads in; refused only when the host wave is smaller than that group, quad operations included (their DPP row mask still numbers the wave's rows; found by @⁠fuzeofficlal in review). Swizzle and bpermute pass 32, DPP8 8, DPP rows 16 when the row write mask has the same bits for both halves (0xF, 0x5, 0xA, 0x0), else the wave: the mask numbers the wave's four rows, and a 32-lane host wave sees only rows 0 and 1 of its half. `v_readlane`/`v_writelane`/`v_mbcnt` and other cross-lane paths are unchanged. - `crates/victory-shader/src/emit/crosslane_tests.rs`: `half_local_cross_lane_ops_of_wave64_match_rdna2_on_a_wave32_host` runs a wave64 program of 64 threads, translated for a 32-lane host, on a hardware device and checks all 64 lanes against RDNA2 for `row_ror:4`, `row_mirror`, `row_share:3`, DPP8, `ds_swizzle_b32` SWAP(16) and `ds_bpermute_b32`, and with only the even lanes active (`v_cmpx`) for `row_ror:4` with `fi:0` and `ds_bpermute_b32` (inactive sources read 0). The wave32 builder and dispatch were split into `shader_of` and `dispatch_lanes::<N>` for it; the existing wave32 tests use them unchanged. - `crates/victory-shader/src/emit/mod.rs`: `wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half`: `row_shr:1` with row masks 0xF and 0x5 emits, 0x1 is refused as cross-half; `quad_perm` with 0xF emits, with 0x1 is refused. **Tested** - RTX 4070 12 GB (driver 617.14, 32-lane waves), i7-13700F, 32 GB RAM, Windows 11 build 26300, Rust 1.98.1 (pinned); on #2176's head `fb99078`. - The two new tests pass (8 hardware cases); with `lower.rs` reverted both fail with "a cross-half operation on a 32-lane host". The existing cross-lane GPU tests (DPP16 18, DPP8 5, swizzle 6 cases) pass. - `cargo test -q --locked -p victory-shader --lib -- --skip heap_direct_texture_reads_mark_their_heap_index`: 302 passed, 3 failed, 3 ignored; #2176 alone: 300 passed, the same 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 hardware failures of #1744). The skipped test kills the process on this card on #2176's base (#2571, fixed on `main` by #2596/#2587). - `cargo test --workspace --locked --no-fail-fast`: the other crates 565 passed, 2 failed (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`: the capped-heap failures #2461 fixes), 7 ignored. - `cargo clippy --workspace --all-targets --locked -- -D warnings` and with `--all-features`: clean. `cargo xtask policy`: 190 files ok. - Offline `victory translate --list` of the title's shader pack with `host_wave32` on (a one-line local change to the translate command to pass it, not in this PR): "a cross-half operation on a 32-lane host" 69 -> 51 programs; compute emitted 2291 -> 2309. The 18: the 2D and array mip-chain programs of levels 2-3 (16), a cascade-shadow min/max and a trail-map mip program. - A 12-minute run of the title (diag build, the opening cutscene into its first 3D shots) on this card with #2176 + #2461 + #2464 and the three programs of #1968 skipped (`VICTORY_SKIP_PIPELINES`), with and without this commit: programs refused as cross-half while playing 28 -> 23, no new refusals, no errors and no device removal in either run; frame rate the same (median about 1.3-1.4 fps there). **Not tested** - AMD and Intel cards (their hosts take wave64, so the path is not used there), WARP's 32-lane mode. - The 51 programs still refused cross the halves for real (`v_readlane` of another half and the like); not changed here. **AI use** - Claude Code (Claude Opus 5.5) found the cases, wrote the change and the tests, ran the measurements and drafted this description; I checked it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On a host of 32-lane waves (#2176) every cross-lane operation that is not
quad-local was refused as "a cross-half operation", but DPP rows (16 lanes),
DPP8 (8 lanes), ds_swizzle_b32 in its group-of-32 mode and ds_bpermute_b32
(each 32-lane half on its own, RDNA2 ISA 10.4.4) only read lanes of their
own half, which one host wave holds whole (FIND-7 in #1633).

cross_lane now takes how far an operation reaches. A DPP row write mask
numbers the wave's four rows, so a row operation stays in its half only
when the mask has the same bits for both halves (0xF, 0x5, 0xA, 0x0).

Offline `translate --list` of the title's shader pack as a 32-lane host:
"a cross-half operation on a 32-lane host" 69 -> 51 programs; compute
programs emitted 2291 -> 2309 (the 2D and array mip-chain programs of
levels 2-3, a cascade-shadow min/max and a trail-map mip program).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:40:50 +00:00
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 08:51 UTC · original · requested changes

Verified on a 32-lane NVIDIA GPU (RTX 5090, Windows 11):

  • emit::crosslane_tests::half_local_cross_lane_ops_of_wave64_match_rdna2_on_a_wave32_host: all 6 cases (dpp16 row_ror:4, row_mirror, row_share:3, dpp8, ds_swizzle_b32 bitmode SWAP(16), ds_bpermute_b32) passed on hardware.
  • Full emit::crosslane_tests:: (6/6), the three wave32-host refusal tests, and victory-gpu shader_cache:: (4/4) all passed; cargo clippy -p victory-shader -p victory-gpu -p victory --all-targets -- -D warnings (default and --all-features) and cargo xtask policy are clean.

One correctness edge case in crates/victory-shader/src/emit/lower.rs:

Asymmetric row_mask on a DPP quad_perm (ctrl: 0..=0xFF) bypasses the cross-half refusal

In dpp():

let quad = matches!(dpp, Dpp::Row { ctrl: 0..=0xFF, .. });
let reach = match dpp {
    Dpp::Lanes { .. } => 8,
    Dpp::Row { row_mask, .. } if row_mask & 3 == row_mask >> 2 => 16,
    Dpp::Row { .. } => self.wave(),
};
...
self.cross_lanes_within(quad, reach)?;

And in cross_lanes_within():

if !quad && self.host_wave() < lanes.min(self.wave()) {
    return Err("a cross-half operation on a 32-lane host");
}

When a wave64 compute shader uses a DPP quad permutation (ctrl: 0..=0xFF) with an asymmetric row_mask (e.g., row_mask = 0x1 or 0x4), reach is 64, but quad is true, so !quad && skips the cross-half check. On a 32-lane host, lane_index() (waveGetLaneIndex) is 0..31 in both halves, so ri = (lane >> 4) & 3 evaluates to {0, 1} in both halves — silently writing to row 2 (lanes 32-47) under row_mask = 0x1, or disabling writes for all 64 lanes under row_mask = 0x4.

Checking all cross_lanes_within call sites, every truly quad-local op already passes lanes <= 32 (ds_swizzle_b32 passes 32, symmetric Dpp::Row passes 16), so dropping !quad && from the condition (if self.host_wave() < lanes.min(self.wave())) fixes this cleanly without affecting valid quad operations. Adding a quad_perm + row_mask = 0x1 case to wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half would lock it down.

(Optional non-blocking note: all 6 hardware cases in half_local_cross_lane_ops_of_wave64_match_rdna2_on_a_wave32_host run with all 64 lanes active and fi = true. Code inspection confirms src_lane_active / ds_bpermute_b32 work with waveGetLaneIndex() (0..31) + waveActiveBallot lo, and adding one divergent-EXEC / fi = false case would cover that path on 32-lane hardware too.)

**@⁠fuzeofficlal** on GitHub · 2026-11-26 08:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/3115#pullrequestreview-6070997712) · **requested changes** Verified on a 32-lane NVIDIA GPU (RTX 5090, Windows 11): - `emit::crosslane_tests::half_local_cross_lane_ops_of_wave64_match_rdna2_on_a_wave32_host`: all 6 cases (`dpp16 row_ror:4`, `row_mirror`, `row_share:3`, `dpp8`, `ds_swizzle_b32 bitmode SWAP(16)`, `ds_bpermute_b32`) passed on hardware. - Full `emit::crosslane_tests::` (6/6), the three wave32-host refusal tests, and `victory-gpu` `shader_cache::` (4/4) all passed; `cargo clippy -p victory-shader -p victory-gpu -p victory --all-targets -- -D warnings` (default and `--all-features`) and `cargo xtask policy` are clean. One correctness edge case in `crates/victory-shader/src/emit/lower.rs`: ### Asymmetric `row_mask` on a DPP `quad_perm` (`ctrl: 0..=0xFF`) bypasses the cross-half refusal In `dpp()`: ```rust let quad = matches!(dpp, Dpp::Row { ctrl: 0..=0xFF, .. }); let reach = match dpp { Dpp::Lanes { .. } => 8, Dpp::Row { row_mask, .. } if row_mask & 3 == row_mask >> 2 => 16, Dpp::Row { .. } => self.wave(), }; ... self.cross_lanes_within(quad, reach)?; ``` And in `cross_lanes_within()`: ```rust if !quad && self.host_wave() < lanes.min(self.wave()) { return Err("a cross-half operation on a 32-lane host"); } ``` When a wave64 compute shader uses a DPP quad permutation (`ctrl: 0..=0xFF`) with an asymmetric `row_mask` (e.g., `row_mask = 0x1` or `0x4`), `reach` is `64`, **but `quad` is `true`, so `!quad &&` skips the cross-half check**. On a 32-lane host, `lane_index()` (`waveGetLaneIndex`) is `0..31` in both halves, so `ri = (lane >> 4) & 3` evaluates to `{0, 1}` in both halves — silently writing to row 2 (lanes 32-47) under `row_mask = 0x1`, or disabling writes for all 64 lanes under `row_mask = 0x4`. Checking all `cross_lanes_within` call sites, every truly quad-local op already passes `lanes <= 32` (`ds_swizzle_b32` passes `32`, symmetric `Dpp::Row` passes `16`), so dropping `!quad &&` from the condition (`if self.host_wave() < lanes.min(self.wave())`) fixes this cleanly without affecting valid quad operations. Adding a `quad_perm` + `row_mask = 0x1` case to `wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half` would lock it down. *(Optional non-blocking note: all 6 hardware cases in `half_local_cross_lane_ops_of_wave64_match_rdna2_on_a_wave32_host` run with all 64 lanes active and `fi = true`. Code inspection confirms `src_lane_active` / `ds_bpermute_b32` work with `waveGetLaneIndex()` (`0..31`) + `waveActiveBallot` `lo`, and adding one divergent-`EXEC` / `fi = false` case would cover that path on 32-lane hardware too.)*
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 08:51 UTC · original · approved these changes

Verified on RTX 5090 (native wave32 host) & WARP against origin/main (63bcca4):

  • cargo test -p victory-shader --lib emit::crosslane_tests:: -- --test-threads=1: 6/6 passed on RTX 5090 and WARP (including half_local_cross_lane_ops_of_wave64_match_rdna2_on_a_wave32_host).
  • cargo test -p victory-gpu --lib shader_cache:: -- --test-threads=1: 4/4 passed.
  • cargo clippy -p victory-shader -p victory-gpu -p victory --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Great NVIDIA/wave32 win: cleanly enables half-local cross-lane wave64 operations on 32-lane hosts and keys the shader cache accordingly.

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

**@⁠Dukestar69** on GitHub · 2026-11-26 08:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/3115#pullrequestreview-6070998074) · **approved these changes** Verified on RTX 5090 (native wave32 host) & WARP against `origin/main` (`63bcca4`): - `cargo test -p victory-shader --lib emit::crosslane_tests:: -- --test-threads=1`: 6/6 passed on RTX 5090 and WARP (including `half_local_cross_lane_ops_of_wave64_match_rdna2_on_a_wave32_host`). - `cargo test -p victory-gpu --lib shader_cache:: -- --test-threads=1`: 4/4 passed. - `cargo clippy -p victory-shader -p victory-gpu -p victory --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Great NVIDIA/wave32 win: cleanly enables half-local cross-lane wave64 operations on 32-lane hosts and keys the shader cache accordingly. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠Aniseto on GitHub · 2026-11-26 08:58 UTC · original

Ran the half-local cross-lane tests at 6f8cb55:

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, debug build. No dxil.dll on this host, so the test reports validation as skipped; the GPU comparisons still ran.

cargo test --locked -p victory-shader --lib half_local_cross_lane_ops_of_wave64 -- --test-threads=1 --nocapture
1 passed; 0 failed; 0 ignored; 308 filtered out      (exit 0)

The GPU test reports [PASS] for all six forms: DPP16 row_ror:4, row_mirror, row_share:3, DPP8, ds_swizzle_b32 SWAP(16) and ds_bpermute_b32 within the half, with all 64 logical lanes matching RDNA2. The negative test wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half also passes (1/1).

What this adds: the author measured on an RTX 4070 12 GB (Ada). This is a Blackwell wave32 part, exercising exactly the host configuration the PR targets, and the thread has no report from another machine.

Not tested: the full victory-shader suite, DXIL validation (no dxil.dll), a title run, AMD and Intel GPUs, WARP, release profile.

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.

**@⁠Aniseto** on GitHub · 2026-11-26 08:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/3115#issuecomment-7187260991) Ran the half-local cross-lane tests at `6f8cb55`: 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, debug build. No `dxil.dll` on this host, so the test reports validation as skipped; the GPU comparisons still ran. ``` cargo test --locked -p victory-shader --lib half_local_cross_lane_ops_of_wave64 -- --test-threads=1 --nocapture 1 passed; 0 failed; 0 ignored; 308 filtered out (exit 0) ``` The GPU test reports `[PASS]` for all six forms: DPP16 `row_ror:4`, `row_mirror`, `row_share:3`, DPP8, `ds_swizzle_b32` SWAP(16) and `ds_bpermute_b32` within the half, with all 64 logical lanes matching RDNA2. The negative test `wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half` also passes (1/1). What this adds: the author measured on an RTX 4070 12 GB (Ada). This is a Blackwell wave32 part, exercising exactly the host configuration the PR targets, and the thread has no report from another machine. Not tested: the full `victory-shader` suite, DXIL validation (no `dxil.dll`), a title run, AMD and Intel GPUs, WARP, release profile. 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.
github-bot force-pushed github-bot/gh-3115 from 6f8cb55d0d to be8c887c50 2026-11-26 11:09:49 +00:00 Compare
Author
Owner

@⁠Creaa on GitHub · 2026-11-26 09:07 UTC · original

@⁠fuzeofficlal thanks, right: a quad_perm with a row mask naming one half skipped the check, since the condition only applied to non-quad operations. Fixed in be8c887 (squashed into the PR's commit) as you suggested: cross_lanes_within now refuses whenever the host wave is smaller than the reach the caller gives, quad operations included; every quad-local caller passes 32 or less, so valid quad operations are unaffected.

  • wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half now also checks quad_perm with row masks 0xF (emits) and 0x1 (refused); with the old condition the 0x1 case emits and the test fails.
  • I also took the optional note: two hardware cases with only the even lanes active (v_cmpx), row_ror:4 with fi:0 and ds_bpermute_b32 (odd, inactive sources read 0). All 8 cases pass on an RTX 4070.
  • victory-shader lib: 302 passed, the same 3 hardware failures as #2176 alone; clippy (default and --all-features) clean; policy ok. The offline count is unchanged (51 programs still refused as cross-half).

AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and drafted this reply.

**@⁠Creaa** on GitHub · 2026-11-26 09:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/3115#issuecomment-7187447337) @⁠fuzeofficlal thanks, right: a `quad_perm` with a row mask naming one half skipped the check, since the condition only applied to non-quad operations. Fixed in `be8c887` (squashed into the PR's commit) as you suggested: `cross_lanes_within` now refuses whenever the host wave is smaller than the reach the caller gives, quad operations included; every quad-local caller passes 32 or less, so valid quad operations are unaffected. - `wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half` now also checks `quad_perm` with row masks 0xF (emits) and 0x1 (refused); with the old condition the 0x1 case emits and the test fails. - I also took the optional note: two hardware cases with only the even lanes active (`v_cmpx`), `row_ror:4` with `fi:0` and `ds_bpermute_b32` (odd, inactive sources read 0). All 8 cases pass on an RTX 4070. - `victory-shader` lib: 302 passed, the same 3 hardware failures as #2176 alone; clippy (default and `--all-features`) clean; policy ok. The offline count is unchanged (51 programs still refused as cross-half). AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and drafted this reply.
Author
Owner

@⁠Aniseto on GitHub · 2026-11-26 09:13 UTC · original

Re-ran the half-local cross-lane tests at be8c887 after the head moved (66 lines added to the cross-lane test, plus changes in lower.rs and emit/mod.rs).

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), MSVC 14.44.35207, debug build. No dxil.dll here, so validation is skipped; the GPU comparisons ran.

cargo test --locked -p victory-shader --lib half_local_cross_lane_ops_of_wave64 -- --test-threads=1 --nocapture
1 passed; 0 failed; 0 ignored; 308 filtered out      (exit 0)

The test now reports eight [PASS] cases: DPP16 row_ror:4, row_mirror, row_share:3, DPP8, ds_swizzle_b32 SWAP(16), ds_bpermute_b32 within the half, plus the new dpp16 row_ror:4 fi:0, even lanes active and ds_bpermute_b32 lane + 1, even lanes active (odd sources read 0). The negative test wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half also passes (1/1). This is a new report following mine at 6f8cb55, not an edit.

Not tested: the full victory-shader suite, DXIL validation, a title run, AMD and Intel GPUs, WARP, release profile.

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.

**@⁠Aniseto** on GitHub · 2026-11-26 09:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/3115#issuecomment-7187617048) Re-ran the half-local cross-lane tests at `be8c887` after the head moved (66 lines added to the cross-lane test, plus changes in `lower.rs` and `emit/mod.rs`). 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), MSVC 14.44.35207, debug build. No `dxil.dll` here, so validation is skipped; the GPU comparisons ran. ``` cargo test --locked -p victory-shader --lib half_local_cross_lane_ops_of_wave64 -- --test-threads=1 --nocapture 1 passed; 0 failed; 0 ignored; 308 filtered out (exit 0) ``` The test now reports eight `[PASS]` cases: DPP16 `row_ror:4`, `row_mirror`, `row_share:3`, DPP8, `ds_swizzle_b32` SWAP(16), `ds_bpermute_b32` within the half, plus the new `dpp16 row_ror:4 fi:0, even lanes active` and `ds_bpermute_b32 lane + 1, even lanes active (odd sources read 0)`. The negative test `wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half` also passes (1/1). This is a new report following mine at `6f8cb55`, not an edit. Not tested: the full `victory-shader` suite, DXIL validation, a title run, AMD and Intel GPUs, WARP, release profile. 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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 09:18 UTC · original

Automated triage for the maintainers.

Needs work: stacked on #2176. The top commit be8c887 looks right. Lower::cross_lanes_within (crates/victory-shader/src/emit/lower.rs) gives each operation the size of the group it reads: 32 for ds_swizzle_b32/ds_bpermute_b32, 8 for DPP8, 16 for DPP rows. None of the accepted DPP row controls (0x101–0x12F, 0x140/0x141, 0x150–0x16F) or swizzle modes reaches outside its row or 32-lane half. Refusing row masks that differ between the halves is the right conservative choice, and wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half covers it. The blocker is that the branch also carries #2176's three commits (host_wave32, emit::Options, the shader_cache and host changes), and none of them is in main. Once #2176 lands, please rebase so that only this commit's changes to lower.rs, crosslane_tests.rs and emit/mod.rs remain. It can be reconsidered then.

CI: check passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 09:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/3115#issuecomment-7187771888) <!-- victory-triage v1 head=be8c887c503d33f844024bb21c5baa1443005716 verdict=needs-work at=2026-11-26T09:19:00Z --> Automated triage for the maintainers. **Needs work: stacked on #2176.** The top commit `be8c887` looks right. `Lower::cross_lanes_within` (`crates/victory-shader/src/emit/lower.rs`) gives each operation the size of the group it reads: 32 for `ds_swizzle_b32`/`ds_bpermute_b32`, 8 for DPP8, 16 for DPP rows. None of the accepted DPP row controls (0x101–0x12F, 0x140/0x141, 0x150–0x16F) or swizzle modes reaches outside its row or 32-lane half. Refusing row masks that differ between the halves is the right conservative choice, and `wave64_dpp_row_is_refused_on_wave32_host_only_with_a_mask_naming_one_half` covers it. The blocker is that the branch also carries #2176's three commits (`host_wave32`, `emit::Options`, the shader_cache and host changes), and none of them is in `main`. Once #2176 lands, please rebase so that only this commit's changes to `lower.rs`, `crosslane_tests.rs` and `emit/mod.rs` remain. It can be reconsidered then. CI: `check` passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 09:39 UTC · original · approved these changes

Re-reviewed at be8c887c. Dropping !quad && in cross_lanes_within (crates/victory-shader/src/emit/lower.rs:2935) cleanly closes the asymmetric row_mask bypass for quad_perm while keeping symmetric quad_perm (row_mask = 0xF / 0x5 / 0xA, reach = 16) and ds_swizzle_b32 (lanes = 32) accepted — verified all cross_lane / cross_lanes_within call sites in lower.rs. The new quad_perm refusal checks in emit/mod.rs and the two active-mask (even lanes active) wave64-on-wave32 GPU tests in crosslane_tests.rs are great additions.

Verified locally on Windows 11 with a 32-lane RTX 5090 and WARP:

  • cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: clean
  • cargo xtask policy: 190 files ok
  • RTX 5090 (32-lane): cargo test -p victory-shader --lib -- crosslane_tests:: wave64 — 14/14 passed (all 8 wave64-on-wave32 subtests including the new even lanes active cases, plus 18 DPP16, 5 DPP8, and 6 ds_swizzle_b32 GPU checks)
  • WARP (VICTORY_D3D12_WARP=1): cargo test -p victory-shader --lib -- crosslane_tests:: wave64 — 14/14 passed
  • RTX 5090 victory-gpu: shader_cache:: 4/4 passed, host::tests:: 12/12 passed

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 09:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/3115#pullrequestreview-6071705341) · **approved these changes** Re-reviewed at `be8c887c`. Dropping `!quad &&` in `cross_lanes_within` (`crates/victory-shader/src/emit/lower.rs:2935`) cleanly closes the asymmetric `row_mask` bypass for `quad_perm` while keeping symmetric `quad_perm` (`row_mask = 0xF / 0x5 / 0xA`, `reach = 16`) and `ds_swizzle_b32` (`lanes = 32`) accepted — verified all `cross_lane` / `cross_lanes_within` call sites in `lower.rs`. The new `quad_perm` refusal checks in `emit/mod.rs` and the two active-mask (`even lanes active`) wave64-on-wave32 GPU tests in `crosslane_tests.rs` are great additions. Verified locally on Windows 11 with a 32-lane RTX 5090 and WARP: - `cargo clippy --workspace --all-targets -- -D warnings`: clean - `cargo clippy --workspace --all-targets --all-features -- -D warnings`: clean - `cargo xtask policy`: `190 files ok` - RTX 5090 (32-lane): `cargo test -p victory-shader --lib -- crosslane_tests:: wave64` — 14/14 passed (all 8 wave64-on-wave32 subtests including the new `even lanes active` cases, plus 18 DPP16, 5 DPP8, and 6 `ds_swizzle_b32` GPU checks) - WARP (`VICTORY_D3D12_WARP=1`): `cargo test -p victory-shader --lib -- crosslane_tests:: wave64` — 14/14 passed - RTX 5090 `victory-gpu`: `shader_cache::` 4/4 passed, `host::tests::` 12/12 passed LGTM.
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/3115/head:github-bot/gh-3115'
git switch 'github-bot/gh-3115'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3115'
git switch 'github-bot/gh-3115'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3115'
git switch 'github-bot/gh-3115'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3115'
git switch 'main'
git merge --squash 'github-bot/gh-3115'
git switch 'main'
git merge --ff-only 'github-bot/gh-3115'
git switch 'main'
git merge 'github-bot/gh-3115'
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!3115
No description provided.