Skip to content

fix: keep Smart mode responsive on newer Apple Silicon - #37

Open
aarmed wants to merge 2 commits into
ProducerGuy:mainfrom
aarmed:fix/smart-mode-m4-responsiveness
Open

fix: keep Smart mode responsive on newer Apple Silicon#37
aarmed wants to merge 2 commits into
ProducerGuy:mainfrom
aarmed:fix/smart-mode-m4-responsiveness

Conversation

@aarmed

@aarmed aarmed commented Aug 15, 2026

Copy link
Copy Markdown

What this fixes

On newer Apple Silicon machines, legacy Tp0* temperature aliases can return placeholder values and the 100ms full-status poll can generate excessive SMC traffic. The app also performed blocking daemon socket reads on the menu-bar actor, which could make the UI appear frozen or make a menu-bar utility such as Bartender look like it intercepted the click.

This patch:

  • prefers available aggregate TC* CPU sensors and falls back to the legacy family only when needed;
  • refreshes full telemetry once per second while keeping the 100ms calculation loop;
  • smooths and bounds Smart-mode control temperature/rate inputs;
  • limits Smart fan writes to two coalescible commands per second while preserving the configured ramp rate;
  • jumps directly to the fan's hardware minimum on engagement instead of repeatedly sending an unachievable sub-minimum ramp;
  • adds a two-second receive/send timeout to daemon Unix-socket I/O;
  • moves heartbeat/version/hold polling off MainActor;
  • serializes and coalesces fan commands so a stalled daemon cannot accumulate one task per calculation tick;
  • avoids following a timed-out fan command with a second blocking state read;
  • retains .window presentation for the rich menu-bar panel;
  • keeps Apple-default behavior on first launch; Smart remains user-selectable;
  • documents the safeguards.

Verification

  • swift build -c release --product ThermalForgeApp passes on the affected M4 Pro host (only CommandLineTools search-path linker warnings remain).
  • git diff --check passes.
  • Credential-shaped scan is clean.
  • Live M4 Pro verification: Smart engaged at approximately 1,350 RPM; repeated sample captures showed the main thread in AppKit event handling rather than DaemonClient.sendRaw/read.
  • The installed menu-bar app opens and its rich panel responds after consolidating two locally installed bundles with the same identifier; that local cleanup is not part of this source PR.
  • swift test builds the test bundle but cannot execute in the local CommandLineTools-only environment because Testing.framework is absent. Full Xcode/CI is still required for the Swift Testing suite.

This is intentionally a source-level fix; no daemon install or system-wide replacement is included in the PR.

@aarmed
aarmed force-pushed the fix/smart-mode-m4-responsiveness branch from b87fec9 to cf66298 Compare August 15, 2026 11:00
@aarmed
aarmed force-pushed the fix/smart-mode-m4-responsiveness branch from cf66298 to 2fdd0c4 Compare August 15, 2026 11:06
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