Recompiler: split single-wave compute groups of any shape #2353
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!2353
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2353"
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?
@zohaiblazuli on GitHub · 2026-11-25 16:20 UTC · original
zohaiblazuli:split-single-wave-any-shape→main· +940 −43 · 6 files · 5 commits · openStacked on #2349, #2097 and #2299; only the top commit belongs here (
a81f9d5). Part of #2088 (workstream 4, large-pipeline splitting).Found independently: the 8×4×1 single-wave gate was described in #2088 (comment, 15:54 UTC) before either PR opened. #2349 covers the part without guest LDS, and this PR is reduced to the guest-LDS part on top of it.
#2349 splits native wave32 groups of any shape, but only without guest LDS. #2299 splits programs with guest LDS, but only in a
[32, 1, 1]native wave32 group or a split-wave64 group whose translator gate admits it. So a program with guest LDS in a single 8×4×1 wave stays whole. In a census of the title's 30 largest compute programs (direct DXIL, default settings), 8 of the 13 that stay whole are exactly that: wave32 8×4×1 with guest LDS, 14.3 MB of plain DXIL, each a 66–217 s cold build on an RTX 3060. With this commit all 8 split, into 15–28 pieces each.What is in it
crates/xcl/src/gpu/dxil/kernel.rs: a native wave32 group with guest LDS is offered to the splitter by its thread count (32, one wave) instead of[32, 1, 1]. A 64-thread split-wave64 group with guest LDS gets its split lane id, so each piece replays the lane allocation before restoring the LDS. #2299's description lists that case as cut, but its translator gate still kept it whole.crates/xcl/src/gpu/dxil/module/split.rs:split_computerefuses a native group with guest LDS that is more than one wave and has no split lane id. Tests: #2299's LDS fixture takes a group shape and checks each thread's x/y/z, for wave32 8×4×1, 4×8×1 and 2×4×4 and split wave64 8×4×2. It also checks that single-wave native lane setup has no group barrier, and that an 8×8×1 wave32 group with LDS (two waves) is refused.README.md: two lines on group shapes with guest LDS.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4ona81f9d5: 1288 passed, 0 failed, 46 ignored.XCL_DIRECT_DXIL=1, default split target, 4 windows): the 8 records split ata81f9d5and stay whole at5e8246b(the commit below):219287eb2f6021fe28 pieces,f839072880d49fb427,c963276f38285bf427,52166c345576bded19,7b468aa4210b181016,715e7a408a537ff517,f9d73adcc1ad69ef16,df45a39c275d0db515.CreateComputePipelineStatewithxcl shaders <pack> --measure-psoand a local, not-included change that builds a chain's pieces in parallel. Implicit driver caches off, fresh process, no cached blob, 1 run each. These were measured on the earlier form of this change (7e92361, on #2299), which emits the same chains for these records:219287eb2f6021fe7b468aa4210b1810df45a39c275d0db5Regression run
scripts/smoke.ps1 -Game <title> -Seconds 100, both withXCL_DIRECT_DXIL=1, since the default HLSL path does not reach this code. 100 s because the title enters a texture-heavy phase near 60 s, and peak commit differs by ~4 GB between runs that end before it and runs that end after it.Not tested
kernel.rsandmodule/split.rsfor #2097's and #2299's commits. Those commits here are my resolution of them on top of #2349, not their authors'.AI use
🤖 Generated with Claude Code
@throny on GitHub · 2026-11-25 17:00 UTC · original
Two contributors checked independently and found that #2349 solves the same problem (for #2088) in a different way: #1607, group D85. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@DavidM1911 on GitHub · 2026-11-25 18:41 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 2 real failures, deterministic (also fail--test-threads=1):Same pair of failures seen across #2229/#2231/#2234/#2235-#2247 — shared feature area, needs fixes before merge.
— Devin
@zohaiblazuli on GitHub · 2026-11-25 18:55 UTC · original
Thanks, @throny. #2349 and this PR overlap: both drop the
[32, 1, 1]gate and use the lane index for one-wave 2-D/3-D groups. #2349 is based onmainand also covers groups of several wave32 waves; this one covers groups that use guest LDS (on top of #2299), which #2349 keeps whole. The 8 programs measured here all use LDS. I'll rebase this PR onto #2349 + #2299 and reduce it to the LDS part, so the two don't compete.@DavidM1911: both failures also fail on this stack's base
4de5261without this commit; #2245 fixed them onmain, and they go away when #2299 is rebased.AI use: Claude Code (Claude Opus 5.5).
@emirduran707 on GitHub · 2026-11-25 20:24 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
a81f9d536f1578e0b8393697320b185da97d573b(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: 1286 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). All native wave64 GPU tests ran and passed.gpu::dxil::module::split::testspassed (no skips):dispatch_chain_four_wave64s_preserves_partner_epochs,dispatch_chain_exited_waves_preserve_other_waves_3d,single_wave_2d_3d_omits_xcl_wt_and_guest_barrier_declines_split, anddispatch_chain_native_wave32_group_shapes_match_whole.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
@DavidM1911 on GitHub · 2026-11-26 00:59 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
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.