Repository navigation
D3D12.X: indirect dispatches of a split program run its direct pieces - #3499
Conversation
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.
|
@Kalmarv a frame-rate regression in the world that bisects to this PR, on an RTX 4080 16 GB (621.40), i9-12900K, Windows 11, release builds of
No device removal and no crash in any of them; the slow runs are steadily slow (few 2-second windows without a present), not stalls. The log's The smoke blocks in the description are 60 s in the menus, which this does not reach. Is there a switch to get the old behaviour back for a comparison run, or should I measure something specific ( Not tested: AMD, other cards, more than two runs per commit. AI use: Claude Code (Claude Opus 5.5) built the commits, ran the bisect and wrote this. |
|
@throny on your question about a switch: nothing restores the old behaviour outright, but two existing variables should separate the candidates in a pair of runs. This is from reading the merged source ( What an indirect dispatch of a split program records now ( Two things that could carry the cost, both guesses until measured:
On the per-call numbers reported elsewhere (small direct dispatches 5 to 28 times slower with identical DXIL): the chain path in For a clean A/B without a revert, the smallest local change I can see is, in I will run AI use: Claude Code (Claude Opus 5.5 read the diff and the source, Claude Fable 5.2 checked the cited switches and lines and wrote this).
|
|
The numbers I promised above. RTX 5070 Ti 16 GB (617.42), Ryzen 7 9800X3D, 32 GB RAM, release,
What I read from it:
B2 ended early with a driver timeout: No device removal in the other five runs. Peak commit 39.2 to 41.6 GB, peak local video memory 19.2 to 20.8 GB against a 15.1 GB budget in all of them. AI use: Claude Code (Claude Opus 5.5 built the revert, ran the runs and read the logs, Claude Fable 5.2 wrote this).
|
|
The three runs that were missing from the table above, same card, binaries, switches and window:
So on this card: A correction to what I said about the driver timeout: A3 is plain AI use: Claude Code (Claude Opus 5.5 ran the runs and read the logs, Claude Fable 5.2 wrote this).
|
|
@tiagonleal thanks, your first guess is it. Same RTX 4080 16 GB setup as above,
So the 16 rounds of every piece per indirect dispatch carry the cost; the scratch size does not. With one round the frame rate is back near the 2.15 to 2.30 of I have not checked whether one round is enough for correctness: an indirect dispatch with more groups than one round covers would leave work undone, and the picture in these runs does not tell me that. @Kalmarv a default that sizes the rounds from the group count (or runs the whole form once it is built, as tiagonleal suggests) would avoid both. Until then, testers on current AI use: Claude Code (Claude Opus 5.5) made the runs and wrote this. |
|
An RTX 3090 data point for
Setup: RTX 3090 24 GB, driver 616.56, Ryzen 9 5950X, Windows 11 22631. Our stack = 42 commits (ports of #3089, #2798 / #2799, the stencil part of #3290; #3094; #3281). Env: Not checked: a revert of c9aa9f8 on this card; other values of the switch; AI use: Claude Code (Claude Opus 5.5) ran the runs and wrote this; checked and posted by me. |
|
Thank you @throny, @tiagonleal, and @CharlyRien for bisecting and isolating this so clearly ( Opened #3528 to return |
PR xcl-dev#3499 (c9aa9f8) routed Dispatch-only ExecuteIndirect of split compute PSOs through the split chain even after the background whole form had finished building. That claimed the full split scratch budget and recorded XCL_SPLIT_INDIRECT_ROUNDS rounds of every piece plus UAV barriers on every indirect dispatch, regressing world frame rate 2-3x across multiple GPUs. Return Indirect::Whole from dispatch_chain::execute_indirect once chain.whole.ready() is Some(Ok(_)) so bind.rs dispatches the single whole-form ExecuteIndirect immediately, while keeping the split chain for cold builds while the whole form is still pending or if the driver refused it. execute_indirect checks again before recording the chain and returns Indirect::Whole when the build finished in between: the chain has no tail for groups past the slicer's rounds, so such a dispatch was left out while counted as run. Also queue the whole form in dispatch_chain::build for programs already recorded in the indirect-use journal, as before xcl-dev#3499 only when the whole form's driver blob is already on disk (whole_blob_path, the DirectConstants chain root compute_container loads it under), so warm runs load the cached whole form before the first indirect dispatch and a cold driver cache does not compile every journalled whole form at pipeline creation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR xcl-dev#3499 (c9aa9f8) routed Dispatch-only ExecuteIndirect of split compute PSOs through the split chain even after the background whole form had finished building. That claimed the full split scratch budget and recorded XCL_SPLIT_INDIRECT_ROUNDS rounds of every piece plus UAV barriers on every indirect dispatch, regressing world frame rate 2-3x across multiple GPUs. Return Indirect::Whole from dispatch_chain::execute_indirect once chain.whole.ready() is Some(Ok(_)) so bind.rs dispatches the single whole-form ExecuteIndirect immediately, while keeping the split chain for cold builds while the whole form is still pending or if the driver refused it. execute_indirect checks again before recording the chain and returns Indirect::Whole when the build finished in between: the chain has no tail for groups past the slicer's rounds, so such a dispatch was left out while counted as run. Also queue the whole form in dispatch_chain::build for programs already recorded in the indirect-use journal, as before xcl-dev#3499 only when the whole form's driver blob is already on disk (whole_blob_path, the DirectConstants chain root compute_container loads it under), so warm runs load the cached whole form before the first indirect dispatch and a cold driver cache does not compile every journalled whole form at pipeline creation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR xcl-dev#3499 (c9aa9f8) routed Dispatch-only ExecuteIndirect of split compute PSOs through the split chain even after the background whole form had finished building. That claimed the full split scratch budget and recorded XCL_SPLIT_INDIRECT_ROUNDS rounds of every piece plus UAV barriers on every indirect dispatch, regressing world frame rate 2-3x across multiple GPUs. Return Indirect::Whole from dispatch_chain::execute_indirect once chain.whole.ready() is Some(Ok(_)) so bind.rs dispatches the single whole-form ExecuteIndirect immediately, while keeping the split chain for cold builds while the whole form is still pending or if the driver refused it. execute_indirect checks again before recording the chain and returns Indirect::Whole when the build finished in between: the chain has no tail for groups past the slicer's rounds, so such a dispatch was left out while counted as run. Also queue the whole form in dispatch_chain::build for programs already recorded in the indirect-use journal, as before xcl-dev#3499 only when the whole form's driver blob is already on disk (whole_blob_path, the DirectConstants chain root compute_container loads it under), so warm runs load the cached whole form before the first indirect dispatch and a cold driver cache does not compile every journalled whole form at pipeline creation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Runs indirect dispatches of a split compute program through its direct DispatchChain piece set so no separate indirect piece set has to be precompiled or built at runtime.
What is in it
Tested
cargo check -p xcl --tests: passed on this exact head againstorigin/main(91244db94)scripts/smoke.ps1running now and will be pasted below.Regression run
main:PR head:
Not tested
AI use