Recompiler: skip split-wave64 v_readfirstlane_b32 exchanges for wave-uniform VGPRs #1193

Open
github-bot wants to merge 1 commit from github-bot/gh-1193 into main AGit
Owner

@⁠zondy1i on GitHub · 2026-11-24 13:04 UTC · original
zondy1i:recomp/x64-uniform-readfirstlane → main · +464 −2 · 4 files · 1 commits · open

��Eliminates split-wave64 xcl_x_rla_uniform() (xcl_x_meet()) cross-half exchanges for v_readfirstlane_b32 when the source VGPR holds a wave-uniform value under guaranteed EXEC != 0.

Why

  • RDNA2 has no scalar floating-point or scalar integer-division instructions, so console shaders evaluate uniform float math and scalar udiv chains (v_cvt_f32_u32 �! v_rcp_iflag_f32 �! v_mul_legacy_f32 �! v_cvt_u32_f32) on VALU with scalar inputs and move the result back to an SGPR via v_readfirstlane_b32.
  • In split-wave64 (docs/wave64-on-wave32.md), every such v_readfirstlane_b32 currently emits xcl_x_rla_uniform() (a groupshared xcl_x_meet() barrier) even though every active lane computed the exact same scalar value.
  • When EXEC != 0 is statically guaranteed (so first_lane(exec) always selects an active lane, never falling back to inactive lane 0) and the source VGPR was produced in the same basic block (with unchanged EXEC) by a chain of plain, full-32-bit-overwrite, lane-independent VALU ops over uniform inputs, we capture each producer in that chain into an immutable scalar temporary (uint tN = ...;) evaluated from uniform operands. Both 32-lane halves compute the exact same tN even if one half has no active lanes (exec_lo == 0 or exec_hi == 0), and v_readfirstlane_b32 copies tN directly without xcl_x_meet().

What is in it

  • crates/xcl/src/gpu/recomp/x64_uniform.rs: forward must-analysis exec_nonzero() tracking non-zero 64-bit SGPR pairs (EXEC, saved EXEC via s_mov_b64 / s_*_saveexec_b64 / s_or_b64, s_cbranch_execz/execnz, saveexec + scc, LOOP_GUARD exits; bails out on unresolved indirect jumps; conservative entry_nonzero = false in kernel mode), in-block wave-uniform VALU chain analysis (analyze()), and 3 unit tests.
  • crates/xcl/src/gpu/recomp/mod.rs: run x64_uniform::analyze in split-wave64 mode for Kernel / Compute / Mesh.
  • crates/xcl/src/gpu/recomp/emit.rs: capture uniform temporaries only for PCs in x64_uniform.capture_pcs (zero extra locals elsewhere), substitute uniform VGPR inputs while evaluating captured producers, copy directly in v_readfirstlane_b32 for PCs in x64_uniform.rfl_pcs, and clear live temporaries on block boundaries / EXEC writes / VGPR overwrites.
  • crates/xcl/src/gpu/recomp/tests.rs: add GPU test gpu_split_wave64_uniform_readfirstlane verifying 0-exchange scalar udiv and float-add chains with only upper-half lane 40 active (exec_lo == 0, garbage in lower-half VGPRs) as well as the conservative EXEC == 0 fallback reading unmodified lane 0.

Measured impact (RTX 3060 Ti, split-wave64)

  • Across 10,490 translated wave64 compute/mesh programs from a retail shader corpus: xcl_x_rla_uniform() calls drop from 80,310 �! 64,658 ("15,652 exchanges, "19.5%).
  • Cold DXC (cs_6_6) and NVIDIA D3D12 PSO compile benchmarks on three retail compute shaders (before 47efa2e �! after 0d8bcd5):
    • Compute shader #1: xcl_x_rla_uniform 57 �! 12 ("78.9%), DXIL 57,328 �! 41,168 B ("28.2%), DXC 347.8 �! 239.7 ms ("31.1%), cold PSO 323.6 �! 218.7 ms ("32.4%).
    • Compute shader #2 (3.1 MB HLSL): xcl_x_rla_uniform 505 �! 463 ("8.3%), DXIL 1,200,072 �! 1,179,728 B ("1.7%), DXC 26,612 �! 24,784 ms ("6.9%), cold PSO 28,313 �! 29,146 ms (noise within 3%).
    • Compute shader #3: xcl_x_rla_uniform 43 �! 13 ("69.8%), DXIL 144,708 �! 133,000 B ("8.1%), DXC 1,343 �! 1,148 ms ("14.6%), cold PSO 1,859 �! 1,696 ms ("8.8%).

Tested

  • Hardware: NVIDIA GeForce RTX 3060 Ti 8 GB (driver 32.0.16.2101), Ryzen 5 7500F, 64 GB RAM, Windows 11 Build 26300, DXC 1.9.2609.5, Rust 1.100.0 (x86_64-pc-windows-msvc), debug + release.
  • cargo test -p xcl --lib x64_uniform -- --test-threads=1: 3 passed, 0 failed.
  • cargo test -p xcl --lib gpu_split_wave64 -- --test-threads=1: 6 passed, 0 failed (including new gpu_split_wave64_uniform_readfirstlane).
  • cargo test --workspace -- --test-threads=1: 745 passed, 0 failed, 41 ignored (1 SKIPPED GPU test: gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64)).

Regression run

main:

xcl-smoke v1
commit: 80f4819098e921f2e1ab371144d4832f68ffedd6
gpu: NVIDIA GeForce RTX 3060 Ti
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1622 (PresentX 1622)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16539 MB

PR:

xcl-smoke v1
commit: 5ae60ad0a9baefd8baa244f36f9e5712f83b37d4
gpu: NVIDIA GeForce RTX 3060 Ti
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1652 (PresentX 1652)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15371 MB

Not tested

  • AMD native wave64 GPUs (x64_uniform only runs when split_wave64 is active on wave32-only GPUs or forced via XCL_SPLIT_WAVE64=1).
  • Linux / Wine.

AI use

  • Antigravity (Gemini 4 Carbon): scanned v_readfirstlane_b32 producers across the shader corpus, designed and implemented x64_uniform.rs + emitter integration, wrote unit and GPU tests, ran the DXC/PSO benchmarks, and drafted the PR description; all tests, benchmarks, and paired smoke runs were executed locally on the hardware above and the diff was reviewed line by line.
