Direct DXIL: translate ds_permute_b32 as the HLSL path does #2218

Open
NWProgramming00 wants to merge 1 commit from upstream-pr/2228 into main
NWProgramming00 commented 2026-11-25 10:44:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by NWProgramming00 on 2026-11-25T10:44:30Z.


#2222 (merged) translates ds_permute_b32 in the HLSL path. The direct DXIL translator (XCL_DIRECT_DXIL) still refused it. This PR lowers it there the same way, so the two backends agree and match the RDNA2 measurements on #2222:

  • Each active lane sends DATA0 to lane ((ADDR + offset) >> 2) & 31 of its own 32-lane half, so it never crosses the halves.
  • Of several senders, the highest lane wins.
  • An active lane that nobody sends to gets 0.

Rebased onto main 0fe06eb after #2222 merged: now one commit, f3f2922.

What is in it

  • crates/xcl/src/gpu/dxil/lower_mem.rs: ds_permute_b32 in Lw::ds. Each receiver reads the 32 senders of its half in lane order (the loop is unrolled) through read_lane_half, as ds_swizzle_b32 does, so the split form needs no exchange.
  • crates/xcl/src/gpu/recomp/tests.rs:
    • gpu_ds_permute_b32 and a new gpu_ds_permute_b32_direct share one body. The new test runs the same five cases through the direct translator whatever XCL_DIRECT_DXIL says, in wave32, native wave64 and split wave64.
    • ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist runs translate_pixel and translate_vertex on a wave64 program with and without split. With split it must be refused; without split it must translate.

Change since the review
@upipibi found that this PR's own refusal of a wave64 VS / PS that may run in 32-lane waves could never fire (it tested split, which Lw::new clears for a VS / PS). The earlier head fixed that with a gfx_split field (1aa9794).

