shader: omit WaveSize(64) for wave-invariant ds_swizzle and 32-lane DPP ops #3421

Open
danielibabet wants to merge 4 commits from upstream-pr/3421 into main
danielibabet commented 2026-11-27 00:20:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by danielibabet on 2026-11-27T00:20:30Z.


\ds_swizzle_b32\ (4-lane quad and 32-lane group modes) and intra-32-lane GFX10 DPP modifiers (everything except \wave_shl1, \wave_rol1, \wave_shr1, \wave_ror1, and
ow_bcast31) produce identical lane indices on Wave32 and Wave64 without relabelling \ hread_id.

Keep \console_lanes = false\ and omit \WaveSize(64)\ when a Wave64 compute shader only uses those wave-invariant cross-lane ops, allowing Wave32-only GPUs (NVIDIA) to compile and run them without \WaveSize(64)\ rejections.

Verified:

  • \cargo test -p victory-shader -j 16 wave64_d -- --test-threads=1\ (3 passed, 0 failed)
  • \cargo clippy -p victory-shader -j 16 --all-targets -- -D warnings\
  • \cargo xtask policy\ (191 files ok)
<!-- greyfinch-sync:Marvisak/VIctory:issue:5519028295 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421). Originally posted by [danielibabet](https://github.com/danielibabet) on 2026-11-27T00:20:30Z. --- \ds_swizzle_b32\ (4-lane quad and 32-lane group modes) and intra-32-lane GFX10 DPP modifiers (everything except \wave_shl1\, \wave_rol1\, \wave_shr1\, \wave_ror1\, and \ ow_bcast31\) produce identical lane indices on Wave32 and Wave64 without relabelling \ hread_id\. Keep \console_lanes = false\ and omit \WaveSize(64)\ when a Wave64 compute shader only uses those wave-invariant cross-lane ops, allowing Wave32-only GPUs (NVIDIA) to compile and run them without \WaveSize(64)\ rejections. Verified: - \cargo test -p victory-shader -j 16 wave64_d -- --test-threads=1\ (3 passed, 0 failed) - \cargo clippy -p victory-shader -j 16 --all-targets -- -D warnings\ - \cargo xtask policy\ (191 files ok)
Dukestar69 commented 2026-11-27 00:27:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-27T00:27:08Z.

Review: APPROVED


LGTM — verified on Windows against origin/main (63bcca4).

  • Omitting WaveSize(64) when ds_swizzle and 32-lane DPP ops are wave-invariant lets those shaders run on 32-lane hosts (like NVIDIA RTX) without losing correctness.
  • cargo test -p victory-shader --lib emit::lower::tests:: -- --test-threads=1: all passed.
  • 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:6081956491 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#pullrequestreview-6081956491). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-27T00:27:08Z. **Review:** APPROVED --- LGTM — verified on Windows against `origin/main` (`63bcca4`). - Omitting `WaveSize(64)` when `ds_swizzle` and 32-lane DPP ops are wave-invariant lets those shaders run on 32-lane hosts (like NVIDIA RTX) without losing correctness. - `cargo test -p victory-shader --lib emit::lower::tests:: -- --test-threads=1`: all passed. - `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).
andrewpozdnakov7-jpg commented 2026-11-27 00:45:13 +00:00 (Migrated from github.com)

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


I tested the Wave64 row-mirror operation from exact head 42cc668 in a synthetic 64-thread compute shader and checked all 64 GPU outputs with WARP 1.0.22. Three fresh processes gave the same result.

Destination row mask PR's default width Forced 32 Forced 64
0xC (upper rows) 32/64 32/64 64/64
0x5 (repeating) 32/64 64/64 64/64

The upper-row result depends on wave-wide destination numbering. The repeating-mask case works at 32 but still fails with the attribute omitted, so the default-width check needs a real dispatch. The forced-width controls changed the test shader's attribute only.

The conservative candidate omits the attribute for quad-local swizzles and unmasked quad DPP. It keeps a fixed width for row, bank-masked, broader swizzle and other cross-quad operations. Both row-mask fixtures and the unmasked quad control reached 64/64 in each of three WARP processes. The 13 related tests, lowering checks, strict clippy in both configurations and asset policy passed.

@danielibabet can you check the quad-local path on the RTX 4070? The forced-32 control is also a way to check any wider policy for repeating masks. Please retain the Git author when picking the commit or add Co-authored-by: andrewpozdnakov7-jpg if folding it.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7206723471 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#issuecomment-7206723471). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T00:45:13Z. --- I tested the Wave64 row-mirror operation from exact head `42cc668` in a synthetic 64-thread compute shader and checked all 64 GPU outputs with WARP 1.0.22. Three fresh processes gave the same result. | Destination row mask | PR's default width | Forced 32 | Forced 64 | | --- | ---: | ---: | ---: | | `0xC` (upper rows) | 32/64 | 32/64 | 64/64 | | `0x5` (repeating) | 32/64 | 64/64 | 64/64 | The upper-row result depends on wave-wide destination numbering. The repeating-mask case works at 32 but still fails with the attribute omitted, so the default-width check needs a real dispatch. The forced-width controls changed the test shader's attribute only. The [conservative candidate](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/2bed12e84ce5a33a983707e4d248b7ef8648a926) omits the attribute for quad-local swizzles and unmasked quad DPP. It keeps a fixed width for row, bank-masked, broader swizzle and other cross-quad operations. Both row-mask fixtures and the unmasked quad control reached 64/64 in each of three WARP processes. The 13 related tests, lowering checks, strict clippy in both configurations and asset policy passed. @danielibabet can you check the quad-local path on the RTX 4070? The forced-32 control is also a way to check any wider policy for repeating masks. Please retain the Git author when picking the commit or add `Co-authored-by: andrewpozdnakov7-jpg` if folding it.
danielibabet commented 2026-11-27 00:47:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by danielibabet on 2026-11-27T00:47:56Z.


@andrewpozdnakov7-jpg Great catch — thank you for testing the
ow_mask/\ank_mask\ edge cases on WARP! I've fast-forwarded \pr/wave-invariant-swizzle-dpp\ to your conservative commit \2bed12e\ (retaining your Git authorship) so only quad-local swizzles and unmasked quad DPP omit \WaveSize(64).

Verified on RTX 4070 (Windows 11):

  • \cargo test -p victory-shader --features host -j 16 wave64_dpp_row_mask_preserves_both_halves_on_warp -- --test-threads=1: 1 passed, 0 failed
  • Lowering unit tests (\wave64_dpp_omits_wave_size_only_for_unmasked_quad_ops, \wave64_dpp_wave_shl1_keeps_wave_size_64, \wave64_ds_swizzle_across_quad_keeps_wave_size, \wave64_ds_swizzle_with_thread_id_omits_wave_size): all passed
  • \cargo clippy -p victory-shader -j 16 --all-targets -- -D warnings\ (default & --features host): clean
  • \cargo xtask policy: 191 files ok
<!-- greyfinch-sync:Marvisak/VIctory:comment:7206761227 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#issuecomment-7206761227). Originally posted by [danielibabet](https://github.com/danielibabet) on 2026-11-27T00:47:56Z. --- @andrewpozdnakov7-jpg Great catch — thank you for testing the \ ow_mask\/\ank_mask\ edge cases on WARP! I've fast-forwarded \pr/wave-invariant-swizzle-dpp\ to your conservative commit \2bed12e\ (retaining your Git authorship) so only quad-local swizzles and unmasked quad DPP omit \WaveSize(64)\. Verified on RTX 4070 (Windows 11): - \cargo test -p victory-shader --features host -j 16 wave64_dpp_row_mask_preserves_both_halves_on_warp -- --test-threads=1\: 1 passed, 0 failed - Lowering unit tests (\wave64_dpp_omits_wave_size_only_for_unmasked_quad_ops\, \wave64_dpp_wave_shl1_keeps_wave_size_64\, \wave64_ds_swizzle_across_quad_keeps_wave_size\, \wave64_ds_swizzle_with_thread_id_omits_wave_size\): all passed - \cargo clippy -p victory-shader -j 16 --all-targets -- -D warnings\ (default & \--features host\): clean - \cargo xtask policy\: 191 files ok
andrewpozdnakov7-jpg commented 2026-11-27 00:56:53 +00:00 (Migrated from github.com)

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


Thanks for taking 2bed12e. The row-mask test in the report explicitly selects WARP. I added a test-only follow-up that also probes the native adapter when VICTORY_WARP is unset or 0. It dispatches the three relaxed paths, unmasked quad DPP, quad swizzle, and bit-mode swizzle within a quad. Each must return all 64 expected words.

WARP passed all three vectors in three fresh processes. My native adapter could not create the SM 6.6 device, so that part was skipped. The seven cross-lane tests, strict clippy in both configurations, and asset policy passed. On the 4070, cargo test -p victory-shader --lib wave64_quad_swizzle_and_dpp_run_on_supported_adapters -- --nocapture --test-threads=1 should identify the native adapter and show all three results. If you pick up the test, please retain the Git author or add Co-authored-by: andrewpozdnakov7-jpg.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7206883946 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#issuecomment-7206883946). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T00:56:53Z. --- Thanks for taking `2bed12e`. The row-mask test in the report explicitly selects WARP. I added a [test-only follow-up](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/2dc86b8bb0bb59e69acd065e2d99a8a2d36adc9e) that also probes the native adapter when `VICTORY_WARP` is unset or 0. It dispatches the three relaxed paths, unmasked quad DPP, quad swizzle, and bit-mode swizzle within a quad. Each must return all 64 expected words. WARP passed all three vectors in three fresh processes. My native adapter could not create the SM 6.6 device, so that part was skipped. The seven cross-lane tests, strict clippy in both configurations, and asset policy passed. On the 4070, `cargo test -p victory-shader --lib wave64_quad_swizzle_and_dpp_run_on_supported_adapters -- --nocapture --test-threads=1` should identify the native adapter and show all three results. If you pick up the test, please retain the Git author or add `Co-authored-by: andrewpozdnakov7-jpg`.
fuzeofficlal commented 2026-11-27 01:11:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T01:11:03Z.

Review: CHANGES_REQUESTED


Good direction on dropping WaveSize(64) for genuinely quad-local cross-lane ops, and crosslane_tests (6/6 on RTX 5090 and WARP) + wave64_* unit tests (4/4) pass. However, probing additional compute cases on RTX 5090 and WARP turned up several correctness issues that block merging as-is:

  1. 2D/3D compute thread groups break quad lane pairing when WaveSize and lane relabeling are omitted (lower.rs:584, :2946)

    • Under SM 6.6, compute quad lanes for a [8, 2, 1] workgroup follow 2D quad tiling rather than flat linear thread_id.x, so omitting console_lanes causes lane ^ 2 to read thread 8 instead of thread 2 (reproduced 16/16 wrong outputs for both QDMode ds_swizzle and DPP quad_perm on RTX 5090 and WARP). Either restrict this relaxation to 1D groups (cs.threads[1] == 1 && cs.threads[2] == 1) or preserve lane relabeling.
  2. v_readfirstlane_b32 is missing from the console_lanes scan (lower.rs:591, :6719)

    • Previously, a ds_swizzle_b32 / dpp instruction kept WaveSize(64) via console_lanes when paired with a non-waterfall v_readfirstlane_b32. Now a 64-thread shader combining a quad swizzle/DPP with v_readfirstlane_b32 drops WaveSize(64), producing divergent values across the upper 32 lanes on RTX 5090 and 60/64 lanes on 4-lane WARP.
  3. quad_swizzle (lower.rs:414-417) treats RDNA2 Rotate (0xC000..=0xDFFF) and FFT (0xE000..=0xFFFF) encodings as QDMode

    • Checking offset & 0x8000 != 0 instead of offset & 0xC000 == 0x8000 omits WaveSize(64) for Rotate/FFT ds_swizzle_b32 modes (matching the existing offset & 0x8000 != 0 check at lower.rs:3235). On both RTX 5090 and 4-lane WARP, 0xC020 (rotate) produced 64/64 wrong outputs, 0xE000 (FFT) 60/64 wrong outputs, and 0xE01F (FFT identity) 64/64 wrong outputs. (Note: the bitmask check offset & 0x1C == 0x1C && offset & 0x380 == 0 && offset >> 10 & 0x1F < 4 is exact across all 32,768 encodings.)
  4. fi = 1 on quad_perm DPP (lower.rs:402, :5955)

    • wave_invariant_dpp allows fi = true, where lower.rs:5955 skips src_lane_active; under a real divergent branch, WaveReadLaneAt on an inactive source lane is undefined and yielded 0 in 8/32 lanes on RTX 5090 instead of preserving the old VGPR value.
  5. Formatting & lower.rs file size (524,256 / 524,288 B)

    • rustfmt --edition 2024 --check fails at lower.rs:412 (quad_swizzle) and crosslane_tests.rs:1085 (:1088), and lower.rs is only 32 bytes below the 512 KiB policy limit.
<!-- greyfinch-sync:Marvisak/VIctory:review:6082188044 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#pullrequestreview-6082188044). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-27T01:11:03Z. **Review:** CHANGES_REQUESTED --- Good direction on dropping `WaveSize(64)` for genuinely quad-local cross-lane ops, and `crosslane_tests` (6/6 on RTX 5090 and WARP) + `wave64_*` unit tests (4/4) pass. However, probing additional compute cases on RTX 5090 and WARP turned up several correctness issues that block merging as-is: 1. **2D/3D compute thread groups break quad lane pairing when `WaveSize` and lane relabeling are omitted (`lower.rs:584`, `:2946`)** - Under SM 6.6, compute quad lanes for a `[8, 2, 1]` workgroup follow 2D quad tiling rather than flat linear `thread_id.x`, so omitting `console_lanes` causes `lane ^ 2` to read thread `8` instead of thread `2` (reproduced 16/16 wrong outputs for both QDMode `ds_swizzle` and DPP `quad_perm` on RTX 5090 and WARP). Either restrict this relaxation to 1D groups (`cs.threads[1] == 1 && cs.threads[2] == 1`) or preserve lane relabeling. 2. **`v_readfirstlane_b32` is missing from the `console_lanes` scan (`lower.rs:591`, `:6719`)** - Previously, a `ds_swizzle_b32` / `dpp` instruction kept `WaveSize(64)` via `console_lanes` when paired with a non-waterfall `v_readfirstlane_b32`. Now a 64-thread shader combining a quad swizzle/DPP with `v_readfirstlane_b32` drops `WaveSize(64)`, producing divergent values across the upper 32 lanes on RTX 5090 and 60/64 lanes on 4-lane WARP. 3. **`quad_swizzle` (`lower.rs:414-417`) treats RDNA2 Rotate (`0xC000..=0xDFFF`) and FFT (`0xE000..=0xFFFF`) encodings as QDMode** - Checking `offset & 0x8000 != 0` instead of `offset & 0xC000 == 0x8000` omits `WaveSize(64)` for Rotate/FFT `ds_swizzle_b32` modes (matching the existing `offset & 0x8000 != 0` check at `lower.rs:3235`). On both RTX 5090 and 4-lane WARP, `0xC020` (rotate) produced 64/64 wrong outputs, `0xE000` (FFT) 60/64 wrong outputs, and `0xE01F` (FFT identity) 64/64 wrong outputs. (Note: the bitmask check `offset & 0x1C == 0x1C && offset & 0x380 == 0 && offset >> 10 & 0x1F < 4` is exact across all 32,768 encodings.) 4. **`fi = 1` on `quad_perm` DPP (`lower.rs:402`, `:5955`)** - `wave_invariant_dpp` allows `fi = true`, where `lower.rs:5955` skips `src_lane_active`; under a real divergent branch, `WaveReadLaneAt` on an inactive source lane is undefined and yielded `0` in 8/32 lanes on RTX 5090 instead of preserving the old VGPR value. 5. **Formatting & `lower.rs` file size (`524,256` / `524,288` B)** - `rustfmt --edition 2024 --check` fails at `lower.rs:412` (`quad_swizzle`) and `crosslane_tests.rs:1085` (`:1088`), and `lower.rs` is only 32 bytes below the 512 KiB policy limit.
andrewpozdnakov7-jpg commented 2026-11-27 06:56:49 +00:00 (Migrated from github.com)

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


@danielibabet I put a follow-up directly on 2bed12e in c2698c3. The relaxation is now limited to 1D quad operations without a whole-wave first-lane dependency or DPP fetch-inactive. Compute quad FI still ignores guest EXEC, and now checks that the source is physically live before issuing a host wave read. Rotate and FFT swizzles with a live result are reported as unsupported instead of being lowered as quad swizzles.

On the original head, the first-lane case disagreed in 60/64 words and branch FI overwrote 16 destinations. With the patch both tests passed on app-local WARP. Nine lowering tests passed, including the 2D/3D fixed-wave guards and the Rotate/FFT cases. Both strict shader Clippy builds passed. The nested DPP16 case also fails on the original head in the WARP comparison.

The [8,2,1] runtime probe still did not give the expected results on my WARP configuration with fixed-wave lowering. Please retest multidimensional readback on an adapter supporting the fixed wave. The portable test here verifies retention of the original lane policy for those shaders.

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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7211994752 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#issuecomment-7211994752). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T06:56:49Z. --- @danielibabet I put a follow-up directly on `2bed12e` in [c2698c3](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/c2698c35e7aa68c5aa7a3fe6eca4af0bd96a2b65). The relaxation is now limited to 1D quad operations without a whole-wave first-lane dependency or DPP fetch-inactive. Compute quad FI still ignores guest EXEC, and now checks that the source is physically live before issuing a host wave read. Rotate and FFT swizzles with a live result are reported as unsupported instead of being lowered as quad swizzles. On the original head, the first-lane case disagreed in 60/64 words and branch FI overwrote 16 destinations. With the patch both tests passed on app-local WARP. Nine lowering tests passed, including the 2D/3D fixed-wave guards and the Rotate/FFT cases. Both strict shader Clippy builds passed. The nested DPP16 case also fails on the original head in the WARP comparison. The `[8,2,1]` runtime probe still did not give the expected results on my WARP configuration with fixed-wave lowering. Please retest multidimensional readback on an adapter supporting the fixed wave. The portable test here verifies retention of the original lane policy for those shaders. 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.
danielibabet commented 2026-11-27 08:30:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by danielibabet on 2026-11-27T08:30:03Z.


@andrewpozdnakov7-jpg Thanks for tightening this in \c2698c3! I've fast-forwarded \pr/wave-invariant-swizzle-dpp\ to \c2698c3\ (retaining your Git authorship).

Verified on Windows 11 / RTX 4070:

  • \wave_tests\ (4/4): \wave64_ds_swizzle_across_quad_keeps_wave_size, \wave64_dpp_wave_shl1_keeps_wave_size_64, \wave64_ds_swizzle_with_thread_id_omits_wave_size, \wave64_dpp_omits_wave_size_only_for_unmasked_quad_ops\ passed
  • \cargo test -p victory-shader --features host -j 16 --lib -- wave64_dpp_row_mask_preserves_both_halves_on_warp: 1 passed, 0 failed
  • \cargo clippy -p victory-shader -j 16 --all-targets -- -D warnings\ (default & --features host): clean
  • \cargo xtask policy: 192 files ok
<!-- greyfinch-sync:Marvisak/VIctory:comment:7213603629 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#issuecomment-7213603629). Originally posted by [danielibabet](https://github.com/danielibabet) on 2026-11-27T08:30:03Z. --- @andrewpozdnakov7-jpg Thanks for tightening this in \c2698c3\! I've fast-forwarded \pr/wave-invariant-swizzle-dpp\ to \c2698c3\ (retaining your Git authorship). Verified on Windows 11 / RTX 4070: - \wave_tests\ (4/4): \wave64_ds_swizzle_across_quad_keeps_wave_size\, \wave64_dpp_wave_shl1_keeps_wave_size_64\, \wave64_ds_swizzle_with_thread_id_omits_wave_size\, \wave64_dpp_omits_wave_size_only_for_unmasked_quad_ops\ passed - \cargo test -p victory-shader --features host -j 16 --lib -- wave64_dpp_row_mask_preserves_both_halves_on_warp\: 1 passed, 0 failed - \cargo clippy -p victory-shader -j 16 --all-targets -- -D warnings\ (default & \--features host\): clean - \cargo xtask policy\: 192 files ok
kalberts0089-hash commented 2026-11-27 09:09:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kalberts0089-hash on 2026-11-27T09:09:30Z.


NVIDIA test report: RTX 4070 Ti (desktop, driver 621.01), Windows 11 Pro, rustc 1.98.1. Head c2698c3 (base main 63bcca4), with the test-only follow-up 2dc86b8 applied on top locally (cherry-picked without committing; it applies cleanly), run on the native adapter (VICTORY_WARP unset).

  • cargo test -p victory-shader --lib wave64_quad_swizzle_and_dpp_run_on_supported_adapters -- --exact --nocapture --test-threads=1: passed 3/3. The native adapter reports NVIDIA GeForce RTX 4070 Ti | SM=0x68 | Wave=32-32; Wave64 guest DPP, DS quad and DS bit each matched all 64 outputs, and WARP matched all 64 too. So the quad-local paths c2698c3 still relaxes run correctly on a 32-lane card with WaveSize(64) omitted.
  • cargo test -p victory-shader --lib --no-fail-fast, skipping heap_direct_texture_reads_mark_their_heap_index (crashes on NVIDIA, #2571): 311 passed, 3 failed, 3 ignored (main: 298 / 3 / 3). All 13 new tests pass (the 9 lower::wave_tests, the 2 new crosslane tests, the row-mask test and the follow-up's test). The 3 failures are the known NVIDIA ones (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), with the same messages as on main; unrelated to this PR.
  • The review points against this run:
    • fetch-inactive (fi = 1) quad DPP: exercised on the hardware. dpp_quad_fi_preserves_the_destination_when_a_host_lane_is_absent runs on the 4070 Ti and passes.
    • 2D/3D groups, whole-wave v_readfirstlane_b32, Rotate/FFT swizzles: the code now keeps the fixed wave size for each (and refuses a live Rotate/FFT swizzle), and the new lowering tests for them pass, but nothing here checks them at runtime. wave64_first_lane_with_quad_swizzle_is_uniform_on_warp skips on this machine ("WARP has no 64-lane waves"), and there's no [8, 2, 1] readback in the PR.
    • Formatting and size: lower.rs is now 522,447 B, and the PR adds no new rustfmt diffs there. crosslane_tests.rs:1085 still fails rustfmt --edition 2024 --check at c2698c3; 2dc86b8 happens to rewrite those lines.
  • Not tested: a multidimensional-group readback on hardware, and title shaders using these ops (needs the game).

Synthetic tests only, no game files. AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7214346999 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#issuecomment-7214346999). Originally posted by [kalberts0089-hash](https://github.com/kalberts0089-hash) on 2026-11-27T09:09:30Z. --- NVIDIA test report: RTX 4070 Ti (desktop, driver 621.01), Windows 11 Pro, rustc 1.98.1. Head `c2698c3` (base main `63bcca4`), **with the test-only follow-up `2dc86b8` applied on top locally (cherry-picked without committing; it applies cleanly)**, run on the native adapter (`VICTORY_WARP` unset). - `cargo test -p victory-shader --lib wave64_quad_swizzle_and_dpp_run_on_supported_adapters -- --exact --nocapture --test-threads=1`: passed 3/3. The native adapter reports `NVIDIA GeForce RTX 4070 Ti | SM=0x68 | Wave=32-32`; Wave64 guest DPP, DS quad and DS bit each matched all 64 outputs, and WARP matched all 64 too. So the quad-local paths `c2698c3` still relaxes run correctly on a 32-lane card with `WaveSize(64)` omitted. - `cargo test -p victory-shader --lib --no-fail-fast`, skipping `heap_direct_texture_reads_mark_their_heap_index` (crashes on NVIDIA, #2571): 311 passed, 3 failed, 3 ignored (main: 298 / 3 / 3). All 13 new tests pass (the 9 `lower::wave_tests`, the 2 new crosslane tests, the row-mask test and the follow-up's test). The 3 failures are the known NVIDIA ones (`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`), with the same messages as on main; unrelated to this PR. - The review points against this run: - fetch-inactive (`fi = 1`) quad DPP: exercised on the hardware. `dpp_quad_fi_preserves_the_destination_when_a_host_lane_is_absent` runs on the 4070 Ti and passes. - 2D/3D groups, whole-wave `v_readfirstlane_b32`, Rotate/FFT swizzles: the code now keeps the fixed wave size for each (and refuses a live Rotate/FFT swizzle), and the new lowering tests for them pass, but nothing here checks them at runtime. `wave64_first_lane_with_quad_swizzle_is_uniform_on_warp` skips on this machine ("WARP has no 64-lane waves"), and there's no `[8, 2, 1]` readback in the PR. - Formatting and size: `lower.rs` is now 522,447 B, and the PR adds no new rustfmt diffs there. `crosslane_tests.rs:1085` still fails `rustfmt --edition 2024 --check` at `c2698c3`; `2dc86b8` happens to rewrite those lines. - Not tested: a multidimensional-group readback on hardware, and title shaders using these ops (needs the game). Synthetic tests only, no game files. AI-assisted (Claude Code).
andrewpozdnakov7-jpg commented 2026-11-27 09:20:54 +00:00 (Migrated from github.com)

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


Thanks @kalberts0089-hash. Your RTX 4070 Ti readbacks confirm all 64 outputs for each of the three relaxed quad paths. @danielibabet I put that same test-only change directly on the current c2698c3 head in 3bb15a3.

The nine cross-lane tests passed locally with WARP 1.0.22. Each relaxed path matched 64/64. This WARP setup also ran the fixed-wave quad-plus-first-lane test and matched all 64 outputs. The fixed-wave multidimensional case still needs a runtime readback. Strict all-features shader Clippy and the asset policy check passed.

Please keep Git authorship if taking the test. If you fold it into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

AI-assisted with Codex. Synthetic shaders only.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7214572970 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#issuecomment-7214572970). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T09:20:54Z. --- Thanks @kalberts0089-hash. Your RTX 4070 Ti readbacks confirm all 64 outputs for each of the three relaxed quad paths. @danielibabet I put that same test-only change directly on the current `c2698c3` head in [3bb15a3](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/3bb15a3976d21bea667836d4c161e350943d8464). The nine cross-lane tests passed locally with WARP 1.0.22. Each relaxed path matched 64/64. This WARP setup also ran the fixed-wave quad-plus-first-lane test and matched all 64 outputs. The fixed-wave multidimensional case still needs a runtime readback. Strict all-features shader Clippy and the asset policy check passed. Please keep Git authorship if taking the test. If you fold it into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with Codex. Synthetic shaders only.
danielibabet commented 2026-11-27 09:40:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by danielibabet on 2026-11-27T09:40:39Z.


@andrewpozdnakov7-jpg I tried to fetch/apply \3bb15a3\ (\3bb15a3976d21bea667836d4c161e350943d4c161e), and GitHub returned \Not Found\ on the commit/patch URL. Could you push it to a branch on your fork or re-check the SHA so I can fast-forward \pr/wave-invariant-swizzle-dpp?

<!-- greyfinch-sync:Marvisak/VIctory:comment:7214962785 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#issuecomment-7214962785). Originally posted by [danielibabet](https://github.com/danielibabet) on 2026-11-27T09:40:39Z. --- @andrewpozdnakov7-jpg I tried to fetch/apply \3bb15a3\ (\3bb15a3976d21bea667836d4c161e350943d4c161e\), and GitHub returned \Not Found\ on the commit/patch URL. Could you push it to a branch on your fork or re-check the SHA so I can fast-forward \pr/wave-invariant-swizzle-dpp\?
andrewpozdnakov7-jpg commented 2026-11-27 09:42:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T09:42:26Z.


@danielibabet I reopened the published branch and commit. The full SHA is 3bb15a3976d21bea667836d4c161e350943d8464, with c2698c3 as its parent. On pr/wave-invariant-swizzle-dpp you can use:

git fetch https://github.com/andrewpozdnakov7-jpg/VIctory.git refs/heads/review/pr3421-native-quad-test
git merge --ff-only FETCH_HEAD
<!-- greyfinch-sync:Marvisak/VIctory:comment:7214998784 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#issuecomment-7214998784). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T09:42:26Z. --- @danielibabet I reopened the [published branch](https://github.com/andrewpozdnakov7-jpg/VIctory/tree/review/pr3421-native-quad-test) and [commit](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/3bb15a3976d21bea667836d4c161e350943d8464). The full SHA is `3bb15a3976d21bea667836d4c161e350943d8464`, with `c2698c3` as its parent. On `pr/wave-invariant-swizzle-dpp` you can use: ```sh git fetch https://github.com/andrewpozdnakov7-jpg/VIctory.git refs/heads/review/pr3421-native-quad-test git merge --ff-only FETCH_HEAD ```
ColorMeBoom commented 2026-11-27 13:15:30 +00:00 (Migrated from github.com)

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


AMD run: RX 5700 XT (RDNA1; the driver reports 32–64 lanes, so it may pick either; no mesh shaders), driver 32.0.21045.29003, Windows 11 26200, Rust 1.98.1. The PR head was merged onto main 63bcca4, tests ran on the native adapter (VICTORY_WARP unset), no game files. I tested @andrewpozdnakov7-jpg's 3bb15a3 (test-only, on top of head c2698c3; it only changes crosslane_tests.rs), because its native-adapter test is the one that dispatches on hardware.

  • wave64_quad_swizzle_and_dpp_run_on_supported_adapters, native adapter AMD Radeon RX 5700 XT | SM=0x68 | Wave=32-64: Wave64 guest DPP, DS quad and DS bit each matched all 64 outputs. The WARP half matched too.
  • crosslane_tests: 9 passed, 0 failed. The DPP16 (18), DPP8/DPP8FI (5), DPP FI (1) and ds_swizzle_b32 (6) hardware cases all passed, with none skipped. The two *_on_warp row-mask tests skipped with "WARP has no 64-lane waves" on the WARP this suite loads.
  • wave_tests: 9 passed, 0 failed. Full victory-shader suite: 315 passed, 0 failed, 3 ignored.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7219253171 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#issuecomment-7219253171). Originally posted by [ColorMeBoom](https://github.com/ColorMeBoom) on 2026-11-27T13:15:30Z. --- **AMD run: RX 5700 XT** (RDNA1; the driver reports 32–64 lanes, so it may pick either; no mesh shaders), driver 32.0.21045.29003, Windows 11 26200, Rust 1.98.1. The PR head was merged onto `main` `63bcca4`, tests ran on the native adapter (`VICTORY_WARP` unset), no game files. I tested @andrewpozdnakov7-jpg's `3bb15a3` (test-only, on top of head `c2698c3`; it only changes `crosslane_tests.rs`), because its native-adapter test is the one that dispatches on hardware. - `wave64_quad_swizzle_and_dpp_run_on_supported_adapters`, native adapter `AMD Radeon RX 5700 XT | SM=0x68 | Wave=32-64`: **Wave64 guest DPP, DS quad and DS bit each matched all 64 outputs**. The WARP half matched too. - `crosslane_tests`: **9 passed, 0 failed**. The DPP16 (18), DPP8/DPP8FI (5), DPP FI (1) and `ds_swizzle_b32` (6) hardware cases all passed, with none skipped. The two `*_on_warp` row-mask tests skipped with "WARP has no 64-lane waves" on the WARP this suite loads. - `wave_tests`: **9 passed, 0 failed**. Full `victory-shader` suite: **315 passed, 0 failed, 3 ignored**. AI use: Claude Code (Claude Opus 5.5).
danielibabet commented 2026-12-01 09:29:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by danielibabet on 2026-12-01T09:29:14Z.


Thanks @fuzeofficlal, @andrewpozdnakov7-jpg, and @ColorMeBoom for the thorough review and hardware runs!

All 5 review points are addressed in c2698c3 + formatting fix:

  1. 2D/3D compute groups: quad_layout_matches now requires cs.threads[1..] == [1, 1], keeping console_lanes + WaveSize(64) for multidimensional workgroups.
  2. ** _readfirstlane_b32**: non-waterfall _readfirstlane_b32 now disables quad_layout_matches so the wave size is preserved.
  3. quad_swizzle Rotate/FFT: quad_swizzle explicitly matches
<!-- greyfinch-sync:Marvisak/VIctory:comment:7306771092 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3421#issuecomment-7306771092). Originally posted by [danielibabet](https://github.com/danielibabet) on 2026-12-01T09:29:14Z. --- Thanks @fuzeofficlal, @andrewpozdnakov7-jpg, and @ColorMeBoom for the thorough review and hardware runs! All 5 review points are addressed in c2698c3 + formatting fix: 1. **2D/3D compute groups**: quad_layout_matches now requires cs.threads[1..] == [1, 1], keeping console_lanes + WaveSize(64) for multidimensional workgroups. 2. ** _readfirstlane_b32**: non-waterfall _readfirstlane_b32 now disables quad_layout_matches so the wave size is preserved. 3. **quad_swizzle Rotate/FFT**: quad_swizzle explicitly matches
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/3421:upstream-pr/3421'
git switch 'upstream-pr/3421'

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