Skip to content

Frame pacing: try 60 when only the GPU's time at 30 holds the game there - #813

Open
peiikai wants to merge 2 commits into
release/0.6from
fix/811-pace-hold
Open

peiikai wants to merge 2 commits into
release/0.6from
fix/811-pace-hold

Conversation

@peiikai

@peiikai peiikai commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Fixes #811

What changed

runtime/nvn/pace.c: when the game is held in its 30 fps mode, the CPU has clear headroom, and only the GPU's time keeps the hold, the pacer now tries 60 after 10 s at 30 (times the backoff). The try has a hitch's grace, and its frames measure the GPU at 60:

  • If they fit, the game stays at 60.
  • If they don't, the game is held again with the backoff doubled, so the next try waits twice as long (up to 16x, 160 s).
  • A try that failed with the GPU over the limit at 60, and no slower at 30 (a GPU that keeps its clock), isn't repeated in that scene.

After a failed try, the hold's log line includes the GPU time measured at 60 (gpu N ms a frame at 60).

Why

In the reporter's logs (Ryzen 5 8600G / Radeon 760M, 2560x1440, Vulkan, Dynamic resolution off), entering Bottle Grotto set off the hold just after the level load's one-second grace. That happened in 2 of 3 runs. In the third, the slow loading frames fell inside the grace and it never held. Held, the GPU timer read 23.2 ms a frame, because an integrated GPU lowers its clock at half load. The way back needs the GPU under 15 ms, so it never came. The game stayed at 30 for the rest of the session, even back in the field, which had run at 58-60 a minute earlier. A restart ran the same dungeon at about 60. Without Dynamic resolution, nothing else looked for 60 from that hold.

Tests

  • tools/test_pace.py: 22 of 22. Two new FPS drops from 60 to 30 on 8600g (760m) #811 cases:
    • An iGPU at 14.5 ms at 60, held by a load tail, reading 23 ms at 30: it was held for good before this change. Now it tries 60 about 12 s after the hold and stays there.
    • An iGPU at 19 ms at 60 and 26 ms at 30: 3 failed tries in 120 s (13 s, 38 s, 82 s), ending held.
  • Compared with the old code, case by case, only the GPU-bound cases changed: GPU 20-25 ms with CPU headroom. Each gets one ~2.5 s try at 60, then stays held in that scene. Their checks now allow that one try. The iPad, edge, backoff, iPhone and CPU-bound cases are unchanged.
  • Not verified in game. The bug needs a GPU that lowers its clock at 30 and doesn't fit the limit there, which neither the Mac (Metal) nor our Windows test PC reproduces. A test build for the reporter would confirm it. The new log line will show their real GPU time at 60.

Backend: shared code (pace.c), the same on Metal and Vulkan.

Not changed here

The hold was set off by frames just past PACE_GRACE_NS after a level load. Giving level loads the render-scale change's "until frames settle" grace (at most 4 s) would keep this hold from starting at all. That's a separate change.

🤖 Generated with Claude Code

peiikai and others added 2 commits November 15, 2026 14:36
Issue #811: a Radeon 760M at 2560x1440 was held at 30 entering a dungeon
(its frames still heavy past the level load's second of grace). Held, it
read 23 ms of GPU time a frame - an integrated GPU clocks down at half
load - so the way back, which wants the GPU under 15 ms, never came:
30 fps until a restart, which ran the same dungeon at 60. Without
Dynamic resolution nothing else looked for 60 from there.

Now, once the CPU has had clear headroom for 10 s at 30 (times the
backoff) and only the GPU's time keeps the hold, 60 gets a try with a
hitch's grace. Its frames measure the GPU at 60: if they don't fit, the
game is held again with the backoff doubled (the next try waits twice
as long, up to 16x). A try that failed with the GPU over the limit at
60 and no slower at 30 (a GPU that keeps its clock) isn't repeated in
that scene. The hold line after a try logs the GPU time it saw at 60.

tools/test_pace.c: two #811 cases (a clocked-down iGPU that fits 60,
and one that doesn't), and the GPU-bound cases' checks allow their one
failed try.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant