Recompiler: ds_bpermute_b32 in wave64 stays in each 32-lane half (#772) #1015

Open
upipibi wants to merge 3 commits from upstream-pr/1022 into main
upipibi commented 2026-11-24 10:26:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T10:26:52Z.


Branch fix/bpermute-wave64, head 7e1b659 (rebased onto main 6e1e2be; merges cleanly with current main).

Fixes #772.

What the hardware does

In native wave64 on RDNA2, ds_bpermute_b32 lets lane l read lane (l & 32) | (((addr + offset) >> 2) & 31). If that lane is inactive, the result is 0. Two people measured it:

XCL used & 63 and read across the halves. That follows the opcode table's "mod 64". The ACO lowering and both measurements disagree with it.

The change

emit.rs, "ds_bpermute_b32"

  • In wave64, the index is (lane_id & 32u) | (((addr + offset) >> 2) & 31u). Wave32 is unchanged.
  • The read goes through rla_half_fn, as ds_swizzle does.
  • Split wave64 needs no exchange any more, so xcl_x_rla_any and its 32-word exchange slot are removed.
  • In a 32-lane wave of a wave64 VS / PS, the permute can no longer reach lanes 32..63. The upper_lanes constant case (select(and(xcl_hw32, l >= 32), c, …)) is therefore removed.

upper_lanes.rs

  • ds_bpermute is no longer counted as a read of lanes ≥ 32.
  • ds_permute keeps its hazard; #925 covers that instruction.

docs/wave64-on-wave32.md

  • The exchange table, the memory slot, the cost paragraph and the VS / PS section now list ds_bpermute with the reads that stay inside their half.

The emitter's lines for wave64 in the split form:

before: uint {t}_l = (({addr} + {offset}u) >> 2) & 63u;                   uint {t} = xcl_x_rla_any({data}, {t}_l);
after:  uint {t}_l = (lane_id & 32u) | ((({addr} + {offset}u) >> 2) & 31u); uint {t} = xcl_x_rla_half({data}, {t}_l);

Test

The new test is gpu_ds_bpermute_wave64_stays_in_its_half. It uses source data 1000 + lane, so a 0 from an inactive lane can't be mistaken for lane 0. It runs seven cases and compares each with the measured model. It also checks these lanes from luckyteagirl's report directly:

  • 63 - lane: lane 0 reads 31, lane 32 reads 63, lane 63 reads 32
  • (lane + 1) & 63: lane 31 reads 0, lane 63 reads 32

Before (main 6efdabc with the new test): 226 wrong lanes. The counts per case match the "full-wave" column of certified-retart's table.

case wrong lanes
4 * lane (identity) 0
4 * (63 - lane) 64
4 * ((lane + 1) & 63) 2
4 * lane, offset:4 2
4 * lane, offset:128 64
4 * (63 - lane), offset:4 62
4 * (lane ^ 32), EXEC 0xAAAAAAAA_55555555 32

After: all seven cases match.

Three existing assertions encoded the cross-half reading and now expect the half-wave lanes. These are the same three that @NathanTheophile listed on the issue:

test old expectation new expectation
gpu_format_stores_atomics_global_lds 63 - l l ^ 31
gpu_split_wave64_cross_half_operations 63 - l l ^ 31
gpu_split_wave64_waves_diverge l ^ 33 l ^ 1

outside_whole_wave_code_the_upper_lanes_stay_unwritten now expects one read where it used to expect two. ds_bpermute is no longer a read of lanes ≥ 32, even after whole-wave code has written them.

The rebase follows Royalflamejlh's recipe (https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7361828945), thanks: xcl_x_rla_any( leaves the exchanged list, read_lane_any goes, and main's is_pixel / live_lanes stay.

Tested

At the current head 5f42473 (rebased onto main e99b0bd on 2026-12-03): NVIDIA GeForce RTX 3070, driver 621.40, Windows 11 Pro, rustc 1.100.0, debug.

  • cargo test -p xcl --lib -- --test-threads=4 (default, direct backend): 2864 passed, 0 failed, 37 ignored
  • The 9 tests listed below plus main's split_wave64_lds_reads_meet_after_writes, 3 runs each with XCL_DIRECT_DXIL=0 and =1: 10 passed, 0 failed every run (gpu_format_stores_atomics_global_lds now passes on =1 too).
  • Red: main's versions of the code files with this PR's tests: 3 passed, 7 failed on both paths (gpu_ds_bpermute_wave64_stays_in_its_half: 226 wrong lanes, as below).

Earlier, at 45e3856:

  • At 45e3856 (rebased onto main e429936), RTX 3070 (616.56), split wave64, debug: 7e1b659 (docs: split exchanges spin by default) is dropped. main's 4701a87 went back to a group barrier for groups of one console wave (x64_spin_for: threads > 64 or XCL_WAVE64_SPIN set to anything but 0; direct DXIL 33..=64 => Partner::Present), and main's docs/wave64-on-wave32.md already says that, so the PR no longer touches that section. The test commit now also counts 1 + 2 meets in the two split_wave64_reduction{,32}_exchange_orders_the_next_lds_access tests added to main since (e909e14). The emit.rs conflict keeps main's code everywhere except ds_bpermute_b32, whose in-half read needs no exchange (so no x64_met()). cargo test -p xcl --lib -- --test-threads=4: 1996 passed, 6 failed, 28 ignored (main e429936: 1995 / 6 / 28, the same 6 failures, #3093). The PR's 9 tests (the seven above plus the two new ones) ×3: 9/9 with XCL_DIRECT_DXIL=0; 8/9 with =1, because gpu_format_stores_atomics_global_lds stops at "split wave64 LDS access needs the HLSL path", which main e429936 does too (dbe6b30). The regression pair below is for 7e1b659 and has to be redone for this head.

  • At 7e1b659 (rebased onto main 6e1e2be), RTX 3070 (616.56), split wave64: the direct DXIL path now also keeps ds_bpermute_b32 in each half (c673925: lane (lane & 32) | (((addr + offset) >> 2) & 31), as the HLSL path does; read_lane_any and its 32-word exchange slot removed), found by cindertheblue. Targeted tests (the five from the review plus split_wave64_reduction_tail_rules and gpu_ds_swizzle_and_bpermute_zero_inactive_lanes): before 6/7 with XCL_DIRECT_DXIL=0 and 2/7 with =1 (226 wrong lanes), after 7/7 on both. split_wave64_reduction_tail_rules (added to main since) now counts 1 + 2 meets (7dc382b). Full gpu_ suite: 135 passed with 0; with 1, 134 passed and 1 failed: gpu_image_get_resinfo_1d_array, which fails on main too (#2046).
    RTX 3070, driver 616.56, Windows 11, DXC 1.8.2502.11. The command was cargo test --workspace --no-fail-fast -- --test-threads=4, in its own target dir.

passed failed ignored
main 6efdabc 727 0 41
212fb96 728 0 41

On both, the usual two tests were skipped (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.

This GPU has 32-lane waves only, so every wave64 case above ran in the split form. The native wave64 path is not run here.

  • @NathanTheophile (RTX 4060 Laptop) and @SlopTart (RX 7900 XT, which also covers split wave64 forced on wave64 hardware) offered to run it.
  • On RADV the native wave64 form goes through ACO's own full-wave emulation of WaveReadLaneAt, so the explicit (lane_id & 32) index is what keeps it half-wave there.

Notes

  • @nineforge0 counted 0 ds_bpermute_b32 in the 22 532 wave64 programs of the retail cache. This is a correctness fix for the instruction, not for any retail shader seen so far.
  • @NathanTheophile wrote the same fix on a local branch (comment on #772). He found the same three assertions.

Regression run

The pair below is for the earlier head 45e3856, before the 2026-12-03 rebase; a pair on 5f42473 is needed.

Pair for the current head 7e1b659 against main afc5ee8, run by Kalmarv (comment, thanks): RTX 5070 Ti, scripts/smoke.ps1 -Seconds 60, release builds from clean trees. Pasted as printed. Their note: this head sits on a much older main than afc5ee8, so the frame (1239 / 1126) and commit (26949 / 23683 MB) differences can't be put down to this change alone; neither run had a device removal or a crash.

xcl-smoke v1
commit: afc5ee86ae3a9521c9f15d96505cd73fe72f2191
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1126 (PresentX 1126)
presents per 2 s (last 3): 4 1 5
device removals: 0
crashes: 0
peak commit: 23683 MB
xcl-smoke v1
commit: 7e1b659cfcd95c37d8710c85adb3753847455575
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1239 (PresentX 1240)
presents per 2 s (last 3): 22 19 40
device removals: 0
crashes: 0
peak commit: 26949 MB

Earlier pair (for 212fb96, before the rebase):
Smoke pair by Kalmarv (RTX 5070 Ti, driver 610.74), main 6efdabc (this PR's base) against 212fb96: 1184 / 1248 frames, no crash, no device removal on either side (comment).

main:

xcl-smoke v1
commit: 6efdabcdaac93ce5cc123a85e85deba5d49cb294
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1248 (PresentX 1248)
presents per 2 s (last 3): 15 32 13
device removals: 0
crashes: 0
peak commit: 28204 MB

PR:

xcl-smoke v1
commit: 212fb961819b45d7bd4b903bf5a823af044674cb
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1184 (PresentX 1184)
presents per 2 s (last 3): 4 0 4
device removals: 0
crashes: 0
peak commit: 25996 MB

Not tested

  • Retail titles (no ds_bpermute_b32 in the 22 532 wave64 programs counted on #772, so a smoke run is a regression check only).
  • Native wave64 hardware: this GPU runs only the split form.

AI use

  • AI-assisted (Claude Code): checked the hardware reports against the code, wrote the fix, the test and this description, and ran the tests above.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5470385362 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T10:26:52Z. --- Branch `fix/bpermute-wave64`, head `7e1b659` (rebased onto `main` `6e1e2be`; merges cleanly with current `main`). Fixes #772. ## What the hardware does In native wave64 on RDNA2, `ds_bpermute_b32` lets lane `l` read lane `(l & 32) | (((addr + offset) >> 2) & 31)`. If that lane is inactive, the result is 0. Two people measured it: - **luckyteagirl**, RX 6800M (gfx1031), https://github.com/ivall/xcl/issues/772#issuecomment-7123462950. Full EXEC, with indices `lane`, `63 - lane` and `(lane + 1) & 63`. The half-wave model matched 64/64 lanes in each case. - **certified-retart**, gfx1036, https://github.com/ivall/xcl/issues/772#issuecomment-7127381205. Partial EXEC masks and immediate offsets 2, 4, 128, 132 and 65532. All 21 cases matched 64/64. XCL used `& 63` and read across the halves. That follows the opcode table's "mod 64". The ACO lowering and both measurements disagree with it. ## The change **`emit.rs`, `"ds_bpermute_b32"`** - In wave64, the index is `(lane_id & 32u) | (((addr + offset) >> 2) & 31u)`. Wave32 is unchanged. - The read goes through `rla_half_fn`, as `ds_swizzle` does. - Split wave64 needs no exchange any more, so `xcl_x_rla_any` and its 32-word exchange slot are removed. - In a 32-lane wave of a wave64 VS / PS, the permute can no longer reach lanes 32..63. The `upper_lanes` constant case (`select(and(xcl_hw32, l >= 32), c, …)`) is therefore removed. **`upper_lanes.rs`** - `ds_bpermute` is no longer counted as a read of lanes ≥ 32. - `ds_permute` keeps its hazard; #925 covers that instruction. **`docs/wave64-on-wave32.md`** - The exchange table, the memory slot, the cost paragraph and the VS / PS section now list `ds_bpermute` with the reads that stay inside their half. The emitter's lines for wave64 in the split form: ``` before: uint {t}_l = (({addr} + {offset}u) >> 2) & 63u; uint {t} = xcl_x_rla_any({data}, {t}_l); after: uint {t}_l = (lane_id & 32u) | ((({addr} + {offset}u) >> 2) & 31u); uint {t} = xcl_x_rla_half({data}, {t}_l); ``` ## Test The new test is `gpu_ds_bpermute_wave64_stays_in_its_half`. It uses source data `1000 + lane`, so a 0 from an inactive lane can't be mistaken for lane 0. It runs seven cases and compares each with the measured model. It also checks these lanes from luckyteagirl's report directly: - `63 - lane`: lane 0 reads 31, lane 32 reads 63, lane 63 reads 32 - `(lane + 1) & 63`: lane 31 reads 0, lane 63 reads 32 **Before** (`main` `6efdabc` with the new test): 226 wrong lanes. The counts per case match the "full-wave" column of certified-retart's table. | case | wrong lanes | | --- | ---: | | `4 * lane` (identity) | 0 | | `4 * (63 - lane)` | 64 | | `4 * ((lane + 1) & 63)` | 2 | | `4 * lane`, `offset:4` | 2 | | `4 * lane`, `offset:128` | 64 | | `4 * (63 - lane)`, `offset:4` | 62 | | `4 * (lane ^ 32)`, EXEC `0xAAAAAAAA_55555555` | 32 | **After:** all seven cases match. Three existing assertions encoded the cross-half reading and now expect the half-wave lanes. These are the same three that @NathanTheophile listed on the issue: | test | old expectation | new expectation | | --- | --- | --- | | `gpu_format_stores_atomics_global_lds` | `63 - l` | `l ^ 31` | | `gpu_split_wave64_cross_half_operations` | `63 - l` | `l ^ 31` | | `gpu_split_wave64_waves_diverge` | `l ^ 33` | `l ^ 1` | `outside_whole_wave_code_the_upper_lanes_stay_unwritten` now expects one read where it used to expect two. `ds_bpermute` is no longer a read of lanes ≥ 32, even after whole-wave code has written them. The rebase follows Royalflamejlh's recipe (https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7361828945), thanks: `xcl_x_rla_any(` leaves the `exchanged` list, `read_lane_any` goes, and `main`'s `is_pixel` / `live_lanes` stay. **Tested** At the current head 5f42473 (rebased onto `main` e99b0bd on 2026-12-03): NVIDIA GeForce RTX 3070, driver 621.40, Windows 11 Pro, rustc 1.100.0, debug. - `cargo test -p xcl --lib -- --test-threads=4` (default, direct backend): 2864 passed, 0 failed, 37 ignored - The 9 tests listed below plus `main`'s `split_wave64_lds_reads_meet_after_writes`, 3 runs each with `XCL_DIRECT_DXIL=0` and `=1`: 10 passed, 0 failed every run (`gpu_format_stores_atomics_global_lds` now passes on `=1` too). - Red: `main`'s versions of the code files with this PR's tests: 3 passed, 7 failed on both paths (`gpu_ds_bpermute_wave64_stays_in_its_half`: 226 wrong lanes, as below). Earlier, at 45e3856: - At `45e3856` (rebased onto `main` `e429936`), RTX 3070 (616.56), split wave64, debug: `7e1b659` (docs: split exchanges spin by default) is dropped. `main`'s `4701a87` went back to a group barrier for groups of one console wave (`x64_spin_for`: `threads > 64` or `XCL_WAVE64_SPIN` set to anything but `0`; direct DXIL `33..=64 => Partner::Present`), and `main`'s `docs/wave64-on-wave32.md` already says that, so the PR no longer touches that section. The test commit now also counts 1 + 2 meets in the two `split_wave64_reduction{,32}_exchange_orders_the_next_lds_access` tests added to `main` since (`e909e14`). The `emit.rs` conflict keeps `main`'s code everywhere except `ds_bpermute_b32`, whose in-half read needs no exchange (so no `x64_met()`). `cargo test -p xcl --lib -- --test-threads=4`: 1996 passed, 6 failed, 28 ignored (`main` `e429936`: 1995 / 6 / 28, the same 6 failures, #3093). The PR's 9 tests (the seven above plus the two new ones) ×3: 9/9 with `XCL_DIRECT_DXIL=0`; 8/9 with `=1`, because `gpu_format_stores_atomics_global_lds` stops at "split wave64 LDS access needs the HLSL path", which `main` `e429936` does too (`dbe6b30`). The regression pair below is for `7e1b659` and has to be redone for this head. - At `7e1b659` (rebased onto `main` `6e1e2be`), RTX 3070 (616.56), split wave64: the direct DXIL path now also keeps `ds_bpermute_b32` in each half (`c673925`: lane `(lane & 32) | (((addr + offset) >> 2) & 31)`, as the HLSL path does; `read_lane_any` and its 32-word exchange slot removed), found by cindertheblue. Targeted tests (the five from the review plus `split_wave64_reduction_tail_rules` and `gpu_ds_swizzle_and_bpermute_zero_inactive_lanes`): before 6/7 with `XCL_DIRECT_DXIL=0` and 2/7 with `=1` (226 wrong lanes), after 7/7 on both. `split_wave64_reduction_tail_rules` (added to `main` since) now counts 1 + 2 meets (`7dc382b`). Full `gpu_` suite: 135 passed with `0`; with `1`, 134 passed and 1 failed: `gpu_image_get_resinfo_1d_array`, which fails on `main` too (#2046). RTX 3070, driver 616.56, Windows 11, DXC 1.8.2502.11. The command was `cargo test --workspace --no-fail-fast -- --test-threads=4`, in its own target dir. | | passed | failed | ignored | | --- | ---: | ---: | ---: | | `main` `6efdabc` | 727 | 0 | 41 | | `212fb96` | 728 | 0 | 41 | On both, the usual two tests were skipped (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. This GPU has 32-lane waves only, so every wave64 case above ran in the split form. **The native wave64 path is not run here.** - @NathanTheophile (RTX 4060 Laptop) and @SlopTart (RX 7900 XT, which also covers split wave64 forced on wave64 hardware) offered to run it. - On RADV the native wave64 form goes through ACO's own full-wave emulation of `WaveReadLaneAt`, so the explicit `(lane_id & 32)` index is what keeps it half-wave there. **Notes** - @nineforge0 counted 0 `ds_bpermute_b32` in the 22 532 wave64 programs of the retail cache. This is a correctness fix for the instruction, not for any retail shader seen so far. - @NathanTheophile wrote the same fix on a local branch (comment on #772). He found the same three assertions. **Regression run** The pair below is for the earlier head 45e3856, before the 2026-12-03 rebase; a pair on 5f42473 is needed. Pair for the current head `7e1b659` against `main` `afc5ee8`, run by Kalmarv ([comment](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7164653114), thanks): RTX 5070 Ti, `scripts/smoke.ps1 -Seconds 60`, release builds from clean trees. Pasted as printed. Their note: this head sits on a much older `main` than `afc5ee8`, so the frame (1239 / 1126) and commit (26949 / 23683 MB) differences can't be put down to this change alone; neither run had a device removal or a crash. ``` xcl-smoke v1 commit: afc5ee86ae3a9521c9f15d96505cd73fe72f2191 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1126 (PresentX 1126) presents per 2 s (last 3): 4 1 5 device removals: 0 crashes: 0 peak commit: 23683 MB ``` ``` xcl-smoke v1 commit: 7e1b659cfcd95c37d8710c85adb3753847455575 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1239 (PresentX 1240) presents per 2 s (last 3): 22 19 40 device removals: 0 crashes: 0 peak commit: 26949 MB ``` Earlier pair (for `212fb96`, before the rebase): Smoke pair by Kalmarv (RTX 5070 Ti, driver 610.74), `main` `6efdabc` (this PR's base) against `212fb96`: 1184 / 1248 frames, no crash, no device removal on either side ([comment](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7137283899)). main: ``` xcl-smoke v1 commit: 6efdabcdaac93ce5cc123a85e85deba5d49cb294 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1248 (PresentX 1248) presents per 2 s (last 3): 15 32 13 device removals: 0 crashes: 0 peak commit: 28204 MB ``` PR: ``` xcl-smoke v1 commit: 212fb961819b45d7bd4b903bf5a823af044674cb gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1184 (PresentX 1184) presents per 2 s (last 3): 4 0 4 device removals: 0 crashes: 0 peak commit: 25996 MB ``` **Not tested** - Retail titles (no `ds_bpermute_b32` in the 22 532 wave64 programs counted on #772, so a smoke run is a regression check only). - Native wave64 hardware: this GPU runs only the split form. **AI use** - AI-assisted (Claude Code): checked the hardware reports against the code, wrote the fix, the test and this description, and ran the tests above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
KENAJBBY commented 2026-11-24 11:05:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KENAJBBY on 2026-11-24T10:33:18Z.


Native wave64 run on RDNA2, the form Not tested lists: pass, and the test's seven cases measured on the hardware with the same inputs.

Tested: head 212fb96 (base main 6efdabc), debug. Windows 11 Pro 26200; AMD Radeon iGPU of the Ryzen 7 9800X3D (gfx1036, RDNA2, native 64-lane waves; driver 32.0.21030.2001); NVIDIA RTX 5070 Ti (driver 621.24, 32-lane waves); Rust 1.100.0 MSVC; DXC 1.9.2602.17. One test process at a time.

Radeon gfx1036, XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64 (native wave64) RTX 5070 Ti, XCL_ADAPTER=nvidia (split wave64)
gpu_ds_bpermute_wave64_stays_in_its_half passed passed
the bpermute, ds_swizzle, ds_permute, split_wave64, upper_lanes and gpu_format_stores_atomics_global_lds tests (20) 20 passed 20 passed
the new test against main's translation (emit.rs of 6efdabc) fails: 226 wrong, e.g. lane 0 4 * (63 - lane): 1063, want 1031 –
cargo test --workspace --no-fail-fast -- --test-threads=4 728 passed, 0 failed, 41 ignored, 0 SKIPPED 728 passed, 0 failed, 41 ignored; SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware

So the native wave64 path gives the half-wave result, and the native form tells the old and new translations apart by the same 226 lanes as your split run.

The test's expected values against the hardware. I ran each of the test's seven cases as raw ds_bpermute_b32 on the same gfx1036 with inline RDNA2 assembly through AMD's OpenCL driver (-cl-std=CL2.0 -Wf,-mwavefrontsize64; v_mbcnt gives lanes 0..63 and s_bcnt1_i32_b64 exec = 64 in the same wave; EXEC set with s_mov_b64 around the instruction; 3 runs each, identical). Each one matches the half-wave model in 64 of 64 lanes, which is the model the test checks:

case half-wave model full-wave (& 63)
4 * lane 64/64 64/64
4 * (63 - lane) 64/64 0/64
4 * ((lane + 1) & 63) 64/64 62/64
4 * lane, offset:4 64/64 62/64
4 * lane, offset:128 64/64 0/64
4 * (63 - lane), offset:4 64/64 2/64
4 * (lane ^ 32), EXEC 0xAAAAAAAA_55555555 (inactive lanes keep VDST) 64/64 32/64

The last two were only measured by @certified-retart so far; this is a second gfx1036, with the same result.

Not tested: the console itself (gfx1036 is a desktop RDNA2 APU of the same generation), RDNA1, a wave64 VS / PS in 32-lane waves (the removed upper_lanes constant case), pixel shaders, a release build, xcl-smoke or any title.

AI use: Claude Code (Claude Opus 5.5) ran the hardware probe and the tests on my PC and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7128935759 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1022#issuecomment-7128935759). Originally posted by [KENAJBBY](https://github.com/KENAJBBY) on 2026-11-24T10:33:18Z. --- Native wave64 run on RDNA2, the form **Not tested** lists: **pass**, and the test's seven cases measured on the hardware with the same inputs. **Tested:** head `212fb96` (base `main` `6efdabc`), debug. Windows 11 Pro 26200; AMD Radeon iGPU of the Ryzen 7 9800X3D (`gfx1036`, RDNA2, native 64-lane waves; driver 32.0.21030.2001); NVIDIA RTX 5070 Ti (driver 621.24, 32-lane waves); Rust 1.100.0 MSVC; DXC 1.9.2602.17. One test process at a time. | | Radeon `gfx1036`, `XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64` (native wave64) | RTX 5070 Ti, `XCL_ADAPTER=nvidia` (split wave64) | | --- | --- | --- | | `gpu_ds_bpermute_wave64_stays_in_its_half` | passed | passed | | the `bpermute`, `ds_swizzle`, `ds_permute`, `split_wave64`, `upper_lanes` and `gpu_format_stores_atomics_global_lds` tests (20) | 20 passed | 20 passed | | the new test against `main`'s translation (`emit.rs` of `6efdabc`) | fails: `226 wrong`, e.g. `lane 0 4 * (63 - lane): 1063, want 1031` | – | | `cargo test --workspace --no-fail-fast -- --test-threads=4` | 728 passed, 0 failed, 41 ignored, 0 `SKIPPED` | 728 passed, 0 failed, 41 ignored; `SKIPPED` (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` | So the native wave64 path gives the half-wave result, and the native form tells the old and new translations apart by the same 226 lanes as your split run. **The test's expected values against the hardware.** I ran each of the test's seven cases as raw `ds_bpermute_b32` on the same `gfx1036` with inline RDNA2 assembly through AMD's OpenCL driver (`-cl-std=CL2.0 -Wf,-mwavefrontsize64`; `v_mbcnt` gives lanes 0..63 and `s_bcnt1_i32_b64 exec` = 64 in the same wave; EXEC set with `s_mov_b64` around the instruction; 3 runs each, identical). Each one matches the half-wave model in 64 of 64 lanes, which is the model the test checks: | case | half-wave model | full-wave (`& 63`) | | --- | ---: | ---: | | `4 * lane` | 64/64 | 64/64 | | `4 * (63 - lane)` | 64/64 | 0/64 | | `4 * ((lane + 1) & 63)` | 64/64 | 62/64 | | `4 * lane`, `offset:4` | 64/64 | 62/64 | | `4 * lane`, `offset:128` | 64/64 | 0/64 | | `4 * (63 - lane)`, `offset:4` | 64/64 | 2/64 | | `4 * (lane ^ 32)`, EXEC `0xAAAAAAAA_55555555` (inactive lanes keep VDST) | 64/64 | 32/64 | The last two were only measured by @certified-retart so far; this is a second `gfx1036`, with the same result. **Not tested:** the console itself (`gfx1036` is a desktop RDNA2 APU of the same generation), RDNA1, a wave64 VS / PS in 32-lane waves (the removed `upper_lanes` constant case), pixel shaders, a release build, `xcl-smoke` or any title. **AI use:** Claude Code (Claude Opus 5.5) ran the hardware probe and the tests on my PC and wrote this comment.
DavidM1911 commented 2026-11-24 11:06:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T11:05:46Z.


Independent verification, merged onto current main 384f7f7 locally (clean merge).

Machine: Windows 11, Ryzen 9 7900X Radeon iGPU (gfx1036, RDNA2, native wave64 — the hardware class this fix targets), RTX 3060 Ti also present; Rust stable MSVC, debug.

  • XCL_ADAPTER=radeon cargo test -p xcl --lib bpermute: 2 passed — gpu_ds_bpermute_wave64_stays_in_its_half and gpu_ds_swizzle_and_bpermute_zero_inactive_lanes both run on the Radeon (backend 'real' – AMD Radeon(TM) Graphics confirmed in output).
  • XCL_ADAPTER=radeon cargo test -p xcl --lib recomp -- --test-threads=4: 189 passed, 0 failed, 18 ignored (ignored = XCL_SAMPLE_* retail-survey tests; all GPU wave64 tests ran).

AI use: test runs by Devin (Cognition, SWE-2); no code changes.

<!-- greyfinch-sync:ivall/xcl:comment:7129648782 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1022#issuecomment-7129648782). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T11:05:46Z. --- Independent verification, merged onto current `main` `384f7f7` locally (clean merge). **Machine:** Windows 11, Ryzen 9 7900X Radeon iGPU (gfx1036, RDNA2, native wave64 — the hardware class this fix targets), RTX 3060 Ti also present; Rust stable MSVC, debug. - `XCL_ADAPTER=radeon cargo test -p xcl --lib bpermute`: **2 passed** — `gpu_ds_bpermute_wave64_stays_in_its_half` and `gpu_ds_swizzle_and_bpermute_zero_inactive_lanes` both run on the Radeon (backend 'real' – AMD Radeon(TM) Graphics confirmed in output). - `XCL_ADAPTER=radeon cargo test -p xcl --lib recomp -- --test-threads=4`: **189 passed, 0 failed, 18 ignored** (ignored = `XCL_SAMPLE_*` retail-survey tests; all GPU wave64 tests ran). AI use: test runs by Devin (Cognition, SWE-2); no code changes.
DavidM1911 commented 2026-11-24 12:05:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T11:33:24Z.


Independent verification, merged onto current main 384f7f7 locally (clean merge).

Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.

  • cargo test -p xcl --lib bpermute: 2 passed, 0 failed — including the new GPU test gpu_ds_bpermute_wave64_stays_in_its_half, which runs on this adapter (wave64 emitted as two wave32 halves with per-half lane fixup). gpu_ds_swizzle_and_bpermute_zero_inactive_lanes also passes.

AI use: test runs by Devin (Cognition, SWE-2); no code changes.

<!-- greyfinch-sync:ivall/xcl:comment:7130248809 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1022#issuecomment-7130248809). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T11:33:24Z. --- Independent verification, merged onto current `main` `384f7f7` locally (clean merge). **Machine:** Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug. - `cargo test -p xcl --lib bpermute`: **2 passed, 0 failed** — including the new GPU test `gpu_ds_bpermute_wave64_stays_in_its_half`, which runs on this adapter (wave64 emitted as two wave32 halves with per-half lane fixup). `gpu_ds_swizzle_and_bpermute_zero_inactive_lanes` also passes. AI use: test runs by Devin (Cognition, SWE-2); no code changes.
SlopTart commented 2026-11-24 12:05:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T11:55:30Z.


Linux / AMD RDNA3 verification, following up on my #772 correction row.

Merged state: head onto current main (54f2c17 lane merge), clean merge. Full suite: 727 passed / 11 failed / 41 ignored - exactly the known Wine-lane set from my #42 rows plus this rig's flake family; no new failures.

For the wave64/bpermute thread specifically, I ran the bpermute tests three ways on this merge:

  • default (wave64 on RADV, real half-wave ds_bpermute semantics per my #772 measurement): pass
  • forced XCL_SPLIT_WAVE64=1: pass
  • the same pair on current main without this PR: 1 of the 2 (the pre-existing test) also passes; the new half-wave test is this PR's.

So the "stays in each 32-lane half" lowering is green end-to-end on RDNA3 native wave64, and composes correctly with the forced split path. That matches what the community measured in hardware terms in #772: GFX10-GFX11.5 already restrict bpermute to the 32-lane half, and this PR makes the recompiler stop assuming otherwise.

One honest side observation from this batch, flagged not blamed: the gpu_split_wave64_* suite on current main under XCL_SPLIT_WAVE64=1 is failing far more on this rig than when I posted my split numbers in #772 (four of the five tests 0/6 in solo reps today, vs 12/12 + 9/12 earlier). Same rig stack, same binaries, and the era-era pin 1ec4c98 shows the same mixed-or-red pattern today, so I am not reading it as a regression from this PR; full numbers and ruled-out causes are in my new comment on #772.

Counts only, no game data.

Not tested: retail titles (none here), Windows, RDNA4.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7130726555 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1022#issuecomment-7130726555). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T11:55:30Z. --- Linux / AMD RDNA3 verification, following up on my #772 correction row. **Merged state:** head onto current main (`54f2c17` lane merge), clean merge. Full suite: 727 passed / 11 failed / 41 ignored - exactly the known Wine-lane set from my #42 rows plus this rig's flake family; no new failures. For the wave64/bpermute thread specifically, I ran the bpermute tests three ways on this merge: - default (wave64 on RADV, real half-wave `ds_bpermute` semantics per my #772 measurement): **pass** - forced `XCL_SPLIT_WAVE64=1`: **pass** - the same pair on current main without this PR: 1 of the 2 (the pre-existing test) also passes; the new half-wave test is this PR's. So the "stays in each 32-lane half" lowering is green end-to-end on RDNA3 native wave64, and composes correctly with the forced split path. That matches what the community measured in hardware terms in #772: GFX10-GFX11.5 already restrict bpermute to the 32-lane half, and this PR makes the recompiler stop assuming otherwise. One honest side observation from this batch, flagged not blamed: the `gpu_split_wave64_*` suite on current main under `XCL_SPLIT_WAVE64=1` is failing far more on this rig than when I posted my split numbers in #772 (four of the five tests 0/6 in solo reps today, vs 12/12 + 9/12 earlier). Same rig stack, same binaries, and the era-era pin `1ec4c98` shows the same mixed-or-red pattern today, so I am not reading it as a regression from this PR; full numbers and ruled-out causes are in my new comment on #772. Counts only, no game data. **Not tested:** retail titles (none here), Windows, RDNA4. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Kalmarv commented 2026-11-24 17:06:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T16:12:15Z.


Regression pair for 212fb96 against main 6efdabc (this PR's base), for the Regression run section. Both runs pass: no device removal, no crash, 95 % of main's frames, 92 % of its peak commit.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro 26200.
  • scripts/smoke.ps1, the same retail title for 60 s each: main at 6efdabc (this PR's base, 29 commits behind today's main) first, then this PR's head, one after the other on the same machine.

main 6efdabc:

xcl-smoke v1
commit: 6efdabcdaac93ce5cc123a85e85deba5d49cb294
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1248 (PresentX 1248)
presents per 2 s (last 3): 15 32 13
device removals: 0
crashes: 0
peak commit: 28204 MB

this PR, 212fb96:

xcl-smoke v1
commit: 212fb961819b45d7bd4b903bf5a823af044674cb
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1184 (PresentX 1184)
presents per 2 s (last 3): 4 0 4
device removals: 0
crashes: 0
peak commit: 25996 MB

Presents per 2 s over the whole run (from the activity (2 s) lines):

  • main: 0 31 59 51 29 57 60 60 60 60 60 60 60 60 59 46 51 60 60 60 45 53 29 5 2 2 9 15 32 13
  • PR: 0 12 60 37 52 24 60 52 60 60 60 60 60 60 60 48 45 60 60 60 60 41 50 24 7 4 0 4 0 4

The 64-frame gap is a few single dips in the first 20 s of the PR's run, and a slow phase from about 46 s that both runs have (93 frames in the last 16 s against 107). Both runs built about the same compute pipelines (175 and 160 lines, 17 and 13 from the driver's blob of an earlier run). As the PR says, no wave64 program counted in the retail cache uses ds_bpermute_b32, so this run is a regression check only, and one pair can't separate 5 % from run-to-run spread.

Not tested

  • Whether any program the title built in these 60 s uses ds_bpermute_b32: not counted.
  • World loading: a 60 s run ends before it.
  • A second pair, AMD, native wave64.

AI use: Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7137283899 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1022#issuecomment-7137283899). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T16:12:15Z. --- Regression pair for `212fb96` against `main` `6efdabc` (this PR's base), for the **Regression run** section. Both runs pass: no device removal, no crash, 95 % of `main`'s frames, 92 % of its peak commit. **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro 26200. - `scripts/smoke.ps1`, the same retail title for 60 s each: `main` at `6efdabc` (this PR's base, 29 commits behind today's `main`) first, then this PR's head, one after the other on the same machine. `main` `6efdabc`: ``` xcl-smoke v1 commit: 6efdabcdaac93ce5cc123a85e85deba5d49cb294 gpu: NVIDIA GeForce RTX 5070 Ti title: GTA VI seconds: 60 exit: 0x0 frames shown: 1248 (PresentX 1248) presents per 2 s (last 3): 15 32 13 device removals: 0 crashes: 0 peak commit: 28204 MB ``` this PR, `212fb96`: ``` xcl-smoke v1 commit: 212fb961819b45d7bd4b903bf5a823af044674cb gpu: NVIDIA GeForce RTX 5070 Ti title: GTA VI seconds: 60 exit: 0x0 frames shown: 1184 (PresentX 1184) presents per 2 s (last 3): 4 0 4 device removals: 0 crashes: 0 peak commit: 25996 MB ``` Presents per 2 s over the whole run (from the `activity (2 s)` lines): - `main`: 0 31 59 51 29 57 60 60 60 60 60 60 60 60 59 46 51 60 60 60 45 53 29 5 2 2 9 15 32 13 - PR: 0 12 60 37 52 24 60 52 60 60 60 60 60 60 60 48 45 60 60 60 60 41 50 24 7 4 0 4 0 4 The 64-frame gap is a few single dips in the first 20 s of the PR's run, and a slow phase from about 46 s that both runs have (93 frames in the last 16 s against 107). Both runs built about the same compute pipelines (175 and 160 lines, 17 and 13 from the driver's blob of an earlier run). As the PR says, no wave64 program counted in the retail cache uses `ds_bpermute_b32`, so this run is a regression check only, and one pair can't separate 5 % from run-to-run spread. **Not tested** - Whether any program the title built in these 60 s uses `ds_bpermute_b32`: not counted. - World loading: a 60 s run ends before it. - A second pair, AMD, native wave64. **AI use:** Claude Code (Claude Opus 5.5)
upipibi commented 2026-11-24 21:09:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T20:47:11Z.


This PR still needs a smoke pair for the PR description check: it changes emit.rs, and we have no title. Could someone with the title post the xcl-smoke blocks for main and 212fb96? @eizispark and @Kalmarv have made these for our earlier PRs. Per the count on #772, no retail wave64 program uses ds_bpermute_b32, so this is only a regression check.

<!-- greyfinch-sync:ivall/xcl:comment:7144053813 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7144053813). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T20:47:11Z. --- This PR still needs a smoke pair for the `PR description` check: it changes `emit.rs`, and we have no title. Could someone with the title post the `xcl-smoke` blocks for `main` and `212fb96`? @eizispark and @Kalmarv have made these for our earlier PRs. Per the count on #772, no retail wave64 program uses `ds_bpermute_b32`, so this is only a regression check.
Kalmarv commented 2026-11-24 21:09:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T20:52:44Z.


@upipibi, the pair for this head is already in an earlier comment: https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7137283899. That's main 6efdabc (this PR's merge-base) against 212fb96, 1184 / 1248 frames (95 %), no crash and no device removal on either side. If you paste those two xcl-smoke blocks under Regression run in the description, the check should pass; the head hasn't moved since.

AI use: Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7144177599 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7144177599). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T20:52:44Z. --- @upipibi, the pair for this head is already in an earlier comment: https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7137283899. That's `main` `6efdabc` (this PR's merge-base) against `212fb96`, 1184 / 1248 frames (95 %), no crash and no device removal on either side. If you paste those two `xcl-smoke` blocks under **Regression run** in the description, the check should pass; the head hasn't moved since. **AI use:** Claude Code (Claude Opus 5.5)
upipibi commented 2026-11-24 21:09:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T21:07:06Z.


Thanks, I missed it. Your pair is now under Regression run in the description, credited.

<!-- greyfinch-sync:ivall/xcl:comment:7144498878 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7144498878). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T21:07:06Z. --- Thanks, I missed it. Your pair is now under **Regression run** in the description, credited.
cindertheblue commented 2026-11-25 03:05:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by cindertheblue on 2026-11-25T02:14:35Z.


Update: retested the new head 7e1b659 (on main 6e1e2be) on the same RDNA3 card in native wave64. Both points are fixed, also with XCL_DIRECT_DXIL=1, which was the case not tested yet. My first report is kept below.

Tested

  • Same machine and setup as below: AMD Radeon RX 7600 XT 16 GB (RDNA3, gfx1102, native wave64 and wave32), driver 32.0.31041.1004 (AMD Software 26.8.1), Ryzen 5 9600X, Windows 11 Home 26200.9974, rustc 1.99.1, DXC 1.8.2502.11 (SDK 10.0.26100), debug. The head and its base built with cargo build --workspace, each in its own folder, no local changes.
  • The five tests from my first run plus split_wave64_reduction_tail_rules and gpu_ds_swizzle_and_bpermute_zero_inactive_lanes, cargo test -p xcl --lib -- <the seven names>, 3 runs per row on the head:
7e1b659
no variable (native wave64 on this card) 7 passed ×3
XCL_SPLIT_WAVE64=1 7 passed ×3
XCL_DIRECT_DXIL=1 7 passed ×3 (the first five: 1 passed, 4 failed on 212fb96)
XCL_DIRECT_DXIL=1 XCL_SPLIT_WAVE64=1 7 passed ×3 (the first five: 1 passed, 4 failed on 212fb96)

On main 6e1e2be the six of these that exist there also pass in all four rows (once each); gpu_ds_bpermute_wave64_stays_in_its_half is new in this PR.

  • cargo test --workspace --no-fail-fast -- --test-threads=4, once each:
main 6e1e2be + this PR (7e1b659)
no variable 1153 passed, 1 failed, 46 ignored 1154 passed, 1 failed, 46 ignored
XCL_DIRECT_DXIL=1 1151 passed, 3 failed, 46 ignored 1152 passed, 3 failed, 46 ignored

The same tests fail on both trees, none from this PR: fuzz_validate_and_gpu_1 (seed 722, #2115); with XCL_DIRECT_DXIL=1 also gpu_image_get_resinfo_1d_array (#2046) and offline_compute_pipeline_is_reused_by_a_second_process (#1674). The same 8 SKIPPED lines on all four runs (f16 per-lane forms, no heap windows, Developer Mode off).

Not tested: a release build, the RDNA2 iGPU on this machine, NVIDIA, titles.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this update from the real output.

First report, on 212fb96 merged onto main 025c786

Tested 212fb96 merged onto main 025c786 (git merges it cleanly) on an RDNA3 card running native wave64, on Windows. The native form passes. Two things on current main need the PR updated: XCL_DIRECT_DXIL has its own ds_bpermute_b32 that still reads across halves, and a test added after this PR's base fails with it.

Tested

  • AMD Radeon RX 7600 XT 16 GB (RDNA3, gfx1102, native wave64 and wave32), driver 32.0.31041.1004 (AMD Software 26.8.1), Ryzen 5 9600X, Windows 11 Home 26200.9974, rustc 1.99.1, DXC 1.8.2502.11 (SDK 10.0.26100), debug. Each tree built with cargo build --workspace in its own folder.
  • The five tests this PR adds or changes (gpu_ds_bpermute_wave64_stays_in_its_half, gpu_format_stores_atomics_global_lds, gpu_split_wave64_cross_half_operations, gpu_split_wave64_waves_diverge, outside_whole_wave_code_the_upper_lanes_stay_unwritten), cargo test -p xcl --lib -- <the five names>, 3 runs per row:
result
no variable (native wave64 on this card) 5 passed ×3
XCL_SPLIT_WAVE64=1 (split form forced on wave64 hardware) 5 passed ×3
XCL_DIRECT_DXIL=1 1 passed, 4 failed ×3
XCL_DIRECT_DXIL=1 XCL_SPLIT_WAVE64=1 1 passed, 4 failed ×3
  • cargo test --workspace --no-fail-fast -- --test-threads=4, once each:
main 025c786 + this PR
no variable 1132 passed, 1 failed, 46 ignored 1132 passed, 2 failed, 46 ignored
XCL_DIRECT_DXIL=1 1130 passed, 3 failed, 46 ignored 1126 passed, 8 failed, 46 ignored

Failing on both trees, not from this PR: fuzz_validate_and_gpu_1 (the AMD seed 722 mismatch from #1679); with XCL_DIRECT_DXIL=1 also gpu_image_get_resinfo_1d_array and offline_compute_pipeline_is_reused_by_a_second_process (#1674).

1. The direct DXIL backend still reads across the halves. #1426 (merged after this PR's base) translates ds_bpermute_b32 itself in crates/xcl/src/gpu/dxil/lower_mem.rs ("ds_bpermute_b32", line 2022 on 025c786): let m = if self.wave64 { 63 } else { 31 }; then read_lane_any. With XCL_DIRECT_DXIL=1:

  • gpu_ds_bpermute_wave64_stays_in_its_half reports 226 wrong lanes in every run, the same count as your "before" on main (e.g. lane 0 4 * (63 - lane): 1063, want 1031).
  • The three updated assertions fail the same way (lane 0: ds_bpermute of index 63 from lane 31, lane 0 ds_bpermute (index 63 - l, within its half), [256, 1, 1], group 0 thread 0: ds_bpermute). On main with XCL_DIRECT_DXIL=1 the old cross-half expectations of those three pass.

So the direct form probably needs the same index, (lane & 32) | (((addr + offset) >> 2) & 31), in wave64.

2. split_wave64_reduction_tail_rules fails with no variable set. It was added in 9e2c7a5, after this PR's base, and counts xcl_x_meet() ? in the HLSL:

assertion `left == right` failed: 1 folded meet + 3 in prelude:
  left: 3
 right: 4

This PR removes xcl_x_rla_any, whose body has one xcl_x_meet() ? (uint o = xcl_x_meet() ? xcl_x_get(l & 31u) : 0u;), so the prelude now has 2. After a rebase the expectation would be 1 + 2. It passes on main.

Not tested

  • This PR's head 212fb96 on its own base 6efdabc: everything above is the merge onto 025c786.
  • A release build; the RDNA2 iGPU on this machine (this PR already has native RDNA2 runs above); NVIDIA.

AI use

  • Claude Code (Claude Opus 5.5) ran the tests, traced the two failures and wrote this comment from the real output.
<!-- greyfinch-sync:ivall/xcl:comment:7150483885 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7150483885). Originally posted by [cindertheblue](https://github.com/cindertheblue) on 2026-11-25T02:14:35Z. --- **Update: retested the new head `7e1b659` (on `main` `6e1e2be`) on the same RDNA3 card in native wave64. Both points are fixed, also with `XCL_DIRECT_DXIL=1`, which was the case not tested yet.** My first report is kept below. **Tested** - Same machine and setup as below: AMD Radeon RX 7600 XT 16 GB (RDNA3, `gfx1102`, native wave64 and wave32), driver 32.0.31041.1004 (AMD Software 26.8.1), Ryzen 5 9600X, Windows 11 Home 26200.9974, rustc 1.99.1, DXC 1.8.2502.11 (SDK 10.0.26100), debug. The head and its base built with `cargo build --workspace`, each in its own folder, no local changes. - The five tests from my first run plus `split_wave64_reduction_tail_rules` and `gpu_ds_swizzle_and_bpermute_zero_inactive_lanes`, `cargo test -p xcl --lib -- <the seven names>`, 3 runs per row on the head: | | `7e1b659` | |---|---| | no variable (native wave64 on this card) | 7 passed ×3 | | `XCL_SPLIT_WAVE64=1` | 7 passed ×3 | | `XCL_DIRECT_DXIL=1` | 7 passed ×3 (the first five: 1 passed, 4 failed on `212fb96`) | | `XCL_DIRECT_DXIL=1 XCL_SPLIT_WAVE64=1` | 7 passed ×3 (the first five: 1 passed, 4 failed on `212fb96`) | On `main` `6e1e2be` the six of these that exist there also pass in all four rows (once each); `gpu_ds_bpermute_wave64_stays_in_its_half` is new in this PR. - `cargo test --workspace --no-fail-fast -- --test-threads=4`, once each: | | `main` `6e1e2be` | + this PR (`7e1b659`) | |---|---|---| | no variable | 1153 passed, 1 failed, 46 ignored | 1154 passed, 1 failed, 46 ignored | | `XCL_DIRECT_DXIL=1` | 1151 passed, 3 failed, 46 ignored | 1152 passed, 3 failed, 46 ignored | The same tests fail on both trees, none from this PR: `fuzz_validate_and_gpu_1` (seed 722, #2115); with `XCL_DIRECT_DXIL=1` also `gpu_image_get_resinfo_1d_array` (#2046) and `offline_compute_pipeline_is_reused_by_a_second_process` (#1674). The same 8 `SKIPPED` lines on all four runs (f16 per-lane forms, no heap windows, Developer Mode off). **Not tested:** a release build, the RDNA2 iGPU on this machine, NVIDIA, titles. **AI use:** Claude Code (Claude Opus 5.5) ran the tests and wrote this update from the real output. <details><summary>First report, on <code>212fb96</code> merged onto <code>main</code> <code>025c786</code></summary> Tested `212fb96` merged onto `main` `025c786` (git merges it cleanly) on an RDNA3 card running native wave64, on Windows. The native form passes. Two things on current `main` need the PR updated: `XCL_DIRECT_DXIL` has its own `ds_bpermute_b32` that still reads across halves, and a test added after this PR's base fails with it. **Tested** - AMD Radeon RX 7600 XT 16 GB (RDNA3, `gfx1102`, native wave64 and wave32), driver 32.0.31041.1004 (AMD Software 26.8.1), Ryzen 5 9600X, Windows 11 Home 26200.9974, rustc 1.99.1, DXC 1.8.2502.11 (SDK 10.0.26100), debug. Each tree built with `cargo build --workspace` in its own folder. - The five tests this PR adds or changes (`gpu_ds_bpermute_wave64_stays_in_its_half`, `gpu_format_stores_atomics_global_lds`, `gpu_split_wave64_cross_half_operations`, `gpu_split_wave64_waves_diverge`, `outside_whole_wave_code_the_upper_lanes_stay_unwritten`), `cargo test -p xcl --lib -- <the five names>`, 3 runs per row: | | result | |---|---| | no variable (native wave64 on this card) | 5 passed ×3 | | `XCL_SPLIT_WAVE64=1` (split form forced on wave64 hardware) | 5 passed ×3 | | `XCL_DIRECT_DXIL=1` | 1 passed, **4 failed** ×3 | | `XCL_DIRECT_DXIL=1 XCL_SPLIT_WAVE64=1` | 1 passed, **4 failed** ×3 | - `cargo test --workspace --no-fail-fast -- --test-threads=4`, once each: | | `main` `025c786` | + this PR | |---|---|---| | no variable | 1132 passed, 1 failed, 46 ignored | 1132 passed, **2** failed, 46 ignored | | `XCL_DIRECT_DXIL=1` | 1130 passed, 3 failed, 46 ignored | 1126 passed, **8** failed, 46 ignored | Failing on both trees, not from this PR: `fuzz_validate_and_gpu_1` (the AMD seed 722 mismatch from #1679); with `XCL_DIRECT_DXIL=1` also `gpu_image_get_resinfo_1d_array` and `offline_compute_pipeline_is_reused_by_a_second_process` (#1674). **1. The direct DXIL backend still reads across the halves.** #1426 (merged after this PR's base) translates `ds_bpermute_b32` itself in `crates/xcl/src/gpu/dxil/lower_mem.rs` (`"ds_bpermute_b32"`, line 2022 on `025c786`): `let m = if self.wave64 { 63 } else { 31 };` then `read_lane_any`. With `XCL_DIRECT_DXIL=1`: - `gpu_ds_bpermute_wave64_stays_in_its_half` reports **226 wrong** lanes in every run, the same count as your "before" on `main` (e.g. `lane 0 4 * (63 - lane): 1063, want 1031`). - The three updated assertions fail the same way (`lane 0: ds_bpermute of index 63 from lane 31`, `lane 0 ds_bpermute (index 63 - l, within its half)`, `[256, 1, 1], group 0 thread 0: ds_bpermute`). On `main` with `XCL_DIRECT_DXIL=1` the old cross-half expectations of those three pass. So the direct form probably needs the same index, `(lane & 32) | (((addr + offset) >> 2) & 31)`, in wave64. **2. `split_wave64_reduction_tail_rules` fails with no variable set.** It was added in `9e2c7a5`, after this PR's base, and counts `xcl_x_meet() ?` in the HLSL: ``` assertion `left == right` failed: 1 folded meet + 3 in prelude: left: 3 right: 4 ``` This PR removes `xcl_x_rla_any`, whose body has one `xcl_x_meet() ?` (`uint o = xcl_x_meet() ? xcl_x_get(l & 31u) : 0u;`), so the prelude now has 2. After a rebase the expectation would be `1 + 2`. It passes on `main`. **Not tested** - This PR's head `212fb96` on its own base `6efdabc`: everything above is the merge onto `025c786`. - A release build; the RDNA2 iGPU on this machine (this PR already has native RDNA2 runs above); NVIDIA. **AI use** - Claude Code (Claude Opus 5.5) ran the tests, traced the two failures and wrote this comment from the real output. </details>
upipibi commented 2026-11-25 07:05:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T06:27:12Z.


Thanks cindertheblue, both points confirmed and fixed; rebased onto main 6e1e2be.

  1. Direct DXIL: ds_bpermute_b32 in dxil/lower_mem.rs now reads lane (lane & 32) | (((addr + offset) >> 2) & 31) through read_lane_half, like ds_swizzle and the HLSL path (c673925). read_lane_any is gone, and so is the 32-word exchange slot it needed in dxil/kernel.rs.
  2. split_wave64_reduction_tail_rules now expects 1 + 2 meets, as you worked out (7dc382b).

In a separate commit (7e1b659), docs/wave64-on-wave32.md now says the split exchange spins by default since #798 (XCL_WAVE64_SPIN=0 brings the barrier back), and that the direct DXIL backend still uses the barrier for one console wave.

RTX 3070 (driver 616.56), split wave64, debug: your five tests plus split_wave64_reduction_tail_rules and gpu_ds_swizzle_and_bpermute_zero_inactive_lanes went from 6/7 to 7/7 with XCL_DIRECT_DXIL=0, and from 2/7 to 7/7 with XCL_DIRECT_DXIL=1 (before the fix: the same 226 wrong lanes). Full gpu_ suite: 135 passed with XCL_DIRECT_DXIL=0; with 1, 134 passed and the 1 failure is gpu_image_get_resinfo_1d_array, which fails on main too. Not tested: native wave64 with the direct path.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ivall/xcl:comment:7154805401 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7154805401). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T06:27:12Z. --- Thanks cindertheblue, both points confirmed and fixed; rebased onto `main` `6e1e2be`. 1. Direct DXIL: `ds_bpermute_b32` in `dxil/lower_mem.rs` now reads lane `(lane & 32) | (((addr + offset) >> 2) & 31)` through `read_lane_half`, like `ds_swizzle` and the HLSL path (`c673925`). `read_lane_any` is gone, and so is the 32-word exchange slot it needed in `dxil/kernel.rs`. 2. `split_wave64_reduction_tail_rules` now expects 1 + 2 meets, as you worked out (`7dc382b`). In a separate commit (`7e1b659`), `docs/wave64-on-wave32.md` now says the split exchange spins by default since #798 (`XCL_WAVE64_SPIN=0` brings the barrier back), and that the direct DXIL backend still uses the barrier for one console wave. RTX 3070 (driver 616.56), split wave64, debug: your five tests plus `split_wave64_reduction_tail_rules` and `gpu_ds_swizzle_and_bpermute_zero_inactive_lanes` went from 6/7 to 7/7 with `XCL_DIRECT_DXIL=0`, and from 2/7 to 7/7 with `XCL_DIRECT_DXIL=1` (before the fix: the same 226 wrong lanes). Full `gpu_` suite: 135 passed with `XCL_DIRECT_DXIL=0`; with `1`, 134 passed and the 1 failure is `gpu_image_get_resinfo_1d_array`, which fails on `main` too. Not tested: native wave64 with the direct path. AI-assisted (Claude Code).
cindertheblue commented 2026-11-25 07:05:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by cindertheblue on 2026-11-25T06:56:47Z.


Retested 7e1b659 on the RX 7600 XT in native wave64, including XCL_DIRECT_DXIL=1: all seven tests pass and the full suite has no new failures. Details in my edited comment above.

<!-- greyfinch-sync:ivall/xcl:comment:7155323204 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7155323204). Originally posted by [cindertheblue](https://github.com/cindertheblue) on 2026-11-25T06:56:47Z. --- Retested `7e1b659` on the RX 7600 XT in native wave64, including `XCL_DIRECT_DXIL=1`: all seven tests pass and the full suite has no new failures. Details in my edited comment above.
JJAutoCompare commented 2026-11-25 07:05:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T07:01:24Z.


Tested

PR #1022 passed the requested fixture on STOR-WINLAB at clean, detached commit 7e1b659cfcd95c37d8710c85adb3753847455575. 1 passed, 0 failed, 0 ignored, 0 skipped. The PR was open at that SHA before and after the run. Its discussion had same-head NVIDIA and AMD results, with no equivalent Arc A770 result.

The stock HLSL → DXIL split-wave64 fixture checked all 64 lanes in seven cases, including immediate offsets and preservation of inactive destination lanes under partial EXEC. This adds independent Arc compatibility coverage for issue #772.

Intel Arc A770 driver 32.0.101.9175, Ryzen 7 3800X, Windows 11 25H2 build 26200.9974, Rust/Cargo 1.100.0 MSVC, DXC and DXIL 1.9.2609.5. With XCL_ADAPTER=A770 and XCL_DXC_DIR pointing to the installed 1.9.2609 directory, the prebuild ran outside the Arc mutex with two jobs, incremental compilation disabled, and dev/test debug info disabled.

cargo test --locked -p xcl --lib --no-run -j 2 --message-format=json

& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & 'L:/XclTooling/pr1844-71f2ceb-t3-737e5ee5/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' 'gpu::recomp::tests::gpu_ds_bpermute_wave64_stays_in_its_half' --exact --test-threads=1 --nocapture
}

The executable SHA-256 matched before the mutex wait and after acquisition. Native and wrapper exits were 0, with 1,124 filtered out and a 0.32 s fixture time.

Not tested

Native AMD ISA or native wave64, direct DXIL, inactive-source zeroing, the workspace suite, and retail smoke.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the verification and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7155403730 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7155403730). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T07:01:24Z. --- **Tested** [PR #1022](https://github.com/xcl-dev/xcl/pull/1022) passed the requested fixture on STOR-WINLAB at clean, detached commit `7e1b659cfcd95c37d8710c85adb3753847455575`. **1 passed, 0 failed, 0 ignored, 0 skipped.** The PR was open at that SHA before and after the run. Its discussion had same-head NVIDIA and AMD results, with no equivalent Arc A770 result. The stock HLSL → DXIL split-wave64 fixture checked all 64 lanes in seven cases, including immediate offsets and preservation of inactive destination lanes under partial EXEC. This adds independent Arc compatibility coverage for [issue #772](https://github.com/xcl-dev/xcl/issues/772). Intel Arc A770 driver `32.0.101.9175`, Ryzen 7 3800X, Windows 11 25H2 build `26200.9974`, Rust/Cargo `1.100.0` MSVC, DXC and DXIL `1.9.2609.5`. With `XCL_ADAPTER=A770` and `XCL_DXC_DIR` pointing to the installed 1.9.2609 directory, the prebuild ran outside the Arc mutex with two jobs, incremental compilation disabled, and dev/test debug info disabled. ```powershell cargo test --locked -p xcl --lib --no-run -j 2 --message-format=json & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & 'L:/XclTooling/pr1844-71f2ceb-t3-737e5ee5/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' 'gpu::recomp::tests::gpu_ds_bpermute_wave64_stays_in_its_half' --exact --test-threads=1 --nocapture } ``` The executable SHA-256 matched before the mutex wait and after acquisition. Native and wrapper exits were 0, with 1,124 filtered out and a 0.32 s fixture time. **Not tested** Native AMD ISA or native wave64, direct DXIL, inactive-source zeroing, the workspace suite, and retail smoke. **AI use** T3 Code / Codex (`gpt-6.2-sol`) ran the verification and wrote this report.
upipibi commented 2026-11-25 14:10:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T13:51:59Z.


Could someone with a retail title post an xcl-smoke pair for main and this head 7e1b659? Kalmarv's pair in the description is for 212fb96, before the rebase, so the PR description check stays red. I'll paste it with credit. cindertheblue's RX 7600 XT re-run and JJAutoCompare's run already cover the synthetic tests at 7e1b659.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ivall/xcl:comment:7164404140 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7164404140). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T13:51:59Z. --- Could someone with a retail title post an `xcl-smoke` pair for `main` and this head `7e1b659`? Kalmarv's pair in the description is for `212fb96`, before the rebase, so the PR description check stays red. I'll paste it with credit. cindertheblue's RX 7600 XT re-run and JJAutoCompare's run already cover the synthetic tests at `7e1b659`. AI-assisted (Claude Code).
Kalmarv commented 2026-11-25 14:10:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-25T14:01:58Z.


@upipibi here is the pair you asked for. scripts/smoke.ps1 -Seconds 60 ran from each tree, at default settings with no XCL_DIRECT_DXIL, the same title, one after the other. Both builds were release, from clean trees. This head 7e1b659 was built as it is, not merged onto main.

main afc5ee8:

xcl-smoke v1
commit: afc5ee86ae3a9521c9f15d96505cd73fe72f2191
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1126 (PresentX 1126)
presents per 2 s (last 3): 4 1 5
device removals: 0
crashes: 0
peak commit: 23683 MB

this PR, 7e1b659:

xcl-smoke v1
commit: 7e1b659cfcd95c37d8710c85adb3753847455575
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1239 (PresentX 1240)
presents per 2 s (last 3): 22 19 40
device removals: 0
crashes: 0
peak commit: 26949 MB

PR vs main: 1239 / 1126 frames (110 %), peak commit 26949 / 23683 MB (114 %). Neither run had a device removal or a crash.

This head sits on a much older main than afc5ee8, so the pair compares across that gap as well as this change. The frame and commit differences can't be put down to ds_bpermute_b32 alone. As your Not tested says, it's a regression check only.

Hardware: RTX 5070 Ti 16 GB (NVIDIA 610.74), Ryzen 9 9950X, Windows 11 build 26200.

AI use: Claude Code (Claude Opus 5.5) built both trees, ran the pair and wrote this; both blocks are pasted as printed.

<!-- greyfinch-sync:ivall/xcl:comment:7164653114 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7164653114). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-25T14:01:58Z. --- @upipibi here is the pair you asked for. `scripts/smoke.ps1 -Seconds 60` ran from each tree, at default settings with no `XCL_DIRECT_DXIL`, the same title, one after the other. Both builds were release, from clean trees. This head `7e1b659` was built as it is, not merged onto `main`. `main` `afc5ee8`: ``` xcl-smoke v1 commit: afc5ee86ae3a9521c9f15d96505cd73fe72f2191 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1126 (PresentX 1126) presents per 2 s (last 3): 4 1 5 device removals: 0 crashes: 0 peak commit: 23683 MB ``` this PR, `7e1b659`: ``` xcl-smoke v1 commit: 7e1b659cfcd95c37d8710c85adb3753847455575 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1239 (PresentX 1240) presents per 2 s (last 3): 22 19 40 device removals: 0 crashes: 0 peak commit: 26949 MB ``` PR vs `main`: 1239 / 1126 frames (110 %), peak commit 26949 / 23683 MB (114 %). Neither run had a device removal or a crash. This head sits on a much older `main` than `afc5ee8`, so the pair compares across that gap as well as this change. The frame and commit differences can't be put down to `ds_bpermute_b32` alone. As your **Not tested** says, it's a regression check only. Hardware: RTX 5070 Ti 16 GB (NVIDIA 610.74), Ryzen 9 9950X, Windows 11 build 26200. AI use: Claude Code (Claude Opus 5.5) built both trees, ran the pair and wrote this; both blocks are pasted as printed.
DavidM1911 commented 2026-11-26 04:07:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:32:10Z.


Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7181804087 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7181804087). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T03:32:10Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
Foniass commented 2026-12-01 04:38:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:38:55Z.


Triage (#1607) – head 45e3856

No open or merged PR changes ds_bpermute_b32 in wave64. Main still treats it as reading any of 64 lanes (xcl_x_rla_any, Lw::read_lane_any). The change covers both the HLSL and the direct-DXIL path, cites the hardware measurements from #772, and updates the tests that assumed cross-half reads.
It conflicts with main: emit.rs on main now also lists xcl_x_rla_any( among the exchanged helpers (the exchanged check), and that entry has to go with the helper.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300949263 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7300949263). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:38:55Z. --- **Triage (#1607)** – head 45e3856 No open or merged PR changes `ds_bpermute_b32` in wave64. Main still treats it as reading any of 64 lanes (`xcl_x_rla_any`, `Lw::read_lane_any`). The change covers both the HLSL and the direct-DXIL path, cites the hardware measurements from #772, and updates the tests that assumed cross-half reads. It conflicts with main: `emit.rs` on main now also lists `xcl_x_rla_any(` among the exchanged helpers (the `exchanged` check), and that entry has to go with the helper. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Royalflamejlh commented 2026-12-02 23:18:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T23:18:35Z.


Rebased onto main 5ad98ad, this PR passed the whole suite on an RTX 2070 SUPER (Windows 11) in 1 of 2 runs (the other run's lib binary crashed early, see below). It also turned the "ds_swizzle, ds_bpermute and ds_permute" case of #3716's RDNA2 reference interpreter from a mismatch into a match.

Setup: 45e3856 cherry-picked onto 5ad98ad (local only, three conflicts), debug cargo test --workspace --no-fail-fast -- --test-threads=4, RTX 2070 SUPER 8 GB (NVIDIA 621.01), Windows 11 Pro 26200.

The rebase, if you want to take it:

  • recomp/emit.rs, "ds_bpermute_b32": take your side. main has since dropped self.x64_met() from the old branch, and your in-half read needs no exchange. Also remove "xcl_x_rla_any(" from the exchanged list in x64_fail_closed_since: your branch deletes that helper but leaves its name there.
  • dxil/lanes.rs: delete read_lane_any whole, including the self.exchange_sites += 1; that main added to it. Keep main's new is_pixel and live_lanes below it.
  • recomp/tests.rs: keep both main's split_wave64_lds_reads_meet_after_writes and your gpu_ds_bpermute_wave64_stays_in_its_half.
tree passed failed ignored
main 5ad98ad 3005 0 52
5ad98ad + this PR 3006 0 52
  • Your new test and the tests you updated passed. The three tests with "bpermute" in their name also passed with XCL_DIRECT_DXIL=1 (1 run).
  • #3716's case "ds_swizzle, ds_bpermute and ds_permute", split HLSL form: on #3716's own branch, without this PR, lane 0's v11 is 24204809 where the reference gives 31684507 (44 dwords differ). With it merged in, all 512 compared dwords match. The direct split form refuses that case because of its ds_permute_b32, so the reference does not check this PR's direct-DXIL change. These runs and the XCL_DIRECT_DXIL=1 one had #3716 merged too; its gpu_wave64_forms_agree_with_the_reference then fails because it still expects this case to mismatch, and I'll update that if this merges first.
  • In the first full run of the PR tree, the xcl lib test binary exited with 0xc0000005 (STATUS_ACCESS_VIOLATION) after 89 of its 2886 tests had passed and none had failed. The second run of the same build passed all of them. 1 run of main passed; I can't say from that whether main can crash the same way.
  • The rebased branch also merges cleanly with today's main 078358a. Not built there.

Not tested: AMD hardware, Linux, the title.

AI use: Claude Code (Claude Opus 5.5) did the rebase, ran the tests and wrote this.

Posted without review by a person: the account owner was away and reads replies later.

<!-- greyfinch-sync:ivall/xcl:comment:7361828945 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7361828945). Originally posted by [Royalflamejlh](https://github.com/Royalflamejlh) on 2026-12-02T23:18:35Z. --- Rebased onto `main` `5ad98ad`, this PR passed the whole suite on an RTX 2070 SUPER (Windows 11) in 1 of 2 runs (the other run's lib binary crashed early, see below). It also turned the "ds_swizzle, ds_bpermute and ds_permute" case of #3716's RDNA2 reference interpreter from a mismatch into a match. Setup: `45e3856` cherry-picked onto `5ad98ad` (local only, three conflicts), debug `cargo test --workspace --no-fail-fast -- --test-threads=4`, RTX 2070 SUPER 8 GB (NVIDIA 621.01), Windows 11 Pro 26200. The rebase, if you want to take it: - `recomp/emit.rs`, `"ds_bpermute_b32"`: take your side. `main` has since dropped `self.x64_met()` from the old branch, and your in-half read needs no exchange. Also remove `"xcl_x_rla_any("` from the `exchanged` list in `x64_fail_closed_since`: your branch deletes that helper but leaves its name there. - `dxil/lanes.rs`: delete `read_lane_any` whole, including the `self.exchange_sites += 1;` that `main` added to it. Keep `main`'s new `is_pixel` and `live_lanes` below it. - `recomp/tests.rs`: keep both `main`'s `split_wave64_lds_reads_meet_after_writes` and your `gpu_ds_bpermute_wave64_stays_in_its_half`. | tree | passed | failed | ignored | | --- | ---: | ---: | ---: | | `main` `5ad98ad` | 3005 | 0 | 52 | | `5ad98ad` + this PR | 3006 | 0 | 52 | - Your new test and the tests you updated passed. The three tests with "bpermute" in their name also passed with `XCL_DIRECT_DXIL=1` (1 run). - #3716's case "ds_swizzle, ds_bpermute and ds_permute", split HLSL form: on #3716's own branch, without this PR, lane 0's `v11` is 24204809 where the reference gives 31684507 (44 dwords differ). With it merged in, all 512 compared dwords match. The direct split form refuses that case because of its `ds_permute_b32`, so the reference does not check this PR's direct-DXIL change. These runs and the `XCL_DIRECT_DXIL=1` one had #3716 merged too; its `gpu_wave64_forms_agree_with_the_reference` then fails because it still expects this case to mismatch, and I'll update that if this merges first. - In the first full run of the PR tree, the `xcl` lib test binary exited with `0xc0000005` (STATUS_ACCESS_VIOLATION) after 89 of its 2886 tests had passed and none had failed. The second run of the same build passed all of them. 1 run of `main` passed; I can't say from that whether `main` can crash the same way. - The rebased branch also merges cleanly with today's `main` `078358a`. Not built there. Not tested: AMD hardware, Linux, the title. AI use: Claude Code (Claude Opus 5.5) did the rebase, ran the tests and wrote this. Posted without review by a person: the account owner was away and reads replies later.
upipibi commented 2026-12-03 17:11:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-12-03T17:11:24Z.


Rebased onto main e99b0bd following Royalflamejlh's recipe above, thanks (head 5f42473). RTX 3070, driver 621.40, debug:

  • The 9 tests in the description plus split_wave64_lds_reads_meet_after_writes, 3 runs each:
    • XCL_DIRECT_DXIL=0: 10 passed, 0 failed (each run)
    • XCL_DIRECT_DXIL=1: 10 passed, 0 failed (each run)
  • Red, main's code files with these tests: 3 passed, 7 failed on both paths (gpu_ds_bpermute_wave64_stays_in_its_half: 226 wrong lanes)
  • cargo test -p xcl --lib -- --test-threads=4: 2864 passed, 0 failed, 37 ignored

The smoke pair in the description is for an older head, so a pair on 5f42473 is needed.

Tested with the help of Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7386109173 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7386109173). Originally posted by [upipibi](https://github.com/upipibi) on 2026-12-03T17:11:24Z. --- Rebased onto `main` `e99b0bd` following Royalflamejlh's recipe above, thanks (head `5f42473`). RTX 3070, driver 621.40, debug: - The 9 tests in the description plus `split_wave64_lds_reads_meet_after_writes`, 3 runs each: - `XCL_DIRECT_DXIL=0`: 10 passed, 0 failed (each run) - `XCL_DIRECT_DXIL=1`: 10 passed, 0 failed (each run) - Red, `main`'s code files with these tests: 3 passed, 7 failed on both paths (`gpu_ds_bpermute_wave64_stays_in_its_half`: 226 wrong lanes) - `cargo test -p xcl --lib -- --test-threads=4`: 2864 passed, 0 failed, 37 ignored The smoke pair in the description is for an older head, so a pair on `5f42473` is needed. *Tested with the help of Claude Code (Claude Opus 5.5).*
Foniass commented 2026-12-03 17:12:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T17:12:12Z.


Follow-up review of 5f42473b, since 45e3856 (code reading only, not a merge-check; PR description red) · 1 medium

In short: Rebased onto main e99b0bd, resolving the conflict the earlier triage named. emit.rs's exchange check no longer lists xcl_x_rla_any(, which went away with the helper. The direct-DXIL exchange_sites count went away with read_lane_any. Nothing else in the three commits changed. Only one evidence gap remains.

Medium

  1. The whole workspace is not reported on this head. Tested gives cargo test -p xcl --lib on 5f42473b (2864 passed, 0 failed, 37 ignored), and the PR's tests on both backends. The workspace run, with the integration tests, is from before the rebase. CONTRIBUTING.md asks for cargo test --workspace -- --test-threads=4 on the head under review.
Checked and fine
  • Earlier triage point fixed: x64_fail_closed_since now lists xcl_x_meet(, xcl_x_ballot( and xcl_x_rla_uniform( only. No reference to xcl_x_rla_any or read_lane_any is left in the tree.
  • The range-diff shows only conflict-resolution changes: the x64_met() call and the exchange_sites += 1 went away with the code they belonged to, and the rest is context.
  • Tested runs the PR's 9 tests and main's split_wave64_lds_reads_meet_after_writes three times on each backend, and shows them failing with main's code.
  • The head merges cleanly onto main.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7386130852 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1022#issuecomment-7386130852). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T17:12:12Z. --- **Follow-up review** of `5f42473b`, since `45e3856` (code reading only, not a merge-check; `PR description` red) · 1 medium **In short:** Rebased onto `main` `e99b0bd`, resolving the conflict the earlier triage named. `emit.rs`'s exchange check no longer lists `xcl_x_rla_any(`, which went away with the helper. The direct-DXIL `exchange_sites` count went away with `read_lane_any`. Nothing else in the three commits changed. Only one evidence gap remains. #### Medium 1. **The whole workspace is not reported on this head.** **Tested** gives `cargo test -p xcl --lib` on `5f42473b` (2864 passed, 0 failed, 37 ignored), and the PR's tests on both backends. The workspace run, with the integration tests, is from before the rebase. CONTRIBUTING.md asks for `cargo test --workspace -- --test-threads=4` on the head under review. <details><summary>Checked and fine</summary> - Earlier triage point fixed: `x64_fail_closed_since` now lists `xcl_x_meet(`, `xcl_x_ballot(` and `xcl_x_rla_uniform(` only. No reference to `xcl_x_rla_any` or `read_lane_any` is left in the tree. - The range-diff shows only conflict-resolution changes: the `x64_met()` call and the `exchange_sites += 1` went away with the code they belonged to, and the rest is context. - **Tested** runs the PR's 9 tests and `main`'s `split_wave64_lds_reads_meet_after_writes` three times on each backend, and shows them failing with `main`'s code. - The head merges cleanly onto `main`. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
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/1022:upstream-pr/1022'
git switch 'upstream-pr/1022'

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