fix(skills): batch animation-map sampling#2339
Open
miguel-heygen wants to merge 1 commit into
Open
Conversation
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.
What
Batch each tween's animation-map seek and bbox samples into one browser evaluation instead of doing a CDP round trip plus a 100ms wall-clock sleep for every sample.
Why
A 60-second, 19-scene single-file composition timed out in the
hyperframes-animationanimation-map helper after both 120s and 300s, whilehyperframes checkand render completed successfully. The helper's runtime scaled withtweens × samples × 100mseven though HyperFrames/GSAP seeks update DOM state synchronously.Reproduction
A generated 60-second fixture with 600 GSAP tweens and six samples per tween exceeded a 35-second timeout before this change. With batching, the same fixture completed in 4.6 seconds and emitted all 600 mapped tweens.
The reproduction initially also exposed the existing rational-FPS capture-session issue addressed separately by #2329; this PR deliberately does not duplicate that fix.
Tests
node --test skills/hyperframes-animation/scripts/animation-map-sampling.test.mjsbun run test:skills— 230 passedbun run lint:skillsgit diff --check