Repository navigation
GPU tests: two tests CI runners failed hold on a loaded host - #2861
0xkn0wh3r3 wants to merge 1 commit into
Conversation
`frame::tests::waits_end_on_ticks_and_count_frames` ran 2 ms ticks and expected a wait with no time to wait to time out right after a tick: a runner woken a tick late found the next tick passed (CI, Marvisak#2085). It uses 50 ms ticks, as the test's second part already does for the same reason. `views_bound_while_another_slot_gets_its_texture_do_not_wait` and `a_slot_rewritten_while_its_view_is_prepared_views_the_new_record` set work for the next view prepared, in a static every test shares: another test preparing a view of its own meanwhile took it (CI, Marvisak#2051). The work is now per thread; both tests prepare on their own thread.
kotekompotek
left a comment
There was a problem hiding this comment.
Right fix for the CI flake: WHILE_PREPARING as a global Mutex meant whichever parallel test hit prepare first consumed the injected work — a test preparing its own view ran another's closure and both misbehaved. thread_local makes the hook per-test-thread, matching how cargo test parallelizes. LGTM.
fuzeofficlal
left a comment
There was a problem hiding this comment.
Verified head b6702963 cleanly merged onto origin/main (63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP + VICTORY_D3D12_DEBUG=1).
Code Review & Cross-PR Note
crates/victory-gpu/src/descriptor/host.rs: Moving the test hookWHILE_PREPARINGfrom a process-wideMutex<Option<Work>>tothread_local! { RefCell<Option<Work>> }eliminates a genuine cross-test concurrency race when parallel GPU tests invokeHostHeap::mirror.crates/victory-gpu/src/frame.rsoverlap with#2877: Widening the2 ms/50 mstolerances to50 ms/250 mstouches the same test that#2877refactors onto a deterministic virtual clock (struct Pacer). If#2877lands first, theframe.rsportion here is superseded, while thedescriptor/host.rsthread_local!fix remains independently valuable.
Local Verification (VICTORY_D3D12_DEBUG=1, 5 consecutive rounds)
- RTX 5090:
descriptor::host::tests(skipping pre-existing 1M cap baselinedynamic_slots_are_held_until_released) 14/14 x 5 rounds,frame::tests2/2 x 5 rounds. - WARP:
descriptor::host::tests15/15 x 5 rounds,frame::tests2/2 x 5 rounds. cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--features diagnostics) &cargo xtask policy(191 files ok): clean.
|
@fuzeofficlal thanks for the five rounds on both adapters. Agreed on #2877: if its virtual clock lands first, the |
|
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Automated triage for the maintainers. Thanks. Nothing has changed since the last review (same head). It stays a merge candidate, and the Generated by Claude Code |
|
Thanks for the runs. On the overlap with #2877: its virtual clock is the better fix for |
Dukestar69
left a comment
There was a problem hiding this comment.
Verified on RTX 5090 against origin/main (63bcca4):
cargo test -p victory-gpu --lib descriptor::host::tests::views_ -- --test-threads=1: 2/2 passed.cargo test -p victory-gpu --lib frame:: -- --test-threads=1: 2/2 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Cleanly hardens both timing-sensitive CI tests against loaded host scheduling jitter.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Problem
Two GPU tests fail on CI runners now and then, on changes that don't touch them:
frame::tests::waits_end_on_ticks_and_count_frames(frame.rs:231, failed on Shaders: pixel programs the console tests depth before keep early depth #2085's run). Its first part runs 2 ms ticks and expects a wait with a zero time-out to time out right after a wait returned on a tick. A runner woken a little late finds the next tick has already passed and getsS_OK.descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait(descriptor/host.rs:2011, failed on GPU: a submission's refreshes copy on several threads #2051's run). It anda_slot_rewritten_while_its_view_is_prepared_views_the_new_recordhand the next view prepared some work throughWHILE_PREPARING, a static every test shares. Another test preparing a view of its own at the same time takes the work, so the test's own view is made without it.Change
WHILE_PREPARINGis per thread (thread_local!). Both tests callmirroron their own thread, which is whereprepareruns the work, and the thread each one spawns can't take it.Tests only; no runtime code changes.
Testing
On an RTX 5070 Ti:
cargo test -p victory-gpu --lib8 times in a row, plus the three tests alone 10 times. None of them failed. The only failures weredynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views, which fail onmainon NVIDIA (#1835's heap cap). Clippy, with and withoutdiagnostics, andcargo xtask policyare clean.