D3D12.X: skip orphaned queued builds in normal PSO workers #2178

Manually merged
github merged 1 commit from gh-pr/2178/head into gh-pr/2178/base 2026-11-26 05:22:10 +00:00
Owner

@⁠O5-7 on GitHub · 2026-11-25 07:54 UTC · original
O5-7:pso/skip-orphaned-queued-builds → main · +72 −0 · 1 files · 1 commits · merged 2026-11-25 10:50 UTC

Fixes #972

What is in it

  • Mirror preload()'s p.orphan.load(Ordering::Acquire) check in the ordinary worker loop (queue()) in crates/xcl/src/hle/d3d12x/pso_async.rs before taking and running p.job, dropping the job when the stand-in has already been released.
  • Add deterministic regression test _released_queued_pipeline_is_not_built_by_normal_workers in pso_async::used_tests that saturates all normal workers behind a gate, queues a target job, releases its stand-in, opens the gate, and asserts the target job never executes.

Tested

  • Hardware / toolchain: NVIDIA GeForce RTX 5080 (driver 32.0.15.9579), AMD Ryzen 7 9700X, Windows 11 Pro 10.0.26100,
    ustc 1.100.0 (0ef1bc386 2026-11-09), debug tests & release smoke run, DXC 1.8.2502.11 (D:\Windows Kits\10\bin\10.0.26100.0\x64).
  • cargo test -p xcl pso_async -- --nocapture: 7 passed, 0 failed, 0 ignored (includes _released_queued_pipeline_is_not_built_by_normal_workers).
  • cargo test --workspace -- --test-threads=4: 1155 passed, 0 failed, 46 ignored.

Regression run
xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1686 (PresentX 1686) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14083 MB
xcl-smoke v1 commit: b4d748214857a9c784654f560207e94bfea73a2b gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1685 (PresentX 1685) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14107 MB

Not tested

  • No full cold world-load shader compilation run or measurement of how often a retail run orphans queued builds was performed.

AI use

  • Antigravity (Gemini 4 Neon) wrote the code change, deterministic regression test, PR text, and ran the test suite and smoke run.
**@⁠O5-7** on GitHub · 2026-11-25 07:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/2178) `O5-7:pso/skip-orphaned-queued-builds` → `main` · +72 −0 · 1 files · 1 commits · merged 2026-11-25 10:50 UTC Fixes #972 **What is in it** - Mirror preload()'s p.orphan.load(Ordering::Acquire) check in the ordinary worker loop (queue()) in crates/xcl/src/hle/d3d12x/pso_async.rs before taking and running p.job, dropping the job when the stand-in has already been released. - Add deterministic regression test _released_queued_pipeline_is_not_built_by_normal_workers in pso_async::used_tests that saturates all normal workers behind a gate, queues a target job, releases its stand-in, opens the gate, and asserts the target job never executes. **Tested** - Hardware / toolchain: NVIDIA GeForce RTX 5080 (driver 32.0.15.9579), AMD Ryzen 7 9700X, Windows 11 Pro 10.0.26100, ustc 1.100.0 (0ef1bc386 2026-11-09), debug tests & release smoke run, DXC 1.8.2502.11 (D:\Windows Kits\10\bin\10.0.26100.0\x64). - cargo test -p xcl pso_async -- --nocapture: 7 passed, 0 failed, 0 ignored (includes _released_queued_pipeline_is_not_built_by_normal_workers). - cargo test --workspace -- --test-threads=4: 1155 passed, 0 failed, 46 ignored. **Regression run** ` xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1686 (PresentX 1686) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14083 MB ` ` xcl-smoke v1 commit: b4d748214857a9c784654f560207e94bfea73a2b gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1685 (PresentX 1685) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14107 MB ` **Not tested** - No full cold world-load shader compilation run or measurement of how often a retail run orphans queued builds was performed. **AI use** - Antigravity (Gemini 4 Neon) wrote the code change, deterministic regression test, PR text, and ran the test suite and smoke run.
Mirror the preload worker's p.orphan check in pso_async::queue() before
taking or compiling a queued pipeline job, so normal workers drop work
whose stand-in has already been released by the title instead of feeding
obsolete builds into DXC and the driver.

Fixes #972

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:22:07 +00:00
github manually merged commit b4d7482148 into gh-pr/2178/base 2026-11-26 05:22:10 +00:00
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-25 09:45 UTC · original

Independent native Windows verification of exact PR head b4d748214857a9c784654f560207e94bfea73a2b (parent cbc296ab65a2661a61e3e2da109134bcd5319f60). The final worktree is clean.

Environment: Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver 30.0.13002.13003; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. These are CPU worker tests; the GPU did not execute a shader.

PR head: cargo test --locked -p xcl --lib -j 2 pso_async -- --test-threads=1 --show-output passed 7/0/0, no skips, including a_released_queued_pipeline_is_not_built_by_normal_workers. I repeated the seven tests after restoring the clean head; they passed again 7/0/0.

Test-only negative control: I removed only the new orphan check from the normal worker loop, retaining the new regression test. With its original dummy return value 0x9721, the queued job ran and the process aborted on a misaligned dummy COM pointer before the intended assertion. For a clean control, I additionally changed that test job's return value to 0 locally, leaving its ran_job flag and assertion intact. The same focused regression then failed 0/1/0, released job reached the compiler. I restored both edits, rebuilt, and reran the passing PR-head tests. No control edit was committed.

Scope: This demonstrates the queued-job behavior in the deterministic synthetic worker fixture. I did not run the full workspace suite, a cold title PSO compilation, or a retail smoke comparison on this PR.

AI use: OpenAI Codex (GPT-6; exact variant not exposed in this session) ran the native Windows tests and local control, restored the clean PR head, and drafted this report.

**@⁠luckyteagirl** on GitHub · 2026-11-25 09:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2178#issuecomment-7158750443) Independent native Windows verification of exact PR head `b4d748214857a9c784654f560207e94bfea73a2b` (parent `cbc296ab65a2661a61e3e2da109134bcd5319f60`). The final worktree is clean. **Environment:** Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver `30.0.13002.13003`; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. These are CPU worker tests; the GPU did not execute a shader. **PR head:** `cargo test --locked -p xcl --lib -j 2 pso_async -- --test-threads=1 --show-output` passed **7/0/0**, no skips, including `a_released_queued_pipeline_is_not_built_by_normal_workers`. I repeated the seven tests after restoring the clean head; they passed again **7/0/0**. **Test-only negative control:** I removed only the new orphan check from the normal worker loop, retaining the new regression test. With its original dummy return value `0x9721`, the queued job ran and the process aborted on a misaligned dummy COM pointer before the intended assertion. For a clean control, I additionally changed that test job's return value to `0` locally, leaving its `ran_job` flag and assertion intact. The same focused regression then failed **0/1/0**, `released job reached the compiler`. I restored both edits, rebuilt, and reran the passing PR-head tests. No control edit was committed. **Scope:** This demonstrates the queued-job behavior in the deterministic synthetic worker fixture. I did not run the full workspace suite, a cold title PSO compilation, or a retail smoke comparison on this PR. AI use: OpenAI Codex (GPT-6; exact variant not exposed in this session) ran the native Windows tests and local control, restored the clean PR head, and drafted this report.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 10:45 UTC · original

Code review on b4d7482:

  • Checking p.orphan.load(Ordering::Acquire) in pso_async::queue's worker loop before taking p.job cleanly avoids compiling stand-in PSOs whose title pipeline was already released while queued, with focused coverage in a_released_queued_pipeline_is_not_built_by_normal_workers.
  • Diff audited and CI workflow approved (running).

Remaining before merge: Build and test finishing green plus dual-vendor (AMD + NVIDIA) verification on b4d7482.

**@⁠raylitebull** on GitHub · 2026-11-25 10:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2178#issuecomment-7160120951) Code review on `b4d7482`: - Checking `p.orphan.load(Ordering::Acquire)` in `pso_async::queue`'s worker loop before taking `p.job` cleanly avoids compiling stand-in PSOs whose title pipeline was already released while queued, with focused coverage in `a_released_queued_pipeline_is_not_built_by_normal_workers`. - Diff audited and CI workflow approved (running). **Remaining before merge:** `Build and test` finishing green plus dual-vendor (**AMD** + **NVIDIA**) verification on `b4d7482`.
This discussion has been locked. Commenting is limited to contributors.
No description provided.