Skip to content

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

Open
ramon-victor wants to merge 1 commit into
xcl-dev:mainfrom
ramon-victor:tests/gpu-dxil-mubuf-smem-parity
Open

ramon-victor wants to merge 1 commit into
xcl-dev:mainfrom
ramon-victor:tests/gpu-dxil-mubuf-smem-parity

Conversation

@ramon-victor

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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 Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #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

Copy link
Copy Markdown
Contributor

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

Thanks!

@throny throny added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants