Frame pacing: honor title intervals under the default cap #250

Open
github-bot wants to merge 2 commits from github-bot/gh-250 into main AGit
Owner

@⁠loyodea on GitHub · 2026-11-26 12:40 UTC · original
loyodea:victory-opening-av-timing → main · +73 −21 · 1 files · 2 commits · open

Related to #59. The default 240 Hz cap previously replaced the title's cadence. Honor slower title requests and limit faster ones to 240 Hz. Explicit VICTORY_FPS overrides, uncapped mode, and token behavior stay as before.

Tested

  • The Windows regression reproduced a 33.333 ms request becoming 4.166666 ms. After the change all three focused frame tests passed.
  • A separate Windows harness exercised the production entry points and verified the default 33.333 ms interval, a 2 ms request capped at 4.166667 ms, an explicit 120 FPS override at 8.333333 ms, and uncapped waits.
  • The serial victory-gpu library suite reported 113 passed, one failed, and four ignored. Clean main 4f62c2a failed the same write-watch assertion.

The connection to the reported audio repeats, flicker, and subtitle overlap remains unverified. Codex helped implement and test this patch.

Review follow-up for the fixed FPS boundary

Fixed FPS conversion now stores a period of at least 1 ns, matching the minimum already used by the scheduler. The regression checks 1,000,000 FPS (1,000 ns), 1,000,000,000 FPS (1 ns), 1,000,000,001 FPS (1 ns), and u32::MAX (1 ns). On the previous revision the test failed at 1,000,000,001 FPS with a stored period of 0 ns. All four frame tests passed on Windows, including an independent rerun. Review thread

**@⁠loyodea** on GitHub · 2026-11-26 12:40 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/250) `loyodea:victory-opening-av-timing` → `main` · +73 −21 · 1 files · 2 commits · open Related to #59. The default 240 Hz cap previously replaced the title's cadence. Honor slower title requests and limit faster ones to 240 Hz. Explicit VICTORY_FPS overrides, uncapped mode, and token behavior stay as before. **Tested** - The Windows regression reproduced a 33.333 ms request becoming 4.166666 ms. After the change all three focused frame tests passed. - A separate Windows harness exercised the production entry points and verified the default 33.333 ms interval, a 2 ms request capped at 4.166667 ms, an explicit 120 FPS override at 8.333333 ms, and uncapped waits. - The serial victory-gpu library suite reported 113 passed, one failed, and four ignored. Clean main 4f62c2a failed the same write-watch assertion. The connection to the reported audio repeats, flicker, and subtitle overlap remains unverified. Codex helped implement and test this patch. ### Review follow-up for the fixed FPS boundary Fixed FPS conversion now stores a period of at least 1 ns, matching the minimum already used by the scheduler. The regression checks 1,000,000 FPS (1,000 ns), 1,000,000,000 FPS (1 ns), 1,000,000,001 FPS (1 ns), and `u32::MAX` (1 ns). On the previous revision the test failed at 1,000,000,001 FPS with a stored period of 0 ns. All four frame tests passed on Windows, including an independent rerun. [Review thread](https://git.gtahub.st/github/Belobug--VIctory-Belobug-AMD/pulls/250)
Limit faster title requests to 240 Hz while respecting slower ones. Preserve explicit FPS overrides, uncapped waits and frame tokens. Related to #59.

Co-authored-by: Codex <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:40:48 +00:00
Author
Owner

@⁠gut0to on GitHub · 2026-11-26 15:32 UTC · original · reviewed

AI-assisted static review; I inspected this diff and the added tests, but did not run tests or the game.

**@⁠gut0to** on GitHub · 2026-11-26 15:32 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/250#pullrequestreview-6076809926) · **reviewed** AI-assisted static review; I inspected this diff and the added tests, but did not run tests or the game.
@ -60,0 +74,4 @@
let minimum = Duration::from_nanos(1_000_000_000_u64.div_ceil(u64::from(DEFAULT_FPS)));
requested.max(minimum)
}
Pacing::Fixed(fps) => Duration::from_nanos(1_000_000_000 / u64::from(fps)),
Author
Owner

@⁠gut0to on GitHub · 2026-11-26 15:32 UTC · original

VICTORY_FPS accepts any positive u32, so values above 1,000,000,000 make this division return a zero-nanosecond interval and remove the intended pacing delay. Could the parser cap/reject those values (or enforce a minimum interval) and add a boundary test?

**@⁠gut0to** on GitHub · 2026-11-26 15:32 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/250#discussion_r4710486612) `VICTORY_FPS` accepts any positive `u32`, so values above 1,000,000,000 make this division return a zero-nanosecond interval and remove the intended pacing delay. Could the parser cap/reject those values (or enforce a minimum interval) and add a boundary test?
@ -60,0 +74,4 @@
let minimum = Duration::from_nanos(1_000_000_000_u64.div_ceil(u64::from(DEFAULT_FPS)));
requested.max(minimum)
}
Pacing::Fixed(fps) => Duration::from_nanos(1_000_000_000 / u64::from(fps)),
Author
Owner

@⁠loyodea on GitHub · 2026-11-26 18:53 UTC · original

Thanks for flagging this. Overrides above 1,000,000,000 FPS produce a zero Duration in frame_interval. next_tick already applies .as_nanos().max(1), so fixed pacing still uses a 1 ns interval. Applying that minimum at conversion would make it explicit and give the boundary a direct test.

**@⁠loyodea** on GitHub · 2026-11-26 18:53 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/250#discussion_r4712406064) Thanks for flagging this. Overrides above 1,000,000,000 FPS produce a zero `Duration` in `frame_interval`. `next_tick` already applies `.as_nanos().max(1)`, so fixed pacing still uses a 1 ns interval. Applying that minimum at conversion would make it explicit and give the boundary a direct test.
Cover the conversion boundary and clamp fixed FPS intervals to the scheduler minimum of one nanosecond. Follow-up to PR #250.

Co-authored-by: Codex <[email protected]>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/250/head:github-bot/gh-250'
git switch 'github-bot/gh-250'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-250'
git switch 'github-bot/gh-250'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-250'
git switch 'github-bot/gh-250'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-250'
git switch 'main'
git merge --squash 'github-bot/gh-250'
git switch 'main'
git merge --ff-only 'github-bot/gh-250'
git switch 'main'
git merge 'github-bot/gh-250'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.