**@⁠zondy1i** on GitHub · 2026-11-24 13:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193) `zondy1i:recomp/x64-uniform-readfirstlane` → `main` · +464 −2 · 4 files · 1 commits · open ��Eliminates split-wave64 `xcl_x_rla_uniform()` (`xcl_x_meet()`) cross-half exchanges for `v_readfirstlane_b32` when the source VGPR holds a wave-uniform value under guaranteed `EXEC != 0`. **Why** - RDNA2 has no scalar floating-point or scalar integer-division instructions, so console shaders evaluate uniform float math and scalar `udiv` chains (`v_cvt_f32_u32` �! `v_rcp_iflag_f32` �! `v_mul_legacy_f32` �! `v_cvt_u32_f32`) on VALU with scalar inputs and move the result back to an SGPR via `v_readfirstlane_b32`. - In split-wave64 (`docs/wave64-on-wave32.md`), every such `v_readfirstlane_b32` currently emits `xcl_x_rla_uniform()` (a groupshared `xcl_x_meet()` barrier) even though every active lane computed the exact same scalar value. - When `EXEC != 0` is statically guaranteed (so `first_lane(exec)` always selects an active lane, never falling back to inactive lane 0) and the source VGPR was produced in the same basic block (with unchanged `EXEC`) by a chain of plain, full-32-bit-overwrite, lane-independent VALU ops over uniform inputs, we capture each producer in that chain into an immutable scalar temporary (`uint tN = ...;`) evaluated from uniform operands. Both 32-lane halves compute the exact same `tN` even if one half has no active lanes (`exec_lo == 0` or `exec_hi == 0`), and `v_readfirstlane_b32` copies `tN` directly without `xcl_x_meet()`. **What is in it** - `crates/xcl/src/gpu/recomp/x64_uniform.rs`: forward must-analysis `exec_nonzero()` tracking non-zero 64-bit SGPR pairs (`EXEC`, saved `EXEC` via `s_mov_b64` / `s_*_saveexec_b64` / `s_or_b64`, `s_cbranch_execz`/`execnz`, `saveexec` + `scc`, `LOOP_GUARD` exits; bails out on unresolved indirect jumps; conservative `entry_nonzero = false` in kernel mode), in-block wave-uniform VALU chain analysis (`analyze()`), and 3 unit tests. - `crates/xcl/src/gpu/recomp/mod.rs`: run `x64_uniform::analyze` in split-wave64 mode for Kernel / Compute / Mesh. - `crates/xcl/src/gpu/recomp/emit.rs`: capture uniform temporaries only for PCs in `x64_uniform.capture_pcs` (zero extra locals elsewhere), substitute uniform VGPR inputs while evaluating captured producers, copy directly in `v_readfirstlane_b32` for PCs in `x64_uniform.rfl_pcs`, and clear live temporaries on block boundaries / `EXEC` writes / VGPR overwrites. - `crates/xcl/src/gpu/recomp/tests.rs`: add GPU test `gpu_split_wave64_uniform_readfirstlane` verifying 0-exchange scalar `udiv` and float-add chains with only upper-half lane 40 active (`exec_lo == 0`, garbage in lower-half VGPRs) as well as the conservative `EXEC == 0` fallback reading unmodified lane 0. **Measured impact (RTX 3060 Ti, split-wave64)** - Across 10,490 translated wave64 compute/mesh programs from a retail shader corpus: `xcl_x_rla_uniform()` calls drop from **80,310 �! 64,658** (**"15,652 exchanges, "19.5%**). - Cold DXC (`cs_6_6`) and NVIDIA D3D12 PSO compile benchmarks on three retail compute shaders (before `47efa2e` �! after `0d8bcd5`): - Compute shader #1: `xcl_x_rla_uniform` `57 �! 12` ("78.9%), DXIL `57,328 �! 41,168 B` (**"28.2%**), DXC `347.8 �! 239.7 ms` (**"31.1%**), cold PSO `323.6 �! 218.7 ms` (**"32.4%**). - Compute shader #2 (3.1 MB HLSL): `xcl_x_rla_uniform` `505 �! 463` ("8.3%), DXIL `1,200,072 �! 1,179,728 B` ("1.7%), DXC `26,612 �! 24,784 ms` (**"6.9%**), cold PSO `28,313 �! 29,146 ms` (noise within 3%). - Compute shader #3: `xcl_x_rla_uniform` `43 �! 13` ("69.8%), DXIL `144,708 �! 133,000 B` (**"8.1%**), DXC `1,343 �! 1,148 ms` (**"14.6%**), cold PSO `1,859 �! 1,696 ms` (**"8.8%**). **Tested** - Hardware: NVIDIA GeForce RTX 3060 Ti 8 GB (driver 32.0.16.2101), Ryzen 5 7500F, 64 GB RAM, Windows 11 Build 26300, DXC 1.9.2609.5, Rust 1.100.0 (`x86_64-pc-windows-msvc`), debug + release. - `cargo test -p xcl --lib x64_uniform -- --test-threads=1`: 3 passed, 0 failed. - `cargo test -p xcl --lib gpu_split_wave64 -- --test-threads=1`: 6 passed, 0 failed (including new `gpu_split_wave64_uniform_readfirstlane`). - `cargo test --workspace -- --test-threads=1`: 745 passed, 0 failed, 41 ignored (1 SKIPPED GPU test: `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (no wave64)). **Regression run** main: ``` xcl-smoke v1 commit: 80f4819098e921f2e1ab371144d4832f68ffedd6 gpu: NVIDIA GeForce RTX 3060 Ti title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1622 (PresentX 1622) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16539 MB ``` PR: ``` xcl-smoke v1 commit: 5ae60ad0a9baefd8baa244f36f9e5712f83b37d4 gpu: NVIDIA GeForce RTX 3060 Ti title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1652 (PresentX 1652) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15371 MB ``` **Not tested** - AMD native wave64 GPUs (`x64_uniform` only runs when `split_wave64` is active on wave32-only GPUs or forced via `XCL_SPLIT_WAVE64=1`). - Linux / Wine. **AI use** - Antigravity (Gemini 4 Carbon): scanned `v_readfirstlane_b32` producers across the shader corpus, designed and implemented `x64_uniform.rs` + emitter integration, wrote unit and GPU tests, ran the DXC/PSO benchmarks, and drafted the PR description; all tests, benchmarks, and paired smoke runs were executed locally on the hardware above and the diff was reviewed line by line.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:46:34 +00:00
Author
Owner

@⁠Aniseto on GitHub · 2026-11-24 13:08 UTC · original

Ran the new uniform tests on an NVIDIA Blackwell part at 0d8bcd5:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=nvidia cargo test -p xcl --lib x64_uniform -- --test-threads=1
3 passed; 0 failed; 0 ignored      (exit 0)

XCL_ADAPTER=nvidia cargo test -p xcl --lib gpu_split_wave64 -- --test-threads=1
6 passed; 0 failed; 0 ignored      (exit 0)

All six split-wave64 GPU tests pass here, including the new gpu_split_wave64_uniform_readfirstlane. This adapter has no native wave64, so the split form is the only path it runs. The author's run was an Ampere RTX 3060 Ti; this adds a Blackwell part with driver 32.0.16.2124 on Windows 11 build 26200.

Not tested: native wave64 (not available here), RDNA2/RDNA4 and Intel GPUs, Wine, release profile, retail titles.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified.

**@⁠Aniseto** on GitHub · 2026-11-24 13:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7132395036) Ran the new uniform tests on an NVIDIA Blackwell part at `0d8bcd5`: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` XCL_ADAPTER=nvidia cargo test -p xcl --lib x64_uniform -- --test-threads=1 3 passed; 0 failed; 0 ignored (exit 0) XCL_ADAPTER=nvidia cargo test -p xcl --lib gpu_split_wave64 -- --test-threads=1 6 passed; 0 failed; 0 ignored (exit 0) ``` All six split-wave64 GPU tests pass here, including the new `gpu_split_wave64_uniform_readfirstlane`. This adapter has no native wave64, so the split form is the only path it runs. The author's run was an Ampere RTX 3060 Ti; this adds a Blackwell part with driver 32.0.16.2124 on Windows 11 build 26200. Not tested: native wave64 (not available here), RDNA2/RDNA4 and Intel GPUs, Wine, release profile, retail titles. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash 1017** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified.
Author
Owner

@⁠juniorteixeiradev on GitHub · 2026-11-24 13:20 UTC · original

Ran the PR on NVIDIA Ampere (wave32 only, so split wave64 is the path in use) at head 0d8bcd5, whose base is main 47efa2e.

Tested

  • Hardware: NVIDIA GeForce RTX 3070 Ti (Ampere, 8 GB), driver 610.88. CPU AMD Ryzen 5 5600G (its Radeon iGPU is also present; the tests used the NVIDIA adapter), 16 GB RAM.
  • Windows 11 Pro build 26200, Rust 1.100.0 stable MSVC, debug.
  • DXC 1.9.2602.17 from Windows SDK 10.0.26100.0.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 on this PR's head: 745 passed, 0 failed, 41 ignored.
  • The same command on main 47efa2e, same machine: 741 passed, 0 failed, 41 ignored. The 4 extra tests are this PR's, and nothing else changed.
  • SKIPPED on both, as expected on a wave32-only adapter:
    • gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
    • gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
  • This PR's tests all pass:
    • gpu::recomp::tests::gpu_split_wave64_uniform_readfirstlane. It ran on the GPU with --nocapture and DXC loaded, and it was not skipped.
    • gpu::recomp::x64_uniform::tests::scalar_div_chain_with_nonzero_exec_is_captured
    • gpu::recomp::x64_uniform::tests::cbranch_execz_and_saved_exec_restore_prove_exec_nonzero
    • gpu::recomp::x64_uniform::tests::non_uniform_exec_maybe_zero_and_loop_exit_stay_conservative

Not tested

  • No retail title and no scripts/smoke.ps1 run: no game files on this machine.
  • Release build.
  • No measurement of the exchanges or barriers saved.

AI use

  • Claude Code (Claude Opus 5.5) fetched the branch, ran the tests and drafted this comment. The counts come from the test logs of those runs.
**@⁠juniorteixeiradev** on GitHub · 2026-11-24 13:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7132690284) Ran the PR on NVIDIA Ampere (wave32 only, so split wave64 is the path in use) at head `0d8bcd5`, whose base is `main` `47efa2e`. **Tested** - Hardware: NVIDIA GeForce RTX 3070 Ti (Ampere, 8 GB), driver 610.88. CPU AMD Ryzen 5 5600G (its Radeon iGPU is also present; the tests used the NVIDIA adapter), 16 GB RAM. - Windows 11 Pro build 26200, Rust 1.100.0 stable MSVC, debug. - DXC 1.9.2602.17 from Windows SDK 10.0.26100.0. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` on this PR's head: 745 passed, 0 failed, 41 ignored. - The same command on `main` `47efa2e`, same machine: 741 passed, 0 failed, 41 ignored. The 4 extra tests are this PR's, and nothing else changed. - `SKIPPED` on both, as expected on a wave32-only adapter: - `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64` - `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64` - This PR's tests all pass: - `gpu::recomp::tests::gpu_split_wave64_uniform_readfirstlane`. It ran on the GPU with `--nocapture` and DXC loaded, and it was not skipped. - `gpu::recomp::x64_uniform::tests::scalar_div_chain_with_nonzero_exec_is_captured` - `gpu::recomp::x64_uniform::tests::cbranch_execz_and_saved_exec_restore_prove_exec_nonzero` - `gpu::recomp::x64_uniform::tests::non_uniform_exec_maybe_zero_and_loop_exit_stay_conservative` **Not tested** - No retail title and no `scripts/smoke.ps1` run: no game files on this machine. - Release build. - No measurement of the exchanges or barriers saved. **AI use** - Claude Code (Claude Opus 5.5) fetched the branch, ran the tests and drafted this comment. The counts come from the test logs of those runs.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 13:21 UTC · original

Independent verification on current main 384f7f7 (branch already contains it — clean).

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

  • cargo test -p xcl --lib readfirstlane: 1 passed, 0 failed — gpu_split_wave64_uniform_readfirstlane on real hardware (the new x64_uniform analysis skips wave-uniform VGPR exchanges correctly).

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

**@⁠DavidM1911** on GitHub · 2026-11-24 13:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7132724855) Independent verification on current `main` `384f7f7` (branch already contains it — clean). **Machine:** Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug; DXC 1.8.2502.11. - `cargo test -p xcl --lib readfirstlane`: **1 passed, 0 failed** — `gpu_split_wave64_uniform_readfirstlane` on real hardware (the new `x64_uniform` analysis skips wave-uniform VGPR exchanges correctly). AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Author
Owner

@⁠0xTehuti on GitHub · 2026-11-24 13:30 UTC · original

Test report on NVIDIA GeForce RTX 2070 SUPER (Turing, wave32)

Commit tested
0d8bcd58626ed825a860cc43664c238f00e02a0c (PR #1193 head)

Tested

  • Hardware:
    • GPU: NVIDIA GeForce RTX 2070 SUPER (Driver 595.79 / 32.0.15.9579, 7989 MiB VRAM)
    • CPU: Intel Core i7-10700K CPU @ 3.80GHz
    • OS: Windows 11 x64, Rust 1.99.0, DXC 1.8.2502.11
  • Commands run and results:
    • cargo test -p xcl --lib x64_uniform:
      3 passed; 0 failed; finished in 0.00s
    • cargo test -p xcl --lib gpu_split_wave64_uniform_readfirstlane:
      1 passed; 0 failed; finished in 0.29s
  • Findings:
    • Verified that skipping xcl_x_rla_uniform() cross-half exchanges for wave-uniform VGPRs in split-wave64 executes cleanly on native wave32 Turing hardware.
    • Confirmed that with only upper-half lane 40 active (exec_lo == 0, garbage in lower half), the scalar value is preserved accurately across both halves, and the conservative EXEC == 0 fallback reads unmodified lane 0 as expected.

Not tested

  • Retail title smoke run (retail game assets unset).
  • AMD native wave64 hardware (optimization applies to split-wave64).

AI use

  • Tool: Antigravity / T3 Code
  • Model: Gemini 3.8 Flash
  • Details: Checked out PR commit in isolated worktree, compiled with DXC, and verified unit and GPU split-wave64 tests on local hardware.
**@⁠0xTehuti** on GitHub · 2026-11-24 13:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7132921705) ### Test report on NVIDIA GeForce RTX 2070 SUPER (Turing, wave32) **Commit tested** `0d8bcd58626ed825a860cc43664c238f00e02a0c` (PR #1193 head) **Tested** - **Hardware:** - GPU: NVIDIA GeForce RTX 2070 SUPER (Driver 595.79 / 32.0.15.9579, 7989 MiB VRAM) - CPU: Intel Core i7-10700K CPU @ 3.80GHz - OS: Windows 11 x64, Rust 1.99.0, DXC 1.8.2502.11 - **Commands run and results:** - `cargo test -p xcl --lib x64_uniform`: `3 passed; 0 failed; finished in 0.00s` - `cargo test -p xcl --lib gpu_split_wave64_uniform_readfirstlane`: `1 passed; 0 failed; finished in 0.29s` - **Findings:** - Verified that skipping `xcl_x_rla_uniform()` cross-half exchanges for wave-uniform VGPRs in split-wave64 executes cleanly on native wave32 Turing hardware. - Confirmed that with only upper-half lane 40 active (`exec_lo == 0`, garbage in lower half), the scalar value is preserved accurately across both halves, and the conservative `EXEC == 0` fallback reads unmodified lane 0 as expected. **Not tested** - Retail title smoke run (retail game assets unset). - AMD native wave64 hardware (optimization applies to split-wave64). **AI use** - Tool: Antigravity / T3 Code - Model: Gemini 3.8 Flash - Details: Checked out PR commit in isolated worktree, compiled with DXC, and verified unit and GPU split-wave64 tests on local hardware.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 13:57 UTC · original

A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257 (DXIL → SPIR-V through dxil-spirv), DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 0d8bcd5 as it is (based on 47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact).
  • gpu::recomp::tests::gpu_split_wave64_uniform_readfirstlane: ok, no SKIPPED.
  • gpu::recomp::x64_uniform::tests::cbranch_execz_and_saved_exec_restore_prove_exec_nonzero: ok, no SKIPPED.
  • gpu::recomp::x64_uniform::tests::non_uniform_exec_maybe_zero_and_loop_exit_stay_conservative: ok, no SKIPPED.
  • gpu::recomp::x64_uniform::tests::scalar_div_chain_with_nonzero_exec_is_captured: ok, no SKIPPED.

Not tested

  • whether the new test fails without the fix on this stack; the rest of the suite on this head; native Windows; AMD / native wave64.

AI use

  • Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
**@⁠JoaoPauluu** on GitHub · 2026-11-24 13:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7133593213) A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257 (DXIL → SPIR-V through dxil-spirv), DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `0d8bcd5` as it is (based on `47efa2e`), no uncommitted changes. The lib test binary runs under Wine, one test per process (`--exact`). - `gpu::recomp::tests::gpu_split_wave64_uniform_readfirstlane`: **ok**, no SKIPPED. - `gpu::recomp::x64_uniform::tests::cbranch_execz_and_saved_exec_restore_prove_exec_nonzero`: **ok**, no SKIPPED. - `gpu::recomp::x64_uniform::tests::non_uniform_exec_maybe_zero_and_loop_exit_stay_conservative`: **ok**, no SKIPPED. - `gpu::recomp::x64_uniform::tests::scalar_div_chain_with_nonzero_exec_is_captured`: **ok**, no SKIPPED. **Not tested** - whether the new test fails without the fix on this stack; the rest of the suite on this head; native Windows; AMD / native wave64. **AI use** - Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 14:36 UTC · original

Counter-datapoint from the axis every report above skips: native wave64 hardware (AMD RDNA3) with the split path forced. All five runs so far are NVIDIA wave32 parts where split-wave64 emulation is the only path; here it has to coexist with real 64-lane waves, so I ran it with XCL_SPLIT_WAVE64=1.

Lane: main b8b1f49 + this PR's head 0d8bcd5 (merge f3cb238). Control: plain b8b1f49. Both XCL_SPLIT_WAVE64=1 --test-threads=1, same session, 3 reps each. Counts only:

  • Control (plain main): gpu_split_wave64_waves_diverge 3/3 ok, gpu_split_wave64_lane_local_masks 3/3 ok, gpu_split_wave64_local_and_exchanged_masks and masks_read_whole_after_partial_writes 3/3 FAILED (the documented split cluster on this rig, #847).
  • PR lane: lane_local_masks still ok, but waves_diverge flips to 3/3 FAILED (signature: ds_bpermute assertion at group 0 thread 96, got 0 expected 65 - exchange value loss), and this PR's own new test gpu_split_wave64_uniform_readfirstlane fails 3/3. The new test passes its static check (the HLSL really does drop all but the definition of xcl_x_rla_uniform) and fails the GPU value check at tests.rs:5834: s6=613566656 expected~=613566720, so the uniform-skip path yields a 64-ulp-wrong readfirstlane result when only upper-half lane 40 is active. It also failed in a full-suite run on an earlier head of this PR.
  • One more angle: waves_diverge fails on this rig at 47efa2e (this PR's base; 3/3 red this morning and 3/3 red again this afternoon) but passes 3/3 on current main b8b1f49, and goes red again with this PR merged on top. So on RDNA3 this head re-introduces an exchange corruption current main does not have.

Net on this axis: strictly worse - two tests that pass on the control go red, none go green, and the PR's own test fails its numeric assert. Caveat kept honest: this rig's split cluster is finicky (#847), so single green runs prove nothing; the pattern above is consistent 3/3 both directions in one session. Happy to re-check a future head with the same 3x fix-vs-control combo.

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

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

**@⁠SlopTart** on GitHub · 2026-11-24 14:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7134662800) Counter-datapoint from the axis every report above skips: native wave64 hardware (AMD RDNA3) with the split path forced. All five runs so far are NVIDIA wave32 parts where split-wave64 emulation is the only path; here it has to coexist with real 64-lane waves, so I ran it with `XCL_SPLIT_WAVE64=1`. Lane: `main` `b8b1f49` + this PR's head `0d8bcd5` (merge `f3cb238`). Control: plain `b8b1f49`. Both `XCL_SPLIT_WAVE64=1 --test-threads=1`, same session, 3 reps each. Counts only: - Control (plain main): `gpu_split_wave64_waves_diverge` 3/3 ok, `gpu_split_wave64_lane_local_masks` 3/3 ok, `gpu_split_wave64_local_and_exchanged_masks` and `masks_read_whole_after_partial_writes` 3/3 FAILED (the documented split cluster on this rig, #847). - PR lane: `lane_local_masks` still ok, but `waves_diverge` flips to 3/3 FAILED (signature: `ds_bpermute` assertion at group 0 thread 96, got 0 expected 65 - exchange value loss), and this PR's own new test `gpu_split_wave64_uniform_readfirstlane` fails 3/3. The new test passes its static check (the HLSL really does drop all but the definition of `xcl_x_rla_uniform`) and fails the GPU value check at `tests.rs:5834`: `s6=613566656 expected~=613566720`, so the uniform-skip path yields a 64-ulp-wrong readfirstlane result when only upper-half lane 40 is active. It also failed in a full-suite run on an earlier head of this PR. - One more angle: `waves_diverge` fails on this rig at `47efa2e` (this PR's base; 3/3 red this morning and 3/3 red again this afternoon) but passes 3/3 on current main `b8b1f49`, and goes red again with this PR merged on top. So on RDNA3 this head re-introduces an exchange corruption current main does not have. Net on this axis: strictly worse - two tests that pass on the control go red, none go green, and the PR's own test fails its numeric assert. Caveat kept honest: this rig's split cluster is finicky (#847), so single green runs prove nothing; the pattern above is consistent 3/3 both directions in one session. Happy to re-check a future head with the same 3x fix-vs-control combo. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠zondy1i on GitHub · 2026-11-24 14:49 UTC · original

Thanks for testing the forced-split RDNA3/RADV path — super useful catch on the test assertion!

Regarding gpu_split_wave64_uniform_readfirstlane:
s6 = 613566656 vs expected = 613566720 is not a uniform-skip bug — it is a 1-ULP float32 rounding difference in hardware rcp(7.0f) where our test tolerance (<= 2) was too tight for AMD RDNA3:

  • The test computes (uint)(rcp(7.0f) * 4294967040.0f) (~6.135e8, exponent 2^29).
  • At 2^29, 1 single float32 ULP is 2^(29 - 23) = 64.
  • NVIDIA computes rcp(7.0f) as 0x3e124925 (613566720), whereas AMD hardware v_rcp_f32(7.0f) returns 0x3e124924 (1 ULP lower, legal per HLSL rcp), which scales to 613566720 - 64 = 613566656.
  • Notably, getting 613566656 instead of the 0xDEAD_0000 garbage preloaded in lane 0 confirms the upper-half-only (exec_lo == 0) uniform capture path computed and returned the exact RDNA3 scalar value without an exchange.

I pushed 7c16823 relaxing only that test's rcp assertion from <= 2 to <= 128 (2 float32 ULPs at 2^29), with no changes to the recompiler or analysis. Regarding waves_diverge, note that this PR's x64_uniform pass only touches v_readfirstlane_b32 and does not touch ds_bpermute or the exchange protocol (#847). If you re-run gpu_split_wave64_uniform_readfirstlane on 7c16823, it should now pass cleanly on RADV too!

AI use: Antigravity (Gemini 4 Neon) analyzed the float32 ULP arithmetic, pushed the 1-line test tolerance fix (7c16823), and helped draft this reply.

**@⁠zondy1i** on GitHub · 2026-11-24 14:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7134996939) Thanks for testing the forced-split RDNA3/RADV path — super useful catch on the test assertion! Regarding `gpu_split_wave64_uniform_readfirstlane`: `s6 = 613566656` vs `expected = 613566720` is **not** a uniform-skip bug — it is a 1-ULP `float32` rounding difference in hardware `rcp(7.0f)` where our test tolerance (`<= 2`) was too tight for AMD RDNA3: - The test computes `(uint)(rcp(7.0f) * 4294967040.0f)` (~`6.135e8`, exponent `2^29`). - At `2^29`, **1 single `float32` ULP is `2^(29 - 23) = 64`**. - NVIDIA computes `rcp(7.0f)` as `0x3e124925` (`613566720`), whereas AMD hardware `v_rcp_f32(7.0f)` returns `0x3e124924` (1 ULP lower, legal per HLSL `rcp`), which scales to `613566720 - 64 = 613566656`. - Notably, getting `613566656` instead of the `0xDEAD_0000` garbage preloaded in lane 0 confirms the upper-half-only (`exec_lo == 0`) uniform capture path computed and returned the exact RDNA3 scalar value without an exchange. I pushed `7c16823` relaxing only that test's `rcp` assertion from `<= 2` to `<= 128` (2 float32 ULPs at `2^29`), with no changes to the recompiler or analysis. Regarding `waves_diverge`, note that this PR's `x64_uniform` pass only touches `v_readfirstlane_b32` and does not touch `ds_bpermute` or the exchange protocol (`#847`). If you re-run `gpu_split_wave64_uniform_readfirstlane` on `7c16823`, it should now pass cleanly on RADV too! AI use: Antigravity (Gemini 4 Neon) analyzed the `float32` ULP arithmetic, pushed the 1-line test tolerance fix (`7c16823`), and helped draft this reply.
Author
Owner

@⁠mastrr9 on GitHub · 2026-11-24 15:30 UTC · original

Verified head 7c16823287be1058d6cf89fe0603b9d5005b2f2a on Windows 11 / NVIDIA RTX 5080 (wave32 / split-wave64, DXC 1.9.2602.17, Rust MSVC, debug build, clean worktree):

  • cargo test -p xcl --lib -- gpu::recomp --test-threads=4: 192 passed, 0 failed, 18 ignored (0 new compiler warnings).

Not tested: AMD native wave64, full workspace, retail smoke (scripts/smoke.ps1).
AI use: T3 Code (Antigravity / Claude Sonnet 5.5) ran the build and tests on our RTX 5080 and drafted this report.

**@⁠mastrr9** on GitHub · 2026-11-24 15:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7136146771) Verified head `7c16823287be1058d6cf89fe0603b9d5005b2f2a` on Windows 11 / NVIDIA RTX 5080 (wave32 / split-wave64, DXC 1.9.2602.17, Rust MSVC, debug build, clean worktree): - `cargo test -p xcl --lib -- gpu::recomp --test-threads=4`: **192 passed, 0 failed, 18 ignored** (0 new compiler warnings). **Not tested:** AMD native wave64, full workspace, retail smoke (`scripts/smoke.ps1`). **AI use:** T3 Code (Antigravity / Claude Sonnet 5.5) ran the build and tests on our RTX 5080 and drafted this report.
Author
Owner

