Tests: verify direct RDNA2-to-DXIL lowering across shader stages on GPU #1658
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!1658
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1658"
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?
@Vadson159 on GitHub · 2026-11-24 18:51 UTC · original
Vadson159:tests/gpu-dxil-lowering→main· +443 −0 · 1 files · 1 commits · openAdds end-to-end GPU execution, DXIL container validation, and HLSL-differential integration tests in
crates/xcl/tests/gpu_dxil_lowering.rsfor the direct RDNA2 -> DXIL backend (xcl::gpu::dxil::kernel), exercising all fivetranslate_*entry points againstgpu::recomp+ DXC baselines without requiringXCL_DIRECT_DXIL.What is in it
direct_dxil_kernel_control_flow_exec_and_whole_wave: verifiesMode::Kernel(translate_full) nested EXEC save/restore (S_AND_SAVEEXEC_B64,S_XOR_B64,S_CBRANCH_EXECZ), cross-half wave masks (S_BCNT1_I32_B64,S_FF1_I32_B64,V_MBCNT_*),V_READLANE_B32/V_READFIRSTLANE_B32,DS_SWIZZLE_B32/DS_BPERMUTE_B32, and irreducible two-entry loop CFG splitting against HLSLcs_6_6anddxil::validate::validate.direct_dxil_kernel_memory_lds_and_exact_valu: verifies SMEM (S_LOAD_DWORDX4), MUBUF load/store/atomic including out-of-bounds lanes, GLOBAL atomic/barrier/load, FLAT load/store, LDS (DS_WRITE_B32,DS_ADD_RTN_U32,DS_ADD_U32,DS_READ_B32), and exact VALU semantics (V_FRACT_F32on+inf/-2^-25,V_MIN_F32/V_MAX_F32on-0/+0/NaN,V_CMP_CLASS_F32withABS/NEG, 64-bit carryV_ADD_CO_U32/V_ADD_CO_CI_U32, clampedV_PK_ADD_I16) across native wave64, split-wave64, and wave32.direct_dxil_compute_dispatch_spin_partial_and_2d: verifiesMode::Compute(translate_compute) withrunner::dispatchacross 128-thread multi-wave LDS +DS_BPERMUTE_B32(tg_size=true,Partner::Spin),[8,4,1]2D thread IDs, partial[40,1,1]wave (Partner::Present), and[16,1,1](Partner::Missing).direct_dxil_graphics_interp_discard_compr_and_mixed_linking: verifiesMode::VertexandMode::Pixel(translate_vertex,translate_pixel) withrunner::draw: f16 (V_INTERP_P1LL_F16/V_INTERP_P2_F16) and f32 (V_INTERP_MOV_F32) interpolation,SV_IsFrontFace(input_ena=0x1302), conditionalDONE=1discard (V_CMPX_GT_F32),COMPR=1f16 export, and mixed direct/HLSL stage linking in wave64 and wave32.direct_dxil_mesh_two_passes: verifiesMode::Mesh(translate_mesh) paired withmesh_passthroughandps_6_6viarunner::mesh_drawin native wave64 and split-wave64, comparing rendered pixels andMESH_HEADERrecords.direct_dxil_rejects_heap_windows_and_reports_unsupported_op: non-GPU unit test verifyingHEAP_WINDOWSrefusal across all fivetranslate_*functions and explicit error reporting for unsupportedS_GETREG_B32.Tested
10.0.26300), AMD Ryzen 7 9800X3D 8-Core Processor, AMD Radeon RX 9070 XT (driver32.0.32029.2010), Rust1.100.0(0ef1bc3862026-11-09), debug build, Windows SDK DXCdxcompiler 1.8.2502.11/dxil 1.8.2502.11..\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4):864passed,0failed,42ignored (XCL_SAMPLE_*unset); GPU tests skipped on this adapter:1(no heap windows:heap_window_out_of_memory_falls_back_to_the_switch_formintests/gpu_compute_e2e.rs).cargo test -p xcl --test gpu_dxil_lowering -- --nocapture:6passed,0failed,0ignored (0GPU tests skipped).Not tested
scripts/smoke.ps1/XCL_SAMPLE_*tests (no retail game files or sample dumps in this environment).AI use
AGENTS.md) designed and implementedcrates/xcl/tests/gpu_dxil_lowering.rs, ran the local build and test suite, and prepared this PR.@nnonno91 on GitHub · 2026-11-24 18:56 UTC · original
Independent two-adapter check at
3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8. The RTX 5090 exposes a lane-order assumption in the new atomic-return comparison.Tested
XCL_ADAPTER='RTX 5090'or'AMD Radeon', and separate XCL caches.cargo build --workspace --lockedpassed.cargo test --locked -p xcl --test gpu_dxil_lowering -- --test-threads=1 --nocapturegave 6 passed, 0 failed on AMD and 5 passed, 1 failed on NVIDIA, 0 ignored and 0 explicit skips on both. The RTX 5090 exercised split-wave64 and wave32. AMD also exercised native wave64.cargo test --locked -p xcl --test gpu_dxil_lowering -- --exact direct_dxil_kernel_memory_lds_and_exact_valu --test-threads=1 --nocapturereproduced the same first failure 5/5 on the RTX 5090 (split-w64: lane 0 v3, direct 280, HLSL 312).cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputreported 864 passed, 0 failed, 42 ignored on AMD and 863 passed, 1 failed, 42 ignored on NVIDIA. The only failure was the same new test. Both pass counts include the heap-window fallback skip (heap windows off). NVIDIA's count also includes two explicit no-wave64 skips (gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware). The bundled title test passed on both.Atomic-return diagnostic
cargo test --locked -p xcl --test atomic_order_probe -- --exact check_atomic_return_sets_and_final_sums --test-threads=1 --nocapturepassed once on each adapter, 0 ignored and 0 skips. In this temporary adaptation I kept the original shader, initial registers and memory. For the two contended atomic return registers I checked each backend's sorted old values against the exact expected range and checked the final count. All the other original checks stayed active.BUFFER_ATOMIC_ADD(v3)GLOBAL_ATOMIC_ADD(v4)The old values were assigned to different lanes in both RTX 5090 split-wave64 comparisons. Each path accounted for all 64 increments. This fixture can check those two return registers by their full value sets and final counters, while keeping the per-lane comparisons for the other outputs. HLSL InterlockedAdd semantics
Not tested
Retail shaders or titles, console-hardware ordering, release builds, or performance.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) adapted the temporary diagnostic, ran the tests, and drafted the report.
@SlopTart on GitHub · 2026-11-24 19:01 UTC · original
Ran the new suite on an AMD card, where this PR's whole point is validating the direct path outside NVIDIA. Result on RX 7900 XT (native wave64), Proton Experimental + patched vkd3d-proton v3.1, DXC 1.9.2609.5 from the pinned manifest, release profile,
XCL_DIRECT_DXIL=1, PR head3d0eee78as-is:direct_dxil_mesh_two_passes: okdirect_dxil_graphics_interp_discard_compr_and_mixed_linking: okdirect_dxil_kernel_memory_lds_and_exact_valu: okdirect_dxil_rejects_heap_windows_and_reports_unsupported_op: okdirect_dxil_compute_dispatch_spin_partial_and_2d: FAILED 2/2 (deterministic),crates/xcl/tests/gpu_dxil_lowering.rs:277, assertion "compute spin split-w64"direct_dxil_kernel_control_flow_exec_and_whole_wave: FAILED 2/2 (deterministic), panic atgpu_dxil_lowering.rs:88The spin_partial diff shape looks relevant: expected buffer has zeros at masked-off lane slots (odd indices), actual has non-zero values in exactly those slots. So lanes that should have been predicated off still performed their writes on this card, in split-wave64 mode. That is the same mask-discipline theme as the forced-split failures I documented on #847 (three deterministic failures plus a cross-test mask leak there), which suggests both suites are hitting one root cause in half/mask handling on native wave64 hardware rather than two separate bugs.
Counts only, no game data.
AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@WebIdentity1 on GitHub · 2026-11-24 19:34 UTC · original
RTX 3090 Ampere confirmation for exact head
3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8: I reproduced the RTX 5090 report's split-wave64 atomic-return lane-order failure. A local test-only comparison of complete atomic old-value sets passes all six tests while preserving the other per-lane and final-memory assertions. I found no distinct Ampere translation failure in this focused suite.Tested
XCL_ADAPTER=3090,XCL_REQUIRE_GPU=mesh,XCL_D3D12_DIRpointing at the existing public Agility x64 directory;XCL_DIRECT_DXILandXCL_HEAP_WINDOWSunset. NoXCL_SAMPLE_*inputs.cargo test --locked -p xcl --test gpu_dxil_lowering -- --test-threads=1 --show-output --nocapture→ 5 passed / 1 failed / 0 ignored, no explicit skip or timeout. The sole failure isdirect_dxil_kernel_memory_lds_and_exact_valu,split-w64: lane 0 v3, direct280, HLSL312. The isolated test reproduced the same first failure in 3/3 fresh processes (0 passed / 1 failed / 0 ignoredeach).280..280+lanesand10..10+lanes). It retains all other per-lane comparisons, SGPR/SCC checks,got.mem == want.mem, and the test's explicit final-memory assertions. The wholegpu_dxil_loweringtarget then reports 6 passed / 0 failed / 0 ignored, no skips or timeouts. Diagnostic test source SHA25689f6a1f2fbe32e564c31988c63006fb8a8dc8cfbc4f2c7a6f21e44e4f1c1a371, matching the Windows copy during that run.Setup correction: an initial run without
XCL_D3D12_DIRcould not create an SM 6.6 device on this Windows 10 host;XCL_REQUIRE_GPU=meshconsequently made five GPU skips look like failures. The temporary gate diagnostic identified the missing Agility directory. Those five setup failures are excluded from the results above.Not tested: full workspace on this head, retail title/shaders, another driver, release build, or performance. The local atomic-set diagnostic demonstrates a sounder oracle for this fixture; it does not prove all direct DXIL operations correct. The PR author owns the test fix.
AI use: Codex (GPT-6) ran the native tests, diagnosed the Agility setup, wrote the local oracle diagnostic, verified source hashes, and prepared this report.
Local test-only oracle patch
@LocranKing on GitHub · 2026-11-24 20:03 UTC · original
Independent Windows release-build check on NVIDIA Ampere (
RTX 3060 Ti, wave32) at3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8: reproduces the samedirect_dxil_kernel_memory_lds_and_exact_valufailure reported by @nnonno91 on RTX 5090; the other 5 tests ingpu_dxil_loweringpass.Setup
8024 MiB VRAM, Ampere, wave32), driver32.0.16.210131.8 GBRAM26200rustc 1.100.0, DXC / validator1.9.2602.17(Windows SDK10.0.26100.0),--releaseResults (
cargo test --workspace --release --no-fail-fast -- --test-threads=4)101: 863 passed, 1 failed, 42 ignored across 21 result blocks (SKIPPED: 2no wave64, 2no D3D12 debug layer,heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows).gpu_dxil_lowering(5 passed, 1 failed):direct_dxil_graphics_interp_discard_compr_and_mixed_linking— okdirect_dxil_rejects_heap_windows_and_reports_unsupported_op— okdirect_dxil_mesh_two_passes— okdirect_dxil_kernel_control_flow_exec_and_whole_wave— okdirect_dxil_compute_dispatch_spin_partial_and_2d— okdirect_dxil_kernel_memory_lds_and_exact_valu— FAILED:Not tested: Debug build, AMD / native wave64 hardware, retail title run.
AI use: Antigravity (
Gemini 4 Neon) built and ran the workspace test suite on this hardware and drafted this report from the captured output; reviewed before posting. No game files attached.@thiagocalile on GitHub · 2026-11-24 20:27 UTC · original
Tested commit
3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8on an AMD Radeon RX 6600 (RDNA2, native 64-lane waves): all targeted tests passed.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, debug build.XCL_ADAPTER=radeon cargo test -p xcl --lib gpu::dxil -- --test-threads=4: 80 passed, 0 failed, 1 ignored (29.8s).XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 861 passed, 3 failed, 42 ignored (79.36s).mainon 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 #1028).SKIPPED(not counted as coverage):heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows(plus D3D12 debug-layer tests skip becaused3d12SDKLayers.dllis not installed).Not tested
scripts/smoke.ps1— no game executable here), D3D12 debug layer, NVIDIA / Intel GPUs, Linux / Wine.AI use
@malzaharhub-ctrl on GitHub · 2026-11-24 20:42 UTC · original
Independent Windows test — RX 7900 XTX
Tested commit:
3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8Hardware / environment
32.0.32029.2010(18 November 2026)Test command
Results: 5 passed, 1 failed
Passing:
direct_dxil_compute_dispatch_spin_partial_and_2ddirect_dxil_graphics_interp_discard_compr_and_mixed_linkingdirect_dxil_kernel_control_flow_exec_and_whole_wavedirect_dxil_mesh_two_passesdirect_dxil_rejects_heap_windows_and_reports_unsupported_opFailing:
direct_dxil_kernel_memory_lds_and_exact_valuThe failure is in
split-w64:I reran the failing test individually and reproduced the exact same mismatch.
The test completed the preceding native-Wave64 configuration before failing in split-Wave64. This suggests the issue is specific to the split-Wave64 path, although I haven't investigated the underlying cause.
The checkout was clean before testing, and no source changes were made.
AI assistance disclosure: ChatGPT assisted with interpreting the test output and drafting this report. I independently ran the tests on the hardware and environment listed above.
Hopefully this additional Windows/RDNA3 result helps narrow down the split-Wave64 issue.
@malzaharhub-ctrl on GitHub · 2026-11-24 20:54 UTC · original
Independent test report — RX 7900 XTX / Windows 11
Tested PR #1658 at commit
3d0eee780b66dc22dbcecd27ff5828fdfc1e43c8.Hardware and environment
32.0.32029.2010(18 November 2026)1.100.01.9.2602.17Initial test
cargo test --locked -p xcl --test gpu_dxil_lowering -- --test-threads=1 --nocaptureResult: 5 passed, 1 failed.
The only failure was
direct_dxil_kernel_memory_lds_and_exact_valu:split-w64: lane 0 v3280312Follow-up diagnostic
I temporarily modified the test comparison, leaving the translation code unchanged. I skipped lane-by-lane comparisons for the two contended atomic return registers in split-wave64 and compared their sorted results instead.
Results:
v3): both backends produced exactly280–343.v4): both backends produced exactly10–73.The temporary test modification was reverted. The original file's SHA-256 was verified after restoration, and
git statusconfirmed a clean working tree.Conclusion
This independently reproduces the lane-specific atomic return mismatch on an AMD RX 7900 XTX under Windows native D3D12. The identical sorted return-value sets and matching final memory strongly suggest that the current lane-by-lane comparison is sensitive to different atomic scheduling between two separate executions, rather than an incorrect final atomic result.
I have not tested any game files.
AI assistance disclosure: ChatGPT assisted with analysing the test output and drafting this report. I independently ran the commands and GPU tests, inspected the results, and verified that the temporary test modification was reverted.
@DavidM1911 on GitHub · 2026-11-24 21:16 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.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.