Skip to content

Compute groups that are not whole waves: padded where the program can tell - #245

Open
Kalmarv wants to merge 1 commit into
xcl-dev:mainfrom
Kalmarv:fix/cs-pad-partial-waves
Open

Kalmarv wants to merge 1 commit into
xcl-dev:mainfrom
Kalmarv:fix/cs-pad-partial-waves

Conversation

@Kalmarv

@Kalmarv Kalmarv commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

This is the compute side of the gap #152 names under "Not covered": lanes the PC never launched. It was offered in #152 (comment).

A console wave always has all its lanes; a PC group of 40 threads has only 40. The lanes the PC never launches are still visible to a program: v_writelane writes them, and code that turns on EXEC runs in them. This PR launches those lanes for compute programs that can tell, inactive as on the console.

One commit, 63a55a0, on main 9e3831e: +829 / -17, about 335 lines of translator code and about 510 of tests. That is over ~800 because of the tests; the translator change is one gate and its pass, which don't split into parts that are useful alone. 63a55a0 is 041772c rebased with one conflict: Options::default() in crates/xcl/src/gpu/recomp/mod.rs, where #680 added heap_windows and this PR adds pad_waves; the line keeps both (git range-diff: no other line changed). 041772c was 761144d rebased (two conflicts, resolved as @Rednaxeh did: emit.rs, the prelude then the padding; pso.rs, all four switches in cache_allowed and its test), plus the two review fixes below. The earlier heads were 887ae29 and ba63366 (the same patch, rebased) and 3aaef99, which added the fix for 64-bit writes to NULL that @JGonzalezRodriguez found (below). 761144d is 3aaef99 rebased from main 9ab7d76, without conflicts and without a changed line (git range-diff: =).

What is in it

What was wrong:

  • A compute group of 40 threads is one console wave64 with lanes 0..39 launched and lanes 40..63 inactive in EXEC, but there.
  • v_writelane writes the inactive lanes whatever EXEC is.
  • Code that turns them on runs in them: s_or_saveexec_b64 s, -1 around whole-wave code, s_mov_b64 exec, -1, s_not_b64 exec, exec, s_wqm_b64 exec, exec.
  • A PC group of 40 threads has no such lanes.

Measured on main 956a476 (RTX 5070 Ti, split form; the same with XCL_X64_ALL_MASKS=1 and XCL_WAVE64_SPIN=1). Expected values are the ISA's definition, not a console measurement:

group s_not_b64 exec, exec, then bits of v_cmp_eq_u32 vcc, v0, v0 s_or_saveexec_b64 s, -1, then the same v_mov under EXEC = -1, v_readlane of lane 63
40 24 expected, 0 measured 64, 40 7, 7 (an undefined read that happened to be right)
42 22, 0 64, 42 7, 7 (same)
20 44, 0 64, 20 7, 0
10 54, 0 64, 10 7, 0
96, second wave 32, 0 64, 32 7, 0

Wave32 programs have the same gap in groups that are not a multiple of 32. It is not the split form's doing: it happens on every GPU and at both wave sizes.

The change: for compute, the missing lanes can simply be launched.

  • The group is declared as whole console waves: [numthreads(64, 1, 1)] for 40 threads, 1-D whatever the console's shape.
  • EXEC starts as the ballot of thread index < 40.
  • The padding lanes are real lanes, inactive as on the console. Nothing else in the translation changes.

Which programs are padded:

  • Only a program that can tell is padded (crates/xcl/src/gpu/recomp/partial_waves.rs). Every other program keeps its group and its HLSL byte for byte (compute_groups_are_padded_only_where_the_program_can_tell).
  • A program can tell when it has a v_writelane to a lane the last wave may not launch, or when EXEC may get a bit outside the launched lanes.
  • The second case is a forward pass over the SGPRs. It tracks words known to lie inside the launched lanes: EXEC at the start, VALU masks, constants by their bits, AND with such a word, OR / XOR of two such words, the saveexec forms, moves and selects.
    • Anything else may have any bit.
    • An indirect jump pads.
    • A 64-bit write to NULL (s125) writes nothing. Before 3aaef99, the pass wrote its high word to s126 (EXEC_LO), and upper_lanes::sgpr_outputs listed a null SDST / VDST as two registers. With EXEC_HI 0, s_or_saveexec_b64 null, 0xFFFFFFFF was then not seen as turning lanes on, and s_and_saveexec_b64 null, s_and_b64 null and a VOP3 v_cmp to null padded for nothing. @JGonzalezRodriguez found this.
    • A wave32 program's S_*_SAVEEXEC_B64 / S_*_WREXEC_B64 writes EXEC_LO and SDST only, as the translator emits it, so the pass uses b64 && wave64 for them (@JGonzalezRodriguez's minor point).
    • The compiler's if / else / loop code keeps EXEC inside the launched lanes, so ordinary programs are not padded.
  • The pass errs towards padding. A padded program is exact; it only runs up to 63 more inactive threads per group.
  • TG_SIZE, group ids, LDS and the dispatch counts are the title's, as before.
  • XCL_CS_PAD_ALL=1 pads every group that is not whole waves, and XCL_NO_CS_PAD=1 pads none. Both are for comparison and bypass the shader caches.
  • A group whose padded size would pass D3D12's 1 024 threads keeps its size.
  • s_barrier counts the group's hardware waves with its padding: in the split form a group of 32 threads or fewer padded to 64 is two hardware waves, and keeps the group sync (xcl_s_barrier). Before, the count was taken before the padding was decided, and such a group got a bare GroupMemoryBarrier().

This is narrower than what I offered in the #152 comment (pad every partial group). I gated it so that programs that cannot tell keep their HLSL and pay nothing; XCL_CS_PAD_ALL=1 is the ungated form.

The HLSL a padded program gets: no wave intrinsic that the translator does not already emit, and none in a new position.

  • [numthreads(N, 1, 1)], with N the next multiple of the console wave size.

  • The entry ballot's argument is ballot(gi < 40u) instead of ballot(true) (xcl_x_ballot in the split form). It is the same function in the same place.

  • Split form (32-lane hardware): XCL_X_THREADS is the padded count. xcl_x_thread and the exchange are unchanged.

  • Native form (64-lane hardware): a padded group takes its threads through the prologue that every 2-D / 3-D compute group already has:

    • WaveActiveCountBits(true), WaveIsFirstLane;
    • InterlockedAdd on the groupshared counter, WaveReadLaneFirst;
    • two group barriers.

    The only new thing is that a 1-D group can get it.

