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

Merged
O5-7 merged 1 commit from upstream-pr/2178 into main 2026-11-25 10:50:53 +00:00
O5-7 commented 2026-11-25 07:54:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by O5-7 on 2026-11-25T07:54:33Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:6599850547 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2178). Originally posted by [O5-7](https://github.com/O5-7) on 2026-11-25T07:54:33Z. --- 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.
luckyteagirl commented 2026-11-25 10:10:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T09:45:05Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7158750443 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2178#issuecomment-7158750443). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-25T09:45:05Z. --- 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.
upstream-sync closed this pull request 2026-11-25 11:08:34 +00:00
raylitebull commented 2026-11-25 11:09:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:45:01Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7160120951 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2178#issuecomment-7160120951). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T10:45:01Z. --- 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`.
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!2168
No description provided.