Repository navigation
Safety floor: per-class thresholds + persistence, pressure-primary (M4 holds were overridden to max) - #68
Open
adurham wants to merge 1 commit into
Open
Safety floor: per-class thresholds + persistence, pressure-primary (M4 holds were overridden to max)#68adurham wants to merge 1 commit into
adurham wants to merge 1 commit into
Conversation
…4 holds) The floor compared the peak over ALL TC/Tp/TG/Tg keys to a single 95C threshold while a below-max hold was active. On M4-class machines hotspot keys legitimately read 96-113C under sustained load while macOS itself stays nominal (fans near minimum, thermal pressure Nominal, no thermal/performance warnings ever recorded), so every manual hold was overridden to max within seconds and re-armed forever - manual fan control was unusable under load (reproduced twice on a MacBook Pro 14in M4 Max, Mac16,6, macOS 27). The rebuilt governor (SafetyGovernor): - Primary trip: macOS thermal pressure (serious/critical immediate, fair sustained 30s) - Apple's model already accounts for hotspot readings. - Per-class backstops with seconds-based persistence (measured elapsed time, so caller cadence changes cannot rescale them): hotspot (TC/Tp/Tg/TG minus the ProducerGuy#63 misnamed battery keys) 118C/10s judged by the second-highest reading (a single glitchy key can neither trip nor block clearing); structure (TS0P) 95C/30s; battery (TB0T) 50C/60s. Backstops are deliberately conservative for older generations where hardware throttling arrives first. - Readings outside 1-130C are sanitized before classification; a fully-blind hold (no hotspot reading) trips after 5s; serious/critical pressure is checked before sensor state so a blind hold cannot wait on the sweep. - On a trip the hold is pinned to max (unchanged behavior) and latched until pressure is NOMINAL and every class sits 10C below its threshold for 30s. - After 3 trips within 10 minutes the governor stops the restore cycle and leaves the fans with Apple (stayAuto); a deliberate re-apply starts fresh. - ProducerGuy#63: TG0B/TG0H/TG0V excluded from the hotspot class (battery, not GPU). Wired into the daemon backstop and the app's client monitor. 12 new unit tests; full suite 164 tests green. Live-validated on the affected machine: a quiet 2400 RPM hold held while hotspots ran 95.7-109.7C with zero overrides (old build tripped at the first >=95 reading). Deliberately not in this PR (to keep it reviewable): fan-stall detection and release-to-auto on trips; display-side key labeling (per-generation tables, see ProducerGuy#62) is complementary and untouched.
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.
Problem
On M4-class machines the thermal safety floor makes manual fan control unusable (reproduced on a MacBook Pro 14" M4 Max,
Mac16,6, macOS 27): hotspot-class keys legitimately read 96-113°C under sustained load while macOS itself stays nominal (fans near minimum, thermal pressure Nominal, no thermal or performance warnings ever recorded in pmset). The floor compares the peak over ALLTC/Tp/TG/Tgkeys against a single 95°C threshold whenever a below-max hold is active, so every manual hold is overridden to max within seconds and re-armed forever — commanded 2600 → target reads 7826 untilauto.Fix
SafetyGovernorreplaces the single-threshold peak check, shared by the daemon backstop and the app's client monitor:stayAuto); a deliberate re-apply starts fresh.#63:TG0B/TG0H/TG0Vexcluded from the hotspot class (battery sensors, not GPU).Evidence
autorestore afterwards; daemon log clean the whole time.Deliberately not in this PR
Related: the fan-control side of #35 and #62, plus #63. Possible rebase conflicts with #37/#25/#47 in
ThermalMonitor.swift/Daemon.swift— happy to rebase as needed.