Skip to content

Switchboard 0.4.2: voice server memory and idle CPU fixes - #164

Merged
sameeeeeeep merged 1 commit into
mainfrom
energy-fixes-0.4.2
Oct 2, 2026
Merged

sameeeeeeep merged 1 commit into
mainfrom
energy-fixes-0.4.2

Conversation

@sameeeeeeep

Copy link
Copy Markdown
Owner

Measured on an 8 GB M1 (2026-10-02), then fixed.

Voice server (god-tts): MLX's buffer cache defaulted to the whole GPU working set (~5.7 GB), so an idle voice server kept ~5.3 GB of freed buffers and pushed the machine into heavy swap. The cache is now capped at 128 MB (GOD_TTS_CACHE_MB) and cleared after every GPU job. Idle footprint: 5,295 MB to ~590 MB, stable across synths and keep-warm passes. Because the engine is opt-in and the installer copies the server only once, the app now refreshes an installed engine's server script from the bundle on launch and restarts com.relay.godtts. It never installs the engine where it is absent.

Menu-bar app idle CPU: 22-23% to 6.0-6.5% (top power 22 to 6). The cause was animations running where nobody could see them:

  • the hidden panel's hero DotMatrix re-laid-out the whole panel at 24 fps (about 23% of main-thread samples); it is now gated on panelVisible
  • the 1 Hz shortcut tick and onboarding breathe are also gated on panelVisible
  • the orb field pauses while the creature is loose, and the creature pauses while docked
  • the team pulse runs only while a team is live
  • the god-status drop releases its hosting view when hidden (its LED kept running at 30 fps after the first God turn)
  • the 1.6 s status poll writes @Published state and redraws the glyph only on change

Built with package-dmg.sh: signed Developer ID, app and DMG notarized and stapled, spctl accepted.

🤖 Generated with Claude Code

- god-tts: cap MLX's buffer cache (128 MB, GOD_TTS_CACHE_MB) and clear it after
  every GPU job. The default cache grew to the whole GPU working set: an idle
  voice server held ~5.3 GB on an 8 GB M1; now ~0.6 GB.
- The app refreshes an installed voice engine's server script from the bundle
  on launch (the engine is opt-in and only copied it once at install).
- Menu-bar app idle CPU ~22% -> ~6%: stop animations nobody can see. The hidden
  panel's hero DotMatrix, 1 Hz shortcut tick and onboarding breathe now pause
  when the panel is off screen; the orb and loose creature only animate when
  visible; the team pulse only runs while a team is live; the god-status drop
  drops its hosting view when hidden; the 1.6 s status poll writes state and
  redraws the menu-bar glyph only on change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sameeeeeeep
sameeeeeeep merged commit 873e89b into main Oct 2, 2026
2 checks passed
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