Timeline test: a contended lock's waits are counted together (failed 1 run in 10 under load) #598
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/598"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T01:43:54Z.
The problem
timeline::report::tests::real_waits_are_recorded_with_who_ended_themsometimes fails under load. It is only built with thediagnosticsfeature (cargo test -p victory-gpu --all-features), so CI never runs it. The failing check is its last one:No wait of the second thread lasting 10 ms or more had a waker. With eight test processes at once (each running this test 15 times) it failed in 13 of 120 runs. I found two causes.
The 20 ms hold was counted from the spawn. The test holds the lock for 20 ms counted from the spawn of the second thread. On a busy processor that thread began late and found the lock nearly free.
One lock wait came out as several.
WaitOnAddressreturns now and then with no wake, and std's lock waits again. A failing run, printed with a temporary log:It happened when the test ran beside
watch::many_askers_tests::no_write_is_lost_when_faults_take_no_lockin one process, as it does incargo test.The change
Only the test changes, in
crates/victory-gpu/src/timeline/report.rs:The recorder and the report are unchanged. A follow-up could join a thread's back-to-back waits on one object in the report itself, so the chains show one wait.
Tests
watchtest above.cargo test -p victory-gpu --all-features --locked --lib: 487 passed. The 2 failures were the indirect tests that then failed onmain;mainhas fixed them since (9b712a6).cargo clippy -p victory-gpu --all-targets --all-features -- -D warningsfinds nothing in this file. It still stops on the lintsmainhas.No game files, dumps or extracted data are included.