D3D12.X: count only queued background pipelines as still building #1159

Closed
eizispark wants to merge 1 commit from upstream-pr/1168 into main
eizispark commented 2026-11-24 12:47:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T12:47:41Z.


With XCL_LAZY_PSO=1 enabled by default, submit_lazy inserts every translated stand-in pipeline into PENDING while sending only pipelines whose shader keys are in used-pipelines.txt (or ones later bound) to the background workers. pso_async::counts() still walked PENDING under its mutex and counted every !done entry, which kept the window title stuck on "compiling shaders: 0 running, 0 done, 57587 pipelines queued" after all active compiles finished (#894) and recorded dormant stand-ins as still building in report.json.

Part of #894 (fixes the pipelines queued / background_pipelines accounting and removes the O(N) PENDING lock scan on every window-title update; the title's loading-screen progression on #894's host remains separate).

What is in it

  • crates/xcl/src/hle/d3d12x/pso_async.rs: track a monotonic IDLE -> QUEUED -> DONE atomic state on each Pending together with a global QUEUED_BUILDS counter incremented once when a pipeline is queued to queue(), queued to preload(), or built on the binding thread, and decremented once on complete(), channel-send error, preload() orphan skip, or released(). pso_async::counts() is now lock-free and O(1).
  • crates/xcl/src/hle/d3d12x/pso_async.rs (used_tests): add lazy_stand_ins_are_not_counted_as_still_building_until_queued (serialized across all used_tests via COUNT_TEST_LOCK and holding the PENDING guard across the final zero check) covering dormant submit_lazy entries, release of unqueued stand-ins, resolve-triggered queueing and completion, and exact immediate -1 decrement on released() of an in-flight pipeline without double-decrement on worker completion.

Tested

  • Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (driver 32.0.32015.16001), rustc 1.100.0 (0ef1bc386 2026-11-09), debug and release.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on the head, rebased onto main 1a0bbe3 (after #1782): 1249 passed, 2 failed – gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 and fuzz_validate_and_gpu_3, which fail the same way on a clean main 426a5a7 on this adapter; 46 ignored.
  • cargo test -p xcl --lib hle::d3d12x::pso_async -- --test-threads=4, 5 consecutive runs: 11 passed, 0 failed on each run (including #1782's two PcCalls tests).
  • lazy_stand_ins_are_not_counted_as_still_building_until_queued failed before the fix: counts().2 reported 64 for 64 unqueued lazy stand-ins.
  • Earlier 60 s retail smoke run: d3d12.background_pipelines in report.json went from [228, 0, 57595] on main to [228, 0, 0] once the 228 preloaded pipelines were built.

Regression run

main:

xcl-smoke v1
commit: 426a5a745db4d5e4b037449ede0b70cb342f5192
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1680 (PresentX 1680)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14599 MB

PR head:

xcl-smoke v1
commit: 0840ff5a690c564caf808b7feecd8211f02aeded
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1679 (PresentX 1679)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14602 MB

Not tested

  • NVIDIA and Intel GPUs, Windows 10, wave32-only adapters, and XCL_SAMPLE_* sample-data tests.
  • The separate loading-screen progression reported on #894's 12 GB NVIDIA host.

AI use

  • Antigravity (Google DeepMind, Gemini 4 Carbon) – investigated pso_async::counts() in #894, wrote the fix and unit test, and ran the test suite and smoke check. Antigravity (Claude Opus 5.5) – rebased it onto main 1a0bbe3 (merged the new a_released_queued_pipeline_is_not_built_by_normal_workers test next to this one and put it under COUNT_TEST_LOCK, since it fills every worker the count test needs), and reran the suite and the smoke pair.
<!-- greyfinch-sync:ivall/xcl:issue:5472434592 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1168). Originally posted by [eizispark](https://github.com/eizispark) on 2026-11-24T12:47:41Z. --- With `XCL_LAZY_PSO=1` enabled by default, `submit_lazy` inserts every translated stand-in pipeline into `PENDING` while sending only pipelines whose shader keys are in `used-pipelines.txt` (or ones later bound) to the background workers. `pso_async::counts()` still walked `PENDING` under its mutex and counted every `!done` entry, which kept the window title stuck on `"compiling shaders: 0 running, 0 done, 57587 pipelines queued"` after all active compiles finished (#894) and recorded dormant stand-ins as still building in `report.json`. Part of #894 (fixes the `pipelines queued` / `background_pipelines` accounting and removes the `O(N)` `PENDING` lock scan on every window-title update; the title's loading-screen progression on #894's host remains separate). **What is in it** - `crates/xcl/src/hle/d3d12x/pso_async.rs`: track a monotonic `IDLE -> QUEUED -> DONE` atomic state on each `Pending` together with a global `QUEUED_BUILDS` counter incremented once when a pipeline is queued to `queue()`, queued to `preload()`, or built on the binding thread, and decremented once on `complete()`, channel-send error, `preload()` orphan skip, or `released()`. `pso_async::counts()` is now lock-free and `O(1)`. - `crates/xcl/src/hle/d3d12x/pso_async.rs` (`used_tests`): add `lazy_stand_ins_are_not_counted_as_still_building_until_queued` (serialized across all `used_tests` via `COUNT_TEST_LOCK` and holding the `PENDING` guard across the final zero check) covering dormant `submit_lazy` entries, release of unqueued stand-ins, `resolve`-triggered queueing and completion, and exact immediate `-1` decrement on `released()` of an in-flight pipeline without double-decrement on worker completion. **Tested** - Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (driver `32.0.32015.16001`), `rustc 1.100.0 (0ef1bc386 2026-11-09)`, debug and release. - `cargo test --workspace --no-fail-fast -- --test-threads=4` on the head, rebased onto `main` `1a0bbe3` (after #1782): 1249 passed, 2 failed – `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` and `fuzz_validate_and_gpu_3`, which fail the same way on a clean `main` `426a5a7` on this adapter; 46 ignored. - `cargo test -p xcl --lib hle::d3d12x::pso_async -- --test-threads=4`, 5 consecutive runs: 11 passed, 0 failed on each run (including #1782's two `PcCalls` tests). - `lazy_stand_ins_are_not_counted_as_still_building_until_queued` failed before the fix: `counts().2` reported 64 for 64 unqueued lazy stand-ins. - Earlier 60 s retail smoke run: `d3d12.background_pipelines` in `report.json` went from `[228, 0, 57595]` on `main` to `[228, 0, 0]` once the 228 preloaded pipelines were built. **Regression run** `main`: ``` xcl-smoke v1 commit: 426a5a745db4d5e4b037449ede0b70cb342f5192 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1680 (PresentX 1680) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14599 MB ``` PR head: ``` xcl-smoke v1 commit: 0840ff5a690c564caf808b7feecd8211f02aeded gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1679 (PresentX 1679) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14602 MB ``` **Not tested** - NVIDIA and Intel GPUs, Windows 10, wave32-only adapters, and `XCL_SAMPLE_*` sample-data tests. - The separate loading-screen progression reported on #894's 12 GB NVIDIA host. **AI use** - Antigravity (Google DeepMind, Gemini 4 Carbon) – investigated `pso_async::counts()` in #894, wrote the fix and unit test, and ran the test suite and smoke check. Antigravity (Claude Opus 5.5) – rebased it onto `main` `1a0bbe3` (merged the new `a_released_queued_pipeline_is_not_built_by_normal_workers` test next to this one and put it under `COUNT_TEST_LOCK`, since it fills every worker the count test needs), and reran the suite and the smoke pair.
fromthemoonx commented 2026-11-24 14:06:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-24T13:19:23Z.


NVIDIA run with the whole suite, since Not tested lists NVIDIA.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (32-lane waves), driver 32.0.16.1088; AMD Ryzen 7 5700X; native Windows 11 Pro 26H2 (build 26300.9974), Graphics Tools (D3D12 debug layer) installed; rustc 1.100.0 stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug
  • Exact head 39d761715ab47392c57fc53778d3c03b9486d8a5, which is on current main 47efa2e (so also the merged result): cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored. The new pso_async::used_tests::lazy_stand_ins_are_not_counted_as_still_building_until_queued passed.
  • Fails with the old counting: with this PR's file and counts() changed back to main's scan of PENDING (every entry whose done is false), the new test fails at pso_async.rs:381. So it covers the pipelines queued / background_pipelines count from #894.
  • pso_async + hle::d3d12x::bind tests, 10 runs: 10 of 10 passed (9 each, the pipeline-wait budget tests included)
  • e2e + gpu_pso_e2e, 3 runs: 3 of 3 passed. The test title builds its pipelines through the background path, with stand-ins.
  • D3D12 debug layer: the test title's XCL_D3D12_DEBUG=1 run logs the same set of debug-layer errors and warnings as on main.
  • SKIPPED (no wave64 on this adapter): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware

Not tested

  • A retail title with used-pipelines.txt and tens of thousands of stand-ins (the #894 window title); release build.

AI use

  • Claude Code (Claude Opus 5.5) ran the build and tests on the machine above, including the old-counting check, and wrote this report from the output.
<!-- greyfinch-sync:ivall/xcl:comment:7132664383 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1168#issuecomment-7132664383). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-11-24T13:19:23Z. --- NVIDIA run with the whole suite, since **Not tested** lists NVIDIA. **Tested** - NVIDIA GeForce RTX 3060 12 GB (32-lane waves), driver 32.0.16.1088; AMD Ryzen 7 5700X; native Windows 11 Pro 26H2 (build 26300.9974), Graphics Tools (D3D12 debug layer) installed; rustc 1.100.0 `stable-x86_64-pc-windows-msvc`; DXC 1.9.2602.17; debug - **Exact head `39d761715ab47392c57fc53778d3c03b9486d8a5`**, which is on current `main` `47efa2e` (so also the merged result): `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4`: **742 passed, 0 failed, 41 ignored**. The new `pso_async::used_tests::lazy_stand_ins_are_not_counted_as_still_building_until_queued` passed. - **Fails with the old counting:** with this PR's file and `counts()` changed back to `main`'s scan of `PENDING` (every entry whose `done` is false), the new test fails at `pso_async.rs:381`. So it covers the `pipelines queued` / `background_pipelines` count from #894. - `pso_async` + `hle::d3d12x::bind` tests, 10 runs: **10 of 10 passed** (9 each, the pipeline-wait budget tests included) - `e2e` + `gpu_pso_e2e`, 3 runs: **3 of 3 passed**. The test title builds its pipelines through the background path, with stand-ins. - D3D12 debug layer: the test title's `XCL_D3D12_DEBUG=1` run logs the same set of debug-layer errors and warnings as on `main`. - SKIPPED (no wave64 on this adapter): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` **Not tested** - A retail title with `used-pipelines.txt` and tens of thousands of stand-ins (the #894 window title); release build. **AI use** - Claude Code (Claude Opus 5.5) ran the build and tests on the machine above, including the old-counting check, and wrote this report from the output.
JoaoPauluu commented 2026-11-24 14:06:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T13:24:27Z.


A run under Wine on Linux: the count changes the same way as in the description's AMD run.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 39d7617 as it is (based on 47efa2e) and main 47efa2e, no uncommitted changes. Retail title 1.0.2.1, scripts/linux/smoke.sh (#257) for 60 s, no input. Runs in order: main, this PR, main.
  • d3d12.background_pipelines in report.json: [228, 0, 57595] on both main runs, [228, 0, 0] on this PR. translated_pipelines 228, failed_pipelines 0 and fallback_pipelines 0 in all three.

Regression run

main (first run):

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1351 (PresentX 1351)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

this PR:

xcl-smoke v1
commit: 39d761715ab47392c57fc53778d3c03b9486d8a5
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1376 (PresentX 1376)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 0 MB

The second main run: 1382 frames, exit: 0x0, no device removal, no crash. Under Wine, peak commit reads 0 MB, so these blocks do not check memory.

Not tested

  • the test suite on this head, the window title's pipelines queued text, native Windows.

AI use

  • Claude Code (Claude Opus 5.5) built both commits, ran the runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
<!-- greyfinch-sync:ivall/xcl:comment:7132784599 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1168#issuecomment-7132784599). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-24T13:24:27Z. --- A run under Wine on Linux: the count changes the same way as in the description's AMD run. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `39d7617` as it is (based on `47efa2e`) and `main` `47efa2e`, no uncommitted changes. Retail title 1.0.2.1, `scripts/linux/smoke.sh` (#257) for 60 s, no input. Runs in order: main, this PR, main. - `d3d12.background_pipelines` in `report.json`: `[228, 0, 57595]` on both `main` runs, `[228, 0, 0]` on this PR. `translated_pipelines` 228, `failed_pipelines` 0 and `fallback_pipelines` 0 in all three. **Regression run** main (first run): ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1351 (PresentX 1351) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` this PR: ``` xcl-smoke v1 commit: 39d761715ab47392c57fc53778d3c03b9486d8a5 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1376 (PresentX 1376) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 0 MB ``` The second `main` run: 1382 frames, `exit: 0x0`, no device removal, no crash. Under Wine, `peak commit` reads 0 MB, so these blocks do not check memory. **Not tested** - the test suite on this head, the window title's `pipelines queued` text, native Windows. **AI use** - Claude Code (Claude Opus 5.5) built both commits, ran the runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
pvfreis commented 2026-11-24 14:17:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-24T14:17:51Z.

Review: COMMENTED


Review of 39d7617 (merge base 47efa2e; current main is 930e8b4), by reading the code; nothing was built or run here. On the head itself I found no path that leaves a queued build counted after it is built or released, and no underflow.

  1. CONFIRMED: merged into current main, pso_async.rs defines BUILDING twice. The head adds static BUILDING: AtomicUsize (pso_async.rs:88). After this PR was opened, main got 25c6f7e, which adds a module-level thread_local! { static BUILDING: RefCell<Option<Arc<Pending>>> } to the same file (pso_async.rs:44-46 on main). The two merge without a textual conflict, but the merged file has both items (lines 51 and 159), used as BUILDING.with(..) and as BUILDING.fetch_add/fetch_sub/load. Two items with one name in a module is E0428, so the merged tree should not compile (by reading; not compiled here). Fix: rebase and give the counter its own name (e.g. QUEUED_BUILDS), then rerun the suite and the smoke block on the new head.

Questions for the author

  • The test's last check drops the PENDING lock before reading the global counter; with --test-threads=4, could another test's submit or released in between make it fail?
  • The comment says a released in-flight pipeline "drops from the building count immediately", but the test only asserts counts().2 < 64; would checking the count before and after released show that?

Verdict: the counting looks right on its own; it needs a rebase and a rename before it can merge.

Review by Claude Code (written by Claude Opus 5.5, second read by Claude Fable 5.2); each point checked by a person before posting.

<!-- greyfinch-sync:ivall/xcl:review:6040850444 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1168#pullrequestreview-6040850444). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-24T14:17:51Z. **Review:** COMMENTED --- Review of `39d7617` (merge base `47efa2e`; current `main` is `930e8b4`), by reading the code; nothing was built or run here. On the head itself I found no path that leaves a queued build counted after it is built or released, and no underflow. 1. **CONFIRMED: merged into current `main`, `pso_async.rs` defines `BUILDING` twice.** The head adds `static BUILDING: AtomicUsize` (`pso_async.rs:88`). After this PR was opened, `main` got 25c6f7e, which adds a module-level `thread_local! { static BUILDING: RefCell<Option<Arc<Pending>>> }` to the same file (`pso_async.rs:44-46` on `main`). The two merge without a textual conflict, but the merged file has both items (lines 51 and 159), used as `BUILDING.with(..)` and as `BUILDING.fetch_add/fetch_sub/load`. Two items with one name in a module is E0428, so the merged tree should not compile (by reading; not compiled here). Fix: rebase and give the counter its own name (e.g. `QUEUED_BUILDS`), then rerun the suite and the smoke block on the new head. **Questions for the author** - The test's last check drops the `PENDING` lock before reading the global counter; with `--test-threads=4`, could another test's `submit` or `released` in between make it fail? - The comment says a released in-flight pipeline "drops from the building count immediately", but the test only asserts `counts().2 < 64`; would checking the count before and after `released` show that? Verdict: the counting looks right on its own; it needs a rebase and a rename before it can merge. Review by Claude Code (written by Claude Opus 5.5, second read by Claude Fable 5.2); each point checked by a person before posting.
eizispark commented 2026-11-24 16:07:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T15:36:02Z.


Thanks @pvfreis for catching the BUILDING symbol collision with 25c6f7e and the two test questions, and thanks @fromthemoonx and @JoaoPauluu for the Windows and Linux/Wine NVIDIA test reports.

Rebased onto current main (930e8b4) as 47f672e:

  • Renamed the atomic counter to QUEUED_BUILDS (resolving E0428 against the BUILDING thread-local).
  • Serialized the used_tests submit/submit_lazy tests under COUNT_TEST_LOCK, updated submit_as and released so QUEUED_BUILDS transitions while holding PENDING, and kept the PENDING guard across the final zero check.
  • Replaced the loose < 64 check on the orphaned in-flight pipeline with an exact after_release + 1 == before_release check around released(), followed by waiting on done and verifying worker completion leaves counts().2 == after_release.
  • Updated the PR description with fresh workspace test counts and a fresh 60 s xcl-smoke run on 47f672e.

AI use: Antigravity (Gemini 4 Carbon)

<!-- greyfinch-sync:ivall/xcl:comment:7136299674 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1168#issuecomment-7136299674). Originally posted by [eizispark](https://github.com/eizispark) on 2026-11-24T15:36:02Z. --- Thanks @pvfreis for catching the `BUILDING` symbol collision with `25c6f7e` and the two test questions, and thanks @fromthemoonx and @JoaoPauluu for the Windows and Linux/Wine NVIDIA test reports. Rebased onto current `main` (`930e8b4`) as `47f672e`: - Renamed the atomic counter to `QUEUED_BUILDS` (resolving `E0428` against the `BUILDING` thread-local). - Serialized the `used_tests` `submit`/`submit_lazy` tests under `COUNT_TEST_LOCK`, updated `submit_as` and `released` so `QUEUED_BUILDS` transitions while holding `PENDING`, and kept the `PENDING` guard across the final zero check. - Replaced the loose `< 64` check on the orphaned in-flight pipeline with an exact `after_release + 1 == before_release` check around `released()`, followed by waiting on `done` and verifying worker completion leaves `counts().2 == after_release`. - Updated the PR description with fresh workspace test counts and a fresh 60 s `xcl-smoke` run on `47f672e`. AI use: Antigravity (Gemini 4 Carbon)
pvfreis commented 2026-11-24 16:07:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-24T15:51:44Z.


Thanks. Checked at 47f672e (read only): the counter is QUEUED_BUILDS and the PR now merges into main 930e8b4 with a single BUILDING (the thread-local), the count tests run under COUNT_TEST_LOCK, and the release check is exact. All three points are addressed.

Reply by Claude Code (Claude Opus 5.5); checked by a person before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7136737139 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1168#issuecomment-7136737139). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-24T15:51:44Z. --- Thanks. Checked at `47f672e` (read only): the counter is `QUEUED_BUILDS` and the PR now merges into `main` `930e8b4` with a single `BUILDING` (the thread-local), the count tests run under `COUNT_TEST_LOCK`, and the release check is exact. All three points are addressed. Reply by Claude Code (Claude Opus 5.5); checked by a person before posting.
DavidM1911 commented 2026-11-25 08:08:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T07:46:54Z.


Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7156245061 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1168#issuecomment-7156245061). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T07:46:54Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
throny commented 2026-11-25 10:10:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-25T09:20:31Z.


Test report for exact head ad5ff40.

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, title runs in release.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 on ad5ff40 as it is (its own base): 876 passed, 0 failed, 42 ignored. SKIPPED: 4 lines (no wave64 on this adapter, and the like).
  • scripts/smoke.ps1, the retail title, 60 s, release builds, main 568e7db first, then this head:

main:

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1607 (PresentX 1607)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15820 MB

PR:

xcl-smoke v1
commit: ad5ff4058ad8f4b64eea4702fe342de6598628e7
gpu: NVIDIA GeForce RTX 4080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1604 (PresentX 1604)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15833 MB

Not tested: AMD, the head merged onto current main, a world load.

AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.

<!-- greyfinch-sync:ivall/xcl:comment:7158200206 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1168#issuecomment-7158200206). Originally posted by [throny](https://github.com/throny) on 2026-11-25T09:20:31Z. --- Test report for exact head `ad5ff40`. **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, title runs in release. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` on `ad5ff40` as it is (its own base): **876 passed, 0 failed, 42 ignored**. `SKIPPED`: 4 lines (no wave64 on this adapter, and the like). - `scripts/smoke.ps1`, the retail title, 60 s, release builds, `main` `568e7db` first, then this head: main: ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: NVIDIA GeForce RTX 4080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1607 (PresentX 1607) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15820 MB ``` PR: ``` xcl-smoke v1 commit: ad5ff4058ad8f4b64eea4702fe342de6598628e7 gpu: NVIDIA GeForce RTX 4080 title: retail-title seconds: 60 exit: 0x0 frames shown: 1604 (PresentX 1604) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15833 MB ``` **Not tested:** AMD, the head merged onto current `main`, a world load. AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.
eizispark commented 2026-11-25 12:06:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by eizispark on 2026-11-25T11:45:23Z.


Rebased onto main 426a5a7 as 532ee56 (thanks @DavidM1911 for flagging the conflict, and @throny for the RTX 4080 run on ad5ff40).

The conflict came from #972's a_released_queued_pipeline_is_not_built_by_normal_workers (b4d7482), which was added in the same spot as this PR's test. Both are kept. That test now takes COUNT_TEST_LOCK, because it fills every normal worker and holds a stand-in in flight, which would throw off this PR's counts() checks if the two ran together. The accounting still holds with the new orphan skip in queue(): released() already calls finish_queued() before a worker can drop the job.

On the RX 9070 XT: pso_async, 5 runs × 9 tests, all passed. Full workspace: 1241 passed; the 3 failures also fail on a clean main 426a5a7 here. New smoke pair in the description: 1680 frames on main, 1678 on the PR.

<!-- greyfinch-sync:ivall/xcl:comment:7161457651 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1168#issuecomment-7161457651). Originally posted by [eizispark](https://github.com/eizispark) on 2026-11-25T11:45:23Z. --- Rebased onto `main` `426a5a7` as `532ee56` (thanks @DavidM1911 for flagging the conflict, and @throny for the RTX 4080 run on `ad5ff40`). The conflict came from #972's `a_released_queued_pipeline_is_not_built_by_normal_workers` (`b4d7482`), which was added in the same spot as this PR's test. Both are kept. That test now takes `COUNT_TEST_LOCK`, because it fills every normal worker and holds a stand-in in flight, which would throw off this PR's `counts()` checks if the two ran together. The accounting still holds with the new orphan skip in `queue()`: `released()` already calls `finish_queued()` before a worker can drop the job. On the RX 9070 XT: `pso_async`, 5 runs × 9 tests, all passed. Full workspace: 1241 passed; the 3 failures also fail on a clean `main` `426a5a7` here. New smoke pair in the description: 1680 frames on main, 1678 on the PR.
eizispark commented 2026-11-25 12:06:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by eizispark on 2026-11-25T11:51:09Z.


Main moved again a few minutes after the rebase (#1782 added its PcCalls tests to used_tests right next to COUNT_TEST_LOCK), so this is now 0840ff5 on top of main 1a0bbe3. Both are kept and nothing else changed. pso_async: 5 runs × 11 passed. Full workspace: 1249 passed; the 2 DXIL fuzz failures also fail on a clean main here. The new smoke pair is in the description (1679 frames on the PR, 1680 on main).

<!-- greyfinch-sync:ivall/xcl:comment:7161583099 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1168#issuecomment-7161583099). Originally posted by [eizispark](https://github.com/eizispark) on 2026-11-25T11:51:09Z. --- Main moved again a few minutes after the rebase (#1782 added its `PcCalls` tests to `used_tests` right next to `COUNT_TEST_LOCK`), so this is now `0840ff5` on top of `main` `1a0bbe3`. Both are kept and nothing else changed. `pso_async`: 5 runs × 11 passed. Full workspace: 1249 passed; the 2 DXIL fuzz failures also fail on a clean `main` here. The new smoke pair is in the description (1679 frames on the PR, 1680 on main).
DavidM1911 commented 2026-11-26 01:05:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:26:37Z.


Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7178761573 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1168#issuecomment-7178761573). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T00:26:37Z. --- Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.
Prime1997 commented 2026-11-26 13:16:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-26T13:16:07Z.

Review: COMMENTED


Exact reviewed head: 0840ff5a690c564caf808b7feecd8211f02aeded.

Needs an atomic accounting fix; the dormant-versus-queued distinction is useful. Pending::note_queued first changes IDLE to QUEUED, then increments QUEUED_BUILDS. The submission path holds PENDING, but resolve obtains its Arc and releases that lock before calling note_queued.

A valid interleaving is: the count is zero; resolve successfully marks the pending entry QUEUED and pauses; another thread removes it through released, whose finish_queued swaps DONE and subtracts one; counts() then reads usize::MAX; finally the delayed increment returns the count to zero. The final value is correct, but the window title/report can observe an enormous queued count. Acquire/release ordering on the per-entry state does not make the later counter update part of that transition.

Please make publication of the queued state and its count consistent with completion/release, and add a controlled interleaving test. Existing sequential accounting tests do not exercise this gap. Source locations at this exact head: pso_async.rs:120–129, 863–875, 1019–1025, 1047.

Validation: independently checked the actual resolve/release lock scopes and atomic ordering; no native race test was run. Current-main integration also needs a rebase. This is separate from the older BUILDING-name collision already fixed by this revision.

AI use: Codex (GPT-6) reviewed the source and checked the stated evidence. Optional temporary Discord for coordinating contributor work, testing and comparing results.

<!-- greyfinch-sync:ivall/xcl:review:6074766800 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1168#pullrequestreview-6074766800). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-26T13:16:07Z. **Review:** COMMENTED --- Exact reviewed head: `0840ff5a690c564caf808b7feecd8211f02aeded`. **Needs an atomic accounting fix; the dormant-versus-queued distinction is useful.** `Pending::note_queued` first changes `IDLE` to `QUEUED`, then increments `QUEUED_BUILDS`. The submission path holds `PENDING`, but `resolve` obtains its `Arc` and releases that lock before calling `note_queued`. A valid interleaving is: the count is zero; resolve successfully marks the pending entry QUEUED and pauses; another thread removes it through `released`, whose `finish_queued` swaps DONE and subtracts one; `counts()` then reads `usize::MAX`; finally the delayed increment returns the count to zero. The final value is correct, but the window title/report can observe an enormous queued count. Acquire/release ordering on the per-entry state does not make the later counter update part of that transition. Please make publication of the queued state and its count consistent with completion/release, and add a controlled interleaving test. Existing sequential accounting tests do not exercise this gap. Source locations at this exact head: `pso_async.rs:120–129`, `863–875`, `1019–1025`, `1047`. **Validation:** independently checked the actual resolve/release lock scopes and atomic ordering; no native race test was run. Current-main integration also needs a rebase. This is separate from the older BUILDING-name collision already fixed by this revision. AI use: Codex (GPT-6) reviewed the source and checked the stated evidence. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating contributor work, testing and comparing results.
Foniass commented 2026-12-01 04:58:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:58:20Z.


Triage (#1607) – head 0840ff5

Main commit b11f4df ("D3D12.X: count queued pipeline builds without a frame scan") adapts this PR's idea to the current coalesced build model and credits #1168: Pending::note_queued / finish_queued with an idle/active/done state and a global QUEUED_BUILDS, and pso_async::counts() on main returns QUEUED_BUILDS instead of scanning PENDING. The #894 counting fix is therefore on main; this branch no longer applies to the rewritten pso_async.rs.
Recommendation: close (superseded by main commit b11f4df).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7301289519 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1168#issuecomment-7301289519). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:58:20Z. --- **Triage (#1607)** – head 0840ff5 Main commit b11f4df ("D3D12.X: count queued pipeline builds without a frame scan") adapts this PR's idea to the current coalesced build model and credits #1168: `Pending::note_queued` / `finish_queued` with an idle/active/done state and a global `QUEUED_BUILDS`, and `pso_async::counts()` on main returns `QUEUED_BUILDS` instead of scanning `PENDING`. The #894 counting fix is therefore on main; this branch no longer applies to the rewritten `pso_async.rs`. Recommendation: close (superseded by main commit b11f4df). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 12:43:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:43:23Z.


Closing as superseded: this change is already on main (b11f4df1). main pso_async.rs has QUEUED_BUILDS with note_queued/finish_queued/mark_queued state accounting and counts() returns it; same accounting as the PR (tracked-only variant)

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311551539 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1168#issuecomment-7311551539). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:43:23Z. --- Closing as superseded: this change is already on `main` (b11f4df1). main pso_async.rs has QUEUED_BUILDS with note_queued/finish_queued/mark_queued state accounting and counts() returns it; same accounting as the PR (tracked-only variant) Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

Pull request closed

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!1159
No description provided.