Skip to content

[upstream #1778] Tests: verify direct DXIL vs HLSL GPU parity for wave, LDS atomic, and MIMG ops - #356

Open
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1778
Open

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1778

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner

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 by dxil.dll) and HLSL+DXC for v_readlane_b32 (low and 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: 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 divergent EXEC masking.
    • direct_dxil_mimg_image_ops_and_atomics_parity: asserts bit-exact VGPR and UAV texture readback parity for 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, and 1×1 contention).

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64 + mesh shaders, driver 32.0.21045.29003; XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.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.
    • The 3 failures are pre-existing on main (b9b6ea6) on this RX 6600 (placed_title_textures_share_vram_and_preserve_pixels: 3D mip subresource mismatch, plus 2 mutex-poison cascades transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory; tracked by D3D12.X: map and unmap 3D texture mips separately xcl-dev/xcl#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 because d3d12SDKLayers.dll is not installed).

Not tested

  • NVIDIA / Intel GPUs, D3D12 debug layer, retail title smoke run (test-only PR; no runtime code changed).

AI use

  • Antigravity (Gemini 4 Neon) wrote 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.

Mirror of xcl-dev#1778 (auto-synced, do not edit).

…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants