Skip to content

D3D12.X: ExecuteIndirect with a pipeline still being built is skipped (Austin's fork fix, upstreamed) - #574

Merged
theaustinayers merged 2 commits into
xcl-dev:mainfrom
ryosen0:ei-test
Nov 24, 2026
Merged

theaustinayers merged 2 commits into
xcl-dev:mainfrom
ryosen0:ei-test

Conversation

@ryosen0

@ryosen0 ryosen0 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Carries theaustinayers' ExecuteIndirect fix from his fork's build 10 (f879d4e) onto main, with a unit test for the gate. Credit for the change and the diagnosis is his; this PR is the upstreamable form (he has not opened one for it).

Scope on current main: the skip half needs a bounded
esolve_wait (#267 / #533 direction, as in the fork's build) - on unmodified main
esolve_wait waits without a limit, so the pending gate cannot fire there; the root-signature half applies now. Stacks naturally on #267 or #533.

The bug: with the bounded wait for a background pipeline (#267's direction), ExecuteIndirect could reach the PC call with the pipeline's stand-in while the list still held XCL's ABI root signature from a translated draw before it. Debug layer 953 ("the currently set Root Signature doesn't match the currently set Pipeline State Object"), six times as a retail title's world started, then the device hung (0x887a0006).

What is in it

  • crates/xcl/src/hle/d3d12x/bind.rs (Austin's change, verbatim): an ExecuteIndirect whose bound pipeline is still being built is skipped like a draw or dispatch of that pipeline; a PC pipeline gets the title's root signature first, as graphics_bound does for draws.
  • New test execute_indirect_with_a_pipeline_still_building_is_skipped: lazy-submitted pipelines under the test's control - pending stays pending (the skip case), built resolves to the real pipeline, failed resolves to the stand-in and is not pending, released is forgotten.

Tested

  • RTX 3060 Ti 8 GB (wave32), Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11, release build.
  • cargo build --workspace, cargo test --workspace --no-fail-fast -- --test-threads=1: 681 passed, 0 failed, 41 ignored; 2 GPU SKIPPED lines (no wave64 on this adapter).
  • Retail (retail title 1.0.2.1): a 488 s run on a local stack carrying this change (XCL_NETWORK=0 XCL_ACTIVITY=1) held 60 presents / 2 s through world streaming with brief dips at t≈120 s and t≈482-484 s (memory pressure, 23-24 GB commit on this 32 GB machine), no device removal, no hang - the failure Austin describes without the fix. The run ended by the window being closed, not a crash.

Not tested

  • The debug-layer 953 reproduction on this machine (no debug-layer run); wave64 hardware.

Regression run
Main 508a0c7:

xcl-smoke v1
commit: 508a0c74d7c0625d6d2de8d24494e69dc2e1926f
gpu: NVIDIA GeForce RTX 3060 Ti
title: ScarlettGame
seconds: 60
exit: 0x0
frames shown: 1076 (PresentX 1077)
presents per 2 s (last 3): 12 10 12
device removals: 0
crashes: 0
peak commit: 15018 MB

Head 86a5d0b:

xcl-smoke v1
commit: 86a5d0b3b7f49ba15e957c917f6488322b09e5d4
gpu: NVIDIA GeForce RTX 3060 Ti
title: ScarlettGame
seconds: 60
exit: 0x0
frames shown: 1048 (PresentX 1049)
presents per 2 s (last 3): 12 11 12
device removals: 0
crashes: 0
peak commit: 14777 MB

AI use
The runtime change is Austin's (assisted by Claude Code per his commit). GPT-6.2 Astra (API model selector) in DSH wrote the test, ran the builds/tests/smokes above, and drafted this description; the human contributor reviewed everything before posting.

theaustinayers and others added 2 commits November 24, 2026 04:50
With the limit on waits for a background pipeline, ExecuteIndirect could reach the PC call with the pipeline's stand-in while the list held XCL's ABI root signature from a translated draw: debug layer 953 (root signature does not match the pipeline state), six times as a retail title's world started, and then the device hung (0x887a0006). Such a call is skipped like a draw or dispatch of that pipeline; a PC pipeline gets the title's root signature first, as graphics_bound does. With it the same run shows no 953 and no device removal.

Assisted-by: Claude Code (Claude Fable 5.2)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@ghost

ghost commented Nov 24, 2026

Copy link
Copy Markdown

Wave64 hardware run, since Not tested lists it: 86a5d0b merged onto main 9ce2070 (clean merge): pass. AMD Radeon RX 9060 XT (RDNA4, native 64-lane waves), driver 32.0.32029.2010; Ryzen 7 5800X3D; Windows 11 Pro 26200; Rust 1.100.0 MSVC; DXC 1.9.2602.17; debug.

  • .\scripts\test.ps1: 685 passed, 0 failed, 41 ignored; no SKIPPED GPU tests.
  • execute_indirect_with_a_pipeline_still_building_is_skipped passes.

AI use

  • Claude Code (Claude Opus 5.5) ran the commands and wrote this report from the logs; I checked it before posting.

T-Crypt added a commit to T-Crypt/bathyal that referenced this pull request Nov 24, 2026
@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

Test run and review of 86a5d0b3b7f49ba15e957c917f6488322b09e5d4 on AMD RDNA4; the PR was tested on NVIDIA only. The branch is based on 508a0c7, so I merged it onto current main 9ce2070 locally (clean merge, only bind.rs) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4) on the merge: 685 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 645 passed, 0 failed, 21 ignored
  • 0 SKIPPED; execute_indirect_with_a_pipeline_still_building_is_skipped passes

Review: the skip cannot fire on current main
execute_indirect starts with let pso = super::pso_async::resolve_wait(with(this, |s| s.pso));. On main, resolve_wait runs the job itself if no worker has, then waits on the condvar until done; it has no time limit. So when the new branch asks pso_async::is_pending(with(this, |s| s.pso)), that entry is always done and is_pending is false: the return before the PC call is unreachable on main. It only takes effect together with a bounded resolve_wait (the #267 direction, which the description mentions and which is what the fork's build has). It might be worth saying so in the description, or stacking this on #267.

The other half applies now: a pipeline that resolves to no translation (a PC one, or a failed build whose stand-in is the original pso) gets the title's root signature before the PC call, as graphics_bound does for draws, which fixes the 953 pairing on the paths that do reach it.

Two smaller points:

  • The new test exercises pso_async's states (pending, built, failed, released), not execute_indirect itself, so it would still pass if the gate in bind.rs were removed.
  • For an indirect dispatch with a PC compute pipeline, the root signature set is the graphics one (rs_gfx); the compute root signature is not touched there. Harmless for the draw case this is about; just noting it.

Not tested: no retail title or regression run (I have no unpacked game), so the 953 / 0x887a0006 case was not reproduced here; no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; each point was checked against the code.

@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

The gate is indeed unreachable on current main — resolve_wait there has no time limit, so the entry is always done by the time is_pending is asked. The change is Austin's fork fix carried as-is: his build has the bounded wait (the #267 direction), and there the skip fires — his log had six 953s and a 0x887a0006 device hang as a retail world started, gone with it. On main only the root-signature half applies, as you say. I've amended the description to state this plainly: the skip half takes effect with a bounded resolve_wait (#267 / #533); until then it is the PC-pipeline root-signature binding that fixes the 953 pairing on the paths that reach it.

On the test: agreed it pins the pso_async states the gate reads, not the call path through execute_indirect — an integration test would need a real command list and a pending pipeline, which the unit harness here doesn't build. Keeping it as the gate's contract test; the retail evidence is in the description.

The rs_gfx note for indirect dispatches: noted, not touched here — the change is Austin's verbatim, and the compute path waits (resolve_for_bind), so a PC compute pipeline at ExecuteIndirect has already resolved. Worth a follow-up if a failed compute build ever reaches it.

AI use: GPT-6.2 Astra (API model selector) in DSH wrote this reply; the human contributor reviewed it.

@towiice towiice left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested PR head 86a5d0b on NVIDIA GeForce GTX 1650 SUPER (Turing / TU116, driver 610.88), Windows 11 build 10.0.26300 (26H2), Rust 1.100.0 (stable-x86_64-pc-windows-gnullvm), DXC v1.9.2609:

  • cargo test -p xcl --lib hle::d3d12x::bind -- --test-threads=4: 5 passed, 0 failed (0.87 s), including execute_indirect_with_a_pipeline_still_building_is_skipped and async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect.

All d3d12x::bind GPU/unit tests pass on Turing.

@theaustinayers
theaustinayers merged commit cedf8ce into xcl-dev:main Nov 24, 2026
3 checks passed
burber added a commit to burber/xcl that referenced this pull request Nov 24, 2026
…iver blob reuse, in-place detiling)

Conflict in bind.rs execute_indirect: upstream's skip of a still-building pipeline kept; with
xcl-dev#533 / xcl-dev#267 the bounded wait hands it the stand-in, which is then skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
burber added a commit to burber/xcl that referenced this pull request Nov 24, 2026
…ner, then a stack overflow at 118 s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
theaustinayers added a commit to theaustinayers/xcl that referenced this pull request Nov 24, 2026
…l#486, ivall#574, ivall#602, ivall#634, ivall#636

Upstream's texture detiling and uploads replace the fork's (ivall#440 and the threaded detile); its disk cache of driver blobs (ivall#634) replaces the fork's first version.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
heretic1321 added a commit to heretic1321/xcl that referenced this pull request Nov 24, 2026
Part of xcl-dev#232. Bounds graphics pipeline waits at draws/ExecuteIndirect to XCL_PSO_WAIT_MS (default 4000 ms, 0 = no limit) and runs builds on workers rather than the title thread. Latches each timed-out pipeline as late so later draws while it is still building return the stand-in immediately instead of waiting N * limit, counts skipped draws in report.json (d3d12.standin_draws), composes with xcl-dev#574's pending ExecuteIndirect skip, and adds unit tests for the per-pipeline latch, timed-out ExecuteIndirect, and env parsing.

Assisted-by: Antigravity (Claude Opus 5.5) and T3 Code / Antigravity (gemini-pro-orchestrator-neon)
heretic1321 added a commit to heretic1321/xcl that referenced this pull request Nov 24, 2026
Part of ivall#232. Bounds graphics pipeline waits at draws/ExecuteIndirect to XCL_PSO_WAIT_MS (default 4000 ms, 0 = no limit) and runs builds on workers rather than the title thread. Latches each timed-out pipeline as late so later draws while it is still building return the stand-in immediately instead of waiting N * limit, counts skipped draws in report.json (d3d12.standin_draws), composes with ivall#574's pending ExecuteIndirect skip, and adds unit tests for the per-pipeline latch, timed-out ExecuteIndirect, and env parsing.

Assisted-by: Antigravity (Claude Opus 5.5) and T3 Code / Antigravity (gemini-pro-orchestrator-neon)
heretic1321 added a commit to heretic1321/xcl that referenced this pull request Nov 24, 2026
Part of ivall#232. Bounds graphics pipeline waits at draws/ExecuteIndirect to XCL_PSO_WAIT_MS (default 4000 ms, 0 = no limit) and runs builds on workers rather than the title thread. Latches each timed-out pipeline as late so later draws while it is still building return the stand-in immediately instead of waiting N * limit, counts skipped draws in report.json (d3d12.standin_draws), composes with ivall#574's pending ExecuteIndirect skip, and adds unit tests for the per-pipeline latch, timed-out ExecuteIndirect, and env parsing.

Assisted-by: Antigravity (Claude Opus 5.5) and T3 Code / Antigravity (gemini-pro-orchestrator-neon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants