Tests: verify direct DXIL vs HLSL GPU parity for MUBUF, TBUFFER, and SMEM ops #2074

Open
ramon-victor wants to merge 1 commit from upstream-pr/2084 into main
ramon-victor commented 2026-11-25 03:31:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ramon-victor on 2026-11-25T03:31:45Z.


Add GPU differential parity tests between the direct RDNA2 → DXIL translator (xcl::gpu::dxil::kernel::translate, validated with dxil.dll) and the HLSL + DXC path (xcl::gpu::recomp) for lower_mem.rs MUBUF, TBUFFER, 32-bit MUBUF atomic, and SMEM instructions across wave32 and wave64 (split wave64 on wave32-only GPUs). Test-only change; no runtime files modified.

What is in it

  • crates/xcl/tests/gpu_dxil_mubuf_smem_parity.rs:
    • direct_dxil_mubuf_raw_subdword_bounds_and_exec_parity: BUFFER_LOAD_DWORDX2/X3/X4 (IDXEN, OFFEN, SOFFSET, OFFSET), BUFFER_STORE_DWORD/BYTE/SHORT, BUFFER_LOAD_{U,S}{BYTE,SHORT}, OOB clamping (loads return 0, stores leave memory untouched), and inactive EXEC preservation.
    • direct_dxil_mubuf_and_tbuffer_format_d16_parity: BUFFER_LOAD_FORMAT_X/XYZW, TBUFFER_LOAD_FORMAT_XY, BUFFER_LOAD_FORMAT_D16_X/XY, TBUFFER_LOAD_FORMAT_D16_XY, BUFFER_STORE_FORMAT_D16_XY/XYZW, custom DST_SEL, unaligned offsets, and OOB zero-fill.
    • direct_dxil_mubuf_atomics_and_bounds_parity: 16 32-bit BUFFER_ATOMIC_* ops (ADD, SUB, SMIN, UMIN, SMAX, UMAX, AND, OR, XOR, SWAP, CMPSWAP, INC, DEC, CSUB, FMIN, FMAX with GLC=1), OOB zero return without memory modification, and inactive-lane VDATA preservation.
    • direct_dxil_smem_loads_alignment_and_bounds_parity: S_LOAD_DWORD/X2/X4 (unaligned offset truncation, negative 21-bit signed offset, SGPR SOFFSET + OFFSET) and S_BUFFER_LOAD_DWORD/X4/X8 (per-dword NUM_RECORDS bounds with stride and full OOB).

Tested

  • Hardware: NVIDIA GeForce RTX 3070 (8 GiB, driver 621.24, wave32), AMD Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.99.0 (x86_64-pc-windows-msvc), DXC 1.8.2502.11 (Windows SDK 10.0.26100.0), debug build.
  • cargo test -p xcl --test gpu_dxil_mubuf_smem_parity -- --nocapture: 4 passed, 0 failed, 0 ignored (0 SKIPPED; each test ran both wave32 and split wave64 through both Direct DXIL and HLSL+DXC).
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4) on head 863aeb3: 1158 passed, 0 failed, 46 ignored (24 SKIPPED GPU tests: 20 no wave64, 3 per-lane form #1426, 1 no heap windows).

Not tested

  • Native 64-lane hardware wave64 (AMD RDNA2/3/4) — RTX 3070 only supports 32-lane waves, so wave64 ran in split-wave64 mode.
  • Release build and retail game titles (test-only PR, no runtime changes).

AI use

  • Antigravity (Google DeepMind; Gemini frontier model — exact minor version not exposed to the agent): wrote the integration test file, ran the full test suite on the RTX 3070, and drafted this PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5484626976 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2084). Originally posted by [ramon-victor](https://github.com/ramon-victor) on 2026-11-25T03:31:45Z. --- Add GPU differential parity tests between the direct RDNA2 → DXIL translator (`xcl::gpu::dxil::kernel::translate`, validated with `dxil.dll`) and the HLSL + DXC path (`xcl::gpu::recomp`) for `lower_mem.rs` MUBUF, TBUFFER, 32-bit MUBUF atomic, and SMEM instructions across wave32 and wave64 (split wave64 on wave32-only GPUs). Test-only change; no runtime files modified. **What is in it** - `crates/xcl/tests/gpu_dxil_mubuf_smem_parity.rs`: - `direct_dxil_mubuf_raw_subdword_bounds_and_exec_parity`: `BUFFER_LOAD_DWORDX2/X3/X4` (`IDXEN`, `OFFEN`, `SOFFSET`, `OFFSET`), `BUFFER_STORE_DWORD/BYTE/SHORT`, `BUFFER_LOAD_{U,S}{BYTE,SHORT}`, OOB clamping (loads return 0, stores leave memory untouched), and inactive `EXEC` preservation. - `direct_dxil_mubuf_and_tbuffer_format_d16_parity`: `BUFFER_LOAD_FORMAT_X/XYZW`, `TBUFFER_LOAD_FORMAT_XY`, `BUFFER_LOAD_FORMAT_D16_X/XY`, `TBUFFER_LOAD_FORMAT_D16_XY`, `BUFFER_STORE_FORMAT_D16_XY/XYZW`, custom `DST_SEL`, unaligned offsets, and OOB zero-fill. - `direct_dxil_mubuf_atomics_and_bounds_parity`: 16 32-bit `BUFFER_ATOMIC_*` ops (`ADD`, `SUB`, `SMIN`, `UMIN`, `SMAX`, `UMAX`, `AND`, `OR`, `XOR`, `SWAP`, `CMPSWAP`, `INC`, `DEC`, `CSUB`, `FMIN`, `FMAX` with `GLC=1`), OOB zero return without memory modification, and inactive-lane `VDATA` preservation. - `direct_dxil_smem_loads_alignment_and_bounds_parity`: `S_LOAD_DWORD/X2/X4` (unaligned offset truncation, negative 21-bit signed offset, SGPR `SOFFSET` + `OFFSET`) and `S_BUFFER_LOAD_DWORD/X4/X8` (per-dword `NUM_RECORDS` bounds with stride and full OOB). **Tested** - Hardware: NVIDIA GeForce RTX 3070 (8 GiB, driver 621.24, wave32), AMD Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.99.0 (`x86_64-pc-windows-msvc`), DXC 1.8.2502.11 (Windows SDK 10.0.26100.0), debug build. - `cargo test -p xcl --test gpu_dxil_mubuf_smem_parity -- --nocapture`: 4 passed, 0 failed, 0 ignored (0 SKIPPED; each test ran both wave32 and split wave64 through both Direct DXIL and HLSL+DXC). - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`) on head `863aeb3`: 1158 passed, 0 failed, 46 ignored (24 SKIPPED GPU tests: 20 `no wave64`, 3 `per-lane form` `#1426`, 1 `no heap windows`). **Not tested** - Native 64-lane hardware wave64 (AMD RDNA2/3/4) — RTX 3070 only supports 32-lane waves, so wave64 ran in split-wave64 mode. - Release build and retail game titles (test-only PR, no runtime changes). **AI use** - Antigravity (Google DeepMind; Gemini frontier model — exact minor version not exposed to the agent): wrote the integration test file, ran the full test suite on the RTX 3070, and drafted this PR description.
DarkPanda69 commented 2026-11-25 04:10:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T03:52:27Z.


Native 64-lane wave64 run on AMD, which this PR lists as not tested (the RTX 3070 ran wave64 split), plus an RTX 3060.

Tested: pass, head 863aeb3 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 --test gpu_dxil_mubuf_smem_parity -- --test-threads=4 with XCL_ADAPTER set to each GPU:

  • AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, waves 32..64: 4 passed, 0 failed, 0 SKIPPED.
  • NVIDIA RTX 3060, driver 32.0.16.1088: 4 passed, 0 failed, 0 SKIPPED.

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

<!-- greyfinch-sync:ivall/xcl:comment:7152319807 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2084#issuecomment-7152319807). Originally posted by [DarkPanda69](https://github.com/DarkPanda69) on 2026-11-25T03:52:27Z. --- Native 64-lane wave64 run on AMD, which this PR lists as not tested (the RTX 3070 ran wave64 split), plus an RTX 3060. **Tested:** pass, head `863aeb3` 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 --test gpu_dxil_mubuf_smem_parity -- --test-threads=4` with `XCL_ADAPTER` set to each GPU: - AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, waves 32..64: 4 passed, 0 failed, 0 SKIPPED. - NVIDIA RTX 3060, driver 32.0.16.1088: 4 passed, 0 failed, 0 SKIPPED. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
JoaoPauluu commented 2026-11-25 06:05:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-25T05:25:59Z.


A run with vkd3d-proton as the host D3D12, so both the direct DXIL and the HLSL → DXC output go through dxil-spirv and the NVIDIA Vulkan driver: all 4 parity tests pass, none skipped.

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. 863aeb3 as it is (merge base with main cbc296a), no uncommitted changes. The gpu_dxil_mubuf_smem_parity test binary runs under Wine, one test per process.
    • direct_dxil_mubuf_and_tbuffer_format_d16_parity: ok
    • direct_dxil_mubuf_atomics_and_bounds_parity: ok
    • direct_dxil_mubuf_raw_subdword_bounds_and_exec_parity: ok
    • direct_dxil_smem_loads_alignment_and_bounds_parity: ok

Not tested

  • wave64 forms (this GPU has 32-lane waves only), the whole suite on this head, 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.
<!-- greyfinch-sync:ivall/xcl:comment:7153764176 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2084#issuecomment-7153764176). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-25T05:25:59Z. --- A run with vkd3d-proton as the host D3D12, so both the direct DXIL and the HLSL → DXC output go through dxil-spirv and the NVIDIA Vulkan driver: all 4 parity tests pass, none skipped. **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`. `863aeb3` as it is (merge base with `main` `cbc296a`), no uncommitted changes. The `gpu_dxil_mubuf_smem_parity` test binary runs under Wine, one test per process. - `direct_dxil_mubuf_and_tbuffer_format_d16_parity`: ok - `direct_dxil_mubuf_atomics_and_bounds_parity`: ok - `direct_dxil_mubuf_raw_subdword_bounds_and_exec_parity`: ok - `direct_dxil_smem_loads_alignment_and_bounds_parity`: ok **Not tested** - wave64 forms (this GPU has 32-lane waves only), the whole suite on this head, 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.
DavidM1911 commented 2026-11-25 06:05:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T05:26:56Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7153784296 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2084#issuecomment-7153784296). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T05:26:56Z. --- 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!
Decodere commented 2026-11-27 09:17:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T09:17:45Z.


Independent desktop NVIDIA verification of PR #2084 at head 863aeb32ce009a8568dcc107bee6fb1165862487 (1 commit; exact parent & merge-base: cbc296ab65a2661a61e3e2da109134bcd5319f60, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted GPU parity tests & build (863aeb32)

Command Result
cargo test --release -p xcl --test gpu_dxil_mubuf_smem_parity -- --nocapture (3 consecutive runs) 4 passed; 0 failed; 0 ignored; 0 filtered out × 3 (1.63s, 0.67s, 0.65s, 0 skipped; live RTX 4060 wave32 + split-wave64 execution of direct_dxil_mubuf_and_tbuffer_format_d16_parity, direct_dxil_mubuf_atomics_and_bounds_parity, direct_dxil_mubuf_raw_subdword_bounds_and_exec_parity, and direct_dxil_smem_loads_alignment_and_bounds_parity)
cargo build --release -p xcl Clean build (0.08s incremental after --test build, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (cbc296ab65a2661a61e3e2da109134bcd5319f60, cached baseline on the same machine):

xcl-smoke v1
commit: cbc296ab65a2661a61e3e2da109134bcd5319f60
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1572 (PresentX 1572)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14509 MB

PR #2084 (863aeb32ce009a8568dcc107bee6fb1165862487):

xcl-smoke v1
commit: 863aeb32ce009a8568dcc107bee6fb1165862487
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1584 (PresentX 1584)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14528 MB

Limits of coverage

  • This PR is test-only (crates/xcl/tests/gpu_dxil_mubuf_smem_parity.rs, 0 production-code changes); all 4 direct-DXIL vs. HLSL MUBUF/TBUFFER/SMEM differential parity tests executed and passed 3/3 on desktop RTX 4060 across wave32 and split-wave64 (gpu_modes() omits native Wave64 on Wave32-only Ada).
  • The 60 s retail smoke confirms non-regression of the unchanged runtime binary at this commit (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7214510652 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2084#issuecomment-7214510652). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T09:17:45Z. --- Independent desktop NVIDIA verification of **PR #2084** at head `863aeb32ce009a8568dcc107bee6fb1165862487` (`1` commit; exact parent & merge-base: `cbc296ab65a2661a61e3e2da109134bcd5319f60`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted GPU parity tests & build (`863aeb32`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --test gpu_dxil_mubuf_smem_parity -- --nocapture` (3 consecutive runs) | `4 passed; 0 failed; 0 ignored; 0 filtered out` × 3 (`1.63s`, `0.67s`, `0.65s`, `0` skipped; live RTX 4060 `wave32` + `split-wave64` execution of `direct_dxil_mubuf_and_tbuffer_format_d16_parity`, `direct_dxil_mubuf_atomics_and_bounds_parity`, `direct_dxil_mubuf_raw_subdword_bounds_and_exec_parity`, and `direct_dxil_smem_loads_alignment_and_bounds_parity`) | | `cargo build --release -p xcl` | Clean build (`0.08s` incremental after `--test` build, exit `0`, `0` new warnings) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`cbc296ab65a2661a61e3e2da109134bcd5319f60`, cached baseline on the same machine): ``` xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1572 (PresentX 1572) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14509 MB ``` PR #2084 (`863aeb32ce009a8568dcc107bee6fb1165862487`): ``` xcl-smoke v1 commit: 863aeb32ce009a8568dcc107bee6fb1165862487 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1584 (PresentX 1584) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14528 MB ``` ### Limits of coverage - This PR is test-only (`crates/xcl/tests/gpu_dxil_mubuf_smem_parity.rs`, `0` production-code changes); all 4 direct-DXIL vs. HLSL MUBUF/TBUFFER/SMEM differential parity tests executed and passed `3/3` on desktop RTX 4060 across `wave32` and `split-wave64` (`gpu_modes()` omits native Wave64 on Wave32-only Ada). - The 60 s retail smoke confirms non-regression of the unchanged runtime binary at this commit (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR). *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
Foniass commented 2026-12-01 07:19:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:19:09Z.


Triage (#1607) – head 863aeb3

No open or merged PR adds direct-DXIL vs HLSL parity tests for MUBUF, TBUFFER and SMEM. #2143 covers FLAT/GLOBAL/SCRATCH and #1778 covers wave/LDS/MIMG, in separate files with no shared cases.
No problems found in the diff. The tests skip through runner::skip_test when there is no GPU, DXC or wave64.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7303912376 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2084#issuecomment-7303912376). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:19:09Z. --- **Triage (#1607)** – head 863aeb3 No open or merged PR adds direct-DXIL vs HLSL parity tests for MUBUF, TBUFFER and SMEM. #2143 covers FLAT/GLOBAL/SCRATCH and #1778 covers wave/LDS/MIMG, in separate files with no shared cases. No problems found in the diff. The tests skip through `runner::skip_test` when there is no GPU, DXC or wave64. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2084:upstream-pr/2084'
git switch 'upstream-pr/2084'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2084'
git switch 'upstream-pr/2084'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2084'
git switch 'upstream-pr/2084'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2084'
git switch 'main'
git merge --squash 'upstream-pr/2084'
git switch 'main'
git merge --ff-only 'upstream-pr/2084'
git switch 'main'
git merge 'upstream-pr/2084'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2074
No description provided.