Repository navigation
Tests: verify direct DXIL vs HLSL parity for FLAT, GLOBAL, SCRATCH ops - #2143
Conversation
Add GPU differential parity tests comparing the direct RDNA2 -> DXIL translator (validated with dxil.dll) against HLSL + DXC across wave32, split-wave64, and native wave64 (when supported) for GLOBAL, FLAT, and SCRATCH memory instructions. Assisted-by: Antigravity (Gemini 4)
|
A run with vkd3d-proton as the host D3D12: 2 of the 4 parity tests fail here. In both, the HLSL reference kernel does not finish, so the direct form is never compared. Tested
Not tested
AI use
|
|
Tested on the discrete RDNA4 card this PR lists as untested, and on native Windows with the same RTX 3060 as the vkd3d-proton run above: all 4 parity tests pass on both.
Head |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Nothing has happened on this PR for 3 days, so it is marked |
|
The other direct DXIL vs HLSL parity PRs cover different instruction families: #1823 (VOP3P, movrel, 64-bit VALU), #2084 (MUBUF, TBUFFER, SMEM), #2093 (LDS) and #2276 (MIMG). None of them, open or merged, covers FLAT, GLOBAL or SCRATCH. The new file is test-only. It skips without DXC or a GPU, and it checks fixed expected values as well as backend-to-backend equality. No problems found in the diff. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
Test report, head
Diff read (+397/-0, one new test file, test only). Minor: when neither wave32 nor wave64 is available, the test skips with the reason Tool and model: Claude Code (Claude Opus 5.5) merged, built, ran the tests and drafted this; I checked it. |
|
merge-check |
|
merge-check |
Add GPU differential parity integration tests between the direct RDNA2 → DXIL translator (
xcl::gpu::dxil::kernel::translate_full, validated withdxil.dll) and HLSL + DXC (xcl::gpu::recomp) forGLOBAL,FLAT, andSCRATCHmemory instructions across wave32 and wave64 (split-wave64 on wave32-only GPUs). Test-only change undercrates/xcl/tests/; no runtime files modified.What is in it
crates/xcl/tests/gpu_dxil_flat_global_scratch_parity.rs(397 lines):direct_dxil_global_load_store_subdword_d16_and_saddr_parity:GLOBAL_{LOAD,STORE}_DWORD{,X2,X3,X4}(64-bitVADDRwithSADDR=0x7D, and 32-bitVADDR+ SGPRSADDRwith positive/negative signed 12-bit offsets),GLOBAL_{LOAD,STORE}_{BYTE,SHORT}/UBYTE/SBYTE/USHORT/SSHORT, all sixD16/D16_HIload variants preserving untouched 16-bit halves,GLOBAL_{LOAD,STORE}_DWORD_ADDTID, and divergentEXECmasking.direct_dxil_global_atomics_32_and_64_parity: 17 32-bitGLOBAL_ATOMIC_*ops (SWAP,CMPSWAP,ADD,SUB,SMIN,UMIN,SMAX,UMAX,AND,OR,XOR,INC,DEC,CSUB,FMIN,FMAX,FCMPSWAP) and 16 64-bitGLOBAL_ATOMIC_*_X2ops withGLC=1,SADDR+ negative offsets, CAS hit/miss (-0.0 == +0.0),INC/DEC/CSUBwrap/clamp, positive/negative floats, andEXECmasking.direct_dxil_flat_load_store_and_atomic_parity:FLAT_{LOAD,STORE}_DWORD{,X2,X3,X4}, sub-dword /D16/D16_HIops, 16 32-bit and 64-bitFLAT_ATOMIC_*ops withGLC=1, and divergentEXECload/store masking.direct_dxil_scratch_load_store_subdword_d16_and_exec_parity: per-laneSCRATCH_{LOAD,STORE}_DWORD{,X2,X3,X4}with both SGPRSADDRand per-laneADDR(SADDR=0x7D) + signed 12-bit offsets, sub-dword /D16/D16_HIops, andEXECmasking.Tested
32.0.16.1088) and AMD Radeon(TM) Graphics (driver32.0.21030.2001), AMD Ryzen 5 7600, Windows 11 Pro10.0.26200(build26200),rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.8.2502.11(Windows SDK10.0.26100.0), debug & release.cargo test -p xcl --test gpu_dxil_flat_global_scratch_parity -- --nocapture(RTX 4060, debug): 4 passed, 0 failed, 0 ignored (0 SKIPPED; each test ran wave32 + split-wave64 on both Direct DXIL and HLSL+DXC).XCL_ADAPTER=Radeon cargo test -p xcl --test gpu_dxil_flat_global_scratch_parity -- --nocapture(AMD Radeon(TM) Graphics, debug): 4 passed, 0 failed, 0 ignored (0 SKIPPED).XCL_D3D12_DEBUG=1 cargo test -p xcl --test gpu_dxil_flat_global_scratch_parity -- --test-threads=1 --nocapture(RTX 4060, debug): 4 passed, 0 failed, 0 ignored.XCL_ADAPTER=warp cargo test -p xcl --test gpu_dxil_flat_global_scratch_parity -- --nocapture(WARP, debug): 4 passed, 0 failed, 0 ignored (4 SKIPPED:no wave64).cargo test --release -p xcl --test gpu_dxil_flat_global_scratch_parity -- --nocapture(RTX 4060, release): 4 passed, 0 failed, 0 ignored (0 SKIPPED)..\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4, RTX 4060, debug): 1158 passed, 0 failed, 46 ignored across 22 test targets (25 SKIPPED GPU checks: 20no wave64, 3per-lane form#1426refusals, 1no heap windows, 1cannot disable the driver cache (Windows Developer Mode is required)).Regression run
crates/xcl/tests/(no runtime files undercrates/xcl/src/modified).Not tested
scripts/smoke.ps1) andXCL_SAMPLE_*tests (no retail game files or sample paths on this machine).XCL_HEAP_WINDOWS=1/ multi-window UMA arenas.AI use
lower_mem.rs,emit.rs,rdna2_spec.rs, andrunner.rs, wrotecrates/xcl/tests/gpu_dxil_flat_global_scratch_parity.rs, ran the test suites listed above on local hardware, and drafted this PR description.