Repository navigation
D3D12.X: use whole form once ready for split ExecuteIndirect - #3528
Conversation
|
merge-check
|
|
merge-check
|
|
Correction, December 1. On this RTX 4090, Setup: RTX 4090 24 GB, NVIDIA 621.40, 32 GB RAM, Windows 11 build 26300, NVIDIA shader heap 2048 MB (#2590).
Not tested: this commit on AI use: Claude Code (Claude Opus 5.5) built the trees, ran the replays and wrote this. The person running these tests checked it and asked for it to be posted. December 1 correction drafted with Codex (GPT-6) after checking the Git ancestry and replay logs. |
There was a problem hiding this comment.
[P2] Recheck whole-form readiness before recording the split chain
If the background build completes between the two chain.whole.ready() calls in execute_indirect, the second check sees Some(Ok(_)) but still records the split chain. For a dispatch that exceeds the slicer’s round budget, the split commands do no work. Before this PR, a successful build observed at this point let the tail command execute that dispatch.
Keep the fast path and replace the second check with:
match chain.whole.ready() {
Some(Ok(_)) => return Ok(Indirect::Whole),
None => { queue_whole(&chain); }
Some(Err(_)) => {}
}I checked that the patch applies to 49eb78e. In an isolated Rust harness, the completed-build case failed before the change. All three cases (completed, pending, and refused) passed afterward. The XCL suite and GPU tests were not run.
Codex assisted with the review, patch, and isolated tests.
|
@Kalmarv a run of this PR on the RTX 4080 16 GB (621.40), i9-12900K, release,
So it does bring the frame rate back (2.5 to 2.7 against 0.77, close to the 2.15 to 2.30 before #3499), but half of the runs with it lost the device about 140 to 150 s after the first frame, which none of my runs of My reading, not verified: the switch from the chain to the whole form happens mid-frame once the whole form becomes ready, and the first indirect dispatch on the whole form is where it hangs. If you have a switch to force the chain or the whole form from the start, I can run both. AI use: Claude Code (Claude Opus 5.5) made the runs and wrote this. |
|
Correction (edit of the report below): the device removals are not specific to this PR. Five more
AI use: Claude Code (Claude Opus 5.5) ran the runs, read the logs and drafted this correction; I checked it. Test report, RTX 3080 10 GB: with this PR a retail title draws its first in-engine cutscene, which Setup
Results
Against the other reports here: these runs end at the opening of the first in-engine cutscene. That is where the cold-cache stall on #505 happens too (118–126 s, with a title thread waiting in Not tested: a raised NVIDIA shader heap (#2590), which would tell whether the removals are #2403; the whole test suite, AI use: Claude Code (Claude Opus 5.5) built the trees, ran the tests and the runs, read the logs and drafted this; I watched the runs and checked it. |
|
How far the RTX 4090 runs with this PR got, to answer cj-tomlin's question above: past the load into the 3D scene, and on in it until the 600 s limit. With the NVIDIA shader heap at 2048 MB (#2590), none of them ended with the silent
AI use: Claude Code (Claude Opus 5.5) ran the replays, read the logs and wrote this. The person running these tests checked it and asked for it to be posted. December 1 correction drafted with Codex (GPT-6). |
|
@Kalmarv I checked the first
On the head, forcing the refusal case sent all 24 groups through each split piece again. Every completed readback preserved both guard words and returned the expected group-ID sums The fixture controls readiness directly. I didn’t test asynchronous readiness timing or reproduce the reported physical-GPU device removals. I used Codex GPT-6.2 Sol to write the fixture and run both revisions. A separate GPT-6.2 Sol agent verified the source and raw WARP logs. Codex GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting. |
|
Test report: in-world frame rate on NVIDIA, Tested
Not tested
AI use
|
49eb78e to
ba8592a
Compare
PR xcl-dev#3499 routed Dispatch-only ExecuteIndirect of split compute PSOs through the split chain even after the background whole form had finished building, claiming split scratch and recording multi-round piece chains on every indirect dispatch. Return Indirect::Whole from dispatch_chain::execute_indirect once chain.whole.ready() is Some(Ok(_)) so bind.rs dispatches the single whole-form ExecuteIndirect directly, while staying on the split chain while the whole form is still pending or refused. Re-check chain.whole.ready() before recording the chain so a build finishing in between hands off cleanly, and drop the now-unused pso::dispatch_command_signature helper. Co-Authored-By: Antigravity (Gemini 3.1 Pro) <noreply@google.com>
ba8592a to
8b9d8df
Compare
|
Rebased onto
Re-verified with full |
|
merge-check |
|
Follow-up review (head 8b9d8df, since ba8592a, diff read, not a merge-check):
Fine: the diff is down to a small change in two files (+55/-38): an early hand-off once the whole form is AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
merge-check verdict: safe to merge |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
bmjask
left a comment
There was a problem hiding this comment.
Review of 8b9d8dfe: 1 finding(s). These are on lines outside the diff:
crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs:652: Oversized ("partial") Dispatch-only indirect dispatches are now dropped but reported as Indirect::Ran. The slicer zeroes every piece round and puts the groups only in the whole-form tail command, and with the tail ExecuteIndirect removed nothing reads that tail. If the whole form is pending (None) or refused by the driver (Err) and the GPU args need more than XCL_SPLIT_INDIRECT_ROUNDS x most slabs (e.g. 16 rounds with large groups), the slicer sets partial=true, writes 0 groups to every round and puts g at chain_tail_offset(rounds). No groups run, execute_indirect returns Ok(Indirect::Ran), and bind.rs counts it as RAN/DISPATCHES instead of SKIPPED. With a permanent Err the dispatch is lost for the whole session with no warning, while the new refusal warning (~365) says these dispatches run their chain. Returning Indirect::Whole or Err for partial splits would make it counted and logged as a skip.
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
|
Thanks @vasanex, @Decodere, @Foniass, and @bmjask for the reviews and merge-checks!
|
|
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any. |
What is in it
Fixes the 2–3× world frame-rate regression introduced by #3499 (
c9aa9f8a2), bisected and diagnosed by @throny, @tiagonleal, @CharlyRien, and @bmjask.dispatch_chain::execute_indirectalways routed Dispatch-onlyExecuteIndirectcalls of split compute PSOs through the split chain — claiming the split scratch budget (256 MiB), running the slicer dispatch, and recordingXCL_SPLIT_INDIRECT_ROUNDS(default 16) rounds of every piece plus UAV barriers — even after the background whole form (chain.whole) had finished building.dispatch_chain::execute_indirect, returnOk(Indirect::Whole)oncechain.whole.ready()isSome(Ok(_))sobind.rsissues a single whole-formExecuteIndirectwithout claiming split scratch or recording multi-round piece chains.chain.whole.ready()immediately before recording the split chain so a background build that completes during setup hands off cleanly instead of recording a redundant split chain.chain.wholeis still pending (None) or refused by the driver (Some(Err(_))), preserving D3D12.X: indirect dispatches of a split program run its direct pieces #3499's cold-build and zero-indirect-variant behavior, and updatequeue_whole's refusal warning to match.pso::dispatch_command_signaturehelper and tail-signature recording path.8b9d8dfe4vsmain 1c8b55147):1699frames shown vs1387(+22.5%),60 60 60presents per 2 s,0device removals,0crashes,18164 MBvs17480 MBpeak commit (+3.9%).49eb78ef): @throny measured 2.49–2.73 presents/s vs 0.77 presents/s onmain(3.2–3.5× recovery, restoring pre-D3D12.X: indirect dispatches of a split program run its direct pieces #3499 2.15–2.30 presents/s) on RTX 4080 16 GB (600–900 s runs).main(1c8b55147) and updated per @Foniass's review:prefetch_wholeindispatch_chain::buildso this PR stays focused on theexecute_indirecthandoff and cannot starve split-chain compilation with eager whole-form builds.pso::dispatch_command_signaturehelper (0 new compiler warnings).ready()race window before chain recording (if the whole form completes after the re-check, that single dispatch still runs the chain as onmain) and updated thequeue_wholerefusal log message.Tested
rustc 1.99.0 (b940084d7 2026-09-28), DXC1.9.2609.5(debug + release).scripts/test.ps1(cargo build --workspace,cargo bench -p xcl --bench '*' -- --test,cargo test --workspace -- --test-threads=4): 2910 passed, 0 failed, 51 ignored across all 43 test targets (24 SKIPPED GPU tests on this adapter: 22no wave64, 2no heap windows).dispatch_chain::tests(17/17 passed), includingindirect_prefers_whole_only_once_built_ok(pending / OOM retry / builtOk/ driver-refusedErr) andan_indirect_dispatch_runs_its_chain_without_any_whole_form(transition fromIndirect::Ranwhile building toIndirect::Wholewithout binding the split chain or running the slicer oncechain.wholeisOk).cargo build --release -p xcl: clean (0 new warnings vsmain).Regression run
Baseline (
main):PR head:
Not tested
XCL_HEAP_WINDOWS=1GPU tests (2 skipped under defaultscripts/test.ps1).prefetch_whole(prior merge-checks verified theexecute_indirecthandoff itself; only the 60 s title smoke was re-run on8b9d8dfe4).AI use
Gemini 4 Neon) assisted with rebasing ontomain, addressing the review items, running the workspace tests and smoke pair, and updating this description; initial PR draft was assisted by Antigravity (Claude Opus 5.5). Note: the commit trailer on8b9d8dfe4carriedGemini 3.1 Profrom an earlier template, while the actual rebase/verification was done withGemini 4 Neon(leaving the commit SHA untouched to preserve the three merge-checks).