Tests: verify direct DXIL vs HLSL parity for FLAT, GLOBAL, SCRATCH ops #2143
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2143
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2143"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@HumanlyDev on GitHub · 2026-11-25 06:10 UTC · original
HumanlyDev:tests/gpu-dxil-flat-global-scratch-parity→main· +397 −0 · 1 files · 1 commits · openAdd 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.@JoaoPauluu on GitHub · 2026-11-25 06:25 UTC · original
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
x86_64-pc-windows-gnu.54387a4as it is (merge base withmain6e1e2be), no uncommitted changes. Thegpu_dxil_flat_global_scratch_paritytest binary runs under Wine, one test per process.direct_dxil_global_load_store_subdword_d16_and_saddr_parity: ok.direct_dxil_scratch_load_store_subdword_d16_and_exec_parity: ok.direct_dxil_flat_load_store_and_atomic_parity: fails atgpu_dxil_flat_global_scratch_parity.rs:124,wave32 HLSL run: kernel dispatch: GPU fence still pending after 10000 ms.direct_dxil_global_atomics_32_and_64_parity: fails the same way, at the same line.runner::runof the HLSL → DXC kernel, the reference, before the direct form runs. The two tests with atomics hang on the GPU here, and the two without pass. I have not checked which instruction the HLSL kernel loops on.Not tested
AI use
@DarkPanda69 on GitHub · 2026-11-25 06:28 UTC · original
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.
cargo test -p xcl --test gpu_dxil_flat_global_scratch_parity: 4 passed, 0 failed, 0 SKIPPED, so each test also ran itsnative-wave64case.direct_dxil_global_atomics_32_and_64_parity,direct_dxil_flat_load_store_and_atomic_parity) finish here, so the HLSL fence timeout above looks specific to vkd3d-proton rather than to the card.gpu::lib filter with this PR applied: RX 9070 XT 584 passed, 2 failed (the AMD fuzz seeds 722 and 1599 tracked in #2115, same onmain); RTX 3060 586 passed, 0 failed.Head
54387a4applied onmain6ea813a, debug, Windows 11 Pro 26200,XCL_ADAPTERset to each card.Not tested: release build,
XCL_HEAP_WINDOWS=1, Linux / Wine.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@DavidM1911 on GitHub · 2026-11-25 06:49 UTC · original
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!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.