Repository navigation
Recompiler: split direct compute programs that use global atomic adds - #2123
Conversation
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
AMD RDNA4 data for #2123. On the RX 9070 XT this change splits 2 more retail compute programs (462 → 464 of 2,689). Both are about 125 KB of direct DXIL, in 2 pieces each, and build 1.3× faster split (2.7 s → 2.1 s for the pair). The PR's tests pass on this card. Setup
Method
Results (mean of 2 rounds)
Tests on this card (
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. |
|
Tested
Not tested Polling-loop refusal, other GPUs or wave modes, workspace suite, retail inputs, title smoke, and performance. AI use T3 Code / Codex (gpt-6.2-sol) ran the fixture, verified the logs, and wrote this report. |
66dd3e3 to
d43468f
Compare
|
Regression run of Against the limits in CONTRIBUTING.md: 104 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
1c341a2 to
7f4b22d
Compare
|
Independent RTX 3080 Ti recheck of the clean 655885e rebase onto afc5ee8. Windows 11 build 26300, NVIDIA 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC and DXC 1.8.2502.11.
I also merged this head locally onto 0829441, which includes the new dispatch scratch sizing. The workspace built and reported 1,274 passed, 0 failed and 46 ignored, including 26 runtime skips. The dispatch-chain filter reported 11 passes including one native-wave64 skip. The atomic-add GPU readback and polling-loop guard both passed. A separate test-only check called the runtime allocator on the RTX 3080 Ti. With an 8 MiB total target, three live allocations used 6, 2 and 2 MiB. The first recording reused its buffer, and after release the next recording got 4 MiB. Live scratch returned to zero once the test released all buffers. The 10 MiB peak includes the intentional 2 MiB minimum for a new recording. This was a serial allocation check, separate from the dispatch readback. Synthetic tests only. No retail smoke or pipeline timing on this revision. AI-assisted. Codex (GPT-6, exact variant unavailable) reran the tests and drafted this report. |
7f4b22d to
655885e
Compare
|
AMD RDNA3 on native Windows: full suite of Test report for head Tested
Not tested
AI use: this run and report were done by Claude Code (Claude Sonnet 5.5), driven by |
|
I'm closing and reopening this right away only to get a CI run on today's AI use: Claude Code (Claude Opus 5.5) checked the merge with |
|
AMD RDNA4 / Linux (Proton Experimental) test report on head Hardware & environment
Isolated unit / GPU tests (
Combined 300 s retail sanity run (release,
Not tested
AI use
|
|
@ClosetPie107 thank you for the RDNA4 run under Proton. It's the first one on Linux, and the 300 s retail run issued 44,546 chained dispatches with no crash or device removal. It's in the description under Tested with your name, along with the note that the retail run is of the 7-PR stack, not this PR alone. AI use: Claude Code (Claude Opus 5.5) updated the description and wrote this. |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
merge-check claim |
|
merge-check |
|
merge-check claim |
|
merge-check |
655885e to
07c7868
Compare
07c7868 to
898fa11
Compare
Keeps upstream's DXIL IR cuts (xcl-dev#3500-xcl-dev#3503/xcl-dev#3495-xcl-dev#3499: sampler waterfall, descriptor windows, split-wave64 mask exchange, per-lane exec, direct PS masks, quad shuffles, packed/normalized buffer decode, commit-aware compiles), xcl-dev#3269 fixed-point optimizer, xcl-dev#3154 compact compute prologue, xcl-dev#2123 split atomic add, xcl-dev#2070 offline 64 MB stacks, xcl-dev#3442 split-whole, xcl-dev#1319 root-constant bounds, xcl-dev#3356 late Reset releases, xcl-dev#1322 empty-BVH/NaN rays, xcl-dev#2753 3-D texture sizing, XMA/VFS/TLS/loader fixes. Resolutions: - real.rs: union of T-156 res_release pinning with upstream's InListReset and abi_rs_for_stages; dropped upstream's warm_graphics (T-095 removed that path); kept ComputeBuild::IndirectChain for our split-chain variant. - dispatch_chain.rs: kept our IndirectBuild split-chain architecture (the T-095 port removed the preload/whole-worker machinery upstream builds on); ported upstream's huge-PSO refusal log. - pso_async.rs: took upstream's commit-aware build_pieces/build_scoped and WORKER_STACK, removed the preload/backlog subsystem our port does not have (and its tests), kept our profile_is_series_s. - late_release.rs: took upstream's Dead enum, Busy/InListReset and hold_pipeline/hold_heap/hold_unmap, with our vram release path (no recycle pool). - emit.rs: upstream's additions moved into emit/memory.rs (ADD_TID_ENABLE), emit/exp.rs (misc-vector layer/viewport), emit/mimg.rs (SampleCmp with bias gradients), emit/valu.rs (abs/neg on shift/align), emit.rs out_struct. - bind.rs: root-constant bounds clamp + its test; kept our bool execute_indirect API. - bvh.rs: our grow/tri_ret/watertight model plus upstream's empty-root bounds and NaN-ray refusal. - kernel.rs: upstream's mask/waterfall/rodata cuts plus our lanes_upper. - shaders.rs: upstream's worker stack helpers and mesh/GS precompile paths, with our PipelineJob record identity. - eh.rs: upstream's CLWB TF guard + test, our termination test. - lower.rs test: 574bda4 makes wave32 SALU words compute S_WQM without quad lanes; assert that and keep the wave64 refusal.
Part of #1269. #2080, the split this builds on, is merged; this PR is one commit on
mainafc5ee8,655885e. It was7f4b22dand before thatbad5f04, stacked on #2080.#2080 splits a program with atomics only when they are 32-bit AND or OR whose old value is unused (the sub-dword stores). It declines every other atomic. For a global (UAV) 32-bit add that is safe to cut around. The add still runs exactly once per lane, in the piece where it stands. The UAV barrier between dispatches orders it before every later piece. Its old value is a live value like any other. The title's meshlet-cull program 1ada490879c33c0e (48,191 DXIL instructions; two guest add sites, which become eight DXIL atomic adds across its heap windows) was declined for this alone. With this change it splits into 4 pieces and builds cold in 0.86 s instead of 1.93 s.
What is in it
crates/xcl/src/gpu/dxil/module/split.rs:dx.op.atomicBinOp.i32with ADD is now admitted. Each add stays at its original site and runs once whenever control reaches it, as before. Its old value goes to later pieces in an existing continuation slot when it is live there. The rule against polling is conservative. If a program has an add and any loop (including a self-loop) contains an atomic or a raw-buffer, typed-buffer or texture load, it keeps the whole pipeline, because such a loop could poll memory the add changes. It doesn't try to prove that the load aliases the add or decides the loop's exit.Tested
Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, release, DXC 1.9.2609.
Cold pipeline build of 1ada490879c33c0e as the title emits it (the whole binary is byte-identical to the title's cache, and so are its samplers), fresh process, implicit caches off, split pieces on 16 threads:
2.2× faster. All 4 pieces pass the DXC 1.9 validator, and the chain uses 7,488 scratch dwords per group.
cargo test --release --offline --workspace -- --test-threads=4one3c50c1, the same change before Recompiler: split large direct compute pipelines at CFG edges #2080's README-only rebase ontomainf5c5bdf: 1160 passed, 0 failed, 46 ignored, with 25 skip notices across 15 tests (no native wave64, unsupported per-lane forms, no heap windows). All fivedispatch_chainGPU tests ran. Four passed with their output read back: the newdispatch_chain_carries_uav_add_result_to_later_load, pluswave32_live_loops,divergent_forward_edges_3dandwave64_live_loops_and_exchange.native_wave64_builds_wholeskipped its GPU part as expected on this card. The CPU refusal test passed. Onbad5f04the sixdispatch_chaintests pass again.AMD Radeon (native wave64) and RTX 5090, measured by @nnonno91 (comment) on
bad5f04with DXC 1.8.2502: the sixdispatch_chaintests pass on both. On the Radeon none skip, and the native-wave64 test checks its GPU output. On both GPUs the new atomic-add test matches all 64 expected words for the whole shader and the split chain.AMD RDNA4, measured by @bielfreedom (comment), RX 9070 XT, on
bad5f04: on that adapter this change splits only 2 more of the title's 2,689 compute programs (462 → 464), both about 125 KB in 2 pieces, 2.7 → 2.1 s for the pair. 1ada490879c33c0e is not among them there; why hasn't been checked. Thedispatch_chainandsplit::teststests pass, 6 of 6, with no skips.AMD Radeon RX 9070, regression pair by @Toons29 (comment), Ryzen 7 7800X3D, on
d43468f(this branch before the latest rebase), 60 s of a title on the default route:main568e7db1566 frames and this PR 1635, peak commit 14592 / 14592 MB, no crash or device removal in either.cargo test --workspace -- --test-threads=4(debug) on655885e: 1265 passed, 0 failed, 46 ignored. 25 SKIPPED notices: no native wave64 on this card, three per-lane FP16 forms the per-lane lowering refuses, and no heap windows. The split tests alone with the DXC 1.9 validator: 33 passed, 0 failed, 1 ignored, no skips.RTX 3080 Ti, checked by @thehollowedone (comment) on
655885e, DXC 1.8: 1,265 passed, 0 failed, 46 ignored. Two extra controls of theirs pass with no skips: a contended 32-lane UAV add reaches 225 with all 32 expected old values in both forms, and a loop with a UAV read keeps the whole pipeline.AMD RDNA4 on Linux, tested by @ClosetPie107 (comment), RX 9070 (RADV, native wave64) under Proton Experimental with vkd3d-proton,
655885emerged ontomainb49be18:gpu::dxil::module::split::10 passed, 0 failed, 0 ignored, no skips, so the GPU dispatch-chain tests, the new atomic-add one included, ran on that card. A 300 s retail run ofmainb49be18with 7 PRs stacked (this one and Recompiler: track SMEM register offsets as scalar reads #1540, DirectStorage: close a queue when its last reference is released #1675, Shaders: resolve deep DXIL SSA joins without recursion #1844, D3D12.X: forget released command queues from vram::Pages::waited #1899, D3D12.X: deduplicate concurrent stand-in creation and harden shell COM methods #2369, D3D12.X: a pipeline is forgotten before its address is free #2422): exit 0, 0 crashes, 0 device removals, 2,014 presents, 44,546 chained split-compute dispatches across 245 split programs. That run is of the whole stack, not of this PR alone.Regression run
main:PR head:
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