Direct DXIL: make multi-wave Compute and Mesh s_barrier early-exit-safe #1793
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!1793
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1793"
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?
@mastrr9 on GitHub · 2026-11-24 20:51 UTC · original
mastrr9:fix/direct-dxil-split-wave64-barriers→main· +528 −12 · 10 files · 1 commits · openSummary
Makes the multi-wave Compute and Mesh
s_barrierin the Direct DXIL path safe against early-exiting waves on split-wave64 NVIDIA GPUs.#1741bounds the single-wave split exchanges. This change covers the remaining unguardedGROUP_SYNCins_barrier(lower.rs), related to#1727. A wave that exits early no longer leaves the others waiting at a barrier it will never reach.xcl_s_barrierlive-wave bookkeeping (0c02b87) to Direct DXIL (group_barrier.rs).XCL_SAFE_BARRIER=0to turn the guard off.TRANSLATOR_VERSIONchange: #1947 hashes thegpu/dxilsources into the cache identity.XCL_SAFE_BARRIERto the translation cache-bypass list.Tested
Current head
e935deb, on macOS:cargo check --locked --workspace --all-targets --target x86_64-pc-windows-msvc(Rust 1.100.0, the C compiler for one dependency stubbed out) finished with no errors. This is a type check only; nothing was run.Earlier runs, made before the rebase and the LDS fix, not on the current head:
Windows 11 x64, NVIDIA GeForce RTX 5080 16 GB, DXC 1.9.2602.17.
cargo test -p xcl --lib dxil::core_tests -- --test-threads=1: 17 passed, 0 failed, 1 ignoredXCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu_split_wave64 -- --test-threads=1: 5 passed, 0 failedcargo test -p xcl --lib gpu::dxil -- --test-threads=1: 89 passed, 0 failed, 1 ignoredcargo test -p xcl --lib -- --test-threads=1: 849 passed, 0 failed, 22 ignored (no new warnings)Not tested
AI use
@upipibi on GitHub · 2026-11-24 21:31 UTC · original · edited 2026-11-24 21:47 UTC
Two data points for the premise, RTX 3070 (Ampere), driver 616.56, Windows 11:
gpu_sparse_vram_descriptors_buffers_and_xmemre-initialising the backend, which #614 fixes: 0 of 4 whole-lib runs hung with it, 3 of 4 onmain(numbers).gpu_safe_s_barrier_multi_warp_and_early_endpgmwithXCL_SAFE_BARRIER=0. The emitted HLSL puts bothGroupMemoryBarrierWithGroupSync()insideif (!xcl_skip_end), so the upper console wave's 2 warps skip them and leavemain. The lower 2 warps still passed both barriers with the correct LDS values, in 2 of 2 runs. On Ampere, warps that have exited seem to count as arrived.So the guard may not be what stops a hang on NVIDIA. It still covers Intel, where boykopovar/AnyPS5#26756 reports the ended-wave hang, and it covers waves that skip a barrier but stay alive. A test that hangs or fails without the guard on the RTX 5080 would show which case this PR fixes there. The update below runs this PR.
Update, this PR's direct path: I sent the same test's early-exit shader (128 threads, the upper console wave ends before two
s_barriers) throughdirect_orlocally. WithXCL_DIRECT_DXIL=1it then runs on this PR's direct translator. At9648fe9, RTX 3070:XCL_SAFE_BARRIER=1(the new guard): passes.XCL_SAFE_BARRIER=0(SBarrier::Sync, a plain group sync): passes, 2 of 2.So on Ampere the direct path doesn't hang without the guard either. That is consistent with the HLSL result above.
AI-assisted (Claude Code). Synthetic tests only.
@DavidM1911 on GitHub · 2026-11-24 23:41 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@futurepro62 on GitHub · 2026-11-24 23:53 UTC · original · edited 2026-11-25 00:00 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
a6ace09(on its base689f2db).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::dxil::fuzz_tests: 972 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.s_barrier_policy_matches_the_recompiler,programs_without_s_barrier_have_no_safe_barrier,multi_wave_s_barrier_is_early_exit_safe,safe_barrier_decrements_on_every_exit,single_wave_s_barrier_is_a_fence,kernel_s_barrier_stays_a_group_sync,safe_barrier_words_live_in_the_lds_block.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 981 passed, 0 failed, 45 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main62265d3too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651) and the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests (follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@Anon64 on GitHub · 2026-11-25 00:18 UTC · original
Regression run for this PR: head
a6ace09, based onmain689f2db. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s, in one batch with themainrun.main
689f2db:this PR:
No device removals or crashes; 100 % of main's frames, 97 % of its peak commit.
Not tested: the whole suite; the direct DXIL path this PR changes (these runs use the default HLSL path,
XCL_DIRECT_DXILunset).Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@mastrr9 on GitHub · 2026-11-25 07:50 UTC · original
Thanks @lewisnic94-max for the clear report and repro. A fix is pushed in
e935deb(rebased onto currentmain).gpu_safe_barrier_keeps_lds_words_8188_and_8191_apart.mainalso clamps toXCL_LDS_TOP8188 with the safe barrier (recomp/emit.rs). This PR does not change that.Not yet verified on Windows: this head has only passed a Windows-target
cargo checkon macOS, so no test has run, including the new one. Windows GPU re-verification is queued for the next PC session.AI use: Claude Code (Claude Sonnet 5.5) made the fix and wrote this reply.
@Toons29 on GitHub · 2026-11-25 13:48 UTC · original
Regression run of
e935debfon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon1a0bbe3a, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.@DavidM1911 on GitHub · 2026-11-26 00:29 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.