VS / PS: the 32-lane form on every GPU that can run 32-lane waves (RD… #152

Merged
WarmMilkCodes merged 1 commit from upstream-pr/155 into main 2026-11-23 20:51:52 +00:00
WarmMilkCodes commented 2026-11-23 17:17:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by WarmMilkCodes on 2026-11-23T17:17:03Z.


On an RX 6600 XT (discrete RDNA2, reports 32–64 lanes) the driver runs wave64 pixel shaders in 32-lane waves, so gpu_wave64_ps_whole_wave_reductions failed: wave32_only() is false for a 32–64 range, VS / PS did not get the upper_lanes form, and v_readlane 32 wrapped to lane 0 (the sum doubled: 928 vs 464). Details in #42.

Change: pso::graphics_wave32 (the adapter's range includes 32) now decides the split flag for VS / PS:

  • PSO creation in real.rs: plain VS+PS pipelines, and the PS of mesh and GS pipelines
  • the test runner (runner::split_for, on_gpu) and the spill-slot tests' expectations
  • xcl shaders --precompile, so its cache keys match the runtime's

Compute, mesh and geometry programs keep wave32_only (they set [WaveSize(64)]). The upper_lanes form checks xcl_hw32 at run time, so a driver that picks 64 lanes runs the program as before. On RDNA GPUs, wave64 VS / PS with constant or slot reads now get the 32-lane form's HLSL; 64-lane-only GPUs are unchanged. Doc: docs/wave64-on-wave32.md.

Tested: RX 6600 XT, driver 32.0.21045.29003, Windows 11 23H2: cargo test --workspace: 568 passed, 0 failed (before: gpu_wave64_ps_whole_wave_reductions failed; it passed only with XCL_SPLIT_WAVE64=1). Not tested on RDNA4 or NVIDIA.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:6564773982 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/155). Originally posted by [WarmMilkCodes](https://github.com/WarmMilkCodes) on 2026-11-23T17:17:03Z. --- On an RX 6600 XT (discrete RDNA2, reports 32–64 lanes) the driver runs wave64 pixel shaders in **32-lane waves**, so `gpu_wave64_ps_whole_wave_reductions` failed: `wave32_only()` is false for a 32–64 range, VS / PS did not get the `upper_lanes` form, and `v_readlane` 32 wrapped to lane 0 (the sum doubled: 928 vs 464). Details in #42. **Change:** `pso::graphics_wave32` (the adapter's range includes 32) now decides the split flag for VS / PS: - PSO creation in `real.rs`: plain VS+PS pipelines, and the PS of mesh and GS pipelines - the test runner (`runner::split_for`, `on_gpu`) and the spill-slot tests' expectations - `xcl shaders --precompile`, so its cache keys match the runtime's Compute, mesh and geometry programs keep `wave32_only` (they set `[WaveSize(64)]`). The `upper_lanes` form checks `xcl_hw32` at run time, so a driver that picks 64 lanes runs the program as before. On RDNA GPUs, wave64 VS / PS with constant or slot reads now get the 32-lane form's HLSL; 64-lane-only GPUs are unchanged. Doc: `docs/wave64-on-wave32.md`. **Tested:** RX 6600 XT, driver 32.0.21045.29003, Windows 11 23H2: `cargo test --workspace`: 568 passed, 0 failed (before: `gpu_wave64_ps_whole_wave_reductions` failed; it passed only with `XCL_SPLIT_WAVE64=1`). Not tested on RDNA4 or NVIDIA. 🤖 Generated with Claude Code
upstream-sync closed this pull request 2026-11-24 06:57:25 +00:00
Vencite commented 2026-11-24 07:04:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Vencite on 2026-11-23T18:53:23Z.


tested this on my rtx 4080 super (driver 621.24).

built main (956a476bf7) and the pr (fc4b2d48f1) separately and ran the same tests on both, with XCL_SPLIT_WAVE64 unset.

all three wave64 gpu tests passed on both builds (ps reductions, ps spill slots, vs spill slots/identity). the reduction test reported 32-lane waves in both cases, and the wave path selection unit test passed too.

so far no regressions on my nvidia setup, at least in these tests. can't say anything about the original rx 6600 xt issue though.

<!-- greyfinch-sync:ivall/xcl:comment:7110795717 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/155#issuecomment-7110795717). Originally posted by [Vencite](https://github.com/Vencite) on 2026-11-23T18:53:23Z. --- tested this on my rtx 4080 super (driver 621.24). built main (956a476bf738) and the pr (fc4b2d48f1a) separately and ran the same tests on both, with XCL_SPLIT_WAVE64 unset. all three wave64 gpu tests passed on both builds (ps reductions, ps spill slots, vs spill slots/identity). the reduction test reported 32-lane waves in both cases, and the wave path selection unit test passed too. so far no regressions on my nvidia setup, at least in these tests. can't say anything about the original rx 6600 xt issue though.
TheHoracio commented 2026-11-24 07:04:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by TheHoracio on 2026-11-23T19:13:33Z.


Tested on RDNA3: AMD Radeon RX 7800 XT (16 GB, reports 32–64 lanes), driver 32.0.32015.7029, Windows 11 Pro 10.0.26300, Rust 1.100.0, DXC 1.9.2602.17 (SDK 10.0.26100.0).

The RX 6600 XT failure reproduces on RDNA3 and this PR fixes it:

Build XCL_SPLIT_WAVE64 gpu_wave64_ps_whole_wave_reductions lib + integration
main 956a476 unset ❌ left: [2, 928, 2], right: [2, 464, 2] (same doubled sum as the 6600 XT) 567 passed, 2 failed*
main 956a476 1 ✅ 568 passed, 1 failed*
this PR fc4b2d4 unset ✅ 568 passed, 1 failed*
this PR fc4b2d4 unset, XCL_REQUIRE_GPU=wave64,mesh ✅ 568 passed, 1 failed*, 0 SKIPPED

gpu_wave64_ps_spill_slots, gpu_wave64_vs_spill_slots_and_identity, geometry_wave_path_selection_preserves_native_wave64 and upper_lanes::spill_slots_come_from_their_shadow pass in all four runs.

* The remaining failure is test_title_runs_and_game_folder_is_untouched (e2e.rs:123). It is the false failure from #42: this machine has no Gaming Services, so preflight prints WARNING: no System32\xgameruntime.dll. The test title itself ran to failures: 0. That failure is unrelated to this PR (fixed in #180).

So on RDNA3, as on RDNA2, the driver runs wave64 pixel shaders in 32-lane waves. Gating the VS / PS form on graphics_wave32 looks right for RX 7000 too.

<!-- greyfinch-sync:ivall/xcl:comment:7111276960 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/155#issuecomment-7111276960). Originally posted by [TheHoracio](https://github.com/TheHoracio) on 2026-11-23T19:13:33Z. --- Tested on **RDNA3: AMD Radeon RX 7800 XT** (16 GB, reports 32–64 lanes), driver 32.0.32015.7029, Windows 11 Pro 10.0.26300, Rust 1.100.0, DXC 1.9.2602.17 (SDK 10.0.26100.0). The RX 6600 XT failure reproduces on RDNA3 and this PR fixes it: | Build | `XCL_SPLIT_WAVE64` | `gpu_wave64_ps_whole_wave_reductions` | lib + integration | |---|---|---|---| | `main` 956a476 | unset | ❌ `left: [2, 928, 2]`, `right: [2, 464, 2]` (same doubled sum as the 6600 XT) | 567 passed, 2 failed* | | `main` 956a476 | `1` | ✅ | 568 passed, 1 failed* | | this PR fc4b2d4 | unset | ✅ | 568 passed, 1 failed* | | this PR fc4b2d4 | unset, `XCL_REQUIRE_GPU=wave64,mesh` | ✅ | 568 passed, 1 failed*, 0 `SKIPPED` | `gpu_wave64_ps_spill_slots`, `gpu_wave64_vs_spill_slots_and_identity`, `geometry_wave_path_selection_preserves_native_wave64` and `upper_lanes::spill_slots_come_from_their_shadow` pass in all four runs. \* The remaining failure is `test_title_runs_and_game_folder_is_untouched` (e2e.rs:123). It is the false failure from #42: this machine has no Gaming Services, so preflight prints `WARNING: no System32\xgameruntime.dll`. The test title itself ran to `failures: 0`. That failure is unrelated to this PR (fixed in #180). So on RDNA3, as on RDNA2, the driver runs wave64 pixel shaders in 32-lane waves. Gating the VS / PS form on `graphics_wave32` looks right for RX 7000 too.
CodeByCon commented 2026-11-24 07:04:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CodeByCon on 2026-11-23T19:14:39Z.


tested this on my rx 7800 xt (driver 32.0.32029.2010, windows 11 build 26300.9974) and can confirm the same failure: 928 vs 464 on main (956a476), twice. with XCL_SPLIT_WAVE64=1 the test passes.

<!-- greyfinch-sync:ivall/xcl:comment:7111306816 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/155#issuecomment-7111306816). Originally posted by [CodeByCon](https://github.com/CodeByCon) on 2026-11-23T19:14:39Z. --- tested this on my rx 7800 xt (driver 32.0.32029.2010, windows 11 build 26300.9974) and can confirm the same failure: 928 vs 464 on main (956a476), twice. with XCL_SPLIT_WAVE64=1 the test passes.
WarmMilkCodes commented 2026-11-24 07:04:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by WarmMilkCodes on 2026-11-23T19:22:16Z.


Thanks @Vencite, @TheHoracio and @CodeByCon for testing. Summary so far:

GPU main 956a476 this PR
RX 6600 XT (RDNA2), 26.11.2 gpu_wave64_ps_whole_wave_reductions fails (928 vs 464) passes, 569/0
RX 7800 XT (RDNA3), 32.0.32015.7029 fails (928 vs 464) passes
RX 7800 XT (RDNA3), 32.0.32029.2010 fails (928 vs 464) –
RTX 4080 Super, 621.24 passes passes (no change)

So RDNA2 and RDNA3 both run wave64 PS in 32-lane waves despite reporting 32–64; the fix applies there and leaves NVIDIA unchanged. Still rebased on current main.

<!-- greyfinch-sync:ivall/xcl:comment:7111507601 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/155#issuecomment-7111507601). Originally posted by [WarmMilkCodes](https://github.com/WarmMilkCodes) on 2026-11-23T19:22:16Z. --- Thanks @Vencite, @TheHoracio and @CodeByCon for testing. Summary so far: | GPU | `main` 956a476 | this PR | |---|---|---| | RX 6600 XT (RDNA2), 26.11.2 | `gpu_wave64_ps_whole_wave_reductions` fails (928 vs 464) | passes, 569/0 | | RX 7800 XT (RDNA3), 32.0.32015.7029 | fails (928 vs 464) | passes | | RX 7800 XT (RDNA3), 32.0.32029.2010 | fails (928 vs 464) | – | | RTX 4080 Super, 621.24 | passes | passes (no change) | So RDNA2 and RDNA3 both run wave64 PS in 32-lane waves despite reporting 32–64; the fix applies there and leaves NVIDIA unchanged. Still rebased on current `main`.
ivall commented 2026-11-24 07:04:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T20:52:39Z.


Merged (main 2abc562). The conflict with lazy pipeline creation, now on main, was resolved: the pso_async::lazy defer check stays first, then graphics_wave32 picks the split form. Checked on an RX 9070 (RDNA4) with the 11 PRs merged together on main 38b05b7: cargo build --workspace && cargo test --workspace -- --test-threads=4 - 547 unit tests passed, 0 failed (19 ignored); the integration and e2e tests passed too.

<!-- greyfinch-sync:ivall/xcl:comment:7113682531 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/155#issuecomment-7113682531). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T20:52:39Z. --- Merged (main 2abc562). The conflict with lazy pipeline creation, now on main, was resolved: the `pso_async::lazy` defer check stays first, then `graphics_wave32` picks the split form. Checked on an RX 9070 (RDNA4) with the 11 PRs merged together on main 38b05b7: `cargo build --workspace && cargo test --workspace -- --test-threads=4` - 547 unit tests passed, 0 failed (19 ignored); the integration and e2e tests passed too.
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
xcl-dev/xcl!152
No description provided.