Recompiler: keep scalar state across proven per-lane paths #1912

Open
github-bot wants to merge 4 commits from github-bot/gh-1912 into main AGit
Owner

@⁠Kalmarv on GitHub · 2026-11-24 23:00 UTC · original
Kalmarv:per-lane-stale-main → main · +272 −21 · 4 files · 4 commits · open

Part of #1269. Builds on #1866 (merged). Four commits, rebased onto main cbfc67bc: a test for SCC from the complemented SAVEEXEC forms (review point 3; it was meant for #1866, which merged first), this change, the dominance-walk fix from review point 1, and a fix for an interaction with #1888.

What is in it

A per-lane read can use a dominating write when the reader stays inside every loop containing that write. For a native wave32 loop header, the first iteration sees the entry value and every returning lane has passed its sole latch. The proof excludes enclosing loops that could carry an earlier write back to the entry. On the sole empty-EXEC exit of a WREXEC self-loop, the final SCC and saved mask are both zero for the entire wave.

  • crates/xcl/src/gpu/recomp/lower.rs, lane_masks.rs: the dominance proof for reads inside loops and the WREXEC exit case.
  • crates/xcl/src/gpu/recomp/lower_dxil.rs: GPU and CPU tests.
  • README.md: one line on the new per-lane loop case.
  • c4093f4, after #1888 merged: its SCC check rejected the shrinking wave32 loop, because the analysis lost the fact that EXEC is empty on the loop's exit. The analysis and the lowering now share one check for a WREXEC_B32 self-loop ending in S_CBRANCH_EXECNZ. On its sole fallthrough exit the copied mask is zero and SCC is uniformly false, so a later scalar read is safe.
  • Review fixes: both dominance walks stop at the dominator-tree root rather than at block 0 and handle unreachable blocks (with a nonzero-entry CPU test); the unreachable plain ANDN1 arm in the mixed-mask list is removed, with a CPU test of S_ANDN1_SAVEEXEC_B32 and S_ORN1_SAVEEXEC_B32 SCC.

Tested

  • Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, Rust 1.99.0 (MSVC x64), release, DXC 1.9.2609.5.
  • Measured before the rebase: against mixed-mask parent 33b1b33e, 6a760ae4 raises native per-lane translation from 316 to 427 of 2,689 compute programs using four switch-selected memory windows. All 111 new admissions were previously refused for a stale value. Stale-first refusals fell from 154 to 43. The 316 previously accepted programs retained their DXIL byte counts. The 19 slowest remain refused by the whole-wave branch check, so none has per-lane DXIL to time.
  • Wave32 tests compare the translated DXIL with independently compiled HLSL on an RTX 5070 Ti. They check a shrinking loop with a latch counter, the SCC after a WREXEC loop, and values below a nested branch. A read of the counter after the loop still refuses. The bounded checker found the two new synthetic programs equivalent on mutually terminating full-launch executions through four backedges for the counter and one for the WREXEC case, excluding documented stale final ABI slots.
  • On c4093f4, after the rebase onto cbfc67bc:
    • cargo test --workspace -- --test-threads=4 (debug): 1187 passed, 1 failed, 46 ignored.
    • The release xcl library tests (four threads, nothing filtered): 1131 passed, 1 failed, 26 ignored.
    • The one failure in both is hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa, which fails on main itself since #1991 (see the note there).
    • SKIPPED: 23 subcases need native wave64 or are forms the per-lane path refuses (20 and 3); the debug run adds one with no heap windows.
  • The rebase resolved one hunk against #2203 in lower.rs: wave_branches keeps #2203's ir.can_wave_branch() and SCC liveness, and analyze_branches keeps this PR's fifth argument.
  • Before the rebase, on 5d0c1f0: cargo test --release --workspace -- --test-threads=4 reported 963 passed, 0 failed and 43 ignored. Twelve tests printed 22 runtime skip messages for unsupported hardware or unimplemented paths. The new GPU fixtures ran with DXC 1.9 and no skip.

Regression run

scripts/smoke.ps1, the same retail title for 60 s each, one after the other on the machine under Tested, release builds from clean trees.

main cbfc67b (this PR's base):

xcl-smoke v1
commit: cbfc67bc529c607aa5072647b4e1999b75f8902f
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1312 (PresentX 1312)
presents per 2 s (last 3): 17 42 59
device removals: 0
crashes: 0
peak commit: 26713 MB

this PR, c4093f4:

xcl-smoke v1
commit: c4093f4c79992b57cc83bb9c36445160bdd33875
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1298 (PresentX 1299)
presents per 2 s (last 3): 37 39 42
device removals: 0
crashes: 0
peak commit: 27446 MB

PR vs main: 1298 / 1312 frames (99 %), peak commit 27446 / 26713 MB (103 %); device removals 0 and crashes 0 on both runs.

Both runs use default settings, nothing else running.

Not tested

  • AMD, native wave64 on hardware, Linux.
  • Output equivalence on retail programs beyond the synthetic GPU readbacks and the bounded check.
  • The 316 → 427 admission count on the rebased head (it was measured before the rebase), and the random-input comparison of per-lane DXIL against HLSL on it (posted for 5d0c1f0).

AI use

OpenAI Codex (GPT-6.2) wrote the change and the tests and ran the suite and the pack count. Claude Code (Claude Opus 5.5) edited this description and opened the PR.

🤖 Generated with Claude Code

**@⁠Kalmarv** on GitHub · 2026-11-24 23:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912) `Kalmarv:per-lane-stale-main` → `main` · +272 −21 · 4 files · 4 commits · open Part of #1269. Builds on #1866 (merged). Four commits, rebased onto `main` `cbfc67bc`: a test for SCC from the complemented SAVEEXEC forms (review point 3; it was meant for #1866, which merged first), this change, the dominance-walk fix from review point 1, and a fix for an interaction with #1888. **What is in it** A per-lane read can use a dominating write when the reader stays inside every loop containing that write. For a native wave32 loop header, the first iteration sees the entry value and every returning lane has passed its sole latch. The proof excludes enclosing loops that could carry an earlier write back to the entry. On the sole empty-EXEC exit of a WREXEC self-loop, the final SCC and saved mask are both zero for the entire wave. - `crates/xcl/src/gpu/recomp/lower.rs`, `lane_masks.rs`: the dominance proof for reads inside loops and the WREXEC exit case. - `crates/xcl/src/gpu/recomp/lower_dxil.rs`: GPU and CPU tests. - `README.md`: one line on the new per-lane loop case. - `c4093f4`, after #1888 merged: its SCC check rejected the shrinking wave32 loop, because the analysis lost the fact that EXEC is empty on the loop's exit. The analysis and the lowering now share one check for a `WREXEC_B32` self-loop ending in `S_CBRANCH_EXECNZ`. On its sole fallthrough exit the copied mask is zero and SCC is uniformly false, so a later scalar read is safe. - Review fixes: both dominance walks stop at the dominator-tree root rather than at block 0 and handle unreachable blocks (with a nonzero-entry CPU test); the unreachable plain `ANDN1` arm in the mixed-mask list is removed, with a CPU test of `S_ANDN1_SAVEEXEC_B32` and `S_ORN1_SAVEEXEC_B32` SCC. **Tested** - Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, Rust 1.99.0 (MSVC x64), release, DXC 1.9.2609.5. - Measured before the rebase: against mixed-mask parent `33b1b33e`, `6a760ae4` raises native per-lane translation from **316 to 427 of 2,689** compute programs using four switch-selected memory windows. All 111 new admissions were previously refused for a stale value. Stale-first refusals fell from 154 to 43. The 316 previously accepted programs retained their DXIL byte counts. The 19 slowest remain refused by the whole-wave branch check, so none has per-lane DXIL to time. - Wave32 tests compare the translated DXIL with independently compiled HLSL on an RTX 5070 Ti. They check a shrinking loop with a latch counter, the SCC after a WREXEC loop, and values below a nested branch. A read of the counter after the loop still refuses. The bounded checker found the two new synthetic programs equivalent on mutually terminating full-launch executions through four backedges for the counter and one for the WREXEC case, excluding documented stale final ABI slots. - On `c4093f4`, after the rebase onto `cbfc67bc`: - `cargo test --workspace -- --test-threads=4` (debug): 1187 passed, 1 failed, 46 ignored. - The release `xcl` library tests (four threads, nothing filtered): 1131 passed, 1 failed, 26 ignored. - The one failure in both is `hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa`, which fails on `main` itself since #1991 (see the note there). - SKIPPED: 23 subcases need native wave64 or are forms the per-lane path refuses (20 and 3); the debug run adds one with no heap windows. - The rebase resolved one hunk against #2203 in `lower.rs`: `wave_branches` keeps #2203's `ir.can_wave_branch()` and SCC liveness, and `analyze_branches` keeps this PR's fifth argument. - Before the rebase, on `5d0c1f0`: `cargo test --release --workspace -- --test-threads=4` reported 963 passed, 0 failed and 43 ignored. Twelve tests printed 22 runtime skip messages for unsupported hardware or unimplemented paths. The new GPU fixtures ran with DXC 1.9 and no skip. **Regression run** `scripts/smoke.ps1`, the same retail title for 60 s each, one after the other on the machine under **Tested**, release builds from clean trees. `main` `cbfc67b` (this PR's base): ``` xcl-smoke v1 commit: cbfc67bc529c607aa5072647b4e1999b75f8902f gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1312 (PresentX 1312) presents per 2 s (last 3): 17 42 59 device removals: 0 crashes: 0 peak commit: 26713 MB ``` this PR, `c4093f4`: ``` xcl-smoke v1 commit: c4093f4c79992b57cc83bb9c36445160bdd33875 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1298 (PresentX 1299) presents per 2 s (last 3): 37 39 42 device removals: 0 crashes: 0 peak commit: 27446 MB ``` PR vs `main`: 1298 / 1312 frames (99 %), peak commit 27446 / 26713 MB (103 %); device removals 0 and crashes 0 on both runs. Both runs use default settings, nothing else running. **Not tested** - AMD, native wave64 on hardware, Linux. - Output equivalence on retail programs beyond the synthetic GPU readbacks and the bounded check. - The 316 → 427 admission count on the rebased head (it was measured before the rebase), and the random-input comparison of per-lane DXIL against HLSL on it (posted for `5d0c1f0`). **AI use** OpenAI Codex (GPT-6.2) wrote the change and the tests and ran the suite and the pack count. Claude Code (Claude Opus 5.5) edited this description and opened the PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ANDN1 and ORN1 only occur in EXEC forms, which record lane SCC before the plain bitwise path. Remove the unreachable ANDN1 plain case and exercise both real encodings across an EXEC restore.
A lane can use a dominating definition while it remains in every loop containing the write. A native wave32 loop header can also read its sole latch's definition on the back edge if no enclosing loop can carry an earlier value to the entry. Preserve the final zero SCC and mask on the sole empty-EXEC exit of a WREXEC self-loop.

Check the reads in nested arms, lanes leaving a loop at different iterations and a read of the counter after exit. Compare both shrinking-loop kernels with HLSL on the GPU.
Use the same root and unreachable checks when constructing loop bodies and proving stale reads. Test a nonzero entry. The existing two-entry cycle test exercises the irreducibility refusal before a summary reaches the lowering.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:09:16 +00:00
Author
Owner

@⁠eizispark on GitHub · 2026-11-24 23:27 UTC · original

Hardware test report — commit 661f7fd

Verified 661f7fdad2d39368e875a678535a7cb13c5ecd5d (branched from main 689f2db477c3c062cf162649781640ef8a977c18, clean merge with current main 20cf130): pass (0 new failures vs main 689f2db).

Tested

  • Hardware: Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver 32.0.32015.16001), 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smoke
  • cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::msaa_tests::gpu_direct_msaa_image_loads: 976 passed, 2 failed, 45 ignored (8 skipped), vs main 689f2db 972 passed, 2 failed, 45 ignored (8 skipped) on this adapter:
    • --skip gpu::dxil::msaa_tests::gpu_direct_msaa_image_loads avoids the pre-#1900 #1679 amdxc64.dll 0xc0000005 crash on the 689f2db base, and the 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722, gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3 seed 1599) are pre-existing on 689f2db; 0 new failures
    • 8 skipped: 6 gpu::recomp::lower_dxil::tests f16/f32 direct-DXIL per-lane cases refused where #1426 semantics differ from the console's; shaders::tests::pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode required, 0x887A002D); heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
  • All 50/50 gpu::recomp::lower::tests and gpu::recomp::lower_dxil::tests passed on RX 9070 XT — including a_value_written_in_a_lane_region_is_read_in_it_past_an_inner_if, the_latch_counter_can_still_be_stale_after_the_loop, a_branch_on_a_mixed_mask_matches_the_hlsl_path_on_the_gpu, shrinking_loops_agree_with_the_hlsl_path_on_the_gpu, and REGION_DIAMOND GPU runs — along with native RDNA4 wave64 GPU tests (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, console_wave64_compute_through_the_pso_hook_dispatch_and_read_back)

Regression run (scripts/smoke.ps1, 60 s, warm shader/driver cache)
main (689f2db477c3c062cf162649781640ef8a977c18):

xcl-smoke v1
commit: 689f2db477c3c062cf162649781640ef8a977c18
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1674 (PresentX 1674)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14862 MB

PR (661f7fdad2d39368e875a678535a7cb13c5ecd5d):

xcl-smoke v1
commit: 661f7fdad2d39368e875a678535a7cb13c5ecd5d
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1677 (PresentX 1677)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14864 MB

Not tested

  • NVIDIA/Intel GPUs, retail run with XCL_DIRECT_DXIL=1 + XCL_PER_LANE=1 past the menus

AI use

  • Antigravity (Google DeepMind, Gemini 4 Carbon) ran the workspace test suite and 60-second retail smoke check and formatted this report.
**@⁠eizispark** on GitHub · 2026-11-24 23:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7147424976) ### Hardware test report — commit `661f7fd` Verified `661f7fdad2d39368e875a678535a7cb13c5ecd5d` (branched from `main` `689f2db477c3c062cf162649781640ef8a977c18`, clean merge with current `main` `20cf130`): **pass** (`0` new failures vs `main` `689f2db`). **Tested** - Hardware: Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver `32.0.32015.16001`), 32 GB RAM, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, debug tests + release smoke - `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::msaa_tests::gpu_direct_msaa_image_loads`: `976 passed, 2 failed, 45 ignored` (`8 skipped`), vs `main` `689f2db` `972 passed, 2 failed, 45 ignored` (`8 skipped`) on this adapter: - `--skip gpu::dxil::msaa_tests::gpu_direct_msaa_image_loads` avoids the pre-`#1900` `#1679` `amdxc64.dll` `0xc0000005` crash on the `689f2db` base, and the 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722, `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3` seed 1599) are pre-existing on `689f2db`; `0` new failures - `8 skipped`: 6 `gpu::recomp::lower_dxil::tests` f16/f32 direct-DXIL per-lane cases refused where `#1426` semantics differ from the console's; `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` (`Windows Developer Mode required`, `0x887A002D`); `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows` - All `50/50` `gpu::recomp::lower::tests` and `gpu::recomp::lower_dxil::tests` passed on RX 9070 XT — including `a_value_written_in_a_lane_region_is_read_in_it_past_an_inner_if`, `the_latch_counter_can_still_be_stale_after_the_loop`, `a_branch_on_a_mixed_mask_matches_the_hlsl_path_on_the_gpu`, `shrinking_loops_agree_with_the_hlsl_path_on_the_gpu`, and `REGION_DIAMOND` GPU runs — along with native RDNA4 wave64 GPU tests (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `console_wave64_compute_through_the_pso_hook_dispatch_and_read_back`) **Regression run** (`scripts/smoke.ps1`, 60 s, warm shader/driver cache) `main` (`689f2db477c3c062cf162649781640ef8a977c18`): ``` xcl-smoke v1 commit: 689f2db477c3c062cf162649781640ef8a977c18 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1674 (PresentX 1674) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14862 MB ``` PR (`661f7fdad2d39368e875a678535a7cb13c5ecd5d`): ``` xcl-smoke v1 commit: 661f7fdad2d39368e875a678535a7cb13c5ecd5d gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1677 (PresentX 1677) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14864 MB ``` **Not tested** - NVIDIA/Intel GPUs, retail run with `XCL_DIRECT_DXIL=1` + `XCL_PER_LANE=1` past the menus **AI use** - Antigravity (Google DeepMind, Gemini 4 Carbon) ran the workspace test suite and 60-second retail smoke check and formatted this report.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 23:40 UTC · original

@⁠ruipedro-pinheiro thanks for the careful read. On the four points:

  1. dominates: agreed, we'll stop on idom[b] == b rather than on block 0.
  2. Irreducible cycles: we're checking whether one is refused before this point. If it isn't, the check will refuse it here, with a CPU test that has an irreducible cycle.
  3. ORN1: that list comes from #1866, so the fix goes there as its own commit, with a test like the ANDN1 one; this PR then gets restacked on it.
  4. The random-input comparison of per-lane DXIL against HLSL for the 111 newly admitted programs is running on an RTX 5070 Ti. We'll post the result here.

We'll reply here with the new heads.

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

**@⁠Kalmarv** on GitHub · 2026-11-24 23:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7147673623) @⁠ruipedro-pinheiro thanks for the careful read. On the four points: 1. `dominates`: agreed, we'll stop on `idom[b] == b` rather than on block 0. 2. Irreducible cycles: we're checking whether one is refused before this point. If it isn't, the check will refuse it here, with a CPU test that has an irreducible cycle. 3. ORN1: that list comes from #1866, so the fix goes there as its own commit, with a test like the ANDN1 one; this PR then gets restacked on it. 4. The random-input comparison of per-lane DXIL against HLSL for the 111 newly admitted programs is running on an RTX 5070 Ti. We'll post the result here. We'll reply here with the new heads. AI use: Claude Code (Claude Opus 5.5) wrote this.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 23:47 UTC · original

@⁠ruipedro-pinheiro the review fixes are pushed. This PR is now 177785a, on #1866's new head c61f53d.

  1. dominates: both dominance walks now stop at the root of the dominator tree, the block whose immediate dominator is itself, rather than at block 0, and they handle unreachable blocks. A new CPU test has an entry block that isn't block 0.
  2. Irreducible cycles: these are refused before the stale-value check is reached. Lanes::new (lane_masks.rs:418) rejects a backward edge whose target doesn't dominate its source, and lowering (lower.rs:1175) returns that error before it reads any loop body. The existing two-entry-cycle CPU test (lane_masks.rs:1070) checks that exact refusal.
  3. ORN1: S_ORN1_SAVEEXEC_B32 already took the EXEC-specific path (lane_masks.rs:519-526), which sets SCC from the new mask. The plain ANDN1 arm next to it was unreachable, so it's removed. A new CPU test on #1866 covers both complemented SAVEEXEC forms with a numeric input and EXEC restored before the SCC branch.
  4. Random-input comparison of the 111: still running. Programs that need native wave64 can't run on our 32-lane card, so those will be listed as not covered.

cargo test --release -p xcl --lib -- gpu::recomp on an RTX 5070 Ti: 267 passed, 0 failed, 18 ignored on 177785a, and 263 / 0 / 18 on c61f53d. The 21 skip notices are 18 native wave64 and 3 unsupported wave32 f16 cases. Regression pairs on the new heads are queued.

AI use: OpenAI Codex (GPT-6.2) wrote the fixes and the tests and ran them; Claude Code (Claude Opus 5.5) wrote this.

**@⁠Kalmarv** on GitHub · 2026-11-24 23:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7147799107) @⁠ruipedro-pinheiro the review fixes are pushed. This PR is now `177785a`, on #1866's new head `c61f53d`. 1. **`dominates`**: both dominance walks now stop at the root of the dominator tree, the block whose immediate dominator is itself, rather than at block 0, and they handle unreachable blocks. A new CPU test has an entry block that isn't block 0. 2. **Irreducible cycles**: these are refused before the stale-value check is reached. `Lanes::new` (`lane_masks.rs:418`) rejects a backward edge whose target doesn't dominate its source, and lowering (`lower.rs:1175`) returns that error before it reads any loop body. The existing two-entry-cycle CPU test (`lane_masks.rs:1070`) checks that exact refusal. 3. **ORN1**: `S_ORN1_SAVEEXEC_B32` already took the EXEC-specific path (`lane_masks.rs:519-526`), which sets SCC from the new mask. The plain `ANDN1` arm next to it was unreachable, so it's removed. A new CPU test on #1866 covers both complemented SAVEEXEC forms with a numeric input and EXEC restored before the SCC branch. 4. **Random-input comparison of the 111**: still running. Programs that need native wave64 can't run on our 32-lane card, so those will be listed as not covered. `cargo test --release -p xcl --lib -- gpu::recomp` on an RTX 5070 Ti: 267 passed, 0 failed, 18 ignored on `177785a`, and 263 / 0 / 18 on `c61f53d`. The 21 skip notices are 18 native wave64 and 3 unsupported wave32 f16 cases. Regression pairs on the new heads are queued. AI use: OpenAI Codex (GPT-6.2) wrote the fixes and the tests and ran them; Claude Code (Claude Opus 5.5) wrote this.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 23:49 UTC · original

Correction to the head above: #1866 was merged at 438d420 before the SAVEEXEC test reached it, so that commit (4c524ec, "cover SCC from complemented SAVEEXEC forms") is now part of this PR. Rebased onto main 62265d3 (clean): head 5d0c1f0, three commits (the SAVEEXEC test, this change, the dominance fix). Pairs on the new head are queued.

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

**@⁠Kalmarv** on GitHub · 2026-11-24 23:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7147844439) Correction to the head above: #1866 was merged at `438d420` before the SAVEEXEC test reached it, so that commit (`4c524ec`, "cover SCC from complemented SAVEEXEC forms") is now part of this PR. Rebased onto `main` `62265d3` (clean): head `5d0c1f0`, three commits (the SAVEEXEC test, this change, the dominance fix). Pairs on the new head are queued. AI use: Claude Code (Claude Opus 5.5) wrote this.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 00:45 UTC · original

On #1912 at 5d0c1f0b, we compared 97 of the 111 new admissions on an RTX 5070 Ti, with one full workgroup per seed (191201, 191203, 191211). All 44 native-wave32 programs matched. Of 53 programs run as split wave64, 51 matched and two differed on all three seeds. Of the 95 matches, 39 changed at least one output word and 56 left the initialized outputs unchanged. Another 13 programs refused split lowering and one failed split PSO creation.

The first differing word in each of the six runs was a texture W component. HLSL stored 0x80000000 (−0) and per-lane stored 0x00000000 (+0). On seed 191201, 12c2b3c6c3298a43 first differed at texture slot 14, word 3, and 3617dc5cc417241a at slot 47, word 195. The scalar buffer descriptors had zero stride and byte limits of 42 and 40 respectively, so loading at byte offset 52 supplied 0x00000000 in both replays.

In 3617dc5cc417241a, the W stored at PC 0x10c comes from V_SUB_F32 at 0x100. In 12c2b3c6c3298a43, the store at 0x2ec takes W from V_MAX_F32 at 0x2e4, following a V_SUB_F32 at 0x2c4. In XCL's default round-to-nearest-even mode, +0 minus +0 gives +0, and RDNA2 takes +0 as the maximum of opposite-signed zeros. Neither program writes the FP mode. The original console launch mode remains unverified. AMD RDNA2 ISA, §§6.4 and 12.7

The HLSL path gives DXC an ordinary 0.0 - x, which compiles here to fsub fast float -0.0, x. Per-lane DXIL preserves the positive left zero. The same instruction-level difference occurs in 17a2587e8c0c4817, already accepted on main 62265d3b before #1912. This explains the first-word sign difference under XCL's modeled mode and places it in the existing HLSL reference. The other differing words still need classification.

@⁠eizispark, could you run the 67 native-wave64 rows on your RX 9070 XT with the default seeds and post the summary from results.csv, including any mismatches or unavailable rows, your driver and DXC version? Native-wave64 replay kit and instructions

AI use: Claude Code (Claude Opus 5.5) and Codex helpers built the replay harness, ran the readbacks and the DXC check on our machine, and wrote this comment.

**@⁠Kalmarv** on GitHub · 2026-11-25 00:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7148848062) On #1912 at `5d0c1f0b`, we compared 97 of the 111 new admissions on an RTX 5070 Ti, with one full workgroup per seed (`191201`, `191203`, `191211`). All 44 native-wave32 programs matched. Of 53 programs run as split wave64, 51 matched and two differed on all three seeds. Of the 95 matches, 39 changed at least one output word and 56 left the initialized outputs unchanged. Another 13 programs refused split lowering and one failed split PSO creation. The first differing word in each of the six runs was a texture W component. HLSL stored `0x80000000` (−0) and per-lane stored `0x00000000` (+0). On seed `191201`, `12c2b3c6c3298a43` first differed at texture slot 14, word 3, and `3617dc5cc417241a` at slot 47, word 195. The scalar buffer descriptors had zero stride and byte limits of 42 and 40 respectively, so loading at byte offset 52 supplied `0x00000000` in both replays. In `3617dc5cc417241a`, the W stored at PC `0x10c` comes from `V_SUB_F32` at `0x100`. In `12c2b3c6c3298a43`, the store at `0x2ec` takes W from `V_MAX_F32` at `0x2e4`, following a `V_SUB_F32` at `0x2c4`. In XCL's default round-to-nearest-even mode, +0 minus +0 gives +0, and RDNA2 takes +0 as the maximum of opposite-signed zeros. Neither program writes the FP mode. The original console launch mode remains unverified. [AMD RDNA2 ISA, §§6.4 and 12.7](https://docs.amd.com/v/u/en-US/rdna2-shader-instruction-set-architecture) The HLSL path gives DXC an ordinary `0.0 - x`, which compiles here to `fsub fast float -0.0, x`. Per-lane DXIL preserves the positive left zero. The same instruction-level difference occurs in `17a2587e8c0c4817`, already accepted on main `62265d3b` before #1912. This explains the first-word sign difference under XCL's modeled mode and places it in the existing HLSL reference. The other differing words still need classification. @⁠eizispark, could you run the 67 native-wave64 rows on your RX 9070 XT with the default seeds and post the summary from `results.csv`, including any mismatches or unavailable rows, your driver and DXC version? [Native-wave64 replay kit and instructions](https://github.com/Kalmarv/xcl/tree/lane1912-replay-kit/scripts/lane1912) AI use: Claude Code (Claude Opus 5.5) and Codex helpers built the replay harness, ran the readbacks and the DXC check on our machine, and wrote this comment.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 02:15 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 02:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7150508632) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 03:33 UTC · original

Arc A770 verification for PR #1912

PR #1912 was open at 5d0c1f0b8a802712e9542f0ffa269d9e36b6747f before and after testing. The assigned checkout was clean and detached at that same commit on both checks. I found no equivalent Arc A770 report in the PR discussion or GPU-results issue #42.

Tested

  • STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 (26200.9974), AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175. Rust 1.100.0 (0ef1bc386) and Cargo 1.100.0 (3acc79c0c), host x86_64-pc-windows-msvc, unoptimized test profile. The GPU test logged DXC 1.9.2609.5 (01b62ad4) and DXIL 1.9.2609.5 from %LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64.
  • cargo test --locked -p xcl --lib --no-run completed outside the Arc lock. Used CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0, CARGO_PROFILE_TEST_DEBUG=0, CARGO_TARGET_DIR=L:/XclTooling/pr1778-2e2ee55-20261125-020159/target, XCL_ADAPTER=A770 and XCL_DXC_DIR pointing at the DXC path above. TEMP and TMP pointed at the private run directory's temp subdirectory.
  • Ran Cargo's built test executable from crates/xcl. The CPU ran outside the Arc lock. The GPU invocation ran in powershell.exe -NoProfile -ExecutionPolicy RemoteSigned with the shared Arc wrapper.
$testExe = 'L:/XclTooling/pr1778-2e2ee55-20261125-020159/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe'
& $testExe --exact gpu::recomp::lane_masks::tests::dominance_ends_at_the_entry_even_when_it_is_not_block_zero --nocapture --test-threads=1
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & $testExe --exact gpu::recomp::lower_dxil::tests::shrinking_loops_agree_with_the_hlsl_path_on_the_gpu --nocapture --test-threads=1
}
  • CPU, 0.01 s. All three dominance assertions passed on the graph with entry block 2, descendant blocks 0 and 1, and unreachable block 3.
  • GPU, 0.32 s. Native wave32 HLSL and per-lane Direct DXIL each produced the expected value on every lane for both shrinking-loop cases. The latch counter produced its lane index in v1 and the WREXEC loop's empty-EXEC exit produced 11 in v2 (128 value assertions across both cases and both paths). The Arc wrapper logged lock release.
  • Both processes exited 0. Each invocation reported 1 passed, 0 failed, 0 ignored and 966 filtered out. Neither emitted a SKIPPED line. Total 2 passed, 0 failed, 0 ignored, 0 skipped.

Not tested

  • Other fixtures and the full workspace suite, native and split wave64, other adapters, and retail-title smoke or rendering.

AI use

  • T3 Code / Codex gpt-6.2-sol ran the two checked-in tests, verified the results and wrote this report.
**@⁠JJAutoCompare** on GitHub · 2026-11-25 03:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7152018177) ## Arc A770 verification for PR #1912 PR #1912 was open at `5d0c1f0b8a802712e9542f0ffa269d9e36b6747f` before and after testing. The assigned checkout was clean and detached at that same commit on both checks. I found no equivalent Arc A770 report in the PR discussion or GPU-results issue #42. **Tested** - STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 (26200.9974), AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175. Rust 1.100.0 (0ef1bc386) and Cargo 1.100.0 (3acc79c0c), host `x86_64-pc-windows-msvc`, unoptimized test profile. The GPU test logged DXC 1.9.2609.5 (01b62ad4) and DXIL 1.9.2609.5 from `%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64`. - `cargo test --locked -p xcl --lib --no-run` completed outside the Arc lock. Used `CARGO_BUILD_JOBS=2`, `CARGO_INCREMENTAL=0`, `CARGO_PROFILE_DEV_DEBUG=0`, `CARGO_PROFILE_TEST_DEBUG=0`, `CARGO_TARGET_DIR=L:/XclTooling/pr1778-2e2ee55-20261125-020159/target`, `XCL_ADAPTER=A770` and `XCL_DXC_DIR` pointing at the DXC path above. `TEMP` and `TMP` pointed at the private run directory's `temp` subdirectory. - Ran Cargo's built test executable from `crates/xcl`. The CPU ran outside the Arc lock. The GPU invocation ran in `powershell.exe -NoProfile -ExecutionPolicy RemoteSigned` with the shared Arc wrapper. ```powershell $testExe = 'L:/XclTooling/pr1778-2e2ee55-20261125-020159/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe' & $testExe --exact gpu::recomp::lane_masks::tests::dominance_ends_at_the_entry_even_when_it_is_not_block_zero --nocapture --test-threads=1 & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & $testExe --exact gpu::recomp::lower_dxil::tests::shrinking_loops_agree_with_the_hlsl_path_on_the_gpu --nocapture --test-threads=1 } ``` - CPU, 0.01 s. All three dominance assertions passed on the graph with entry block 2, descendant blocks 0 and 1, and unreachable block 3. - GPU, 0.32 s. Native wave32 HLSL and per-lane Direct DXIL each produced the expected value on every lane for both shrinking-loop cases. The latch counter produced its lane index in `v1` and the WREXEC loop's empty-EXEC exit produced `11` in `v2` (128 value assertions across both cases and both paths). The Arc wrapper logged lock release. - Both processes exited 0. Each invocation reported 1 passed, 0 failed, 0 ignored and 966 filtered out. Neither emitted a `SKIPPED` line. Total **2 passed, 0 failed, 0 ignored, 0 skipped**. **Not tested** - Other fixtures and the full workspace suite, native and split wave64, other adapters, and retail-title smoke or rendering. **AI use** - T3 Code / Codex gpt-6.2-sol ran the two checked-in tests, verified the results and wrote this report.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 12:00 UTC · original

Thanks for reading it again. All four points were raised on the earlier head, and at c4093f4 they stand as follows (reply with the details: #1912):

  1. dominates stops at the root of the dominator tree (idom[b] == b), not at block 0, and skips unreachable blocks (lane_masks.rs:307). dominance_ends_at_the_entry_even_when_it_is_not_block_zero (lane_masks.rs:1148) has an entry that isn't block 0.

  2. Irreducible cycles never reach the check. Lanes::new returns "irreducible control flow" (lane_masks.rs:447) for a backward edge whose target doesn't dominate its source. Lowering returns that error before it builds any loop body (lower.rs:1092). unsupported_control_flow_is_refused asserts it on a two-entry cycle (lane_masks.rs:1166).

  3. ORN1: S_ORN1_SAVEEXEC_B32 takes the EXEC path, which sets SCC from the new mask. The plain list has both ANDN1 and ORN1 (lane_masks.rs:535-536). The CPU test at lower.rs:3361 runs both complemented SAVEEXEC forms.

  4. The 111 programs: the random-input comparison is at #1912. It covered 97 of them on 5d0c1f0, on an RTX 5070 Ti with three seeds.

    • All 44 native-wave32 programs matched.
    • 51 of 53 matched as split wave64. In the two that differed, the first differing word is a −0/+0 sign in a texture W, from 0.0 - x. Main already has the same difference in a program it accepts. Their other differing words are not classified yet.
    • The 67 native-wave64 rows need an RDNA card; the replay kit is linked there.

    That comparison predates the rebase onto cbfc67b. The only change in the rebase is one hunk in lower.rs that keeps #2203's can_wave_branch() condition alongside this PR's argument, so I haven't rerun it.

AI use: Claude Code (Claude Opus 5.5) checked each point against c4093f4 and wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-25 12:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7161803057) Thanks for reading it again. All four points were raised on the earlier head, and at `c4093f4` they stand as follows (reply with the details: https://git.gtahub.st/github/xcl-dev--xcl/pulls/1912): 1. **`dominates`** stops at the root of the dominator tree (`idom[b] == b`), not at block 0, and skips unreachable blocks (`lane_masks.rs:307`). `dominance_ends_at_the_entry_even_when_it_is_not_block_zero` (`lane_masks.rs:1148`) has an entry that isn't block 0. 2. **Irreducible cycles** never reach the check. `Lanes::new` returns `"irreducible control flow"` (`lane_masks.rs:447`) for a backward edge whose target doesn't dominate its source. Lowering returns that error before it builds any loop body (`lower.rs:1092`). `unsupported_control_flow_is_refused` asserts it on a two-entry cycle (`lane_masks.rs:1166`). 3. **ORN1:** `S_ORN1_SAVEEXEC_B32` takes the EXEC path, which sets SCC from the new mask. The plain list has both `ANDN1` and `ORN1` (`lane_masks.rs:535-536`). The CPU test at `lower.rs:3361` runs both complemented SAVEEXEC forms. 4. **The 111 programs:** the random-input comparison is at https://git.gtahub.st/github/xcl-dev--xcl/pulls/1912. It covered 97 of them on `5d0c1f0`, on an RTX 5070 Ti with three seeds. - All 44 native-wave32 programs matched. - 51 of 53 matched as split wave64. In the two that differed, the first differing word is a −0/+0 sign in a texture W, from `0.0 - x`. Main already has the same difference in a program it accepts. Their other differing words are not classified yet. - The 67 native-wave64 rows need an RDNA card; the replay kit is linked there. That comparison predates the rebase onto `cbfc67b`. The only change in the rebase is one hunk in `lower.rs` that keeps #2203's `can_wave_branch()` condition alongside this PR's argument, so I haven't rerun it. AI use: Claude Code (Claude Opus 5.5) checked each point against `c4093f4` and wrote this reply.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 00:42 UTC · original

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

**@⁠DavidM1911** on GitHub · 2026-11-26 00:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7179037733) 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
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-26 01:00 UTC · original

I'm closing and reopening this right away only to rerun CI on today's main (b49be18). The failed Build and test (merge with the main of 11-25 about 10:45Z) failed in hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa ("format 85 kept"). This PR doesn't touch that file, and main's CI has been green since then. The head c4093f4 merges into b49be18 without conflicts.

AI use: Claude Code (Claude Opus 5.5) read the CI log, checked the merge with git merge-tree and wrote this.

**@⁠Kalmarv** on GitHub · 2026-11-26 01:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7179335844) I'm closing and reopening this right away only to rerun CI on today's `main` (`b49be18`). The failed `Build and test` (merge with the `main` of 11-25 about 10:45Z) failed in `hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa` ("format 85 kept"). This PR doesn't touch that file, and `main`'s CI has been green since then. The head `c4093f4` merges into `b49be18` without conflicts. AI use: Claude Code (Claude Opus 5.5) read the CI log, checked the merge with `git merge-tree` and wrote this.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-24 23:30 UTC · original · edited 2026-11-26 01:12 UTC

Updated check on c4093f4 (26 Nov). Windows 11 build 26300, RTX 3080 Ti / driver 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11. Synthetic tests only.

Tested

  • On the exact PR head, cargo build --offline --locked --workspace passed. The checked-in shrinking_loops_agree_with_the_hlsl_path_on_the_gpu comparison passed on the GPU (1 passed, no skip), as did the two focused empty-loop/latch regression tests (1 passed each, no skip).
  • On that head, cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 reported 1,187 passed, 1 failed, 46 ignored, with 24 SKIPPED notices. The failure was the unrelated D3D12 resource-format test pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa (format 85 kept); this PR does not change its file.
  • I merged that exact head into current main b49be18 locally, without committing. The merge had no conflicts. cargo build --offline --locked --workspace passed, and the same full suite reported 1,441 passed, 0 failed, 47 ignored, with 25 SKIPPED notices. The D3D12 format test and the checked-in GPU shrinking-loop comparison both passed on the integration. This checks the current merge result; it does not change the PR branch.

Not tested

  • Native wave64 or AMD hardware, retail title behavior, and long-running rendering. The head-only suite is red; the tested current-main integration is green.

AI use

  • Codex (GPT-6.2 Sol) ran the checks, verified the logs and drafted this report. AI-assisted.

Earlier check on 661f7fd: an additional synthetic, production-translator fixture selected per-lane DXIL for the latch and empty-EXEC SCC cases; the stale counter case stayed per-instruction. Selected DXIL and HLSL matched the expected outputs on two native wave32s. That fixture was local and is separate from the checked-in tests above.

**@⁠thehollowedone** on GitHub · 2026-11-24 23:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7147473232) · edited 2026-11-26 01:12 UTC **Updated check on [c4093f4](https://github.com/xcl-dev/xcl/commit/c4093f4c79992b57cc83bb9c36445160bdd33875)** (26 Nov). Windows 11 build 26300, RTX 3080 Ti / driver 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11. Synthetic tests only. **Tested** - On the exact PR head, `cargo build --offline --locked --workspace` passed. The checked-in `shrinking_loops_agree_with_the_hlsl_path_on_the_gpu` comparison passed on the GPU (1 passed, no skip), as did the two focused empty-loop/latch regression tests (1 passed each, no skip). - On that head, `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4` reported **1,187 passed, 1 failed, 46 ignored**, with 24 `SKIPPED` notices. The failure was the unrelated D3D12 resource-format test `pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa` (`format 85 kept`); this PR does not change its file. - I merged that exact head into current [main `b49be18`](https://github.com/xcl-dev/xcl/commit/b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7) locally, without committing. The merge had no conflicts. `cargo build --offline --locked --workspace` passed, and the same full suite reported **1,441 passed, 0 failed, 47 ignored**, with 25 `SKIPPED` notices. The D3D12 format test and the checked-in GPU shrinking-loop comparison both passed on the integration. This checks the current merge result; it does not change the PR branch. **Not tested** - Native wave64 or AMD hardware, retail title behavior, and long-running rendering. The head-only suite is red; the tested current-main integration is green. **AI use** - Codex (GPT-6.2 Sol) ran the checks, verified the logs and drafted this report. AI-assisted. Earlier check on [661f7fd](https://github.com/xcl-dev/xcl/commit/661f7fdad2d39368e875a678535a7cb13c5ecd5d): an additional synthetic, production-translator fixture selected per-lane DXIL for the latch and empty-EXEC SCC cases; the stale counter case stayed per-instruction. Selected DXIL and HLSL matched the expected outputs on two native wave32s. That fixture was local and is separate from the checked-in tests above.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 05:54 UTC · original

NVIDIA and AMD full-suite run of head c4093f4c, on its own base cbfc67b and merged with current main b49be183, to go with the reports above by thehollowedone, since none of them covers AMD. On its base, the 2 failures come from changes made on main after that base (#2245 and ea088a5); merged with main, both cards pass. The bare-head runs come first.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1120 passed, 1 failed, 24 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • Failed: hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa. (stale on this base, fixed on main by #2245; see the merged run below)
  • The new tests ran and passed: dominance_ends_at_the_entry_even_when_it_is_not_block_zero, complemented_saveexec_replaces_the_previous_uniform_scc, a_value_written_in_a_lane_region_is_read_in_it_past_an_inner_if, empty_wrexec_loop_repairs_the_mask_and_scc_only_on_exhaustion, the_latch_counter_can_still_be_stale_after_the_loop, shrinking_loops_agree_with_the_hlsl_path_on_the_gpu.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1129 passed, 2 failed, 26 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))).
  • --skip leaves out tests that fail on main b49be183 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.
  • AMD failures on this base: gpu_image_get_resinfo_past_last_level (ea088a5), pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa (#2245).
  • Merged with main b49be183 (git merge --no-ff, clean, local only): NVIDIA XCL_REQUIRE_GPU=mesh cargo test --workspace with the same skips: 1429 passed, 0 failed, 45 ignored; AMD Radeon iGPU (XCL_ADAPTER=radeon, same skips): 1440 passed, 0 failed, 47 ignored.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-26 05:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#issuecomment-7183907601) NVIDIA and AMD full-suite run of head `c4093f4c`, on its own base `cbfc67b` and merged with current `main` `b49be183`, to go with the reports above by thehollowedone, since none of them covers AMD. On its base, the 2 failures come from changes made on `main` after that base (#2245 and `ea088a5`); merged with `main`, both cards pass. The bare-head runs come first. **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1120 passed, 1 failed, 24 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - Failed: `hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa`. (stale on this base, fixed on `main` by #2245; see the merged run below) - The new tests ran and passed: `dominance_ends_at_the_entry_even_when_it_is_not_block_zero`, `complemented_saveexec_replaces_the_previous_uniform_scc`, `a_value_written_in_a_lane_region_is_read_in_it_past_an_inner_if`, `empty_wrexec_loop_repairs_the_mask_and_scc_only_on_exhaustion`, `the_latch_counter_can_still_be_stale_after_the_loop`, `shrinking_loops_agree_with_the_hlsl_path_on_the_gpu`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1129 passed, 2 failed, 26 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))). - `--skip` leaves out tests that fail on main `b49be183` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. - AMD failures on this base: `gpu_image_get_resinfo_past_last_level` (`ea088a5`), `pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa` (#2245). - **Merged with `main` `b49be183`** (`git merge --no-ff`, clean, local only): NVIDIA `XCL_REQUIRE_GPU=mesh cargo test --workspace` with the same skips: **1429 passed, 0 failed, 45 ignored**; AMD Radeon iGPU (`XCL_ADAPTER=radeon`, same skips): **1440 passed, 0 failed, 47 ignored**. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠Melow-code on GitHub · 2026-11-24 23:13 UTC · original · reviewed

No clear bug in the dominance proof or the WREXEC exit. Four points:

  1. dominates assumes block 0 is the entry — the loop stops on b == 0. If the entry has another index, the loop does not end. Test self.idom[b] == b instead.
  2. Irreducible cycles: body holds natural loops only. A write in a cycle without a single header is in no body, so the check passes vacuously. Is an irreducible CFG refused before this point?
  3. The mixed-mask SCC op list has ANDN1 but not ORN1. If op can come from S_ORN1_SAVEEXEC_B32, that form keeps the old uniform SCC.
  4. The 111 new programs need a per-lane DXIL vs HLSL comparison with random inputs before merge. The GPU tests cover synthetic programs only.
**@⁠Melow-code** on GitHub · 2026-11-24 23:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#pullrequestreview-6048897425) · **reviewed** No clear bug in the dominance proof or the WREXEC exit. Four points: 1. `dominates` assumes block 0 is the entry — the loop stops on `b == 0`. If the entry has another index, the loop does not end. Test `self.idom[b] == b` instead. 2. Irreducible cycles: `body` holds natural loops only. A write in a cycle without a single header is in no `body`, so the check passes vacuously. Is an irreducible CFG refused before this point? 3. The mixed-mask SCC op list has ANDN1 but not ORN1. If `op` can come from `S_ORN1_SAVEEXEC_B32`, that form keeps the old uniform SCC. 4. The 111 new programs need a per-lane DXIL vs HLSL comparison with random inputs before merge. The GPU tests cover synthetic programs only.
Author
Owner

@⁠Melow-code on GitHub · 2026-11-25 11:54 UTC · original · reviewed

I read the dominance proof, the WREXEC exit and the mixed-mask SCC change from #1866. I found no clear bug. I have four points:

  1. dominates assumes that block 0 is the entry. The loop stops on b == 0. If the entry has another index and its idom is itself, the loop does not end. A test on self.idom[b] == b does not depend on the index.
  2. Irreducible cycles. body holds natural loops only. A write in a cycle without a single header is in no body. Then the check "every loop that holds the write holds the read" has no loop to check, and it passes. Is an irreducible CFG refused before this point? If it is not, passed should return false there.
  3. The op list for the mixed-mask SCC has ANDN1 but not ORN1. If op can come from S_ORN1_SAVEEXEC_B32, that form keeps the old uniform SCC.
  4. The 111 new programs. This relaxation lets programs through that the stale check refused before. So a wrong proof gives wrong values with no refusal. The GPU tests cover synthetic programs only. Please compare the per-lane DXIL with the HLSL path on these 111 programs, with random inputs. That shows if the proof holds on real code.

The WREXEC exit case agrees with the ISA. After the last S_*_WREXEC_B32 before a not-taken S_CBRANCH_EXECNZ, EXEC, the destination and SCC are all 0 for the wave. The r != 125 check skips the null SGPR.

**@⁠Melow-code** on GitHub · 2026-11-25 11:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/1912#pullrequestreview-6057120529) · **reviewed** I read the dominance proof, the WREXEC exit and the mixed-mask SCC change from #1866. I found no clear bug. I have four points: 1. **`dominates` assumes that block 0 is the entry.** The loop stops on `b == 0`. If the entry has another index and its `idom` is itself, the loop does not end. A test on `self.idom[b] == b` does not depend on the index. 2. **Irreducible cycles.** `body` holds natural loops only. A write in a cycle without a single header is in no `body`. Then the check "every loop that holds the write holds the read" has no loop to check, and it passes. Is an irreducible CFG refused before this point? If it is not, `passed` should return false there. 3. **The op list for the mixed-mask SCC** has `ANDN1` but not `ORN1`. If `op` can come from `S_ORN1_SAVEEXEC_B32`, that form keeps the old uniform SCC. 4. **The 111 new programs.** This relaxation lets programs through that the stale check refused before. So a wrong proof gives wrong values with no refusal. The GPU tests cover synthetic programs only. Please compare the per-lane DXIL with the HLSL path on these 111 programs, with random inputs. That shows if the proof holds on real code. The WREXEC exit case agrees with the ISA. After the last `S_*_WREXEC_B32` before a not-taken `S_CBRANCH_EXECNZ`, EXEC, the destination and SCC are all 0 for the wave. The `r != 125` check skips the null SGPR.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1912/head:github-bot/gh-1912'
git switch 'github-bot/gh-1912'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1912'
git switch 'github-bot/gh-1912'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1912'
git switch 'github-bot/gh-1912'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1912'
git switch 'main'
git merge --squash 'github-bot/gh-1912'
git switch 'main'
git merge --ff-only 'github-bot/gh-1912'
git switch 'main'
git merge 'github-bot/gh-1912'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.