Direct DXIL: skip unused compare/DATA1 VGPR reads on single-operand atomics #2077

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

@⁠certified-retart on GitHub · 2026-11-25 03:16 UTC · original
certified-retart:dxil/atomic-no-spurious-vreg → main · +167 −6 · 3 files · 1 commits · open

Skip reading the unused second/compare VGPR in Direct DXIL (#1426) lowering for single-operand buffer, global/flat, image, and LDS atomics. Part of #1269.

Previously all five Direct DXIL atomic paths unconditionally called self.vreg(...) for the compare / DATA1 operand even when the instruction only takes a single data operand:

  • atomic64 read cmp and cmp + 1 on non-cmpswap/fcmpswap 64-bit atomics.
  • buffer_atomic read vdata + 1 on non-cmpswap/fcmpswap 32-bit MUBUF atomics.
  • flat_atomic read data + 1 on non-cmpswap/fcmpswap 32-bit global/flat atomics.
  • ds read f("DATA1") (which is 0 / v0 in single-data DS encodings) on every DS atomic other than cmpst_* / mskor_b32.
  • image_atomic read vdata + 1 on non-cmpswap/fcmpswap image atomics.

In per-instruction Direct DXIL this emitted dead VGPR loads; in the per-lane Direct DXIL bridge (recomp/lower_dxil), it caused every single-operand atomic to be refused because the bridge only supplies the registers the instruction actually reads (rdna2::vgpr_uses).

What is in it

  • crates/xcl/src/gpu/dxil/lower_mem.rs: gate the compare/DATA1 self.vreg(...) reads in atomic64, buffer_atomic, flat_atomic, and ds so only cmpswap / fcmpswap (and cmpst_* / mskor_b32 for DS) read the second operand; pass c(0) / c64(0) otherwise.
  • crates/xcl/src/gpu/dxil/lower_image.rs: gate self.vreg(vdata + 1) in image_atomic on matches!(opn, "cmpswap" | "fcmpswap").
  • crates/xcl/src/gpu/recomp/lower_dxil.rs: add per_lane_bridges_atomics_without_spurious_vreg_reads (wave32 and wave64 bridge + DXIL validation covering 32/64-bit MUBUF, global, image, and LDS 1-data and 2-data atomics) and per_lane_atomics_run_on_the_gpu (real GPU dispatch checking exact output and parity with per-instruction Direct DXIL).

Measured impact (retail shader pack, 2,689 compute programs)

  • XCL_RECOMP_NO_HLSL=1 xcl shaders <pack> --recomp --top 25:
    • Per-lane Direct DXIL compute programs passing: 579 → 705 / 2,689 (+126 CS programs, +21.8%).
    • Per-lane refused for instructions only: 1,078 → 952 (-126).
    • Eliminates all single-operand MUBUF/global/LDS/image atomic refusals in per-lane Direct DXIL (e.g. BUFFER_ATOMIC_ADD 563 → 0, BUFFER_ATOMIC_UMIN 359 → 0, DS_WRXCHG_RTN_B32 64 → 0, DS_ADD_U32 60 → 0, DS_ADD_RTN_U32 44 → 0, DS_MAX_U32 35 → 0, DS_MIN_U32 35 → 0, DS_OR_B32 28 → 0).
    • Per-instruction Direct DXIL remains 2,689 / 2,689 CS and 9,282 / 9,282 MS ok.

Tested

  • Host: Windows 11, AMD Ryzen 7 9800X3D, NVIDIA GeForce RTX 5070 (12 GB), Agility SDK v614 (XCL_D3D12_DIR), DXC 1.9.2602.17.
  • cargo test -p xcl --lib -- per_lane_bridges_atomics_without_spurious_vreg_reads per_lane_atomics_run_on_the_gpu --nocapture: 2 passed, 0 failed (real GPU execution + per-instruction parity).
  • cargo test --workspace -- --test-threads=4: all workspace unit and integration tests passed, 0 failed.
  • XCL_RECOMP_NO_HLSL=1 target\release\xcl.exe shaders <pack> --recomp --top 25 on 1bcd2c7: verified 705 per-lane CS ok and 0 single-operand atomic refusals.

Regression run
main:

xcl-smoke v1
commit: cbc296ab65a2661a61e3e2da109134bcd5319f60
gpu: NVIDIA GeForce RTX 5070
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1682 (PresentX 1682)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15030 MB

PR:

xcl-smoke v1
commit: 1bcd2c7a9abee4b41ba23dbc33c07f8248003a8e
gpu: NVIDIA GeForce RTX 5070
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1683 (PresentX 1683)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14888 MB

Not tested

  • AMD / Intel GPUs and native wave64-hardware-only GPU tests.
  • IMAGE_ATOMIC_CMPSWAP in the per-lane bridge (its two-VGPR DMASK=3 vgpr_uses tracking is separate from this PR).

AI use

  • Antigravity with Gemini 4 Neon: identified the unused VGPR reads across all five Direct DXIL atomic paths, implemented the fix and unit/GPU tests, and ran the workspace test suite, shader-pack sweep, and matched 60 s smoke tests locally on an RTX 5070.
**@⁠certified-retart** on GitHub · 2026-11-25 03:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/2077) `certified-retart:dxil/atomic-no-spurious-vreg` → `main` · +167 −6 · 3 files · 1 commits · open Skip reading the unused second/compare VGPR in Direct DXIL (`#1426`) lowering for single-operand buffer, global/flat, image, and LDS atomics. Part of #1269. Previously all five Direct DXIL atomic paths unconditionally called `self.vreg(...)` for the compare / `DATA1` operand even when the instruction only takes a single data operand: - `atomic64` read `cmp` and `cmp + 1` on non-`cmpswap`/`fcmpswap` 64-bit atomics. - `buffer_atomic` read `vdata + 1` on non-`cmpswap`/`fcmpswap` 32-bit MUBUF atomics. - `flat_atomic` read `data + 1` on non-`cmpswap`/`fcmpswap` 32-bit global/flat atomics. - `ds` read `f("DATA1")` (which is `0` / `v0` in single-data DS encodings) on every DS atomic other than `cmpst_*` / `mskor_b32`. - `image_atomic` read `vdata + 1` on non-`cmpswap`/`fcmpswap` image atomics. In per-instruction Direct DXIL this emitted dead VGPR loads; in the per-lane Direct DXIL bridge (`recomp/lower_dxil`), it caused every single-operand atomic to be refused because the bridge only supplies the registers the instruction actually reads (`rdna2::vgpr_uses`). **What is in it** - `crates/xcl/src/gpu/dxil/lower_mem.rs`: gate the compare/`DATA1` `self.vreg(...)` reads in `atomic64`, `buffer_atomic`, `flat_atomic`, and `ds` so only `cmpswap` / `fcmpswap` (and `cmpst_*` / `mskor_b32` for DS) read the second operand; pass `c(0)` / `c64(0)` otherwise. - `crates/xcl/src/gpu/dxil/lower_image.rs`: gate `self.vreg(vdata + 1)` in `image_atomic` on `matches!(opn, "cmpswap" | "fcmpswap")`. - `crates/xcl/src/gpu/recomp/lower_dxil.rs`: add `per_lane_bridges_atomics_without_spurious_vreg_reads` (wave32 and wave64 bridge + DXIL validation covering 32/64-bit MUBUF, global, image, and LDS 1-data and 2-data atomics) and `per_lane_atomics_run_on_the_gpu` (real GPU dispatch checking exact output and parity with per-instruction Direct DXIL). **Measured impact (retail shader pack, 2,689 compute programs)** - `XCL_RECOMP_NO_HLSL=1 xcl shaders <pack> --recomp --top 25`: - Per-lane Direct DXIL compute programs passing: `579` → `705` / `2,689` (**`+126` CS programs, +21.8%**). - Per-lane refused for instructions only: `1,078` → `952` (`-126`). - Eliminates all single-operand MUBUF/global/LDS/image atomic refusals in per-lane Direct DXIL (e.g. `BUFFER_ATOMIC_ADD` `563` → `0`, `BUFFER_ATOMIC_UMIN` `359` → `0`, `DS_WRXCHG_RTN_B32` `64` → `0`, `DS_ADD_U32` `60` → `0`, `DS_ADD_RTN_U32` `44` → `0`, `DS_MAX_U32` `35` → `0`, `DS_MIN_U32` `35` → `0`, `DS_OR_B32` `28` → `0`). - Per-instruction Direct DXIL remains `2,689 / 2,689` CS and `9,282 / 9,282` MS ok. **Tested** - Host: Windows 11, AMD Ryzen 7 9800X3D, NVIDIA GeForce RTX 5070 (12 GB), Agility SDK v614 (`XCL_D3D12_DIR`), DXC `1.9.2602.17`. - `cargo test -p xcl --lib -- per_lane_bridges_atomics_without_spurious_vreg_reads per_lane_atomics_run_on_the_gpu --nocapture`: 2 passed, 0 failed (real GPU execution + per-instruction parity). - `cargo test --workspace -- --test-threads=4`: all workspace unit and integration tests passed, 0 failed. - `XCL_RECOMP_NO_HLSL=1 target\release\xcl.exe shaders <pack> --recomp --top 25` on `1bcd2c7`: verified `705` per-lane CS ok and `0` single-operand atomic refusals. **Regression run** main: ``` xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: NVIDIA GeForce RTX 5070 title: 6ca5cab7 seconds: 60 exit: 0x0 frames shown: 1682 (PresentX 1682) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15030 MB ``` PR: ``` xcl-smoke v1 commit: 1bcd2c7a9abee4b41ba23dbc33c07f8248003a8e gpu: NVIDIA GeForce RTX 5070 title: 6ca5cab7 seconds: 60 exit: 0x0 frames shown: 1683 (PresentX 1683) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14888 MB ``` **Not tested** - AMD / Intel GPUs and native wave64-hardware-only GPU tests. - `IMAGE_ATOMIC_CMPSWAP` in the per-lane bridge (its two-VGPR `DMASK=3` `vgpr_uses` tracking is separate from this PR). **AI use** - Antigravity with Gemini 4 Neon: identified the unused VGPR reads across all five Direct DXIL atomic paths, implemented the fix and unit/GPU tests, and ran the workspace test suite, shader-pack sweep, and matched 60 s smoke tests locally on an RTX 5070.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:17:50 +00:00
Author
Owner

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

Tested

  • XCL PR #2077 at 1bcd2c7a9abee4b41ba23dbc33c07f8248003a8e. The PR was open at this SHA before and after testing. The existing detached checkout matched that SHA and was clean both times. The PR discussion and GPU-results issue #42 contained no equivalent Arc A770 result when checked.
  • STOR-WINLAB, Windows 11 Enterprise Evaluation 26200.9974, AMD Ryzen 7 3800X (6 cores and 12 logical processors exposed), Intel Arc A770 Graphics driver 32.0.101.9175, rustc 1.100.0 (0ef1bc386) and Cargo 1.100.0 on x86_64-pc-windows-msvc. Both fixture logs confirm the selected directory supplied dxcompiler.dll 1.9.2609.5 (01b62ad4) and dxil.dll 1.9.2609.5.
  • The CPU fixture passed in 0.10 s. Both wave32 and wave64 per-lane Direct DXIL compute variants had an empty refusal list and passed DXIL validation. The synthetic program covers 32-bit and 64-bit MUBUF add and compare-swap, MUBUF unsigned min, 32-bit and 64-bit global add, 32-bit global compare-swap, image add, and the LDS add, exchange, min, max, OR, compare-store and masked OR forms in the fixture.
  • The GPU fixture passed in 0.25 s. It dispatched one 32-thread wave32 group for each of the per-lane and per-instruction Direct DXIL paths on the Arc A770 using the Windows inbox D3D12 runtime. Per-lane readback passed all eight exact checks for buffer, global and LDS atomics, including both words of each 64-bit add. The first ten dwords, [32, 10, 32, 0, 42, 64, 32, 0, 64, 90], matched the per-instruction Direct DXIL readback exactly.
  • Each exact run reported 1 passed, 0 failed, 0 ignored, 0 skipped and 1,125 filtered out. Total across the two runs was 2 passed, 0 failed, 0 ignored, 0 skipped. Both processes exited 0 and neither log contained a SKIPPED notice. The prebuild and CPU fixture ran outside the Arc mutex. The wrapper logged acquisition and release around the GPU fixture.
$run = 'L:/XclTooling/pr2077/run-20261125T032140877Z'
$env:PATH = "$env:USERPROFILE/.cargo/bin;$env:PATH"
$env:TEMP = Join-Path $run 'temp'
$env:TMP = $env:TEMP
$env:CARGO_TARGET_DIR = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target'
$env:CARGO_BUILD_JOBS = '2'
$env:CARGO_INCREMENTAL = '0'
$env:CARGO_PROFILE_DEV_DEBUG = '0'
$env:CARGO_PROFILE_TEST_DEBUG = '0'
$env:XCL_ADAPTER = 'A770'
$env:XCL_DXC_DIR = "$env:LOCALAPPDATA/XclTooling/dxc-1.9.2609/bin/x64"
$env:XCL_DXIL_CACHE = Join-Path $run 'dxil-cache'
cargo test --locked -p xcl --lib --no-run --message-format=json
$env:XCL_PR2077_TEST_EXE = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
& $env:XCL_PR2077_TEST_EXE 'gpu::recomp::lower_dxil::tests::per_lane_bridges_atomics_without_spurious_vreg_reads' --exact --nocapture --test-threads=1
$gpuCommand = '& ''L:/XclTooling/Invoke-ArcTest.ps1'' -Test { & $env:XCL_PR2077_TEST_EXE ''gpu::recomp::lower_dxil::tests::per_lane_atomics_run_on_the_gpu'' --exact --nocapture --test-threads=1 }; exit $LASTEXITCODE'
$encoded = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($gpuCommand))
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -EncodedCommand $encoded

Cargo identified the executable in prebuild.jsonl. The test profile was unoptimized with debug info disabled. prebuild.stderr.log, cpu.stdout.log, cpu.stderr.log, gpu.stdout.log, and gpu.stderr.log are in the run directory.

Not tested

Native wave64 GPU dispatch, GPU image atomics, GPU atomic forms outside the readback fixture, per-lane image compare-swap lowering, HLSL parity, other adapters or drivers, retail shaders or titles, smoke runs, or the full suite.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the two checked-in fixtures and wrote this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 03:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/2077#issuecomment-7151911360) **Tested** - XCL PR #2077 at `1bcd2c7a9abee4b41ba23dbc33c07f8248003a8e`. The PR was open at this SHA before and after testing. The existing detached checkout matched that SHA and was clean both times. The PR discussion and GPU-results issue #42 contained no equivalent Arc A770 result when checked. - STOR-WINLAB, Windows 11 Enterprise Evaluation `26200.9974`, AMD Ryzen 7 3800X (6 cores and 12 logical processors exposed), Intel Arc A770 Graphics driver `32.0.101.9175`, rustc `1.100.0 (0ef1bc386)` and Cargo `1.100.0` on `x86_64-pc-windows-msvc`. Both fixture logs confirm the selected directory supplied `dxcompiler.dll` `1.9.2609.5 (01b62ad4)` and `dxil.dll` `1.9.2609.5`. - The CPU fixture passed in 0.10 s. Both wave32 and wave64 per-lane Direct DXIL compute variants had an empty refusal list and passed DXIL validation. The synthetic program covers 32-bit and 64-bit MUBUF add and compare-swap, MUBUF unsigned min, 32-bit and 64-bit global add, 32-bit global compare-swap, image add, and the LDS add, exchange, min, max, OR, compare-store and masked OR forms in the fixture. - The GPU fixture passed in 0.25 s. It dispatched one 32-thread wave32 group for each of the per-lane and per-instruction Direct DXIL paths on the Arc A770 using the Windows inbox D3D12 runtime. Per-lane readback passed all eight exact checks for buffer, global and LDS atomics, including both words of each 64-bit add. The first ten dwords, `[32, 10, 32, 0, 42, 64, 32, 0, 64, 90]`, matched the per-instruction Direct DXIL readback exactly. - Each exact run reported 1 passed, 0 failed, 0 ignored, 0 skipped and 1,125 filtered out. Total across the two runs was **2 passed, 0 failed, 0 ignored, 0 skipped**. Both processes exited `0` and neither log contained a `SKIPPED` notice. The prebuild and CPU fixture ran outside the Arc mutex. The wrapper logged acquisition and release around the GPU fixture. ```powershell $run = 'L:/XclTooling/pr2077/run-20261125T032140877Z' $env:PATH = "$env:USERPROFILE/.cargo/bin;$env:PATH" $env:TEMP = Join-Path $run 'temp' $env:TMP = $env:TEMP $env:CARGO_TARGET_DIR = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target' $env:CARGO_BUILD_JOBS = '2' $env:CARGO_INCREMENTAL = '0' $env:CARGO_PROFILE_DEV_DEBUG = '0' $env:CARGO_PROFILE_TEST_DEBUG = '0' $env:XCL_ADAPTER = 'A770' $env:XCL_DXC_DIR = "$env:LOCALAPPDATA/XclTooling/dxc-1.9.2609/bin/x64" $env:XCL_DXIL_CACHE = Join-Path $run 'dxil-cache' cargo test --locked -p xcl --lib --no-run --message-format=json $env:XCL_PR2077_TEST_EXE = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' & $env:XCL_PR2077_TEST_EXE 'gpu::recomp::lower_dxil::tests::per_lane_bridges_atomics_without_spurious_vreg_reads' --exact --nocapture --test-threads=1 $gpuCommand = '& ''L:/XclTooling/Invoke-ArcTest.ps1'' -Test { & $env:XCL_PR2077_TEST_EXE ''gpu::recomp::lower_dxil::tests::per_lane_atomics_run_on_the_gpu'' --exact --nocapture --test-threads=1 }; exit $LASTEXITCODE' $encoded = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($gpuCommand)) powershell.exe -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -EncodedCommand $encoded ``` Cargo identified the executable in `prebuild.jsonl`. The test profile was unoptimized with debug info disabled. `prebuild.stderr.log`, `cpu.stdout.log`, `cpu.stderr.log`, `gpu.stdout.log`, and `gpu.stderr.log` are in the run directory. **Not tested** Native wave64 GPU dispatch, GPU image atomics, GPU atomic forms outside the readback fixture, per-lane image compare-swap lowering, HLSL parity, other adapters or drivers, retail shaders or titles, smoke runs, or the full suite. **AI use** T3 Code / Codex (`gpt-6.2-sol`) ran the two checked-in fixtures and wrote this report.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-25 03:37 UTC · original

NVIDIA and AMD full-suite run, to go with the Intel Arc A770 report above. Tested exact head 1bcd2c7 (on its base cbc296a).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1144 passed, 0 failed, 44 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: per_lane_bridges_atomics_without_spurious_vreg_reads, per_lane_atomics_run_on_the_gpu.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1155 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main cbc296a too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

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

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-25 03:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/2077#issuecomment-7152093873) NVIDIA and AMD full-suite run, to go with the Intel Arc A770 report above. Tested exact head `1bcd2c7` (on its base `cbc296a`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1144 passed, 0 failed, 44 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `per_lane_bridges_atomics_without_spurious_vreg_reads`, `per_lane_atomics_run_on_the_gpu`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1155 passed, 0 failed, 46 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `cbc296a` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DarkPanda69 on GitHub · 2026-11-25 03:53 UTC · original

AMD run with native 64-lane waves, which this PR lists as not tested (the other reports here are Arc).

Tested: pass, head 1bcd2c7 applied on its base main cbc296a, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17. cargo test -p xcl --lib -- gpu:: --test-threads=4:

  • AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, waves 32..64: 586 passed, 2 failed, 22 ignored. per_lane_atomics_run_on_the_gpu and per_lane_bridges_atomics_without_spurious_vreg_reads ok. The 2 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 and _3, the same as on main cbc296a without this PR on this card.
  • NVIDIA RTX 3060, driver 32.0.16.1088: 588 passed, 0 failed, 22 ignored. Same tests ok.

