Tests: serialise the pipeline tests that store into the library builder #3221
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3221"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-28T21:28:19Z.
Build and test (Windows, no GPU)fails at random on main: onbeeb81be,shaders::pipeline_library::tests::builder_deduplicates_names_and_atomically_replaces_outputcounted 3 entries where it stored 2 (pipeline_library.rs:414). Three more tests then failed on the poisonedBUILD_TESTlock. The same tree passed in another run.Cause: the library builder is one per process, and while it is begun, every pipeline
Pipelines::make*creates is stored into it (make_required→pipeline_library::store). The library tests holdBUILD_TESTwhile they begin, store and finish, but three tests that make pipelines throughPipelinesdid not take it. When one of them ran beside the builder test, its pipelines went into that test's library. On beeb81be's CI run, the failure came right aftersplit_compute_program_prebuilds_and_caches_chain_piecesfinished.This is a test-only change: no runtime code changes.
What is in it
crates/xcl/src/shaders.rs:stale_blob_cannot_bypass_the_offline_pipeline_cap,split_compute_program_prebuilds_and_caches_chain_piecesandpso_measurement_compiles_an_exact_synthetic_recordholdBUILD_TEST.shaders.rs,shaders/pipeline_library.rs,shaders/warm_library.rs: everyBUILD_TESTholder takes the lock even when it is poisoned. A test that panics while holding it then fails alone, instead of failing the tests queued behind it (on CI, one cause showed up as four failures).Tested
cargo test -p xcl --lib -- --test-threads=4(DXC 1.9.2609) at the head: 2455 passed, 0 failed, 29 ignored; 25 SKIPPED lines.XCL_ADAPTER=warp cargo test -p xcl --lib -- shaders:: --test-threads=4 --nocapture, 5 runs): the 6pipeline_libraryand 4pipeline_cap_teststests passed in all 5.pso_measurement_compiles_an_exact_synthetic_recordfails on this machine's WARP, alone too (CreateComputePipelineState run 1: The parameter is incorrect), while it passes on CI's WARP. With the poison-tolerant lock, that failure no longer takes downcold_publish_makes_an_unchanged_corpus_reusable, as it did with the lock alone.shaders::runs on the GPU all passed on main's tree. The cause comes from the code path and CI's test order, not from a local failure.Regression run
crates/xcl/src, so it needs thetest-onlylabel.Not tested
-p xcl --lib, the target the change touches).AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T23:26:21Z.
Review: APPROVED
Approving on a merge-check run on an RTX 3060 Ti 8 GB (driver 32.0.16.1714, i5-10400, Windows 11 Pro 26200, Rust 1.100.0).
2c003dd6ac4bde876cd6c24cadc479ffcfa8e039merged cleanly ontomain7db2f391, and the workspace builds.cargo test -p xcl --lib -- --test-threads=4 shaders::three times on the merge gave 63 passed, 0 failed each time (1 SKIPPED: no Windows Developer Mode). On plainmainthe same command failed the four pipeline-library tests in 2 of 3 runs.PR descriptioncheck is red on this head; that is about the description, not the diff.AI use: Claude Code ran the builds, tests and smoke on Prime's PC and wrote this text. Approving is Prime's decision.
I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord
Imported from ivall/xcl. Originally posted by Foniass on 2026-11-29T14:57:43Z.
Merge-check run and written with Claude Code (Claude Opus 5.5): a test merge onto the base above and the full suite on this machine. The 4
fuzz_validate_and_gpu_*failures happen on main on this machine too. Note: main's own CI run on3b6a91edfails on these same 4 pipeline_library / warm_library tests.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T15:12:40Z.
I checked the extra
pso_measurement_compiles_an_exact_synthetic_recordguard in2c003dd6, compared with #3183. The measurement body usesCreateComputePipelineStatedirectly. It does not callPipelines::make_required, which inserts into the process-wide builder.In a test instrumented to hold the replacement library open until the other test finished:
0x887A002D, so it checks entry count and does not measure cache-off compile time..chain.psokeys and finished with four entries instead of two. Restoring the guard gave two passing tests with zero skips. This is the same contributor that #3183 already covers.The stock measurement test skipped at cache preflight on both adapters. Forcing it past that check on WARP led to
E_INVALIDARGat pipeline creation even when run by itself, so the successful measurement-overlap control is scoped to the native RTX adapter.For the reproduced entry-count flake both PRs serialize the tested split-shader writer. I found no evidence that the extra measurement-test lock is needed for that count. This is the CI failure reported on the base of #3219 as well.
AI disclosure: OpenAI Codex (GPT-6.2 Sol) added the bounded test scheduling, ran these controls and drafted this comment.