Repository navigation
Tests: a tick between the origin polls' zero-time-out asks is asked again - #3080
kotekompotek wants to merge 1 commit into
Conversation
…gain waits_end_on_ticks_and_count_frames polls the origin with a zero time-out twice in a row; a wait only times out while the next 2 ms tick is not due, and a host that wakes the thread a whole tick late between the asks (seen in CI: left S_OK, right TIMEOUT) makes the second one succeed. Each ask now retries until one really does time out; a hit takes its tick, so the retry sees the following tick a whole interval out. Frame tokens a boundary hit took are counted in the asserts. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Independent verification for my claim #1633 (comment). Test report only; no source review. Disclosure: checks run by Claude Code (Claude Sonnet 5.5), coordinated by Codex (gpt-6.2-sol). Tested: PR head
Failure sites:
Conclusion: reproducible, not a one-off flake. The parent's zero-time-out assertion fails often under CPU contention, and the head removes most of it (moderate load: 25/40 to 37/40; heavy load: 1/60 to 20/60). Idle runs were clean in both. The remaining head failures under load come from the PR's retry bound (heavy load only) and from the separate 10 ms elapsed-time assertion, which also fails at the parent. They are timing-sensitive tests under artificial contention, not evidence of a logic regression. I did not test CI-like conditions. Scratch worktree, binaries and cargo target directory were removed afterwards. |
|
Automated triage for the maintainers. Merge candidate. Test-only fix for a real flake in Generated by Claude Code |
Dukestar69
left a comment
There was a problem hiding this comment.
Verified against origin/main (63bcca4):
cargo test -p victory-gpu --lib frame:: -- --test-threads=1: 2/2 passed (waits_begun_together_take_different_ticksandwaits_end_on_ticks_and_count_frames).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Cleanly removes the timing flake when a tick lands between zero-timeout origin polls.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
fuzeofficlal
left a comment
There was a problem hiding this comment.
Verified 5a4f4697 locally on Windows 11 x64:
cargo clippy --all-targets --locked -- -D warnings: clean (3.38s).cargo test -p xtask --locked policy::tests::repository_passes_policy: 1 passed, 0 failed (0.34s).cargo test -p victory-gpu --lib --locked frame::: 2 passed, 0 failed (0.31s), plus20/20consecutive runs (6.92s) and40/40across 8 concurrent workers on the compiled test binary. Production code (frame.rs:1-215) is unchanged.
One test-assertion gap in timed_out(TOKEN_ON_TIMEOUT, &mut early) (crates/victory-gpu/src/frame.rs:236-251): passing the same &mut early across retries can mask a timeout-token regression. Because wait also writes *token on S_OK (frame.rs:156-162), if an earlier retry hits a due tick (S_OK) and updates early, and the next call returns TIMEOUT without writing *token, early keeps the S_OK value and the subsequent early > second && next == early + 1 assertions still pass.
Please reset *token = 0 (or record current() before each attempt) so the test directly asserts that the specific TIMEOUT call itself wrote the incremented frame token (and that the flags == 0 TIMEOUT left *token untouched).
|
NVIDIA full-suite run, to go with the reports above by Dukestar69, fuzeofficlal, oni-swr, since none of them names a GPU run. Tested exact head Tested
Not tested
AI use
|
|
Fresh Windows MSVC CI evidence for the zero-timeout origin poll: on main Failing job: https://github.com/Marvisak/VIctory/actions/runs/45850563859/job/140015510444 . App tests and both Clippy configurations passed before the workspace stopped at this frame test (230 GPU tests passed, 1 failed, 1 ignored). This appears to be the same live-clock zero-poll assumption addressed here, rather than a save migration failure. Reporting the existing CI result only; no duplicate implementation or new GPU test run. AI-assisted triage with Codex. |
Summary
CI on #2810 failed
frame::tests::waits_end_on_ticks_and_count_framesatframe.rs:235(left: S_OK, right: TIMEOUT) — a flake, not that PR's change (it only toucheshost.rscopy ordering; this test passed at its previous head).The test polls the origin with a zero time-out twice in a row (lines 231 and 235). A wait only times out while the next tick is not due, and the interval here is 2 ms — a host that wakes the thread a whole tick late between the two asks makes the second one return
S_OK. Probability per run is the inter-ask gap over the interval, which a loaded CI runner can hit.early == second + 1becomesearly > second: a boundary hit takes a frame token too, so a retry may have bumpedearly/secondfurther. The consecutive-token invariant (next == early + 1) and the timeout-token semantics are preserved.The second half of the test (50 ms flip ticks, unbounded waits) is unaffected.
Test plan
cargo test -p victory-gpu frame::— both frame tests passcargo clippy -p victory-gpu --all-targets -D warningscleanGenerated with Devin