Repository navigation
Conversation
Two descriptor tests set a global hook that runs while a view's texture is prepared, and any test preparing a view took it. With tests running in parallel, one test could take or replace the other's hook: the work then never ran where it was meant to, and views_bound_while_another_slot_gets_ its_texture_do_not_wait failed with "both made". It failed that way in CI on three unrelated pull requests (Marvisak#2310 and two others) within a day. The hook is now thread-local: set and taken on the test's own thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… this branch hit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Code review and parallel stress verification at head
LGTM. |
Dukestar69
left a comment
There was a problem hiding this comment.
Tested merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090):
cargo test -p victory-gpu --lib descriptor::host::tests -- --skip dynamic_slots_are_held_until_released: 14 passed, 0 failed (parallel run;dynamic_slots_are_held_until_releasedskipped due to pre-existing NVIDIA 1M view-heap cap#1744).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Moving WHILE_PREPARING from a global Mutex to a thread_local! RefCell cleanly eliminates cross-test stealing of the prepare hook during parallel test runs.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
|
This is the same change as #2585, opened 2026-11-25 16:16 UTC and triaged as a merge candidate at That PR has parallel-run numbers for both tests: 22/200 → 0/200 runs failing on an RTX 3080, and 7/150 → 0/150 on WARP from @oni-swr. Linking the two so only one needs to land. |
kotekompotek
left a comment
There was a problem hiding this comment.
Verified: this fixes a real flake class — parallel tests could take each other's queued prepare-work, leaving the intended test unexercised and failing at random. thread_local keeps the once-only semantics per test thread, and on_prepare/prepare_pending helpers keep call sites tidy. Consistent with the earlier thread_local conversion of the other WHILE_PREPARING.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
views_bound_while_another_slot_gets_its_texture_do_not_waitfails at random in CI withboth made. In the last 25 failed runs it did on three unrelated PRs: #2310 (run),gpu/loose-window-reuse(run) andgpu/parallel-refresh(run).Cause: that test and
a_slot_rewritten_while_its_view_is_prepared_views_the_new_recordset a global hook (WHILE_PREPARING) that runs while a view's texture is prepared, and any test that prepares a view takes it. With tests in parallel, one test can take or replace the other's hook. The work then never runs where it was meant to, and the second slot is never made.Change: the hook is thread-local. It's set and taken on the test's own thread; the threads the work spawns don't see it. Test code only.
How it was found: the failing CI run on #2310 (which doesn't touch
descriptor/), then a search of the recent failed runs for the test name. Locally (Wine, vkd3d-proton 3.2.0, RTX 5080) it didn't reproduce in 25 parallel runs ofdescriptor::host, before or after; the race needs CI's timing. Clippy is clean.🤖 Generated with Claude Code