fix(fan): calibrate hotspot safety guard#5
Merged
Conversation
b0e42b3 to
8776469
Compare
harryisfish
added a commit
that referenced
this pull request
Jun 10, 2026
Squashed replacement for closed stacked PR #6 after PR #4 and PR #5 landed.\n\nAdditional fixes included before merge:\n- persist battery.force_discharge in writeConfig\n- prevent disabled charge limiting from keeping force-discharge armed\n- document new CLI entries in English and Chinese README files\n\nValidated:\n- swift test --disable-sandbox\n- git diff --check\n- git merge-tree --write-tree --merge-base $(git merge-base HEAD origin/main) HEAD origin/main\n- GitHub CI Build & Test (macOS)
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.
Summary
FanSafetyGuardper sensor instead of comparing every sample to one global ceilingTp*hot-spot sensors to use a dedicated 110C effective ceiling while keeping non-hotspot sensors at the stricter base ceilingContext
A real M4 Mac mini session showed
smctl fan set 3000succeeding once and then being rejected by a latched guard. The daemon log showed the guard tripped on105.859375Cagainst the old 100C ceiling, while read-only sensors still worked. That points to the guard treating Apple Silicon hot-spot readings like board/skin/proximity sensors.External research did not find a public Apple TJmax statement precise enough to cite as a spec. Linux
macsmc-hwmondoes confirm Apple Silicon exposes different SMC sensor sets per platform and marks manual fan control unsafe by default because fail-safe behavior under overheating cannot be proven. This PR keeps smctl's fail-safe semantics intact: no readable temperatures still force auto immediately, and ordinary sensors still trip at the base ceiling.Tests
swift test --disable-sandboxgit diff --checkgit fetch origin main --quiet && git merge-tree --write-tree --merge-base $(git merge-base HEAD origin/main) HEAD origin/main