Direct DXIL: bound single-wave split exchanges #1741
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!1741
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1741/head"
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?
@hajduzsolt on GitHub · 2026-11-24 20:06 UTC · original
hajduzsolt:fix/direct-dxil-single-wave-spin→main· +43 −13 · 3 files · 1 commits · closed without mergingRuntime fix verified with unit tests and RX 9070 XT smoke run.
What is in it
Tested
cargo test -p xcl --lib split_single_wave_uses_bounded_exchange -- --test-threads=2passed.XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu_split_wave64 -- --test-threads=1 --nocapturepassed (5 passed, no reported skips).cargo test --workspace -- --test-threads=2passed; library tests: 827 passed, 22 ignored. Other test binaries also passed. Runtime GPU skips were not individually assessed in this run.Regression run
main:
PR:
Not tested
AI use
@fromthemoonx on GitHub · 2026-11-24 20:33 UTC · original
On an NVIDIA wave32 card the #1727 hang still happens with this PR, as often as on
main. The build, the tests and the new test's check are fine.Tested
NVIDIA GeForce RTX 3060 12 GB (32-lane waves, so wave64 runs split), driver 32.0.16.1088; AMD Ryzen 7 5700X; native Windows 11 Pro 26H2 (build 26300.9974); rustc 1.100.0
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug#1727's reproduction,
XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- --test-threads=4, alternatingmainb9b6ea6and this head254f51a, 12 runs each:0x887a0006)mainmain, default HLSL path (noXCL_DIRECT_DXIL)The System log has 44
nvlddmkmevent 153 entries during these runs. The hung runs fail the same wave64 tests on both trees (gpu_split_wave64_waves_diverge,gpu_wave64_ps_spill_slots,gpu_wave64_vs_spill_slots_and_identity, …), plusgpu_sparse_vram_descriptors_buffers_and_xmemand the tests that share the removed device. So the 33–64-thread group barrier does not look like the cause on this card, or not the only one.Exact head
254f51a7e6faa1d757016b39979ced29ab05b24b(base85e3826):cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4: 876 passed, 0 failed, 42 ignoredMerged onto current
mainb9b6ea6(no conflict): 890 passed, 0 failed, 42 ignoredsplit_single_wave_uses_bounded_exchangefails with33..=64 => Partner::Presentput back (33 threads must use bounded counter exchange). 10 runs with the change: 10 of 10 passed.Your command,
XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu_split_wave64 -- --test-threads=1: 3 of 3 passed (5 tests each). One thread does not hang on either tree.SKIPPED (no wave64):
gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware;heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowsNot tested
XCL_DIRECT_DXIL=1; DRED.AI use
@IgorAntunes66 on GitHub · 2026-11-24 20:37 UTC · original
Test report from split-wave64 hardware (the case listed under "Not tested"), plus a correction on the motivation.
RTX 5070 12 GB (wave32 only), driver 621.24, Windows 11 26H2, rustc 1.100.0, DXC 1.9.2602.17, PR head
254f51a(base85e3826).Correctness:
cargo test -p xcl --lib -- --test-threads=1: 827 passed, 0 failed, 22 ignored, both without and withXCL_DIRECT_DXIL=1(skips: 2 × no wave64, 1 × Developer Mode).split_single_wave_uses_bounded_exchange+gpu_split_wave64*with
XCL_DIRECT_DXIL=1: 6 passed.#1727 hang: this does not fix it. I wrote #1727's barrier hypothesis and later bisected it to the sparse VRAM test, which
#614 fixes (correction in #1727).
XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu::recomp::tests::gpu_ --test-threads=4,runs interleaved with base
85e3826:85e3826An equivalent local patch earlier gave 9/15 vs 9/15 on
c160d86, so I would not read the 9 vs 2 as this PR making it worse;with #614 applied it is clean. So this can stand as hardening, but not as the fix for #1727.
Review notes (from reading the code, not tested):
TRANSLATOR_VERSION(kernel.rs:36-39) is not bumped. Its comment says it must change with any change to the emittedcontainers because
gpu/dxilis not in build.rs's source hash, so existing direct-DXIL disk caches would keep serving thebarrier form.
XCL_WAVE64_SPIN=0go back to group barriers for 1-wave groups; there is no counterpart here.AI use: Claude Code (claude-opus-5-5) ran the tests and measurements and drafted this comment; I reviewed it.
@DavidM1911 on GitHub · 2026-11-24 22:43 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@Raul-Paiva on GitHub · 2026-11-25 01:32 UTC · original
A test of this PR on split-wave64 NVIDIA hardware, the case under Not tested. Counts only.
Setup:
main6567c5f+ #684, #501, #1592, #1803, #1914, #1697, #1514, plus local logging;XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1.maininkernel.rs. I applied its partner selection by hand.split_single_wave1 passed,XCL_DIRECT_DXIL=1 … gpu_split_wave645 passed. I did not run the whole suite there.Warm caches hide this PR.
src/gpu/dxil/is not inTRANSLATOR_SOURCES(build.rs), so with a warm translated cache the new DXIL is never built (#1947 fixes that). I changed the cache identity locally for the runs below.Result on a retail title:
0x887a0006) 3.5 s after a burst of compute dispatches. Nsight Aftermath showed the GPU hung in a 64-thread compute program (one console wave per group).A cost: the bounded exchange grows the largest compute program from 4.0 MB to 6.2 MB of DXIL. The NVIDIA driver took 92 s to build it once, and with 32 GB of RAM (47 GB commit limit) four runs and two precompile attempts ran out of memory while it was building. For the other runs I kept the group barrier locally for that one program.
Not tested: the whole suite on this tree; AMD; the HLSL path; the title without the other PRs listed above.
AI use: Claude Code (Claude Opus 5.5) applied the PR locally, ran the builds, tests and runs, read the logs and dumps, and wrote this comment.
@hajduzsolt on GitHub · 2026-11-25 14:46 UTC · original
Thank you for the detailed reports and the correction to the original motivation. The results do not establish this as a fix for #1727; the change should be evaluated as separate split-wave hardening. The direct-DXIL source-hash cache fix in #1947 has since merged upstream.
I tested a local rebase with a single-wave barrier fallback, but have not pushed it: the updated tree introduced three failing dispatch-splitting tests, including invalid PHI nodes. Its workspace run had 1,193 passed, 5 failed and 26 ignored in the xcl unit suite. A separate run on upstream
06c9f55had 1,194 passed, 2 failed and 26 ignored; those two failures were also present in the rebased run. The additional three failures need investigation before the rebase is ready. No new smoke result is claimed.@hajduzsolt on GitHub · 2026-11-25 15:42 UTC · original
Thank you for the testing and review. I am closing this change: the bounded spin exchange uses group-shared counters and atomics, while the current dispatch splitter cannot safely carry that state across dispatch boundaries. Supporting it requires a broader splitter redesign. The barrier fallback passes the split-dispatch fixtures, but its synchronization behavior does not establish an equivalent fix for the originally proposed spin path.
Pull request closed