Not tested: IMAGE_ATOMIC_CMPSWAP in the per-lane bridge.

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

**@⁠DarkPanda69** on GitHub · 2026-11-25 03:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/2077#issuecomment-7152328353) AMD run with native 64-lane waves, which this PR lists as not tested (the other reports here are Arc). **Tested:** pass, head `1bcd2c7` applied on its base `main` `cbc296a`, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17. `cargo test -p xcl --lib -- gpu:: --test-threads=4`: - AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, waves 32..64: 586 passed, 2 failed, 22 ignored. `per_lane_atomics_run_on_the_gpu` and `per_lane_bridges_atomics_without_spurious_vreg_reads` ok. The 2 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` and `_3`, the same as on `main` `cbc296a` without this PR on this card. - NVIDIA RTX 3060, driver 32.0.16.1088: 588 passed, 0 failed, 22 ignored. Same tests ok. **Not tested:** `IMAGE_ATOMIC_CMPSWAP` in the per-lane bridge. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 05:10 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 05:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/2077#issuecomment-7153511012) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-25 05:22 UTC · original

A run with vkd3d-proton as the host D3D12: per_lane_atomics_run_on_the_gpu fails here, with the per-lane and per-instruction forms agreeing with each other on the wrong values.

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, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 1bcd2c7 as it is (merge base with main cbc296a), no uncommitted changes. The lib test binary runs under Wine, one test per process.
    • per_lane_bridges_atomics_without_spurious_vreg_reads: ok.
    • per_lane_atomics_run_on_the_gpu: fails at lower_dxil.rs:1149, BUFFER_ATOMIC_ADD, left: 90, right: 32.
  • To see all ten values, I added a local println! before the first assertion and reverted it afterwards (the result above is from the unchanged head). Three runs, each giving the same output:
    per-lane  [90, 10, 32, 0, 42, 64, 32, 0, 0, 0]
    per-inst  [90, 10, 32, 0, 42, 64, 32, 0, 0, 0]
    expected  [32, 10, 32, 0, 42, 64, 32, 0, 64, 0x5A]
    
    So the buffer UMIN, ADD_X2, CMPSWAP and global atomics match. out[0] holds 90 (= 0x5A, the value expected in out[9]), and out[8]/out[9] stay 0. That looks like lane 0's two GLOBAL_STORE_DWORDs of the LDS results landing at byte 0 rather than 32/36, or the LDS part going wrong. I have not narrowed it down. Both forms give the same values, so this is not a per-lane-only difference.

Not tested

  • whether this test fails the same way on main's code for these instructions (the test is new in this PR), native Windows, AMD.

AI use

  • Claude Code (Claude Opus 5.5) built the commit, 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-25 05:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/2077#issuecomment-7153702184) A run with vkd3d-proton as the host D3D12: `per_lane_atomics_run_on_the_gpu` fails here, with the per-lane and per-instruction forms agreeing with each other on the wrong values. **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, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `1bcd2c7` as it is (merge base with `main` `cbc296a`), no uncommitted changes. The lib test binary runs under Wine, one test per process. - `per_lane_bridges_atomics_without_spurious_vreg_reads`: ok. - `per_lane_atomics_run_on_the_gpu`: **fails** at `lower_dxil.rs:1149`, `BUFFER_ATOMIC_ADD`, `left: 90`, `right: 32`. - To see all ten values, I added a local `println!` before the first assertion and reverted it afterwards (the result above is from the unchanged head). Three runs, each giving the same output: ``` per-lane [90, 10, 32, 0, 42, 64, 32, 0, 0, 0] per-inst [90, 10, 32, 0, 42, 64, 32, 0, 0, 0] expected [32, 10, 32, 0, 42, 64, 32, 0, 64, 0x5A] ``` So the buffer UMIN, ADD_X2, CMPSWAP and global atomics match. `out[0]` holds 90 (= `0x5A`, the value expected in `out[9]`), and `out[8]`/`out[9]` stay 0. That looks like lane 0's two `GLOBAL_STORE_DWORD`s of the LDS results landing at byte 0 rather than 32/36, or the LDS part going wrong. I have not narrowed it down. Both forms give the same values, so this is not a per-lane-only difference. **Not tested** - whether this test fails the same way on `main`'s code for these instructions (the test is new in this PR), native Windows, AMD. **AI use** - Claude Code (Claude Opus 5.5) built the commit, 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

@⁠certified-retart on GitHub · 2026-11-25 06:40 UTC · original

Thanks for testing on vkd3d-proton and printing all 10 dwords, @⁠JoaoPauluu!

The fact that both per-lane and per-inst (which is untouched main lowering) produce the exact same [90, 10, 32, 0, 42, 64, 32, 0, 0, 0] — while native Windows NVIDIA (RTX 5070 / 5070 Ti / 3060 Ti), AMD iGPU, and Intel Arc A770 all produce [32, 10, 32, 0, 42, 64, 32, 0, 64, 90] — confirms this isn't a per-lane or #2077-specific bug.

Very interesting clue though: 90 == 0x5A is the exact result of DS_CMPST_RTN_B32 + DS_MSKOR_RTN_B32 + DS_READ_B32, so the LDS atomics succeeded, and then both lane-0 GLOBAL_STORE_DWORDs (at byte 32 and byte 36) appear to have written to byte 0 (overwriting out[0] with 64 then 90 while leaving out[1]=10 and out[8..9]=0). That smells like a dxil-spirv / NVIDIA Linux Vulkan quirk around rawBufferStore (or its undef elementOffset) when the same RawBuffer UAV also has atomicBinOp / atomicCompareExchange in the same shader. Worth investigating separately if it reproduces on main!

**@⁠certified-retart** on GitHub · 2026-11-25 06:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/2077#issuecomment-7155039762) Thanks for testing on vkd3d-proton and printing all 10 dwords, @⁠JoaoPauluu! The fact that both `per-lane` and `per-inst` (which is untouched `main` lowering) produce the exact same `[90, 10, 32, 0, 42, 64, 32, 0, 0, 0]` — while native Windows NVIDIA (RTX 5070 / 5070 Ti / 3060 Ti), AMD iGPU, and Intel Arc A770 all produce `[32, 10, 32, 0, 42, 64, 32, 0, 64, 90]` — confirms this isn't a per-lane or #2077-specific bug. Very interesting clue though: `90 == 0x5A` is the exact result of `DS_CMPST_RTN_B32` + `DS_MSKOR_RTN_B32` + `DS_READ_B32`, so the LDS atomics succeeded, and then both lane-0 `GLOBAL_STORE_DWORD`s (at `byte 32` and `byte 36`) appear to have written to `byte 0` (overwriting `out[0]` with `64` then `90` while leaving `out[1]=10` and `out[8..9]=0`). That smells like a `dxil-spirv` / NVIDIA Linux Vulkan quirk around `rawBufferStore` (or its `undef` `elementOffset`) when the same `RawBuffer` UAV also has `atomicBinOp` / `atomicCompareExchange` in the same shader. Worth investigating separately if it reproduces on `main`!
Author
Owner

@⁠bmjask on GitHub · 2026-11-25 17:18 UTC · original

@⁠certified-retart can you join our discord please, message the mods

**@⁠bmjask** on GitHub · 2026-11-25 17:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/2077#issuecomment-7169310037) @⁠certified-retart can you join our discord please, message the mods
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/gpu/dxil/lower_image.rs
  • crates/xcl/src/gpu/recomp/lower_dxil.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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