Repository navigation
Conversation
What was wrong: `descriptor::host::tests::WHILE_PREPARING`, the hook that runs work while a view's texture is prepared, was one global for the test process. Every test that binds a view prepares one, and the suite runs tests in parallel, so the hook ran in whichever test prepared first, or another test replaced it before its own test's prepare ran. `a_slot_rewritten_while_its_view_is_prepared_views_the_new_record` then failed with "the slot views the record written last" (the rewrite never happened) and `views_bound_while_another_slot_gets_its_texture_do_not_wait` with "both made" (the other slot was never bound). What changed: the hook is thread-local. `prepare` runs on the thread that binds the view (`HostHeap::mirror`), so a test's hook runs in its own prepare and in no other test's. Test code only. Evidence: the full `cargo test -p victory-gpu --lib` binary, 200 runs each on Windows 10 (19045) and an RTX 3080: main 67e8ae1 had a failure of one of the two in 22 runs (13 and 11); with this change, none.
|
oni-swr verification — head Environment: Windows 11 Pro (26200), rustc 1.98.1, WARP only ( Commands / results
Review: test-only change. Overlap: no open PR changes the same hunks. #2547, #2558, #2543, #2542, #2541, #2483 also touch AI disclosure: this review and verification were done by Claude Code (Claude Sonnet 5.5), not a human reviewer. Comment-only; no code changed. |
|
Thanks, @oni-swr. Your 7/150 → 0/150 on WARP matches what I saw on hardware. On |
|
Automated triage for the maintainers. Merge candidate. This is a test-only fix for two flaky CI: Generated by Claude Code |
…own thread The CI test race fix this branch hit; it replaces Marvisak#2946, which duplicated it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two
victory-gputests added in 42ea09f fail intermittently when the suite runs in parallel (the default forcargo test):descriptor::host::tests::a_slot_rewritten_while_its_view_is_prepared_views_the_new_record: "the slot views the record written last"descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait: "both made"Each passes when run alone.
Cause
Both tests install work in
WHILE_PREPARING, whichprepareruns once. It was one global for the whole test process. Every test that binds a view callsprepare, so with tests running in parallel:preparecan take the hook first, so the work runs inside that test instead, orprepareruns, so this test runs the other one's work.Either way, the concurrent write (or bind) the test checks for never happens, and its assertion fails.
Change
WHILE_PREPARINGis now thread-local.prepareruns on the thread that binds the view (HostHeap::mirror), so each test's hook runs in its ownprepareand nowhere else. The two tests set and check it viaset/with_borrow. This is test code only; nothing outside#[cfg(test)]changes.WHILE_MAKINGis left alone, because it already only runs for its own slot.Testing
Windows 10 Pro 22H2 (19045), RTX 3080 (driver 617.42), Rust 1.98.1 MSVC, base
67e8ae1. The fullvictory-gpulib test binary was run 200 times in a row with default parallelism:main67e8ae1a_slot_rewritten_…13,views_bound_…11)The other failures on this machine are unchanged in both builds and unrelated. They happen in every run:
dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views(NVIDIA's view heap cap,FIND-9), plusa_texture_written_in_one_format_reads_in_another_through_a_placed_view(Windows 10 has noID3D12Device10, #1999).cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean, also with--all-featurescargo xtask policy:184 files okClaim: #1633 (comment)