@⁠Mykolas009 on GitHub · 2026-11-24 15:49 UTC · original

Tested on NVIDIA Blackwell: head 7c16823 merged onto main 930e8b4 (clean merge, not pushed).

  • NVIDIA GeForce RTX 5060 8 GB (32-lane waves, so the split form), driver 610.88; Ryzen 5 7500F;
    Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.9.2602.17.
  • cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4 (debug):
    755 passed, 0 failed, 41 ignored (main alone: 751 / 0 / 41). SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask,
    gpu_wave32_program_in_wave64_hardware (no wave64). The 4 new tests pass.

Speed, since no report has timings yet. A local benchmark (not for a PR, built like bench_split_wave64:
2^18 threads, 32,768 loop iterations, GPU timestamps, median of 9, release), 2 runs each:

loop body main + #1193
v_cvt_f32_u32 of an SGPR, v_cvt_u32_f32, v_readfirstlane (uniform) 127.5–130.6 ms, 1 exchange 13.9–14.1 ms, 0 exchanges
v_readfirstlane of a lane value 127–129 ms 127–129 ms (kept, as it should be)
4 v_readfirstlane of lane values 513–517 ms 513–517 ms (kept)

About 9x faster in the uniform case, the same for 64- and 256-thread groups, and no change where the value is
not uniform. The wave64 output of every case is identical with and without the PR.

Not tested

  • Real shaders or a retail title. AMD. A negative control: with emit.rs from main the tree does not build
    (no field x64_uniform), so I did not separate it further; the benchmark shows the exchange removed.

AI use

  • Claude Code (Claude Opus 5.5) wrote the local benchmark, ran it and the tests, and drafted this; I checked the numbers.
**@⁠Mykolas009** on GitHub · 2026-11-24 15:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7136687642) **Tested** on NVIDIA Blackwell: head `7c16823` merged onto `main` `930e8b4` (clean merge, not pushed). - NVIDIA GeForce RTX 5060 8 GB (32-lane waves, so the split form), driver 610.88; Ryzen 5 7500F; Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.9.2602.17. - `cargo build --workspace` + `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug): **755 passed, 0 failed, 41 ignored** (`main` alone: 751 / 0 / 41). SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64). The 4 new tests pass. **Speed**, since no report has timings yet. A local benchmark (not for a PR, built like `bench_split_wave64`: 2^18 threads, 32,768 loop iterations, GPU timestamps, median of 9, release), 2 runs each: | loop body | `main` | + #1193 | |---|---|---| | `v_cvt_f32_u32` of an SGPR, `v_cvt_u32_f32`, `v_readfirstlane` (uniform) | 127.5–130.6 ms, 1 exchange | **13.9–14.1 ms**, 0 exchanges | | `v_readfirstlane` of a lane value | 127–129 ms | 127–129 ms (kept, as it should be) | | 4 `v_readfirstlane` of lane values | 513–517 ms | 513–517 ms (kept) | About 9x faster in the uniform case, the same for 64- and 256-thread groups, and no change where the value is not uniform. The wave64 output of every case is identical with and without the PR. **Not tested** - Real shaders or a retail title. AMD. A negative control: with `emit.rs` from `main` the tree does not build (`no field x64_uniform`), so I did not separate it further; the benchmark shows the exchange removed. **AI use** - Claude Code (Claude Opus 5.5) wrote the local benchmark, ran it and the tests, and drafted this; I checked the numbers.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 17:31 UTC · original

AMD side of the new head 7c16823, and a correction to my earlier regression claim.

Same rig and forced split mode (XCL_SPLIT_WAVE64=1, native wave64 card forced to the split path, --test-threads=1):

  • My earlier report (head 0d8bcd5): this PR's own test failed 3/3 here and waves_diverge went red vs the control. Both are fixed now: gpu_split_wave64_uniform_readfirstlane passes 1/1 in forced mode, and gpu_split_wave64_waves_diverge passes with and without this PR. I withdraw the regression claim.
  • What is still broken is on main b7aa9f3b, not this PR: forced split mode on current main fails 3 of the renamed family:
    • gpu_split_wave64_local_and_exchanged_masks_in_diverging_waves fails at tests.rs:5970, left 157 right 164 (mask mismatch, same family as the pair I reported in #847)
    • gpu_split_wave64_masks_read_whole_after_partial_writes fails at tests.rs:5860:71
    • gpu_split_wave64_cross_half_operations panics at tests.rs:5727:48
      Same three also fail at this PR's head (identical deltas), so the PR neither fixes nor worsens them; they are pre-existing failures against current main. Unforced on the same card: 6/6 green, so this is split-path specific. The two NVIDIA reports on this thread (RTX 5080, RTX 5060) run the split form natively and see all green, which points at something in the split simulation on native-wave64 cards (mask merging across halves), consistent with #847.

Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile; control run taken in the same session at the same main tip. See my Linux rows in #42 / #718.

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

**@⁠SlopTart** on GitHub · 2026-11-24 17:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7139321265) AMD side of the new head `7c16823`, and a correction to my earlier regression claim. Same rig and forced split mode (`XCL_SPLIT_WAVE64=1`, native wave64 card forced to the split path, `--test-threads=1`): - My earlier report (head `0d8bcd5`): this PR's own test failed 3/3 here and `waves_diverge` went red vs the control. Both are fixed now: `gpu_split_wave64_uniform_readfirstlane` passes 1/1 in forced mode, and `gpu_split_wave64_waves_diverge` passes with and without this PR. I withdraw the regression claim. - What is still broken is on `main` `b7aa9f3b`, not this PR: forced split mode on current main fails 3 of the renamed family: - `gpu_split_wave64_local_and_exchanged_masks_in_diverging_waves` fails at `tests.rs:5970`, left `157` right `164` (mask mismatch, same family as the pair I reported in #847) - `gpu_split_wave64_masks_read_whole_after_partial_writes` fails at `tests.rs:5860:71` - `gpu_split_wave64_cross_half_operations` panics at `tests.rs:5727:48` Same three also fail at this PR's head (identical deltas), so the PR neither fixes nor worsens them; they are pre-existing failures against current main. Unforced on the same card: 6/6 green, so this is split-path specific. The two NVIDIA reports on this thread (RTX 5080, RTX 5060) run the split form natively and see all green, which points at something in the split simulation on native-wave64 cards (mask merging across halves), consistent with #847. Counts only, no game data. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile; control run taken in the same session at the same main tip. See my Linux rows in #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 07:01 UTC · original

Tested

PR #1193 was open at 5ae60ad0a9baefd8baa244f36f9e5712f83b37d4 before and after the run. The detached checkout was clean at that SHA. The PR description includes NVIDIA results, and the discussion covers earlier NVIDIA and forced-split AMD runs. I found no equivalent same-head Intel Arc result in the PR discussion or issue #42.

STOR-WINLAB ran Windows 11 Enterprise Evaluation 25H2 x64 build 26200.9974, AMD Ryzen 7 3800X, and Intel Arc A770 driver 32.0.101.9175. Rust 1.100.0 (0ef1bc386 2026-11-09) targeted x86_64-pc-windows-msvc. DXC and DXIL were 1.9.2609.5 from %LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64.

cargo test --locked -p xcl --lib --no-run --message-format=json-render-diagnostics
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & 'L:/XclTooling/pr1975-b62e6e3/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' `
        'gpu::recomp::tests::gpu_split_wave64_uniform_readfirstlane' --exact --test-threads=1 --nocapture
}

The prebuild ran outside the Arc mutex, with CARGO_TARGET_DIR=L:/XclTooling/pr1975-b62e6e3/target, private TEMP and TMP at L:/XclTooling/pr1193/temp, CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, and CARGO_PROFILE_DEV_DEBUG=CARGO_PROFILE_TEST_DEBUG=0 (both variables set individually). The target stayed exclusive through test exit. Process-scoped RemoteSigned allowed the trusted wrapper to run. The test used XCL_ADAPTER=A770, the DXC folder above via XCL_DXC_DIR, and XCL_REQUIRE_GPU=wave64. XCL_SPLIT_WAVE64 and XCL_DIRECT_DXIL were unset.

The executable SHA-256 was 1A18DA96CE234223C8CB000AF410EA2FD15DE937B44272102FD202A4C1D2FD13 both before waiting and after acquiring the mutex. The earlier same-host D3D12 capability log reports Arc A770 hardware waves of 8–32 lanes. The checked-in runner therefore selected stock split-wave64, compiled both synthetic kernels via HLSL/DXC, and dispatched them on D3D12.

1 passed, 0 failed, 0 ignored, 0 GPU skips, 1,082 filtered out, 0.31 s, wrapper exit 0. The build completed with two Rust deprecation warnings. PowerShell formatted the fixture's DXC version message as NativeCommandError because it came from stderr. The fixture completed successfully.

  • With only lane 40 active, the HLSL had zero xcl_x_rla_uniform calls. The GPU readback satisfied s6 within 128 of the scaled reciprocal reference and s7 == 3. Lane 40's v3 became 3, and inactive lane 0's v3 retained 0xBEEF0000.
  • With empty EXEC, the HLSL retained one exchange and the GPU readback satisfied s6 == 0x12345678, the value seeded in lane 0's v1.
  • The runner checks SGPR agreement between the two split halves on readback. The fixture reports assertions as a single test result and does not print the observed reciprocal value.

Not tested

Native wave64, forced split on a native-wave64 adapter, Direct DXIL, other GPUs, other fixtures, the full workspace suite, retail smoke, and performance.

AI use

T3 Code / Codex (gpt-6.2-sol) verified the PR and fixture, ran the focused test, checked the logs, and wrote this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 07:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7155403744) ## Tested [PR #1193](https://git.gtahub.st/github/xcl-dev--xcl/pulls/1193) was open at `5ae60ad0a9baefd8baa244f36f9e5712f83b37d4` before and after the run. The detached checkout was clean at that SHA. The PR description includes NVIDIA results, and the discussion covers earlier NVIDIA and forced-split AMD runs. I found no equivalent same-head Intel Arc result in the PR discussion or issue #42. STOR-WINLAB ran Windows 11 Enterprise Evaluation 25H2 x64 build `26200.9974`, AMD Ryzen 7 3800X, and Intel Arc A770 driver `32.0.101.9175`. Rust `1.100.0 (0ef1bc386 2026-11-09)` targeted `x86_64-pc-windows-msvc`. DXC and DXIL were `1.9.2609.5` from `%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64`. ```powershell cargo test --locked -p xcl --lib --no-run --message-format=json-render-diagnostics & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & 'L:/XclTooling/pr1975-b62e6e3/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' ` 'gpu::recomp::tests::gpu_split_wave64_uniform_readfirstlane' --exact --test-threads=1 --nocapture } ``` The prebuild ran outside the Arc mutex, with `CARGO_TARGET_DIR=L:/XclTooling/pr1975-b62e6e3/target`, private `TEMP` and `TMP` at `L:/XclTooling/pr1193/temp`, `CARGO_BUILD_JOBS=2`, `CARGO_INCREMENTAL=0`, and `CARGO_PROFILE_DEV_DEBUG=CARGO_PROFILE_TEST_DEBUG=0` (both variables set individually). The target stayed exclusive through test exit. Process-scoped `RemoteSigned` allowed the trusted wrapper to run. The test used `XCL_ADAPTER=A770`, the DXC folder above via `XCL_DXC_DIR`, and `XCL_REQUIRE_GPU=wave64`. `XCL_SPLIT_WAVE64` and `XCL_DIRECT_DXIL` were unset. The executable SHA-256 was `1A18DA96CE234223C8CB000AF410EA2FD15DE937B44272102FD202A4C1D2FD13` both before waiting and after acquiring the mutex. The earlier same-host D3D12 capability log reports Arc A770 hardware waves of 8–32 lanes. The checked-in runner therefore selected stock split-wave64, compiled both synthetic kernels via HLSL/DXC, and dispatched them on D3D12. **1 passed, 0 failed, 0 ignored, 0 GPU skips**, 1,082 filtered out, 0.31 s, wrapper exit 0. The build completed with two Rust deprecation warnings. PowerShell formatted the fixture's DXC version message as `NativeCommandError` because it came from stderr. The fixture completed successfully. - With only lane 40 active, the HLSL had zero `xcl_x_rla_uniform` calls. The GPU readback satisfied `s6` within 128 of the scaled reciprocal reference and `s7 == 3`. Lane 40's `v3` became `3`, and inactive lane 0's `v3` retained `0xBEEF0000`. - With empty EXEC, the HLSL retained one exchange and the GPU readback satisfied `s6 == 0x12345678`, the value seeded in lane 0's `v1`. - The runner checks SGPR agreement between the two split halves on readback. The fixture reports assertions as a single test result and does not print the observed reciprocal value. ## Not tested Native wave64, forced split on a native-wave64 adapter, Direct DXIL, other GPUs, other fixtures, the full workspace suite, retail smoke, and performance. ## AI use T3 Code / Codex (`gpt-6.2-sol`) verified the PR and fixture, ran the focused test, checked the logs, and wrote this report.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 11:01 UTC · original

Independent Windows run on 5ae60ad. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug.

cargo build --offline --locked --workspace passed. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture reported 1,106 passed, 0 failed, 46 ignored, with 24 runtime skips included in Cargo's pass count. The stock uniform readfirstlane test passed.

For a separate synthetic check, LLVM MC 23.1.6 assembled a gfx1030 kernel with a branch on empty EXEC and a uniform float-add and conversion feeding v_readfirstlane_b32. I fed its 24-byte .text directly to XCL's HLSL/DXC runner. The RTX matched 3 scalar results and all 192 lane values across lower-half-only, mixed-half and empty EXEC. The optimized HLSL emitted zero cross-half exchange calls. With the optimization disabled in the same scratch checkout, it emitted one exchange call and returned the same values.

XCL_REQUIRE_GPU=wave64 with cargo test --offline --locked -p xcl --lib gpu_split_wave64_llvm_uniform_mask_edges -- --nocapture --test-threads=1 passed 1/0/0 with zero fixture skips in each run. This covers HLSL split-wave64 on wave32 hardware. Retail, native wave64, Direct DXIL and performance were outside this check. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote the scratch fixture, ran the tests, and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-25 11:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7160481337) Independent Windows run on [5ae60ad](https://github.com/xcl-dev/xcl/commit/5ae60ad0a9baefd8baa244f36f9e5712f83b37d4). Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug. `cargo build --offline --locked --workspace` passed. `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture` reported **1,106 passed, 0 failed, 46 ignored**, with 24 runtime skips included in Cargo's pass count. The stock uniform readfirstlane test passed. For a separate synthetic check, LLVM MC 23.1.6 assembled a gfx1030 kernel with a branch on empty EXEC and a uniform float-add and conversion feeding `v_readfirstlane_b32`. I fed its 24-byte .text directly to XCL's HLSL/DXC runner. The RTX matched **3 scalar results and all 192 lane values** across lower-half-only, mixed-half and empty EXEC. The optimized HLSL emitted zero cross-half exchange calls. With the optimization disabled in the same scratch checkout, it emitted one exchange call and returned the same values. `XCL_REQUIRE_GPU=wave64` with `cargo test --offline --locked -p xcl --lib gpu_split_wave64_llvm_uniform_mask_edges -- --nocapture --test-threads=1` passed 1/0/0 with zero fixture skips in each run. This covers HLSL split-wave64 on wave32 hardware. Retail, native wave64, Direct DXIL and performance were outside this check. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote the scratch fixture, ran the tests, and drafted this report.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 11:06 UTC · original

Diff review on 5ae60ad (x64_uniform.rs + emit.rs + tests.rs) looks clean, CI is green, and RTX 3060 Ti, RTX 3080 Ti, and Arc A770 checks all pass on 5ae60ad.

Only item remaining before merge is a quick XCL_SPLIT_WAVE64=1 AMD check (gpu_split_wave64_uniform_readfirstlane) on exact head 5ae60ad (the earlier RADV run was on pre-rebase 7c16823).

**@⁠raylitebull** on GitHub · 2026-11-25 11:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7160588544) Diff review on `5ae60ad` (`x64_uniform.rs` + `emit.rs` + `tests.rs`) looks clean, CI is green, and RTX 3060 Ti, RTX 3080 Ti, and Arc A770 checks all pass on `5ae60ad`. Only item remaining before merge is a quick `XCL_SPLIT_WAVE64=1` AMD check (`gpu_split_wave64_uniform_readfirstlane`) on exact head `5ae60ad` (the earlier RADV run was on pre-rebase `7c16823`).
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 01:45 UTC · original

Test report: Windows AMD RX 7800 XT, forced split wave64, exact head 5ae60ad

Commit tested: 5ae60ad0a9baefd8baa244f36f9e5712f83b37d4 (PR head, detached clean checkout). Control: exact parent 8f5fca5bb9ad6e695093d75294ad2cec023bba60.

Hardware / toolchain: AMD Radeon RX 7800 XT (RDNA3, physical; driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 Pro build 26200, Rust 1.100.0 MSVC, debug, DXC from Windows Kits 10.0.26100.0.

Adapter and path: a temporary probe test (not committed, removed afterwards) printed adapter=AMD Radeon RX 7800 XT wave64=true wave32=true. With XCL_SPLIT_WAVE64=1 it showed split_wave64_forced()=true runner::split_wave64()=true, and with the variable unset false/false. So the HLSL exchange-count assertions in the new test were active in the forced runs.

Head 5ae60ad, XCL_SPLIT_WAVE64=1

  • cargo test -p xcl --lib -j 4 -- x64_uniform gpu_split_wave64 readfirstlane gpu_bench_really_runs --test-threads=1: 11 passed, 0 failed, 0 ignored. Coverage:
    • gpu_split_wave64_uniform_readfirstlane: the uniform chains under a proven non-zero EXEC with only lane 40 active (exec_lo == 0), and the EXEC-may-be-0 case.
    • Divergent / read-first-lane: gpu_split_wave64_cross_half_operations, _waves_diverge, _local_and_exchanged_masks_in_diverging_waves.
    • _lane_local_masks, _masks_read_whole_after_partial_writes, _reduction_tails.
    • The 3 x64_uniform unit tests.
  • gpu_split_wave64_uniform_readfirstlane alone, run 5 times: 5/5 passed.
  • cargo test -p xcl --lib -j 4 -- gpu::recomp --test-threads=4: 345 passed, 0 failed, 19 ignored.

Head 5ae60ad, native wave64 (variable unset): -- gpu_split_wave64 x64_uniform --test-threads=1: 10 passed, 0 failed, 0 ignored.

Exact parent 8f5fca5, XCL_SPLIT_WAVE64=1

  • Same focused filter: 6 passed, 0 failed (all 6 existing gpu_split_wave64_* tests).
  • -- gpu::recomp --test-threads=4: 341 passed, 0 failed, 19 ignored. The 4 tests the head adds account for the difference.
  • I also copied the PR's new test unchanged into the parent as a temporary control:
    • It fails at only definition, 0 calls with left: 3, right: 1: the parent emits 2 xcl_x_rla_uniform exchanges where the head emits none.
    • With that count assertion turned into a print, every GPU value assertion passes on the parent: s6, s7 == 3, lane 40 / lane 0 v3, and EXEC == 0 reading the old lane 0 (whose "definition + 1 exchange kept" count also holds).
    • So on this card the head drops the exchanges and returns the same values as the parent.
    • The copied test passes on the parent with the variable unset (count assertions inactive).

SKIPPED: none from the filtered tests. The gpu::recomp runs print 6 SKIPPED sub-case lines inside the passing lower_dxil::tests::f16_programs_on_the_gpu and f32_programs_on_the_gpu: per-lane form refusals of V_MUL_F16, V_PK_MUL_F16 and V_CVT_F16_F32. Head and parent print the same lines.

Not tested: the whole workspace suite, NVIDIA / Intel, RDNA2 / RDNA4, release builds, a retail title or scripts/smoke.ps1.

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

**@⁠oni-swr** on GitHub · 2026-11-26 01:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7180105338) ### Test report: Windows AMD RX 7800 XT, forced split wave64, exact head `5ae60ad` **Commit tested:** `5ae60ad0a9baefd8baa244f36f9e5712f83b37d4` (PR head, detached clean checkout). Control: exact parent `8f5fca5bb9ad6e695093d75294ad2cec023bba60`. **Hardware / toolchain:** AMD Radeon RX 7800 XT (RDNA3, physical; driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 Pro build 26200, Rust 1.100.0 MSVC, debug, DXC from Windows Kits 10.0.26100.0. **Adapter and path:** a temporary probe test (not committed, removed afterwards) printed `adapter=AMD Radeon RX 7800 XT wave64=true wave32=true`. With `XCL_SPLIT_WAVE64=1` it showed `split_wave64_forced()=true runner::split_wave64()=true`, and with the variable unset `false/false`. So the HLSL exchange-count assertions in the new test were active in the forced runs. **Head `5ae60ad`, `XCL_SPLIT_WAVE64=1`** - `cargo test -p xcl --lib -j 4 -- x64_uniform gpu_split_wave64 readfirstlane gpu_bench_really_runs --test-threads=1`: **11 passed, 0 failed, 0 ignored**. Coverage: - `gpu_split_wave64_uniform_readfirstlane`: the uniform chains under a proven non-zero EXEC with only lane 40 active (`exec_lo == 0`), and the EXEC-may-be-0 case. - Divergent / read-first-lane: `gpu_split_wave64_cross_half_operations`, `_waves_diverge`, `_local_and_exchanged_masks_in_diverging_waves`. - `_lane_local_masks`, `_masks_read_whole_after_partial_writes`, `_reduction_tails`. - The 3 `x64_uniform` unit tests. - `gpu_split_wave64_uniform_readfirstlane` alone, run 5 times: **5/5 passed**. - `cargo test -p xcl --lib -j 4 -- gpu::recomp --test-threads=4`: **345 passed, 0 failed, 19 ignored**. **Head `5ae60ad`, native wave64 (variable unset):** `-- gpu_split_wave64 x64_uniform --test-threads=1`: **10 passed, 0 failed, 0 ignored**. **Exact parent `8f5fca5`, `XCL_SPLIT_WAVE64=1`** - Same focused filter: **6 passed, 0 failed** (all 6 existing `gpu_split_wave64_*` tests). - `-- gpu::recomp --test-threads=4`: **341 passed, 0 failed, 19 ignored**. The 4 tests the head adds account for the difference. - I also copied the PR's new test unchanged into the parent as a temporary control: - It **fails** at `only definition, 0 calls` with `left: 3, right: 1`: the parent emits 2 `xcl_x_rla_uniform` exchanges where the head emits none. - With that count assertion turned into a print, every GPU value assertion passes on the parent: `s6`, `s7 == 3`, lane 40 / lane 0 `v3`, and EXEC == 0 reading the old lane 0 (whose "definition + 1 exchange kept" count also holds). - So on this card the head drops the exchanges and returns the same values as the parent. - The copied test passes on the parent with the variable unset (count assertions inactive). **SKIPPED:** none from the filtered tests. The `gpu::recomp` runs print 6 `SKIPPED` sub-case lines inside the passing `lower_dxil::tests::f16_programs_on_the_gpu` and `f32_programs_on_the_gpu`: per-lane form refusals of `V_MUL_F16`, `V_PK_MUL_F16` and `V_CVT_F16_F32`. Head and parent print the same lines. **Not tested:** the whole workspace suite, NVIDIA / Intel, RDNA2 / RDNA4, release builds, a retail title or `scripts/smoke.ps1`. **AI use:** Claude Code (Claude Opus 5.5) ran the commands on this machine and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 03:52 UTC · original

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

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

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 03:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#issuecomment-7182100815) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-26 13:16 UTC · original · reviewed

Needs changes: exhausted shared loop budget can produce a false EXEC-nonzero proof. Exact PR head 5ae60ad0a9baefd8baa244f36f9e5712f83b37d4.

The runtime loop guard runs before a loop's first instruction, and its budget is shared across loops. x64_uniform::exec_nonzero adds guard-exit edges using only post-instruction facts. If an earlier loop exhausts the budget, a later loop beginning with s_mov_b64 exec, -1 is skipped. The analysis nevertheless propagates that nonzero EXEC fact past the second loop. A following predicated VGPR move must preserve the old value with EXEC zero, while the optimized readfirstlane can return its unconditional captured scalar instead.

Measured CPU regression: an isolated checkout with production code unchanged and one seven-instruction analysis fixture added produced 0 passed, 1 failed, 0 ignored, 0 skipped, at the false nonzero proof. The positive nonzero control ran before that assertion. Test-only source patch SHA-256: 642ab6d8895c86a270727dfb0f565707565204e1e7a5a0f898e6a61787db2a52.

A separate, uncommitted local repair makes guard-exit facts conservative over both pre- and post-instruction states, including the SCC relation. The identical regression plus all three original CPU analysis fixtures produced 4 passed, 0 failed, 0 ignored, 0 skipped. Repair source patch SHA-256: c51b1a9f9ad4547389f675ba3962945fab021d869d403ebdf5e4e1b55381d5fc. This repair is local and has not been pushed into the PR.

Exact filters:

  • gpu::recomp::x64_uniform::tests::exhausted_shared_loop_budget_does_not_prove_exec_nonzero
  • gpu::recomp::x64_uniform::tests::scalar_div_chain_with_nonzero_exec_is_captured
  • gpu::recomp::x64_uniform::tests::cbranch_execz_and_saved_exec_restore_prove_exec_nonzero
  • gpu::recomp::x64_uniform::tests::non_uniform_exec_maybe_zero_and_loop_exit_stay_conservative

Build each isolated worktree: cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Run each filter in a fresh process: <test-exe> <exact-filter> --exact --test-threads=1 --nocapture. Windows 11 Pro26200, i5-10400, 32GiB, Rust1.100.0 MSVC debug; private paths are placeholders.

Not tested: no shader loop was dispatched, no DXC/device call occurs in these finite analysis fixtures, and no GPU/title correctness or whole-suite result is claimed. Latest main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 has the same shared guard but not this optimization; the local repair was tested on the PR head, not a rebased integration. Source locations: x64_uniform.rs:115–120,147–149; mod.rs:638,1017,1138; emit.rs:6077.

AI use: Codex (GPT-6) reviewed the source and checked the stated evidence. Optional temporary Discord for coordinating contributor work, testing and comparing results.

**@⁠Prime1997** on GitHub · 2026-11-26 13:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/1193#pullrequestreview-6074768086) · **reviewed** **Needs changes: exhausted shared loop budget can produce a false EXEC-nonzero proof.** Exact PR head `5ae60ad0a9baefd8baa244f36f9e5712f83b37d4`. The runtime loop guard runs before a loop's first instruction, and its budget is shared across loops. `x64_uniform::exec_nonzero` adds guard-exit edges using only post-instruction facts. If an earlier loop exhausts the budget, a later loop beginning with `s_mov_b64 exec, -1` is skipped. The analysis nevertheless propagates that nonzero EXEC fact past the second loop. A following predicated VGPR move must preserve the old value with EXEC zero, while the optimized readfirstlane can return its unconditional captured scalar instead. **Measured CPU regression:** an isolated checkout with production code unchanged and one seven-instruction analysis fixture added produced **0 passed, 1 failed, 0 ignored, 0 skipped**, at the false nonzero proof. The positive nonzero control ran before that assertion. Test-only source patch SHA-256: `642ab6d8895c86a270727dfb0f565707565204e1e7a5a0f898e6a61787db2a52`. A separate, uncommitted local repair makes guard-exit facts conservative over both pre- and post-instruction states, including the SCC relation. The identical regression plus all three original CPU analysis fixtures produced **4 passed, 0 failed, 0 ignored, 0 skipped**. Repair source patch SHA-256: `c51b1a9f9ad4547389f675ba3962945fab021d869d403ebdf5e4e1b55381d5fc`. This repair is local and has not been pushed into the PR. Exact filters: - `gpu::recomp::x64_uniform::tests::exhausted_shared_loop_budget_does_not_prove_exec_nonzero` - `gpu::recomp::x64_uniform::tests::scalar_div_chain_with_nonzero_exec_is_captured` - `gpu::recomp::x64_uniform::tests::cbranch_execz_and_saved_exec_restore_prove_exec_nonzero` - `gpu::recomp::x64_uniform::tests::non_uniform_exec_maybe_zero_and_loop_exit_stay_conservative` Build each isolated worktree: `cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>`. Run each filter in a fresh process: `<test-exe> <exact-filter> --exact --test-threads=1 --nocapture`. Windows 11 Pro26200, i5-10400, 32GiB, Rust1.100.0 MSVC debug; private paths are placeholders. **Not tested:** no shader loop was dispatched, no DXC/device call occurs in these finite analysis fixtures, and no GPU/title correctness or whole-suite result is claimed. Latest main `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7` has the same shared guard but not this optimization; the local repair was tested on the PR head, not a rebased integration. Source locations: `x64_uniform.rs:115–120,147–149`; `mod.rs:638,1017,1138`; `emit.rs:6077`. AI use: Codex (GPT-6) reviewed the source and checked the stated evidence. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating contributor work, testing and comparing results.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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