A padded group's thread count is a multiple of the hardware wave size, so the driver has no partial last wave to form for it. A padded program's wave operations therefore run in fewer partial waves than before, not more. The body of the program is translated as before.

Tests:

  • gpu_wave64_valu_code_in_lanes_not_launched and gpu_wave32_valu_code_in_lanes_not_launched: one program, run in 1-D, 2-D and 3-D groups. It:

    • counts the compare's bits after s_not exec, exec and after s_or_saveexec s, -1;
    • reads the wave's last lane of a VGPR written under EXEC = -1;
    • reads back a lane v_writelane wrote.

    Both fail without the change. Each also runs with PadWaves::Never (the translation main makes) and requires every partial wave to differ: 11 and 5 of them.

  • gpu_padded_compute_groups_look_the_same_to_the_program: these are the same padded or not:

    • thread ids (1-D, 2-D, 3-D), the group id, TG_SIZE and lane numbers;
    • the launched-lane count;
    • LDS across s_barrier, and one atomic per thread.

    No padding lane stores.

  • gpu_wave64_saveexec_to_null_turns_on_lanes_not_launched: @JGonzalezRodriguez's case on the GPU. In a group of 20 threads, s_or_saveexec_b64 null, 0xFFFFFFFF with EXEC_HI 0 turns on lanes 20..31, so a compare counts 32 lanes. Unpadded (PadWaves::Never), it counts 20.

  • CPU: partial_waves::tests (9), compute_groups_are_padded_only_where_the_program_can_tell and a_padded_group_barrier_counts_its_padding_waves. Two of the nine are for the null writes, a_saveexec_to_null_that_widens_exec_is_seen and masks_discarded_into_null_leave_exec_alone; both fail without the fix in 3aaef99. a_wave32_saveexec_b64_writes_one_word and a_padded_group_barrier_counts_its_padding_waves fail without the two review fixes in 041772c.

