Repository navigation
Conversation
…ctive speed is 0 Two rendering-cost changes measured on a real wallpaper deployment (powermetrics, M4 Pro): uncapped rAF on ProMotion displays ran the loop at 120Hz, and a speed-0 (paused) field kept repainting identical frames. - New `maxFps` config option: excess animation frames are skipped while the rAF chain stays alive; skipped time folds into the next frame's delta so delta-integrating animations stay correct. `0` disables the cap. - When the active animation's speed is exactly 0 the computed field is time-invariant (verified per-animation), so the loop now draws one frame and parks via the existing idle machinery; any update() re-wakes it. - update() now pins the frame clock when resuming from a park so delta-based animations don't integrate the whole parked stretch. - release-please: bump-minor-pre-major so this releases as 0.7.0. BREAKING CHANGE: rendering is capped at 60fps by default; pass maxFps: 0 to restore uncapped rendering. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015oFoSH9ZnH1mheL8R7wNQY
This branch has not been deployed
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
maxFpsrendering cap (default 60) — excess rAF frames are skipped with the loop kept alive and skipped time folded into the next delta.speedis0— one frame is drawn, then the rAF chain stops until the nextupdate()/visibility change.Why
Benchmarked on a real wallpaper deployment (Apple powermetrics, M4 Pro): the uncapped loop runs at 120Hz on ProMotion displays for a field that moves imperceptibly per frame, and a paused (speed-0) field kept repainting identical frames at full rate — ~46% of one core while visible.
Benefits
speed: 0now costs ~0 CPU instead of a full render loop — hosts can implement "pause" for free.How
lastDrawTimesolastFrameTimekeeps accumulating delta across skipped frames (therandomanimation integratesdeltaMs); drift correction keeps average fps ≈ target;update()/resize draws bypass the throttle and reset its window.resolved[animation].speed === 0(strict — negative speeds animate backwards), verified time-invariant per animation in new field tests (incl. arc breathe / ribbon bloom / random's post-init behavior). It funnels into the existingidleDrawnpark machinery viashouldAnimate(), so visibility gates, resize, andupdate()re-wake paths all behave as before.update()pinslastFrameTimewhen resuming from a park, so delta-based animations don't integrate the whole parked stretch in one frame.bump-minor-pre-majoradded to release-please config → this releases as 0.7.0.BREAKING: rendering is now capped at 60fps by default; pass
maxFps: 0for the old uncapped behavior.Test plan
resolveConfig maxFpstests; 5 new field time-invariance tests.pnpm --filter wavedance test— 68/68 green;typecheck+buildgreen.🤖 Generated with Claude Code
https://claude.ai/code/session_015oFoSH9ZnH1mheL8R7wNQY