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

Merged
ryosen0 merged 2 commits from upstream-pr/574 into main 2026-11-24 02:43:20 +00:00
ryosen0 commented 2026-11-24 01:58:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ryosen0 on 2026-11-24T01:58:14Z.


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.

<!-- greyfinch-sync:ivall/xcl:issue:6572864166 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/574). Originally posted by [ryosen0](https://github.com/ryosen0) on 2026-11-24T01:58:14Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:59:01 +00:00
towiice commented 2026-11-24 06:59:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by towiice on 2026-11-24T02:14:52Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:ivall/xcl:review:6032624899 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/574#pullrequestreview-6032624899). Originally posted by [towiice](https://github.com/towiice) on 2026-11-24T02:14:52Z. **Review:** COMMENTED --- 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.
nullmarsh commented 2026-11-24 07:05:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by nullmarsh on 2026-11-24T02:06:35Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7119762859 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/574#issuecomment-7119762859). Originally posted by [nullmarsh](https://github.com/nullmarsh) on 2026-11-24T02:06:35Z. --- 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.
MesshM commented 2026-11-24 07:05:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T02:08:40Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7119799357 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/574#issuecomment-7119799357). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T02:08:40Z. --- 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 commented 2026-11-24 07:05:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ryosen0 on 2026-11-24T02:13:35Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7119891101 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/574#issuecomment-7119891101). Originally posted by [ryosen0](https://github.com/ryosen0) on 2026-11-24T02:13:35Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!569
No description provided.