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
Contributor

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
@Decodere

Copy link
Copy Markdown
Contributor

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

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

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.

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.

7 participants