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

Manually merged
github merged 1 commit from gh-pr/155/head into gh-pr/155/base 2026-11-26 04:12:57 +00:00
Owner

@⁠WarmMilkCodes on GitHub · 2026-11-23 17:17 UTC · original
WarmMilkCodes:rdna2-ps-wave32 → main · +90 −25 · 7 files · 1 commits · merged 2026-11-23 20:51 UTC

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

**@⁠WarmMilkCodes** on GitHub · 2026-11-23 17:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/155) `WarmMilkCodes:rdna2-ps-wave32` → `main` · +90 −25 · 7 files · 1 commits · merged 2026-11-23 20:51 UTC 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
D3D12 has no WaveSize for graphics shaders, so the driver picks the wave
size of a wave64 VS / PS. On an RX 6600 XT (RDNA2, reports 32-64 lanes) the
driver runs pixel shaders in waves of 32, but `wave32_only()` is false for a
32-64 range, so VS / PS did not get the `upper_lanes` form and `v_readlane`
32 wrapped to lane 0: gpu_wave64_ps_whole_wave_reductions summed twice
(928 vs 464), issue #42.

`pso::graphics_wave32` (range includes 32) now decides the split flag for
VS / PS at PSO creation (plain, mesh and GS pipelines' PS), in the test
runner and in `xcl shaders --precompile`; compute, mesh and geometry
programs keep `wave32_only`. The form checks the wave size at run time,
so a driver that picks 64 lanes is unaffected.

Tested on an RX 6600 XT (driver 32.0.21045.29003): cargo test --workspace, 569 passed, 0 failed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FSrXQbQ1CgygrnUUsgR2st
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:12:56 +00:00
github manually merged commit fc4b2d48f1 into gh-pr/155/base 2026-11-26 04:12:57 +00:00
Author
Owner

@⁠Vencite on GitHub · 2026-11-23 18:53 UTC · original

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.

**@⁠Vencite** on GitHub · 2026-11-23 18:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/155#issuecomment-7110795717) 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.
Author
Owner

@⁠TheHoracio on GitHub · 2026-11-23 19:13 UTC · original

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.

**@⁠TheHoracio** on GitHub · 2026-11-23 19:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/155#issuecomment-7111276960) 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.
Author
Owner

@⁠CodeByCon on GitHub · 2026-11-23 19:14 UTC · original

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.

**@⁠CodeByCon** on GitHub · 2026-11-23 19:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/155#issuecomment-7111306816) 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.
Author
Owner

@⁠WarmMilkCodes on GitHub · 2026-11-23 19:22 UTC · original

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.

**@⁠WarmMilkCodes** on GitHub · 2026-11-23 19:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/155#issuecomment-7111507601) 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`.
Author
Owner

@⁠ivall on GitHub · 2026-11-23 20:52 UTC · original

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.

**@⁠ivall** on GitHub · 2026-11-23 20:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/155#issuecomment-7113682531) 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.