Skip to content

fix(fan): calibrate hotspot safety guard#5

Merged
harryisfish merged 1 commit into
mainfrom
fix/fan-hotspot-guard
Jun 10, 2026
Merged

fix(fan): calibrate hotspot safety guard#5
harryisfish merged 1 commit into
mainfrom
fix/fan-hotspot-guard

Conversation

@harryisfish

Copy link
Copy Markdown
Contributor

Summary

  • calibrate FanSafetyGuard per sensor instead of comparing every sample to one global ceiling
  • allow Apple Silicon Tp* hot-spot sensors to use a dedicated 110C effective ceiling while keeping non-hotspot sensors at the stricter base ceiling
  • clear stale over-ceiling debounce count when a latched guard releases
  • update English and Chinese safety docs to describe the split ceiling honestly

Context

A real M4 Mac mini session showed smctl fan set 3000 succeeding once and then being rejected by a latched guard. The daemon log showed the guard tripped on 105.859375C against 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-hwmon does 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-sandbox
  • git diff --check
  • git fetch origin main --quiet && git merge-tree --write-tree --merge-base $(git merge-base HEAD origin/main) HEAD origin/main

@harryisfish harryisfish force-pushed the fix/fan-hotspot-guard branch from b0e42b3 to 8776469 Compare June 10, 2026 20:29
@harryisfish harryisfish merged commit 214d2c1 into main Jun 10, 2026
1 check passed
@leaperone-bot leaperone-bot deleted the fix/fan-hotspot-guard branch June 10, 2026 20:31
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants