Recompiler: propagate PSO demand to a shared shader build #2608

Open
opened 2026-11-26 05:34:45 +00:00 by github-bot · 1 comment
Owner

@⁠KOLESNiii on GitHub · 2026-11-26 01:31 UTC · original

Part of #2508 (Pipeline Rebuild). Verified on main at b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.

Two different PSOs can share a translated shader. A background PSO can take the ShaderKey mutex first and hold it through its DXC call. An urgent PSO requesting the same shader then waits on the mutex. DXC captured a callback to the original PSO's demand, and the waiting PSO registers no demand with the shared shader work. Its arrival therefore cannot change whether that DXC job is considered wanted. This also matters with #2423's priority queue because that queue reads the job's existing demand callback. Translation flight · Demand callback · DXC job

An extracted-code CPU probe used two simulated pending PSOs, one wanted and one background. Both received the single cached result and the owner's demand callback remained false. For a fix, let foreground waiters register demand on the shared shader work and make DXC query that aggregate while the job is queued or waiting for headroom. Add a deterministic test with a blocked background owner, an urgent joiner and one compile. Check the DXC source-key flight too because distinct shader keys can converge there. Windows timing and title frequency remain unmeasured.

Related to #2088, #2423, #2424 and #2579. AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for static review, the Linux probe and drafting.

**@⁠KOLESNiii** on GitHub · 2026-11-26 01:31 UTC · [original](https://github.com/xcl-dev/xcl/issues/2608) Part of #2508 (Pipeline Rebuild). Verified on `main` at `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. Two different PSOs can share a translated shader. A background PSO can take the `ShaderKey` mutex first and hold it through its DXC call. An urgent PSO requesting the same shader then waits on the mutex. DXC captured a callback to the original PSO's demand, and the waiting PSO registers no demand with the shared shader work. Its arrival therefore cannot change whether that DXC job is considered wanted. This also matters with #2423's priority queue because that queue reads the job's existing demand callback. [Translation flight](https://github.com/xcl-dev/xcl/blob/b49be18/crates/xcl/src/gpu/recomp/pso.rs#L857-L904) · [Demand callback](https://github.com/xcl-dev/xcl/blob/b49be18/crates/xcl/src/hle/d3d12x/pso_async.rs#L60-L69) · [DXC job](https://github.com/xcl-dev/xcl/blob/b49be18/crates/xcl/src/gpu/recomp/dxc.rs#L475-L496) An extracted-code CPU probe used two simulated pending PSOs, one wanted and one background. Both received the single cached result and the owner's demand callback remained false. For a fix, let foreground waiters register demand on the shared shader work and make DXC query that aggregate while the job is queued or waiting for headroom. Add a deterministic test with a blocked background owner, an urgent joiner and one compile. Check the DXC source-key flight too because distinct shader keys can converge there. Windows timing and title frequency remain unmeasured. Related to #2088, #2423, #2424 and #2579. AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for static review, the Linux probe and drafting.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:34:45 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 02:22 UTC · original

Claiming #2608 to prepare a local fix that registers foreground waiter demand on shared shader compilation, with a CPU regression test. The branch will be available for maintainer or contributor review before submission.
AI use: Claude Code (Claude Opus 5.5), coordinated by Codex (gpt-6.2-sol).

**@⁠oni-swr** on GitHub · 2026-11-26 02:22 UTC · [original](https://github.com/xcl-dev/xcl/issues/2608#issuecomment-7180750549) Claiming #2608 to prepare a local fix that registers foreground waiter demand on shared shader compilation, with a CPU regression test. The branch will be available for maintainer or contributor review before submission. AI use: Claude Code (Claude Opus 5.5), coordinated by Codex (gpt-6.2-sol).
This discussion has been locked. Commenting is limited to contributors.
No description provided.