D3D12.X: ExecuteIndirect skips a stand-in whose build ends during the call #2598
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2598
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@iggyvilla on GitHub · 2026-11-26 01:16 UTC · original
iggyvilla:execute-indirect-pending-race-r2→main· +50 −1 · 2 files · 1 commits · openexecute_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
@DavidM1911 on GitHub · 2026-11-26 01:20 UTC · original
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
@SlopTart on GitHub · 2026-11-26 05:13 UTC · original
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.
xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.