cmux NEXT Home: a Chief's avatar runs nothing at idle; Ring's glint plays once on a state change

Merged
TE
3d ago
+70-46

The coordinator's ask, on #33395: "The idle state's glint every 7 s is a loop running at idle. Check it against the 'no CPU/wakeups at idle' budget: measure the idle wakeups before and after with the shared perf harness. If it costs anything, run the glint only on hover or on a state change. Fix it forward as its own small PR."

#33395 gave the Home Chief avatar's idle state a loop: under Ring (the default), a glint swept across the face every 7 s, and under Tilt, the avatar glanced every 6 s. An idle loop breaks the idle budget (plans/cmux-next/idle-wakeups.md: 0.0% CPU over 60 s with nothing changing). A repeating Core Animation loop also keeps the render server compositing that layer for as long as it runs.

Change

  • Idle runs nothing in every style. Only working loops: Ring's arc, Glow's glint, Tilt's rock. Waiting and failed stay still rings, as before.
  • Ring's glint plays once, for 240 ms, when the state changes (any change except into working, where the arc starts). It is a one-shot cue like the pop and the shake, and removes itself.
  • Hover: not added. The vendored list does not route row hover to the avatar, and a state change already covers "once". Hover can follow if it is wanted.
  • A cue still playing ends when motion stops: Reduce Motion, the window resigning key, or Still. This is #33475 item 1.
  • Updated to match: the Debug Settings help (home.avatarMotion), the gallery sheet (idle strips stand still, cue strips show the glint) and the tests.

Performance

Filled in from the shared idle-cost bench once the runs finish (comment below).

Tests

ChiefAvatarMotionTests:

  • idle runs nothing in any style, and only working loops;
  • a change glints once (≤ 240 ms, removes itself);
  • a playing cue ends when Reduce Motion turns on;
  • the existing stop conditions still hold.

ChiefAvatarMotionGalleryTests redraws the sheet.

Observed / Not run

  • python3 scripts/cmux-next/prepush-gate.py: no new violations. Fleet suites, compile and bench: comments below.
  • Not run: a DEV build watching the list live.

No capture: motion only, in the gallery sheet.

Changelog

Changed: A Chief's avatar in Home no longer animates at idle; it glints once when its state changes.

Agent session: agent session

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Stops the Home Chief avatar from animating at idle so nothing runs while nothing changes, meeting the no-wakeups-at-idle budget. Ring's glint now plays once as a state-change cue instead of looping every 7 s, and any cue still playing ends when motion stops.

  • Idle, waiting, and failed run nothing in any style; only working states loop (Ring's arc, Glow's glint, Tilt's rock).
  • Ring glints once across the face (≤ 240 ms) on every state change except into working; a pinned tile's avatar behaves the same.
  • Removed Tilt's idle glance.
  • A playing cue ends when Reduce Motion turns on, the window loses key, or Still is chosen.
  • Updated the Debug Settings help, the gallery sheet, and the motion tests; the fleet test that relied on the idle loop now restyles the pinned tile while it works.