Repository navigation
D3D12.X: Reset and CreateCommandList do not wait for a compute pipeline still being built - #2548
tiagonleal 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)
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
|
c0d0920 to
d6d4e99
Compare
d6d4e99 to
7056b3b
Compare
…ne still being built After xcl-dev#2118 a dispatch waits for its compute pipeline at the submit, not in the bind. SetPipelineState takes a pending compute pipeline lazily (NativePipelineBindMode::Lazy, the stand-in, no wait), and the re-bind after KickoffX uses bind::initial_pipeline, which does not wait either. Reset(allocator, initial_pso) (reset_pc) and CreateCommandList with an initial pipeline (create_list, path without the console list) prepare their pipeline with PreparedNativePipeline::new, which selects with ForBind: that waits for a compute pipeline and may build it on the title's thread. These two now use PreparedNativePipeline::new_lazy, the same retained resolution selected with Lazy, like SetPipelineState. 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. The Reset of the PC path (real::cl_reset) keeps ForBind. 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 two calls back on PreparedNativePipeline::new the Reset and CreateCommandList tests fail ("Reset waited for the build (10.0014942s)", "CreateCommandList waited for the build (10.001688s)"); the KickoffX one passes on main already and stays as a regression test.
7056b3b to
3407d22
Compare
|
No open or merged PR makes the same change. #1798 is about graphics draws, and #2615 is about building cold pipelines in binds. main still calls AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
After #2118 a dispatch waits for its compute pipeline at the submit instead of in the bind.
SetPipelineStatetakes a pending compute pipeline lazily (the stand-in, no wait), and sincemain's db4dd27 the re-bind afterKickoffXusesbind::initial_pipeline, which does not wait either. Two places still wait:Reset(allocator, initial_pso)andCreateCommandListwith an initial pipeline prepare it withPreparedNativePipeline::new, which selects withForBind. That waits for a compute pipeline and may build it on the title's thread. A title that passes a compute pipeline still being built to one of them stops there until the driver finishes, which can take minutes for a large program.These two now use
PreparedNativePipeline::new_lazy, the same retained resolution selected lazily, asSetPipelineStatedoes. 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 it is pending. The Reset of the PC path (real::cl_reset) keepsForBind.An earlier version of this PR also changed the re-bind after
KickoffX.mainfixed that part in db4dd27, so it is no longer in the diff; its test stays as a regression test and passes onmainas it is.What is in it
bind.rs:PreparedNativePipeline::new_lazy, and a sharedfrom_resolution_modebehind it andnew.list_x.rs:reset_pcusesnew_lazy.device_x.rs:create_list(the path without the console list) usesnew_lazy.a_reset_with_a_compute_pipeline_still_building_does_not_wait,a_kickoff_with_a_compute_pipeline_still_building_does_not_waitanda_command_list_created_with_a_compute_pipeline_still_building_does_not_wait(list_x.rs): each makes a compute pipeline whose build stays pending, checks that the call returns without waiting for it and that a Dispatch right after is put off to the submit. The Reset one also checks that the list tracks the stand-in.Tested
cargo test -p xcl --lib -- still_building_does_not_wait: 3 passed, 0 failed. With the two calls put back toPreparedNativePipeline::new, the Reset and CreateCommandList tests fail after the test's 10 s wait ("Reset waited for the build (10.0014942s)", "CreateCommandList waited for the build (10.001688s)"); the KickoffX one passes either way.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.maind8bd9a38(head3407d221):cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4, one run: 2617 passed, 4 failed, 49 ignored (26SKIPPEDlines). The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3. The 4 are thefuzz_validate_and_gpu_*tests, which fail onmainhere too (Recompiler: LDS ds_sub_u32 hides its negation from the driver (RTX 50 refuses it) #1919 fixes them);main's run had a fifth failure, the intermittent e2e check reported in D3D12.X: a submit misses a CPU write into memory idle for 1.5 s (hot write-watch looks); intermittent e2e failure #3382. Onmaind8bd9a38on this machine the same command gave 2613 passed, 5 failed, 49 ignored (26SKIPPEDlines). The other results in this section are from the earlier heads named in them.Regression run
scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e(Newer Retail Game), release builds of both commits in clean trees,maind8bd9a38first, one run each, in one queue with this account's other PRs. Both runs hadXCL_PREPARE=0and the same warm DXIL cache. A warm-up run ofmaincame before them and is not shown. A second run ofmainat the end of the queue showed 1694 frames and a peak commit of 15641 MB, so differences of a few tens of frames between runs are noise here.main(d8bd9a38):This PR (
3407d221):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_reset(the PC path) still usesPreparedNativePipeline::new(ForBind); it is not changed here.AI use
🤖 Generated with Claude Code