Recompiler: split single-wave compute groups of any shape #2343
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by zohaiblazuli on 2026-11-25T16:20:50Z.
Stacked 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
Imported from ivall/xcl. Originally posted by throny on 2026-11-25T17:00:42Z.
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.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T18:41:23Z.
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
Imported from ivall/xcl. Originally posted by zohaiblazuli on 2026-11-25T18:55:59Z.
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).
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:20:51Z.
Review: COMMENTED
No confirmed source-level correctness defect found, but this is not merge-ready. It substantially overlaps #2349; the author notes that it must be rebased onto #2349 plus #2299 and reduced to the LDS-specific portion. Please do that before review/merge, since the current +940/-43 diff obscures the boundary. Also, the strong synthetic GPU coverage is not a substitute for current real-title smoke/regression evidence for these LDS programs. After rebasing, please provide a fresh Windows GPU/smoke comparison, particularly because snapshotting full LDS around cuts can grow generated DXIL.
Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T20:24:16Z.
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
Imported from ivall/xcl. Originally posted by CalvyPZ on 2026-11-25T22:44:25Z.
This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:59:32Z.
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
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:40:40Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:53:56Z.
Triage (#1607) – head
a81f9d5#3504 carries this whole stack rebased onto current main: #2349's commit, #2097's two commits, #2299's commit, and this PR's own commit
a81f9d5(asb195c24).git range-diffshows only rebase adjustments:safe_barrier_init,reuse_piece_slots, and thesplit_computereturn. #3504 adds the two-pass mesh dispatch chains on top, it is mergeable and its checks are green. This branch conflicts with main.No problems found in this PR's own commit: it admits single-wave native LDS groups by thread count, gives 64-thread split LDS groups the split lane ID, and adds shape tests.
Recommendation: close (superseded by #3504).
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T15:58:37Z.
Closing as superseded: the same change is in #3504 (open, mergeable, required checks green). From Foniass's rechecked close list on #1607, checked again by script just now. If something here is still missing, say so and reopen it, or ask and I will.
AI use: Claude Code (Claude Opus 5.5).
Pull request closed