Since then main got 50e85c5 (#2252 adapted). It passes the requested split to direct_graphics, and translate_on_this_thread refuses a wave64 VS / PS asked to split when upper_lanes::analyze finds a read that is not native. upper_lanes classes every DS_PERMUTE_B32 as an Unknown read, so main already refuses these programs before Lw::new. So I dropped 1aa9794 and the dead refusal in the lowering. The refusal test now checks main's message (wave64 VS / PS in 32-lane waves: a read of lanes 32–63).

Tested

  • Windows 11, NVIDIA GeForce RTX 5070 Ti 16 GB (wave32; wave64 as two halves) and an AMD Radeon RDNA2 iGPU (gfx1036, native wave64, XCL_ADAPTER=radeon). Rust 1.100 MSVC, release.
  • The ds_permute tests (f3f2922, ds_permute filter): 5 passed, 0 failed on each adapter, with and without XCL_DIRECT_DXIL=all.
  • Earlier checks, same lowering (on 03d0ba8 and 1aa9794; the lowering has not changed since):
    • xcl against the hardware: the 26 RDNA2 code blocks from #2222 ran through the direct translator (runner::direct_kernel_full). Bit for bit against the gfx1036's own results they gave 26/26 equal on the RTX 5070 Ti and 26/26 equal on the Radeon.
    • With the half bit dropped, gpu_ds_permute_b32_direct fails on both adapters. With the offset dropped it fails too.
  • The whole suite (f3f2922): cargo build --release --workspace, then cargo test --release --workspace --no-fail-fast -- --test-threads=4, with and without XCL_DIRECT_DXIL=all, against base main 0fe06eb on the same machine:
Adapter Mode base 0fe06eb this PR (f3f2922)
RTX 5070 Ti default 2737 passed, 0 failed, 49 ignored 2738 passed, 1 failed, 49 ignored
RTX 5070 Ti XCL_DIRECT_DXIL=all 2736 passed, 1 failed, 49 ignored 2738 passed, 1 failed, 49 ignored
Radeon gfx1036 default 138 passed, 1 failed, 20 ignored 138 passed, 1 failed, 20 ignored
Radeon gfx1036 XCL_DIRECT_DXIL=all 138 passed, 1 failed, 20 ignored 138 passed, 1 failed, 20 ignored
  • The +2 on NVIDIA are this PR's two new tests.
  • The one failure is two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (gpu_two_pass_cache_e2e). It is not stable on this machine: it passed in the first base run, then failed in 3 of 3 reruns of that test alone on base.
  • On the Radeon, both base and PR stop in the same place: the xcl lib test process exits with 0x80004005 after hle::d3d12x::bind tests. That is why only 138 tests are counted there, and why the ds_permute tests were run alone there (above).

Regression run
Both runs with XCL_PREPARE=0: it skips the startup shader preparation that #2555 added (about 5 hours from an empty cache here), so the title starts as it did before #2555. The two runs differ only in the commit.

Base (main 0fe06eb), NVIDIA GeForce RTX 5070 Ti:

xcl-smoke v1
commit: 0fe06eb0f05459007ebfffc67bb9983acb3a832d
gpu: NVIDIA GeForce RTX 5070 Ti
title: title-a
seconds: 60
exit: 0x0
frames shown: 1527 (PresentX 1527)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15504 MB

This PR (f3f2922), same card, run right after:

xcl-smoke v1
commit: f3f292295195d96f3e245733562145cf4a7b2475
gpu: NVIDIA GeForce RTX 5070 Ti
title: title-a
seconds: 60
exit: 0x0
frames shown: 1688 (PresentX 1688)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 15280 MB

Not tested

  • A title run, and a retail program that uses ds_permute_b32.
  • RDNA3 / RDNA4 and Intel.
  • A wave64 VS / PS through the direct translator on a GPU with 64-lane waves (translated, not run).

AI use

  • Claude Code (Claude Opus 5.5) did the work: it wrote the lowering and the tests, did the rebase, ran the hardware comparison and the suites, and wrote this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5489780180 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228). Originally posted by [NWProgramming00](https://github.com/NWProgramming00) on 2026-11-25T10:44:30Z. --- #2222 (merged) translates `ds_permute_b32` in the HLSL path. The direct DXIL translator (`XCL_DIRECT_DXIL`) still refused it. This PR lowers it there the same way, so the two backends agree and match the RDNA2 measurements on #2222: - Each active lane sends DATA0 to lane `((ADDR + offset) >> 2) & 31` of its own 32-lane half, so it never crosses the halves. - Of several senders, the highest lane wins. - An active lane that nobody sends to gets 0. Rebased onto `main` `0fe06eb` after #2222 merged: now one commit, `f3f2922`. **What is in it** - `crates/xcl/src/gpu/dxil/lower_mem.rs`: `ds_permute_b32` in `Lw::ds`. Each receiver reads the 32 senders of its half in lane order (the loop is unrolled) through `read_lane_half`, as `ds_swizzle_b32` does, so the split form needs no exchange. - `crates/xcl/src/gpu/recomp/tests.rs`: - `gpu_ds_permute_b32` and a new `gpu_ds_permute_b32_direct` share one body. The new test runs the same five cases through the direct translator whatever `XCL_DIRECT_DXIL` says, in wave32, native wave64 and split wave64. - `ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist` runs `translate_pixel` and `translate_vertex` on a wave64 program with and without split. With split it must be refused; without split it must translate. **Change since the review** @upipibi found that this PR's own refusal of a wave64 VS / PS that may run in 32-lane waves could never fire (it tested `split`, which `Lw::new` clears for a VS / PS). The earlier head fixed that with a `gfx_split` field (`1aa9794`). Since then `main` got `50e85c5` (#2252 adapted). It passes the requested split to `direct_graphics`, and `translate_on_this_thread` refuses a wave64 VS / PS asked to split when `upper_lanes::analyze` finds a read that is not native. `upper_lanes` classes every `DS_PERMUTE_B32` as an `Unknown` read, so `main` already refuses these programs before `Lw::new`. So I dropped `1aa9794` and the dead refusal in the lowering. The refusal test now checks `main`'s message (`wave64 VS / PS in 32-lane waves: a read of lanes 32–63`). **Tested** - Windows 11, NVIDIA GeForce RTX 5070 Ti 16 GB (wave32; wave64 as two halves) and an AMD Radeon RDNA2 iGPU (gfx1036, native wave64, `XCL_ADAPTER=radeon`). Rust 1.100 MSVC, release. - **The ds_permute tests** (`f3f2922`, `ds_permute` filter): 5 passed, 0 failed on each adapter, with and without `XCL_DIRECT_DXIL=all`. - **Earlier checks, same lowering** (on `03d0ba8` and `1aa9794`; the lowering has not changed since): - xcl against the hardware: the 26 RDNA2 code blocks from #2222 ran through the direct translator (`runner::direct_kernel_full`). Bit for bit against the gfx1036's own results they gave 26/26 equal on the RTX 5070 Ti and 26/26 equal on the Radeon. - With the half bit dropped, `gpu_ds_permute_b32_direct` fails on both adapters. With the offset dropped it fails too. - **The whole suite** (`f3f2922`): `cargo build --release --workspace`, then `cargo test --release --workspace --no-fail-fast -- --test-threads=4`, with and without `XCL_DIRECT_DXIL=all`, against base `main` `0fe06eb` on the same machine: | Adapter | Mode | base `0fe06eb` | this PR (`f3f2922`) | |---|---|---|---| | RTX 5070 Ti | default | 2737 passed, 0 failed, 49 ignored | 2738 passed, 1 failed, 49 ignored | | RTX 5070 Ti | `XCL_DIRECT_DXIL=all` | 2736 passed, 1 failed, 49 ignored | 2738 passed, 1 failed, 49 ignored | | Radeon gfx1036 | default | 138 passed, 1 failed, 20 ignored | 138 passed, 1 failed, 20 ignored | | Radeon gfx1036 | `XCL_DIRECT_DXIL=all` | 138 passed, 1 failed, 20 ignored | 138 passed, 1 failed, 20 ignored | - The +2 on NVIDIA are this PR's two new tests. - The one failure is `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` (`gpu_two_pass_cache_e2e`). It is not stable on this machine: it passed in the first base run, then failed in 3 of 3 reruns of that test alone on base. - On the Radeon, both base and PR stop in the same place: the `xcl` lib test process exits with `0x80004005` after `hle::d3d12x::bind` tests. That is why only 138 tests are counted there, and why the `ds_permute` tests were run alone there (above). **Regression run** Both runs with `XCL_PREPARE=0`: it skips the startup shader preparation that #2555 added (about 5 hours from an empty cache here), so the title starts as it did before #2555. The two runs differ only in the commit. Base (`main` `0fe06eb`), NVIDIA GeForce RTX 5070 Ti: ``` xcl-smoke v1 commit: 0fe06eb0f05459007ebfffc67bb9983acb3a832d gpu: NVIDIA GeForce RTX 5070 Ti title: title-a seconds: 60 exit: 0x0 frames shown: 1527 (PresentX 1527) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15504 MB ``` This PR (`f3f2922`), same card, run right after: ``` xcl-smoke v1 commit: f3f292295195d96f3e245733562145cf4a7b2475 gpu: NVIDIA GeForce RTX 5070 Ti title: title-a seconds: 60 exit: 0x0 frames shown: 1688 (PresentX 1688) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 15280 MB ``` **Not tested** - A title run, and a retail program that uses `ds_permute_b32`. - RDNA3 / RDNA4 and Intel. - A wave64 VS / PS through the direct translator on a GPU with 64-lane waves (translated, not run). **AI use** - Claude Code (Claude Opus 5.5) did the work: it wrote the lowering and the tests, did the rebase, ran the hardware comparison and the suites, and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
luckyteagirl commented 2026-11-25 11:09:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T10:47:53Z.


Independent RDNA2 check on exact, clean PR head 03d0ba8bd7e7d3079a227565bce8b07b2f5051c7.

Environment: Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver 30.0.13002.13003; Rust 1.99.0 MSVC, debug; DXC/DXIL 1.9.2609.5. XCL_ADAPTER=6800M, XCL_REQUIRE_GPU=wave64.

I ran cargo test --locked -p xcl --lib -j 2 ds_permute -- --test-threads=1 --show-output twice with separate environment settings:

XCL_DIRECT_DXIL Passed Failed Ignored Explicit SKIPPED
1 4 0 0 0
0 4 0 0 0

Both runs include gpu_ds_permute_b32 and the new gpu_ds_permute_b32_direct; the latter explicitly takes the direct translator regardless of the environment setting. The reference-model and graphics-refusal tests passed too. This extends the reported RDNA2 test coverage from the author's gfx1036 iGPU to a discrete RX 6800M on an older driver. It is focused test evidence only: I did not repeat the full workspace suite, a hardware ISA measurement, or a retail smoke comparison for this head.

AI assistance: OpenAI Codex (GPT-6; exact variant not exposed) ran the commands, checked the logs and head revision, and drafted this report. No game data was used or attached.

<!-- greyfinch-sync:ivall/xcl:comment:7160186364 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228#issuecomment-7160186364). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-25T10:47:53Z. --- Independent RDNA2 check on exact, clean PR head `03d0ba8bd7e7d3079a227565bce8b07b2f5051c7`. **Environment:** Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver `30.0.13002.13003`; Rust 1.99.0 MSVC, debug; DXC/DXIL 1.9.2609.5. `XCL_ADAPTER=6800M`, `XCL_REQUIRE_GPU=wave64`. I ran `cargo test --locked -p xcl --lib -j 2 ds_permute -- --test-threads=1 --show-output` twice with separate environment settings: | `XCL_DIRECT_DXIL` | Passed | Failed | Ignored | Explicit SKIPPED | |---|---:|---:|---:|---:| | `1` | 4 | 0 | 0 | 0 | | `0` | 4 | 0 | 0 | 0 | Both runs include `gpu_ds_permute_b32` and the new `gpu_ds_permute_b32_direct`; the latter explicitly takes the direct translator regardless of the environment setting. The reference-model and graphics-refusal tests passed too. This extends the reported RDNA2 test coverage from the author's gfx1036 iGPU to a discrete RX 6800M on an older driver. It is **focused test evidence only**: I did not repeat the full workspace suite, a hardware ISA measurement, or a retail smoke comparison for this head. **AI assistance:** OpenAI Codex (GPT-6; exact variant not exposed) ran the commands, checked the logs and head revision, and drafted this report. No game data was used or attached.
emirduran707 commented 2026-11-25 21:05:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T20:09:46Z.


Independent AMD RDNA4 (native wave64) test report on exact head 03d0ba8bd7e7d3079a227565bce8b07b2f5051c7 (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1156 passed, 2 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • All 4 PR tests passed (no skips): gpu::recomp::tests::ds_permute_reference_matches_rdna2_values, ds_permute_b32_refused_where_upper_lanes_do_not_exist, gpu_ds_permute_b32, and gpu_ds_permute_b32_direct.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) are pre-existing on unmodified main on this GPU.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: 03d0ba8bd7e7d3079a227565bce8b07b2f5051c7
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1527 (PresentX 1527)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16330 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • Wave32-only GPUs (NVIDIA/Intel); D3D12 debug layer.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7173273965 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228#issuecomment-7173273965). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T20:09:46Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `03d0ba8bd7e7d3079a227565bce8b07b2f5051c7` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1156 passed, 2 failed, 46 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All native wave64 GPU tests ran and passed. - All 4 PR tests passed (no skips): `gpu::recomp::tests::ds_permute_reference_matches_rdna2_values`, `ds_permute_b32_refused_where_upper_lanes_do_not_exist`, `gpu_ds_permute_b32`, and `gpu_ds_permute_b32_direct`. - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599) are pre-existing on unmodified `main` on this GPU. **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: 03d0ba8bd7e7d3079a227565bce8b07b2f5051c7 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1527 (PresentX 1527) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16330 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - Wave32-only GPUs (NVIDIA/Intel); D3D12 debug layer. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
upipibi commented 2026-11-26 22:45:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T22:45:48Z.


Found by reading the code at 03d0ba8b. I did not run it.

Thanks for the direct-path lowering. The permute itself matches the HLSL lowering in #2222 as far as I can trace it: same sender set, highest sender wins, 0 for an active lane nobody sends to, inactive receivers keep their old value. One question about the refusal:

crates/xcl/src/gpu/dxil/lower_mem.rs:2042

if self.wave64 && self.split && self.gfx.as_ref().is_some_and(|g| g.vs.is_some() || g.ps.is_some()) {

I don't see any path where this condition can be true:

  • self.gfx is set only in setup_vertex / setup_pixel (lower_gfx.rs:152, :251, plus the restore at :285). Those are called only for Entry::Vertex / Entry::Pixel (kernel.rs:211, :217).
  • For those entries, Lw::new clears split at kernel.rs:438 (let split = split && !gfx;) and stores it at kernel.rs:458. Nothing assigns split after that. translate_on_this_thread does the same at kernel.rs:170.
  • direct_graphics passes split: false anyway (recomp/pso.rs:767). The one caller that passes split_wave64 (pso.rs:987) is the GS compute pass (Entry::Geometry), which has no gfx context.

So with XCL_DIRECT_DXIL on a 32-lane-only GPU, the direct path lowers a wave64 VS / PS that uses ds_permute_b32, while the HLSL path refuses it (recomp/emit.rs:4405, which tests opt.split_wave64 and Mode::Vertex | Mode::Pixel). That doesn't match the description's "refuses it, as in the HLSL path". It also explains why the "Not tested" list has "A wave64 VS / PS without the refusal": the refusal can't fire.

By reading only, I can't say whether the direct output is actually wrong there. Its lanes are the real host lanes 0..31, and the direct translator has no upper_lanes model, so this may just be a mismatch between the two backends rather than a wrong value. Either way, the check at :2042 looks like dead code. Was the intent to test the requested split (o.wave64 && o.split before kernel.rs:438 clears it), or to drop the check and change the description? A CPU test like #2222's ds_permute_b32_refused_where_upper_lanes_do_not_exist, run through kernel::translate_vertex / translate_pixel with split: true, would settle it.

<!-- greyfinch-sync:ivall/xcl:comment:7204963869 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228#issuecomment-7204963869). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T22:45:48Z. --- Found by reading the code at `03d0ba8b`. I did not run it. Thanks for the direct-path lowering. The permute itself matches the HLSL lowering in #2222 as far as I can trace it: same sender set, highest sender wins, 0 for an active lane nobody sends to, inactive receivers keep their old value. One question about the refusal: `crates/xcl/src/gpu/dxil/lower_mem.rs:2042` ```rust if self.wave64 && self.split && self.gfx.as_ref().is_some_and(|g| g.vs.is_some() || g.ps.is_some()) { ``` I don't see any path where this condition can be true: - `self.gfx` is set only in `setup_vertex` / `setup_pixel` (`lower_gfx.rs:152`, `:251`, plus the restore at `:285`). Those are called only for `Entry::Vertex` / `Entry::Pixel` (`kernel.rs:211`, `:217`). - For those entries, `Lw::new` clears split at `kernel.rs:438` (`let split = split && !gfx;`) and stores it at `kernel.rs:458`. Nothing assigns `split` after that. `translate_on_this_thread` does the same at `kernel.rs:170`. - `direct_graphics` passes `split: false` anyway (`recomp/pso.rs:767`). The one caller that passes `split_wave64` (`pso.rs:987`) is the GS compute pass (`Entry::Geometry`), which has no gfx context. So with `XCL_DIRECT_DXIL` on a 32-lane-only GPU, the direct path lowers a wave64 VS / PS that uses `ds_permute_b32`, while the HLSL path refuses it (`recomp/emit.rs:4405`, which tests `opt.split_wave64` and `Mode::Vertex | Mode::Pixel`). That doesn't match the description's "refuses it, as in the HLSL path". It also explains why the "Not tested" list has "A wave64 VS / PS without the refusal": the refusal can't fire. By reading only, I can't say whether the direct output is actually wrong there. Its lanes are the real host lanes 0..31, and the direct translator has no `upper_lanes` model, so this may just be a mismatch between the two backends rather than a wrong value. Either way, the check at :2042 looks like dead code. Was the intent to test the requested split (`o.wave64 && o.split` before `kernel.rs:438` clears it), or to drop the check and change the description? A CPU test like #2222's `ds_permute_b32_refused_where_upper_lanes_do_not_exist`, run through `kernel::translate_vertex` / `translate_pixel` with `split: true`, would settle it.
NWProgramming00 commented 2026-11-26 23:12:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by NWProgramming00 on 2026-11-26T23:12:20Z.


@upipibi you are right, thanks. The check could not fire: Lw::new clears split for a VS / PS, and direct_graphics passed split: false anyway. So the direct path lowered what the HLSL path refuses.

Fixed in 1aa9794:

  • Lw keeps the requested split of a VS / PS in gfx_split.
  • direct_graphics now passes split_wave64, as the HLSL path does.
  • The refusal tests gfx_split.
  • ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist runs translate_pixel / translate_vertex with and without split, as you suggested. It fails with the old condition and passes with the fix.

I rebased the stack onto e120925 for a fast smoke run (see the description). The full suite and the smoke pair are in the description.

AI use: Claude Code (Claude Opus 5.5) checked the trace, wrote the fix and the test, ran the suite and the smoke pair, and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7205343196 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228#issuecomment-7205343196). Originally posted by [NWProgramming00](https://github.com/NWProgramming00) on 2026-11-26T23:12:20Z. --- @upipibi you are right, thanks. The check could not fire: `Lw::new` clears `split` for a VS / PS, and `direct_graphics` passed `split: false` anyway. So the direct path lowered what the HLSL path refuses. Fixed in `1aa9794`: - `Lw` keeps the requested split of a VS / PS in `gfx_split`. - `direct_graphics` now passes `split_wave64`, as the HLSL path does. - The refusal tests `gfx_split`. - `ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist` runs `translate_pixel` / `translate_vertex` with and without split, as you suggested. It fails with the old condition and passes with the fix. I rebased the stack onto `e120925` for a fast smoke run (see the description). The full suite and the smoke pair are in the description. AI use: Claude Code (Claude Opus 5.5) checked the trace, wrote the fix and the test, ran the suite and the smoke pair, and wrote this.
upipibi commented 2026-11-26 23:31:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T23:31:07Z.


@NWProgramming00 thanks, 1aa9794 looks right to me by reading. gfx_split is now wave64 && split_wave64 for a VS / PS, which is the HLSL path's condition at emit.rs:4405. direct_graphics passes the split through, and translate_on_this_thread still clears split for graphics, so nothing else changes for a VS / PS. I also ran it on our card:

Tested head 1aa97946e97e71e5baca0a62d088e552d0214ad5, merge-base e120925e3abc9956a8b9bae631969d32e8ccd43c, RTX 3070 (Ampere) driver 616.56, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09)

Debug profile (not release), no game files. cargo build --workspace and cargo test -p xcl --lib --no-run built clean on head. XCL_DIRECT_DXIL was not set: the PR says gpu_ds_permute_b32_direct runs the direct translator whatever it says.

1. The five ds_permute tests on head, --test-threads=1, three runs (ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist, ds_permute_b32_refused_where_upper_lanes_do_not_exist, ds_permute_reference_matches_rdna2_values, gpu_ds_permute_b32, gpu_ds_permute_b32_direct):

  • run 1: 5 passed, 0 failed, 0 ignored
  • run 2: 5 passed, 0 failed, 0 ignored
  • run 3: 5 passed, 0 failed, 0 ignored

2. Negative control. Parent 9f2cacc163ecac52bb91c0b8fe3aa5bc9510932d (1aa9794^) with only the new test from 1aa9794 added to recomp/tests.rs: 0 passed, 1 failed.
ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist panicked at crates\xcl\src\gpu\recomp\tests.rs:8526:5: PS: "". So translate_pixel with split: true returned no error (the refusal did not fire), which is the bug the commit fixes.

3. cargo test -p xcl --lib -- --test-threads=4, same env:

  • head: 1320 passed, 0 failed, 27 ignored
  • merge-base: 1315 passed, 0 failed, 27 ignored (5 fewer tests: the stack's new tests are not there)

Skips (25 SKIPPED lines, identical on head and merge-base):

  • 21 "no wave64": this GPU has no native wave64, so the native-wave64 cases skip.
  • 3 "refused (unsupported V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 (its #1426 semantics differ from the console's))": f16 per-lane form, unrelated to this PR.
  • 1 pso_measurement_compiles_an_exact_synthetic_record: needs Windows Developer Mode to disable the driver cache.

Not tested: retail title; AMD wave64 hardware.

AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).

<!-- greyfinch-sync:ivall/xcl:comment:7205607304 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228#issuecomment-7205607304). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T23:31:07Z. --- @NWProgramming00 thanks, 1aa9794 looks right to me by reading. `gfx_split` is now `wave64 && split_wave64` for a VS / PS, which is the HLSL path's condition at emit.rs:4405. `direct_graphics` passes the split through, and `translate_on_this_thread` still clears `split` for graphics, so nothing else changes for a VS / PS. I also ran it on our card: Tested head `1aa97946e97e71e5baca0a62d088e552d0214ad5`, merge-base `e120925e3abc9956a8b9bae631969d32e8ccd43c`, RTX 3070 (Ampere) driver 616.56, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09) Debug profile (not release), no game files. `cargo build --workspace` and `cargo test -p xcl --lib --no-run` built clean on head. `XCL_DIRECT_DXIL` was not set: the PR says `gpu_ds_permute_b32_direct` runs the direct translator whatever it says. **1. The five ds_permute tests on head, `--test-threads=1`, three runs** (`ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist`, `ds_permute_b32_refused_where_upper_lanes_do_not_exist`, `ds_permute_reference_matches_rdna2_values`, `gpu_ds_permute_b32`, `gpu_ds_permute_b32_direct`): - run 1: 5 passed, 0 failed, 0 ignored - run 2: 5 passed, 0 failed, 0 ignored - run 3: 5 passed, 0 failed, 0 ignored **2. Negative control.** Parent `9f2cacc163ecac52bb91c0b8fe3aa5bc9510932d` (1aa9794^) with only the new test from 1aa9794 added to `recomp/tests.rs`: 0 passed, 1 failed. `ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist` panicked at `crates\xcl\src\gpu\recomp\tests.rs:8526:5`: `PS: ""`. So `translate_pixel` with `split: true` returned no error (the refusal did not fire), which is the bug the commit fixes. **3. `cargo test -p xcl --lib -- --test-threads=4`, same env:** - head: 1320 passed, 0 failed, 27 ignored - merge-base: 1315 passed, 0 failed, 27 ignored (5 fewer tests: the stack's new tests are not there) Skips (25 `SKIPPED` lines, identical on head and merge-base): - 21 "no wave64": this GPU has no native wave64, so the native-wave64 cases skip. - 3 "refused (unsupported V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 (its #1426 semantics differ from the console's))": f16 per-lane form, unrelated to this PR. - 1 `pso_measurement_compiles_an_exact_synthetic_record`: needs Windows Developer Mode to disable the driver cache. Not tested: retail title; AMD wave64 hardware. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
JJAutoCompare commented 2026-11-27 00:20:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T00:20:35Z.


Tested: Clean 1aa97946e97e71e5baca0a62d088e552d0214ad5, Windows 11 build 26200, Ryzen 7 3800X, Arc A770 driver 32.0.101.9175, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug. cargo test --locked -p xcl --lib -j 2 --no-run, then ds_permute --skip gpu_ds_permute_b32 --test-threads=1 --nocapture and each exact test gpu::recomp::tests::{gpu_ds_permute_b32,gpu_ds_permute_b32_direct} on the resulting binary. Three CPU and two Arc tests passed, with zero failures, ignores or skips. A standalone replay of the fixture captured identical HLSL and direct DXIL readbacks for 160 wave32 and 320 split-wave64 register values, including collisions and inactive lanes.

Not tested: Retail smoke, full workspace suite, and native wave64 hardware.

AI use: T3 Code / Codex (gpt-6.2-sol) ran and reran the checks and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7206380238 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228#issuecomment-7206380238). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-27T00:20:35Z. --- **Tested:** Clean `1aa97946e97e71e5baca0a62d088e552d0214ad5`, Windows 11 build 26200, Ryzen 7 3800X, Arc A770 driver 32.0.101.9175, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug. `cargo test --locked -p xcl --lib -j 2 --no-run`, then `ds_permute --skip gpu_ds_permute_b32 --test-threads=1 --nocapture` and each exact test `gpu::recomp::tests::{gpu_ds_permute_b32,gpu_ds_permute_b32_direct}` on the resulting binary. Three CPU and two Arc tests passed, with zero failures, ignores or skips. A standalone replay of the fixture captured identical HLSL and direct DXIL readbacks for 160 wave32 and 320 split-wave64 register values, including collisions and inactive lanes. **Not tested:** Retail smoke, full workspace suite, and native wave64 hardware. **AI use:** T3 Code / Codex (`gpt-6.2-sol`) ran and reran the checks and wrote this report.
Decodere commented 2026-11-27 00:45:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T00:45:28Z.


Independent desktop NVIDIA (Wave32-only Ada) verification of PR #2228 at head 1aa97946e97e71e5baca0a62d088e552d0214ad5 (3 commits 06d8dea4 -> 9f2cacc1 -> 1aa97946; exact merge-base: e120925e3abc9956a8b9bae631969d32e8ccd43c, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (1aa97946)

Command Result
cargo test --release -p xcl --lib ds_permute_reference_matches_rdna2_values -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1346 filtered out × 3 (0.00s × 3)
cargo test --release -p xcl --lib gpu_ds_permute_b32 -- --nocapture (3 consecutive runs; executes both gpu_ds_permute_b32 and gpu_ds_permute_b32_direct) 2 passed; 0 failed; 0 ignored; 1345 filtered out × 3 (0.31s, 0.24s, 0.23s, 0 skipped; live on RTX 4060 + DXC 1.9.2609.5)
cargo test --release -p xcl --lib gpu_ds_permute_b32_direct -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1346 filtered out × 3 (0.19s, 0.19s, 0.21s, 0 skipped)
cargo test --release -p xcl --lib ds_permute_b32_refused_where_upper_lanes_do_not_exist -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1346 filtered out × 3 (0.00s × 3)
cargo test --release -p xcl --lib ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1346 filtered out × 3 (0.01s × 3)
cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4 (3 consecutive runs) 184 passed; 0 failed; 3 ignored; 1160 filtered out × 3 (4.03s, 4.39s, 4.15s; 183 executed + 1 expected Wave32-only skip dispatch_chain_native_wave64_builds_whole: no wave64)
cargo test --release -p xcl --lib gpu::recomp::pso:: (3 consecutive runs) 27 passed; 0 failed; 1 ignored; 1319 filtered out × 3 (0.08s × 3, 0 skipped)
cargo build --release -p xcl Clean build (1m 14s, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact merge-base (e120925e3abc9956a8b9bae631969d32e8ccd43c, cached baseline on the same machine):

xcl-smoke v1
commit: e120925e3abc9956a8b9bae631969d32e8ccd43c
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13979 MB

PR #2228 (1aa97946e97e71e5baca0a62d088e552d0214ad5):

xcl-smoke v1
commit: 1aa97946e97e71e5baca0a62d088e552d0214ad5
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13975 MB

Runtime log observations (xcl.log)

  • 9221 log lines, 0 [ERROR] / device-removal / panic lines.
  • Final draw/memory telemetry in log: 19585 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 13975 MB committed by the process; video memory 6115 MB local, 4651 MB non-local.

Limits of coverage

  • Both HLSL (gpu_ds_permute_b32) and direct DXIL (gpu_ds_permute_b32_direct) ds_permute_b32 lowering matched the RDNA2 reference live on desktop Wave32-only RTX 4060 (3/3, 0 skipped), alongside both VS/PS upper-lane refusal tests (3/3), gpu::dxil:: (183 executed + 1 expected no wave64 skip × 3), and gpu::recomp::pso:: (27/0/1 × 3).
  • Native Wave64 GPU execution is not available on this Wave32-only NVIDIA RTX 4060 (dispatch_chain_native_wave64_builds_whole skipped as expected), and the warm-cache 60 s retail smoke on title: 29640639 confirms zero runtime regression rather than exercising a retail shader using ds_permute_b32.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7206727312 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228#issuecomment-7206727312). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T00:45:28Z. --- Independent desktop NVIDIA (Wave32-only Ada) verification of **PR #2228** at head `1aa97946e97e71e5baca0a62d088e552d0214ad5` (`3` commits `06d8dea4 -> 9f2cacc1 -> 1aa97946`; exact merge-base: `e120925e3abc9956a8b9bae631969d32e8ccd43c`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`1aa97946`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib ds_permute_reference_matches_rdna2_values -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1346 filtered out` × 3 (`0.00s` × 3) | | `cargo test --release -p xcl --lib gpu_ds_permute_b32 -- --nocapture` (3 consecutive runs; executes both `gpu_ds_permute_b32` and `gpu_ds_permute_b32_direct`) | `2 passed; 0 failed; 0 ignored; 1345 filtered out` × 3 (`0.31s`, `0.24s`, `0.23s`, `0` skipped; live on RTX 4060 + DXC `1.9.2609.5`) | | `cargo test --release -p xcl --lib gpu_ds_permute_b32_direct -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1346 filtered out` × 3 (`0.19s`, `0.19s`, `0.21s`, `0` skipped) | | `cargo test --release -p xcl --lib ds_permute_b32_refused_where_upper_lanes_do_not_exist -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1346 filtered out` × 3 (`0.00s` × 3) | | `cargo test --release -p xcl --lib ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1346 filtered out` × 3 (`0.01s` × 3) | | `cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4` (3 consecutive runs) | `184 passed; 0 failed; 3 ignored; 1160 filtered out` × 3 (`4.03s`, `4.39s`, `4.15s`; `183` executed + `1` expected Wave32-only skip `dispatch_chain_native_wave64_builds_whole: no wave64`) | | `cargo test --release -p xcl --lib gpu::recomp::pso::` (3 consecutive runs) | `27 passed; 0 failed; 1 ignored; 1319 filtered out` × 3 (`0.08s` × 3, `0` skipped) | | `cargo build --release -p xcl` | Clean build (`1m 14s`, exit `0`, `0` new warnings) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact merge-base (`e120925e3abc9956a8b9bae631969d32e8ccd43c`, cached baseline on the same machine): ``` xcl-smoke v1 commit: e120925e3abc9956a8b9bae631969d32e8ccd43c gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1602) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13979 MB ``` PR #2228 (`1aa97946e97e71e5baca0a62d088e552d0214ad5`): ``` xcl-smoke v1 commit: 1aa97946e97e71e5baca0a62d088e552d0214ad5 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1606 (PresentX 1606) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13975 MB ``` ### Runtime log observations (`xcl.log`) - `9221` log lines, `0` `[ERROR]` / device-removal / panic lines. - Final draw/memory telemetry in log: `19585 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `13975 MB committed by the process; video memory 6115 MB local, 4651 MB non-local`. ### Limits of coverage - Both HLSL (`gpu_ds_permute_b32`) and direct DXIL (`gpu_ds_permute_b32_direct`) `ds_permute_b32` lowering matched the RDNA2 reference live on desktop Wave32-only RTX 4060 (`3/3`, `0` skipped), alongside both VS/PS upper-lane refusal tests (`3/3`), `gpu::dxil::` (`183` executed + `1` expected `no wave64` skip × 3), and `gpu::recomp::pso::` (`27/0/1` × 3). - Native Wave64 GPU execution is not available on this Wave32-only NVIDIA RTX 4060 (`dispatch_chain_native_wave64_builds_whole` skipped as expected), and the warm-cache 60 s retail smoke on `title: 29640639` confirms zero runtime regression rather than exercising a retail shader using `ds_permute_b32`. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
Foniass commented 2026-12-01 07:37:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:37:37Z.


Triage (#1607) – head f3f2922

No open or merged PR adds ds_permute_b32 to the direct DXIL translator. Main's lower_mem.rs handles ds_bpermute_b32 and ds_swizzle_b32 only.
No problems found in the diff. The forward permute is done per 32-lane half with the highest active sender winning, as in the HLSL path. The existing GPU test now also runs the direct path, and the refusal for split wave64 VS/PS is tested.
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:7304286741 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228#issuecomment-7304286741). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:37:37Z. --- **Triage (#1607)** – head f3f2922 No open or merged PR adds `ds_permute_b32` to the direct DXIL translator. Main's `lower_mem.rs` handles `ds_bpermute_b32` and `ds_swizzle_b32` only. No problems found in the diff. The forward permute is done per 32-lane half with the highest active sender winning, as in the HLSL path. The existing GPU test now also runs the direct path, and the refusal for split wave64 VS/PS is tested. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
BBareth commented 2026-12-01 09:38:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-12-01T09:38:43Z.


merge-check claim
head: f3f2922951

<!-- greyfinch-sync:ivall/xcl:comment:7306998856 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228#issuecomment-7306998856). Originally posted by [BBareth](https://github.com/BBareth) on 2026-12-01T09:38:43Z. --- merge-check claim head: f3f292295195d96f3e245733562145cf4a7b2475
BBareth commented 2026-12-01 09:59:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-12-01T09:59:49Z.


merge-check
base: 493dbd3dd0
head: f3f2922951
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2902 passed, 0 failed, 51 ignored; 28 SKIPPED lines, as on the base; failing: none. The base alone, same machine, same commit: 2900 passed, 0 failed, 51 ignored, 28 SKIPPED lines (22 no wave64, 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 cannot disable the driver cache). Both new tests ran and passed: gpu_ds_permute_b32_direct (on the GPU) and ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist.
review: no blocking finding; two files (+64/-4), every line read. The direct DXIL translator gets ds_permute_b32 (the forward permute): each receiver looks at the 32 senders of its own 32-lane half in lane order through read_lane_half, takes DATA0 of the last active sender whose ((ADDR + offset) >> 2) & 31 is its lane, and 0 when nobody sends to it; the rule the comment in the PR gives for the HLSL path, and the existing GPU test now runs both translators against the same expected values. It is an unrolled loop of 32 lane reads per instruction, so the emitted code grows by that much per use. Not tested here: native wave64 (this adapter runs the split form), and a retail shader that uses the instruction.
performance: none by default for programs without the instruction; with it, 32 lane reads per use (not measured).
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.

<!-- greyfinch-sync:ivall/xcl:comment:7307512677 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228#issuecomment-7307512677). Originally posted by [BBareth](https://github.com/BBareth) on 2026-12-01T09:59:49Z. --- merge-check base: 493dbd3dd0cd50b4c3e8d28f73ab9b504fcd8158 head: f3f292295195d96f3e245733562145cf4a7b2475 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2902 passed, 0 failed, 51 ignored; 28 SKIPPED lines, as on the base; failing: none. The base alone, same machine, same commit: 2900 passed, 0 failed, 51 ignored, 28 SKIPPED lines (22 no wave64, 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 cannot disable the driver cache). Both new tests ran and passed: `gpu_ds_permute_b32_direct` (on the GPU) and `ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist`. review: no blocking finding; two files (+64/-4), every line read. The direct DXIL translator gets `ds_permute_b32` (the forward permute): each receiver looks at the 32 senders of its own 32-lane half in lane order through `read_lane_half`, takes DATA0 of the last active sender whose `((ADDR + offset) >> 2) & 31` is its lane, and 0 when nobody sends to it; the rule the comment in the PR gives for the HLSL path, and the existing GPU test now runs both translators against the same expected values. It is an unrolled loop of 32 lane reads per instruction, so the emitted code grows by that much per use. Not tested here: native wave64 (this adapter runs the split form), and a retail shader that uses the instruction. performance: none by default for programs without the instruction; with it, 32 lane reads per use (not measured). verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
fromthemoonx commented 2026-12-02 14:36:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-02T14:36:51Z.


merge-check
base: 5eaadb54c1
head: f3f2922951
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2976 passed, 0 failed, 52 ignored (base: 2974 passed, 0 failed, 52 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same set as base; failing: none
review: read the whole diff (2 files, +64 -4). No problem found.

  • The 5 ds_permute tests: 3 of 3 rounds passed on this wave32 GPU, none skipped, and once more with XCL_DIRECT_DXIL=all.
  • Mutations: the lowest sender winning instead of the highest, and senders outside EXEC counted. gpu_ds_permute_b32_direct fails for both.
  • Main got new split-wave64 shortcuts after this PR was written (gpu/dxil/idioms.rs, #3655). From reading, they do not affect this instruction: the mask analysis treats DS_PERMUTE_B32 as reading every mask whole, a branch over any DS instruction is not decided by each half alone, and its result is not taken as uniform.
  • Not run here: native wave64, and a title or retail shader that uses the instruction.
    performance: no change for programs without the instruction. Each use is unrolled into 32 senders (two lane reads each), so it adds code; not measured.
    verdict: safe to merge
    hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
<!-- greyfinch-sync:ivall/xcl:comment:7348843846 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2228#issuecomment-7348843846). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-02T14:36:51Z. --- merge-check base: 5eaadb54c14e0fc29597b2a1689d7dbd83491303 head: f3f292295195d96f3e245733562145cf4a7b2475 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2976 passed, 0 failed, 52 ignored (base: 2974 passed, 0 failed, 52 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same set as base; failing: none review: read the whole diff (2 files, +64 -4). No problem found. - The 5 `ds_permute` tests: 3 of 3 rounds passed on this wave32 GPU, none skipped, and once more with `XCL_DIRECT_DXIL=all`. - Mutations: the lowest sender winning instead of the highest, and senders outside EXEC counted. `gpu_ds_permute_b32_direct` fails for both. - Main got new split-wave64 shortcuts after this PR was written (`gpu/dxil/idioms.rs`, #3655). From reading, they do not affect this instruction: the mask analysis treats `DS_PERMUTE_B32` as reading every mask whole, a branch over any DS instruction is not decided by each half alone, and its result is not taken as uniform. - Not run here: native wave64, and a title or retail shader that uses the instruction. performance: no change for programs without the instruction. Each use is unrolled into 32 senders (two lane reads each), so it adds code; not measured. verdict: safe to merge hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
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/2228:upstream-pr/2228'
git switch 'upstream-pr/2228'

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