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
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)
…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. Tests a_reset_with_a_compute_pipeline_still_building_does_not_wait, a_kickoff_with_a_compute_pipeline_still_building_does_not_wait and a_command_list_created_with_a_compute_pipeline_still_building_does_not_wait, one per path. Each makes a compute pipeline whose build stays pending and checks the call returns without waiting for it and that a Dispatch right after is put off to the submit; the Reset one also checks the list tracks the stand-in. With the three calls back on resolve_for_bind all three fail ("Reset waited for the build (10.0008635s)", "KickoffX waited for the build (10.0029887s)", "CreateCommandList waited for the build (10.0042973s)"); with the change they pass, 3 of 3 runs. cargo build --release -p xcl and cargo test --workspace --no-fail-fast -- --test-threads=4, twice: 1422 passed, 4 failed, 46 ignored, 25 SKIPPED both times. The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (E_OUTOFMEMORY), failing on this machine without this change too. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
5ac8e85 to
c0d0920
Compare
|
Thanks. I added a test for each of the two other paths, next to the Reset one, both in Run on c0d0920: Not run: the four fuzz tests on |
|
Independent desktop NVIDIA verification of PR #2548 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib a_reset_with_a_compute_pipeline_still_building_does_not_wait -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1326 filtered out × 3 (0.23s, 0.20s, 0.19s, 0 skipped — live D3D12 + DXC on RTX 4060) |
cargo test --release -p xcl --lib a_kickoff_with_a_compute_pipeline_still_building_does_not_wait -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1326 filtered out × 3 (0.19s × 3, 0 skipped — live D3D12 + DXC on RTX 4060) |
cargo test --release -p xcl --lib a_command_list_created_with_a_compute_pipeline_still_building_does_not_wait -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1326 filtered out × 3 (0.20s, 0.19s, 0.19s, 0 skipped — live D3D12 + DXC on RTX 4060) |
cargo test --release -p xcl --lib hle::d3d12x::device_x:: -- --test-threads=1 (3 consecutive runs) |
14 passed; 0 failed; 0 ignored; 1313 filtered out × 3 (0.33s × 3, 0 skipped) |
cargo test --release -p xcl --lib hle::d3d12x::list_x:: -- --test-threads=1 (3 consecutive runs) |
43 passed; 0 failed; 0 ignored; 1284 filtered out × 3 (1.14s × 3, 0 skipped) |
cargo build --release -p xcl |
Clean build (1m 07s, exit 0, 0 new warnings) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (e1d84b7d9153f86a97d2ec5d209d196046fc0bea, cached baseline on the same machine):
xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1531 (PresentX 1531)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13982 MB
PR #2548 (c0d09204145a8c6b9f49e5c19aad27c64711c97c):
xcl-smoke v1
commit: c0d09204145a8c6b9f49e5c19aad27c64711c97c
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1574 (PresentX 1574)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14003 MB
Runtime log observations (xcl.log)
9221log lines,0[ERROR]/ device-removal / panic lines.- Final draw/memory telemetry in log:
19432 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14002 MB committed by the process; video memory 6116 MB local, 4683 MB non-local.
Limits of coverage
- Non-blocking
Reset,KickoffX, andCreateCommandListwith an in-flight compute pipeline build were directly verified on desktop D3D12 / RTX 4060 + DXC1.9.2609.5via all 3 new GPU tests (3/3each,0skipped),hle::d3d12x::device_x::(14/14× 3), andhle::d3d12x::list_x::(43/43× 3). - The 60 s retail smoke ran with warm shader/driver caches on
title: 29640639, confirming zero runtime regression rather than triggering a cold compute pipeline build duringReset/KickoffX/CreateCommandList(frame-count delta vs. cached parent reflects single-run startup variance, not this PR).
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
|
Independent test report under Wine/Proton (not native Windows) for head Setup
Tests (debug,
Retail title, 300 s (release, every run from a copy of the same warm-cache snapshot;
Not tested
AI use
|
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::resolvedevice_x.rs:create_list(the path without the console list) usespso_async::resolvelist_x.rs, one per path, each with a build that finishes only when the test releases it: the call returns without waiting for it, the pipeline is still pending, and aDispatchright after is left for the submit.a_reset_with_a_compute_pipeline_still_building_does_not_waitalso checks that the list tracks the stand-in. The other two area_kickoff_with_a_compute_pipeline_still_building_does_not_waitanda_command_list_created_with_a_compute_pipeline_still_building_does_not_wait.Tested
cargo test -p xcl --lib -- still_building_does_not_wait: 3 passed, 0 failed, 3 of 3 runs on c0d0920. With the three calls put back toresolve_for_bind, all three fail after the test's 10 s wait:Reset waited for the build (10.0008635s),KickoffX waited for the build (10.0029887s),CreateCommandList waited for the build (10.0042973s).cargo test --workspace --no-fail-fast -- --test-threads=4, run twice on c0d0920: 1422 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; I did not run them onmainagain today.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.real.rscl_resetandcl_clear_statestill useresolve_for_bind; they are not changed here.AI use
🤖 Generated with Claude Code