Repository navigation
Tests: verify direct DXIL vs HLSL GPU parity for wave, LDS atomic, and MIMG ops - #1778
thiagocalile wants to merge 2 commits into
Conversation
…d MIMG ops Add integration test crates/xcl/tests/gpu_dxil_parity.rs comparing the direct RDNA2 -> DXIL translator against HLSL + DXC on the GPU across native wave64, split wave64, and wave32: - direct_dxil_cross_lane_and_dpp_parity: v_readlane_b32 (low/high half), v_readfirstlane_b32 (under divergent EXEC), v_writelane_b32, ds_swizzle_b32 (quad reverse and XOR-1), ds_bpermute_b32, v_permlane16_b32 (default and FI/BC), v_permlanex16_b32, and VOP1_VOP_DPP16 / VOP1_VOP_DPP8. - direct_dxil_lds_atomics_and_barrier_parity: per-lane and multi-lane contention LDS atomics (add, sub, and, or, xor, umin/umax, smin/smax, wrxchg, cmpst, inc, dec), s_barrier, and divergent EXEC masking. - direct_dxil_mimg_image_ops_and_atomics_parity: image_load, image_store, image_gather4_lz, and 32-bit image_atomic_* (add, sub, and, or, xor, swap GLC=1/0, inc, dec, cmpswap, smin, smax, contention) checking both VGPRs and UAV texture readbacks byte-for-byte. Assisted-by: Antigravity (Gemini 4 Neon)
|
Tested (head
AI use: Antigravity (Google DeepMind; exact model version not exposed to agent) ran the test suite and extracted the log results. |
|
Rerun on the new head Passes on an RTX 3060 (wave32 and split wave64), 10 of 10, unlike the RTX 5070 Ti run above. The new LDS test also catches a bug that no existing test does. The two setups differ in DXC (1.9.2602.17 here, 1.8.2502.11 above) and driver (32.0.16.1088 here, 32.0.16.2135 above), so the Tested
Not tested
AI use
|
|
Another RTX 5070 Ti, to help split the two failures above by GPU, driver and DXC. Same head Tested
So on this card the Not tested
AI use
|
|
Independent Windows 11 + 8 GB Ampere (wave32) This adds a data point between the RTX 5070 Ti ( Tested
Not tested: native wave64, DXC AI use: Antigravity ( |
|
On the So it is not something this PR's test does wrong.
Not tested: the whole suite of this PR, another driver or GPU. Run and written with Claude Code (Claude Opus 5.5). |
|
All three new parity tests passed on an RTX 5070 Ti under Proton at the exact PR head
3 passed, 0 failed, 0 ignored, 0 skipped. Each run filtered out the other two tests. The adapter exposed 32-lane subgroups, so these tests covered wave32 and split wave64. This adds a Proton data point for the Windows reports above. cargo test --locked --target x86_64-pc-windows-gnullvm -p xcl --test gpu_dxil_parity --no-run --message-format=json -j 3
wine <gpu_dxil_parity.exe> <exact-test> --exact --test-threads=1 --nocaptureRTX 5070 Ti (16 GB, driver 620.73.04), Ryzen 7 9700X, 32 GB DDR5, CachyOS 7.3.5-2-cachyos, Proton Experimental AI use — OpenAI Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Follow-up to my report above: I updated the driver on the same RTX 5070 Ti, and the
Tested
So the mimg mismatch follows the newer NVIDIA driver, not DXC or this machine. It matches @Ctrl-Alt-Haze (5070 Ti, 621.35) and @PHeitor1 (5060 Ti, 621.24), while @LocranKing's Ampere card on 621.01 passes. It may be specific to the 621.2x+ drivers on Blackwell, but I have not tested any driver between 616.64 and 621.40. The Not tested
AI use
|
|
@futurepro62 thanks, changing only the driver is the clean comparison. I looked into both failures; they have different causes.
- [0x2000_0000 | (idx << 4), 0, 0, (dfmt << 20) | (rtype << 28), 0, 0, 0, 0]
+ [idx, dfmt << 20, 0, rtype << 28, 0, 0, 0, 0]The second part is the layout of
So my earlier comment, which left the image failure as a separate thing, was right that it is not the same cause, but it is in the test and not in the translator. Not tested: another driver or GPU with the changed line, a driver that passes as it is. Run and written with Claude Code (Claude Opus 5.5). |
|
Thanks @PHeitor1, @futurepro62, @Ctrl-Alt-Haze, and @fromthemoonx for tracking down both issues so cleanly! Pushed AI use: Antigravity (Gemini 4 Neon) applied the 2-line fix, ran the RX 6600 test, and drafted this reply; I reviewed it before posting. |
|
@PHeitor1 @thiagocalile confirmed here:
Tested: Not tested: the full suite at this head, other NVIDIA drivers. AI-assisted (Claude Code). |
|
Tested
Not tested
AI use
|
|
Diff is clean and verified across AMD (RX 6600, RDNA2 iGPU), NVIDIA (RTX 3060, RTX 5070 Ti with |
|
Linux/RADV + Wine GPU test report on PR Tested
Not tested
AI use
|
|
RDNA3 reproduction of the split-wave64 parity failure. Second AMD generation covered, and the failing SGPR values are byte-identical to the RX 9070 report. Rig: RX 7900 XT (RDNA3, RADV NAVI31, Mesa 26.2.5) under Proton Experimental (wine-11.0) + the xcl-pinned vkd3d-proton 3.1 build, Parity suite: 2 pass / 1 fail. Identical corruption pattern on two different AMD generations. Not card-specific, not driver-version-specific, not RDNA4-specific.
Two of the deterministic set ( This PR adds only Counts only, no game data. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
|
Independent RTX 5080 result for
Applying only the two lowering-file changes from #1919 Test matrix and reproduction notes OpenAI Codex (GPT-6) ran the tests, added local backend logging, and drafted this report. |
Adds GPU differential parity tests between the direct RDNA2 → DXIL translator (
xcl::gpu::dxil::kernel) and the HLSL + DXC path (xcl::gpu::recomp) across native wave64, split wave64, and wave32. Covers cross-lane/DPP wave ops, LDS atomics + barriers, and MIMG texture ops + 32-bit image atomics. No runtime or recompiler source files are changed.What is in it
crates/xcl/tests/gpu_dxil_parity.rs(new integration test, 333 lines):direct_dxil_cross_lane_and_dpp_parity: asserts bit-exact SGPR/VGPR parity between direct DXIL (validated bydxil.dll) and HLSL+DXC forv_readlane_b32(low and high half),v_readfirstlane_b32under divergentEXEC,v_writelane_b32,ds_swizzle_b32(quad reverse and XOR-1),ds_bpermute_b32,v_permlane16_b32(default andFI/BC),v_permlanex16_b32, andVOP1_VOP_DPP16/VOP1_VOP_DPP8.direct_dxil_lds_atomics_and_barrier_parity: asserts bit-exact VGPR parity for per-lane and multi-lane contention LDS atomics (add,sub,and,or,xor,umin/umax,smin/smax,wrxchg,cmpst,inc,dec),s_barrier, and divergentEXECmasking.direct_dxil_mimg_image_ops_and_atomics_parity: asserts bit-exact VGPR and UAV texture readback parity forimage_load,image_store,image_gather4_lz, and 32-bitimage_atomic_*(add,sub,and,or,xor,swapGLC=1/0,inc,dec,cmpswap,smin,smax, and 1×1 contention).Tested
32.0.21045.29003;XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11.XCL_ADAPTER=radeon cargo test -p xcl --test gpu_dxil_parity -- --nocapture: 3 passed, 0 failed, 0 ignored (0.45s; native wave64, split wave64, and wave32 all executed on hardware).XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 889 passed, 3 failed, 42 ignored.main(b9b6ea6) on this RX 6600 (placed_title_textures_share_vram_and_preserve_pixels: 3D mip subresource mismatch, plus 2 mutex-poison cascadestransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory; tracked by D3D12.X: map and unmap 3D texture mips separately #1028).SKIPPED(not counted as coverage):heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows,shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (0x887A002D)(plus D3D12 debug-layer tests skip becaused3d12SDKLayers.dllis not installed).Not tested
AI use
crates/xcl/tests/gpu_dxil_parity.rs, ran the targeted and full workspace test suites on my RX 6600, and drafted this PR description; I reviewed the diff and test output before opening the PR.