Skip to content

feat(skills): baked-sim rule — offline physics stepped at build time, replayed by frame index - #3780

Open
jbernard077 wants to merge 1 commit into
heygen-com:mainfrom
jbernard077:feat/baked-sim-rule
Open

feat(skills): baked-sim rule — offline physics stepped at build time, replayed by frame index#3780
jbernard077 wants to merge 1 commit into
heygen-com:mainfrom
jbernard077:feat/baked-sim-rule

Conversation

@jbernard077

@jbernard077 jbernard077 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Adds one rule to skills/hyperframes-animation: organic physics (a rope, flag, cloth, debris, a
flock) is simulated once at build time and replayed by frame index, so the renderer never runs
an integrator. Validated in a deterministic reference build (a verlet pennant in a 24 s reel) through
the local gate.

What's added

  • rules/baked-sim.md — the bake → ship → replay contract:
    • a build script steps the sim at dt = 1/fps with a seeded PRNG, fixed iteration counts and
      per-frame forces computed from the frame number, after a ~60-frame pre-roll so frame 0 is
      already settled;
    • the output ships as a synchronous script include (window.__NAME = {...}) — never
      fetch(), which races the first-frame capture;
    • playback is one ease: "none" driver spanning exactly LAST / fps seconds so the proxy equals the
      frame index at every sampled frame; its onUpdate does frames[round(f)] — an index lookup and
      nothing else — with the frame-0 state applied at setup.
    • Recipe (verlet rope bake + SVG path replay), variations (transform arrays, canvas draw, two-rate
      bake, re-bake for art direction), values, constraints.
  • A rules-index.md row and a boundary sentence in particle-burst.md (interacting bodies are
    baked; ballistic particles stay closed-form), plus the hook-regenerated skills-manifest.json.

Validation

Evidence Result
hyperframes check on the reel 0 errors (one pre-existing structural lint warning — four scenes on one track)
Double-render frame hashes (PNG sequence, static-frame dedup off) 720/720 bit-identical
Seek-shuffle (shuffled-order direct seeks vs ascending order, including t = 17.0 s — the pennant scene's first frame — and 3 more inside that scene) 9/9 bit-identical
Bake determinism seeded mulberry32(42), dt = 1/30, 15 constraint passes, 60-frame pre-roll; re-running the bake reproduces the data file byte for byte, and the rule's own recipe run as a script reproduces it frame for frame (both logged)
Runtime audit no Math.random, Date.now, or requestAnimationFrame in the composition; the replay is a single index lookup

Fit against current HEAD

Anchors re-verified against main @ 250afc3. The rule sits beside particle-burst (closed-form,
no bake) and points at ../adapters/three.md for the GPU lane; it introduces no new contract —
it is the existing determinism rules applied to stateful physics.

Preview media

(the pennant scene of the reference reel: verlet rope baked offline, replayed by index, end card on
a critically damped spring)

pr-b-baked-pennant.mp4

🤖 Generated with Claude Code

… replayed by frame index

Adds rules/baked-sim.md to hyperframes-animation: a seeded build-time simulation (verlet rope
reference) written as per-frame data, shipped as a synchronous script include, and replayed by one
ease:"none" driver doing an index lookup — no integration or RNG at runtime, seek-safe by
construction. Adds the rules-index row and a boundary pointer in particle-burst.md (interacting
bodies are baked; ballistic ones stay closed-form).
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