Skip to content

iPhone: hold 30 fps while the device is thermally serious (thermal cap) - #212

Closed
v0lumehi wants to merge 2 commits into
seedds:mainfrom
v0lumehi:thermal-cap
Closed

v0lumehi wants to merge 2 commits into
seedds:mainfrom
v0lumehi:thermal-cap

Conversation

@v0lumehi

Copy link
Copy Markdown
Contributor

Part of #142: Breath of the Wild performance on iPhone and Mac. Start there to see how the PRs fit together and the merge order.

Based on main (5b0c11a). It doesn't depend on the other open PRs and merges cleanly onto the pipeline stack.

A steady 30 fps instead of dropped frames when the device is hot

When an iPhone reaches thermal state serious, iOS lowers the GPU clock to about a third. On the iPhone 17 Pro Max, the median of the frame's tiny passes goes from 6 µs to 22 µs. Breath of the Wild's vistas have about 3,000 G-buffer draws, and at that clock they take 17–26 ms of GPU time per frame. At a 60 fps target, most 300-frame windows then dropped frames, and the phone kept heating.

With this PR, the host's frame step holds 30 fps while the device is serious or critical (NSProcessInfo.thermalState ≥ 2):

  • It reads the thermal state once a second.
  • It goes back to the cap after the device has been fair or better for 30 s, so it doesn't flap at the boundary.
  • It logs both changes: thermal state 2: the frame step holds 30 fps until … and … back to the frame rate cap; the frame step's line names the reason (frame step cap 60 → 30 fps … (thermal state serious)).
  • DM_THERMAL_CAP=0 turns it off.
  • It only acts where the host runs the frame step (a game with an fps target). The Mac reports no thermal state, so nothing changes there.

A steady 30 is also the cheaper state, so the device has a chance to cool down.

Measured (iPhone 17 Pro Max, iOS 27.0.1, BotW docked)

Start What happened
Cold (thermal 0) Fair after 61 s, serious after 226 s, then the cap held 30 fps. Before serious: 13 + 5 dropped frames in two windows while the clock fell.
Warm (fair at launch) Serious after 64 s, then 30 fps.
Launched at serious 6 windows of 300 frames at 30 fps: 0 dropped, on-screen p99 33.34 ms.

Not observed yet: the way back to 60. In these runs the device didn't return to fair for 30 s.

Checked

  • Local CI-equivalent run: host tests, graphics CPU tests, every graphics test builds, dmhost for three profiles, the iOS compile check and the tool tests all pass.
  • With Breath of the Wild's profile: t_nvn (152 checks), t_fstep (51) and t_present_snap (13) pass.
  • No unit test drives the thermal state. The behaviour above comes from the device logs.
  • Docs: a reference entry in docs/reference/frame-rate.md (A thermally serious iPhone holds 30 fps), the symptom index, and the game's note.

@v0lumehi
v0lumehi marked this pull request as draft October 25, 2026 20:05
@v0lumehi
v0lumehi marked this pull request as ready for review October 25, 2026 20:05
…step holds 30 fps, and goes back to the cap after 30 s at fair or better (DM_THERMAL_CAP=0 turns it off; the Mac reports no thermal state). At serious iOS caps the GPU clock to about a third: Breath of the Wild's vistas (about 3,000 G-buffer draws) took 17-26 ms a frame and dropped frames in most 300-frame windows; a steady 30 also lets the device cool. Tests: t_nvn 152, t_fstep 51, t_present_snap 13, iOS compile check
… movie or thermal state serious; it said prerendered movie for both), and docs/reference/frame-rate.md has its entry (A thermally serious iPhone holds 30 fps), linked from Breath of the Wild's note; the symptom index is regenerated
@v0lumehi

Copy link
Copy Markdown
Contributor Author

Replaced by #220 (same branch), opened anew so the automatic review runs on it.

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