D3D12.X: ExecuteIndirect skips a stand-in whose build ends during the call #2588
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2598"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by iggyvilla on 2026-11-26T01:16:57Z.
execute_indirectresolves the bound pipeline withresolve_wait, then asksis_pendingwhether it was a stand-in of a pipeline still being built. If the build ends between the two calls,is_pendingis false whilepsois still the stand-in (or, for a shared stand-in, the shared driver pipeline). With a signature that is not a Dispatch one, the call then goes to the PCExecuteIndirectwith the stand-in and the list's root signature. That is the pair the skip exists to avoid (debug layer 953; a retail title's world hung the GPU, 0x887a0006, see the comment above the check). The window opens whenever a bind does not wait for the build to the end: withXCL_PSO_WAIT_MSorXCL_PSO_IMAGE_SKIP=1, and for every bind of a cold pipeline with #2615, which makes no bind wait by default. Either of the two can land first.pso_async::bound_unbuilt(raw_pso, pso)takes one lookup and answers for what the bind got:psois the stand-in and the build has not failed. A build that ended since does not change the answer. A failed build's stand-in is still not "unbuilt", so it goes on to the console-compute check below, as before (#2342).#2118 puts a dispatching
ExecuteIndirectof a console compute pipeline that is still being built off to the submit. That check comes beforeresolve_waitand leaves this window as it was. A pipeline whose build ends betweenresolve_waitand the check still takes the path above. So does a call recorded at the submit, through the same function. So does a call that could not be put off: a signature that does not dispatch, or a list that cannot be split.#1652 also fixes this, with
resolve_wait_criticalreturning(pso, pending)from one lookup, as part of a much larger change (bind waits, pending-draw guards, target init). This PR is the small fix on its own. If #1652 lands first, this one is not needed.What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs:bound_unbuilt.crates/xcl/src/hle/d3d12x/bind.rs:execute_indirectuses it in place ofis_pending(raw_pso).pso_async.rs):a_stand_in_bound_before_its_build_ended_stays_unbuilt_for_that_bind. A bind gets the stand-in, then the build ends.is_pendingis false (what the old check read) whilebound_unbuiltstays true. A bind after the build is not unbuilt, nor is a failed build's stand-in, nor a pipeline that is no stand-in.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on1e280117: 1429 passed, 1 failed, 47 ignored. The failure isgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 783,res[64] = 0xc, CPU 0x7fffffff), which also fails onmain. e2e: 4 passed.lower_dxilf16/f32 per-lane programs (refused, #1426 semantics),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(the driver cache cannot be disabled without Developer Mode).cargo test -p xcl --lib pso_asyncon1e280117: 15 passed, 0 failed.Regression run (
scripts/smoke.ps1, same title, 60 s, adjacent runs in the order main, another PR's head, this PR, main)main
08db802(run 1):this PR,
1e280117:main
08db802(run 2):Not tested
execute_indirectcall: it is rare. Reproducing it needs a hook between the bind's lookup and the check. After this change there is a single lookup, so the decision isbound_unbuilt's, and the unit test covers it.graphics_boundreadsis_pending(pso)after itsresolve_waitthe same way, but only to count a dropped draw and for a frame-trace log line. Not changed here.AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T01:20:17Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 26 ignored.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-26T05:13:33Z.
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).gpu_suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.Targeted run of
a_stand_in_bound_before_its_build_ended_stays_unbuilt_for_that_bind: passed.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.
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-26T15:50:13Z.
Review: COMMENTED
AI-assisted review (OpenAI GPT-6). I inspected the changed call path and its regression test; I did not run tests.
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-26T15:50:13Z.
Code review location:
crates/xcl/src/hle/d3d12x/bind.rs; line 286Could this regression exercise
execute_indirectacross the build-completion window? The new unit test provesbound_unbuiltstays true for a captured stand-in, but it does not verify that this call site uses that predicate or prevents the PCExecuteIndirectcall; reverting this condition tois_pending(raw_pso)would leave the helper test green. A deterministic test could capture the stand-in, complete the build before this check, then assert the fake PC call was not made. AI-assisted review (OpenAI GPT-6): I inspected this call path and the added unit test; I did not run tests.Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T12:54:03Z.
Independent desktop NVIDIA verification of PR #2598 at head
1e28011782dd52bdbe245885cc1cb2a4baee9810(1commit; exact parent & merge-base:08db8020d323bf478964fcc586152cce54959cfc, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12, Wave32-only Ada), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted tests & build (
1e280117)cargo test --release -p xcl --lib a_stand_in_bound_before_its_build_ended_stays_unbuilt_for_that_bind -- --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1331 filtered out× 3 (0.01s,0.01s,0.01s,0skipped)cargo test --release -p xcl --lib hle::d3d12x::pso_async:: -- --nocapture(3 consecutive runs)15 passed; 0 failed; 0 ignored; 1317 filtered out× 3 (1.01s,1.06s,1.06s,0skipped)cargo build --release -p xcl1m 33s, exit0,0new warnings inbind.rs/pso_async.rs)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
08db8020d323bf478964fcc586152cce54959cfc, cached baseline on the same machine):PR #2598 (
1e28011782dd52bdbe245885cc1cb2a4baee9810):Limits of coverage
a_stand_in_bound_before_its_build_ended_stays_unbuilt_for_that_bindand all15/15hle::d3d12x::pso_async::tests (0skipped) passed3/3, directly verifying thebound_unbuiltcheck for a stand-in whose async PSO build finishes mid-bind.0device removals,0crashes, steady 60 Hz); single-run frame/commit delta vs. the cached parent reflects normal startup variance.AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:27:08Z.
Triage (#1607) – head
1e28011Main already has this change in adapted form. Commit
14bc6f6, "D3D12.X: classify the pipeline selected by ExecuteIndirect", says it is adapted from this PR. It addsPending::bound_unbuiltandresolve_wait_boundin pso_async.rs and the same done/failed-build distinction.execute_indirectin bind.rs now skips on thebound_unbuiltof the bound choice instead ofis_pending(raw_pso).Recommendation: close (superseded by main commit
14bc6f6).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:55:12Z.
Closing as superseded: this change is already on
main(14bc6f64). main bind.rs/pso_async.rs classify the pipeline selected by ExecuteIndirect via bound_unbuilt from one captured Pending (14bc6f64adapted from #2598); same fixTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed