Tests: verify direct RDNA2-to-DXIL lowering across shader stages on GPU #1658

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

@⁠Vadson159 on GitHub · 2026-11-24 18:51 UTC · original
Vadson159:tests/gpu-dxil-lowering → main · +443 −0 · 1 files · 1 commits · open

Adds end-to-end GPU execution, DXIL container validation, and HLSL-differential integration tests in crates/xcl/tests/gpu_dxil_lowering.rs for the direct RDNA2 -> DXIL backend (xcl::gpu::dxil::kernel), exercising all five translate_* entry points against gpu::recomp + DXC baselines without requiring XCL_DIRECT_DXIL.

What is in it

  • direct_dxil_kernel_control_flow_exec_and_whole_wave: verifies Mode::Kernel (translate_full) nested EXEC save/restore (S_AND_SAVEEXEC_B64, S_XOR_B64, S_CBRANCH_EXECZ), cross-half wave masks (S_BCNT1_I32_B64, S_FF1_I32_B64, V_MBCNT_*), V_READLANE_B32 / V_READFIRSTLANE_B32, DS_SWIZZLE_B32 / DS_BPERMUTE_B32, and irreducible two-entry loop CFG splitting against HLSL cs_6_6 and dxil::validate::validate.
  • direct_dxil_kernel_memory_lds_and_exact_valu: verifies SMEM (S_LOAD_DWORDX4), MUBUF load/store/atomic including out-of-bounds lanes, GLOBAL atomic/barrier/load, FLAT load/store, LDS (DS_WRITE_B32, DS_ADD_RTN_U32, DS_ADD_U32, DS_READ_B32), and exact VALU semantics (V_FRACT_F32 on +inf/-2^-25, V_MIN_F32/V_MAX_F32 on -0/+0/NaN, V_CMP_CLASS_F32 with ABS/NEG, 64-bit carry V_ADD_CO_U32/V_ADD_CO_CI_U32, clamped V_PK_ADD_I16) across native wave64, split-wave64, and wave32.
  • direct_dxil_compute_dispatch_spin_partial_and_2d: verifies Mode::Compute (translate_compute) with runner::dispatch across 128-thread multi-wave LDS + DS_BPERMUTE_B32 (tg_size=true, Partner::Spin), [8,4,1] 2D thread IDs, partial [40,1,1] wave (Partner::Present), and [16,1,1] (Partner::Missing).
  • direct_dxil_graphics_interp_discard_compr_and_mixed_linking: verifies Mode::Vertex and Mode::Pixel (translate_vertex, translate_pixel) with runner::draw: f16 (V_INTERP_P1LL_F16/V_INTERP_P2_F16) and f32 (V_INTERP_MOV_F32) interpolation, SV_IsFrontFace (input_ena=0x1302), conditional DONE=1 discard (V_CMPX_GT_F32), COMPR=1 f16 export, and mixed direct/HLSL stage linking in wave64 and wave32.
  • direct_dxil_mesh_two_passes: verifies Mode::Mesh (translate_mesh) paired with mesh_passthrough and ps_6_6 via runner::mesh_draw in native wave64 and split-wave64, comparing rendered pixels and MESH_HEADER records.
  • direct_dxil_rejects_heap_windows_and_reports_unsupported_op: non-GPU unit test verifying HEAP_WINDOWS refusal across all five translate_* functions and explicit error reporting for unsupported S_GETREG_B32.

Tested

  • Windows 11 Pro (10.0.26300), AMD Ryzen 7 9800X3D 8-Core Processor, AMD Radeon RX 9070 XT (driver 32.0.32029.2010), Rust 1.100.0 (0ef1bc386 2026-11-09), debug build, Windows SDK DXC dxcompiler 1.8.2502.11 / dxil 1.8.2502.11.
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 864 passed, 0 failed, 42 ignored (XCL_SAMPLE_* unset); GPU tests skipped on this adapter: 1 (no heap windows: heap_window_out_of_memory_falls_back_to_the_switch_form in tests/gpu_compute_e2e.rs).
  • cargo test -p xcl --test gpu_dxil_lowering -- --nocapture: 6 passed, 0 failed, 0 ignored (0 GPU tests skipped).

Not tested

  • Release profile builds and retail game scripts/smoke.ps1 / XCL_SAMPLE_* tests (no retail game files or sample dumps in this environment).
  • Adapters lacking native wave64 or mesh shader support (covered only by test skip gates).

AI use

  • Antigravity (exact model name not exposed to the agent; not guessing per AGENTS.md) designed and implemented crates/xcl/tests/gpu_dxil_lowering.rs, ran the local build and test suite, and prepared this PR.
