D3D12.X: an ExecuteIndirect dispatch of an untranslated compute pipeline is skipped, as Dispatch is #1195
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!1195
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1195/head"
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?
@ofc0urse on GitHub · 2026-11-24 13:04 UTC · original
ofc0urse:fix/execute-indirect-untranslated-compute→main· +96 −0 · 3 files · 1 commits · merged 2026-11-24 19:49 UTCDispatchskips a console compute pipeline that has no translation (its build failed).ExecuteIndirectsent the same pipeline to the PC call, after setting only the graphics root signature. The dispatch then ran with whatever compute root signature the list held, which can still be XCL's ABI one from a translated dispatch before it. The debug layer reports that pair as error 953 ("the currently set Root Signature doesn't match the currently set Pipeline State Object"). Follows #574, which skips the same call for a pipeline that is still being built.What is in it
crates/xcl/src/hle/d3d12x/device_x.rs:create_command_signature_xnotes whether a new signature has a Dispatch argument, at every creation, so a signature made later at a freed one's address does not inherit the kind.crates/xcl/src/hle/d3d12x/real.rs: compute pipelines made from a console shader that runs untranslated (the stand-in of a background build, the fallback of a console shader that failed) are noted inCONSOLE_COMPUTEand dropped with the pipeline inforget_pso.crates/xcl/src/hle/d3d12x/bind.rs:execute_indirectskips a Dispatch signature when the bound pipeline is one of those, counted as a skipped dispatch and logged likedispatchdoes. Draw signatures and native PC compute pipelines go to the PC call as before.async_compute_pso_success_and_failure_in_dispatch_and_execute_indirectgets two more cases. A failed console compute stand-in with a Dispatch signature must not reach the PCExecuteIndirect(fails without the change inbind.rs). A native PC compute pipeline with the same signature still reaches it (fails with a guard on the signature alone, the first version of this PR, found by @thehollowedone). The same address noted again without a Dispatch argument goes to the PC call, and a released pipeline's address is no longer a console one.Tested
cargo build --workspace+cargo test --workspace -- --test-threads=4: 741 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2, no wave64)XCL_D3D12_DEBUG=1,XCL_PSO_WAIT_MS=50, through the account screen into the world load. To get compute builds that fail, these runs also carry a local patch that is not part of this PR: compute programs of 768 KB of DXIL or more are refused instead of compiled (XCL_SKIP_CS_KB=768, 11 programs refused per run; on this card such programs take 60 to 97 s each in the driver).mainwithout the local patch: no compute build failed in that run and 953 did not appear, so on this title the case needs a compute program that fails to translate or that the driver rejects.Regression run
main with the cache warm. A first pair, run in the order main then PR, gave 274 and 1046 frames: whichever build ran first on a cold pipeline cache paid for it. The PR block is the current head; the first version of this PR (c1ebdac) showed the same 1558 frames as main.
main:
PR:
Not tested
AI use
🤖 Generated with Claude Code
@thehollowedone on GitHub · 2026-11-24 13:10 UTC · original
The new guard also skips a valid native PC compute pipeline when its indirect signature is created through XCL’s console path. A synthetic one-group dispatch used a native
cs_5_0pipeline, a matching compute root signature and UAV, and aDispatchXsignature created bycreate_command_signature_x. I called XCL’s consoleexecute_indirectand read back the UAV after the fence.47efa2ewrote0x12345678.c1ebdaclogged the new skip message and left the UAV at zero.done == trueandreal == 0before taking the new skip branch. This restored0x12345678and the stockasync_compute_pso_success_and_failure_in_dispatch_and_execute_indirecttest still passed.All three GPU runs completed with zero debug-layer messages. Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, debug. Command
cargo test --offline --locked -p xcl --lib <filter> -- --nocapture --test-threads=1. This verifies the native control and the failed async case. Retail and synchronous fallback behavior were outside the check.AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch checks and drafted this report.
@DavidM1911 on GitHub · 2026-11-24 13:22 UTC · original
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
cargo test -p xcl --lib bind: 8 passed, 0 failed — the ExecuteIndirect untranslated-compute skip matches the Dispatch behaviour and the bind suite stays green.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@0xTehuti on GitHub · 2026-11-24 13:30 UTC · original
Test report on NVIDIA GeForce RTX 2070 SUPER (Turing, wave32)
Commit tested
c1ebdacf0cd2cab91c2fc1ca7227c2074885c8ff(PR #1195 head)Tested
cargo test --test gpu_compute_e2e:2 passed; 0 failed; finished in 0.54sasync_compute_pso_registers_real_pso_and_not_standin ... okconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_back ... okNot tested
AI use
@ofc0urse on GitHub · 2026-11-24 13:36 UTC · original
@thehollowedone Thanks, you're right: the guard looked only at the signature, so a native PC compute pipeline went down with the failed console ones.
Fixed in
d6ff44c(squashed into the one commit). XCL now notes compute pipelines made from a console shader that runs untranslated: the stand-in of a background build, and the fallback of a console shader that failed while it was being made. They are dropped with the pipeline.ExecuteIndirectskips a Dispatch signature only for those, so your nativecs_5_0control goes to the PC call as on main.The test has your case as step 4: a pipeline not made from a console shader, bound with the same Dispatch signature, reaches the PC
ExecuteIndirect. It fails with the old guard and passes now. I used a set of console pipelines instead ofdone && real == 0so that the synchronous fallback is covered as well.@JoaoPauluu on GitHub · 2026-11-24 14:21 UTC · original
A regression run under Wine on Linux, on a retail title.
Tested
x86_64-pc-windows-gnu.d6ff44cas it is (merge base47efa2e) andmain47efa2e, no uncommitted changes. Retail title 1.0.2.1,scripts/linux/smoke.sh(#257) for 60 s, no input. Twelve runs in a row,mainfirst and last, other PRs in between.ExecuteIndirect dispatch with a pipeline that has no translationline is not in its log. So this is a regression check only.Regression run
main (first run):
this PR:
The last
mainrun: 1425 frames,exit: 0x0, no device removal, no crash. Under Wine,peak commitreads 0 MB, so these blocks do not check memory.Not tested
AI use
@thehollowedone on GitHub · 2026-11-24 15:46 UTC · original
Confirmed the follow-up fix on d6ff44c. Windows 11 build 26300, RTX 3080 Ti / 621.35, DXC 1.8.2502.11, Rust 1.99.1 MSVC, debug.
The synthetic fixture created a real console
DispatchXcommand signature through XCL and submitted the list to D3D12. With a native compute pipeline,ExecuteIndirectwrote all eight expected values and the skipped-dispatch counter stayed flat. With the same pipeline marked as an untranslated console stand-in, the eight outputs stayed zero and the counter rose by one.cargo test --offline --locked -p xcl --lib hle::d3d12x::bind::tests -- --test-threads=1passed 5/5. The scratch GPU readback test passed once per case with no skips. Synthetic inputs only.AI-assisted. Codex (GPT-6 family, exact variant unavailable) extended and ran the fixture and drafted this reply.
@DavidM1911 on GitHub · 2026-11-26 03:52 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin