Repository navigation
D3D12.X: Reset, KickoffX and CreateCommandList do not wait for a compute pipeline still being built - #2548
D3D12.X: Reset, KickoffX and CreateCommandList do not wait for a compute pipeline still being built#2548tiagonleal wants to merge 1 commit into
Conversation
…ute pipeline still being built After xcl-dev#2118 a dispatch waits for its compute pipeline at the submit, not in the bind. SetPipelineState and the mid-list split already take a pending compute pipeline with pso_async::resolve (the stand-in, no wait). Reset(allocator, initial_pso) (reset_pc), the re-bind after KickoffX (kickoff_x) and CreateCommandList with an initial pipeline (create_list, path without the console list) still used resolve_for_bind, which waits for a compute pipeline and may build it on the title's thread. These three now use resolve, like split. bind::reset and on_create keep the title's own pipeline (the stand-in), and bind::dispatch / execute_indirect defer when it is pending, so the dispatch that follows is still left for the submit. Test a_reset_with_a_compute_pipeline_still_building_does_not_wait: before the fix it fails ("Reset waited for the build (9.9994639s)"); after the fix it passes 5 of 5 runs alone. It also checks the list tracks the stand-in and a following Dispatch is deferred. KickoffX and CreateCommandList have no test of their own. cargo build --workspace and cargo test --workspace --no-fail-fast -j 6 -- --test-threads=4, twice: 1420 passed, 4 failed, 46 ignored both times (25 SKIPPED lines). The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (E_OUTOFMEMORY), known on this machine. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Test run on exact head Tested
Regression run (60 s, default settings, a retail title) main: this PR: No crash or device removal; frames 104 % of Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! — Devin |
|
Independent AMD RDNA4 (native wave64) verification of exact PR head Tested
(Compare against Not tested
AI use
|
Eliminate the global sparse STATE lock convoy across synchronous GPU fence waits in sparse::readback_now (triggered on ID3D12Resource::Map readbacks) by pooling per-Map ReadbackJob objects (COPY command allocator + list + persistently-mapped READBACK staging buffer + OS fence event) outside STATE. STATE is now only held briefly to flush pending zero/dirty pages and snapshot mapped spans, to submit/signal on the copy queue, and to copy still-committed non-hole bytes back into host memory after the fence wait completes unlocked. Also adapt three upstream fixes cleanly atop our runtime branch: - #2548: use pso_async::resolve (non-blocking) instead of resolve_for_bind in device_x::create_list, list_x::kickoff_x, and list_x::reset_pc so list creation/reset with a compiling compute PSO never stalls the title thread. - #2549: preserve own_alloc when split() reuses a spare segment whose previous recording held deferred dispatches' allocator. - #2550: add pso_async::is_stand_in and bind::note_skipped_indirect to call list_x::note_dropped_draw on skipped graphics ExecuteIndirect paths (including stand-in / two-pass PSOs) so dropped draws stay tracked consistently. Assisted-by: Antigravity (Gemini 4 Neon High)
|
Read the diff on AI use: Claude Code (Claude Opus 5.5) reviewed the diff; I checked each point. |
…ixes Integrates upstream amd-dev 61121fe/xcl-dev#2569 (DirectStorage ordered completion wakeups) plus open PRs xcl-dev#2577 (skip AMD cache-reference driver blobs on disk, xcl-dev#2512), xcl-dev#2578 (clear LAST_CONTENT on placed texture unmap/remap, xcl-dev#2460), xcl-dev#2579 (mark put-off builds wanted immediately), xcl-dev#2556 (NULL-ppv CreateDescriptorHeap test), xcl-dev#2550 (skipped ExecuteIndirect occlusion query), xcl-dev#2549 (reused spare keeps in-flight deferred allocator, with Wine raw fences and UnadoptGuard), and xcl-dev#2548 (Reset/KickoffX/CreateCommandList do not wait on building compute pipelines). Assisted-by: Antigravity (Gemini 4 Neon)
|
Tested: current PR head merged onto current
Not tested: retail titles (no title data on this lane, counts only). AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting. |
…+ xcl-dev#2548 + xcl-dev#2579 + xcl-dev#2581 + xcl-dev#2598 + xcl-dev#2611 + xcl-dev#2615 + xcl-dev#2622) (cherry picked from commit 57e5c216e924452b59cd64862d2941006e24c28c)
After #2118 a dispatch waits for its compute pipeline at the submit instead of in the bind.
SetPipelineStateand the mid-list split already take a pending compute pipeline withpso_async::resolve, which returns the stand-in and does not wait. Three other places still usedpso_async::resolve_for_bind, which waits for a compute pipeline (and builds it on the title's thread if no worker has started it):Reset(allocator, initial_pso), the re-bind afterKickoffX, andCreateCommandListwith an initial pipeline. A title that passes a compute pipeline still being built to one of them stopped there until the driver finished, which can take minutes for a large program.These three now use
resolve, likesplit. The dispatch that follows is still left for the submit:bind::resetandon_createkeep the title's own pipeline (the stand-in), andbind::dispatchandbind::execute_indirectdefer when that pipeline is pending, as they do after aSetPipelineState.What is in it
list_x.rs:reset_pcandkickoff_xusepso_async::resolve; testa_reset_with_a_compute_pipeline_still_building_does_not_wait(a build that finishes only when the test releases it;reset_pcreturns in well under 700 ms, the pipeline is still pending, the list tracks the stand-in, and a followingDispatchis left for the submit)device_x.rs:create_list(the path without the console list) usespso_async::resolveTested
resolve_for_bind):cargo test -p xcl --lib a_reset_with_a_compute_pipeline: 0 passed, 1 failed,Reset waited for the build (9.9994639s)(the test's build gives up after 10 s). After the fix, run 5 times: 1 passed, 0 failed each time.cargo build --workspaceandcargo test --workspace --no-fail-fast -j 6 -- --test-threads=4, run twice: 1420 passed, 4 failed, 46 ignored both times (25SKIPPEDlines). The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3(E_OUTOFMEMORY), the known ones on this machine.Regression run
60 s each, the same retail title, release builds from clean trees, one after the other.
main(e1d84b7):This PR:
Not tested
ResetorCreateCommandList: not known. No claim about world loading or any visible change; the smoke run shows only that nothing regressed.KickoffXrarely reaches this case, because the deferred recording right before it has already waited for the deferred pipelines.KickoffXandCreateCommandListchanges have no unit test of their own (the first needs a full KickoffX setup, the second a device through the hooked vtable). They are the same one-line change asreset_pc, which is tested.real.rscl_resetandcl_clear_statestill useresolve_for_bind; they are not changed here.AI use
🤖 Generated with Claude Code