Recompiler: give a compute loop above the split target its own dispatch piece #2107
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!2107
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2107/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?
@Kalmarv on GitHub · 2026-11-25 04:31 UTC · original
Kalmarv:direct-split-oversized-scc→main· +1364 −83 · 16 files · 6 commits · merged 2026-11-25 13:36 UTCPart of #1269. Stacked on #2080: only the last commit,
697e8fd, is new here.#2080 keeps each strongly connected component (every loop) in one piece and declines a program when a single component is bigger than the piece target. The title's b3618a0fd76af79c (a raytracing resolve, 120,327 DXIL instructions) has one 15,652-instruction loop against the 12,500 target, so it stays whole and takes 31 s to build cold. With this change that loop gets a piece of its own, the rest splits as before, and the program builds in 4.1 s.
What is in it
crates/xcl/src/gpu/dxil/module/split.rs: a component over the target gets its own piece, up to four times the target. The components around it go in separate pieces. A component over four times the target, or a plan that ends up as one piece, keeps the whole pipeline as before.README.md:XCL_DIRECT_SPLIT_INSTRUCTIONSnow describes the four-times ceiling.dispatch_chain_oversized_loop_matches_whole, gives a 55-instruction loop its own piece at a target of 40. Its whole and split outputs match the CPU reference in native wave32 (96 words) and split wave64 (192 words).Tested
Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, release, DXC 1.9.2609.
Cold pipeline build of b3618a0fd76af79c as the title emits it (the whole binary is byte-identical to the title's cache, and so are all six sampler records), fresh process, implicit caches off, split pieces on 16 threads:
7.6× faster. All 11 pieces pass the DXC 1.9 validator. The largest has 26,449 instructions after the continuation code, and the chain uses 10,272 scratch dwords per group.
Across the 81-program compute corpus of the title's first two minutes (four heap windows, offline), this change admits 7 more programs to splitting, 25 → 32, with 9–11 pieces each, and loses none. Every whole binary is unchanged. Two programs still keep their whole pipeline, because one loop is over the 50,000-instruction ceiling: 958400d2 (57,891) and 56c0cd3b (62,580). b3618a0fd76af79c is not among the 81.
Intel Arc A770, measured by @JJAutoCompare (comment) on
d131645:dispatch_chain_oversized_loop_matches_wholepasses, with all 96 native-wave32 and 192 split-wave64 words matching.AMD RDNA4, measured by @bielfreedom (comment), RX 9070 XT, Ryzen 7 7700, on
d4b8717: of the title's 2,689 compute programs, 809 split against 462 with #2080 alone. The 347 newly split programs are 815 KB to 1.30 MB of direct DXIL, in 10–15 pieces. Twelve of them, spread by size, build 9.1× faster split on 16 threads than whole (843.8 s → 93.0 s, mean of 2 rounds; 5.4–13.7× each), and all 312 builds succeed. On that card thedispatch_chainandsplit::teststests pass, 6 of 6, with no skips.84eee477d68b6fdf (
CS_RaytracingResolve) on AMD, measured by @bielfreedom (comment, method): on the HLSL path it never finishes building, on an RX 6800 (#1809) or on an RX 9070 XT (over 20 min). On the RX 9070 XT withXCL_DIRECT_DXIL=1, #2080 alone keeps it whole (52.9 s). With this change it splits into 12 pieces and builds in 7.8 s on 16 threads.With #2107 and #2126 together, on AMD RDNA4, measured by @bielfreedom (comment), RX 9070 XT,
3283da4withd4b8717merged on top (clean merge): the 13 programs only #2107 splits build in 34.3 s split against 87.3 s with #2107 alone and 837.1 s whole (24.4×), each in 2.1–3.3 s. That includes 84eee477d68b6fdf, which never finishes building on the HLSL path there, in 2.6 s. Summed piece builds 693.6 → 281.9 s. On the merged tree thedispatch_chainandsplit::teststests pass, 8 of 8, with no skips.On an RTX 3060, measured by @pvfreis (comment):
742a41ceb422beb5doesn't split with #2080 alone (whole 45.6 s). With this PR's planner change it splits into 11 pieces, built in 4.4 s against 42.1 s whole (9.5×; 12 threads, driver caches off, median of 3).The branch was rebased onto
mainf5c5bdfwith #2080; the only conflict was inREADME.md.697e8fdisd131645rebased (it wasd4b8717before the rebase ontomain9633138).cargo test --release --offline --workspace -- --test-threads=4ond131645: 1159 passed, 0 failed, 46 ignored, with 24 skip notices across 14 tests (no native wave64, unsupported per-lane forms, no heap windows). All fourdispatch_chainGPU tests ran and passed, the new one included, and so did the planner's ceiling test.AMD Radeon RX 9070, regression pair by @Toons29 (comment), Ryzen 7 7800X3D, on
049dec8(this branch before the latest rebase), 60 s of a title on the default route:main568e7db1566 frames and this PR 1632, peak commit 14592 / 14591 MB, no crash or device removal in either.cargo test --workspace -- --test-threads=4(debug) on697e8fd, rebased ontomain9633138: 1248 passed, 2 failed, 46 ignored. The two failures,device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaaandpso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator, fail onmain9633138too; #2245 fixed both onmainsince. 25 SKIPPED notices: no native wave64 on this card, three per-lane FP16 forms the per-lane lowering refuses, and no heap windows.Regression run
The branch was rebased onto
main9633138with #2080's current head6c34370, with no conflicts of its own.scripts/smoke.ps1 -Seconds 120, the same retail title, one after the other on the machine under Tested, release builds from clean trees.main9633138(this PR's base):this PR,
697e8fd:PR vs
main: 1311 / 1323 frames (99 %), peak commit 30324 / 29175 MB (104 %); device removals 0 and crashes 0 on the PR run, 0 and 0 onmain.Both runs use
XCL_DIRECT_DXIL=1and start with the same private XCL pipeline cache, holding only the pipeline list; the driver's own cache was left alone. The PR run loggedcompute split: 34 programs split, 179 pieces built, 114 chained dispatches issuedat 120 s (0 by 60 s, all 114 by 70 s), and nopiece ... refusedwarning. Before the rebase,d4b8717logged 33 programs, 173 pieces, 156 chains in the same setup; how far the title gets before it stops varies between runs. Both runs present no frames in their last 6 s, for a reason this change doesn't touch.Not tested
AI use
OpenAI Codex (GPT-6) wrote the change and the tests. Claude Code (Claude Opus 5.5) helpers ran the driver timings, and Claude Code wrote this description and opened the PR.
🤖 Generated with Claude Code
@JJAutoCompare on GitHub · 2026-11-25 04:51 UTC · original
Tested
Clean detached PR head
d1316454dd83c20a770ac48e6df7bc08d1b3a364on STOR-WINLAB. Windows 11 Enterprise Evaluation 25H2 x64 (26200.9974), Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 x86_64-pc-windows-msvc, DXC/DXIL 1.9.2609.5. Unoptimized test profile with debug info and incremental compilation disabled.cargo test --locked -p xcl --lib --no-runran outside the GPU mutex and exited 0 in 1m 55s. WithXCL_ADAPTER=A770andXCL_DXC_DIRset to the installed 1.9.2609 toolchain, ran this prebuilt command under the sharedInvoke-ArcTest.ps1 -Testmutex.1 passed, 0 failed, 0 ignored, 0 skipped, 1,128 filtered out, 0.48 s. Fixture and wrapper exited 0. The oversized loop occupied its own piece at a target size of 40, and the dispatch chain contained at least three pieces for both wave forms. All 96 native-wave32 words and 192 split-wave64 words matched in the whole-dispatch vs CPU reference and split-chain vs whole-dispatch comparisons.
Not tested
Native wave64, other adapters, planner ceiling rejection cases, dispatch timing, workspace suite, and retail smoke.
AI use
T3 Code / Codex (
gpt-6.2-sol) ran the existing fixture, checked the evidence, and wrote this report.@JoaoPauluu on GitHub · 2026-11-25 05:22 UTC · original
Same as on #2080, plus this PR's tests. A run with vkd3d-proton as the host D3D12. 4 of the new dispatch-chain GPU tests crash the test process inside vkd3d-proton.
Tested
x86_64-pc-windows-gnu.d4b8717as it is (merge base withmainf5c5bdf), no uncommitted changes. The lib test binary runs under Wine, one test per process, twice: atd131645and atd4b8717, with the same result.dispatch_chain_oversized_loop_matches_whole: crashes (see below)dispatch_chain_divergent_forward_edges_3d: crashes (see below)dispatch_chain_wave32_live_loops: crashes (see below)dispatch_chain_wave64_live_loops_and_exchange: crashes (see below)dispatch_chain_native_wave64_builds_whole: ok, SKIPPED (no wave64)oversized_loop_occupies_one_piece_up_to_the_hard_ceiling: okpage fault on read access to 0x0000000000000110, at0x6ffffca2b118. That address is inside vkd3d-proton'sd3d12core.dll, which is loaded at0x6ffffc880000. I traced it fordispatch_chain_wave32_live_loops; the others end with the same exit code. So the host's D3D12 crashes on something the dispatch chain does. I have not found which call.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-25 06:02 UTC · original
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!
@bielfreedom on GitHub · 2026-11-25 06:55 UTC · original
AMD RDNA4 data for #2107: on the RX 9070 XT this change splits 347 more retail compute programs (462 → 809 of 2,689). The 12 measured build 9.1× faster split than whole (844 s → 93 s). Every build succeeded, and the PR's tests pass on this card.
Setup
d4b8717(on #2080), plus the local timing patch from my #2080 report. For a program with adispatch_chain, the patch builds the whole DXIL, then the pieces on up to 16 threads, and times everyCreateComputePipelineState.Census (
XCL_DIRECT_DXIL=1, default split target)Measured
XCL_PSO_DISK_CACHE=0, a fresh exe name per round (the AMD driver cache is keyed on it), 2 rounds.Tests on this card (
XCL_REQUIRE_GPU=1,XCL_ADAPTER=9070)cargo test --release -p xcl --lib -- dispatch_chain split::tests --test-threads=1: 6 passed, 0 failed, no SKIPPED notices.dispatch_chain_oversized_loop_matches_wholeandoversized_loop_occupies_one_piece_up_to_the_hard_ceiling.Not tested
AI use: Claude Code (Claude Opus 5.5) ran the census, timings and tests and drafted this. Counts and timings only, no game data.
@bielfreedom on GitHub · 2026-11-25 07:43 UTC · original
A follow-up for #2107 from the RDNA4 side. The retail program
84eee477d68b6fdf(CS_RaytracingResolve) never finishes on the HLSL path on the RX 6800 (reported on #1809) or on the RX 9070 XT (over 20 min here). On the RX 9070 XT:Numbers and method: #1809 comment.
AI use: Claude Code (Claude Opus 5.5) wrote this. Account owner away; counts and timings only.
@bielfreedom on GitHub · 2026-11-25 08:42 UTC · original
Combined with #2126 on the RX 9070 XT, this PR's 12 newly split programs plus
84eee477d68b6fdfbuild in 34.3 s split, against 837 s whole (24×). That is 87.3 s with this PR alone. Numbers: #2126 comment.AI use: Claude Code (Claude Opus 5.5) wrote this. Account owner away.
@moombathepilot on GitHub · 2026-11-25 09:28 UTC · original
Tested — RX 7800 XT (RDNA3), native Windows
Clean release builds of #2080 at
8eefdefcf2283f1ae7ff524ed66de43356b82060and #2107 atd4b8717f92d1fcc8f3be31c2070de03ca58246fc. RX 7800 XT 16 GB, AMD driver32.0.32029.2010, Ryzen 7 5700X3D, Windows 11, Rust 1.100.0 MSVC, DXC 1.9.2602.17.cargo test --locked --release -p xcl --lib dispatch_chain -- --test-threads=1 --show-outputon #2107: 5 passed, 0 failed, 0 ignored, 0 skips. The split-vs-whole GPU fixtures passed, including the oversized-loop case.dispatch_chain_native_wave64_builds_wholealso passed.Retail smoke
One 150 s run per build, run sequentially with
scripts/smoke.ps1 -Seconds 150,XCL_DIRECT_DXIL=1,XCL_PSO_DISK_CACHE=0, separate fresh XCL data and DXIL caches seeded with the same saves, and networking off. The AMD driver cache was not explicitly cleared or disabled.Both reached the loading artwork and exited at the test limit with
0x0, zero crashes and zero device removals. The last nonzero present sample on #2107 ended at about 122 s. Manual input took the two runs into loading at different times, so the frame and memory totals do not establish a speedup or regression.Not tested
First playable frame, full workspace suite, or split dispatch GPU time. Both runs enumerated
84eee477d68b6fdf, but neither logged a build for that record. The counters do not identify the program that split.AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) ran the builds and focused tests, set up the retail runs, checked the logs, and drafted this report. The account owner supplied the manual retail input.
@Toons29 on GitHub · 2026-11-25 11:23 UTC · original
Regression run of
049dec89on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon568e7db7, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 104 % 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.@thehollowedone on GitHub · 2026-11-25 08:49 UTC · original · edited 2026-11-25 13:08 UTC
Recheck on 697e8fd
Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, DXC/DXIL 1.8.2502.11, debug.
cargo build --offline --locked --workspace --jobs 6passed for both the exact revision and the local merge with main 1a0bbe3.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapturereported 1248 passed, 2 failed, 46 ignored on the exact head and 1257 passed, 0 failed, 46 ignored on the integration. The exact-head failures were the same cache-marker and UAV-format assertions, with the same values, as in the pinned-base comparison for #2080. Main includes the assertion fixes from #2245. Cargo's passed count includes 26 explicit skip notices in each run.The planner's four-times cutoff test passed on both builds. The oversized-loop GPU fixture matched the whole shader and the CPU reference for all 96 native-wave32 and 192 emulated-wave64 outputs on each build. This recheck did not repeat the timing measurements below or run the retail title.
AI-assisted. Codex (GPT-6, exact variant unavailable) ran the recheck and drafted this update.
Earlier timing run
Independent GPU execution timing on d4b8717, RTX 3080 Ti / 621.35, Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC and DXC 1.8.2502.11.
The stock
dispatch_chain_oversized_loop_matches_wholepassed (1 passed, 0 failed, 0 skips). A scratch extension of the same synthetic test used D3D12 timestamp queries around one whole dispatch or the full split chain. I ran both orders in two fresh processes and dropped the first five of 21 samples in each series. All repeated-dispatch readbacks matched. The table shows the range of series medians in µs.The test command was
cargo test --offline --locked -p xcl --lib dispatch_chain_oversized_loop_matches_whole -- --nocapture --test-threads=1. Both timed runs passed with zero skips. These timings cover dispatch execution, including the in-chain barriers. Compilation, upload and readback are outside the timestamps. Retail frame pacing was not tested.AI use: Codex (GPT-6, exact variant unspecified) extended and ran the synthetic test and drafted this report.
@ivall on GitHub · 2026-11-25 13:36 UTC · original
Merged as
afc5ee8together with the other two of the split (#2080, #2107, #2126), thanks.Tested on the merged tree: AMD RDNA4, Windows, DXC 1.8.2502.11, debug.
cargo test --workspace --no-fail-fast -- --test-threads=4: 1261 passed, 2 failed (fuzz_validate_and_gpu_1/_3, #2115, as onmain), 46 ignored.XCL_DIRECT_DXIL=allongpu::: 638 passed, the same 2 failed, 22 ignored.In a title (these heads on
main1a0bbe3with other open PRs on top: #1803, #2092, #541; AMD RDNA4): two runs of 366 s and 699 s without a removal, and one of 96 s that ended in 0x887a0006, in a list whose last labelled pipeline was a graphics one (a light shader), not a chain. That 96 s run, with a slab commit on top, logged 177 programs split, 1 809 pieces, 75 chained dispatches, each in one slab, scratch at most 54 MiB, largest dispatch 15 MiB. The merge tree itself has not been run in a title.Conflicts with #1592 (
real.rs: the moved compute container and theXCL_DREDlabels) and with the test insplit.rswere resolved in the merge;XCL_DRED=1now labels the compute pipelines that a chain returns.AI use: Claude Code (Claude Opus 5.5) merged it, ran the tests and wrote this on the maintainer's behalf.
@DavidM1911 on GitHub · 2026-11-26 07:28 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