Repository navigation
Port upstream #174: a frame wait takes its tick before it sleeps - #50
Merged
DesertGamer merged 2 commits intoNov 26, 2026
Merged
Conversation
frame::wait marked the tick it waited for as taken (LAST) only after the sleep, outside the clock's lock, so two threads waiting for one event kind at once both got the same tick and both returned on it, against the module's once-per-tick rule (an origin wait then begins two frames in one interval). next_tick now takes the tick under the clock's lock when the wait comes within its time-out; a time-out takes none, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 810f442)
The previous commit dropped the tick next_tick returns, but the diagnostics build's tracing::debug! still names it (E0425). Bind it again; it is unused without the feature, so that lint is allowed there. Reported by Sunkiller-qc and r4tedx. cargo check -p victory-gpu passes with and without --features diagnostics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 882664e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
This ports Marvisak/VIctory#174 by Manuel Pérez: both of its commits, cherry-picked with
-x, so they keep their authorship. The second commit is the author's follow-up, which keeps the tick for thediagnosticslog line.frame::waitincrates/viport-gpu/src/frame.rsmarks the tick it waited for as taken (LAST) only after the sleep, outside the clock's lock. Two threads waiting for the same event kind at once therefore both get the same tick and both return on it. That breaks the module's once-per-tick rule: an origin wait then begins two frames in one interval.The fix makes
next_ticktake the tick under the clock's lock when the wait comes within its time-out. A time-out takes no tick, as before. The new testwaits_begun_together_take_different_tickschecks this.VIPort has the upstream merge of #174 in its history, but the change is not in the tree. It was lost in a later merge. Both commits applied without conflicts.
Checked
docs/asset-policy.mdbuild.rs, git hook,.cargoconfig, CI change or script (or an issue explains why)cargo test --workspacepasses (not run, see below)cargo clippy --workspace --all-targets --locked -- -D warningspasses (Windows target, run on Linux, with and without--all-features)rustfmt; I did not reformat lines I did not changeWhat I ran
viport-gpubuilds only for Windows. On Linux, I compiled the clock part offrame.rs(everything above the tests, withtracingstubbed out) frommainand from this branch, each with the new test:main(the test calling the one-argumentnext_tick): fails with1 after 1. Two waits begun together get the same tick.cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, with and without--all-features: clean. The diagnostics build is what needs the second commit.Not run: the Windows test run of
viport-gpu, or the game. The CI test step will run the new test.Overlaps
None. No open PR touches
viport-gpu/src/frame.rs.🤖 Generated with Claude Code