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

Manually merged
github merged 2 commits from gh-pr/574/head into gh-pr/574/base 2026-11-26 04:26:14 +00:00
Owner

@⁠ryosen0 on GitHub · 2026-11-24 01:58 UTC · original
ryosen0:ei-test → main · +40 −0 · 1 files · 2 commits · merged 2026-11-24 02:43 UTC

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.

**@⁠ryosen0** on GitHub · 2026-11-24 01:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/574) `ryosen0:ei-test` → `main` · +40 −0 · 1 files · 2 commits · merged 2026-11-24 02:43 UTC Carries theaustinayers' `ExecuteIndirect` fix from his fork's build 10 ([`f879d4e`](https://github.com/theaustinayers/xcl/commit/f879d4e75f4d9bd67624896607b0fc8c5b42cf7e)) 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.
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 <[email protected]>
Assisted-by: DSH (GPT-6.2 Astra)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:26:13 +00:00
github manually merged commit 86a5d0b3b7 into gh-pr/574/base 2026-11-26 04:26:14 +00:00
Author
Owner

@⁠ghost on GitHub · 2026-11-24 02:06 UTC · original

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.
**@⁠ghost** on GitHub · 2026-11-24 02:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/574#issuecomment-7119762859) 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.
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 02:08 UTC · original

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.

**@⁠MesshM** on GitHub · 2026-11-24 02:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/574#issuecomment-7119799357) 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.
Author
Owner

@⁠ryosen0 on GitHub · 2026-11-24 02:13 UTC · original

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.

**@⁠ryosen0** on GitHub · 2026-11-24 02:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/574#issuecomment-7119891101) 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.