Repository navigation
GPU: hold a present with no flip wait since the last one to its flip tick (intro movie judder) - #457
Open
GamingRipperDoc wants to merge 1 commit into
Open
GamingRipperDoc wants to merge 1 commit into
GamingRipperDoc wants to merge 1 commit into
Conversation
This was referenced Nov 25, 2026
…tick The title polls the frame origin with "token on time-out" and normally waits for the flip before each present. When its movie player falls behind, it presents a frame begun early without that flip wait. The console flips such a frame on the next flip tick; we presented it at once, so it stayed on screen ~5 ms and its neighbours twice as long: the intro movie juddered through its first seconds (27 such presents in 5 s, each followed by a present with no new movie frame). before_present() now holds such a present until the next flip tick and takes that tick, so each present still gets one tick. Presents after a flip wait (every frame in normal play, and slow world frames) are not delayed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GamingRipperDoc
force-pushed
the
flip-pacing
branch
from
November 26, 2026 06:26
af08b20 to
2fd1402
Compare
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.
The intro movie judders through its first seconds. Root cause: the title's catch-up presents are shown at once instead of on their flip tick.
What happens
The title polls the frame origin with "token on time-out" and normally waits for the flip before each present (
frame.rs's own notes). While the movie player is behind, right after playback starts, it begins a frame early and presents it without the flip wait. The console flips such a frame on the next flip tick, so the cadence stays even. VIctory hands every present to the host at once (Present(0, …)), so that frame stayed on screen ~5 ms and the frames around it twice as long.Measured on the intro movie with per-present logging and a local check of the movie's texture buffers (the 8 MB luma + 2 × 2 MB chroma, three sets in rotation), over the same ~15 s:
Every extra present came right after an origin poll that timed out (
frame wait kind=0 timeout_ms=0 flags=2 hr=1) with nokind=2wait before it; the next present then had no new movie frame. Background shader translation was ruled out (none during those seconds), and the texture checks are exact (hash at submission).Change
frame::before_present(), called right before the hostPresent: if no flip wait has ended since the last present, it sleeps to the next flip tick and takes it (last(FLIP)), so each present still gets one tick and the next frame's flip wait lands after it. Presents after a flip wait, which is every frame in normal play, including slow world frames with this tree's early-ending waits, are not delayed. Two files, +47/−1.A test extends
waits_end_on_ticks_and_count_frames(the clock is global, so it stays in that test): a present after a flip wait takes no tick; a second present with no flip wait takes the next tick; the following flip wait lands after it. It failed before the change.Tested
Windows 10 22H2, AMD RX 9070 XT, Ryzen 9 9900X:
cargo test -p victory-gpu: 112 passed.cargo clippy --workspace --all-targets --locked [--all-features] -- -D warnings: clean.rustfmt --checkonframe.rs: clean.ffe310e+ Windows 10: the D3D12 Agility SDK runtime for victory.exe and the shader tests #420's Agility runtime + GPU: free host textures only after running submissions, and make them on first use Marvisak/VIctory#431, GPU: give table slots without a view a null descriptor of the kind the shader reads Marvisak/VIctory#568 and GPU: implement CopyTextureRegion texture-to-buffer readbacks Marvisak/VIctory#67), whereframe.rsmatches this tree's except for the early-ending waits; the patch applied there unchanged.No game data used.
AI-assisted (Claude Code); I watched both runs and the logs were read with the model.