**@⁠Vadson159** on GitHub · 2026-11-24 18:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/1658) `Vadson159:tests/gpu-dxil-lowering` → `main` · +443 −0 · 1 files · 1 commits · open Adds end-to-end GPU execution, DXIL container validation, and HLSL-differential integration tests in `crates/xcl/tests/gpu_dxil_lowering.rs` for the direct RDNA2 -> DXIL backend (`xcl::gpu::dxil::kernel`), exercising all five `translate_*` entry points against `gpu::recomp` + DXC baselines without requiring `XCL_DIRECT_DXIL`. **What is in it** - `direct_dxil_kernel_control_flow_exec_and_whole_wave`: verifies `Mode::Kernel` (`translate_full`) nested EXEC save/restore (`S_AND_SAVEEXEC_B64`, `S_XOR_B64`, `S_CBRANCH_EXECZ`), cross-half wave masks (`S_BCNT1_I32_B64`, `S_FF1_I32_B64`, `V_MBCNT_*`), `V_READLANE_B32` / `V_READFIRSTLANE_B32`, `DS_SWIZZLE_B32` / `DS_BPERMUTE_B32`, and irreducible two-entry loop CFG splitting against HLSL `cs_6_6` and `dxil::validate::validate`. - `direct_dxil_kernel_memory_lds_and_exact_valu`: verifies SMEM (`S_LOAD_DWORDX4`), MUBUF load/store/atomic including out-of-bounds lanes, GLOBAL atomic/barrier/load, FLAT load/store, LDS (`DS_WRITE_B32`, `DS_ADD_RTN_U32`, `DS_ADD_U32`, `DS_READ_B32`), and exact VALU semantics (`V_FRACT_F32` on `+inf`/`-2^-25`, `V_MIN_F32`/`V_MAX_F32` on `-0/+0`/`NaN`, `V_CMP_CLASS_F32` with `ABS`/`NEG`, 64-bit carry `V_ADD_CO_U32`/`V_ADD_CO_CI_U32`, clamped `V_PK_ADD_I16`) across native wave64, split-wave64, and wave32. - `direct_dxil_compute_dispatch_spin_partial_and_2d`: verifies `Mode::Compute` (`translate_compute`) with `runner::dispatch` across 128-thread multi-wave LDS + `DS_BPERMUTE_B32` (`tg_size=true`, `Partner::Spin`), `[8,4,1]` 2D thread IDs, partial `[40,1,1]` wave (`Partner::Present`), and `[16,1,1]` (`Partner::Missing`). - `direct_dxil_graphics_interp_discard_compr_and_mixed_linking`: verifies `Mode::Vertex` and `Mode::Pixel` (`translate_vertex`, `translate_pixel`) with `runner::draw`: f16 (`V_INTERP_P1LL_F16`/`V_INTERP_P2_F16`) and f32 (`V_INTERP_MOV_F32`) interpolation, `SV_IsFrontFace` (`input_ena=0x1302`), conditional `DONE=1` discard (`V_CMPX_GT_F32`), `COMPR=1` f16 export, and mixed direct/HLSL stage linking in wave64 and wave32. - `direct_dxil_mesh_two_passes`: verifies `Mode::Mesh` (`translate_mesh`) paired with `mesh_passthrough` and `ps_6_6` via `runner::mesh_draw` in native wave64 and split-wave64, comparing rendered pixels and `MESH_HEADER` records. - `direct_dxil_rejects_heap_windows_and_reports_unsupported_op`: non-GPU unit test verifying `HEAP_WINDOWS` refusal across all five `translate_*` functions and explicit error reporting for unsupported `S_GETREG_B32`. **Tested** - Windows 11 Pro (`10.0.26300`), AMD Ryzen 7 9800X3D 8-Core Processor, AMD Radeon RX 9070 XT (driver `32.0.32029.2010`), Rust `1.100.0` (`0ef1bc386` `2026-11-09`), debug build, Windows SDK DXC `dxcompiler 1.8.2502.11` / `dxil 1.8.2502.11`. - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): `864` passed, `0` failed, `42` ignored (`XCL_SAMPLE_*` unset); GPU tests skipped on this adapter: `1` (`no heap windows`: `heap_window_out_of_memory_falls_back_to_the_switch_form` in `tests/gpu_compute_e2e.rs`). - `cargo test -p xcl --test gpu_dxil_lowering -- --nocapture`: `6` passed, `0` failed, `0` ignored (`0` GPU tests skipped). **Not tested** - Release profile builds and retail game `scripts/smoke.ps1` / `XCL_SAMPLE_*` tests (no retail game files or sample dumps in this environment). - Adapters lacking native wave64 or mesh shader support (covered only by test skip gates). **AI use** - Antigravity (exact model name not exposed to the agent; not guessing per `AGENTS.md`) designed and implemented `crates/xcl/tests/gpu_dxil_lowering.rs`, ran the local build and test suite, and prepared this PR.
Why: the direct RDNA2 -> DXIL backend (`xcl::gpu::dxil::kernel`) validates
bitcode in unit tests, while `scripts/test.ps1` does not run `translate_*`
outputs on D3D12 hardware unless `XCL_DIRECT_DXIL` is enabled globally.
Add `crates/xcl/tests/gpu_dxil_lowering.rs` to exercise the five public
`translate_*` entry points and compare GPU results against the HLSL -> DXC
baseline.

What is covered:
- `Mode::Kernel`: EXEC save/restore/cbranch_execz, cross-half wave masks,
  readlane/readfirstlane, swizzle/bpermute, irreducible two-entry loop CFG,
  SMEM/MUBUF(+OOB)/GLOBAL/FLAT/LDS barriers and atomics, and exact VALU edge
  cases (`v_fract_f32`, `-0/+0`/`NaN` min/max, `v_cmp_class_f32`, carries,
  saturated `v_pk_add_i16`).
- `Mode::Compute`: native wave64, split-wave64 (`Partner::Spin` multi-wave
  LDS/bpermute, `Partner::Present` partial 40-thread wave), wave32
  (`[8,4,1]` 2D thread IDs and `[16,1,1]` `Partner::Missing`).
- `Mode::Vertex` + `Mode::Pixel`: f16/f32 interpolation, `SV_IsFrontFace`,
  conditional `DONE=1` discard, `COMPR=1` f16 export, and mixed direct/HLSL
  stage linking in wave64 and wave32.
- `Mode::Mesh`: two-pass mesh emission paired with `mesh_passthrough` and
  `ps_6_6` in native wave64 and split-wave64.
- Refusal contracts: `HEAP_WINDOWS` rejection across all five entry points
  and unsupported instruction error reporting (`S_GETREG_B32`).

Measured: `.\scripts\test.ps1` passed on Windows 11 Pro (Ryzen 7 9800X3D,
AMD Radeon RX 9070 XT): workspace tests 864 passed, 0 failed, 42 ignored
(1 GPU test skipped: `no heap windows`), with `gpu_dxil_lowering` passing
6/6 (0 skipped).

Assisted-by: Antigravity (exact model name unknown)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:00:45 +00:00
Author
Owner

@⁠nnonno91 on GitHub · 2026-11-24 18:56 UTC · original

Independent two-adapter check at 3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8. The RTX 5090 exposes a lane-order assumption in the new atomic-return comparison.

Tested

  • Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, RTX 5090 (617.42 / 32.0.16.1742) and AMD Radeon(TM) Graphics (32.0.21042.62), Rust 1.100.0 MSVC, SDK DXC 1.8.2502.11. Debug/test profiles with debug info disabled. Used XCL_ADAPTER='RTX 5090' or 'AMD Radeon', and separate XCL caches.
  • cargo build --workspace --locked passed. cargo test --locked -p xcl --test gpu_dxil_lowering -- --test-threads=1 --nocapture gave 6 passed, 0 failed on AMD and 5 passed, 1 failed on NVIDIA, 0 ignored and 0 explicit skips on both. The RTX 5090 exercised split-wave64 and wave32. AMD also exercised native wave64.
  • cargo test --locked -p xcl --test gpu_dxil_lowering -- --exact direct_dxil_kernel_memory_lds_and_exact_valu --test-threads=1 --nocapture reproduced the same first failure 5/5 on the RTX 5090 (split-w64: lane 0 v3, direct 280, HLSL 312).
  • cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output reported 864 passed, 0 failed, 42 ignored on AMD and 863 passed, 1 failed, 42 ignored on NVIDIA. The only failure was the same new test. Both pass counts include the heap-window fallback skip (heap windows off). NVIDIA's count also includes two explicit no-wave64 skips (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware). The bundled title test passed on both.

Atomic-return diagnostic

cargo test --locked -p xcl --test atomic_order_probe -- --exact check_atomic_return_sets_and_final_sums --test-threads=1 --nocapture passed once on each adapter, 0 ignored and 0 skips. In this temporary adaptation I kept the original shader, initial registers and memory. For the two contended atomic return registers I checked each backend's sorted old values against the exact expected range and checked the final count. All the other original checks stayed active.

RTX 5090, split wave64 Lane 0 direct / HLSL Old values, both paths Final, both paths
BUFFER_ATOMIC_ADD (v3) 280 / 312 280–343, each once 344
GLOBAL_ATOMIC_ADD (v4) 10 / 42 10–73, each once 74

The old values were assigned to different lanes in both RTX 5090 split-wave64 comparisons. Each path accounted for all 64 increments. This fixture can check those two return registers by their full value sets and final counters, while keeping the per-lane comparisons for the other outputs. HLSL InterlockedAdd semantics

Not tested

Retail shaders or titles, console-hardware ordering, release builds, or performance.

AI use

OpenAI Codex (GPT-6 family, exact variant unavailable) adapted the temporary diagnostic, ran the tests, and drafted the report.

**@⁠nnonno91** on GitHub · 2026-11-24 18:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/1658#issuecomment-7141377900) Independent two-adapter check at `3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8`. The RTX 5090 exposes a lane-order assumption in the new atomic-return comparison. **Tested** - Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, RTX 5090 (617.42 / 32.0.16.1742) and AMD Radeon(TM) Graphics (32.0.21042.62), Rust 1.100.0 MSVC, SDK DXC 1.8.2502.11. Debug/test profiles with debug info disabled. Used `XCL_ADAPTER='RTX 5090'` or `'AMD Radeon'`, and separate XCL caches. - `cargo build --workspace --locked` passed. `cargo test --locked -p xcl --test gpu_dxil_lowering -- --test-threads=1 --nocapture` gave **6 passed, 0 failed** on AMD and **5 passed, 1 failed** on NVIDIA, 0 ignored and 0 explicit skips on both. The RTX 5090 exercised split-wave64 and wave32. AMD also exercised native wave64. - `cargo test --locked -p xcl --test gpu_dxil_lowering -- --exact direct_dxil_kernel_memory_lds_and_exact_valu --test-threads=1 --nocapture` reproduced the same first failure **5/5** on the RTX 5090 (`split-w64: lane 0 v3`, direct 280, HLSL 312). - `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output` reported **864 passed, 0 failed, 42 ignored** on AMD and **863 passed, 1 failed, 42 ignored** on NVIDIA. The only failure was the same new test. Both pass counts include the heap-window fallback skip (heap windows off). NVIDIA's count also includes two explicit no-wave64 skips (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`). The bundled title test passed on both. **Atomic-return diagnostic** `cargo test --locked -p xcl --test atomic_order_probe -- --exact check_atomic_return_sets_and_final_sums --test-threads=1 --nocapture` passed once on each adapter, 0 ignored and 0 skips. In this temporary adaptation I kept the original shader, initial registers and memory. For the two contended atomic return registers I checked each backend's sorted old values against the exact expected range and checked the final count. All the other original checks stayed active. | RTX 5090, split wave64 | Lane 0 direct / HLSL | Old values, both paths | Final, both paths | | --- | --- | --- | ---: | | `BUFFER_ATOMIC_ADD` (v3) | 280 / 312 | 280–343, each once | 344 | | `GLOBAL_ATOMIC_ADD` (v4) | 10 / 42 | 10–73, each once | 74 | The old values were assigned to different lanes in both RTX 5090 split-wave64 comparisons. Each path accounted for all 64 increments. This fixture can check those two return registers by their full value sets and final counters, while keeping the per-lane comparisons for the other outputs. [HLSL InterlockedAdd semantics](https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/interlockedadd) **Not tested** Retail shaders or titles, console-hardware ordering, release builds, or performance. **AI use** OpenAI Codex (GPT-6 family, exact variant unavailable) adapted the temporary diagnostic, ran the tests, and drafted the report.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 19:01 UTC · original

Ran the new suite on an AMD card, where this PR's whole point is validating the direct path outside NVIDIA. Result on RX 7900 XT (native wave64), Proton Experimental + patched vkd3d-proton v3.1, DXC 1.9.2609.5 from the pinned manifest, release profile, XCL_DIRECT_DXIL=1, PR head 3d0eee78 as-is:

  • direct_dxil_mesh_two_passes: ok
  • direct_dxil_graphics_interp_discard_compr_and_mixed_linking: ok
  • direct_dxil_kernel_memory_lds_and_exact_valu: ok
  • direct_dxil_rejects_heap_windows_and_reports_unsupported_op: ok
  • direct_dxil_compute_dispatch_spin_partial_and_2d: FAILED 2/2 (deterministic), crates/xcl/tests/gpu_dxil_lowering.rs:277, assertion "compute spin split-w64"
  • direct_dxil_kernel_control_flow_exec_and_whole_wave: FAILED 2/2 (deterministic), panic at gpu_dxil_lowering.rs:88

The spin_partial diff shape looks relevant: expected buffer has zeros at masked-off lane slots (odd indices), actual has non-zero values in exactly those slots. So lanes that should have been predicated off still performed their writes on this card, in split-wave64 mode. That is the same mask-discipline theme as the forced-split failures I documented on #847 (three deterministic failures plus a cross-test mask leak there), which suggests both suites are hitting one root cause in half/mask handling on native wave64 hardware rather than two separate bugs.

Counts only, no game data.

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

**@⁠SlopTart** on GitHub · 2026-11-24 19:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/1658#issuecomment-7141477854) Ran the new suite on an AMD card, where this PR's whole point is validating the direct path outside NVIDIA. Result on RX 7900 XT (native wave64), Proton Experimental + patched vkd3d-proton v3.1, DXC 1.9.2609.5 from the pinned manifest, release profile, `XCL_DIRECT_DXIL=1`, PR head `3d0eee78` as-is: - `direct_dxil_mesh_two_passes`: ok - `direct_dxil_graphics_interp_discard_compr_and_mixed_linking`: ok - `direct_dxil_kernel_memory_lds_and_exact_valu`: ok - `direct_dxil_rejects_heap_windows_and_reports_unsupported_op`: ok - `direct_dxil_compute_dispatch_spin_partial_and_2d`: FAILED 2/2 (deterministic), `crates/xcl/tests/gpu_dxil_lowering.rs:277`, assertion "compute spin split-w64" - `direct_dxil_kernel_control_flow_exec_and_whole_wave`: FAILED 2/2 (deterministic), panic at `gpu_dxil_lowering.rs:88` The spin_partial diff shape looks relevant: expected buffer has zeros at masked-off lane slots (odd indices), actual has non-zero values in exactly those slots. So lanes that should have been predicated off still performed their writes on this card, in split-wave64 mode. That is the same mask-discipline theme as the forced-split failures I documented on #847 (three deterministic failures plus a cross-test mask leak there), which suggests both suites are hitting one root cause in half/mask handling on native wave64 hardware rather than two separate bugs. Counts only, no game data. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠WebIdentity1 on GitHub · 2026-11-24 19:34 UTC · original

RTX 3090 Ampere confirmation for exact head 3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8: I reproduced the RTX 5090 report's split-wave64 atomic-return lane-order failure. A local test-only comparison of complete atomic old-value sets passes all six tests while preserving the other per-lane and final-memory assertions. I found no distinct Ampere translation failure in this focused suite.

Tested

  • Windows 10 Home 19045, Ryzen 7 7800X3D, RTX 3090 driver 591.74, Rust 1.98.1 MSVC, Agility 1.620.2, SDK DXC/DXIL 1.8.2502.11, debug. SSH Session 0. XCL_ADAPTER=3090, XCL_REQUIRE_GPU=mesh, XCL_D3D12_DIR pointing at the existing public Agility x64 directory; XCL_DIRECT_DXIL and XCL_HEAP_WINDOWS unset. No XCL_SAMPLE_* inputs.
  • Exact, unmodified head: cargo test --locked -p xcl --test gpu_dxil_lowering -- --test-threads=1 --show-output --nocapture → 5 passed / 1 failed / 0 ignored, no explicit skip or timeout. The sole failure is direct_dxil_kernel_memory_lds_and_exact_valu, split-w64: lane 0 v3, direct 280, HLSL 312. The isolated test reproduced the same first failure in 3/3 fresh processes (0 passed / 1 failed / 0 ignored each).
  • Local diagnostic patch changes only the comparison for the two contended atomic-return registers, v3 and v4: each backend's sorted old-value set must equal every integer in the expected range (280..280+lanes and 10..10+lanes). It retains all other per-lane comparisons, SGPR/SCC checks, got.mem == want.mem, and the test's explicit final-memory assertions. The whole gpu_dxil_lowering target then reports 6 passed / 0 failed / 0 ignored, no skips or timeouts. Diagnostic test source SHA256 89f6a1f2fbe32e564c31988c63006fb8a8dc8cfbc4f2c7a6f21e44e4f1c1a371, matching the Windows copy during that run.
  • After the diagnostic, I restored the exact head. All 293 tracked source file hashes matched the Windows tree again. No commit, push, or new PR.

Setup correction: an initial run without XCL_D3D12_DIR could not create an SM 6.6 device on this Windows 10 host; XCL_REQUIRE_GPU=mesh consequently made five GPU skips look like failures. The temporary gate diagnostic identified the missing Agility directory. Those five setup failures are excluded from the results above.

Not tested: full workspace on this head, retail title/shaders, another driver, release build, or performance. The local atomic-set diagnostic demonstrates a sounder oracle for this fixture; it does not prove all direct DXIL operations correct. The PR author owns the test fix.

AI use: Codex (GPT-6) ran the native tests, diagnosed the Agility setup, wrote the local oracle diagnostic, verified source hashes, and prepared this report.

Local test-only oracle patch
diff --git a/crates/xcl/tests/gpu_dxil_lowering.rs b/crates/xcl/tests/gpu_dxil_lowering.rs
index 7210e44..89dd1d5 100644
--- a/crates/xcl/tests/gpu_dxil_lowering.rs
+++ b/crates/xcl/tests/gpu_dxil_lowering.rs
@@ -90,11 +90,23 @@ fn assert_kernel_matches(
         assert_eq!(got.sgpr[s], want.sgpr[s], "{label}: s{s}");
     }
     assert_eq!(got.scc, want.scc, "{label}: scc");
+    let atomic_set = check_vgpr.contains(&4); // only the memory/LDS fixture checks v4
     for l in 0..lanes {
         for &v in check_vgpr {
+            if atomic_set && (v == 3 || v == 4) { continue; }
             assert_eq!(got.vgpr[l][v], want.vgpr[l][v], "{label}: lane {l} v{v}");
         }
     }
+    if atomic_set {
+        for (v, first) in [(3usize, 280u32), (4, 10)] {
+            let expected: Vec<u32> = (first..first + lanes as u32).collect();
+            for (backend, output) in [("direct", &got), ("hlsl", &want)] {
+                let mut old: Vec<u32> = (0..lanes).map(|l| output.vgpr[l][v]).collect();
+                old.sort_unstable();
+                assert_eq!(old, expected, "{label}: {backend} v{v} complete old-value set");
+            }
+        }
+    }
     assert_eq!(got.mem, want.mem, "{label}: memory");
     got
 }

**@⁠WebIdentity1** on GitHub · 2026-11-24 19:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/1658#issuecomment-7142288825) RTX 3090 Ampere confirmation for exact head `3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8`: I reproduced [the RTX 5090 report's](https://git.gtahub.st/github/xcl-dev--xcl/pulls/1658) split-wave64 atomic-return lane-order failure. A local test-only comparison of complete atomic old-value sets passes all six tests while preserving the other per-lane and final-memory assertions. I found no distinct Ampere translation failure in this focused suite. **Tested** - Windows 10 Home 19045, Ryzen 7 7800X3D, RTX 3090 driver 591.74, Rust 1.98.1 MSVC, Agility 1.620.2, SDK DXC/DXIL 1.8.2502.11, debug. SSH Session 0. `XCL_ADAPTER=3090`, `XCL_REQUIRE_GPU=mesh`, `XCL_D3D12_DIR` pointing at the existing public Agility x64 directory; `XCL_DIRECT_DXIL` and `XCL_HEAP_WINDOWS` unset. No `XCL_SAMPLE_*` inputs. - Exact, unmodified head: `cargo test --locked -p xcl --test gpu_dxil_lowering -- --test-threads=1 --show-output --nocapture` → **5 passed / 1 failed / 0 ignored**, no explicit skip or timeout. The sole failure is `direct_dxil_kernel_memory_lds_and_exact_valu`, `split-w64: lane 0 v3`, direct `280`, HLSL `312`. The isolated test reproduced the same first failure in **3/3** fresh processes (`0 passed / 1 failed / 0 ignored` each). - Local diagnostic patch changes only the comparison for the two contended atomic-return registers, v3 and v4: each backend's sorted old-value set must equal every integer in the expected range (`280..280+lanes` and `10..10+lanes`). It retains all other per-lane comparisons, SGPR/SCC checks, `got.mem == want.mem`, and the test's explicit final-memory assertions. The whole `gpu_dxil_lowering` target then reports **6 passed / 0 failed / 0 ignored**, no skips or timeouts. Diagnostic test source SHA256 `89f6a1f2fbe32e564c31988c63006fb8a8dc8cfbc4f2c7a6f21e44e4f1c1a371`, matching the Windows copy during that run. - After the diagnostic, I restored the exact head. All **293 tracked source file hashes** matched the Windows tree again. No commit, push, or new PR. **Setup correction:** an initial run without `XCL_D3D12_DIR` could not create an SM 6.6 device on this Windows 10 host; `XCL_REQUIRE_GPU=mesh` consequently made five GPU skips look like failures. The temporary gate diagnostic identified the missing Agility directory. Those five setup failures are excluded from the results above. **Not tested:** full workspace on this head, retail title/shaders, another driver, release build, or performance. The local atomic-set diagnostic demonstrates a sounder oracle for this fixture; it does not prove all direct DXIL operations correct. The PR author owns the test fix. **AI use:** Codex (GPT-6) ran the native tests, diagnosed the Agility setup, wrote the local oracle diagnostic, verified source hashes, and prepared this report. <details><summary>Local test-only oracle patch</summary> ```diff diff --git a/crates/xcl/tests/gpu_dxil_lowering.rs b/crates/xcl/tests/gpu_dxil_lowering.rs index 7210e44..89dd1d5 100644 --- a/crates/xcl/tests/gpu_dxil_lowering.rs +++ b/crates/xcl/tests/gpu_dxil_lowering.rs @@ -90,11 +90,23 @@ fn assert_kernel_matches( assert_eq!(got.sgpr[s], want.sgpr[s], "{label}: s{s}"); } assert_eq!(got.scc, want.scc, "{label}: scc"); + let atomic_set = check_vgpr.contains(&4); // only the memory/LDS fixture checks v4 for l in 0..lanes { for &v in check_vgpr { + if atomic_set && (v == 3 || v == 4) { continue; } assert_eq!(got.vgpr[l][v], want.vgpr[l][v], "{label}: lane {l} v{v}"); } } + if atomic_set { + for (v, first) in [(3usize, 280u32), (4, 10)] { + let expected: Vec<u32> = (first..first + lanes as u32).collect(); + for (backend, output) in [("direct", &got), ("hlsl", &want)] { + let mut old: Vec<u32> = (0..lanes).map(|l| output.vgpr[l][v]).collect(); + old.sort_unstable(); + assert_eq!(old, expected, "{label}: {backend} v{v} complete old-value set"); + } + } + } assert_eq!(got.mem, want.mem, "{label}: memory"); got } ``` </details>
Author
Owner

@⁠LocranKing on GitHub · 2026-11-24 20:03 UTC · original

Independent Windows release-build check on NVIDIA Ampere (RTX 3060 Ti, wave32) at 3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8: reproduces the same direct_dxil_kernel_memory_lds_and_exact_valu failure reported by @⁠nnonno91 on RTX 5090; the other 5 tests in gpu_dxil_lowering pass.

Setup

  • GPU: NVIDIA GeForce RTX 3060 Ti (8024 MiB VRAM, Ampere, wave32), driver 32.0.16.2101
  • CPU / RAM: AMD Ryzen 5 5500 (6C/12T), 31.8 GB RAM
  • OS: Windows 11 Home Single Language, build 26200
  • Toolchain: rustc 1.100.0, DXC / validator 1.9.2602.17 (Windows SDK 10.0.26100.0), --release

Results (cargo test --workspace --release --no-fail-fast -- --test-threads=4)

  • Exit 101: 863 passed, 1 failed, 42 ignored across 21 result blocks (SKIPPED: 2 no wave64, 2 no D3D12 debug layer, heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows).
  • gpu_dxil_lowering (5 passed, 1 failed):
    • direct_dxil_graphics_interp_discard_compr_and_mixed_linking — ok
    • direct_dxil_rejects_heap_windows_and_reports_unsupported_op — ok
    • direct_dxil_mesh_two_passes — ok
    • direct_dxil_kernel_control_flow_exec_and_whole_wave — ok
    • direct_dxil_compute_dispatch_spin_partial_and_2d — ok
    • direct_dxil_kernel_memory_lds_and_exact_valu — FAILED:
      thread 'direct_dxil_kernel_memory_lds_and_exact_valu' panicked at crates\xcl\tests\gpu_dxil_lowering.rs:95:13:
      assertion `left == right` failed: split-w64: lane 0 v3
        left: 280
       right: 312
      

Not tested: Debug build, AMD / native wave64 hardware, retail title run.

AI use: Antigravity (Gemini 4 Neon) built and ran the workspace test suite on this hardware and drafted this report from the captured output; reviewed before posting. No game files attached.

**@⁠LocranKing** on GitHub · 2026-11-24 20:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/1658#issuecomment-7142980450) Independent Windows release-build check on NVIDIA Ampere (`RTX 3060 Ti`, wave32) at `3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8`: reproduces the same `direct_dxil_kernel_memory_lds_and_exact_valu` failure reported by @⁠nnonno91 on RTX 5090; the other 5 tests in `gpu_dxil_lowering` pass. **Setup** - GPU: NVIDIA GeForce RTX 3060 Ti (`8024 MiB VRAM`, Ampere, wave32), driver `32.0.16.2101` - CPU / RAM: AMD Ryzen 5 5500 (6C/12T), `31.8 GB` RAM - OS: Windows 11 Home Single Language, build `26200` - Toolchain: `rustc 1.100.0`, DXC / validator `1.9.2602.17` (Windows SDK `10.0.26100.0`), `--release` **Results (`cargo test --workspace --release --no-fail-fast -- --test-threads=4`)** - Exit `101`: **863 passed, 1 failed, 42 ignored** across 21 result blocks (`SKIPPED`: 2 `no wave64`, 2 `no D3D12 debug layer`, `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`). - `gpu_dxil_lowering` (**5 passed, 1 failed**): - `direct_dxil_graphics_interp_discard_compr_and_mixed_linking` — ok - `direct_dxil_rejects_heap_windows_and_reports_unsupported_op` — ok - `direct_dxil_mesh_two_passes` — ok - `direct_dxil_kernel_control_flow_exec_and_whole_wave` — ok - `direct_dxil_compute_dispatch_spin_partial_and_2d` — ok - `direct_dxil_kernel_memory_lds_and_exact_valu` — **FAILED**: ``` thread 'direct_dxil_kernel_memory_lds_and_exact_valu' panicked at crates\xcl\tests\gpu_dxil_lowering.rs:95:13: assertion `left == right` failed: split-w64: lane 0 v3 left: 280 right: 312 ``` **Not tested:** Debug build, AMD / native wave64 hardware, retail title run. **AI use:** Antigravity (`Gemini 4 Neon`) built and ran the workspace test suite on this hardware and drafted this report from the captured output; reviewed before posting. No game files attached.
Author
Owner

@⁠thiagocalile on GitHub · 2026-11-24 20:27 UTC · original

Tested commit 3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8 on an AMD Radeon RX 6600 (RDNA2, native 64-lane waves): all targeted tests passed.

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64 + mesh shaders, driver 32.0.21045.29003; XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11, debug build.
  • XCL_ADAPTER=radeon cargo test -p xcl --lib gpu::dxil -- --test-threads=4: 80 passed, 0 failed, 1 ignored (29.8s).
  • XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 861 passed, 3 failed, 42 ignored (79.36s).
    • The 3 workspace failures are pre-existing on main on this RX 6600 (placed_title_textures_share_vram_and_preserve_pixels: 3D mip subresource mismatch, plus 2 mutex-poison cascades transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory; tracked by #1028).
    • SKIPPED (not counted as coverage): heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows (plus D3D12 debug-layer tests skip because d3d12SDKLayers.dll is not installed).

Not tested

  • Retail title run (scripts/smoke.ps1 — no game executable here), D3D12 debug layer, NVIDIA / Intel GPUs, Linux / Wine.

AI use

  • Antigravity (Gemini 4 Neon) ran the test suites on my RX 6600 and drafted this report; I checked the results before posting.
**@⁠thiagocalile** on GitHub · 2026-11-24 20:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/1658#issuecomment-7143566079) Tested commit `3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8` on an AMD Radeon RX 6600 (RDNA2, native 64-lane waves): all targeted tests passed. **Tested** - Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64 + mesh shaders, driver `32.0.21045.29003`; `XCL_ADAPTER=radeon`), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (`10.0.26200.0`), Rust `1.100.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.8.2502.11`, debug build. - `XCL_ADAPTER=radeon cargo test -p xcl --lib gpu::dxil -- --test-threads=4`: **80 passed, 0 failed, 1 ignored** (`29.8s`). - `XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4`: **861 passed, 3 failed, 42 ignored** (`79.36s`). - The 3 workspace failures are pre-existing on `main` on this RX 6600 (`placed_title_textures_share_vram_and_preserve_pixels`: 3D mip subresource mismatch, plus 2 mutex-poison cascades `transitions_apply_when_their_list_is_submitted` and `d32s8_targets_take_their_own_size_of_video_memory`; tracked by #1028). - `SKIPPED` (not counted as coverage): `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows` (plus D3D12 debug-layer tests skip because `d3d12SDKLayers.dll` is not installed). **Not tested** - Retail title run (`scripts/smoke.ps1` — no game executable here), D3D12 debug layer, NVIDIA / Intel GPUs, Linux / Wine. **AI use** - Antigravity (Gemini 4 Neon) ran the test suites on my RX 6600 and drafted this report; I checked the results before posting.
Author
Owner

@⁠malzaharhub-ctrl on GitHub · 2026-11-24 20:42 UTC · original

Independent Windows test — RX 7900 XTX

Tested commit: 3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8

Hardware / environment

  • GPU: AMD Radeon RX 7900 XTX (24 GB)
  • Driver: 32.0.32029.2010 (18 November 2026)
  • OS: Windows 11 Pro, build 26300
  • Rust: 1.100.0
  • DXC / DXIL: 1.9.2602.17

Test command

cargo test --locked -p xcl --test gpu_dxil_lowering -- --test-threads=1 --nocapture

Results: 5 passed, 1 failed

Passing:

  • direct_dxil_compute_dispatch_spin_partial_and_2d
  • direct_dxil_graphics_interp_discard_compr_and_mixed_linking
  • direct_dxil_kernel_control_flow_exec_and_whole_wave
  • direct_dxil_mesh_two_passes
  • direct_dxil_rejects_heap_windows_and_reports_unsupported_op

Failing:

  • direct_dxil_kernel_memory_lds_and_exact_valu

The failure is in split-w64:

assertion `left == right` failed: split-w64: lane 0 v3
left: 280
right: 312

I reran the failing test individually and reproduced the exact same mismatch.

The test completed the preceding native-Wave64 configuration before failing in split-Wave64. This suggests the issue is specific to the split-Wave64 path, although I haven't investigated the underlying cause.

The checkout was clean before testing, and no source changes were made.

AI assistance disclosure: ChatGPT assisted with interpreting the test output and drafting this report. I independently ran the tests on the hardware and environment listed above.

Hopefully this additional Windows/RDNA3 result helps narrow down the split-Wave64 issue.

**@⁠malzaharhub-ctrl** on GitHub · 2026-11-24 20:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/1658#issuecomment-7143949085) ### Independent Windows test — RX 7900 XTX Tested commit: `3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8` **Hardware / environment** - GPU: AMD Radeon RX 7900 XTX (24 GB) - Driver: `32.0.32029.2010` (18 November 2026) - OS: Windows 11 Pro, build 26300 - Rust: 1.100.0 - DXC / DXIL: 1.9.2602.17 **Test command** ```powershell cargo test --locked -p xcl --test gpu_dxil_lowering -- --test-threads=1 --nocapture ``` **Results: 5 passed, 1 failed** Passing: - `direct_dxil_compute_dispatch_spin_partial_and_2d` - `direct_dxil_graphics_interp_discard_compr_and_mixed_linking` - `direct_dxil_kernel_control_flow_exec_and_whole_wave` - `direct_dxil_mesh_two_passes` - `direct_dxil_rejects_heap_windows_and_reports_unsupported_op` Failing: - `direct_dxil_kernel_memory_lds_and_exact_valu` The failure is in `split-w64`: ```text assertion `left == right` failed: split-w64: lane 0 v3 left: 280 right: 312 ``` I reran the failing test individually and reproduced the exact same mismatch. The test completed the preceding native-Wave64 configuration before failing in split-Wave64. This suggests the issue is specific to the split-Wave64 path, although I haven't investigated the underlying cause. The checkout was clean before testing, and no source changes were made. **AI assistance disclosure:** ChatGPT assisted with interpreting the test output and drafting this report. I independently ran the tests on the hardware and environment listed above. Hopefully this additional Windows/RDNA3 result helps narrow down the split-Wave64 issue.
Author
Owner

@⁠malzaharhub-ctrl on GitHub · 2026-11-24 20:54 UTC · original

Independent test report — RX 7900 XTX / Windows 11

Tested PR #1658 at commit 3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8.

Hardware and environment

  • Windows 11 Pro, build 26300
  • AMD Ryzen 7 5800X
  • AMD Radeon RX 7900 XTX, 24 GB
  • AMD driver 32.0.32029.2010 (18 November 2026)
  • Rust 1.100.0
  • DXC / DXIL 1.9.2602.17

Initial test

cargo test --locked -p xcl --test gpu_dxil_lowering -- --test-threads=1 --nocapture

Result: 5 passed, 1 failed.

The only failure was direct_dxil_kernel_memory_lds_and_exact_valu:

split-w64: lane 0 v3

  • Direct DXIL: 280
  • HLSL baseline: 312

Follow-up diagnostic

I temporarily modified the test comparison, leaving the translation code unchanged. I skipped lane-by-lane comparisons for the two contended atomic return registers in split-wave64 and compared their sorted results instead.

Results:

  • MUBUF atomic (v3): both backends produced exactly 280–343.
  • GLOBAL atomic (v4): both backends produced exactly 10–73.
  • Final memory comparison: zero differences.
  • All remaining assertions passed.

The temporary test modification was reverted. The original file's SHA-256 was verified after restoration, and git status confirmed a clean working tree.

Conclusion

This independently reproduces the lane-specific atomic return mismatch on an AMD RX 7900 XTX under Windows native D3D12. The identical sorted return-value sets and matching final memory strongly suggest that the current lane-by-lane comparison is sensitive to different atomic scheduling between two separate executions, rather than an incorrect final atomic result.

I have not tested any game files.

AI assistance disclosure: ChatGPT assisted with analysing the test output and drafting this report. I independently ran the commands and GPU tests, inspected the results, and verified that the temporary test modification was reverted.

**@⁠malzaharhub-ctrl** on GitHub · 2026-11-24 20:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/1658#issuecomment-7144218133) ### Independent test report — RX 7900 XTX / Windows 11 Tested PR #1658 at commit `3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8`. **Hardware and environment** - Windows 11 Pro, build 26300 - AMD Ryzen 7 5800X - AMD Radeon RX 7900 XTX, 24 GB - AMD driver `32.0.32029.2010` (18 November 2026) - Rust `1.100.0` - DXC / DXIL `1.9.2602.17` **Initial test** `cargo test --locked -p xcl --test gpu_dxil_lowering -- --test-threads=1 --nocapture` Result: 5 passed, 1 failed. The only failure was `direct_dxil_kernel_memory_lds_and_exact_valu`: `split-w64: lane 0 v3` - Direct DXIL: `280` - HLSL baseline: `312` **Follow-up diagnostic** I temporarily modified the test comparison, leaving the translation code unchanged. I skipped lane-by-lane comparisons for the two contended atomic return registers in split-wave64 and compared their sorted results instead. Results: - MUBUF atomic (`v3`): both backends produced exactly `280–343`. - GLOBAL atomic (`v4`): both backends produced exactly `10–73`. - Final memory comparison: zero differences. - All remaining assertions passed. The temporary test modification was reverted. The original file's SHA-256 was verified after restoration, and `git status` confirmed a clean working tree. **Conclusion** This independently reproduces the lane-specific atomic return mismatch on an AMD RX 7900 XTX under Windows native D3D12. The identical sorted return-value sets and matching final memory strongly suggest that the current lane-by-lane comparison is sensitive to different atomic scheduling between two separate executions, rather than an incorrect final atomic result. I have not tested any game files. **AI assistance disclosure:** ChatGPT assisted with analysing the test output and drafting this report. I independently ran the commands and GPU tests, inspected the results, and verified that the temporary test modification was reverted.
Author
Owner

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

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 21:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/1658#issuecomment-7144717205) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. Thanks!
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/1658/head:github-bot/gh-1658'
git switch 'github-bot/gh-1658'

Merge

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