Tested

  • RTX 5070 Ti, NVIDIA 610.74, Ryzen 9 9950X, Windows 11 Pro 25H2 (build 26200.9711), Rust 1.99.0, debug build. The GPU has 32-lane waves only: wave64 programs run split, wave32 programs natively.
  • cargo test --workspace -- --test-threads=4 on 63a55a0: 791 passed, 0 failed, 41 ignored (the xcl library: 742 passed, 21 ignored). SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64), and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows; Recompiler: memory windows from the descriptor heap (no per-access switch) #680's test).
  • The earlier head 041772c, on main 930e8b4: 766 passed, 0 failed, 41 ignored (the xcl library: 722 passed, 21 ignored), the same two "no wave64" SKIPPED tests. gpu::recomp::: 204 passed, 0 failed, 18 ignored. The 15 tests of this PR: 15 passed.
  • The earlier head 761144d, on main dd2ae9a: 703 passed, 0 failed, 41 ignored (the xcl library: 663 passed, 21 ignored). SKIPPED GPU tests: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware, both "no wave64". gpu::recomp::: 196 passed, 0 failed, 18 ignored. The 13 tests of this PR: 13 passed.
  • The earlier head 3aaef99, on main 9ab7d76: 664 passed, 0 failed, 40 ignored, with the same two SKIPPED tests. That was ba63366's 661 and the three new tests. gpu::recomp::: 195 passed, 0 failed, 18 ignored.
  • The fix in 3aaef99, built with and without it (the same tests in both):
    • partial_waves::: 8 of 8 pass with the fix, and both new CPU tests fail without it.
    • gpu_wave64_saveexec_to_null_turns_on_lanes_not_launched passes with the fix. Without it, every thread counts 20 lanes instead of 32.
    • The four GPU tests of this PR pass with the fix.
  • The previous head ba63366, on our machine: 661 passed, 0 failed, 40 ignored, with the same two SKIPPED tests.
  • Also run by @regiumlepidi on 3aaef99, merged onto main 4017f8f (a clean merge), on an RTX 5070 Ti (NVIDIA 617.42) and on the AMD RDNA2 iGPU of a Ryzen 7 9800X3D (driver 32.0.21030.2001, native 64-lane waves, native Windows D3D12). Windows 11 Pro 25H2, rustc 1.100.0, debug (Compute groups that are not whole waves: padded where the program can tell #245 (comment)):
    • scripts/test.ps1: 665 passed, 0 failed, 40 ignored on both adapters; main 4017f8f gave 652 / 0 / 40 on both.
    • SKIPPED tests: 2 on the RTX 5070 Ti (no wave64), none on the iGPU. So the wave64 tests, gpu_wave64_saveexec_to_null_turns_on_lanes_not_launched included, ran in native 64-lane waves there.
    • The 13 tests of this PR, with XCL_CS_PAD_ALL=1: 13 passed on both. With XCL_NO_CS_PAD=1: 10 passed and 3 failed on both, the three GPU tests in their padded half, as expected.
  • Also run by @Rednaxeh on ba63366 (main 9ab7d76 + this commit), on an RX 7800 XT (RDNA3, native 64-lane waves, driver 32.0.32029.2010), Ryzen 7 7800X3D, Windows 11 Pro 26300, rustc 1.100.0, with XCL_REQUIRE_GPU=wave64,mesh (Compute groups that are not whole waves: padded where the program can tell #245 (comment)):
    • scripts/test.ps1, debug and release: 661 passed, 0 failed, 40 ignored, 0 SKIPPED; main 9ab7d76 gave 651 / 0 / 40.
    • gpu::recomp::: 192 / 0 / 18 natively, and the same with XCL_SPLIT_WAVE64=1, XCL_CS_PAD_ALL=1, XCL_WAVE64_SPIN=1 and XCL_X64_ALL_MASKS=1.
    • With XCL_NO_CS_PAD=1, both …_valu_code_in_lanes_not_launched tests fail in every partial wave, natively on 64-lane hardware too.
    • The regression run below.
  • Also run by @PHeitor1 on 3aaef99 merged onto main 2b4bb43, on an RTX 5060 Ti, debug, with the debug-layer tests enabled: cargo test --workspace, 683 passed, 0 failed, 41 ignored; the only SKIPPED tests are the two "no wave64" ones (Compute groups that are not whole waves: padded where the program can tell #245 (comment)).
  • The tester runs below are of ba63366 and 887ae29, which carry the same patch. 3aaef99 differs from them only by the null-write fix and its tests (git diff ba63366 3aaef99: partial_waves.rs, upper_lanes.rs, tests.rs).
  • Also run by @denio4321 on an RTX 3060 (NVIDIA 610.88), previous head ba63366: cargo test --workspace, 661 passed, 0 failed, 40 ignored (main: 651 passed), and the 10 new tests pass (Compute groups that are not whole waves: padded where the program can tell #245 (comment)).
  • Also run by @PHeitor1 on an RTX 5060 Ti (NVIDIA 621.24), Windows 11, debug, previous head ba63366: cargo test --workspace, 661 passed, 0 failed, 40 ignored (Compute groups that are not whole waves: padded where the program can tell #245 (comment)).
  • Also run by @JGonzalezRodriguez on 887ae29 (the same patch as ba63366), on an RTX 4090 (wave32 hardware, wave64 split) and on an AMD Raphael RDNA2 iGPU (RADV 26.2.4, native wave64), both under Proton with vkd3d-proton on Linux, debug (Compute groups that are not whole waves: padded where the program can tell #245 (comment)):
    • partial_waves::tests 6/6 and the four new tests 4/4 on both GPUs.
    • Without the change (XCL_NO_CS_PAD=1, and with the two GPU tests on base 60565c4), both …_valu_code_in_lanes_not_launched tests fail on both GPUs.
    • gpu::recomp::: 192 passed, 0 failed, 18 ignored on the RTX 4090. On RADV: 189 passed, 3 failed, 18 ignored, also with XCL_CS_PAD_ALL=1. The three (gpu_f64_roots, gpu_f64_math_random, gpu_nonfused_mad_and_mac_prevent_fma_contraction) fail the same way on base 60565c4.
  • The runs below are of the earlier head 887ae29 (main 60565c4 + the same patch):
    • The four new tests by exact name (<lib test exe> --exact … --test-threads=1), in three forms of the split (default, XCL_X64_ALL_MASKS=1, XCL_WAVE64_SPIN=1): 4 passed, 0 failed in each.
    • Without the change (XCL_NO_CS_PAD=1, which makes the translation main's), both …_valu_code_in_lanes_not_launched tests fail in every partial wave. For example:
      • group 40, wave64: want [24, 64, 7, 33], got [0, 40, 7, 0];
      • group 20, wave32: want [12, 32, 7, 33], got [0, 20, 7, 0].
    • Every gpu::recomp:: test (<lib test exe> gpu::recomp:: --test-threads=2):
switch passed failed ignored
none 192 0 18
XCL_CS_PAD_ALL=1 (every partial compute group padded) 192 0 18
XCL_WAVE64_SPIN=1 192 0 18
XCL_X64_ALL_MASKS=1 190 2 18
  • The two failures under XCL_X64_ALL_MASKS=1 are gpu_split_wave64_lane_local_masks and gpu_split_wave64_local_and_exchanged_masks_in_diverging_waves. They assert that masks stay in their half, which that switch turns off. They failed the same way with main's translator when I ran it on af20b4b.
  • cargo test --workspace --no-fail-fast -- --test-threads=2: 661 passed, 0 failed, 40 ignored (lib: 621 / 0 / 20).
  • Earlier smoke runs by @Rednaxeh, RX 7800 XT (RDNA3), on main 9ab7d76 and the previous head ba63366 (which differs only by the null-destination fix): 1262 and 1261 frames in 60 s, no crash or device removal (Compute groups that are not whole waves: padded where the program can tell #245 (comment)).

Overlaps:

  • 1058c0b (Compute TG_SIZE: a partial last wave counts #136, TG_SIZE) changed one constant: the wave count in the TG_SIZE SGPR is now the ceiling, so a program is told that a last, partial wave exists. That wave still has only the lanes the PC launched. This PR does not touch TG_SIZE (the line is unchanged, and a test checks that the value is the same padded or not); it gives the partial wave its missing lanes.
  • Recompiler: classify wave64 VS / PS by whether a 32-lane cut changes them (#336) #517 (@emirduran707, classifying wave64 VS / PS by whether a 32-lane cut can be seen) edits gpu/recomp/mod.rs where this PR does, and the two conflict there (git merge-tree of 63a55a0 with its dfc5578). Whichever lands second needs a rebase.
  • VS / PS whole-wave reductions as wave operations (partial waves, every GPU) #152 recognises whole-wave reductions in VS / PS and names compute and mesh as not covered. Nothing here touches VS / PS; this only changes the compute entry, so the two should compose.
  • docs/wave64-on-wave32.md says that "the console group keeps its numthreads". With this PR, a compute program that can tell gets a padded group instead. The doc is not edited here.

Regression run

Our own runs, one after the other on the machine under Tested (RTX 5070 Ti), release builds, no uncommitted changes: main at 9e3831e (this PR's base), then this PR's head 63a55a0. 1298 / 1301 frames (100 %), peak commit 27169 / 26955 MB (101 %); no device removal and no crash on either run.

main:

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1301 (PresentX 1302)
presents per 2 s (last 3): 14 42 41
device removals: 0
crashes: 0
peak commit: 26955 MB

PR:

xcl-smoke v1
commit: 63a55a033ee73e2a5cf660fb8fdf6542535bd9f7
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1298 (PresentX 1298)
presents per 2 s (last 3): 16 38 54
device removals: 0
crashes: 0
peak commit: 27169 MB

Not tested

  • How many of a title's compute programs get padded is not counted; the smoke runs above are a regression check only.
  • AMD: no RDNA4. The AMD runs:
  • Expected values come from the ISA's definition; nothing was compared with a console.
  • Not covered by the change:

AI use

  • Claude Code (Claude Fable 5.2), code, tests and the first description; Claude Code (Claude Opus 5.5), the earlier rebase and this description; Claude Code (Claude Fable 5.2), the rebase onto dd2ae9a and its runs; Claude Code (Claude Opus 5.5), the rebase onto 930e8b4, the two review fixes and their tests, and these runs; Claude Code (Claude Opus 5.5), the rebase onto 9e3831e and its run

@denio4321

Copy link
Copy Markdown

Tested ba63366 merged onto main 9ab7d76 on RTX 3060 12 GB (Ampere, 32-lane waves), NVIDIA 610.88, Windows 11 Pro 23H2 (22631), rustc 1.100.0 MSVC, DXC 1.9.2602.17: pass.

.\scripts\test.ps1 (debug, --test-threads=4), no XCL_SAMPLE_* set. Baseline main 9ab7d76 alone on the same machine: 651 passed, 0 failed, 40 ignored.

  • This PR: 661 passed, 0 failed, 40 ignored (the 10 new tests, all ok).
  • gpu_wave64_valu_code_in_lanes_not_launched and gpu_wave32_valu_code_in_lanes_not_launched pass here; the wave64 one runs in the split form (two hardware wave32s per console wave).
  • gpu_padded_compute_groups_look_the_same_to_the_program and compute_groups_are_padded_only_where_the_program_can_tell pass, and so do the six partial_waves::tests.
  • GPU skips are the same 2 as on main (no wave64).

Not run: the new tests without the emit.rs change (the negative control), or any game.

AI-assisted (Claude Code).

@PHeitor1

Copy link
Copy Markdown

Tested on RTX 5060 Ti 8 GB, driver 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native), Rust 1.100.0 msvc, debug. cargo test --workspace --no-fail-fast -- --test-threads=4 on the head ba63366: 661 passed, 0 failed, 40 ignored (main 9ab7d76: 651 / 0 / 40, so +10 new tests, all green on a 32-lane NVIDIA). SKIPPED: only the usual two no wave64 (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware).

Run and written with Claude Code (Claude Opus 5.5).

@JGonzalezRodriguez

Copy link
Copy Markdown

Tested commit 887ae29 (on base 60565c4; also verified the current rebased head ba63366 has zero diff in partial_waves.rs, upper_lanes.rs, and emit.rs) on both wave32-only hardware (NVIDIA RTX 4090) and native wave64 hardware (AMD Raphael RDNA2 / RADV).

Tested

  • Host / stack: CachyOS Linux, Proton Experimental wine + relaxed vkd3d-proton (30b0eb9), DXC 1.9.2609.5, cross-built x86_64-pc-windows-msvc debug (rustc 1.98.1, clang-cl 23.1.1 + lld-link, 0 errors, 0 warnings).
Suite / switch RTX 4090 (610.57.4, wave32 / split wave64) AMD Raphael RDNA2 (radv 26.2.4, native wave64 + wave32)
partial_waves::tests 6/6 pass 6/6 pass
4 new PR #245 tests (default) 4/4 pass 4/4 pass
4 new PR #245 tests (XCL_WAVE64_SPIN=1) 4/4 pass —
4 new PR #245 tests (XCL_X64_ALL_MASKS=1) 4/4 pass —
4 new PR #245 tests (XCL_SPLIT_WAVE64=1) — 4/4 pass
4 new PR #245 tests (XCL_NO_CS_PAD=1) 2 pass, 2 fail (11 w64 + 5 w32 partial waves) 2 pass, 2 fail (11 w64 + 5 w32 partial waves)
Full gpu::recomp:: (default) 192 pass, 0 fail, 18 ignored 189 pass, 3 fail*, 18 ignored
Full gpu::recomp:: (XCL_CS_PAD_ALL=1) 192 pass, 0 fail, 18 ignored 189 pass, 3 fail*, 18 ignored
Base 60565c4 negative control (2 new GPU tests carried onto base) 0/2 pass (11 w64 + 5 w32 partial waves fail) 0/2 pass (11 w64 + 5 w32 partial waves fail)

* On AMD RADV, the 3 failures (gpu_f64_roots, gpu_f64_math_random, gpu_nonfused_mad_and_mac_prevent_fma_contraction) also fail identically 3/3 on base 60565c4 (pre-existing RADV f64 rsq / f32 FMA quirks; zero regressions from this PR, including under XCL_CS_PAD_ALL=1). Native wave64 execution on RADV was verified via gpu_wave32_program_in_wave64_hardware running without skipping.

The native wave64 reorder prologue, XCL_WT/xcl_lds[8191u] barrier handoff, TG_SIZE, barriers, and split-wave64 paths all behave cleanly on both GPUs.

Findings

1. 64-bit writes with SDST/VDST = null (125) clobber st.s[126] (EXEC_LO)

State::set ignores r == 125, so the low-word write to null is skipped, but 64-bit writes still call st.set(dst + 1, ...) = st.set(126, ...), overwriting EXEC_LO in three places:

  • partial_waves.rs:137-141 (SAVEEXEC/WREXEC: st.set(dst + 1, ...))
  • partial_waves.rs:160-163 (ENC_SOP1/ENC_SOP2: st.set(dst + 1, hi))
  • partial_waves.rs:173-180 via upper_lanes::sgpr_outputs (upper_lanes.rs:497, 509), which returns (125, 2) when SDST/VDST == 125 (including SDWA SD=1).

This causes both a false negative (missed padding) and false positives (spurious padding) on partial waves with launched < 32 (reproduced on both RTX 4090 and AMD RADV with a [20, 1, 1] wave64 group):

  1. False negative: s_mov_b32 exec_hi, 0; s_or_saveexec_b64 null, 0xFFFF_FFFF widens EXEC_LO to 0xFFFF_FFFF (activating lanes 20..31), setting st.s[126] = 0, which is immediately overwritten by st.set(126, eh) (LO | HI) before line 205 checks st.s[126] & LO == 0. sees_lanes_not_launched returns None, the shader stays unpadded, and v_cmp_eq_u32 vcc, v0, v0; s_bcnt1_i32_b64 returns 20 instead of 32 (PadWaves::Always returns 32).
  2. False positives: Normal narrowing/test idioms that discard into null — s_and_saveexec_b64 null, vcc, s_and_b64 null, exec, vcc, and v_cmp_gt_u32 null, v0, v1 (ENC_VOP3) — overwrite st.s[126] with eh (HI, lacking LO) and spuriously pad the group.

Guarding dst != 125 before writing 64-bit pairs in partial_waves.rs (e.g. a set64 helper) and skipping v == 125 in upper_lanes::sgpr_outputs fixes all three paths cleanly.

(Minor: in partial_waves.rs:138, if b64 could also be if b64 && wave64 to match emit.rs:1118.)

Not tested

  • Native Windows, Windows SDK DXC 1.7, full workspace test run on rebased ba63366 (verified zero diff vs tested 887ae29 in partial_waves.rs/upper_lanes.rs/emit.rs), retail titles.

AI use

Antigravity (Gemini frontier model) assisted with code review, dual-GPU test execution, and drafting this report; every line cited and repro result was directly verified on this host.

@Kalmarv

Kalmarv commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@JGonzalezRodriguez thank you, and for the RADV wave64 run. Finding 1 holds as you describe: State::set skips 125, but the second word of a 64-bit write to null lands on 126, and sgpr_outputs returns (125, 2) for a null destination. A fix with your cases as tests (the missed pad and the three spurious ones) is coming as a push to this PR, with you credited in the description; I'll also check the b64 && wave64 point against emit.rs. I'll ask for smoke runs once the new head is up.

🤖 Claude Opus 5.5

@Kalmarv
Kalmarv force-pushed the fix/cs-pad-partial-waves branch from ba63366 to 3aaef99 Compare November 23, 2026 22:45
@regiumlepidi

Copy link
Copy Markdown

Tested the new head 3aaef99 merged onto current main 4017f8f (clean merge) on native 64-lane hardware under Windows – an AMD RDNA2 iGPU – and on an NVIDIA RTX 5070 Ti, with main 4017f8f as the baseline on both: pass on both.

Tested

  • AMD Radeon(TM) Graphics, the Ryzen 7 9800X3D's iGPU (RDNA2, native 64-lane waves), driver 32.0.21030.2001, native Windows D3D12 (not vkd3d), selected with XCL_ADAPTER=radeon
  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves), driver 617.42 (32.0.16.1742)
  • AMD Ryzen 7 9800X3D, 48 GB DDR5-6000, Windows 11 Pro 25H2, rustc 1.100.0 MSVC, DXC from Windows SDK 10.0.26100, debug
  • .\scripts\test.ps1 (cargo test --workspace -- --test-threads=4), no XCL_SAMPLE_* set
Build Adapter Passed Failed Ignored GPU tests skipped
main 4017f8f RTX 5070 Ti 652 0 40 2 (no wave64)
main 4017f8f RDNA2 iGPU 652 0 40 none
3aaef99 on 4017f8f RTX 5070 Ti 665 0 40 2 (no wave64)
3aaef99 on 4017f8f RDNA2 iGPU 665 0 40 none
  • On the iGPU nothing is skipped, so the wave64 programs ran in native 64-lane waves there: gpu_wave64_valu_code_in_lanes_not_launched, gpu_wave64_saveexec_to_null_turns_on_lanes_not_launched (the null-saveexec case from the RADV review), gpu_wave32_valu_code_in_lanes_not_launched and gpu_padded_compute_groups_look_the_same_to_the_program all pass, as do the 8 partial_waves::tests and compute_groups_are_padded_only_where_the_program_can_tell. The PadWaves::Never halves of those tests (11 and 5 differing waves, the unpadded count of 20) hold on both adapters too.

The switches, the 13 tests above only (cargo test -p xcl --lib -- lanes_not_launched padded_compute compute_groups_are_padded partial_waves):

Switch RTX 5070 Ti RDNA2 iGPU
XCL_CS_PAD_ALL=1 13 passed 13 passed
XCL_NO_CS_PAD=1 10 passed, 3 failed 10 passed, 3 failed

With XCL_NO_CS_PAD=1 the three GPU tests fail in their WhereSeen half, as expected, since the switch turns it into Never: e.g. on the iGPU group [40, 1, 1] wave 0 (40 lanes) | want [24, 64, 7, 33] | got [[0, 40, 0, 0]], and the null-saveexec case counts 20 instead of 32. So on 64-lane hardware too the padding is what makes them pass.

Regression run

  • None: I have no unpacked Xbox Series title.

Not tested

  • scripts/smoke.ps1 on a real title, main or this head; how many of a title's compute programs get padded.
  • RDNA3 / RDNA4 and discrete AMD cards; Intel.

AI use: Claude Code with Claude Opus 5.5 ran the builds and tests and wrote this report; the numbers come from those runs.

@Rednaxeh

Copy link
Copy Markdown
Contributor

RDNA3: Radeon RX 7800 XT (native 64-lane waves) on ba63366: 661 passed, 0 failed; the new tests fail without the change here too; retail title runs the same as main

First AMD run of this PR, as asked under Not tested, plus a regression run on a retail title. Tested ba63366, which is main 9ab7d76 plus this PR's commit (fast-forward, so head = merge result), with no uncommitted changes. No XCL_SAMPLE_* variables set for the test suite.

GPU / driver AMD Radeon RX 7800 XT (16 GB, RDNA3), driver 32.0.32029.2010; 32–64-lane waves, mesh shaders, SM 6.6
CPU / RAM AMD Ryzen 7 7800X3D, 32 GB DDR5-6000
OS Windows 11 Pro 26300 (native)
Toolchain rustc 1.100.0 x86_64-pc-windows-msvc, debug (release where said); DXC 1.9.2602.17 (Windows SDK 10.0.26100); system XGameRuntime 10.0.26100.9656

Whole suite – .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4) with XCL_REQUIRE_GPU=wave64,mesh, so a skipped GPU test would have failed: 661 passed, 0 failed, 40 ignored, 0 SKIPPED (lib 621 / 0 / 20). main 9ab7d76 alone on this machine, same command and switch, earlier today: 651 / 0 / 40, 0 SKIPPED. The 10 extra passes are this PR's tests: the 6 unit tests in partial_waves.rs, compute_groups_are_padded_only_where_the_program_can_tell, and the 3 GPU tests.

gpu::recomp:: (cargo test -p xcl --lib -- gpu::recomp:: --test-threads=2, XCL_REQUIRE_GPU=wave64,mesh throughout):

switch passed failed ignored
none (native wave64) 192 0 18
XCL_SPLIT_WAVE64=1 (the 32-lane split form on AMD) 192 0 18
XCL_CS_PAD_ALL=1 192 0 18
XCL_WAVE64_SPIN=1 192 0 18
XCL_X64_ALL_MASKS=1 192 0 18

Under XCL_X64_ALL_MASKS=1 the two gpu_split_wave64_*_masks* tests that fail on the RTX 5070 Ti pass here: on native 64-lane waves there is no split for that switch to act on.

The four new tests by exact name (--exact --test-threads=1): 4 passed in each of the five forms (native, XCL_SPLIT_WAVE64=1, XCL_CS_PAD_ALL=1, XCL_WAVE64_SPIN=1, XCL_X64_ALL_MASKS=1).

Release: cargo build --release --workspace + cargo test --release --workspace -- --test-threads=4, XCL_REQUIRE_GPU=wave64,mesh: 661 passed, 0 failed, 40 ignored, 0 SKIPPED, the same as debug.

Without the change (XCL_NO_CS_PAD=1, same four tests): gpu_wave64_valu_code_in_lanes_not_launched and gpu_wave32_valu_code_in_lanes_not_launched fail in every partial wave, as on NVIDIA; the other two pass. So the native thread-counter prologue on 64-lane hardware, which the description lists as untested, takes the padded form here and the test catches main's translation on it. Examples, verbatim (want / got as the test prints them):

wave64: group [40, 1, 1] wave 0 (40 lanes) | want [24, 64, 7, 33] | got [[0, 40, 0, 0]]
wave64: group [96, 1, 1] wave 1 (32 lanes) | want [32, 64, 7, 33] | got [[0, 32, 0, 0]]
wave64: group [1, 1, 1]  wave 0 (1 lanes)  | want [63, 64, 7, 33] | got [[0, 1, 0, 0]]
wave32: group [20, 1, 1] wave 0 (20 lanes) | want [12, 32, 7, 33] | got [[0, 20, 0, 0]]
wave32: group [52, 1, 1] wave 1 (20 lanes) | want [12, 32, 7, 33] | got [[0, 20, 0, 0]]

One difference from the NVIDIA failure quoted in the description (got [0, 40, 7, 0]): natively on this GPU the third word is 0, not 7, in every case. I have not looked into why; it is the unfixed path either way.

Regression run – scripts/smoke.ps1 -Game <folder> on a retail title, release builds, no uncommitted changes, same machine, the five runs one after the other in this order. All five: exit 0x0, 0 device removals, 0 crashes. The gpu: line names the wrong adapter (the script's known issue, #281 / #282 / #285); the GPU was the RX 7800 XT. Blocks unedited.

  1. main, first run on an empty cache/ (the First run of a title: the coherent window is 512 MB until uma_coherent.txt has been learned (menus at ~12 fps, then 30) #284 first-run window; a warm-up, not for comparison):
xcl-smoke v1
commit: 9ab7d763197c7f420bff10cd9bf1310f07e2a9aa
gpu: Meta Virtual Monitor
title: GTA6
seconds: 60
exit: 0x0
frames shown: 966 (PresentX 966)
presents per 2 s (last 3): 38 39 39
device removals: 0
crashes: 0
peak commit: 15681 MB
  1. main, second run:
xcl-smoke v1
commit: 9ab7d763197c7f420bff10cd9bf1310f07e2a9aa
gpu: Meta Virtual Monitor
title: GTA6
seconds: 60
exit: 0x0
frames shown: 1470 (PresentX 1470)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 15549 MB
  1. this PR, first run with its exe (its padded compute programs translate differently, so they compile anew):
xcl-smoke v1
commit: ba633669be03d9a41a314a3204d58fe4cc88237d
gpu: Meta Virtual Monitor
title: GTA6
seconds: 60
exit: 0x0
frames shown: 1393 (PresentX 1393)
presents per 2 s (last 3): 60 58 14
device removals: 0
crashes: 0
peak commit: 15773 MB
  1. this PR, second run:
xcl-smoke v1
commit: ba633669be03d9a41a314a3204d58fe4cc88237d
gpu: Meta Virtual Monitor
title: GTA6
seconds: 60
exit: 0x0
frames shown: 1261 (PresentX 1261)
presents per 2 s (last 3): 1 0 0
device removals: 0
crashes: 0
peak commit: 16236 MB
  1. main again, right after:
xcl-smoke v1
commit: 9ab7d763197c7f420bff10cd9bf1310f07e2a9aa
gpu: Meta Virtual Monitor
title: GTA6
seconds: 60
exit: 0x0
frames shown: 1262 (PresentX 1262)
presents per 2 s (last 3): 1 0 1
device removals: 0
crashes: 0
peak commit: 16302 MB

Reading: the consecutive pair 4 / 5 is 1261 vs 1262 frames and 16236 vs 16302 MB peak, so no difference between this PR and main on this title. The spread between runs of the same build (main 1470 → 1262) is far larger than any main / PR difference, and the near-zero presents at the end of runs 4 and 5 appear on both builds alike, so they come from where the title is by then (it stops presenting in its last seconds), not from this PR. Run 3's lower count and its 14 are what a first run with new shader translations looks like; run 4 does not repeat it.

Not tested: how many of the title's compute programs get padded (not counted); which screen the title reaches, and why it stops presenting near the end of runs 4 and 5, was not looked at; no RDNA4 / RDNA2 (this machine has one GPU).

Report written with Claude Code (Claude Fable 5.1) from the runs above; the commands and counts are from this machine.

@Kalmarv

Kalmarv commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@Rednaxeh thank you, the first AMD run and the first regression runs this PR has. One catch: after @JGonzalezRodriguez's finding above, the head moved to 3aaef99. The only change from ba63366 is the null-destination fix in partial_waves.rs / upper_lanes.rs and its tests (git diff ba63366 3aaef99). The PR check wants the PR's block made on the head commit. If you can, a single scripts/smoke.ps1 run built from 3aaef99, same title and length, is all it needs; your main blocks still count. Your results go into the description either way, with your name and hardware.

🤖 Claude Opus 5.5

@PHeitor1

Copy link
Copy Markdown

Re-tested the new head 3aaef99 merged onto main 2b4bb43 (clean merge) on RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed, so the debug-layer tests run), rustc 1.100.0 MSVC, debug, cargo test --workspace --no-fail-fast -- --test-threads=4, no XCL_SAMPLE_*.

Pass: 683 passed, 0 failed, 41 ignored. SKIPPED: only the 2 no wave64 tests.

Run and written with Claude Code (Claude Opus 5.5).

@Kalmarv

Kalmarv commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@Rednaxeh no need for a run at 3aaef99 any more: we have our own copy of the title now, and our pair at 3aaef99 is in the description. Thanks again for the earlier ones.

🤖 Claude Opus 5.5

@Kalmarv
Kalmarv force-pushed the fix/cs-pad-partial-waves branch from 3aaef99 to 761144d Compare November 24, 2026 03:43
@Rednaxeh

Copy link
Copy Markdown
Contributor

@Kalmarv three things the PR needs now, from a second RX 7800 XT (driver 32.0.32029.2010, Ryzen 7 7800X3D, 32 GB, Windows 11 26300, release builds):

1. The branch no longer merges into main (47efa2e): two small conflicts, both "both sides added a line at the same place":

  • emit.rs, the compute main prologue: main added self.safe_barrier_prelude(&mut h); where this PR adds let [nx, ny, nz] = padded.map_or([x, y, z], |t| [t, 1, 1]); – keep both, the prelude first.
  • pso.rs (cache_allowed and its test): main added XCL_X64_ALL_MASKS / XCL_WAVE64_SPIN to the variables that disable the shader cache, this PR adds XCL_CS_PAD_ALL / XCL_NO_CS_PAD – the list wants all four, in both places.

I have the merge resolved that way locally (65f966f = 47efa2e + 761144d, nothing else changed); I can push it as a branch if it saves you the rebase.

2. That merge still passes here. XCL_REQUIRE_GPU=wave64,mesh: gpu::recomp:: 201 passed, 0 failed, 18 ignored (the PR's four tests included); .\scripts\test.ps1: 753 passed, 0 failed, 41 ignored, 0 SKIPPED.

3. A smoke pair on the same main, release builds, no uncommitted changes, one after the other, no other load (a first run of the merge that overlapped a test run is left out). Both blocks unedited.

main 47efa2e:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: AMD  Radeon RX 7800 XT
title: retail-game6
seconds: 60
exit: 0x0
frames shown: 1319 (PresentX 1319)
presents per 2 s (last 3): 4 3 4
device removals: 0
crashes: 0
peak commit: 24793 MB

the merge 65f966f:

xcl-smoke v1
commit: 65f966fc99c73d7966f3461561d4927a15698ac5
gpu: AMD  Radeon RX 7800 XT
title: retail-game6
seconds: 60
exit: 0x0
frames shown: 1262 (PresentX 1262)
presents per 2 s (last 3): 0 3 8
device removals: 0
crashes: 0
peak commit: 27332 MB

Frames 96 % of main's, peak commit +10 %, no device removal, no crash: within the check's bounds. (On today's main the minute ends in the world loading on this card, hence the low last-3 on both.) The check itself wants the PR's block made on this PR's head, so after your rebase I'll run it once more on that commit – say the word.

AI use: Claude Code (Claude Fable 5.1) found and resolved the conflicts and wrote this; the runs were mine.

@Kalmarv

Kalmarv commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main 930e8b4 as 041772c (one commit; whole suite on an RTX 5070 Ti: 766 passed, 0 failed, 41 ignored, 2 SKIPPED for no wave64). The smoke pair for this head follows in the description.

@Rednaxeh: the two conflicts are resolved the way you did it (emit.rs: the prelude, then padded; pso.rs: all four variables in cache_allowed and its test). Thanks for the merge and the RX 7800 XT pair; we'll run our own pair on the new head.

Two fixes, squashed into the PR's commit:

  • s_barrier in a padded group. The barrier choice (compute_or_mesh_hw_waves) counted the group's threads without the padding, before the padding was decided. In split wave64 a group of 32 threads or fewer is padded to 64, two hardware waves, but was counted as one, so s_barrier lost its group sync. The count now includes the padding and is taken after it is decided. Test: a_padded_group_barrier_counts_its_padding_waves (fails without the fix).
  • @JGonzalezRodriguez's minor point: you were right. A wave32 program's S_*_SAVEEXEC_B64 / S_*_WREXEC_B64 is translated as the 32-bit form (EXEC_LO and SDST only), but partial_waves modelled it as 64-bit, so it could take EXEC_HI and SDST+1 as launched-lane subsets and not pad. The step now uses b64 && wave64. Test: a_wave32_saveexec_b64_writes_one_word (fails without the fix).

AI use: Claude Code (Claude Opus 5.5)

A console wave always has all its lanes: a 40-thread group is one wave64
with lanes 0..39 launched and 40..63 inactive, but there. v_writelane
writes them, and code that turns them on in EXEC (s_or_saveexec_b64 s, -1,
s_mov_b64 exec, -1, s_not_b64 exec, s_wqm_b64 exec) runs in them. A PC
group of 40 threads has no such lanes: on an RTX 5070 Ti s_or_saveexec -1
followed by a compare gave 40 mask bits instead of 64, s_not exec followed
by one 0 instead of 24.

A compute program that can tell (partial_waves.rs: a v_writelane to a lane
the last wave may not launch, or EXEC that may leave the launched lanes) now
gets its group declared as whole console waves, with EXEC starting as the
ballot of thread index < the console's thread count. Thread ids come from
the index (xcl_x_thread in the split form, the 2-D / 3-D groups' thread
counter natively). Every other program keeps its group and its HLSL.
TG_SIZE, group ids and LDS are unchanged. XCL_CS_PAD_ALL=1 pads every
partial group, XCL_NO_CS_PAD=1 none; both bypass the shader caches.

A 64-bit write to NULL (s125) writes nothing: the pass wrote its high word
to s126 (EXEC_LO), and upper_lanes::sgpr_outputs listed a null SDST / VDST
as (125, 2). So `s_or_saveexec_b64 null, 0xFFFFFFFF` with EXEC_HI 0 was not
seen as turning on lanes (a group of 20 then counted 20 lanes, not 32), and
s_and_saveexec_b64 null / s_and_b64 null / a VOP3 v_cmp to null padded
for nothing. Found by JGonzalezRodriguez.

A wave32 program's _B64 saveexec / wrexec forms are its _B32 ones, as Em
translates them: the pass no longer gives EXEC_HI and the pair's high word
their result, which could take a word the translation leaves alone for a
subset of the launched lanes (JGonzalezRodriguez).

s_barrier's form counts the group's hardware waves with its padding, after
the padding is decided: split wave64 runs a group of 32 threads or fewer,
padded to 64, as two 32-lane waves, and its barrier keeps the group sync
(xcl_s_barrier) instead of becoming a bare GroupMemoryBarrier.

Tests: gpu_wave64_valu_code_in_lanes_not_launched,
gpu_wave32_valu_code_in_lanes_not_launched (both fail without the padding),
gpu_padded_compute_groups_look_the_same_to_the_program,
gpu_wave64_saveexec_to_null_turns_on_lanes_not_launched,
compute_groups_are_padded_only_where_the_program_can_tell,
a_padded_group_barrier_counts_its_padding_waves,
partial_waves::tests.

Not covered: mesh and geometry programs, VS / PS. Not run on AMD.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Kalmarv
Kalmarv force-pushed the fix/cs-pad-partial-waves branch from 041772c to 63a55a0 Compare November 24, 2026 17:44
@Kalmarv

Kalmarv commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main 9e3831e as 63a55a0. One conflict: Options::default() in crates/xcl/src/gpu/recomp/mod.rs, where #680 added heap_windows and this PR adds pad_waves; the line keeps both. git range-diff against 041772c shows no other changed line.

Tested (RTX 5070 Ti, NVIDIA 610.74, Ryzen 9 9950X, Windows 11 Pro 26200, debug)

  • cargo test --workspace -- --test-threads=4 on 63a55a0: 791 passed, 0 failed, 41 ignored (the xcl library: 742 passed, 21 ignored). SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64), and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows; Recompiler: memory windows from the descriptor heap (no per-access switch) #680's test).

A smoke pair for 63a55a0 against main 9e3831e follows in the description. @Rednaxeh, if your offer (7130411564) still stands, a rerun of your RX 7800 XT pair on 63a55a0 would cover wave64 hardware for the rebased head.

AI use: Claude Code (Claude Opus 5.5)

kacper-serewis pushed a commit to kacper-serewis/xcl that referenced this pull request Nov 24, 2026
A console wave always has all its lanes: a 40-thread group is one wave64
with lanes 0..39 launched and 40..63 inactive, but there. v_writelane
writes them, and code that turns them on in EXEC (s_or_saveexec_b64 s, -1,
s_mov_b64 exec, -1, s_not_b64 exec, s_wqm_b64 exec) runs in them. A PC
group of 40 threads has no such lanes: on an RTX 5070 Ti s_or_saveexec -1
followed by a compare gave 40 mask bits instead of 64, s_not exec followed
by one 0 instead of 24.

A compute program that can tell (partial_waves.rs: a v_writelane to a lane
the last wave may not launch, or EXEC that may leave the launched lanes) now
gets its group declared as whole console waves, with EXEC starting as the
ballot of thread index < the console's thread count. Thread ids come from
the index (xcl_x_thread in the split form, the 2-D / 3-D groups' thread
counter natively). Every other program keeps its group and its HLSL.
TG_SIZE, group ids and LDS are unchanged. XCL_CS_PAD_ALL=1 pads every
partial group, XCL_NO_CS_PAD=1 none; both bypass the shader caches.

A 64-bit write to NULL (s125) writes nothing: the pass wrote its high word
to s126 (EXEC_LO), and upper_lanes::sgpr_outputs listed a null SDST / VDST
as (125, 2). So `s_or_saveexec_b64 null, 0xFFFFFFFF` with EXEC_HI 0 was not
seen as turning on lanes (a group of 20 then counted 20 lanes, not 32), and
s_and_saveexec_b64 null / s_and_b64 null / a VOP3 v_cmp to null padded
for nothing. Found by JGonzalezRodriguez.

A wave32 program's _B64 saveexec / wrexec forms are its _B32 ones, as Em
translates them: the pass no longer gives EXEC_HI and the pair's high word
their result, which could take a word the translation leaves alone for a
subset of the launched lanes (JGonzalezRodriguez).

s_barrier's form counts the group's hardware waves with its padding, after
the padding is decided: split wave64 runs a group of 32 threads or fewer,
padded to 64, as two 32-lane waves, and its barrier keeps the group sync
(xcl_s_barrier) instead of becoming a bare GroupMemoryBarrier.

Tests: gpu_wave64_valu_code_in_lanes_not_launched,
gpu_wave32_valu_code_in_lanes_not_launched (both fail without the padding),
gpu_padded_compute_groups_look_the_same_to_the_program,
gpu_wave64_saveexec_to_null_turns_on_lanes_not_launched,
compute_groups_are_padded_only_where_the_program_can_tell,
a_padded_group_barrier_counts_its_padding_waves,
partial_waves::tests.

Not covered: mesh and geometry programs, VS / PS. Not run on AMD.

(cherry picked from commit 63a55a0, upstream PR xcl-dev#245 by Kalmarv)
[Ported onto bff0e6b. mod.rs: Options and its Default keep both
int64_typed_atomic and pad_waves. tests.rs: both sides' new tests kept.
No other line differs from 63a55a0.]

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5bd41e742a219c41b9b2d30ef9b12a1726d3d51e)
kacper-serewis added a commit to kacper-serewis/xcl that referenced this pull request Nov 24, 2026
partial_waves.rs decides which compute groups are padded, so it decides the
HLSL, but build.rs hashes a list of files and xcl-dev#245 did not add it. The
translated-shader cache on disk is keyed by that hash: a later change to
partial_waves.rs alone would have run the old translations.

translated_identity_covers_the_recompiler_modules names any module of the
recompiler missing from the list (without the build.rs line: partial_waves).

Found while porting upstream PR xcl-dev#245 (63a55a0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 7184873cbdb57235d67bea8bdeb2eb7c4fd3701e)
@raylitebull

Copy link
Copy Markdown
Member

CI checks (Build and test and PR description) are green on 63a55a0.

Remaining before merge: an independent AMD GPU pass on the current revised head 63a55a0.

@Kalmarv

Kalmarv commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, @raylitebull. An AMD pass on the current head 63a55a0 is the one missing piece. We have no AMD card here, so this needs someone who does. @srcamarda and @DarkPanda69, you've run AMD passes on related heads before. If either of you has time:

git fetch https://github.com/xcl-dev/xcl.git pull/245/head && git checkout FETCH_HEAD
cargo test --release -p xcl --lib -- --test-threads=4

Please post the passed, failed and ignored counts, any SKIPPED lines, and your GPU, driver and DXC version.

AI use: Claude Code (Claude Opus 5.5) wrote this.

@DarkPanda69

Copy link
Copy Markdown

@Kalmarv here's the AMD pass you asked for, on the current head 63a55a0 (63a55a033), checked out as is (no local changes), in the form you gave. Note that this head no longer merges cleanly into current main, so I tested it on its own base.

Tested: Windows 11 Pro 26200, Ryzen 7 5800X, rustc 1.100.0, DXC 1.9.2602.17, release. cargo test --release -p xcl --lib -- --test-threads=4:

  • AMD RX 9070 XT (RDNA4, driver 32.0.32029.2010, waves 32..64): 742 passed, 0 failed, 21 ignored, no SKIPPED lines, so every wave64 test ran natively.
  • NVIDIA RTX 3060 (driver 32.0.16.1088, waves 32 only), for comparison: 742 passed, 0 failed, 21 ignored. SKIPPED (2): gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64).

Not tested: a title, the head rebased onto current main.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants