Recompiler: a per-lane form for the direct DXIL backend (XCL_PER_LANE) #1735

Merged
gefydev merged 51 commits from upstream-pr/1745 into main 2026-11-24 21:10:43 +00:00
gefydev commented 2026-11-24 20:09:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-24T20:09:02Z.


A per-lane form for the direct DXIL backend (#1426): where a lane-mask analysis proves EXEC, console code is lowered without EXEC guards. Each lane carries its own bit of every mask, mask branches become per-lane branches, and guards stay only where EXEC is not proven. Instructions it has no lowering of go through #1426's Lw::inst_guarded with the analysis's guard. It is opt-in: with XCL_DIRECT_DXIL=1 XCL_PER_LANE=1, a compute program tries the per-lane form, then #1426's per-instruction form, then the HLSL path. Without XCL_PER_LANE nothing changes. Part of #1269.

It is one PR at the maintainer's request: the size rule is waived for this feature (asked of the maintainer by @gefydev; the plan is on #1269, the waiver itself was not posted on GitHub). About 2 600 of the 7 460 added lines are tests.

Result so far, for the maintainer to judge. Whole-pack sweep of a retail title (xcl shaders --direct --lanes --sample 0 --max-bytes 0 --split 0 --windows 4 --timeout 120): the per-lane form translates 316 of 2 689 compute programs (with the stricter rules from the reviews below; 321 before). On those, its DXIL is 4 020 436 B against 3 988 440 B for #1426's per-instruction form (+0.8 %): no size gain. After bmjask's cleanups, #1426 emits few guards on these programs. Measurements on #1269 point the same way: removing every EXEC select takes about 9 % off driver time on one RTX 3080 program, against 85 % for the window switch, which #1693 now addresses. The large programs, where a gain would matter, are still refused. The main refusals are structural: a branch on whether any lane of a mask is set, with lanes in EXEC that lack the bit (the first refusal of 1 771 programs; the console decides those for the whole wave), and stale values (154). Driver time, measured by Raghav314 on an RTX 4090 (#1269), on the 310 programs that build in all four forms: per-lane 10.0 s, #1426 per-instruction 10.5 s, HLSL 14.1 s driver + 21.9 s DXC, and HLSL with heap windows 10.8 s + 17.2 s. Per-lane against #1426 is a median ratio of 0.98, so again no real gain on what it covers. So this PR is the infrastructure plus measurements. It does not deliver a speedup today.

What is in it (51 commits; authors kept)

  • gpu/recomp/lane_masks.rs: the lane-mask analysis (BDD over lane / SCC / opaque atoms, worklist dataflow, loop heads, irreducible flow refused). The launch EXEC can be an atom for VS / PS (teidenzero).
  • gpu/recomp/ssa.rs: on-the-fly SSA (Braun et al.), with a number view and a lane-bit view per SGPR.
  • gpu/recomp/lower.rs, lower/wave.rs: the lowering behind an Ir trait, with a CPU interpreter for tests. It covers SALU / VALU / memory, mask ops, s_cselect / s_wqm / v_cmpx, far jumps, and cross-lane ops (Sr-0w). It refuses stale values written where some lanes are elsewhere. Also guard coalescing (MiguelMachado-dev) and VS / PS stages (teidenzero). The bridge to #1426 refuses an instruction when #1426 would read a register it was not passed.
  • gpu/recomp/lower_dxil.rs: the Ir on #1426's Lw. It handles head / tail blocks, so #1426 can make blocks inside an instruction, plus several and heap memory windows, the split wave64 form (upipibi) and batched trivial-phi replacement (Itsmetibo).
  • gpu/dxil/kernel.rs: Lw::new / Lw::finish out of the kernel translator, with no change to #1426's output (Sr-0w).
  • gpu/recomp/pso.rs: the runtime hookup behind XCL_PER_LANE=1, with its own translated-cache identity.
  • gpu/recomp/dxil/assemble.rs: IR text to a signed container, as a test oracle (Sr-0w).
  • shaders.rs: xcl shaders --direct --lanes (coverage and size against #1426), plus the per-lane refusal survey (Kalmarv).
  • Tests: f32 / f64 / integer / f16 programs on the HLSL path and per lane (vladbondarenko97), GPU comparisons of the per-lane DXIL against the CPU lowering and the HLSL path, and split-form and four-window runs.
  • Bugs found on the way, fixed here with tests:
    • the f32 reference's signed zeros on AMD (Diskuss);
    • an overflow for s0 in the mask-pair check (nobodyttk);
    • split compute through the runtime asked for WaveSize(64) (MiguelMachado-dev);
    • the kernel entry never set up Lw's lanes (vladbondarenko97);
    • a copied value in a partial block escaped the stale check (MiguelMachado-dev).
    • from reviews of this PR: whole-wave branches and selects on a mask some lanes in EXEC lack, and rounding modes the per-lane form dropped (Kalmarv); such an SCC carried around a loop (thehollowedone); per-lane cache entries outliving source changes (Pipodi).
  • #1426 semantics that differ from the console (v_cvt_f16_f32, v_mul_f16, v_pk_mul_f16 round toward zero) stay on the fallback (DIFFERS_ON_1426); itsSio is fixing them on main.

Tested

  • NVIDIA GTX 1650 (wave32 only, so the split wave64 tests run for real), driver 621.24, Windows 11 Pro 26300, Rust 1.100.0, debug.
  • cargo test --workspace -- --test-threads=4 on the head (bfb8133, on main 4178e88): 955 passed, 0 failed, 42 ignored. With XCL_ADAPTER=warp (the CI adapter, no sized waves) the lib gives 876 passed, 0 failed, 22 ignored: the per-lane GPU tests skip there.
  • SKIPPED (22): 18 "no wave64" (this GPU), 1 "no heap windows", and 3 per-lane halves refused on purpose (V_CVT_F16_F32, V_MUL_F16, V_PK_MUL_F16, see above).
  • Whole-pack sweep (release, on d5fd85d, before the rebase onto main and the last four commits): numbers as in the result paragraph; 577 s.

Regression run
main:

xcl-smoke v1
commit: 6c89285b8b529bde59cd17a26b911c39912fb677
gpu: NVIDIA GeForce GTX 1650
title: xcl-title
seconds: 60
exit: 0x0
frames shown: 889 (PresentX 890)
presents per 2 s (last 3): 2 0 12
device removals: 0
crashes: 0
peak commit: 15518 MB

This PR's head:

xcl-smoke v1
commit: bfb8133d36df38c3de381f9d99203568b32aa765
gpu: NVIDIA GeForce GTX 1650
title: xcl-title
seconds: 60
exit: 0x0
frames shown: 915 (PresentX 916)
presents per 2 s (last 3): 0 0 9
device removals: 0
crashes: 0
peak commit: 11638 MB

Both with XCL_PER_LANE off (the default), so they check that nothing changes. The machine was short of memory: runs of earlier head builds gave 508 to 931 frames, so the frame counts vary a lot run to run here.

Not tested

  • Native wave64 GPUs (AMD) on my side; helpers ran parts of the branch on RX 7800 XT / RX 9070 XT and RTX 3060 Ti–5080 (#1269).
  • DXC and driver times of the per-lane form against #1426's (only DXIL sizes measured).
  • A title run with XCL_PER_LANE=1; the regression runs below are with it off, the default.
  • Mesh shaders in the per-lane form; VS / PS has only its lowering half (no adapter yet).

AI use

  • Claude Code (Claude Opus 5.5): wrote my commits, the tests in them and this description, ran the checks. Helpers' commits carry their own AI-use notes on #1269. Two of MiguelMachado-dev's commits (guard coalescing and its split-form test) carry Assisted-by: Antigravity (Gemini 4 Neon); the other helpers name their tools on #1269.
<!-- greyfinch-sync:ivall/xcl:issue:6590433480 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-24T20:09:02Z. --- A per-lane form for the direct DXIL backend (#1426): where a lane-mask analysis proves EXEC, console code is lowered without EXEC guards. Each lane carries its own bit of every mask, mask branches become per-lane branches, and guards stay only where EXEC is not proven. Instructions it has no lowering of go through #1426's `Lw::inst_guarded` with the analysis's guard. It is opt-in: with `XCL_DIRECT_DXIL=1 XCL_PER_LANE=1`, a compute program tries the per-lane form, then #1426's per-instruction form, then the HLSL path. Without `XCL_PER_LANE` nothing changes. Part of #1269. It is one PR at the maintainer's request: the size rule is waived for this feature (asked of the maintainer by @gefydev; the plan is on #1269, the waiver itself was not posted on GitHub). About 2 600 of the 7 460 added lines are tests. **Result so far, for the maintainer to judge.** Whole-pack sweep of a retail title (`xcl shaders --direct --lanes --sample 0 --max-bytes 0 --split 0 --windows 4 --timeout 120`): the per-lane form translates **316 of 2 689** compute programs (with the stricter rules from the reviews below; 321 before). On those, its DXIL is **4 020 436 B against 3 988 440 B** for #1426's per-instruction form (+0.8 %): **no size gain**. After bmjask's cleanups, #1426 emits few guards on these programs. Measurements on #1269 point the same way: removing every EXEC select takes about 9 % off driver time on one RTX 3080 program, against 85 % for the window switch, which #1693 now addresses. The large programs, where a gain would matter, are still refused. The main refusals are structural: a branch on whether any lane of a mask is set, with lanes in EXEC that lack the bit (the first refusal of 1 771 programs; the console decides those for the whole wave), and stale values (154). Driver time, measured by Raghav314 on an RTX 4090 (#1269), on the 310 programs that build in all four forms: per-lane 10.0 s, #1426 per-instruction 10.5 s, HLSL 14.1 s driver + 21.9 s DXC, and HLSL with heap windows 10.8 s + 17.2 s. Per-lane against #1426 is a median ratio of 0.98, so again no real gain on what it covers. So this PR is the infrastructure plus measurements. It does not deliver a speedup today. **What is in it** (51 commits; authors kept) - `gpu/recomp/lane_masks.rs`: the lane-mask analysis (BDD over lane / SCC / opaque atoms, worklist dataflow, loop heads, irreducible flow refused). The launch EXEC can be an atom for VS / PS (teidenzero). - `gpu/recomp/ssa.rs`: on-the-fly SSA (Braun et al.), with a number view and a lane-bit view per SGPR. - `gpu/recomp/lower.rs`, `lower/wave.rs`: the lowering behind an `Ir` trait, with a CPU interpreter for tests. It covers SALU / VALU / memory, mask ops, `s_cselect` / `s_wqm` / `v_cmpx`, far jumps, and cross-lane ops (Sr-0w). It refuses stale values written where some lanes are elsewhere. Also guard coalescing (MiguelMachado-dev) and VS / PS stages (teidenzero). The bridge to #1426 refuses an instruction when #1426 would read a register it was not passed. - `gpu/recomp/lower_dxil.rs`: the `Ir` on #1426's `Lw`. It handles head / tail blocks, so #1426 can make blocks inside an instruction, plus several and heap memory windows, the split wave64 form (upipibi) and batched trivial-phi replacement (Itsmetibo). - `gpu/dxil/kernel.rs`: `Lw::new` / `Lw::finish` out of the kernel translator, with no change to #1426's output (Sr-0w). - `gpu/recomp/pso.rs`: the runtime hookup behind `XCL_PER_LANE=1`, with its own translated-cache identity. - `gpu/recomp/dxil/assemble.rs`: IR text to a signed container, as a test oracle (Sr-0w). - `shaders.rs`: `xcl shaders --direct --lanes` (coverage and size against #1426), plus the per-lane refusal survey (Kalmarv). - Tests: f32 / f64 / integer / f16 programs on the HLSL path and per lane (vladbondarenko97), GPU comparisons of the per-lane DXIL against the CPU lowering and the HLSL path, and split-form and four-window runs. - Bugs found on the way, fixed here with tests: - the f32 reference's signed zeros on AMD (Diskuss); - an overflow for `s0` in the mask-pair check (nobodyttk); - split compute through the runtime asked for `WaveSize(64)` (MiguelMachado-dev); - the kernel entry never set up `Lw`'s lanes (vladbondarenko97); - a copied value in a partial block escaped the stale check (MiguelMachado-dev). - from reviews of this PR: whole-wave branches and selects on a mask some lanes in EXEC lack, and rounding modes the per-lane form dropped (Kalmarv); such an SCC carried around a loop (thehollowedone); per-lane cache entries outliving source changes (Pipodi). - #1426 semantics that differ from the console (`v_cvt_f16_f32`, `v_mul_f16`, `v_pk_mul_f16` round toward zero) stay on the fallback (`DIFFERS_ON_1426`); itsSio is fixing them on `main`. **Tested** - NVIDIA GTX 1650 (wave32 only, so the split wave64 tests run for real), driver 621.24, Windows 11 Pro 26300, Rust 1.100.0, debug. - `cargo test --workspace -- --test-threads=4` on the head (`bfb8133`, on `main` `4178e88`): **955 passed, 0 failed, 42 ignored**. With `XCL_ADAPTER=warp` (the CI adapter, no sized waves) the lib gives 876 passed, 0 failed, 22 ignored: the per-lane GPU tests skip there. - SKIPPED (22): 18 "no wave64" (this GPU), 1 "no heap windows", and 3 per-lane halves refused on purpose (`V_CVT_F16_F32`, `V_MUL_F16`, `V_PK_MUL_F16`, see above). - Whole-pack sweep (release, on `d5fd85d`, before the rebase onto `main` and the last four commits): numbers as in the result paragraph; 577 s. **Regression run** `main`: ``` xcl-smoke v1 commit: 6c89285b8b529bde59cd17a26b911c39912fb677 gpu: NVIDIA GeForce GTX 1650 title: xcl-title seconds: 60 exit: 0x0 frames shown: 889 (PresentX 890) presents per 2 s (last 3): 2 0 12 device removals: 0 crashes: 0 peak commit: 15518 MB ``` This PR's head: ``` xcl-smoke v1 commit: bfb8133d36df38c3de381f9d99203568b32aa765 gpu: NVIDIA GeForce GTX 1650 title: xcl-title seconds: 60 exit: 0x0 frames shown: 915 (PresentX 916) presents per 2 s (last 3): 0 0 9 device removals: 0 crashes: 0 peak commit: 11638 MB ``` Both with `XCL_PER_LANE` off (the default), so they check that nothing changes. The machine was short of memory: runs of earlier head builds gave 508 to 931 frames, so the frame counts vary a lot run to run here. **Not tested** - Native wave64 GPUs (AMD) on my side; helpers ran parts of the branch on RX 7800 XT / RX 9070 XT and RTX 3060 Ti–5080 (#1269). - DXC and driver times of the per-lane form against #1426's (only DXIL sizes measured). - A title run with `XCL_PER_LANE=1`; the regression runs below are with it off, the default. - Mesh shaders in the per-lane form; VS / PS has only its lowering half (no adapter yet). **AI use** - Claude Code (Claude Opus 5.5): wrote my commits, the tests in them and this description, ran the checks. Helpers' commits carry their own AI-use notes on #1269. Two of MiguelMachado-dev's commits (guard coalescing and its split-form test) carry `Assisted-by: Antigravity (Gemini 4 Neon)`; the other helpers name their tools on #1269.
Diskuss commented 2026-11-24 21:08:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Diskuss on 2026-11-24T20:45:59Z.

Review: COMMENTED


Tested on AMD Radeon RX 9070 XT (RDNA4, native wave64) at cf29f8a6a7e4e64cfaf17dd929e5334a7d5cf193, merged locally with main 4178e88

RX 9070 XT, driver 32.0.32015.7029; Ryzen 7 5700X3D; 32 GB RAM; Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.9.2602.17; debug build.

Tested

  • The head is 15 commits behind main. The merge has one conflict, in gpu/dxil/kernel.rs, with #1748 (0b64aa0). #1748 added three fields to the Lw literal in translate_on_this_thread, and this PR moves that literal into Lw::new. I resolved it locally by keeping Lw::new and adding fmt_desc_cache: HashMap::new(), fmt_comp1_cache: HashMap::new() and uma_base_val: None to it. Everything below ran on that merge. It was not pushed.
  • cargo test --workspace --no-fail-fast -- --test-threads=4:
    • PR + main: 953 passed, 0 failed, 42 ignored
    • main 4178e88 alone: 891 passed, 0 failed, 42 ignored
    • The +62 are this PR's tests. The lib goes from 864 to 926 tests.
  • SKIPPED, 8 lines:
    • The 6 intentional per-lane refusals: V_MUL_F16, V_PK_MUL_F16 and V_CVT_F16_F32, each in wave32 and wave64.
    • heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
    • pso_measurement_compiles_an_exact_synthetic_record (Developer Mode off).
    • On main, only the last two skip. There are no no wave64 skips, so every wave64 half ran natively. No device removal in any run.
  • The PR's tests, run 3 times by name (recomp::lane_masks, recomp::lower (which includes lower_dxil), recomp::ssa, recomp::dxil::assemble, batched_replacements_match_one_at_a_time, --test-threads=1): 62 passed, 0 failed, 3 of 3 runs, with the same SKIPPED lines each time.
    • f32_programs_on_the_gpu passes in both wave32 and native wave64, including the bit-exact -0 in v10 under -Gis. That was the RDNA4 failure before 9109710.
    • a_per_lane_program_with_four_memory_windows_runs_on_the_gpu passes with #1748's entry-block uma_base hoist merged in. The per-lane form leaves Block(0) without a terminator until DxilIr::finish, and the hoist into it works.

Review (AMD-relevant semantics only; I did not repeat @Kalmarv's three points)

  • Merge conflict with main (above). This blocks CONTRIBUTING item 6. The rebase fix is the three-field addition to Lw::new; nothing else conflicts. TRANSLATOR_VERSION comes in from main as 6. The per-lane cache identity is derived from it (identity_for(.., "xcl-per-lane")), so it is invalidated too.
  • Sign of zero, denorms and fast-math: the per-lane lowering emits no float instructions of its own. Floats go through Ir::foreign to #1426's Lw, so they take #1426's fast-math flags and denorm handling unchanged, and nothing AMD-specific is added. The other HLSL-reference comparisons (lower.rs agrees_with_hlsl and related, coalesced_foreign_runs_agree_on_the_gpu, COALESCED_F32_RUN) still compile without -Gis and compare bit for bit. Their inputs produce no signed zero, though, and all pass here, so no change is needed today. This is only the place to look if a new float program is added to them.
  • wave32 / wave64 and EXEC: I read lower/wave.rs, i.e. mask_words, exec_words, read_from and the wave64 == false upper word set to 0. It matches the module doc. The whole-wave forms refuse in partial blocks, and a read of a lane outside EXEC returns this lane's own value, so it never uses WaveReadLaneAt on an inactive lane, which is undefined on AMD. Native wave64 runs of the cross-lane, coalesced, 2-D / 3-D and split tests all pass here.
  • No other issues found that I could tie to a failing case on this card.

Not tested

  • A retail title with XCL_PER_LANE=1 or scripts/smoke.ps1 (no game files here).
  • A release build, and the pack sweep.

Review and test run by Claude Code (Claude Opus 5.5) on Diskuss's machine.

<!-- greyfinch-sync:ivall/xcl:review:6047121606 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#pullrequestreview-6047121606). Originally posted by [Diskuss](https://github.com/Diskuss) on 2026-11-24T20:45:59Z. **Review:** COMMENTED --- **Tested on AMD Radeon RX 9070 XT (RDNA4, native wave64) at `cf29f8a6a7e4e64cfaf17dd929e5334a7d5cf193`, merged locally with `main` `4178e88`** RX 9070 XT, driver 32.0.32015.7029; Ryzen 7 5700X3D; 32 GB RAM; Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.9.2602.17; debug build. **Tested** - The head is 15 commits behind `main`. The merge has one conflict, in `gpu/dxil/kernel.rs`, with #1748 (`0b64aa0`). #1748 added three fields to the `Lw` literal in `translate_on_this_thread`, and this PR moves that literal into `Lw::new`. I resolved it locally by keeping `Lw::new` and adding `fmt_desc_cache: HashMap::new()`, `fmt_comp1_cache: HashMap::new()` and `uma_base_val: None` to it. Everything below ran on that merge. It was not pushed. - `cargo test --workspace --no-fail-fast -- --test-threads=4`: - PR + `main`: **953 passed, 0 failed, 42 ignored** - `main` `4178e88` alone: **891 passed, 0 failed, 42 ignored** - The +62 are this PR's tests. The lib goes from 864 to 926 tests. - SKIPPED, 8 lines: - The 6 intentional per-lane refusals: `V_MUL_F16`, `V_PK_MUL_F16` and `V_CVT_F16_F32`, each in wave32 and wave64. - `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `pso_measurement_compiles_an_exact_synthetic_record` (Developer Mode off). - On `main`, only the last two skip. There are no `no wave64` skips, so every wave64 half ran natively. No device removal in any run. - The PR's tests, run 3 times by name (`recomp::lane_masks`, `recomp::lower` (which includes `lower_dxil`), `recomp::ssa`, `recomp::dxil::assemble`, `batched_replacements_match_one_at_a_time`, `--test-threads=1`): **62 passed, 0 failed, 3 of 3 runs**, with the same SKIPPED lines each time. - `f32_programs_on_the_gpu` passes in both wave32 and native wave64, including the bit-exact `-0` in v10 under `-Gis`. That was the RDNA4 failure before 9109710. - `a_per_lane_program_with_four_memory_windows_runs_on_the_gpu` passes with #1748's entry-block `uma_base` hoist merged in. The per-lane form leaves `Block(0)` without a terminator until `DxilIr::finish`, and the hoist into it works. **Review** (AMD-relevant semantics only; I did not repeat @Kalmarv's three points) - **Merge conflict with `main`** (above). This blocks CONTRIBUTING item 6. The rebase fix is the three-field addition to `Lw::new`; nothing else conflicts. `TRANSLATOR_VERSION` comes in from `main` as 6. The per-lane cache identity is derived from it (`identity_for(.., "xcl-per-lane")`), so it is invalidated too. - Sign of zero, denorms and fast-math: the per-lane lowering emits no float instructions of its own. Floats go through `Ir::foreign` to #1426's `Lw`, so they take #1426's fast-math flags and denorm handling unchanged, and nothing AMD-specific is added. The other HLSL-reference comparisons (`lower.rs` `agrees_with_hlsl` and related, `coalesced_foreign_runs_agree_on_the_gpu`, `COALESCED_F32_RUN`) still compile without `-Gis` and compare bit for bit. Their inputs produce no signed zero, though, and all pass here, so no change is needed today. This is only the place to look if a new float program is added to them. - wave32 / wave64 and EXEC: I read `lower/wave.rs`, i.e. `mask_words`, `exec_words`, `read_from` and the `wave64 == false` upper word set to 0. It matches the module doc. The whole-wave forms refuse in `partial` blocks, and a read of a lane outside EXEC returns this lane's own value, so it never uses `WaveReadLaneAt` on an inactive lane, which is undefined on AMD. Native wave64 runs of the cross-lane, coalesced, 2-D / 3-D and split tests all pass here. - No other issues found that I could tie to a failing case on this card. **Not tested** - A retail title with `XCL_PER_LANE=1` or `scripts/smoke.ps1` (no game files here). - A release build, and the pack sweep. Review and test run by Claude Code (Claude Opus 5.5) on Diskuss's machine.
Raghav314 commented 2026-11-24 21:09:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Raghav314 on 2026-11-24T20:26:32Z.


DXC and cold driver times for the per-lane form against #1426 and the HLSL path, NVIDIA Windows (as asked on #1269, comment). Counts and timings only.

Setup: RTX 4090 24 GB, driver 617.14, Windows 11, DXC 1.8.2502.11, release. direct-on-1426 3ca3633 + @Itsmetibo's 4c3fe1e (now 1c9477a here), retail 1.0.2.1 pack, split wave64, 4 windows, as the runtime does on a 32-lane GPU. Each pipeline made one at a time, no concurrency, no XCL cache, the driver's shader cache off for the process (ID3D12Device9::ShaderCacheControl(IMPLICIT_DRIVER_MANAGED, DISABLE)). Two full runs agree within 1 %.

Programs: the per-lane form takes 311 of 2 689 compute programs in the split form. 310 built in all four forms, 0 failures (first row dropped as driver warm-up). Median 212 B of console code, largest 2.6 KB.

form DXIL DXC driver total
per-lane 3 168 KB – 10.0 s 10.5 s
#1426 per-instruction 3 187 KB – 10.5 s 10.9 s
HLSL, 4 windows 3 881 KB 21.9 s 14.1 s 36.1 s
HLSL, heap windows 3 455 KB 17.2 s 10.8 s 28.0 s
  • Per-lane vs #1426: driver time per program, median ratio 0.98 (p10 0.85, p90 1.10); −5 % in total. No real gain on the programs it covers.
  • Both direct forms vs the HLSL path: 3.4× less total time, mostly DXC (61 % of the HLSL path's time here); the driver is also ~27 % faster on the direct DXIL.
  • Not covered: the large programs, which the per-lane form refuses.

Harness: Raghav314/xcl shaders/time-forms, one commit c17ed53 on this PR's head cf29f8a (shaders.rs +155, pso.rs +6): xcl shaders <pack> --time-forms [--split 1] [--windows 4] [--timeout 120] [--limit N] [--warm] [--out file.csv]. One CSV row per program, record index only. Needs Windows developer mode for the cache switch; --warm skips it. Re-checked on c17ed53: builds, and --limit 3 gives cold times (9–41 ms) against 0.5–2 ms with --warm.

AI use: Claude Code (Claude Opus 5.5) wrote the harness, ran the measurements and drafted this.

<!-- greyfinch-sync:ivall/xcl:comment:7143552555 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7143552555). Originally posted by [Raghav314](https://github.com/Raghav314) on 2026-11-24T20:26:32Z. --- **DXC and cold driver times for the per-lane form against #1426 and the HLSL path, NVIDIA Windows** (as asked on #1269, [comment](https://github.com/xcl-dev/xcl/issues/1269#issuecomment-7143437069)). Counts and timings only. **Setup:** RTX 4090 24 GB, driver 617.14, Windows 11, DXC 1.8.2502.11, release. `direct-on-1426` `3ca3633` + @Itsmetibo's `4c3fe1e` (now `1c9477a` here), retail 1.0.2.1 pack, split wave64, 4 windows, as the runtime does on a 32-lane GPU. Each pipeline made one at a time, no concurrency, no XCL cache, the driver's shader cache off for the process (`ID3D12Device9::ShaderCacheControl(IMPLICIT_DRIVER_MANAGED, DISABLE)`). Two full runs agree within 1 %. **Programs:** the per-lane form takes 311 of 2 689 compute programs in the split form. 310 built in all four forms, 0 failures (first row dropped as driver warm-up). Median 212 B of console code, largest 2.6 KB. | form | DXIL | DXC | driver | total | |---|---|---|---|---| | per-lane | 3 168 KB | – | 10.0 s | 10.5 s | | #1426 per-instruction | 3 187 KB | – | 10.5 s | 10.9 s | | HLSL, 4 windows | 3 881 KB | 21.9 s | 14.1 s | 36.1 s | | HLSL, heap windows | 3 455 KB | 17.2 s | 10.8 s | 28.0 s | - **Per-lane vs #1426:** driver time per program, median ratio 0.98 (p10 0.85, p90 1.10); −5 % in total. No real gain on the programs it covers. - **Both direct forms vs the HLSL path:** 3.4× less total time, mostly DXC (61 % of the HLSL path's time here); the driver is also ~27 % faster on the direct DXIL. - **Not covered:** the large programs, which the per-lane form refuses. **Harness:** [`Raghav314/xcl` `shaders/time-forms`](https://github.com/Raghav314/xcl/tree/shaders/time-forms), one commit `c17ed53` on this PR's head `cf29f8a` (`shaders.rs` +155, `pso.rs` +6): `xcl shaders <pack> --time-forms [--split 1] [--windows 4] [--timeout 120] [--limit N] [--warm] [--out file.csv]`. One CSV row per program, record index only. Needs Windows developer mode for the cache switch; `--warm` skips it. Re-checked on `c17ed53`: builds, and `--limit 3` gives cold times (9–41 ms) against 0.5–2 ms with `--warm`. AI use: Claude Code (Claude Opus 5.5) wrote the harness, ran the measurements and drafted this.
Kalmarv commented 2026-11-24 21:09:30 +00:00 (Migrated from github.com)

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


@gefydev: the stale-value work is ready as a follow-up on this PR's head, not for #1745 itself. It is four commits on 43cb32c in Kalmarv/xcl per-lane-stale (head f5bfab2e):

  • 01715c81 the per-lane survey drops VCC after a refused compare: note_inst missed VOPC / VOP2 writes of VCC, which have no field, so a refused v_cmp_*_f32 left an older VCC that later showed up as a stale value.
  • 909d33b5 a write every reading lane passed is not a stale value: your rule from #1269. W dominates R, and every loop that contains W also contains R. Summary exports the dominators and the loop bodies. Same-block reads stay with def_owner / use_owner.
  • 595dd348 a join takes the scalar value an arm some lanes skipped wrote (case A, numbers and SCC). At a join every lane reaches, with a single stale write: a ballot of a per-region "ran it" flag, then a read from the first lane that ran it. Each lane keeps its own value when no lane ran it. A write in a loop that lanes leave one by one is still refused. Only registers a later read can see are repaired, because Module::optimize keeps wave ops. A value written in two such blocks is refused by its own name.
  • f5bfab2e a join takes a compare an arm some lanes skipped made (case A, VOPC masks): ran && bit. A mask a scalar instruction wrote is refused by its own name.

Recount: xcl shaders <pack> --direct --lanes --sample 0 --max-bytes 0 --split 0 --windows 4, the first refusal of each of 2689 compute programs, no timeouts in any run:

tree per-lane ok first refusal: stale value
43cb32c 321 265
+ 01715c81, 909d33b5 435 151
+ 595dd348, f5bfab2e 435 140 generic, 11 "written in more than one block"

The stale rule takes 114 more programs (321 to 435). Case A takes none in this sweep; it only renames 11 of the 151. Whatever the remaining stale values hit, it is not the single-write join that case A repairs. I'm classifying the 140 next (loops that lanes leave one by one, reads inside a region, or joins it skips) to decide what comes next. In a 60 s game run on 43cb32c, the stale value was the top fallback reason too: 17 of 73.

Tested on an RTX 5070 Ti (wave32 only) under Windows 11, release builds:

  • the recomp CPU tests (lower, lane_masks, lower_dxil), run by exact name: 43 passed at f5bfab2e, 42 at 595dd348. The new tests fail with the join repair switched off.
  • the 14 GPU tests of the same modules, run through the GPU queue at f5bfab2e: 14 passed, 0 failed. They compare against the HLSL path, as DXIL, and in the split form. Five report SKIPPED ... no wave64 (one of them only in part), and six skip only the validation step (DXC 1.7 < 1.8), so the split-form runs still happen.

The quadratic replace_all_uses is Itsmetibo's 4c3fe1e (1c9477a here); we dropped our own fix for it.

Not tested: the whole workspace suite, AMD, native wave64, a game run with these commits.

AI use: Claude Code (Claude Opus 5.5) wrote the commits, ran the tests and the recount, and wrote this note.

<!-- greyfinch-sync:ivall/xcl:comment:7143611170 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7143611170). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T20:28:53Z. --- @gefydev: the stale-value work is ready as a follow-up on this PR's head, not for #1745 itself. It is four commits on 43cb32c in [Kalmarv/xcl `per-lane-stale`](https://github.com/Kalmarv/xcl/tree/per-lane-stale) (head f5bfab2e): - 01715c81 **the per-lane survey drops VCC after a refused compare**: `note_inst` missed VOPC / VOP2 writes of VCC, which have no field, so a refused `v_cmp_*_f32` left an older VCC that later showed up as a stale value. - 909d33b5 **a write every reading lane passed is not a stale value**: your rule from #1269. W dominates R, and every loop that contains W also contains R. `Summary` exports the dominators and the loop bodies. Same-block reads stay with `def_owner` / `use_owner`. - 595dd348 **a join takes the scalar value an arm some lanes skipped wrote** (case A, numbers and SCC). At a join every lane reaches, with a single stale write: a ballot of a per-region "ran it" flag, then a read from the first lane that ran it. Each lane keeps its own value when no lane ran it. A write in a loop that lanes leave one by one is still refused. Only registers a later read can see are repaired, because `Module::optimize` keeps wave ops. A value written in two such blocks is refused by its own name. - f5bfab2e **a join takes a compare an arm some lanes skipped made** (case A, VOPC masks): `ran && bit`. A mask a scalar instruction wrote is refused by its own name. **Recount**: `xcl shaders <pack> --direct --lanes --sample 0 --max-bytes 0 --split 0 --windows 4`, the first refusal of each of 2689 compute programs, no timeouts in any run: | tree | per-lane ok | first refusal: stale value | |---|---|---| | 43cb32c | 321 | 265 | | + 01715c81, 909d33b5 | 435 | 151 | | + 595dd348, f5bfab2e | 435 | 140 generic, 11 "written in more than one block" | The stale rule takes 114 more programs (321 to 435). Case A takes none in this sweep; it only renames 11 of the 151. Whatever the remaining stale values hit, it is not the single-write join that case A repairs. I'm classifying the 140 next (loops that lanes leave one by one, reads inside a region, or joins it skips) to decide what comes next. In a 60 s game run on 43cb32c, the stale value was the top fallback reason too: 17 of 73. **Tested** on an RTX 5070 Ti (wave32 only) under Windows 11, release builds: - the recomp CPU tests (`lower`, `lane_masks`, `lower_dxil`), run by exact name: 43 passed at f5bfab2e, 42 at 595dd348. The new tests fail with the join repair switched off. - the 14 GPU tests of the same modules, run through the GPU queue at f5bfab2e: 14 passed, 0 failed. They compare against the HLSL path, as DXIL, and in the split form. Five report `SKIPPED ... no wave64` (one of them only in part), and six skip only the validation step (DXC 1.7 < 1.8), so the split-form runs still happen. The quadratic `replace_all_uses` is Itsmetibo's 4c3fe1e (1c9477a here); we dropped our own fix for it. Not tested: the whole workspace suite, AMD, native wave64, a game run with these commits. **AI use:** Claude Code (Claude Opus 5.5) wrote the commits, ran the tests and the recount, and wrote this note.
gefydev commented 2026-11-24 21:09:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-24T20:30:01Z.


A fact about the follow-up, not a change to this PR. @Kalmarv has the stale-value work ready as a follow-up on top of this PR's head: four commits on 43cb32c, branch Kalmarv/xcl per-lane-stale (head f5bfab2e). In his recount (xcl shaders <pack> --direct --lanes --sample 0 --max-bytes 0 --split 0 --windows 4, the first refusal of each of the 2 689 compute programs), the dominance rule for stale values (a write that dominates its read, with every loop containing the write also containing the read) takes the per-lane form from 321 to 435 programs; the repair of a value written in a region some lanes skip (case A) takes none more in that sweep. It is not part of #1745 and would go on top of it, or as a stacked PR, as the maintainer prefers. Thank you, Kalmarv.

AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.

<!-- greyfinch-sync:ivall/xcl:comment:7143640007 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7143640007). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-24T20:30:01Z. --- A fact about the follow-up, not a change to this PR. @Kalmarv has the stale-value work ready as a follow-up on top of this PR's head: four commits on `43cb32c`, branch `Kalmarv/xcl` `per-lane-stale` (head `f5bfab2e`). In his recount (`xcl shaders <pack> --direct --lanes --sample 0 --max-bytes 0 --split 0 --windows 4`, the first refusal of each of the 2 689 compute programs), the dominance rule for stale values (a write that dominates its read, with every loop containing the write also containing the read) takes the per-lane form from **321 to 435** programs; the repair of a value written in a region some lanes skip (case A) takes none more in that sweep. It is not part of #1745 and would go on top of it, or as a stacked PR, as the maintainer prefers. Thank you, Kalmarv. AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
alexmircea1299 commented 2026-11-24 21:09:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by alexmircea1299 on 2026-11-24T20:31:19Z.


Test report on NVIDIA GeForce RTX 5070 (12 GB)

  • PR / Commit: #1745 (43cb32c)
  • Hardware: AMD Ryzen 5 9600X, NVIDIA GeForce RTX 5070 (12 GB VRAM, driver 621.35), 32 GB DDR5 6000MT/s
  • Environment: Windows 11 (build 26300), rustc 1.100.0 (0ef1bc386 2026-11-09), Windows SDK 10.0.26100.0 (debug build)
  • Command: .\scripts\test.ps1 (cargo test --workspace -- --test-threads=4)
  • Results:
    • xcl --lib: 876 passed; 0 failed; 22 ignored (14.29s)
    • Integration tests: 8 passed; 0 failed; 12 ignored (1 + 1 + 6)
    • Total workspace: 884 passed; 0 failed; 34 ignored
  • GPU tests skipped on this adapter:
    • 7 (no wave64)
    • 1 (no heap windows)
    • 1 (f32 rounding, wave64: no wave64)
    • 1 (integer arithmetic, wave64: no wave64)
    • 1 (f64, wave64: no wave64)
    • 1 (integer carries, wave64: no wave64)
    • 1 (f32 three-source, wave64: no wave64)
    • 1 (f32 transcendentals, wave64: no wave64)
    • 1 (f32 conversions, wave64: no wave64)
    • 1 (f16 arithmetic, wave64: no wave64)
    • 1 (f16 packed, wave64: no wave64)
    • 1 (f32 compares, wave64: no wave64)
    • 1 (f32 arithmetic, wave64: no wave64)
    • 1 (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)))
    • 1 (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)))
    • 1 (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)))
  • Not tested: Retail title (smoke.ps1), release build, AMD / native wave64 GPUs.
  • AI use: Google Gemini assisted with running the commands and drafting this report from my real local test run.
<!-- greyfinch-sync:ivall/xcl:comment:7143673334 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7143673334). Originally posted by [alexmircea1299](https://github.com/alexmircea1299) on 2026-11-24T20:31:19Z. --- **Test report on NVIDIA GeForce RTX 5070 (12 GB)** * **PR / Commit:** #1745 (`43cb32c`) * **Hardware:** AMD Ryzen 5 9600X, NVIDIA GeForce RTX 5070 (12 GB VRAM, driver `621.35`), 32 GB DDR5 6000MT/s * **Environment:** Windows 11 (build `26300`), `rustc 1.100.0 (0ef1bc386 2026-11-09)`, Windows SDK `10.0.26100.0` (debug build) * **Command:** `.\scripts\test.ps1` (`cargo test --workspace -- --test-threads=4`) * **Results:** * `xcl --lib`: `876 passed; 0 failed; 22 ignored` (14.29s) * Integration tests: `8 passed; 0 failed; 12 ignored` (1 + 1 + 6) * Total workspace: `884 passed; 0 failed; 34 ignored` * **GPU tests skipped on this adapter:** * `7 (no wave64)` * `1 (no heap windows)` * `1 (f32 rounding, wave64: no wave64)` * `1 (integer arithmetic, wave64: no wave64)` * `1 (f64, wave64: no wave64)` * `1 (integer carries, wave64: no wave64)` * `1 (f32 three-source, wave64: no wave64)` * `1 (f32 transcendentals, wave64: no wave64)` * `1 (f32 conversions, wave64: no wave64)` * `1 (f16 arithmetic, wave64: no wave64)` * `1 (f16 packed, wave64: no wave64)` * `1 (f32 compares, wave64: no wave64)` * `1 (f32 arithmetic, wave64: no wave64)` * `1 (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)))` * `1 (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)))` * `1 (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)))` * **Not tested:** Retail title (`smoke.ps1`), release build, AMD / native wave64 GPUs. * **AI use:** Google Gemini assisted with running the commands and drafting this report from my real local test run.
HKEY-Funk-Machine commented 2026-11-24 21:09:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by HKEY-Funk-Machine on 2026-11-24T20:31:48Z.


@gefydev native wave64 and title results on AMD RDNA4 for 43cb32c: the suite passes, including every wave64 half. In the title, the per-lane form took 90 of 300 compute programs with no failures, but they are all small, and there is no size or driver-time gain on them. That's the same as your pack numbers, now measured in the AMD driver.

Tested

  • AMD Radeon RX 9070 (RDNA4, native wave64), driver 32.0.32015.7029, Ryzen 9 7945HX3D, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0, DXC 1.9.2602.17, release.
  • Clean 43cb32c: cargo test --release --workspace --no-fail-fast -- --test-threads=4: 925 passed, 0 failed, 42 ignored. gpu::dxil + recomp::lower: 125 passed, 0 failed, 1 ignored. No no wave64 skips: f32_programs_on_the_gpu (wave32 and wave64), the_split_form_agrees_with_the_wave64_lowering_on_the_gpu and the_runtime_path_takes_the_split_form ran and passed. SKIPPED: f16_programs_on_the_gpu ×4 (V_MUL_F16 / V_PK_MUL_F16 refused), f32_programs_on_the_gpu ×2 (V_CVT_F16_F32 refused), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Current head cf29f8a (test-only on top): gpu::dxil + recomp::lower again 125 passed, 0 failed, 1 ignored, the same 6 SKIPPED. The new 32-lane skip doesn't trigger on this card. The title runs below are on 43cb32c; cf29f8a changes only tests.

Title A/B (retail title; 43cb32c + #751, plus two local-only changes: skip InitializeApiImplEx2 in xgameruntime/api.rs, which hangs here, and a log line before and after each compute CreateComputePipelineState):

  • A: XCL_DIRECT_DXIL=1. B: XCL_DIRECT_DXIL=1 XCL_PER_LANE=1. Both with XCL_TRANSLATED_CACHE=0 XCL_PSO_DISK_CACHE=0 XCL_NETWORK=0, and each run's xcl.exe copied under a new name, so the AMD driver's cache was cold for both. A pressed on the title screen.
  • I stopped both runs about 5 minutes in, once cs 56c0cd3b82a00c6e (ActivateProbes, 15 042 740 B of per-instruction DXIL, refused by the per-lane form) had been in the driver for over a minute with process memory past 90 GB. In earlier runs on this card it ran out of memory at ~105 GB (https://github.com/xcl-dev/xcl/pull/1426#issuecomment-7141181058).
  • Programs were matched by console hash: a program whose DXIL differs between A and B went per-lane in B.
compute builds, A / B / built in both 300 / 302 / 300, 0 failed
per-lane in B 90 of 300 (the other 210: same DXIL as A)
DXIL of those 90 1.294 MB → 1.299 MB (+0.4 %)
driver time of those 90 6.4 s → 6.7 s (+4.7 %). Of the 38 that took ≥ 50 ms in A, 19 were faster in B
control: the 210 with the same DXIL, cold in both 598.8 s → 529.3 s (−11.6 %). So run-to-run driver noise is about ±10 %, and the +4.7 % is within it
largest per-lane program 130 544 B, 1.14 s in A → 129 532 B, 1.32 s in B
device removal, 0x8007000E, crash none in either run (both stopped by me)

Top per-lane refusals in B (count of programs): "a value written while some lanes were elsewhere, read after they met again" 55, IMAGE_LOAD (reads a register the per-lane form did not pass) 31, IMAGE_SAMPLE_LZ 19, "a mask read as a number where some lanes are elsewhere" 12, IMAGE_STORE 11, DS_ADD_U32 10, BUFFER_ATOMIC_ADD 8, IMAGE_LOAD_MIP 6.

So on this card the per-lane form is correct on what it takes, and neutral on cost. The programs the world load waits on (ActivateProbes and the other ~1 MB+ programs) all stay on the per-instruction form, mostly for the stale-value refusal and the image / LDS register plumbing.

Not tested

  • The title past ActivateProbes (it runs out of memory on the direct path here), more than one run per form, heap windows (XCL_HEAP_WINDOWS=1), split wave64 in the title, and output correctness beyond "no failure" (no frame comparison).

AI use: Claude Code (Claude Opus 5.5) ran the tests and the two runs, matched the programs with a script and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7143685782 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7143685782). Originally posted by [HKEY-Funk-Machine](https://github.com/HKEY-Funk-Machine) on 2026-11-24T20:31:48Z. --- @gefydev native wave64 and title results on AMD RDNA4 for `43cb32c`: **the suite passes, including every wave64 half. In the title, the per-lane form took 90 of 300 compute programs with no failures, but they are all small, and there is no size or driver-time gain on them.** That's the same as your pack numbers, now measured in the AMD driver. **Tested** - AMD Radeon RX 9070 (RDNA4, native wave64), driver 32.0.32015.7029, Ryzen 9 7945HX3D, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0, DXC 1.9.2602.17, release. - Clean `43cb32c`: `cargo test --release --workspace --no-fail-fast -- --test-threads=4`: **925 passed, 0 failed, 42 ignored**. `gpu::dxil` + `recomp::lower`: 125 passed, 0 failed, 1 ignored. No `no wave64` skips: `f32_programs_on_the_gpu` (wave32 and wave64), `the_split_form_agrees_with_the_wave64_lowering_on_the_gpu` and `the_runtime_path_takes_the_split_form` ran and passed. SKIPPED: `f16_programs_on_the_gpu` ×4 (`V_MUL_F16` / `V_PK_MUL_F16` refused), `f32_programs_on_the_gpu` ×2 (`V_CVT_F16_F32` refused), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - Current head `cf29f8a` (test-only on top): `gpu::dxil` + `recomp::lower` again 125 passed, 0 failed, 1 ignored, the same 6 SKIPPED. The new 32-lane skip doesn't trigger on this card. The title runs below are on `43cb32c`; `cf29f8a` changes only tests. **Title A/B** (retail title; `43cb32c` + #751, plus two local-only changes: skip `InitializeApiImplEx2` in `xgameruntime/api.rs`, which hangs here, and a log line before and after each compute `CreateComputePipelineState`): - A: `XCL_DIRECT_DXIL=1`. B: `XCL_DIRECT_DXIL=1 XCL_PER_LANE=1`. Both with `XCL_TRANSLATED_CACHE=0 XCL_PSO_DISK_CACHE=0 XCL_NETWORK=0`, and each run's `xcl.exe` copied under a new name, so the AMD driver's cache was cold for both. A pressed on the title screen. - I stopped both runs about 5 minutes in, once `cs 56c0cd3b82a00c6e` (`ActivateProbes`, 15 042 740 B of per-instruction DXIL, refused by the per-lane form) had been in the driver for over a minute with process memory past 90 GB. In earlier runs on this card it ran out of memory at ~105 GB (https://github.com/xcl-dev/xcl/pull/1426#issuecomment-7141181058). - Programs were matched by console hash: a program whose DXIL differs between A and B went per-lane in B. | | | |---|---| | compute builds, A / B / built in both | 300 / 302 / 300, **0 failed** | | per-lane in B | **90** of 300 (the other 210: same DXIL as A) | | DXIL of those 90 | 1.294 MB → 1.299 MB (**+0.4 %**) | | driver time of those 90 | 6.4 s → 6.7 s (**+4.7 %**). Of the 38 that took ≥ 50 ms in A, 19 were faster in B | | control: the 210 with the same DXIL, cold in both | 598.8 s → 529.3 s (−11.6 %). So run-to-run driver noise is about ±10 %, and the +4.7 % is within it | | largest per-lane program | 130 544 B, 1.14 s in A → 129 532 B, 1.32 s in B | | device removal, `0x8007000E`, crash | none in either run (both stopped by me) | Top per-lane refusals in B (count of programs): "a value written while some lanes were elsewhere, read after they met again" 55, `IMAGE_LOAD` (reads a register the per-lane form did not pass) 31, `IMAGE_SAMPLE_LZ` 19, "a mask read as a number where some lanes are elsewhere" 12, `IMAGE_STORE` 11, `DS_ADD_U32` 10, `BUFFER_ATOMIC_ADD` 8, `IMAGE_LOAD_MIP` 6. So on this card the per-lane form is correct on what it takes, and neutral on cost. The programs the world load waits on (`ActivateProbes` and the other ~1 MB+ programs) all stay on the per-instruction form, mostly for the stale-value refusal and the image / LDS register plumbing. **Not tested** - The title past `ActivateProbes` (it runs out of memory on the direct path here), more than one run per form, heap windows (`XCL_HEAP_WINDOWS=1`), split wave64 in the title, and output correctness beyond "no failure" (no frame comparison). AI use: Claude Code (Claude Opus 5.5) ran the tests and the two runs, matched the programs with a script and wrote this comment.
gefydev commented 2026-11-24 21:09:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-24T20:32:41Z.


Thank you both for the test reports on this PR.

  • @alexmircea1299: 43cb32c on an RTX 5070 gives 876 passed, 0 failed in the lib, with the wave64 halves and the three per-lane refusals reported as SKIPPED. That is a clean second NVIDIA card.
  • @HKEY-Funk-Machine: the native wave64 run on the RX 9070 (925 passed, 0 failed, no no wave64 skips) and the title A/B are the first AMD driver-side measurement of the per-lane form. On the 90 of 300 programs the per-lane form takes, it is correct and neutral on cost (DXIL +0.4 %, driver time +4.7 %, within the noise you measured), and the programs the world load waits on stay on #1426's form. That agrees with the numbers in the description.

AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.

<!-- greyfinch-sync:ivall/xcl:comment:7143708576 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7143708576). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-24T20:32:41Z. --- Thank you both for the test reports on this PR. - @alexmircea1299: `43cb32c` on an RTX 5070 gives 876 passed, 0 failed in the lib, with the wave64 halves and the three per-lane refusals reported as SKIPPED. That is a clean second NVIDIA card. - @HKEY-Funk-Machine: the native wave64 run on the RX 9070 (925 passed, 0 failed, no `no wave64` skips) and the title A/B are the first AMD driver-side measurement of the per-lane form. On the 90 of 300 programs the per-lane form takes, it is correct and neutral on cost (DXIL +0.4 %, driver time +4.7 %, within the noise you measured), and the programs the world load waits on stay on #1426's form. That agrees with the numbers in the description. AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
teidenzero commented 2026-11-24 21:09:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by teidenzero on 2026-11-24T20:34:03Z.


Test report for cf29f8a on Windows 10 (where SM 6.6 comes from the Agility SDK), NVIDIA RTX 4090.

Tested

  • NVIDIA GeForce RTX 4090 24 GB (Ada, 32-lane waves, so the split wave64 tests run for real), driver 621.24 (32.0.16.2124); AMD Ryzen 7 3700X; Windows 10 Pro 22H2 build 19045.6466 with the D3D12 Agility SDK 1.620.2 (the inbox runtime stops at SM 6.5); Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug; DXC 1.8.2502.11 from the Windows SDK 10.0.26100.0, without dxil.dll.
  • .\scripts\test.ps1 at cf29f8a: 925 passed, 0 failed, 42 ignored over the workspace (lib: 876 passed, 0 failed, 22 ignored), the same totals as the GTX 1650 run in the description.
  • SKIPPED (23): 18 "no wave64" (this GPU), 1 "no heap windows", 1 "no dxil.dll" (the IR-assembly test; the SDK's DXC ships without it), and the 3 per-lane halves refused on purpose (V_CVT_F16_F32, V_MUL_F16, V_PK_MUL_F16).

Not tested

  • Native wave64 (no AMD GPU here), a release build, a title (none here, so no smoke run, with XCL_PER_LANE off or on).

The VS / PS adapter half, which the description lists as missing: 43d5851 from #1269 applies onto cf29f8a (one trivial conflict: the new replaced field next to its graphics field) as teidenzero/xcl vsps-dxil-on-1745 13dd18b. There the workspace gives 926 passed, 0 failed, 42 ignored on this machine, the one more being its draw test, which passes. It waits for the maintainer's call on this PR, as you said.

AI use: Claude Code (Claude Opus 5.5) ran the tests, rebased the commit and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7143743022 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7143743022). Originally posted by [teidenzero](https://github.com/teidenzero) on 2026-11-24T20:34:03Z. --- Test report for `cf29f8a` on Windows 10 (where SM 6.6 comes from the Agility SDK), NVIDIA RTX 4090. **Tested** - NVIDIA GeForce RTX 4090 24 GB (Ada, 32-lane waves, so the split wave64 tests run for real), driver 621.24 (32.0.16.2124); AMD Ryzen 7 3700X; Windows 10 Pro 22H2 build 19045.6466 with the D3D12 Agility SDK 1.620.2 (the inbox runtime stops at SM 6.5); Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug; DXC 1.8.2502.11 from the Windows SDK 10.0.26100.0, without `dxil.dll`. - `.\scripts\test.ps1` at `cf29f8a`: **925 passed, 0 failed, 42 ignored** over the workspace (lib: 876 passed, 0 failed, 22 ignored), the same totals as the GTX 1650 run in the description. - SKIPPED (23): 18 "no wave64" (this GPU), 1 "no heap windows", 1 "no dxil.dll" (the IR-assembly test; the SDK's DXC ships without it), and the 3 per-lane halves refused on purpose (`V_CVT_F16_F32`, `V_MUL_F16`, `V_PK_MUL_F16`). **Not tested** - Native wave64 (no AMD GPU here), a release build, a title (none here, so no smoke run, with `XCL_PER_LANE` off or on). **The VS / PS adapter half**, which the description lists as missing: `43d5851` from #1269 applies onto `cf29f8a` (one trivial conflict: the new `replaced` field next to its `graphics` field) as [`teidenzero/xcl` `vsps-dxil-on-1745`](https://github.com/teidenzero/xcl/tree/vsps-dxil-on-1745) `13dd18b`. There the workspace gives 926 passed, 0 failed, 42 ignored on this machine, the one more being its draw test, which passes. It waits for the maintainer's call on this PR, as you said. AI use: Claude Code (Claude Opus 5.5) ran the tests, rebased the commit and drafted this report.
gefydev commented 2026-11-24 21:09:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-24T20:34:41Z.


@teidenzero thank you: the report on cf29f8a (925 passed, 0 failed, 42 ignored on an RTX 4090 under Windows 10 with the Agility SDK, with the split wave64 tests running for real) is the same total as the description's. Your VS / PS adapter half rebased on the head (teidenzero/xcl vsps-dxil-on-1745, 13dd18b, 926 passed) is noted: it waits for the maintainer's call on this PR, as you say.

AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.

<!-- greyfinch-sync:ivall/xcl:comment:7143760315 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7143760315). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-24T20:34:41Z. --- @teidenzero thank you: the report on `cf29f8a` (925 passed, 0 failed, 42 ignored on an RTX 4090 under Windows 10 with the Agility SDK, with the split wave64 tests running for real) is the same total as the description's. Your VS / PS adapter half rebased on the head (`teidenzero/xcl` `vsps-dxil-on-1745`, `13dd18b`, 926 passed) is noted: it waits for the maintainer's call on this PR, as you say. AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
oni-swr commented 2026-11-24 21:09:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-24T20:38:30Z.


Test report for #1745 on native wave64 (AMD RDNA3). The second part is with #1742 merged in, to check that the DIFFERS_ON_1426 f16 entries can go.

Tested

  • AMD Radeon RX 7800 XT, driver 32.0.31035.1003 (wave32 and native wave64); Ryzen 7 5700X3D; Windows 11 Pro 26200; Rust 1.100.0 MSVC; debug; each tree in its own target dir.
  • #1745 head 43cb32c, as is: cargo test --workspace -- --test-threads=4 --nocapture gives 925 passed, 0 failed, 42 ignored. 7 tests SKIPPED: the 6 per-lane refusals V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 (f16_programs_on_the_gpu f16 arithmetic and f16 packed, f32_programs_on_the_gpu f32 conversions, each in wave32 and wave64), plus heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows). Everything else in recomp::lower / lower_dxil / lane_masks passes in native wave64.
  • 43cb32c merged with #1742 35355a2 (no conflicts), and DIFFERS_ON_1426 emptied (local edit in recomp/lower.rs, not pushed):
    • cargo test -p xcl --lib recomp::lower -- --test-threads=1: 44 passed, 0 failed, 0 ignored, no SKIPPED. f16_programs_on_the_gpu (f16 arithmetic, f16 packed) and f32_programs_on_the_gpu (f32 conversions) now run per lane in wave32 and native wave64, and agree with the HLSL path.
    • cargo test --workspace -- --test-threads=4 --nocapture: 938 passed, 0 failed, 42 ignored. The extra tests come from main 85e3826, which #1742 is based on. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows) and pso_measurement_compiles_an_exact_synthetic_record (Developer Mode off).

Not tested

  • No title run of #1745 (XCL_PER_LANE) here. No release build. Nothing on NVIDIA or Intel.

AI use: Claude Code (Claude Opus 5.5) ran these tests on @oni-swr's machine and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7143857989 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7143857989). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-24T20:38:30Z. --- Test report for #1745 on native wave64 (AMD RDNA3). The second part is with #1742 merged in, to check that the `DIFFERS_ON_1426` f16 entries can go. **Tested** - AMD Radeon RX 7800 XT, driver 32.0.31035.1003 (wave32 and native wave64); Ryzen 7 5700X3D; Windows 11 Pro 26200; Rust 1.100.0 MSVC; debug; each tree in its own target dir. - **#1745 head `43cb32c`, as is:** `cargo test --workspace -- --test-threads=4 --nocapture` gives 925 passed, 0 failed, 42 ignored. 7 tests SKIPPED: the 6 per-lane refusals `V_MUL_F16` / `V_PK_MUL_F16` / `V_CVT_F16_F32` (`f16_programs_on_the_gpu` f16 arithmetic and f16 packed, `f32_programs_on_the_gpu` f32 conversions, each in wave32 and wave64), plus `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). Everything else in `recomp::lower` / `lower_dxil` / `lane_masks` passes in native wave64. - **`43cb32c` merged with #1742 `35355a2` (no conflicts), and `DIFFERS_ON_1426` emptied** (local edit in `recomp/lower.rs`, not pushed): - `cargo test -p xcl --lib recomp::lower -- --test-threads=1`: 44 passed, 0 failed, 0 ignored, no SKIPPED. `f16_programs_on_the_gpu` (f16 arithmetic, f16 packed) and `f32_programs_on_the_gpu` (f32 conversions) now run per lane in wave32 and native wave64, and agree with the HLSL path. - `cargo test --workspace -- --test-threads=4 --nocapture`: 938 passed, 0 failed, 42 ignored. The extra tests come from `main` `85e3826`, which #1742 is based on. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows) and `pso_measurement_compiles_an_exact_synthetic_record` (Developer Mode off). **Not tested** - No title run of #1745 (`XCL_PER_LANE`) here. No release build. Nothing on NVIDIA or Intel. AI use: Claude Code (Claude Opus 5.5) ran these tests on @oni-swr's machine and wrote this report.
gefydev commented 2026-11-24 21:09:37 +00:00 (Migrated from github.com)

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


  • @Kalmarv thank you for the review and the small programs behind it: points 1 (a branch or select on "any lane" of a mask taken lane by lane), 2 (a non-default rounding mode dropped where #1426 and the HLSL path refuse the program) and 3 (the summary label "HLSL fallback" for the per-lane refusals) are received and being looked at, and I will answer each of them on this PR. Please keep your three local tests (the split-form programs, the branch programs, the rounding programs) ready; I will say whether they go in as a patch or a follow-up.
  • @oni-swr thank you: 43cb32c merged with #1742 and DIFFERS_ON_1426 emptied, with recomp::lower at 44 passed and no SKIPPED, and the workspace at 938 passed, 0 failed, is the evidence that the three f16 entries can go. The removal waits for #1742 to land in main.

AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.

<!-- greyfinch-sync:ivall/xcl:comment:7143902243 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7143902243). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-24T20:40:24Z. --- - @Kalmarv thank you for the review and the small programs behind it: points 1 (a branch or select on "any lane" of a mask taken lane by lane), 2 (a non-default rounding mode dropped where #1426 and the HLSL path refuse the program) and 3 (the summary label "HLSL fallback" for the per-lane refusals) are received and being looked at, and I will answer each of them on this PR. Please keep your three local tests (the split-form programs, the branch programs, the rounding programs) ready; I will say whether they go in as a patch or a follow-up. - @oni-swr thank you: `43cb32c` merged with #1742 and `DIFFERS_ON_1426` emptied, with `recomp::lower` at 44 passed and no SKIPPED, and the workspace at 938 passed, 0 failed, is the evidence that the three f16 entries can go. The removal waits for #1742 to land in `main`. AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
Pipodi commented 2026-11-24 21:09:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-24T20:53:34Z.


Review of #1745 at 0570037: static, nothing built or run. I read the diff against main 6c89285 in three parts: the lane-mask analysis and SSA, the lowering, and the DXIL adapter and runtime wiring. Nothing below was run: each correctness point comes with the program that would show it, compared with the HLSL path (EXEC emulated). They all need XCL_DIRECT_DXIL=1 XCL_PER_LANE=1, except where I say otherwise. 0570037 answers @Kalmarv's points 1 and 2, and I leave out his point 3. Line numbers are at 0570037.

Correctness of the per-lane form

  1. Whole-wave mask decisions: fixed in 0570037. I read the commit:
    • uniform_over refuses a lane branch, or an s_cselect / s_cmov / s_addc / s_subb of a mask op's SCC, unless the condition is the same in every lane in EXEC. That is the rule I would have suggested.
    • The old test now asserts it.
    • The check runs only where the analysis marks the branch or the SCC as a lane mask's (lane), so point 2's case still gets through it.
  2. The analysis and the lowering disagree on which branches are per-lane.
    • The analysis follows a mask op only when both sources are known masks (lane_masks.rs:528-549); otherwise SCC is an Atom::Scc with lane = false (lane_masks.rs:574-578).
    • The lowering treats an op as a mask op when any source holds a mask (reads_mask, lower.rs:545 and lower.rs:566), and writes SCC per lane; cond then branches on it lane by lane (lower.rs:963).
    • Example: v_cmp … vcc; s_and_b64 s[4:5], vcc, s[8:9] (s8:9 is user data), then s_cbranch_scc0 J; s_mov_b32 s6, 1; J: v_mov_b32 v3, s6.
      • The lowering branches per lane, but the analysis has lane = false, so neither 0570037's uniform_over check nor partial_blocks (lower.rs:1063) sees the branch.
      • So the stale-value, cross-lane and s_barrier refusals don't run, and the lanes that skipped read their old s6.
  3. A bridged v_cmpx_* can turn on lanes that had EXEC off.
    • lower.rs:1647 passes guard = true for every cmpx. #1426's write_mask builds act() & cond, and act() returns that guard (dxil/lower.rs:773, dxil/lower.rs:849-851).
    • So at a guarded pc, the new EXEC is cond, not cond & EXEC. The native integer path is right (lower.rs:791-794).
    • Example: v_cmp_gt_u32 vcc, 16, v0; s_and_saveexec_b32 s0, vcc (no execz), then v_cmpx_le_f32 0, v1; v_mov_b32 v2, 7; s_or_b32 exec, exec, s0. Lanes 16 and up get v2 = 7.
  4. The stale-value rule misses three cases. @Kalmarv's per-lane-stale follow-up reworks this rule; from its description, same-block reads "stay with def_owner / use_owner", so the loop case below would still be taken there. I haven't read that branch.
    • Loops. The rule compares static blocks (def_owner[b] != use_owner[c], lower.rs:1004), so a scalar written and read in the same partial block on different loop iterations is accepted.
      • Example: s1 = 0; s3 = 0; L: v_cmp_eq_u32 vcc, s3, v0; s_and_saveexec s2, vcc; s_cbranch_execz J; s_add_u32 s1, s1, 1; v_mov v1, s1; J: s_or exec, exec, s2; s_add s3, s3, 1; s_cmp_lt_u32 s3, 4; s_cbranch_scc1 L.
      • On the console, lane k gets v1 = k + 1. In the per-lane form every lane gets 1.
    • A phi copied in a partial block. own (lower.rs:370-380) copies only values already in def_block, and a phi never is one. stale follows the phi's operands, not the phi.
      • Example: a uniform if/else sets s5 to 1 or 2, then s_and_saveexec; s_cbranch_execz J; s_mov_b32 s6, s5; J: s_or exec; v_mov v1, s6.
      • The copy case in a_mask_left_behind_by_lanes_that_skipped_its_write copies an older mask from before the split, so it doesn't cover this.
    • s_bcnt0/1 of a mask. It writes SCC through ssa.write (wave.rs:464), not write_scc/own, so stale never sees it. Example: s_bcnt1_i32_b64 s2, exec in an execz arm, then s_cbranch_scc0 after the join.
  5. A bridged mask write in the split wave64 form can sit behind a barrier that only one half reaches.
    • The bridge (lower.rs:1648) has no all_lanes-style check for instructions that #1426 lowers with an exchange between the halves.
    • Every f32/f16/f64 v_cmp* and v_add_co_* whose mask is read as a whole goes through write_mask → ballot → exchange_n → meet(), a group barrier (dxil/lanes.rs:221-256).
    • In a branch only one half takes (33–64 threads, Partner::Present), the other hardware wave never reaches that barrier: a hang, or barriers paired with the wrong partner.
    • The per-lane form's own ballots refuse this (wave.rs:53, wave.rs:122).
    • I followed the path, but the hang itself needs a run on a wave32 GPU.
  6. Lanes outside the launch EXEC (kernel ABI).
    • lower.rs:1259-1270 and lower.rs:1502-1512 send those lanes straight to the exit, and lane 0 stores every SGPR.
    • With a launch EXEC of 0xFFFFFFFE, s_mov_b32 s0, 5 leaves res[0] at its input value.
    • The skip block also sets every mask bit to 0 (lower.rs:1268), where s_not or s_orn2 of a v_cmp mask leaves those lanes at 1 on the console.
    • lanes_outside_exec_at_launch_keep_their_registers keeps lane 0 active.
  7. Not traced to the end: s_or_saveexec_b64 s, -1 and s_mov_b64 exec, -1 (whole-wave mode) inside a block some lanes don't reach give EXEC = TRUE (lane_masks.rs:464-467, lane_masks.rs:519-526). On the console that turns on the lanes that branched away, and here they are elsewhere. What's left after the cross-lane refusals is a write in that region read by those lanes after the join. I haven't checked whether real code does that.

Runtime and caching

  1. xcl shaders --recomp changes with no flag.
    • RecompAgg::add (shaders.rs:445-503) now runs lower_dxil::compute_code, survey_compute_code, a second translate_compute/translate_mesh and lane_masks::analyze_code on every program, without --lanes.
    • So the existing sweep is slower and prints new lines.
    • These calls run on the sweep's worker threads, without compute_with's 256 MB stack and panic catch. A panic in the new code would hit h.join().unwrap() (shaders.rs:767) and end the sweep.
  2. The per-lane cache identity has no version.
    • lower.rs, lower/wave.rs, lower_dxil.rs, lane_masks.rs and ssa.rs are not in TRANSLATOR_SOURCES (build.rs).
    • TRANSLATOR_VERSION covers gpu/dxil only, and the per-lane identity is identity_for(id, "xcl-per-lane") (pso.rs:245).
    • So a later fix to the lowering keeps serving the old cached containers to XCL_PER_LANE=1 users, unless someone bumps a version by hand.

Tests

  1. Refusals become skips. programs_on_the_gpu (lower_dxil.rs:600-606) turns any Err from the per-lane form into skip_test, not only the programs in DIFFERS_ON_1426. A change that makes the form refuse the f32/f64/int/f16 programs still passes. An allow-list of the expected refusals would keep the assertion.
  2. Not covered:
  • Every lane_masks test is wave64. Nothing tests:
    • the wave32 _B32 paths;
    • *_WREXEC, v_cmpx, VOP3 sdst = EXEC, or separate exec_lo/exec_hi writes;
    • nested loops or the step_bounded/cond_bounded fallbacks.
  • d94736a, 5f78f44 and 1b257c2 add no test.
  • The CPU Interp has no foreign, so bridged instructions are only covered by GPU runs.

CONTRIBUTING

  1. The size waiver. The description says the size rule is waived "at the maintainer's request (#1269)". The only maintainer text I found is the issue body ("We are open for big PRs aiming to optimize shaders … compiling shaders directly into DXIL"); please link or quote that, so a reviewer can see what the 7,467 lines rest on.
  2. Commits.
    • cf29f8a says every per-lane GPU test failed on WARP (the CI adapter) before it, so the commits before it don't each pass CI.
    • Several commits fix earlier ones in the PR: bcb502f fixes 8cb697d, 1c9477a reworks d1f0661, 51f3b82 drops 8cb697d's heap refusal, and c7caa1d fixes this PR's DxilIr.
    • The description says 45 commits; the branch has 49.
  3. AI use. 43cb32c and 8e0c4a7 carry Assisted-by: Antigravity (Gemini 4 Neon), which the AI use section doesn't name.
  4. Not tested. Both smoke runs are with XCL_PER_LANE off and, from the description, without XCL_DIRECT_DXIL, so they don't exercise the kernel.rs refactor (Lw::new/Lw::finish) under XCL_DIRECT_DXIL=1. Reading it, I think it emits the same DXIL. A byte diff of xcl shaders --direct --dump on 6c89285 and on cf29f8a would show it, and Not tested could say it wasn't run.
  5. XCL_PER_LANE, XCL_RECOMP_STAGES and XCL_RECOMP_NO_HLSL aren't documented anywhere, as with XCL_DIRECT_DXIL today.

Nits

  • pso.rs:238: let id = identity_with(.
  • ssa.rs:150-158 doesn't move users[phi] to users[same], so a trivial phi can be left behind. The results are unaffected: a leftover phi over the marker is still refused.
  • wave.rs:298-300: v_readfirstlane where no lane has EXEC reads lane 0.
  • recomp/dxil/assemble.rs is called only from its own test. It finds dxil.dll through GetModuleHandleW, so it works only once DXC has loaded it.

Checked and fine

  • The lane-mask analysis:
    • the BDD (variable order, memoisation, partial results);
    • the saveexec/wrexec semantics, including the ANDN1/ANDN2 operand order;
    • VOPC/VOP3 sdst writes, and separate exec_lo/exec_hi writes turning EXEC opaque;
    • irreducible-flow detection, which is complete;
    • loop atoms not leaking between iterations;
    • the fallbacks weakening soundly.
  • SSA: the sealing order, and the one-pass trivial-phi replacement in 1c9477a, which can't form a cycle.
  • The lowering:
    • DPP16/DPP8, v_permlane(x)16, ds_swizzle quad-perm and bitmask modes (rotate mode not checked);
    • mbcnt, readlane, writelane and their split checks;
    • the v_cndmask/carry-in lane bit (c7caa1d);
    • coalesced runs, which can't span an EXEC or guard change; stores and atomics under partial EXEC run only in the lanes that have it;
    • far jumps.
  • The bridge's register check refuses every unpassed read of VCC, M0, EXEC and SCC.
  • The kernel.rs refactor: by reading, the module calls run in the same order, so the DXIL should be the same.
  • The fallback: a per-lane error, including a caught panic, goes to #1426's form.
  • GPU tests skip with runner::skip_test; no #[ignore], no game data, no new dependency, no ported code.

AI use: Claude Code. Three Claude Opus 5.5 subagents reviewed the three parts. Claude Opus 5.5 (the main session) then read the code path of every numbered point itself, at cf29f8a and again at 0570037, and wrote this review; the Checked and fine list is from the subagents' reading. Points 5 and 7 are not traced to the end, as they say.

<!-- greyfinch-sync:ivall/xcl:comment:7144195923 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7144195923). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-24T20:53:34Z. --- **Review of #1745 at `0570037`: static, nothing built or run.** I read the diff against `main` `6c89285` in three parts: the lane-mask analysis and SSA, the lowering, and the DXIL adapter and runtime wiring. Nothing below was run: each correctness point comes with the program that would show it, compared with the HLSL path (EXEC emulated). They all need `XCL_DIRECT_DXIL=1 XCL_PER_LANE=1`, except where I say otherwise. `0570037` answers @Kalmarv's points 1 and 2, and I leave out his point 3. Line numbers are at `0570037`. **Correctness of the per-lane form** 1. **Whole-wave mask decisions: fixed in `0570037`.** I read the commit: - `uniform_over` refuses a lane branch, or an `s_cselect` / `s_cmov` / `s_addc` / `s_subb` of a mask op's SCC, unless the condition is the same in every lane in EXEC. That is the rule I would have suggested. - The old test now asserts it. - The check runs only where the analysis marks the branch or the SCC as a lane mask's (`lane`), so point 2's case still gets through it. 2. **The analysis and the lowering disagree on which branches are per-lane.** - The analysis follows a mask op only when *both* sources are known masks (`lane_masks.rs:528-549`); otherwise SCC is an `Atom::Scc` with `lane = false` (`lane_masks.rs:574-578`). - The lowering treats an op as a mask op when *any* source holds a mask (`reads_mask`, `lower.rs:545` and `lower.rs:566`), and writes SCC per lane; `cond` then branches on it lane by lane (`lower.rs:963`). - Example: `v_cmp … vcc; s_and_b64 s[4:5], vcc, s[8:9]` (s8:9 is user data), then `s_cbranch_scc0 J; s_mov_b32 s6, 1; J: v_mov_b32 v3, s6`. - The lowering branches per lane, but the analysis has `lane = false`, so neither `0570037`'s `uniform_over` check nor `partial_blocks` (`lower.rs:1063`) sees the branch. - So the stale-value, cross-lane and `s_barrier` refusals don't run, and the lanes that skipped read their old s6. 3. **A bridged `v_cmpx_*` can turn on lanes that had EXEC off.** - `lower.rs:1647` passes `guard = true` for every cmpx. #1426's `write_mask` builds `act() & cond`, and `act()` returns that guard (`dxil/lower.rs:773`, `dxil/lower.rs:849-851`). - So at a guarded pc, the new EXEC is `cond`, not `cond & EXEC`. The native integer path is right (`lower.rs:791-794`). - Example: `v_cmp_gt_u32 vcc, 16, v0; s_and_saveexec_b32 s0, vcc` (no execz), then `v_cmpx_le_f32 0, v1; v_mov_b32 v2, 7; s_or_b32 exec, exec, s0`. Lanes 16 and up get v2 = 7. 4. **The stale-value rule misses three cases.** @Kalmarv's `per-lane-stale` follow-up reworks this rule; from its description, same-block reads "stay with `def_owner` / `use_owner`", so the loop case below would still be taken there. I haven't read that branch. - **Loops.** The rule compares static blocks (`def_owner[b] != use_owner[c]`, `lower.rs:1004`), so a scalar written and read in the same partial block on different loop iterations is accepted. - Example: `s1 = 0; s3 = 0; L: v_cmp_eq_u32 vcc, s3, v0; s_and_saveexec s2, vcc; s_cbranch_execz J; s_add_u32 s1, s1, 1; v_mov v1, s1; J: s_or exec, exec, s2; s_add s3, s3, 1; s_cmp_lt_u32 s3, 4; s_cbranch_scc1 L`. - On the console, lane k gets v1 = k + 1. In the per-lane form every lane gets 1. - **A phi copied in a partial block.** `own` (`lower.rs:370-380`) copies only values already in `def_block`, and a phi never is one. `stale` follows the phi's operands, not the phi. - Example: a uniform if/else sets s5 to 1 or 2, then `s_and_saveexec; s_cbranch_execz J; s_mov_b32 s6, s5; J: s_or exec; v_mov v1, s6`. - The copy case in `a_mask_left_behind_by_lanes_that_skipped_its_write` copies an older mask from before the split, so it doesn't cover this. - **`s_bcnt0/1` of a mask.** It writes SCC through `ssa.write` (`wave.rs:464`), not `write_scc`/`own`, so `stale` never sees it. Example: `s_bcnt1_i32_b64 s2, exec` in an execz arm, then `s_cbranch_scc0` after the join. 5. **A bridged mask write in the split wave64 form can sit behind a barrier that only one half reaches.** - The bridge (`lower.rs:1648`) has no `all_lanes`-style check for instructions that #1426 lowers with an exchange between the halves. - Every f32/f16/f64 `v_cmp*` and `v_add_co_*` whose mask is read as a whole goes through `write_mask` → `ballot` → `exchange_n` → `meet()`, a group barrier (`dxil/lanes.rs:221-256`). - In a branch only one half takes (33–64 threads, `Partner::Present`), the other hardware wave never reaches that barrier: a hang, or barriers paired with the wrong partner. - The per-lane form's own ballots refuse this (`wave.rs:53`, `wave.rs:122`). - I followed the path, but the hang itself needs a run on a wave32 GPU. 6. **Lanes outside the launch EXEC (kernel ABI).** - `lower.rs:1259-1270` and `lower.rs:1502-1512` send those lanes straight to the exit, and lane 0 stores every SGPR. - With a launch EXEC of `0xFFFFFFFE`, `s_mov_b32 s0, 5` leaves `res[0]` at its input value. - The skip block also sets every mask bit to 0 (`lower.rs:1268`), where `s_not` or `s_orn2` of a v_cmp mask leaves those lanes at 1 on the console. - `lanes_outside_exec_at_launch_keep_their_registers` keeps lane 0 active. 7. **Not traced to the end:** `s_or_saveexec_b64 s, -1` and `s_mov_b64 exec, -1` (whole-wave mode) inside a block some lanes don't reach give EXEC = TRUE (`lane_masks.rs:464-467`, `lane_masks.rs:519-526`). On the console that turns on the lanes that branched away, and here they are elsewhere. What's left after the cross-lane refusals is a write in that region read by those lanes after the join. I haven't checked whether real code does that. **Runtime and caching** 8. **`xcl shaders --recomp` changes with no flag.** - `RecompAgg::add` (`shaders.rs:445-503`) now runs `lower_dxil::compute_code`, `survey_compute_code`, a second `translate_compute`/`translate_mesh` and `lane_masks::analyze_code` on every program, without `--lanes`. - So the existing sweep is slower and prints new lines. - These calls run on the sweep's worker threads, without `compute_with`'s 256 MB stack and panic catch. A panic in the new code would hit `h.join().unwrap()` (`shaders.rs:767`) and end the sweep. 9. **The per-lane cache identity has no version.** - `lower.rs`, `lower/wave.rs`, `lower_dxil.rs`, `lane_masks.rs` and `ssa.rs` are not in `TRANSLATOR_SOURCES` (`build.rs`). - `TRANSLATOR_VERSION` covers `gpu/dxil` only, and the per-lane identity is `identity_for(id, "xcl-per-lane")` (`pso.rs:245`). - So a later fix to the lowering keeps serving the old cached containers to `XCL_PER_LANE=1` users, unless someone bumps a version by hand. **Tests** 10. **Refusals become skips.** `programs_on_the_gpu` (`lower_dxil.rs:600-606`) turns any `Err` from the per-lane form into `skip_test`, not only the programs in `DIFFERS_ON_1426`. A change that makes the form refuse the f32/f64/int/f16 programs still passes. An allow-list of the expected refusals would keep the assertion. 11. Not covered: - Every lane_masks test is wave64. Nothing tests: - the wave32 `_B32` paths; - `*_WREXEC`, `v_cmpx`, VOP3 sdst = EXEC, or separate `exec_lo`/`exec_hi` writes; - nested loops or the `step_bounded`/`cond_bounded` fallbacks. - d94736a, 5f78f44 and 1b257c2 add no test. - The CPU `Interp` has no `foreign`, so bridged instructions are only covered by GPU runs. **CONTRIBUTING** 12. **The size waiver.** The description says the size rule is waived "at the maintainer's request (#1269)". The only maintainer text I found is the issue body ("We are open for big PRs aiming to optimize shaders … compiling shaders directly into DXIL"); please link or quote that, so a reviewer can see what the 7,467 lines rest on. 13. **Commits.** - `cf29f8a` says every per-lane GPU test failed on WARP (the CI adapter) before it, so the commits before it don't each pass CI. - Several commits fix earlier ones in the PR: bcb502f fixes 8cb697d, 1c9477a reworks d1f0661, 51f3b82 drops 8cb697d's heap refusal, and c7caa1d fixes this PR's `DxilIr`. - The description says 45 commits; the branch has 49. 14. **AI use.** 43cb32c and 8e0c4a7 carry `Assisted-by: Antigravity (Gemini 4 Neon)`, which the **AI use** section doesn't name. 15. **Not tested.** Both smoke runs are with `XCL_PER_LANE` off and, from the description, without `XCL_DIRECT_DXIL`, so they don't exercise the `kernel.rs` refactor (`Lw::new`/`Lw::finish`) under `XCL_DIRECT_DXIL=1`. Reading it, I think it emits the same DXIL. A byte diff of `xcl shaders --direct --dump` on `6c89285` and on `cf29f8a` would show it, and **Not tested** could say it wasn't run. 16. `XCL_PER_LANE`, `XCL_RECOMP_STAGES` and `XCL_RECOMP_NO_HLSL` aren't documented anywhere, as with `XCL_DIRECT_DXIL` today. **Nits** - `pso.rs:238`: `let id = identity_with(`. - `ssa.rs:150-158` doesn't move `users[phi]` to `users[same]`, so a trivial phi can be left behind. The results are unaffected: a leftover phi over the marker is still refused. - `wave.rs:298-300`: `v_readfirstlane` where no lane has EXEC reads lane 0. - `recomp/dxil/assemble.rs` is called only from its own test. It finds dxil.dll through `GetModuleHandleW`, so it works only once DXC has loaded it. **Checked and fine** - The lane-mask analysis: - the BDD (variable order, memoisation, partial results); - the saveexec/wrexec semantics, including the ANDN1/ANDN2 operand order; - VOPC/VOP3 sdst writes, and separate `exec_lo`/`exec_hi` writes turning EXEC opaque; - irreducible-flow detection, which is complete; - loop atoms not leaking between iterations; - the fallbacks weakening soundly. - SSA: the sealing order, and the one-pass trivial-phi replacement in 1c9477a, which can't form a cycle. - The lowering: - DPP16/DPP8, `v_permlane(x)16`, `ds_swizzle` quad-perm and bitmask modes (rotate mode not checked); - mbcnt, readlane, writelane and their split checks; - the `v_cndmask`/carry-in lane bit (c7caa1d); - coalesced runs, which can't span an EXEC or guard change; stores and atomics under partial EXEC run only in the lanes that have it; - far jumps. - The bridge's register check refuses every unpassed read of VCC, M0, EXEC and SCC. - The `kernel.rs` refactor: by reading, the module calls run in the same order, so the DXIL should be the same. - The fallback: a per-lane error, including a caught panic, goes to #1426's form. - GPU tests skip with `runner::skip_test`; no `#[ignore]`, no game data, no new dependency, no ported code. **AI use:** Claude Code. Three Claude Opus 5.5 subagents reviewed the three parts. Claude Opus 5.5 (the main session) then read the code path of every numbered point itself, at `cf29f8a` and again at `0570037`, and wrote this review; the **Checked and fine** list is from the subagents' reading. Points 5 and 7 are not traced to the end, as they say.
alexmircea1299 commented 2026-11-24 21:09:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by alexmircea1299 on 2026-11-24T20:53:34Z.


Test report on NVIDIA GeForce RTX 5070 (12 GB)

  • PR / Commit: #1745 (**cf29f8a**)
  • Hardware: AMD Ryzen 5 9600X, NVIDIA GeForce RTX 5070 (12 GB VRAM, driver 621.35), 32 GB DDR5 6000MT/s
  • Environment: Windows 11 (build 26300), rustc 1.100.0 (0ef1bc386 2026-11-09), Windows SDK 10.0.26100.0 (debug build)
  • Command: .\scripts\test.ps1 (cargo test --workspace -- --test-threads=4)
  • Results:
    • xcl --lib: 876 passed; 0 failed; 22 ignored (14.76s)
    • Integration tests: 8 passed; 0 failed; 12 ignored (1 + 1 + 6)
    • Total workspace: 884 passed; 0 failed; 34 ignored
  • GPU tests skipped on this adapter:
    • 7 (no wave64)
    • 1 (no heap windows)
    • 1 (f32 rounding, wave64: no wave64)
    • 1 (integer arithmetic, wave64: no wave64)
    • 1 (f64, wave64: no wave64)
    • 1 (integer carries, wave64: no wave64)
    • 1 (f32 three-source, wave64: no wave64)
    • 1 (f32 transcendentals, wave64: no wave64)
    • 1 (f32 conversions, wave64: no wave64)
    • 1 (f16 arithmetic, wave64: no wave64)
    • 1 (f16 packed, wave64: no wave64)
    • 1 (f32 compares, wave64: no wave64)
    • 1 (f32 arithmetic, wave64: no wave64)
    • 1 (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)))
    • 1 (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)))
    • 1 (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)))
  • Not tested: Retail title (smoke.ps1), release build, AMD / native wave64 GPUs.
  • AI use: Google Gemini assisted with running the commands and drafting this report from my real local test run.
<!-- greyfinch-sync:ivall/xcl:comment:7144196009 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7144196009). Originally posted by [alexmircea1299](https://github.com/alexmircea1299) on 2026-11-24T20:53:34Z. --- **Test report on NVIDIA GeForce RTX 5070 (12 GB)** * **PR / Commit:** #1745 (`**cf29f8a**`) * **Hardware:** AMD Ryzen 5 9600X, NVIDIA GeForce RTX 5070 (12 GB VRAM, driver `621.35`), 32 GB DDR5 6000MT/s * **Environment:** Windows 11 (build `26300`), `rustc 1.100.0 (0ef1bc386 2026-11-09)`, Windows SDK `10.0.26100.0` (debug build) * **Command:** `.\scripts\test.ps1` (`cargo test --workspace -- --test-threads=4`) * **Results:** * `xcl --lib`: `876 passed; 0 failed; 22 ignored` (14.76s) * Integration tests: `8 passed; 0 failed; 12 ignored` (1 + 1 + 6) * Total workspace: `884 passed; 0 failed; 34 ignored` * **GPU tests skipped on this adapter:** * `7 (no wave64)` * `1 (no heap windows)` * `1 (f32 rounding, wave64: no wave64)` * `1 (integer arithmetic, wave64: no wave64)` * `1 (f64, wave64: no wave64)` * `1 (integer carries, wave64: no wave64)` * `1 (f32 three-source, wave64: no wave64)` * `1 (f32 transcendentals, wave64: no wave64)` * `1 (f32 conversions, wave64: no wave64)` * `1 (f16 arithmetic, wave64: no wave64)` * `1 (f16 packed, wave64: no wave64)` * `1 (f32 compares, wave64: no wave64)` * `1 (f32 arithmetic, wave64: no wave64)` * `1 (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)))` * `1 (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)))` * `1 (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)))` * **Not tested:** Retail title (`smoke.ps1`), release build, AMD / native wave64 GPUs. * **AI use:** Google Gemini assisted with running the commands and drafting this report from my real local test run.
mgrein commented 2026-11-24 21:09:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mgrein on 2026-11-24T20:54:19Z.


Test report for the head 0570037 (not yet reported on), NVIDIA RTX 4070.

Tested

  • NVIDIA GeForce RTX 4070 12 GB (Ada, 32-lane waves, so the split wave64 tests run for real), driver 617.14; AMD Ryzen 5 5600X; 32 GB RAM; Windows 11 Pro 25H2 (build 26200); Rust 1.94.1 stable-x86_64-pc-windows-msvc, debug; DXC 1.9.2609.5. A clean worktree of 0570037, its own target dir.
  • .\scripts\test.ps1 at 0570037: 927 passed, 0 failed, 42 ignored over the workspace (lib: 878 passed, 0 failed, 22 ignored), two more than the description's 925 / 876 on cf29f8a.
  • SKIPPED (22): 18 "no wave64" (this GPU), 1 "no heap windows", and the 3 per-lane refusals the description names (V_CVT_F16_F32 in f32 conversions, V_MUL_F16 in f16 arithmetic, V_PK_MUL_F16 in f16 packed, wave32 per-lane form).
  • The XCL_SAMPLE_* variables were not set, so the game-data tests did nothing.

Not tested: native wave64; a title run with XCL_PER_LANE=1; --direct --lanes on the pack; release.

AI use: Claude Code (Claude Opus 5.5) ran the suite and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7144212462 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7144212462). Originally posted by [mgrein](https://github.com/mgrein) on 2026-11-24T20:54:19Z. --- Test report for the head `0570037` (not yet reported on), NVIDIA RTX 4070. **Tested** - NVIDIA GeForce RTX 4070 12 GB (Ada, 32-lane waves, so the split wave64 tests run for real), driver 617.14; AMD Ryzen 5 5600X; 32 GB RAM; Windows 11 Pro 25H2 (build 26200); Rust 1.94.1 `stable-x86_64-pc-windows-msvc`, debug; DXC 1.9.2609.5. A clean worktree of `0570037`, its own target dir. - `.\scripts\test.ps1` at `0570037`: **927 passed, 0 failed, 42 ignored** over the workspace (lib: 878 passed, 0 failed, 22 ignored), two more than the description's 925 / 876 on `cf29f8a`. - SKIPPED (22): 18 "no wave64" (this GPU), 1 "no heap windows", and the 3 per-lane refusals the description names (`V_CVT_F16_F32` in f32 conversions, `V_MUL_F16` in f16 arithmetic, `V_PK_MUL_F16` in f16 packed, wave32 per-lane form). - The `XCL_SAMPLE_*` variables were not set, so the game-data tests did nothing. **Not tested:** native wave64; a title run with `XCL_PER_LANE=1`; `--direct --lanes` on the pack; release. **AI use:** Claude Code (Claude Opus 5.5) ran the suite and wrote this report.
Kalmarv commented 2026-11-24 21:09:45 +00:00 (Migrated from github.com)

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


Test report and review, on an RTX 5070 Ti (32-lane waves only). The suite passes on 43cb32c and on the current head cf29f8a, and a 60 s title pair with XCL_PER_LANE=1 is clean. Reading the per-lane parts gave two cases where the per-lane form takes a program and gives other results than the HLSL path (review points 1 and 2, each with small programs run here), and one wrong label in the summary line.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, 32-lane waves only), AMD Ryzen 9 9950X, Windows 11 Pro 26200; Rust 1.99.0 MSVC, debug; DXC 1.9.2609 (XCL_DXC_DIR); a private XCL_DXIL_CACHE, new for the first run and kept for the second.
  • cargo test --workspace -- --test-threads=4, clean trees, once per commit:
commit passed failed ignored SKIPPED lines
43cb32c 925 0 42 22
cf29f8a 925 0 42 22 (the same lines)
  • SKIPPED, 22 lines: 18 no wave64, 3 per-lane halves refused on purpose (V_CVT_F16_F32, V_MUL_F16, V_PK_MUL_F16), 1 no heap windows. The description counts 25 with 21 no wave64; the RTX 5070 report above has the same 22 as here.
the 22 lines
SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::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))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::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))
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: f64, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64
SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
  • Which tests ran per-lane DXIL on this GPU (all passed):
    • wave32: a_bridged_instruction_may_write_to_the_entry_block, per_lane_kernels_run_on_the_gpu (9 programs), a_per_lane_compute_program_runs_on_the_gpu, a_per_lane_program_with_four_memory_windows_runs_on_the_gpu, the wave32 shapes of a_per_lane_2d_or_3d_group_runs_on_the_gpu, the wave32 part of coalesced_foreign_runs_agree_on_the_gpu, and the wave32 halves of integer_programs_on_the_gpu (2 of 2), f32_programs_on_the_gpu (5 of 6) and f64_programs_on_the_gpu (1 of 1).
    • split wave64 (two 32-lane hardware waves, for real here): lower::tests::the_split_form_agrees_with_the_wave64_lowering_on_the_gpu, the_runtime_path_takes_the_split_form, and the (wave64, split) part of coalesced_foreign_runs_agree_on_the_gpu.
    • f16_programs_on_the_gpu passes without running any per-lane DXIL here: both wave32 halves are refused and both wave64 halves skip.
    • No native wave64 half ran. programs_on_the_gpu does not try the split form, so in the suite the f32 / f64 / integer programs never run as wave64 on a 32-lane GPU.
  • To cover that gap, one local test (not in the PR): the same programs through lower_dxil::kernel_split against the HLSL path's split form (Options { wave64: true, split_wave64: true }), every SGPR and VGPR the program names in all 64 lanes, f32_close where the suite uses it. All 8 programs the per-lane form takes agree: f32 arithmetic, compares, rounding, transcendentals, three-source; f64; integer arithmetic, carries. The other 3 are the same refusals as in wave32.
  • Title pair, 60 s each, XCL_DIRECT_DXIL=1 XCL_PER_LANE=1 on both sides (XCL_DIRECT_DXIL_STATS=1 for the summary line), 43cb32c against its merge-base with main:

main:

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

This PR (43cb32c):

xcl-smoke v1
commit: 43cb32c04fe9d69caad38893467c2f6eff8bfc98
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1228 (PresentX 1228)
presents per 2 s (last 3): 1 7 5
device removals: 0
crashes: 0
peak commit: 25176 MB
  • The per-lane path was taken. Summary at 60 s on the PR side: CS direct 102 / HLSL fallback 0; CS per-lane direct 29 / HLSL fallback 73;. So 29 of 102 compute programs ran in the per-lane form and 73 were refused and went to #1426's per-instruction form (73 [SHADER] per-lane fallback ... – per-instruction form lines). None went to the HLSL path; see point 3 for the label. main side: CS direct 99 / HLSL fallback 0;.
  • Top refusal reasons of the 73:
count reason
17 a value written while some lanes were elsewhere, read after they met again
9 EXEC as a number in the split form where some lanes are elsewhere
8 unsupported IMAGE_LOAD (it reads register N the per-lane form did not pass)
5 unsupported IMAGE_SAMPLE_L (it reads register N the per-lane form did not pass)
3 mask source code N

Review (the per-lane parts; line numbers at cf29f8a)

  1. A branch or select on "any lane" of a mask is taken lane by lane, also where the lanes without the bit are still in EXEC. lane_masks::cond (lane_masks.rs:604) treats s_cbranch_vccz / vccnz and a branch on the SCC of a mask op as each lane's own bit, and Lower::cond (lower.rs:971) branches on it; S_CSELECT_B32 (lower.rs:624) selects on the same per-lane SCC. On the console these test the whole wave, and every lane goes the same way. The module doc says so as an assumption (lane_masks.rs:17, "it jumps over work that inactive lanes would not change anyway, or it tests a uniform value"), but nothing checks it, so a program outside it is taken and not refused. Shown with wave32 kernel programs that start with v_cmp_gt_u32 vcc, 16, v0 (VCC = lanes 0–15, EXEC = all 32) and write v1 on the fall-through, per-lane DXIL (lower_dxil::kernel) against the HLSL path on the GPU:
program after the compare HLSL path, v1 in lane 16 per-lane form, v1 in lane 16
s_and_b32 s0, vcc, exec; s_cbranch_scc1 L; v_mov_b32 v1, 7; L: 0 7
s_cbranch_vccnz L; v_mov_b32 v1, 7; L: 0 7
s_cbranch_vccz L; v_mov_b32 v1, 7; L: 7 0
s_cmp_lg_u32 vcc, 0; s_cbranch_scc1 L; v_mov_b32 v1, 7; L: 0 7
s_and_b32 s0, vcc, exec; s_cselect_b32 s1, 5, 7; v_mov_b32 v1, s1 5 7
control: SKIPPED_IF (s_and_saveexec, s_cbranch_execz) agrees agrees

In each of the first five rows the two paths differ in all of lanes 16–31 and agree in lanes 0–15 (the HLSL path has the same v1 in lanes 0 and 31). A branch on "any lane" is what if (WaveActiveAnyTrue(x)) or an early-out on "no lane needs this" asks for. Checked on the pack sweep since: of the 321 compute programs the per-lane form takes, 166 have a lane branch, and a local analysis pass (is there a lane here, in EXEC, without the bit?) marks 7 branches in 5 of them, all s_and_b64 vcc, exec, <mask>; s_cbranch_vccnz; no branch on the SCC of another mask op and no s_cselect on one. Read by hand, all 7 test a value that is the same in every active lane (the compiler's uniform branch), so none of the 321 gives other results through this. The point stands as an unchecked assumption, not as a wrong result in this pack. Not checked: the 29 programs of the title run on their own.

  1. A non-default rounding mode is dropped where #1426 and the HLSL path refuse the program. This may be what @erickbobd's MODE guard (asked for on #1269) already covers; we haven't checked their branch. If it covers only s_setreg, the second way in below needs its own check. Two ways in:

    • lower.rs:720 takes every s_setreg* of MODE as a no-op. Its comment (lower.rs:718) says the lowering refuses every float instruction, which was true before the bridge; float instructions now go through Ir::foreign.
    • s_round_mode goes through the bridge to #1426's Lw::sopp (gpu/dxil/lower.rs:955), which refuses a non-default f32 mode but decides f64 and f16 from has_f64_round_op and dyn_rm. Lw::new leaves both false (gpu/dxil/kernel.rs:314), and only translate_on_this_thread sets them (kernel.rs:183), which the per-lane form does not go through.

    Shown with wave32 kernel programs, a sum of 1 + lane ulp and 0.75 ulp, on the GPU (lane 0):

program HLSL path #1426 form per-lane form
s_setreg_imm32_b32 hwreg(MODE, 0, 2), 3; v_add_f32 refused: non-default f32 round mode refused: the same taken: 0x3F800001 (to nearest; toward zero is 0x3F800000)
s_round_mode 0xC; v_add_f64 refused: non-default f64 round mode refused: the same taken: low dword 1 (to nearest; toward zero is 0)
s_setreg_imm32_b32 hwreg(MODE, 2, 2), 3; v_add_f64 refused: non-default f64 round mode refused: the same taken: low dword 1
s_round_mode 0x3; v_add_f32 refused refused refused (through the bridge)
the two sums without a mode write 0x3F800001; 1 the same the same

The f16 side (dyn_rm, s_round_mode 0xC with an f16 instruction, which recomp/tests.rs:6627 calls the retail pattern) is from reading only: a run here cannot show it, because an f16 sum comes out rounded toward zero on this driver on all three paths, with or without the mode write.

  1. The summary calls the per-lane refusals "HLSL fallback". pso.rs:617 records a refusal under the stage CS per-lane and goes on to translate_compute (pso.rs:622), and coverage::fallback_summary prints every stage as direct N / HLSL fallback M (gpu/dxil/coverage.rs:317). In the title run above, CS per-lane direct 29 / HLSL fallback 73 are 73 programs in the per-instruction form; CS direct 102 / HLSL fallback 0 is the line that counts the HLSL path. Label only.

The three local tests behind this (split-form programs, the branch programs, the rounding programs; they print, they don't assert) are about 230 lines on cf29f8a; say if you want them as a follow-up PR or a patch here.

Not tested

  • Native wave64 (every wave64 half skips here), AMD and Intel GPUs, a release build of the suite.
  • The title beyond 60 s, and the pictures: the pair counts frames, crashes and device removals only. cf29f8a in the title (it changes test code only).
  • xcl shaders --direct --lanes (the pack sweep), DXC and driver times.
  • VS / PS and mesh in the per-lane form.
  • The refactor of gpu/dxil/kernel.rs (Lw::new / Lw::finish): its output was not compared with main's, and of its diff only Lw::new was read.
  • Read for the review: lower_dxil.rs, ssa.rs, lower/wave.rs, the pso.rs and module.rs diffs, and of lower.rs the scalar, vector and memory instructions, the branches, the stale check, the bridge and the block driver. Not read: assemble.rs, shaders.rs, the VS / PS parts and the tests of lower.rs; lane_masks.rs only where point 1 needed it.

AI use: Claude Code (Claude Fable 5.2) ran the tests, read the diff and drafted this. Claude Code (Claude Opus 5.5) reviewed it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7143855041 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7143855041). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T20:38:23Z. --- Test report and review, on an RTX 5070 Ti (32-lane waves only). The suite passes on `43cb32c` and on the current head `cf29f8a`, and a 60 s title pair with `XCL_PER_LANE=1` is clean. Reading the per-lane parts gave two cases where the per-lane form takes a program and gives other results than the HLSL path (review points 1 and 2, each with small programs run here), and one wrong label in the summary line. **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, 32-lane waves only), AMD Ryzen 9 9950X, Windows 11 Pro 26200; Rust 1.99.0 MSVC, debug; DXC 1.9.2609 (`XCL_DXC_DIR`); a private `XCL_DXIL_CACHE`, new for the first run and kept for the second. - `cargo test --workspace -- --test-threads=4`, clean trees, once per commit: | commit | passed | failed | ignored | SKIPPED lines | |---|---|---|---|---| | `43cb32c` | 925 | 0 | 42 | 22 | | `cf29f8a` | 925 | 0 | 42 | 22 (the same lines) | - SKIPPED, 22 lines: 18 `no wave64`, 3 per-lane halves refused on purpose (`V_CVT_F16_F32`, `V_MUL_F16`, `V_PK_MUL_F16`), 1 `no heap windows`. The description counts 25 with 21 `no wave64`; the RTX 5070 report above has the same 22 as here. <details><summary>the 22 lines</summary> ``` SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)) SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::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)) SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::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)) SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: f64, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64 SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64 SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64 SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows ``` </details> - Which tests ran per-lane DXIL on this GPU (all passed): - wave32: `a_bridged_instruction_may_write_to_the_entry_block`, `per_lane_kernels_run_on_the_gpu` (9 programs), `a_per_lane_compute_program_runs_on_the_gpu`, `a_per_lane_program_with_four_memory_windows_runs_on_the_gpu`, the wave32 shapes of `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, the wave32 part of `coalesced_foreign_runs_agree_on_the_gpu`, and the wave32 halves of `integer_programs_on_the_gpu` (2 of 2), `f32_programs_on_the_gpu` (5 of 6) and `f64_programs_on_the_gpu` (1 of 1). - split wave64 (two 32-lane hardware waves, for real here): `lower::tests::the_split_form_agrees_with_the_wave64_lowering_on_the_gpu`, `the_runtime_path_takes_the_split_form`, and the `(wave64, split)` part of `coalesced_foreign_runs_agree_on_the_gpu`. - `f16_programs_on_the_gpu` passes without running any per-lane DXIL here: both wave32 halves are refused and both wave64 halves skip. - No native wave64 half ran. `programs_on_the_gpu` does not try the split form, so in the suite the f32 / f64 / integer programs never run as wave64 on a 32-lane GPU. - To cover that gap, one local test (not in the PR): the same programs through `lower_dxil::kernel_split` against the HLSL path's split form (`Options { wave64: true, split_wave64: true }`), every SGPR and VGPR the program names in all 64 lanes, `f32_close` where the suite uses it. All 8 programs the per-lane form takes agree: f32 arithmetic, compares, rounding, transcendentals, three-source; f64; integer arithmetic, carries. The other 3 are the same refusals as in wave32. - Title pair, 60 s each, `XCL_DIRECT_DXIL=1 XCL_PER_LANE=1` on both sides (`XCL_DIRECT_DXIL_STATS=1` for the summary line), `43cb32c` against its merge-base with `main`: `main`: ``` xcl-smoke v1 commit: 6c89285b8b529bde59cd17a26b911c39912fb677 gpu: NVIDIA GeForce RTX 5070 Ti title: GTA VI seconds: 60 exit: 0x0 frames shown: 1193 (PresentX 1193) presents per 2 s (last 3): 0 4 2 device removals: 0 crashes: 0 peak commit: 24075 MB ``` This PR (`43cb32c`): ``` xcl-smoke v1 commit: 43cb32c04fe9d69caad38893467c2f6eff8bfc98 gpu: NVIDIA GeForce RTX 5070 Ti title: GTA VI seconds: 60 exit: 0x0 frames shown: 1228 (PresentX 1228) presents per 2 s (last 3): 1 7 5 device removals: 0 crashes: 0 peak commit: 25176 MB ``` - The per-lane path was taken. Summary at 60 s on the PR side: `CS direct 102 / HLSL fallback 0; CS per-lane direct 29 / HLSL fallback 73;`. So 29 of 102 compute programs ran in the per-lane form and 73 were refused and went to #1426's per-instruction form (73 `[SHADER] per-lane fallback ... – per-instruction form` lines). None went to the HLSL path; see point 3 for the label. `main` side: `CS direct 99 / HLSL fallback 0;`. - Top refusal reasons of the 73: | count | reason | |---|---| | 17 | a value written while some lanes were elsewhere, read after they met again | | 9 | EXEC as a number in the split form where some lanes are elsewhere | | 8 | unsupported IMAGE_LOAD (it reads register N the per-lane form did not pass) | | 5 | unsupported IMAGE_SAMPLE_L (it reads register N the per-lane form did not pass) | | 3 | mask source code N | **Review** (the per-lane parts; line numbers at `cf29f8a`) 1. **A branch or select on "any lane" of a mask is taken lane by lane, also where the lanes without the bit are still in EXEC.** `lane_masks::cond` (`lane_masks.rs:604`) treats `s_cbranch_vccz` / `vccnz` and a branch on the SCC of a mask op as each lane's own bit, and `Lower::cond` (`lower.rs:971`) branches on it; `S_CSELECT_B32` (`lower.rs:624`) selects on the same per-lane SCC. On the console these test the whole wave, and every lane goes the same way. The module doc says so as an assumption (`lane_masks.rs:17`, "it jumps over work that inactive lanes would not change anyway, or it tests a uniform value"), but nothing checks it, so a program outside it is taken and not refused. Shown with wave32 kernel programs that start with `v_cmp_gt_u32 vcc, 16, v0` (VCC = lanes 0–15, EXEC = all 32) and write `v1` on the fall-through, per-lane DXIL (`lower_dxil::kernel`) against the HLSL path on the GPU: | program after the compare | HLSL path, `v1` in lane 16 | per-lane form, `v1` in lane 16 | |---|---|---| | `s_and_b32 s0, vcc, exec; s_cbranch_scc1 L; v_mov_b32 v1, 7; L:` | 0 | 7 | | `s_cbranch_vccnz L; v_mov_b32 v1, 7; L:` | 0 | 7 | | `s_cbranch_vccz L; v_mov_b32 v1, 7; L:` | 7 | 0 | | `s_cmp_lg_u32 vcc, 0; s_cbranch_scc1 L; v_mov_b32 v1, 7; L:` | 0 | 7 | | `s_and_b32 s0, vcc, exec; s_cselect_b32 s1, 5, 7; v_mov_b32 v1, s1` | 5 | 7 | | control: `SKIPPED_IF` (`s_and_saveexec`, `s_cbranch_execz`) | agrees | agrees | In each of the first five rows the two paths differ in all of lanes 16–31 and agree in lanes 0–15 (the HLSL path has the same `v1` in lanes 0 and 31). A branch on "any lane" is what `if (WaveActiveAnyTrue(x))` or an early-out on "no lane needs this" asks for. Checked on the pack sweep since: of the 321 compute programs the per-lane form takes, 166 have a lane branch, and a local analysis pass (is there a lane here, in EXEC, without the bit?) marks 7 branches in 5 of them, all `s_and_b64 vcc, exec, <mask>; s_cbranch_vccnz`; no branch on the SCC of another mask op and no `s_cselect` on one. Read by hand, all 7 test a value that is the same in every active lane (the compiler's uniform branch), so none of the 321 gives other results through this. The point stands as an unchecked assumption, not as a wrong result in this pack. Not checked: the 29 programs of the title run on their own. 2. **A non-default rounding mode is dropped where #1426 and the HLSL path refuse the program.** This may be what @erickbobd's MODE guard (asked for on #1269) already covers; we haven't checked their branch. If it covers only `s_setreg`, the second way in below needs its own check. Two ways in: - `lower.rs:720` takes every `s_setreg*` of MODE as a no-op. Its comment (`lower.rs:718`) says the lowering refuses every float instruction, which was true before the bridge; float instructions now go through `Ir::foreign`. - `s_round_mode` goes through the bridge to #1426's `Lw::sopp` (`gpu/dxil/lower.rs:955`), which refuses a non-default f32 mode but decides f64 and f16 from `has_f64_round_op` and `dyn_rm`. `Lw::new` leaves both `false` (`gpu/dxil/kernel.rs:314`), and only `translate_on_this_thread` sets them (`kernel.rs:183`), which the per-lane form does not go through. Shown with wave32 kernel programs, a sum of `1 + lane ulp` and `0.75 ulp`, on the GPU (lane 0): | program | HLSL path | #1426 form | per-lane form | |---|---|---|---| | `s_setreg_imm32_b32 hwreg(MODE, 0, 2), 3; v_add_f32` | refused: non-default f32 round mode | refused: the same | taken: `0x3F800001` (to nearest; toward zero is `0x3F800000`) | | `s_round_mode 0xC; v_add_f64` | refused: non-default f64 round mode | refused: the same | taken: low dword 1 (to nearest; toward zero is 0) | | `s_setreg_imm32_b32 hwreg(MODE, 2, 2), 3; v_add_f64` | refused: non-default f64 round mode | refused: the same | taken: low dword 1 | | `s_round_mode 0x3; v_add_f32` | refused | refused | refused (through the bridge) | | the two sums without a mode write | `0x3F800001`; 1 | the same | the same | The f16 side (`dyn_rm`, `s_round_mode 0xC` with an f16 instruction, which `recomp/tests.rs:6627` calls the retail pattern) is from reading only: a run here cannot show it, because an f16 sum comes out rounded toward zero on this driver on all three paths, with or without the mode write. 3. **The summary calls the per-lane refusals "HLSL fallback".** `pso.rs:617` records a refusal under the stage `CS per-lane` and goes on to `translate_compute` (`pso.rs:622`), and `coverage::fallback_summary` prints every stage as `direct N / HLSL fallback M` (`gpu/dxil/coverage.rs:317`). In the title run above, `CS per-lane direct 29 / HLSL fallback 73` are 73 programs in the per-instruction form; `CS direct 102 / HLSL fallback 0` is the line that counts the HLSL path. Label only. The three local tests behind this (split-form programs, the branch programs, the rounding programs; they print, they don't assert) are about 230 lines on `cf29f8a`; say if you want them as a follow-up PR or a patch here. **Not tested** - Native wave64 (every wave64 half skips here), AMD and Intel GPUs, a release build of the suite. - The title beyond 60 s, and the pictures: the pair counts frames, crashes and device removals only. `cf29f8a` in the title (it changes test code only). - `xcl shaders --direct --lanes` (the pack sweep), DXC and driver times. - VS / PS and mesh in the per-lane form. - The refactor of `gpu/dxil/kernel.rs` (`Lw::new` / `Lw::finish`): its output was not compared with `main`'s, and of its diff only `Lw::new` was read. - Read for the review: `lower_dxil.rs`, `ssa.rs`, `lower/wave.rs`, the `pso.rs` and `module.rs` diffs, and of `lower.rs` the scalar, vector and memory instructions, the branches, the stale check, the bridge and the block driver. Not read: `assemble.rs`, `shaders.rs`, the VS / PS parts and the tests of `lower.rs`; `lane_masks.rs` only where point 1 needed it. **AI use:** Claude Code (Claude Fable 5.2) ran the tests, read the diff and drafted this. Claude Code (Claude Opus 5.5) reviewed it before posting.
thehollowedone commented 2026-11-24 21:09:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-24T20:55:19Z.


Retest on bfb8133d

Confirmed the loop SCC fix on the same RTX 3080 Ti setup. The per-lane compiler now refuses the original loop at the scalar select. I dispatched the same shader separately through per-instruction direct DXIL and HLSL. Each returned 5 in all 32 lanes. In a control that set the loop condition with a uniform scalar compare, per-lane DXIL still compiled and returned 5 in all 32 lanes.

Using cargo test --offline --locked -p xcl --lib <filter> -- --nocapture --test-threads=1, the stock gpu::recomp::lower::tests:: suite reported 34 passed, 0 failed, 0 ignored, with four native-wave64 subcases skipped. The added scratch_wave32_loop_refusal_and_reference_readback fixture passed 1/1 with zero skips. This checks kernel compilation and readback. Retail and runtime routing were outside the test.

Tested

On 0570037d, a synthetic two-iteration wave32 loop gave different GPU readbacks. HLSL returned v1 = 5 in all 32 lanes. Per-lane DXIL returned 5 in lanes 0–15 and 7 in lanes 16–31. Both dispatched successfully. This exercises a mask-derived SCC reaching the next iteration's scalar select, with both mask operands known.

Initialize EXEC to all 32 lanes and v0 to the lane index.

s_mov_b32 s4, 2
v_cmp_gt_u32 vcc_lo, 16, v0
s_cmp_gt_u32 1, 0
loop:
s_cselect_b32 s1, 5, 7
v_mov_b32 v1, s1
s_sub_u32 s4, s4, 1
s_cmp_eq_u32 s4, 0
s_cbranch_scc1 done
s_and_b32 s0, vcc_lo, exec_lo
s_branch loop
done:
s_endpgm

RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11. cargo test --offline --locked -p xcl --lib scratch_loop_carried_scc -- --test-threads=1 --nocapture ran one added fixture with zero skips and failed at the direct DXIL vs. HLSL comparison. The HLSL readback passed the all-5 assertion. The fixture uses the existing kernel runners.

Not tested

This fixture covers wave32 kernel lowering. Retail behavior, native wave64 and runtime fallback were outside the run.

AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the fixture and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7144234666 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7144234666). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-24T20:55:19Z. --- **Retest on [`bfb8133d`](https://github.com/xcl-dev/xcl/commit/bfb8133d36df38c3de381f9d99203568b32aa765)** Confirmed [the loop SCC fix](https://github.com/xcl-dev/xcl/commit/9dcf2f6916436aad162069127c8e68586862cc3b) on the same RTX 3080 Ti setup. The per-lane compiler now refuses the original loop at the scalar select. I dispatched the same shader separately through per-instruction direct DXIL and HLSL. Each returned `5` in all 32 lanes. In a control that set the loop condition with a uniform scalar compare, per-lane DXIL still compiled and returned `5` in all 32 lanes. Using `cargo test --offline --locked -p xcl --lib <filter> -- --nocapture --test-threads=1`, the stock `gpu::recomp::lower::tests::` suite reported 34 passed, 0 failed, 0 ignored, with four native-wave64 subcases skipped. The added `scratch_wave32_loop_refusal_and_reference_readback` fixture passed 1/1 with zero skips. This checks kernel compilation and readback. Retail and runtime routing were outside the test. **Tested** On [`0570037d`](https://github.com/xcl-dev/xcl/commit/0570037d0247978205e786057cadbdc85dded0ca), a synthetic two-iteration wave32 loop gave different GPU readbacks. HLSL returned `v1 = 5` in all 32 lanes. Per-lane DXIL returned `5` in lanes 0–15 and `7` in lanes 16–31. Both dispatched successfully. This exercises a mask-derived SCC reaching the next iteration's scalar select, with both mask operands known. Initialize `EXEC` to all 32 lanes and `v0` to the lane index. ```asm s_mov_b32 s4, 2 v_cmp_gt_u32 vcc_lo, 16, v0 s_cmp_gt_u32 1, 0 loop: s_cselect_b32 s1, 5, 7 v_mov_b32 v1, s1 s_sub_u32 s4, s4, 1 s_cmp_eq_u32 s4, 0 s_cbranch_scc1 done s_and_b32 s0, vcc_lo, exec_lo s_branch loop done: s_endpgm ``` RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11. `cargo test --offline --locked -p xcl --lib scratch_loop_carried_scc -- --test-threads=1 --nocapture` ran one added fixture with zero skips and failed at the direct DXIL vs. HLSL comparison. The HLSL readback passed the all-5 assertion. The fixture uses the existing kernel runners. **Not tested** This fixture covers wave32 kernel lowering. Retail behavior, native wave64 and runtime fallback were outside the run. AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the fixture and drafted this report.
gefydev commented 2026-11-24 21:09:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-24T20:56:51Z.


@thehollowedone thank you for the fixture and the readbacks on 0570037 (HLSL all 5, per-lane 5 in lanes 0-15 and 7 in lanes 16-31). Received. It looks like the same area as the SCC-from-a-mask review point above (the form treats the SCC as per lane where the check does not see it); I have passed your program to the session that writes the code and will answer here once there is a decision. I am not promising a fix yet.

AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.

<!-- greyfinch-sync:ivall/xcl:comment:7144269595 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7144269595). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-24T20:56:51Z. --- @thehollowedone thank you for the fixture and the readbacks on `0570037` (HLSL all 5, per-lane 5 in lanes 0-15 and 7 in lanes 16-31). Received. It looks like the same area as the SCC-from-a-mask review point above (the form treats the SCC as per lane where the check does not see it); I have passed your program to the session that writes the code and will answer here once there is a decision. I am not promising a fix yet. AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
moombathepilot commented 2026-11-24 21:09:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by moombathepilot on 2026-11-24T20:57:16Z.


RX 7800 XT review of #1745

I reviewed the shader sweep's validation and size reporting and ran the tests below on clean head 0570037d0247978205e786057cadbdc85dded0ca. Both test commands exited successfully.

Review findings

  1. Separate successful translations from paired size totals. If per-lane translation succeeds but the per-instruction run returns an error or times out, the sweep adds the per-lane byte count and adds zero for the other side. The printed size totals then compare different sets of shaders. Keep counting all successful per-lane translations for coverage, but add to both size totals only when both paths succeed and print the paired count. This is a conditional accounting issue found in the code. I did not verify that it affected the posted whole-pack numbers.
  2. Apply --validate to the per-lane output in release sweeps. --validate reaches the per-instruction translator, but the per-lane call doesn't use it. The validator in Lw::finish runs only in debug or test builds. A release --direct --lanes --validate sweep can therefore count per-lane output without passing it through the DXIL validator. Could the sweep validate both paths when the flag is set, or label which path it validates?

Tested

RX 7800 XT (RDNA3), driver 32.0.32029.2010, Ryzen 7 5700X3D, Windows build 26300.9974, Rust 1.100.0 MSVC, SDK DXC/DXIL 1.9.2602.17, debug. No source changes.

Run Passed Failed Ignored Explicit skips included in passing results
scripts/test.ps1 --test-threads=4, flags unset 927 0 42 7 skip messages
cargo test --locked -p xcl --lib -- gpu::recomp::lower --test-threads=1 --nocapture, with XCL_DIRECT_DXIL=1 and XCL_PER_LANE=1 46 0 0 6 skip messages

Both runs logged the six documented f16 cases (arithmetic, packed multiply and conversion on wave32 and wave64). The full suite also skipped heap_window_out_of_memory_falls_back_to_the_switch_form because heap windows were unavailable. The focused set includes the split-path and four-memory-window GPU tests, which passed.

Not tested

Retail startup on this PR, a release shader sweep, the whole-pack size result, compile speed, or opt-in game-data tests (XCL_SAMPLE_* unset). The two reporting findings were verified by reading the source and are separate from the passing debug tests.

AI use

Codex (GPT-6.2-sol) reviewed the relevant code, ran the tests on this PC, and drafted this report from the results.

<!-- greyfinch-sync:ivall/xcl:comment:7144278744 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7144278744). Originally posted by [moombathepilot](https://github.com/moombathepilot) on 2026-11-24T20:57:16Z. --- ### RX 7800 XT review of #1745 I reviewed the shader sweep's validation and size reporting and ran the tests below on clean head `0570037d0247978205e786057cadbdc85dded0ca`. Both test commands exited successfully. ### Review findings 1. [Separate successful translations from paired size totals](https://github.com/xcl-dev/xcl/blob/0570037d0247978205e786057cadbdc85dded0ca/crates/xcl/src/shaders.rs#L1580-L1586). If per-lane translation succeeds but the per-instruction run returns an error or times out, the sweep adds the per-lane byte count and adds zero for the other side. The printed size totals then compare different sets of shaders. Keep counting all successful per-lane translations for coverage, but add to both size totals only when both paths succeed and print the paired count. This is a conditional accounting issue found in the code. I did not verify that it affected the posted whole-pack numbers. 2. [Apply `--validate` to the per-lane output in release sweeps](https://github.com/xcl-dev/xcl/blob/0570037d0247978205e786057cadbdc85dded0ca/crates/xcl/src/shaders.rs#L1563-L1584). `--validate` reaches the per-instruction translator, but the per-lane call doesn't use it. [The validator in `Lw::finish`](https://github.com/xcl-dev/xcl/blob/0570037d0247978205e786057cadbdc85dded0ca/crates/xcl/src/gpu/dxil/kernel.rs#L399-L410) runs only in debug or test builds. A release `--direct --lanes --validate` sweep can therefore count per-lane output without passing it through the DXIL validator. Could the sweep validate both paths when the flag is set, or label which path it validates? ### Tested RX 7800 XT (RDNA3), driver `32.0.32029.2010`, Ryzen 7 5700X3D, Windows build `26300.9974`, Rust `1.100.0` MSVC, SDK DXC/DXIL `1.9.2602.17`, debug. No source changes. | Run | Passed | Failed | Ignored | Explicit skips included in passing results | | --- | ---: | ---: | ---: | --- | | `scripts/test.ps1 --test-threads=4`, flags unset | 927 | 0 | 42 | 7 skip messages | | `cargo test --locked -p xcl --lib -- gpu::recomp::lower --test-threads=1 --nocapture`, with `XCL_DIRECT_DXIL=1` and `XCL_PER_LANE=1` | 46 | 0 | 0 | 6 skip messages | Both runs logged the six documented f16 cases (arithmetic, packed multiply and conversion on wave32 and wave64). The full suite also skipped `heap_window_out_of_memory_falls_back_to_the_switch_form` because heap windows were unavailable. The focused set includes the split-path and four-memory-window GPU tests, which passed. ### Not tested Retail startup on this PR, a release shader sweep, the whole-pack size result, compile speed, or opt-in game-data tests (`XCL_SAMPLE_*` unset). The two reporting findings were verified by reading the source and are separate from the passing debug tests. ### AI use Codex (GPT-6.2-sol) reviewed the relevant code, ran the tests on this PC, and drafted this report from the results.
gefydev commented 2026-11-24 21:09:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-24T20:58:04Z.


@moombathepilot thank you for the RX 7800 XT report on 0570037 (927 passed, 0 failed, 42 ignored; 46 passed with XCL_DIRECT_DXIL=1 XCL_PER_LANE=1, six documented f16 skips) and for the two review points on the sweep (paired size totals, --validate for the per-lane output). Received and passed to the session that writes the code; I will answer here once there is a decision. I am not promising a change yet.

AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.

<!-- greyfinch-sync:ivall/xcl:comment:7144296497 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7144296497). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-24T20:58:04Z. --- @moombathepilot thank you for the RX 7800 XT report on `0570037` (927 passed, 0 failed, 42 ignored; 46 passed with `XCL_DIRECT_DXIL=1 XCL_PER_LANE=1`, six documented f16 skips) and for the two review points on the sweep (paired size totals, `--validate` for the per-lane output). Received and passed to the session that writes the code; I will answer here once there is a decision. I am not promising a change yet. AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
vitor127wt commented 2026-11-24 21:09:49 +00:00 (Migrated from github.com)

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


RTX 5070 Ti / Proton — per-lane retail run on 0570037

With XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PER_LANE=1, the 150 s run on 0570037d0247978205e786057cadbdc85dded0ca translated 10 of 24 compute shaders per lane. The other 14 used per-instruction direct DXIL. Eleven per-lane refusals logged the new whole-wave mask branch rule, two logged numeric EXEC in the split form, and one logged an IMAGE_LOAD register restriction. There were zero HLSL fallbacks.

The earlier 150 s run on cf29f8a6a7e4e64cfaf17dd929e5334a7d5cf193 also routed 10 shaders per lane and 14 per instruction. All 24 translated compute cache keys and their DXIL bytes matched across the two revisions. Earlier 60 s runs on 6c89285 and cf29f8a with per-lane off showed 1,236 and 1,235 frames, respectively. Enabling per-lane on cf29f8a in the 60 s run sent all three startup compute shaders through the per-instruction path. All three runs produced byte-identical compute DXIL.

Tested

  • RTX 5070 Ti 16 GB, NVIDIA 620.73.04, Ryzen 7 9700X, 32 GB DDR5, CachyOS 7.3.5-2-cachyos, Proton Experimental 11.0 (experimental-11.0-20261112-x86_64). vkd3d-proton ec207194 with the #257 patch, dxil-spirv 7c048638, and DXC 1.9.2609.5. Clean x64 Windows release builds using Rust 1.100.0 and LLVM-MinGW 20261117 (x86_64-pc-windows-gnullvm).
  • Built with cargo build --locked --release --target x86_64-pc-windows-gnullvm -p xcl --bin xcl. Ran scripts/linux/smoke.sh "$PROTON" "$PREFIX" "$GAME" 150 from #257 for the longer runs. Each run used the same retail title, a separate fresh Wine prefix and shader cache, networking off, and A presses scheduled every three seconds. XCL PSO cache blobs and vkd3d-proton/NVIDIA disk shader caches were disabled. Both used XCL_DXC_THREADS=2, XCL_PSO_TRACE=1, and XCL_DIRECT_DXIL_STATS=1. The smoke scope was capped at 16 GiB RAM with no swap.
  • Built the library tests with cargo test --locked --release --target x86_64-pc-windows-gnullvm -p xcl --lib --no-run. Ran the Windows test binary in Proton Wine with the filters gpu::recomp::lower_dxil::tests:: and a_whole_wave_decision_on_a_mask_some_lanes_lack_is_refused, --test-threads=1 --nocapture. The updated head returned 13 passed, 0 failed, 0 ignored. This includes the whole-wave mask and rounding-mode regression tests. The run logged 15 skipped subcases (12 requiring native wave64 and three intentionally refused f16 cases). The split wave64 and four-memory-window GPU tests ran.

150 s smoke on 0570037

xcl-smoke v1
commit: 0570037d0247978205e786057cadbdc85dded0ca
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA6.Xbox.v1.0.2.1
seconds: 150
exit: 0x0
frames shown: 1830 (PresentX 1830)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 0 MB

The Wine smoke script generated the block. I abbreviated the local folder name in title. The last two-second bin with presents ended at 94.1 s. Wine reported 0 MB in the Windows peak-commit field. Linux cgroup peak was 15.07 GiB, with no OOM kill. Coverage is the retail loading interval on Proton and the focused suite.

AI use — OpenAI Codex (GPT-6, exact variant unavailable) built and ran the checks, verified the logs, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7144314537 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7144314537). Originally posted by [vitor127wt](https://github.com/vitor127wt) on 2026-11-24T20:58:52Z. --- **RTX 5070 Ti / Proton — per-lane retail run on `0570037`** With `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PER_LANE=1`, the 150 s run on `0570037d0247978205e786057cadbdc85dded0ca` translated **10 of 24 compute shaders per lane**. The other 14 used per-instruction direct DXIL. Eleven per-lane refusals logged the new whole-wave mask branch rule, two logged numeric EXEC in the split form, and one logged an `IMAGE_LOAD` register restriction. There were zero HLSL fallbacks. The earlier 150 s run on `cf29f8a6a7e4e64cfaf17dd929e5334a7d5cf193` also routed 10 shaders per lane and 14 per instruction. All 24 translated compute cache keys and their DXIL bytes matched across the two revisions. Earlier 60 s runs on `6c89285` and `cf29f8a` with per-lane off showed 1,236 and 1,235 frames, respectively. Enabling per-lane on `cf29f8a` in the 60 s run sent all three startup compute shaders through the per-instruction path. All three runs produced byte-identical compute DXIL. **Tested** - RTX 5070 Ti 16 GB, NVIDIA 620.73.04, Ryzen 7 9700X, 32 GB DDR5, CachyOS `7.3.5-2-cachyos`, Proton Experimental 11.0 (`experimental-11.0-20261112-x86_64`). vkd3d-proton `ec207194` with the #257 patch, dxil-spirv `7c048638`, and DXC 1.9.2609.5. Clean x64 Windows release builds using Rust 1.100.0 and LLVM-MinGW 20261117 (`x86_64-pc-windows-gnullvm`). - Built with `cargo build --locked --release --target x86_64-pc-windows-gnullvm -p xcl --bin xcl`. Ran `scripts/linux/smoke.sh "$PROTON" "$PREFIX" "$GAME" 150` from #257 for the longer runs. Each run used the same retail title, a separate fresh Wine prefix and shader cache, networking off, and A presses scheduled every three seconds. XCL PSO cache blobs and vkd3d-proton/NVIDIA disk shader caches were disabled. Both used `XCL_DXC_THREADS=2`, `XCL_PSO_TRACE=1`, and `XCL_DIRECT_DXIL_STATS=1`. The smoke scope was capped at 16 GiB RAM with no swap. - Built the library tests with `cargo test --locked --release --target x86_64-pc-windows-gnullvm -p xcl --lib --no-run`. Ran the Windows test binary in Proton Wine with the filters `gpu::recomp::lower_dxil::tests::` and `a_whole_wave_decision_on_a_mask_some_lanes_lack_is_refused`, `--test-threads=1 --nocapture`. The updated head returned **13 passed, 0 failed, 0 ignored**. This includes the whole-wave mask and rounding-mode regression tests. The run logged **15 skipped subcases** (12 requiring native wave64 and three intentionally refused f16 cases). The split wave64 and four-memory-window GPU tests ran. **150 s smoke on `0570037`** ``` xcl-smoke v1 commit: 0570037d0247978205e786057cadbdc85dded0ca gpu: NVIDIA GeForce RTX 5070 Ti title: GTA6.Xbox.v1.0.2.1 seconds: 150 exit: 0x0 frames shown: 1830 (PresentX 1830) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 0 MB ``` The Wine smoke script generated the block. I abbreviated the local folder name in `title`. The last two-second bin with presents ended at 94.1 s. Wine reported 0 MB in the Windows peak-commit field. Linux cgroup peak was 15.07 GiB, with no OOM kill. Coverage is the retail loading interval on Proton and the focused suite. **AI use** — OpenAI Codex (GPT-6, exact variant unavailable) built and ran the checks, verified the logs, and drafted this report.
upstream-sync closed this pull request 2026-11-24 21:29:24 +00:00
gefydev commented 2026-11-24 21:29:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-24T21:10:35Z.


#1745 is rebased onto main 4178e88 (one conflict in kernel.rs with #1748's new Lw fields, resolved). Head bfb8133, 51 commits, both checks green. Suite 955 passed, 0 failed, 42 ignored; smoke 915 frames against 889 for main. Replies, one per reviewer:

  • @Kalmarv: points 1 and 2 are fixed in 66879ef. A branch or scalar select on whether any lane of a mask is set is taken per lane only where the condition is the same in every lane in EXEC, and is refused otherwise. MODE writes go through #1426, and the adapter sets dyn_rm / has_f64_round_op. Each has a test that failed before. Point 3 (the "HLSL fallback" label) is noted and not changed.
  • @thehollowedone: your loop program (a mask-op SCC carried around the back edge) is now refused, in 9dcf2f6, with a test that failed before. Thank you for the fixture.
  • @Pipodi: points 9 (per-lane cache identity from the per-lane sources, bfb8133), 12 (size waiver, in the description), 13 (commit count, now 51) and 14 (the Antigravity trailer on two of MiguelMachado-dev's commits, now named in AI use) are done. Points 2, 3, 4-8, 10, 11, 15 and 16 are noted as follow-ups for after the maintainer's call. For 15, @vitor127wt's byte-identical DXIL run covers one title.
  • @moombathepilot: the two sweep notes (paired size totals, --validate for the per-lane output) are noted for the --lanes follow-up.

The description now says 316 / 2 689 compute programs with the stricter rules, +0.8 % size against #1426's per-instruction form, so the earlier 321 figure no longer applies.

AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.

<!-- greyfinch-sync:ivall/xcl:comment:7144578560 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7144578560). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-24T21:10:35Z. --- #1745 is rebased onto `main` `4178e88` (one conflict in `kernel.rs` with #1748's new `Lw` fields, resolved). Head `bfb8133`, 51 commits, both checks green. Suite 955 passed, 0 failed, 42 ignored; smoke 915 frames against 889 for `main`. Replies, one per reviewer: - @Kalmarv: points 1 and 2 are fixed in `66879ef`. A branch or scalar select on whether any lane of a mask is set is taken per lane only where the condition is the same in every lane in EXEC, and is refused otherwise. MODE writes go through #1426, and the adapter sets `dyn_rm` / `has_f64_round_op`. Each has a test that failed before. Point 3 (the "HLSL fallback" label) is noted and not changed. - @thehollowedone: your loop program (a mask-op SCC carried around the back edge) is now refused, in `9dcf2f6`, with a test that failed before. Thank you for the fixture. - @Pipodi: points 9 (per-lane cache identity from the per-lane sources, `bfb8133`), 12 (size waiver, in the description), 13 (commit count, now 51) and 14 (the Antigravity trailer on two of MiguelMachado-dev's commits, now named in **AI use**) are done. Points 2, 3, 4-8, 10, 11, 15 and 16 are noted as follow-ups for after the maintainer's call. For 15, @vitor127wt's byte-identical DXIL run covers one title. - @moombathepilot: the two sweep notes (paired size totals, `--validate` for the per-lane output) are noted for the `--lanes` follow-up. The description now says 316 / 2 689 compute programs with the stricter rules, +0.8 % size against #1426's per-instruction form, so the earlier 321 figure no longer applies. AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
DavidM1911 commented 2026-11-24 23:08:36 +00:00 (Migrated from github.com)

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


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7146805195 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7146805195). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T22:55:33Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
BetterJdue commented 2026-11-25 00:09:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BetterJdue on 2026-11-24T23:40:45Z.


Test report after the merge, on native wave64 AMD RDNA2 (the reports above are RDNA3, RDNA4 and NVIDIA): main c4d37be, which has #1745 as 7f7e768.

Tested

  • AMD Radeon RX 6700 (RDNA2, native wave64), driver 32.0.21045.29003; Ryzen 5 3600; 32 GB RAM; Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.9.2602.17; debug; clean worktree, own target dir.
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 956 passed, 3 failed, 43 ignored. SKIPPED (8): the six per-lane refusals (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32, wave32 and wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows) and pso_measurement_compiles_an_exact_synthetic_record (Developer Mode off). No no wave64 skips.
  • The 3 failures are not from #1745: placed_title_textures_share_vram_and_preserve_pixels ("3D 64x64x64 4 mips: subresource 2 mismatch") also fails alone on main b9b6ea6, before the merge, and the other two fail on the lock it poisons. It is the RDNA2 failure reported fixed by #1028.
  • cargo test -p xcl --lib -- gpu::dxil recomp::lower --test-threads=4: 130 passed, 0 failed, 1 ignored; the same six refusals SKIPPED.
  • Alone, 3 runs each, all passed, no device removal (21 of 21): wave_ops_match_cpu, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu, the_split_form_agrees_with_the_wave64_lowering_on_the_gpu, a_wave64_mask_left_behind_is_reported_in_both_halves, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, f32_programs_on_the_gpu, the_runtime_path_takes_the_split_form. On this card wave_ops_match_cpu removed the device (0x887A0005, also alone) on 164050e earlier today; it passes now.
  • XCL_ADAPTER=warp cargo test -p xcl --lib -- --test-threads=4: 907 passed, 3 failed, 23 ignored. The 3 failures are the same texture tests; with XCL_ADAPTER=warp that test fails on b9b6ea6 too, so it seems to run on the hardware adapter rather than WARP (inferred, not checked).
  • The same steps on 0570037, before the merge, gave the same picture: 924 passed, 3 failed (the same three), 42 ignored; gpu::dxil + recomp::lower 127 passed, 0 failed; the 21 runs passed.
  • A note on XCL_REQUIRE_GPU=wave64: it turns the six deliberate per-lane refusals into failures (runner.rs:469), so with it gpu::dxil + recomp::lower gives 128 passed, 2 failed. It cannot show here that the wave64 halves ran; that the plain run reports no no wave64 skip does.

Not tested

  • A title run, driver times or XCL_PER_LANE=1 at run time (no game data here).
  • Release build; mesh shaders.

AI use: Claude Code (Claude Opus 5.5) ran these tests on my machine and wrote this report.

AI-assisted verification using synthetic inputs.

<!-- greyfinch-sync:ivall/xcl:comment:7147673200 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1745#issuecomment-7147673200). Originally posted by [BetterJdue](https://github.com/BetterJdue) on 2026-11-24T23:40:45Z. --- Test report after the merge, on native wave64 AMD RDNA2 (the reports above are RDNA3, RDNA4 and NVIDIA): `main` `c4d37be`, which has #1745 as `7f7e768`. **Tested** - AMD Radeon RX 6700 (RDNA2, native wave64), driver 32.0.21045.29003; Ryzen 5 3600; 32 GB RAM; Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.9.2602.17; debug; clean worktree, own target dir. - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 956 passed, 3 failed, 43 ignored. SKIPPED (8): the six per-lane refusals (`V_MUL_F16`, `V_PK_MUL_F16`, `V_CVT_F16_F32`, wave32 and wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows) and `pso_measurement_compiles_an_exact_synthetic_record` (Developer Mode off). No `no wave64` skips. - The 3 failures are not from #1745: `placed_title_textures_share_vram_and_preserve_pixels` ("3D 64x64x64 4 mips: subresource 2 mismatch") also fails alone on `main` `b9b6ea6`, before the merge, and the other two fail on the lock it poisons. It is the RDNA2 failure reported fixed by #1028. - `cargo test -p xcl --lib -- gpu::dxil recomp::lower --test-threads=4`: 130 passed, 0 failed, 1 ignored; the same six refusals SKIPPED. - Alone, 3 runs each, all passed, no device removal (21 of 21): `wave_ops_match_cpu`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`, `the_split_form_agrees_with_the_wave64_lowering_on_the_gpu`, `a_wave64_mask_left_behind_is_reported_in_both_halves`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `f32_programs_on_the_gpu`, `the_runtime_path_takes_the_split_form`. On this card `wave_ops_match_cpu` removed the device (`0x887A0005`, also alone) on `164050e` earlier today; it passes now. - `XCL_ADAPTER=warp cargo test -p xcl --lib -- --test-threads=4`: 907 passed, 3 failed, 23 ignored. The 3 failures are the same texture tests; with `XCL_ADAPTER=warp` that test fails on `b9b6ea6` too, so it seems to run on the hardware adapter rather than WARP (inferred, not checked). - The same steps on `0570037`, before the merge, gave the same picture: 924 passed, 3 failed (the same three), 42 ignored; `gpu::dxil` + `recomp::lower` 127 passed, 0 failed; the 21 runs passed. - A note on `XCL_REQUIRE_GPU=wave64`: it turns the six deliberate per-lane refusals into failures (`runner.rs:469`), so with it `gpu::dxil` + `recomp::lower` gives 128 passed, 2 failed. It cannot show here that the wave64 halves ran; that the plain run reports no `no wave64` skip does. **Not tested** - A title run, driver times or `XCL_PER_LANE=1` at run time (no game data here). - Release build; mesh shaders. AI use: Claude Code (Claude Opus 5.5) ran these tests on my machine and wrote this report. AI-assisted verification using synthetic inputs.
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!1735
No description provided.