Tests: serialise the stale-blob pipeline test with library builds #3183

Merged
tiagonleal merged 1 commit from upstream-pr/3183 into main 2026-12-02 17:39:38 +00:00
tiagonleal commented 2026-11-28 16:32:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-28T16:32:44Z.


Part of #3180. #3221 (merged on 29 Nov) already serialises the tests this PR used to lock and made the lock poison-tolerant, so those parts are dropped. The branch is now one commit of two lines.

What is left: a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced makes two pipelines through Pipelines::make_with_cache_path, and every successful make reaches pipeline_library::store. The test did not hold BUILD_TEST. When it overlaps a locked test that has a library build active, its pipeline lands in that test's library and the entry count is one too high. This is the class of intermittent failure listed in #3180.

It is the only test in the lib test binary that reaches store without the lock. I checked this by reading the callers of the make* functions: the other makes are in tests that already hold BUILD_TEST, the pipeline_library tests that do not lock use NativeLibrary directly, and the two-pass test in real.rs returns before store.

What is in it

  • shaders.rs: that test takes BUILD_TEST (poison-tolerant, as the other tests do) at its start
  • +2/-0, one file, inside #[cfg(test)]

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0, debug
  • cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 on head c3d1bd7d: 2841 passed, 0 failed, 51 ignored (24 SKIPPED lines: 22 no wave64, 2 no heap windows; the same 24 in both logs). main f97120dc on the same machine: 2841 passed, 0 failed, 51 ignored.

Regression run
scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e (a retail title), release builds of both commits, main f97120dc and this PR's head c3d1bd7d, one run each. A second run of main after the PR runs gave 1680 frames.

main (f97120dc):

xcl-smoke v1
commit: f97120dc196ca05e7f47e919d3675f7d5a2b478a
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1635 (PresentX 1635)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15366 MB

This PR (c3d1bd7d):

xcl-smoke v1
commit: c3d1bd7d554ade974f47981d17d1160d3c3a250d
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1659 (PresentX 1659)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15789 MB

Not tested

  • No test that fails without the change. It needs two tests to overlap in time on a GPU, which I cannot reproduce on demand.
  • AMD.
  • The retail title beyond the 60 s smoke. The diff is test-only (inside #[cfg(test)]) in a runtime file.

AI use

  • Claude Code with Claude Opus 5.5 wrote the change and Claude Fable 5.2 directed the diagnosis, ran the tests and wrote this description.
<!-- greyfinch-sync:ivall/xcl:issue:5542313428 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3183). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-28T16:32:44Z. --- Part of #3180. #3221 (merged on 29 Nov) already serialises the tests this PR used to lock and made the lock poison-tolerant, so those parts are dropped. The branch is now one commit of two lines. What is left: `a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced` makes two pipelines through `Pipelines::make_with_cache_path`, and every successful make reaches `pipeline_library::store`. The test did not hold `BUILD_TEST`. When it overlaps a locked test that has a library build active, its pipeline lands in that test's library and the entry count is one too high. This is the class of intermittent failure listed in #3180. It is the only test in the lib test binary that reaches `store` without the lock. I checked this by reading the callers of the `make*` functions: the other makes are in tests that already hold `BUILD_TEST`, the `pipeline_library` tests that do not lock use `NativeLibrary` directly, and the two-pass test in `real.rs` returns before `store`. **What is in it** - `shaders.rs`: that test takes `BUILD_TEST` (poison-tolerant, as the other tests do) at its start - +2/-0, one file, inside `#[cfg(test)]` **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0, debug - `cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4` on head `c3d1bd7d`: 2841 passed, 0 failed, 51 ignored (24 `SKIPPED` lines: 22 `no wave64`, 2 `no heap windows`; the same 24 in both logs). `main` `f97120dc` on the same machine: 2841 passed, 0 failed, 51 ignored. **Regression run** `scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e` (a retail title), release builds of both commits, `main` `f97120dc` and this PR's head `c3d1bd7d`, one run each. A second run of `main` after the PR runs gave 1680 frames. `main` (`f97120dc`): ``` xcl-smoke v1 commit: f97120dc196ca05e7f47e919d3675f7d5a2b478a gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1635 (PresentX 1635) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15366 MB ``` This PR (`c3d1bd7d`): ``` xcl-smoke v1 commit: c3d1bd7d554ade974f47981d17d1160d3c3a250d gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1659 (PresentX 1659) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15789 MB ``` **Not tested** - No test that fails without the change. It needs two tests to overlap in time on a GPU, which I cannot reproduce on demand. - AMD. - The retail title beyond the 60 s smoke. The diff is test-only (inside `#[cfg(test)]`) in a runtime file. **AI use** - Claude Code with Claude Opus 5.5 wrote the change and Claude Fable 5.2 directed the diagnosis, ran the tests and wrote this description.
andrewDoing commented 2026-11-28 21:35:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T21:35:42Z.


I reproduced the builder's 4 instead of 2 failure on Windows WARP and verified this PR's exact diff applies cleanly to merged main beeb81be. The #3219 hosted run saw 4, and its base run saw 3; both then failed the same three tests on the poisoned lock.

I selected the real builder_deduplicates_names_and_atomically_replaces_output and split_compute_program_prebuilds_and_caches_chain_pieces tests. A test-only handshake paused the owner after it opened its replacement library and let the split test reach its first pipeline builds. All waits were bounded. Each row used a fresh process, Ryzen 7 5700X3D, Windows 11, WARP software adapter, debug MSVC. No skips.

Revision Serial control Deliberately overlapping replacement and split build
Main beeb81be 2 passed 1 passed, builder failed with 4 entries instead of 2
Same main + #3183 diff from 78477c1b 2 passed 2 passed; the competing test observed the held BUILD_TEST guard before continuing

The stock overlap added exactly d64e5342b8bdf90a-cd4-0.chain.pso and dc6482d7869677a9-d50-0.chain.pso to the owner's library. With the guard applied, the schedule released the owner after observing that the waiter could not yet take the lock; the owner verified its two entries and the split test then finished. This supports the existing fix for this pair. No retail run or hardware-GPU result is claimed.

AI assistance: OpenAI Codex (GPT-6) prepared and ran the bounded schedule and drafted this note.

<!-- greyfinch-sync:ivall/xcl:comment:7246131958 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3183#issuecomment-7246131958). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-28T21:35:42Z. --- I reproduced the builder's **4 instead of 2** failure on Windows WARP and verified this PR's exact diff applies cleanly to merged main `beeb81be`. The [#3219 hosted run](https://github.com/xcl-dev/xcl/actions/runs/46190304830) saw 4, and its [base run](https://github.com/xcl-dev/xcl/actions/runs/46187703752) saw 3; both then failed the same three tests on the poisoned lock. I selected the real `builder_deduplicates_names_and_atomically_replaces_output` and `split_compute_program_prebuilds_and_caches_chain_pieces` tests. A test-only handshake paused the owner after it opened its replacement library and let the split test reach its first pipeline builds. All waits were bounded. Each row used a fresh process, Ryzen 7 5700X3D, Windows 11, WARP software adapter, debug MSVC. No skips. | Revision | Serial control | Deliberately overlapping replacement and split build | | --- | --- | --- | | Main `beeb81be` | 2 passed | 1 passed, builder failed with 4 entries instead of 2 | | Same main + #3183 diff from `78477c1b` | 2 passed | 2 passed; the competing test observed the held `BUILD_TEST` guard before continuing | The stock overlap added exactly `d64e5342b8bdf90a-cd4-0.chain.pso` and `dc6482d7869677a9-d50-0.chain.pso` to the owner's library. With the guard applied, the schedule released the owner after observing that the waiter could not yet take the lock; the owner verified its two entries and the split test then finished. This supports the existing fix for this pair. No retail run or hardware-GPU result is claimed. AI assistance: OpenAI Codex (GPT-6) prepared and ran the bounded schedule and drafted this note.
thehollowedone commented 2026-11-28 23:09:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T23:09:46Z.


Independent Windows/NVIDIA check of #3183 head 78477c1b, with db3921dc as its exact parent. Windows 11 build 26300, RTX 3080 Ti / NVIDIA 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC. I built the clean head first so the e2e title and DLL existed.

  • cargo build --offline --locked -j 4 --workspace: passed.
  • cargo test --offline --locked -j 4 -p xcl --lib shaders:: -- --test-threads=16: 53 passed, 0 failed, 0 ignored, 0 skips. This includes the builder test and both newly guarded shader tests.
  • cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4: 2,144 passed, 1 failed, 48 ignored across 39 test targets, with 25 explicit GPU SKIPPED notices counted among passes. All five e2e tests passed. The sole failure was console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (DXIL not compiled yet). I reran that test on the clean exact parent: 0 passed, 1 failed, 0 ignored, with the same error. The full local suite is therefore not green; this failure predates the PR.

I reviewed the test-only diff (6 added and 4 removed lines). The affected callers take BUILD_TEST before entering the process-global pipeline-library build; I found no reverse lock acquisition in these paths. The poison recovery prevents one assertion failure from cascading through the other library tests. This review and run do not measure retail startup or AMD/Intel behavior. The PR's hosted Windows and description checks are green.

AI use: Codex (GPT-6.2 Sol) reviewed the diff, checked the lock paths and ran these tests.

<!-- greyfinch-sync:ivall/xcl:comment:7247241919 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3183#issuecomment-7247241919). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T23:09:46Z. --- Independent Windows/NVIDIA check of [#3183 head `78477c1b`](https://github.com/xcl-dev/xcl/commit/78477c1bc5b4f4b40ad0dfba3d145a4ba37a805a), with [`db3921dc`](https://github.com/xcl-dev/xcl/commit/db3921dcc69a32be381a17b6a81c944617338c9f) as its exact parent. Windows 11 build 26300, RTX 3080 Ti / NVIDIA 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC. I built the clean head first so the e2e title and DLL existed. - `cargo build --offline --locked -j 4 --workspace`: passed. - `cargo test --offline --locked -j 4 -p xcl --lib shaders:: -- --test-threads=16`: **53 passed, 0 failed, 0 ignored, 0 skips**. This includes the builder test and both newly guarded shader tests. - `cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4`: **2,144 passed, 1 failed, 48 ignored** across 39 test targets, with 25 explicit GPU `SKIPPED` notices counted among passes. All five e2e tests passed. The sole failure was `console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` (`DXIL not compiled yet`). I reran that test on the clean exact parent: **0 passed, 1 failed, 0 ignored**, with the same error. The full local suite is therefore not green; this failure predates the PR. I reviewed the test-only diff (6 added and 4 removed lines). The affected callers take `BUILD_TEST` before entering the process-global pipeline-library build; I found no reverse lock acquisition in these paths. The poison recovery prevents one assertion failure from cascading through the other library tests. This review and run do not measure retail startup or AMD/Intel behavior. The PR's hosted Windows and description checks are green. AI use: Codex (GPT-6.2 Sol) reviewed the diff, checked the lock paths and ran these tests.
tiagonleal commented 2026-11-29 13:14:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-29T13:14:31Z.


