Tests: add end-to-end GPU tests for direct compute dispatch splitting #2477
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2487"
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?
Imported from ivall/xcl. Originally posted by microwave805 on 2026-11-25T20:09:09Z.
Part of #1269
Direct DXIL compute dispatch splitting (
gpu/dxil/module/split.rsandhle/d3d12x/real/dispatch_chain.rs) was covered by unit tests on hand-built IR modules, but had no end-to-end GPU tests running real RDNA2 compute programs throughkernel::translate_computeor exercising the D3D12.XCreateComputePipelineState->dispatch_chain::build-> consoleDispatch->ID3D12CommandAllocator::Resetlifecycle.What is in it
crates/xcl/tests/gpu_dispatch_split_e2e.rswith two end-to-end GPU tests (dedicated test binary soXCL_DIRECT_DXIL=1,XCL_DIRECT_SPLIT_INSTRUCTIONS=80,XCL_SPLIT_SCRATCH_MB=1,XCL_UMA_MB=64stay isolated):direct_compute_dispatch_split_matches_unsplit_across_wave32_and_wave64: translates real RDNA2 wave32 ([32, 1, 1]) and split wave64 ([64, 1, 1]withv_readlane_b32inter-half exchanges) programs containing a scalar loop SCC, a uniform forward skip over intermediate split pieces, lane-divergent selection, and a persistent value kept live across all pieces; validates every piece (>= 3pieces) and checks exact equality against both unsplit DXIL and a CPU oracle across[2, 3, 2]grids and slab limitsmost = 1, 2, 3, 7, 12.console_split_compute_pso_dispatches_through_d3d12x_hook_and_reuses_scratch: wraps both wave32 (flags = 0x20) and wave64 (flags = 0) programs in retail console containers (DXBC -> DXIL/XDAT -> XBCH -> FSSM), compiles throughreal::create_device->CreateComputePipelineState, verifies the dedicateddispatch_chainroot signature, executes two back-to-back chained dispatches on the same command list (reusingSHAREDscratch with an inter-dispatch UAV barrier), resets the command allocator, runs a third pass, and verifies every output dword in UMA.Tested
32.0.16.1742, wave32 + SM 6.6 + mesh shaders, no native wave64), DXC1.9.2602.17(Windows SDK10.0.26100.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), debug profile, tested on commit627e3ce06ff7.cargo test -p xcl --test gpu_dispatch_split_e2e -- --nocapture: 2 passed, 0 failed, 0 ignored..\scripts\test.ps1(withXCL_DXIL_CACHE=%TEMP%\xcl-test-dxil-cache): 1419 passed, 0 failed, 46 ignored (26SKIPPEDlines on this adapter: 21no wave64, 3 per-lane wave32 unsupported-op skips, 1no heap windows, 1cannot disable the driver cache (Windows Developer Mode is required)).Regression run
Not needed: test-only change under
crates/xcl/tests/(no runtime files modified).Not tested
XCL_SAMPLE_*game-data tests (no unpacked Xbox Series game files available).AI use
Gemini 4 Neon).crates/xcl/tests/gpu_dispatch_split_e2e.rs, ran the targeted and full workspace test suites on commit627e3ce06ff7, and drafted this PR description.Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T20:27:56Z.
Focused AMD run of exact PR head
627e3ce06ff7e655368b53acd80705c0b1fb3b63from a clean detached worktree.Tested
30.0.13002.13003; Windows 11 build 26200; Rust1.99.0(stable-x86_64-pc-windows-msvc); DXC/DXIL1.8.2502.11.XCL_ADAPTER=6800M cargo test --locked -p xcl --test gpu_dispatch_split_e2e -- --test-threads=1 --show-outputand each of the two tests rerun individually with--exact --test-threads=1 --nocapture.0xc0000005(STATUS_ACCESS_VIOLATION) after XCL initialized the real RX 6800M D3D12 backend. The file-level run also terminated this way. The process exited before libtest produced a final passed/failed/ignored summary; noSKIPPEDlines appeared.fetch_updateuses and one unreadheapsfield.Not tested
AI use
Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T20:36:10Z.
Independent AMD RDNA4 (native wave64) test report on exact head
627e3ce06ff7e655368b53acd80705c0b1fb3b63(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1417 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record).tests/gpu_dispatch_split_e2e.rsran and passed on AMD RDNA4 with zero skips.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599) are pre-existing on unmodifiedmainon this GPU.Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T20:37:09Z.
gpu_suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, and the promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Notegpu_depth_buffer_created_for_unordered_access_is_placedis green on main now, #2466 did its job on this lane.Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T20:41:32Z.
Ran on an AMD RX 9070 XT (RDNA4, native wave64) and an RTX 3060. Both new tests pass on both cards.
Diff applied on
main6d12f58, debug, Windows 11 Pro 26200, card chosen withXCL_ADAPTER:cargo test -p xcl --test gpu_dispatch_split_e2e -- --nocapture: 2 passed, 0 failed, no skips, on both the RX 9070 XT (driver 32.0.32029.2010) and the RTX 3060 (driver 32.0.16.1088).cargo test -p xcl --lib -- gpu::: RTX 3060 700 passed, 0 failed; RX 9070 XT 698 passed, 2 failed. The 2 failures are the AMD fuzz seeds tracked in #2115, the same onmain.One note on the "native wave64" gap:
direct_compute_dispatch_split_matches_unsplit_across_wave32_and_wave64translates the wave64 case withsplit: wave64, so even on the RX 9070 XT it runs the split form. This run doesn't cover the native (split = false) wave64 path either.Not tested:
XCL_SAMPLE_*game-data tests (no game files).AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T20:53:01Z.
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!
upstream-sync referenced this pull request2026-11-25 22:05:21 +00:00
Imported from ivall/xcl. Originally posted by pablogonz12 on 2026-11-25T21:35:30Z.
Test report from Linux + Wine on AMD RADV, and a caveat with it: on this lane both new tests abort the test binary before any
test resultline, andmainaborts the same way on the same box, so this is the lane, not your diff. Prepared with AI assistance (DeepSeek V4.1 Flash in OpenCode ran the commands and wrote this); no code was written or changed.Setup
RADV GFX1201), AMD Radeon RX 9070 XT 16 GB (RDNA4, native wave64), Ryzen 9 9900X.WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11,d3d10core=n,b",VKD3D_CONFIG=ignore_shared_fence,WINEDEBUG=-all, DXC 1.9.2609.5.627e3ceon basemain6d12f58(clean checkout, no changes to tracked files).RUSTFLAGS="-C target-feature=+crt-static" cargo xwin test -p xcl --release --locked --target x86_64-pc-windows-msvc --test gpu_dispatch_split_e2e --no-run, then under Wine.Result at this head
--test-threads=1test resultline--exact direct_compute_dispatch_split_matches_unsplit_across_wave32_and_wave64test resultline--exact console_split_compute_pso_dispatches_through_d3d12x_hook_and_reuses_scratchtest resultlineEach run gets as far as compiling its compute shader (
xcl: [SHADER] cs ... format dxil), creating the device on RADV and the UMA windows; the process then exits with status 5 and prints no panic message. It runs twice with the same result (the whole binary plus each test alone).Same box,
main6d12f58, no PR appliedxcllib test binary, filtergpu::dxil::module::split::tests::dispatch_chain --test-threads=1: exit 5, notest resultline — the same abort signature, on the existing split tests (issue #1246).gpu_compute_e2e: 5 passed, 1 failed, 1 skipped (no heap windows). The failure isoffline_split_compute_pipeline_is_reused_by_a_second_process, which panics atcrates/xcl/tests/gpu_compute_e2e.rs:195withprecompiling 1 shaders into C:\users\steamuser\AppData\Local\Temp\xcl-offline-split-pso-....So on this lane the split/dispatch-chain compute path already fails on
main, before this PR. For contrast, the lane does run other GPU code: on#2488's head the 64-bit typedIMAGE_ATOMIC_*e2e tests pass 3/3 with noSKIPPEDon the same prefix and driver.Not tested
AI use
main, ran the commands above and wrote this report.mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #172Imported from ivall/xcl. Originally posted by microwave805 on 2026-11-26T23:37:04Z.
@DarkPanda69 Thanks for testing on RX 9070 XT and RTX 3060! Passing
split: wave64indirect_compute_dispatch_split_matches_unsplit_across_wave32_and_wave64is intentional:kernel::finish_dispatchonly runssplit_computeforhw == 32(native wave64 never builds aDispatchChain, whichkernel::dispatch_chain_native_wave64_builds_wholeenforces).(AI use: Antigravity (
Gemini 4 Neon) drafted this comment.)Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T00:08:45Z.
Tested: Clean
627e3ce06ff7e655368b53acd80705c0b1fb3b63, Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC, debug, Intel Arc A770 driver 32.0.101.9175, DXC 1.9.2602.17.cargo test --locked -j 2 -p xcl --test gpu_dispatch_split_e2e --no-run, followed by the built test binary with--test-threads=1 --nocaptureandXCL_ADAPTER=A770: 2 passed, 0 failed, 0 ignored, 0 skips. For native wave32 and split wave64 on a 2×3×2 grid, whole and split direct DXIL matched the CPU oracle at slab limits 1, 2, 3, 7 and 12. The console hook fixture also verified UMA readback after two dispatches on one list and another after allocator reset. Comparisons covered all 400 or 784 dwords including 16 guard words per case.Not tested: Native wave64 hardware, scratch allocation identity, full workspace suite and retail smoke.
AI use: T3 Code / Codex (
gpt-6.2-sol) ran and independently reran the checks and drafted this report.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:10:16Z.
Triage (#1607) – head
627e3ceNo open or merged PR adds end-to-end GPU tests of a split direct compute dispatch (
kernel::translate_compute->DispatchChainrun per slab against the unsplit DXIL and a CPU model, and the console list path throughCreateComputePipelineState/Dispatch). The struct literals (KernelOptions,CsInterface,MappedModule) and thereal/pso_async/bindfunctions it uses still match main.run_dispatch_chainbuilds its own copy of the dispatch-chain root signature and slab loop, so it can drift frompso::record_dispatch_chainwithout failing. No problems found in the diff.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.