Skip to content

Performance overlay: thermal state field - #168

Merged
willfaust merged 1 commit into
willfaust:mainfrom
bahacan16:pr/overlay-thermal
Oct 4, 2026
Merged

willfaust merged 1 commit into
willfaust:mainfrom
bahacan16:pr/overlay-thermal

Conversation

@bahacan16

Copy link
Copy Markdown
Contributor

Problem

A common report is "it starts at 40-45 FPS and sinks to 20 after a few minutes". That can be the game, the runtime, or iOS lowering clocks because the phone is hot, and the in-game overlay cannot tell them apart. The existing [device-load] line has the thermal state, but it is opt-in (env.MADEIRA_DEVICE_STATS = 1) and only in the log.

Change

  • In-game menu › Performance overlay gets a fifth field, Thermal (off unless chosen, saved with the game like the other fields): Cool, Warm, Hot or Critical from ProcessInfo.thermalState (nominal, fair, serious, critical). iOS throttles from "serious" (Hot) on.
  • While the performance overlay is shown, a change of state is logged once: [thermal] fair -> serious at 31 FPS.
  • DeviceLoadDiagnostics.thermalName is factored out of the [device-load] line and shared.

Evidence

From the fork's overlay (iPhone 17 Pro Max, iOS 27), where the same readout has been on screen since late September:

  • Ghost of Tsushima, "40-45 then 20 FPS" report: the thermal state was already WARM at the start of the session, which kept the analysis from blaming the D3D12 runtime alone; the GPU time per frame rose with the game's particle count, a separate cause.
  • Sessions with async submission enabled showed no clear win while the phone was WARM from the start, so measurements are now repeated on a cool phone.

Notes / risks

  • App only (Library.swift, plus the overlay fields in docs/LIBRARY.md). No new setting, no new Swift file.
  • The developer interface's FPS overlay is unchanged.

🤖 Generated with Claude Code

Claude-Session: https://claude.ai/code/session_0189oLHghpaYKLk4f786a6bc

## Problem

A common report is "it starts at 40-45 FPS and sinks to 20 after a few minutes". That can be the game, the runtime, or iOS lowering clocks because the phone is hot, and the in-game overlay cannot tell them apart. The existing `[device-load]` line has the thermal state, but it is opt-in (`env.MADEIRA_DEVICE_STATS = 1`) and only in the log.

## Change

- **In-game menu › Performance overlay** gets a fifth field, **Thermal** (off unless chosen, saved with the game like the other fields): Cool, Warm, Hot or Critical from `ProcessInfo.thermalState` (nominal, fair, serious, critical). iOS throttles from "serious" (Hot) on.
- While the performance overlay is shown, a change of state is logged once: `[thermal] fair -> serious at 31 FPS`.
- `DeviceLoadDiagnostics.thermalName` is factored out of the `[device-load]` line and shared.

## Evidence

From the fork's overlay (iPhone 17 Pro Max, iOS 27), where the same readout has been on screen since late September:

- Ghost of Tsushima, "40-45 then 20 FPS" report: the thermal state was already WARM at the start of the session, which kept the analysis from blaming the D3D12 runtime alone; the GPU time per frame rose with the game's particle count, a separate cause.
- Sessions with async submission enabled showed no clear win while the phone was WARM from the start, so measurements are now repeated on a cool phone.

## Notes / risks

- App only (`Library.swift`, plus the overlay fields in `docs/LIBRARY.md`). No new setting, no new Swift file.
- The developer interface's FPS overlay is unchanged.

---
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0189oLHghpaYKLk4f786a6bc
Signed-off-by: bahacan16 <190844990+bahacan16@users.noreply.github.com>
willfaust pushed a commit that referenced this pull request Oct 4, 2026
Squashed from #168.

Signed-off-by: bahacan16 <190844990+bahacan16@users.noreply.github.com>
@willfaust willfaust closed this Oct 4, 2026
@willfaust willfaust reopened this Oct 4, 2026
@willfaust
willfaust merged commit a70caf9 into willfaust:main Oct 4, 2026
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.

3 participants