@thehollowedone @andrewDoing thanks for both checks. The four tests this PR fixes went red again today on three CI runs of PRs that do not touch shader code: 46257764057 (#3190), 46260503226 (#570) and 46265260479 (#2858). Each time builder_deduplicates_names_and_atomically_replaces_output failed first and the other three followed.

This PR still merges into main without conflict and its checks are green, but the queue in #3041 shows it with no merge-check, because it only counts comments in the merge-check format with a verdict: line. If either of you is willing to repost your result in that format, that would let it move.

  • Tiago
<!-- greyfinch-sync:ivall/xcl:comment:7256391912 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3183#issuecomment-7256391912). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-29T13:14:31Z. --- @thehollowedone @andrewDoing thanks for both checks. The four tests this PR fixes went red again today on three CI runs of PRs that do not touch shader code: [46257764057](https://github.com/xcl-dev/xcl/actions/runs/46257764057) (#3190), [46260503226](https://github.com/xcl-dev/xcl/actions/runs/46260503226) (#570) and [46265260479](https://github.com/xcl-dev/xcl/actions/runs/46265260479) (#2858). Each time `builder_deduplicates_names_and_atomically_replaces_output` failed first and the other three followed. This PR still merges into `main` without conflict and its checks are green, but the queue in #3041 shows it with no merge-check, because it only counts comments in the `merge-check` format with a `verdict:` line. If either of you is willing to repost your result in that format, that would let it move. - Tiago
BBareth commented 2026-11-30 23:11:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T23:11:27Z.


merge-check claim
head: c3d1bd7d55

<!-- greyfinch-sync:ivall/xcl:comment:7294819596 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3183#issuecomment-7294819596). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T23:11:27Z. --- merge-check claim head: c3d1bd7d554ade974f47981d17d1160d3c3a250d
BBareth commented 2026-11-30 23:19:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T23:19:44Z.


merge-check
base: 86e86fcb33
head: c3d1bd7d55
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2889 passed, 0 failed, 51 ignored; 28 SKIPPED lines, as on the base; failing: none. The base alone, same run: 2889 passed, 0 failed, 51 ignored, 28 SKIPPED lines (22 no wave64, 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 cannot disable the driver cache). shaders::pipeline_cap_tests::a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced ran and passed.
review: no blocking finding; test-only, one file (+2/-0), read. The test takes pipeline_library::BUILD_TEST at its start, poison-tolerant like the tests that already hold it, and it takes no other test lock before it, so it adds no lock-order pair. I did not re-check the description's statement that this is the only test reaching store without the lock. The miscount this is for did not occur on the base in this run, so the run shows no regression, not the fix. No runtime code changes.
performance: none: tests only (one more test serialised with the library-build tests).
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.

<!-- greyfinch-sync:ivall/xcl:comment:7294987370 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3183#issuecomment-7294987370). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T23:19:44Z. --- merge-check base: 86e86fcb33f94fa5d0c809d9b50af7b84bf49cce head: c3d1bd7d554ade974f47981d17d1160d3c3a250d merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2889 passed, 0 failed, 51 ignored; 28 SKIPPED lines, as on the base; failing: none. The base alone, same run: 2889 passed, 0 failed, 51 ignored, 28 SKIPPED lines (22 no wave64, 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 cannot disable the driver cache). `shaders::pipeline_cap_tests::a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced` ran and passed. review: no blocking finding; test-only, one file (+2/-0), read. The test takes `pipeline_library::BUILD_TEST` at its start, poison-tolerant like the tests that already hold it, and it takes no other test lock before it, so it adds no lock-order pair. I did not re-check the description's statement that this is the only test reaching `store` without the lock. The miscount this is for did not occur on the base in this run, so the run shows no regression, not the fix. No runtime code changes. performance: none: tests only (one more test serialised with the library-build tests). verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
Foniass commented 2026-12-01 09:41:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:41:55Z.


Triage (#1607) – head c3d1bd7

#3221 (merged) serialised the other pipeline-library tests with BUILD_TEST; on main a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced in shaders.rs still does not take it, and this PR adds exactly that lock. #3190 and #3472 (same issue #3180) lock other tests in alloc_pool.rs / list_x.rs, not this one.
No problems found in the diff.
Recommendation: keep open.

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:7307075540 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3183#issuecomment-7307075540). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:41:55Z. --- **Triage (#1607)** – head c3d1bd7 #3221 (merged) serialised the other pipeline-library tests with `BUILD_TEST`; on `main` `a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced` in `shaders.rs` still does not take it, and this PR adds exactly that lock. #3190 and #3472 (same issue #3180) lock other tests in `alloc_pool.rs` / `list_x.rs`, not this one. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Foniass commented 2026-12-01 10:27:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:27:02Z.


merge-check
base: 493dbd3dd0
head: c3d1bd7d55
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2900 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+2, inside #[cfg(test)] in shaders.rs). a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced (~2207) now takes pipeline_library::BUILD_TEST (poison-tolerant), because its two Pipelines::make_with_cache_path calls reach pipeline_library::store and can land in another test's active library build, making that test's entry count one too high (#3180). I checked the other callers that reach store: the remaining tests either hold BUILD_TEST already (after #3221) or use NativeLibrary directly. Fine: nothing outside the test changes, and the lock matches the one the pipeline_library tests take (pipeline_library.rs ~156). No smoke run here: test-only.
performance: no smoke run (the default path doesn't reach this change); not measured. Test-only: no runtime path changes.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7308206854 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3183#issuecomment-7308206854). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T10:27:02Z. --- merge-check base: 493dbd3dd0cd50b4c3e8d28f73ab9b504fcd8158 head: c3d1bd7d554ade974f47981d17d1160d3c3a250d merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2900 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: read the whole diff (+2, inside `#[cfg(test)]` in `shaders.rs`). `a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced` (~2207) now takes `pipeline_library::BUILD_TEST` (poison-tolerant), because its two `Pipelines::make_with_cache_path` calls reach `pipeline_library::store` and can land in another test's active library build, making that test's entry count one too high (#3180). I checked the other callers that reach `store`: the remaining tests either hold `BUILD_TEST` already (after #3221) or use `NativeLibrary` directly. Fine: nothing outside the test changes, and the lock matches the one the `pipeline_library` tests take (`pipeline_library.rs` ~156). No smoke run here: test-only. performance: no smoke run (the default path doesn't reach this change); not measured. Test-only: no runtime path changes. verdict: safe to merge hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
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!3183
No description provided.