mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-23 11:29:54 +00:00
03e3755aaacff101e8b760329d3dc0622341d34a
331
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8dfdceb167 | fix(core): a CSS animation in a later clip shows the right frame after a seek (#4554) | ||
|
|
3def3514d1 |
fix(engine): export draws a video in exactly the frames it is shown in (#4565)
* fix(engine): export draws a video in exactly the frames export visibility shows it * test(producer): guard that chunk frame planning snaps clip windows like export * refactor(engine): set the render fps once per frame table and name its clip window * chore(engine): trim frame table comments |
||
|
|
cc439b0e59 | fix(core): preserve in-flight video preloads during runtime binding (#4562) | ||
|
|
984ad28c7c |
fix(core): clips that meet within float rounding count as meeting in edits and playback (#4535)
* fix(core): clips that meet within float rounding count as meeting in edits and playback * fix(engine): hand a shared clip boundary to the incoming clip in export, as preview does |
||
|
|
e0e6442d9c |
feat(core): the runtime reports where a composition's animations end, one cycle each (#4541)
* feat(core): the runtime reports where a composition's animations end, one cycle each * fix(core): the reported animation end no longer moves with the playhead * fix(core): the animation end skips script-made WAAPI and counts one stagger cycle * fix(core): the animation end follows stretched keyframes and a Lottie's scene start * refactor(core): tidy the Lottie animation end reader and pin its inferred length |
||
|
|
22eb0ce5e5 |
fix(core): a picked heading is named by its text, not just Heading (#4545)
* fix(core): a picked heading is named by its text, not just Heading * fix(core): a picked label never cuts a character in half |
||
|
|
36db44d9b7 |
perf(core): a paused preview stops running its audio output (#4534)
* perf(core): a paused preview stops running its audio output The preview runtime opened its AudioContext at load and left it running for the whole session, so a paused Studio kept an audio output stream rendering silence in Chrome's audio service and output threads, and on Chrome's fake sink once a context has been silent for 30 s. The transport now suspends the context once it has been paused for a second with no captured track playing, and resumes it for Play and for a captured track that plays while paused (the scrub route). The delay keeps a stop-and-reschedule inside one play (a rate change, a hidden track, a seek while playing) from bouncing the output. A Play that lands while a suspend is pending resumes anyway, and a Pause that lands while Play waits on resume() lets the context go back to sleep. * fix(core): decoded audio after an idle pause starts where the picture is Review follow-ups to the idle suspend: - A decoded track read its start time before waiting for the context to wake, so every Play after an idle pause anchored the clock that far back and the picture stepped back. The transport now reads the time after the wake. - The transport kept every element it ever captured. It now holds only captured tracks that are playing, so a replaced track is free once it pauses. - A failed suspend and destroy() both clear the pending-suspend flag, so the next pause, or a fresh init(), can suspend again. - A test pins the one-second idle delay; the redundant "ended" listener is gone, since a track that ends fires "pause" first. * fix(core): a preview whose browser starts audio late still goes quiet when idle The idle timer was armed only if the context was already running when the transport opened it or resumed it, so a browser that starts the context a moment after construction left it running until the first pause. The transport now arms the timer from the context's own statechange event, which Chrome fires after construction and on every resume, so the separate arming in init() and after a stale Play are gone. * fix(core): a reloaded track no longer keeps a paused preview's audio awake Reloading a playing captured track (el.load(), a src swap) stops it without a "pause" event, so the transport kept counting it as playing and a paused preview never went quiet. The idle check now drops tracks that are already paused before it counts, and "emptied" is handled like "pause" so the idle timer is armed when a reload stops a track. * perf(core): a paused preview waits 10 s before its audio output goes to sleep * docs(core): say why a paused preview's audio waits 10 s before it sleeps * fix(core): a browser-side audio suspend drops the preview's idle timer |
||
|
|
473c86248c | fix(core): the picker offers what is drawn under the pointer, not see-through layers over it (#4536) | ||
|
|
0b24a0ea82 | fix(core): pick mode keeps its highlight on the hovered element and offers it on click (#4538) | ||
|
|
cb8e7995a2 |
perf(runtime): swap edited scenes into the running preview from a rebuilt document (#4502)
* perf(runtime): swap edited scenes in place from a rebuilt preview document window.__hfSwapScenes(html) compares the preview manifests. When the rebuilt document differs only inside existing scenes, it replaces each changed scene's host, styles and scripts, drops the old scene timelines (nested ones included), reruns the passes boot runs on scene DOM, releases the old media, rebinds and keeps the playhead. Anything else rejects before touching the film, so the caller does its full reload. * fix(runtime): refuse unsafe scene swaps and redraw the swapped scene like a seek The swap now refuses scenes marked unswappable or with more than one host, keeps the style order, lets adapters find the new scene, redraws through the transport seek and rejects when torn down mid-swap. * fix(runtime): scope swap caption overrides to the swapped scene and swap only manifest pages Other scenes kept re-dimmed caption words after a swap, and pages without a scene manifest offered a swap that could only be refused. * fix(runtime): repaint caption colours that were overridden after their tween rendered A swapped scene, or a film reloaded mid-way, rendered its caption tweens before the overrides rewrote their colours, so words kept the old colour. * fix(runtime): repaint caption colours of a swapped scene the playhead has passed * refactor(core): cut scene swap comments to what names and types do not say * fix(runtime): a scene swap keeps other media loaded and waits for new media by reloading * fix(runtime): a scene swap resolves bound and proxied media before refusing The new-media check compared the new scene raw src against the live DOM, which variable bindings and the media proxy have already rewritten. A scene with a customised data-var-src logo, or a proxied video, was refused on every edit. Both sides now resolve src the same way: the bound variable value, else the src attribute before any proxy swap, which the proxy now records where it rewrites the src. * fix(runtime): a scene swap binds variables only in the swapped scene, before media setup The swap re-ran variable bindings over the whole document after binding media, so a proxied video in any scene got its original, undecodable src back and a bound text in an untouched scene was rewritten. Bindings now run only inside the swapped hosts and before media binding, as boot does, and the src guard compares against the src the element had before its proxy. * fix(runtime): a scene swap keeps unchanged video and audio playing A text edit beside a video rebuilt the video from scratch, so it went blank until it loaded again. A video or audio in the edited scene whose src matches one in the old scene (same src, same order among those) is now the old element, moved into the new scene and given the new element attributes and children, except src and the runtime-owned preload. * fix(runtime): a scene swap refuses more new-media forms and names the scene The new-media check missed uppercase URL(), image-set() and @import strings, SVG image href and xlink:href, and object data, so a new asset could pop in after the swap. Its refusal now says the media is new to this scene, which is what it checks. The existing inline style url(), poster and srcset checks get tests of their own. * fix(runtime): a scene swap loads caption overrides before changing the page The swap wrote the new scene first and only then fetched caption-overrides.json, so a stalled request left the preview half swapped when the caller gave up and reloaded. The overrides are now fetched before the first write and applied from the fetched data. A swap that another swap finished first while it waited now refuses, since its document is the older one. * refactor(runtime): keep the proxy src record within the comment share * fix(runtime): a scene swap keeps media only when the edit left it as written and ungraded Keeping a live video or audio and copying the new attributes onto it was not the same as a fresh load: muted only sets the initial state, and a graded video left its grading canvas in the discarded scene, so it went black. The swap now keeps an element only when its authored markup, captured before the runtime writes to it, equals the new one, and the grading runtime says it is not graded. Anything else is rebuilt fresh; the attribute copy is gone. * fix(runtime): a waiting scene swap refuses after any other swap changed the page The check compared the scene manifest, which misses a scene changed and changed back while a captioned swap waited for its overrides; that swap then went on with stale elements and wrote a wrong manifest. A generation count the swap owns now moves on every page change by a swap, so any intervening swap makes the waiting one refuse. * fix(runtime): a scene swap warns about a non-media data-var-src once, as a load does The new-media scan resolved every bound src through the warning path, so each swap logged the ignored data-var-src again for the old and the new element. The scan now resolves silently and only the bindings pass warns, once for the new element. * refactor(runtime): keep the grading query within the comment share * fix(runtime): a scene swap replaces each of a scene's styles in its own place The bundle can now give one scene several style runs separated by another scene's, when its nested scene comes later in source order. The swap put all new styles before the first old one, so a later same-named @keyframes moved ahead of the other scene's and the cascade differed from a fresh load and the render. Each new style now replaces its old counterpart in place, and a scene whose style count differs is refused before any write. * test(core): check the bundled stylesheets, not the inlined runtime, for a leftover @import * fix(runtime): a video kept through a scene swap starts its new tweens from its authored values * fix(runtime): a from() caption colour tween with an override still lights its word up * fix(runtime): a scene swap reverts the old timelines, so a kept video shows the edited CSS * fix(runtime): a caption word with a dim-colour override still lights up when spoken * fix(runtime): a word whose colour override lands late still looks dim before it is spoken * fix(runtime): a caption override keeps class highlights and resolves var() colours per word |
||
|
|
fb3fdd4f0c |
fix(core): muting or unmuting an audio group while playing takes effect at once (#4532)
* fix(core): muting or unmuting an audio group while playing reaches the mix * fix(core): a group mute uses its bus gain; only an unmute restarts the mix * fix(core): unmuting a group captures members that have yet to play, without restarting routed ones * fix(core): unmuting a group skips members muted on their own |
||
|
|
79144f914b |
fix(core): a film stops at its declared length instead of playing its animation past it (#4530)
* fix(core): a film stops at its declared length instead of playing its animation past it * docs(core): the root-length floor comment names what it still does * fix(core): report the real length of a film shorter than one second * test(core): pin sub-second lengths with and without timed clips * fix(core): any positive declared length stops the film, even a single frame * test(core): pin every declared length in one table and read the player test by its fields |
||
|
|
5e962a4eeb |
fix(player): end and loop films whose length falls between two frames (#4504)
* fix(player): end and loop films whose length falls between two frames * fix(player): end a stopped film within half a frame, not while it still plays * fix(player): end a film at the runtime's exact time so a pause on the last frame stays a pause * fix(player): end a film when the runtime reports its end, not by comparing two lengths * fix(player): keep a pause the runtime marks as not ended, even at exactly the length * fix(player): trust a not-ended report only from a stopped runtime |
||
|
|
f2c63ca424 |
fix(core): a video's voice keeps pace with the playhead instead of trailing it (#4511)
* fix(core): a video's voice keeps pace with the playhead instead of trailing it A playing video is exempt from seek-based drift correction, because seeking resets its decoder and stutters. Nothing else corrected it, so a talking-head video that started a few frames late (92 ms measured in Studio) kept its voice behind the playhead for the whole clip, and further behind after each loop. Media sync now runs a video that drifts past the 40 ms sync tolerance 3% fast or slow (pitch preserved) until it is within 10 ms, then returns it to the authored rate. The rate is written only when steering starts or stops, since every rate change costs Chrome a frame; large jumps still hard-seek. Measured in Studio: 92 ms constant on main, about 10 ms steady with the fix. * fix(core): video steering holds through speed ramps and hard syncs Review follow-ups: steering inferred itself from the element's current rate, which a speed ramp moves every tick, so a ramped video stopped steering at the 40 ms tolerance instead of 10 ms; the direction is now kept per element. A hard-sync tick plays the authored rate, since its pre-seek offset is stale, and a rate that reads back at lower precision is not rewritten every tick. * test(core): pin clearing and write-once for video steering Review follow-up: nothing failed when the steering state was left uncleared on eviction or pause, or when the rate compare went back to strict equality. Tests now cover all three, and the sync-state test seam reports the steering map so the proxy's leak test sees it. * chore(core): format the video steering and keep its tolerance module-private * chore(core): shorten the video steering comment |
||
|
|
416d009a6b |
fix(core): scrubbing stays audible after the first Play (#4517)
* fix(core): scrubbing stays audible after the first Play Pause unplugged every track Web Audio had captured, and a captured track has no native output, so Studio's paused scrub audition went silent after the first Play for the rest of the session. A captured track outside a play now reaches the speakers the way an uncaptured one does, and Play takes that route away before building its own, so there is one path out at a time. * fix(core): a track muted while playing goes silent at once Review follow-ups to the idle route: stopAll hands every captured track back its own volume on that route, so a track hidden while playing sounded for one frame before media sync zeroed it; the hide reschedule now zeroes hidden tracks in the same task. stopAll also advances the play generation, so a schedule still waiting on resume() when Pause lands is dropped instead of giving the track a second path out. * fix(core): a replaced audio capture no longer mutes its track When a newer play pass replaced a capture still waiting on resume(), the old pass saw null and treated it as a failed capture, muting a processed track at a non-unit rate for the rest of the session. The fallback now ignores results from a stale generation. * test(core): reset the pending resume between idle-route tests * chore(core): trim the scrub fix's comments to the ratchet |
||
|
|
77b2260f2b |
fix(core): report one composition size in stage-size and timeline messages (#4496)
* fix(core): report one composition size in stage-size and timeline messages The runtime posted the composition size twice per timeline post, read two ways: stage-size used the lenient reader the stage layout uses, the timeline payload a strict one. A root with data-width="1080px" reached the player as 1080x1920, then 1920x1080, so a portrait film was framed as a cropped landscape picture. Both messages and the stage layout now share parseCompositionDimension, and stage-size sends the value unrounded. * fix(core): the layout diagnostic and nested roots read the same composition size * fix(core): read composition sizes as whole px, as the renderer and Studio do * chore(core): one comment line on the composition size reader * fix(core): keep fractional layout sizes and report the same root in both size messages Layout (the stage, timed clips, flattened nested roots, the layout diagnostic) reads data-width/data-height as before, fractions kept. Only the size the runtime reports in stage-size and timeline reads whole px. Both messages and the stage layout now take the root from one finder, so an earlier composition no longer replaces the explicit data-root's size. * fix(core): use the size messages root for the clip tree and analytics |
||
|
|
02147b8d15 |
fix(core): a clip gets its own inline display back when the runtime shows it (#4498)
* fix(core): a clip gets its own inline display back when the runtime shows it The visibility pass wrote a plain display:none over a hidden clip's inline display and removed the property when showing it, so an author's display:flex came back as block and an author's display:none !important showed the clip. The data-hidden path kept the value but not its priority. Both paths now save the author's value and priority once and put exactly that back. * fix(core): a plain inline display:none still shows at the clip's start A plain none on a hidden clip can be a runtime hide left behind (a Studio reveal restoring it), so it is not saved as the author's value; the clip shows at its start as before. Values with a priority, and every other value, are still put back. * fix(core): keep an author's plain display:none through a data-hidden toggle The leftover-hide rule applies to the timed hide only; a data-hidden hide saves the author's plain none as it is, so un-hiding keeps the clip hidden, as on main. * docs(core): say the leftover rule belongs to the timed hide |
||
|
|
aadeaf9ddd |
fix(core): a clip that starts later keeps the place and size its CSS gives it (#4495)
* fix(core): a clip that starts later keeps the place and size its CSS gives it A timed root clip that had not started when the runtime laid clips out was display:none, so it measured as auto: it was pinned to the top-left corner, and an empty full-frame clip got no size. Measure a hidden clip as it will show and never pin, so it lays out like a clip showing at load. * perf(core): lay out hidden clips in one pass and pin the !important restore Lift every hidden clip's display:none at once so a layout pass forces one layout instead of one per hidden clip; it runs every 20 frames during playback. Add a test that an author's display:none !important comes back with its priority, and fix comments that described the removed pin. * test(core): describe what the applyClipLayout test block covers * refactor(core): name the display lift instead of commenting it |
||
|
|
e266ad5e5c | fix(core): a frame capture keeps waiting for a video between its range requests (#4490) | ||
|
|
a486c0f8d9 | fix(core): a frame capture waits for a video that is still loading its first data (#4487) | ||
|
|
fba943ea3a | fix(cli): render --quiet stops printing producer info and trace lines (#4478) | ||
|
|
ab540fc42e |
perf(player): let paused players check in once a second with low-power-idle (#4483)
* perf(player): let paused players check in once a second with low-power-idle * refactor(player): trim low-power-idle comments and tidy its test * fix(core): keep the fast paused heartbeat until a timeline is bound * fix(core): wait for sub-compositions to bind before slowing the paused heartbeat |
||
|
|
2455a3d0ee |
fix(core): a seek during playback lands a playing video on the new time (#4467)
* fix(core): a seek during playback lands a playing video on the new time * fix(core): the seek fix passes the comment ratchet without a new comment * fix(core): keep why a pausing seek still lands, folded into the paragraph above --------- Co-authored-by: Miguel Angel Simon Sierra <miguelangelsisi098@gmail.com> |
||
|
|
830f28bf4e | fix(core): preview time follows a voiceover that plays through Web Audio (#4476) | ||
|
|
ad87313ee2 | fix(core): a Lottie animation in a mounted composition plays from that composition's start (#4471) | ||
|
|
278bc712d7 |
fix(core): a mounted composition's import map and module scripts run as such (#4446)
* feat(core): a composition's script can load its own files with __hyperframes.assetUrl * test(core): a template composition inside a mounted file resolves assets from that file * docs: assetUrl is for paths beside the composition, not project-root paths * docs: say assetUrl misses a project-root path * fix(core): a mounted composition's import map and module scripts run as such * refactor(core): scope a mounted module script under the same condition as a classic one * fix(core): a mounted module script loaded by src stays a module * fix(core): a mounted import map keeps the trailing slash of a prefix address * chore(core): keep the module-script helpers' comment share at the base |
||
|
|
f888db950e |
fix(core): paint no timed clip until the runtime decides its visibility (#4460)
* fix(core): paint no timed clip until the runtime decides its visibility Until its first visibility pass, a paused page showed every timed clip at once: an embed without a loader flashed a later scene before the first, and a player's hidden iframe still decoded every scene's images. The runtime now hides timed non-media clips from the moment its script runs, and the first pass that decides them removes that rule, so each clip is shown only by the pass. * refactor(core): name media with the realm-safe helper in the first-pass check * fix(core): share the first-pass hide across runtime copies and shader captures A second evaluation of the runtime (a sub-composition carrying its own runtime tag, or a page that includes it twice) added a hide rule nothing removed, so the film stayed invisible. The rule and its flag now live on the page: a copy that finds either, or finds the runtime already initialised, adds none, and the first pass removes every copy. HyperShader's capture clone forces its scene visible with !important, so a transition captured before the first pass still shows the scene's clips. The runtime test now also pins evaluation-time hiding, inline visibility, media, and two copies. * fix(core): grade media inside a clip once the first pass shows it Color grading registers only media it can see. Media with no timing of its own inside a timed clip inherited the first-pass hide, so grading skipped it, and lifting the rule is not a body mutation, so nothing registered it again: the image or video stayed ungraded. The pass now refreshes grading when it lifts the rule. The second-copy test now asserts on a paused page, before any seek. * chore(core): keep the comment share of the first-pass hide files at or under their base The comment ratchet counts one added comment line each in entry.ts, init.ts and capture.ts, and a new file above its package's share. The three lines are gone, and the one note that has to stay (why the hide runs at script evaluation) now lives in the new module's shorter header. |
||
|
|
b8dd023a97 |
feat(core): a composition's script can load its own files with __hyperframes.assetUrl (#4434)
* feat(core): a composition's script can load its own files with __hyperframes.assetUrl * test(core): a template composition inside a mounted file resolves assets from that file * docs: assetUrl is for paths beside the composition, not project-root paths * docs: say assetUrl misses a project-root path |
||
|
|
861fcc4dd0 |
fix(core): a preview that is never seeked shows only the clips of its current time (#4422)
The visibility pass ran only on seek, pause, play and during playback, and at init for video and img alone, so a paused page published __renderReady with every caption and composition host visible until someone seeked. Readiness now runs that pass for non-media timed elements; media keeps its init pass and seeks, which own color grading and audio scheduling. |
||
|
|
261af22c16 |
fix(core): frame captures wait for a seeking video to land its frame (#4406)
* fix(core): frame captures wait for a seeking video to land its frame A paused seek set video.currentTime and returned; the seek-completion barrier resolved while the video was still seeking, so a capture right after the first seek on a fresh preview painted the previous frame. The media sync now joins each seeking video to that barrier until seeked, error, emptied or abort. * style(core): format the seek barrier test |
||
|
|
115332f4f6 |
fix(core): a section whose root sets pointer-events:none stays pickable (#4399)
* fix(core): a section whose root sets pointer-events:none stays pickable * fix(core): the picker enables one sheet per hit test instead of mutating the DOM * fix(core): the picker override lives in an adopted sheet, never in the saved document * fix(core): the picker override wins over an author !important on a section root * docs(core): name the picker override ceiling and why the fallback stays unlayered * fix(core): a click-through overlay host keeps passing picks through The override now targets section inner roots only, so a host the parent author set to pointer-events:none stays pass-through. Inner roots that were none before the override are never pick targets themselves, an inner root gets a unique selector instead of its bare tag, and a page with no pass-through root skips the override and its restyle. * fix(core): picks reach content under a composition's own pointer-events:none root |
||
|
|
84e36fc16a |
feat(runtime): data-vfx-chain backdrop capture and two-source kernels (luma-matte, noise) (#4330)
* feat(runtime): data-vfx-chain backdrop capture and ref second sources
Interface v1.1's two remaining capture shapes, in the runtime.
`backdrop`: a host resolves its source from a sibling
`<canvas layoutsubtree class="hf-vfx-src" data-vfx-for="<host id>">`
before its own child wrapper, so the same kernel reads either its own
pixels or every layer below it — which element the wrapper holds is the
exporter's placement, not a def's declaration. `VfxEntry.capture` now
reports what was resolved rather than what the defs asked for.
The trap that shape creates: a `backdrop` wrapper lives OUTSIDE the host,
and children of a `layoutsubtree` canvas are never painted by the page
compositor. Skipping a hidden host the way a `self` host is skipped would
therefore delete every layer below the adjustment instead of passing it
through. A hidden backdrop host now still captures and KEEPS the bitmap,
painting no kernel.
`ref` params: a node's second source, captured into `u_src2` from the
wrapper the exporter emitted around the referenced element. Per node, not
per entry, and shared when two nodes name the same element. Every source
is drawn at the host's device size so `u_src`/`u_src2`/`.hf-vfx-out`
share one coordinate space, and each source's canvas gets its own
`paint` wait — paint records are per canvas. A source the clip runtime
has hidden captures EMPTY rather than waiting out a paint that cannot
come and then throwing "No cached paint record" every frame; an empty
matte is also what After Effects shows outside a matte layer's window.
Also: a `.hf-vfx-in` that measures 0×0 is now reported once instead of
capturing nothing in silence, and one that is not the canvas's immediate
child is refused at registration instead of throwing every frame. Both
are measured Chrome rules (vault `layoutsubtree-capture-rules`).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(runtime): luma-matte and noise two-source vfx kernels
`luma-matte` is the first def with a `ref` param: `out = src · coverage(u_src2)`
with Alpha / Alpha Inverted / Luma / Luma Inverted coverage. It is not one
After Effects effect but the runtime form of all of them — unsupported
track-matte sources, stencils, silhouettes, Set Matte — which the exporter
distinguishes by choosing what the host wraps and what `matte` names. `src`
is premultiplied, so one scalar multiply covers all four channels, and Luma
reads the matte over black, which is what a premultiplied texel already holds.
`noise` ports `ADBE Noise` from `AEFX_Noise.metallib`: Bob Jenkins' 1997
integer mix over `(x, y, seed32)`, the two glibc-style LCG rounds, and the
`0x7F80`/`0xFF` byte the IR XORs out of them — no table, no state, so it is
seek-safe by construction. Reading the metallib's struct metadata rather
than the deep dive's prose settles two of its open questions:
`ADBE Noise-0002` is `inUseColorNoise` (a checkbox), not a Uniform/Gaussian
popup, and the mystery seed floats are `inRandomSeed_High`/`_Low`, the two
halves of one 32-bit seed. What the CPU puts in those halves per frame is
still unprobed (plan Task 4.3), so the kernel seeds the low half with the
frame index; the tests assert distribution and seek determinism, not parity.
The shader declares `precision highp int` — the whole port rests on 32-bit
wraparound and a fragment shader's integers default to mediump, which ESSL
guarantees only 16 bits of.
Both defs declare `capture: "self"`, which says a texture is needed and
nothing about whose: `noise` on an adjustment layer is the same kernel, and
the runtime reads the `backdrop` placement off the DOM.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* test(vfx): browser checks for backdrop capture, luma-matte and noise
Task 2.6 Step 5 and Task 2.7's owed browser checks, folded into the
existing puppeteer harness: an identity backdrop kernel composites two
stacked blocks captured through a data-vfx-for sibling wrapper back
over themselves (PSNR >= 40dB vs a plain-DOM control panel); a backdrop
host outside its own clip window still keeps those blocks on the
wrapper canvas's own bitmap via capturePassThrough; luma-matte's four
modes are checked against alpha- and luma-varying matte strips at four
sample points each; noise is checked for amount=0 identity, same-time
determinism, and a changed pattern when its only seed (seek time)
changes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* feat(runtime): external displacement maps and visible ref sources
Two gaps the exporter side found in the `ref` plumbing.
1. `displacement-map` had no `map` ref param, so the exporter's
`params.map = "<element id>"` was dropped by `normalizeVfxParams` (it
iterates the def) and the node silently self-displaced. `map` is now a
ref param, bound to `u_src2` and selected by a new `u_hasSrc2` uniform
the runtime sets from whether the ref resolved. Refs gain
`optional: true` — empty `map` is the self-referential form every
corpus instance uses, while an empty `matte` stays a loud failure — and
a ref naming its own host resolves to self rather than capturing the
same pixels twice (on a backdrop host it would otherwise have read the
layers below as the map).
2. Interface v1.1 assumed a ref source is invisible in After Effects.
retro-wave `Logo Anim` layer 5 is layer 4's displacement map AND an
enabled, opaque layer, and the runtime cleared its wrapper's bitmap
after the upload, deleting it from the frame. A wrapper marked
`data-vfx-ref-visible` now keeps its bitmap and is captured at the
REF's own box instead of the host's, so it paints at its own size and
resolution. The three capture shapes are one `{ upload, keepBitmap }`
mode: texture only, bitmap only (a backdrop pass-through), or both.
Sampling is unaffected by the box choice, and the browser test proves it
rather than assuming it: `drawElementImage` scales the element into the
whole canvas, so a 320px-wide matte's four strips still land as four
40px bands in a 160px host. The v1 rule — a ref is scaled into the host's
box, not placed in composition space — is unchanged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(runtime): capture a visible ref while its host is hidden; review nits
Addresses PR #4330 review feedback (jrusso1020, CHANGES_REQUESTED).
Blocking: both the engine-mode and preview-mode capture paths treated
"host not paintable" as binary — a backdrop entry got a pass-through
capture, everything else was skipped outright, including a ref source
that lives on a different, independently-visible element (e.g.
retro-wave's Logo Anim layer, which is simultaneously layer 4's
displacement map and its own fully opaque visible layer). Adds
visibleRefSources()/captureVisibleRefsOnly() and a unified
FrameCaptureMode discriminator so a visible ref still gets captured
even while its own host is hidden, on both paths.
Non-blocking, addressed:
- luma-matte's mandatory ref that names its own host now resolves to
an explicit RefResolution {kind:"self"} and binds u_src2 to unit 0,
instead of relying on an unbound sampler's implicit default.
displacement-map's optional self-ref is unaffected (still folds into
{kind:"none"}, using its existing u_hasSrc2 shader branch).
- noise shader now enforces rgb<=a (valid premultiplied alpha) after
adding noise, independent of u_clipping — documented why u_clipping
is currently a permanent no-op on this runtime's 8-bit render
targets.
- added a hash-pinning test for hfJenkinsMix; documented, with a
brute-force proof, which one of the reviewer's suggested mutations
is unobservable within this fixture's reachable seed range.
- fixed two misplaced doc comments.
fallow flagged resolveVfxCapture/resolveRefSource as newly over the
complexity threshold after this diff; extracted resolveEmptyRefParam()
and captureHiddenEntry() to bring both back under.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(runtime): capture a visible ref while a hidden BACKDROP host passes through
Re-review of #4330 at
|
||
|
|
c6913aabe2 |
fix(core): the runtime never reports a film's length as Infinity (#4372)
* fix(core): films whose animations end after the voiceover keep their length The runtime treated any root timeline running more than 1 s past its media as loop-inflated and, with no data-duration on the root, reported its length as Infinity. Hosts that read only the runtime message, such as an opaque-sandboxed preview, then showed a total of 00:00. Only a timeline at endless-loop scale (7200 s, the length Studio already rejects) now counts as loop-inflated. * fix(core): the runtime reports a finite length for looping timelines When the root timeline looked loop-inflated and the root had no data-duration, the timeline message said Infinity even though the runtime had already chosen the media window as the root's length. Hosts that read only this message (Studio's player, opaque-sandboxed previews) then showed a total of 00:00. The message now carries the length the runtime resolved. |
||
|
|
0618fc0dc3 | fix(parsers): render bare fragment sub-compositions (#4335) | ||
|
|
8055961740 |
feat(registry): a Lottie character walk-in, and looping Lottie that keeps playing (#4316)
* fix(core): looping Lottie animations keep cycling instead of freezing after one pass * feat(registry): add a Lottie character walk-in and document the character route * chore(registry): index lottie-character-walk in the catalog and search vectors * chore(docs): list lottie-character-walk in the catalog gallery * docs(skills): say that lottie-web loops when loop is left out * fix(core): a finished Lottie holds its last frame instead of disappearing * fix(core): hold a finished Lottie on its exact last frame * chore(skills): refresh the manifest hash for the Lottie skill edits * fix(core): wrap looping Lottie by frame so a loop never holds at its seam * fix(core): a looping Lottie starts each cycle on frame 0 despite float error |
||
|
|
b32b9a7dab |
feat(runtime): data-vfx-chain — a seek-deterministic per-pixel effect element (#4306)
* feat(core): data-vfx-chain defs and chain parsing (mirrors data-fx-chain)
Mirrors audioFx.ts's shape for the per-pixel VFX chain: a versioned
JSON chain attribute (data-vfx-chain), a def registry with typed
params (number/enum/bool/ref), and parse/serialize/normalize helpers.
HF_VFX holds one def, fractal-noise, with a placeholder frag; the
kernel and its consumers (packages/core/src/runtime/vfx.ts) land in
Task 1.2/1.3 of the vfx-chain-runtime plan, so vfx.ts is added to
.fallowrc.jsonc's entry list for now.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* feat(runtime): paint data-vfx-chain canvases on every seek
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* feat(vfx): fractal-noise kernel (Basic/fBm approximation) with CPU reference
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* feat(vfx): self capture through layoutsubtree with the page-composite readiness protocol
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* feat(vfx): wave-warp kernel (Sine)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* feat(vfx): displacement-map kernel (self-referential map)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* test(vfx): chain order is nesting order; preceding CSS effects are captured
...and following ones apply outside. The plan's one-line message for Task 2.4
is 105 characters; commitlint caps the header at 100, so the tail moved here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* test(vfx): seek determinism and CPU-reference PSNR for fractal-noise
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(vfx): size the output canvas from the host's layout box, not its transformed AABB
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* feat(telemetry): vfx node count, capture class and types on render_complete
Threads vfxNodeCount, vfxCapture and vfxTypes from a static scan of the
compiled composition's data-vfx-chain hosts (mirrors the existing
compositionElementCount/colorGradingCount scan) through
RenderPerfSummary.drawElement into the render_complete event, next to
de_capture_mode. Exports chainCapture/parseVfxChain/HfVfxCapture from
@hyperframes/core's index for the producer to consume. The PostHog
dashboard tile is not created here — left for the coordinator.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(vfx): data-vfx-chain guide — element shape, capture table, Studio flag, known constraints
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(vfx): register chain hosts that arrive with a sub-composition mount
`initVfx(document.body, fps)` ran once, synchronously, three lines after
`void loadExternalCompositions(...)` — so every `data-vfx-chain` host that
enters the DOM only when a `data-composition-src` mount resolves was never
registered. An unregistered host paints nothing and reports nothing: no
`[HyperFrames] composition script error`, the `.hf-vfx-out` canvas keeps its
300x150 default, and `paintVfx` never even arms the page-composite flag.
Measured on a real multi-file export served raw: `#main-l5-text`'s output
canvas stayed 300x150 and `window.__timelines` never gained the sub-comp.
Re-scan in the loader's `.finally`, before `maybePublishRenderReady()`, so
registration precedes readiness. `initVfx` now releases the outgoing
registry's programs, capture textures and ping-pong targets first — the
output canvas hands back the same WebGL2 context on a re-scan, so the
previous pass's GL objects would otherwise leak.
Two browser cases in `vfxDeterminism.test.ts`, both against the real runtime
bundle: a host whose `.hf-vfx-in` IS the mount (already worked — the mount
replaces the wrapper's children, not the wrapper, so the registered source
node survives), and a host that arrives INSIDE a mounted sub-composition
(failed with `armed: false` and no error; passes now).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(vfx): runtime tsconfig typecheck passes
Under noUncheckedIndexedAccess, resolveCaptureSource's null return
widened VfxEntry.src past its VfxCaptureSource | undefined type; the
function is internal-only, so its return type moves to
VfxCaptureSource | undefined instead. Indexing PingPong.framebuffers
by a non-literal index produced | undefined against
WebGLFramebuffer | null, coalesced to null. No behavior change.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(vfx): structural DOM predicates instead of realm-bound instanceof
vfx.ts checked `instanceof HTMLCanvasElement`/`HTMLElement` directly, which
returns false for inner-realm nodes when the Studio previews across an
iframe realm. domRealm.ts had no canvas predicate yet, so this adds
isCanvasElement mirroring the existing isImageElement pattern, then swaps
all three vfx.ts checks to the structural predicates the lint guard requires.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(vfx): paint self-capture hosts under hyperframes snapshot, not only the engine path
`paintVfx(t, { engineMode: true })` armed the page-composite protocol and
returned, betting that every capturing chain runs under `frameCapture.ts`.
`hyperframes snapshot` (and check/compare/validate/layout, and Studio's
thumbnail capture) seek through the same `renderSeek`, never read
`__hf_page_composite_pending` and never call `__hf_page_composite_resolve` —
so a `self` chain painted nothing there, in silence, because its content
lives in a `layoutsubtree` canvas the browser never paints directly.
Engine mode now arms the preview-side capture as well and paints on whichever
completes first. A seek token stops a superseded async capture from repainting
a newer frame, and a registry-identity check stops it painting an entry
`initVfx` already released. `resolveVfxCapture` stays non-idempotent on
purpose: the engine resolves only after its own before-capture hooks have
mutated the DOM, so its capture is still the authoritative one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(vfx): an exporter-emitted .hf-vfx-out gets the box the spec fixes for it
findOrCreateOut adopted a canvas the exporter had already emitted without
applying the layout cssText, so it kept the default position:static;
display:inline and wrapped to the line AFTER the layer-wide .hf-vfx-src
canvas — painting a second, misplaced copy of the layer one full layer
height below the host. Measured on retro-wave #main-l6-text: .hf-vfx-src
rect top 315.1 h 93.0, .hf-vfx-out rect top 409.2, both style=null,
position static (ae-mcp findings Task 3.5b). Hosts with no emitted
out-canvas were never affected, which is why only this one host moved.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* refactor(telemetry): vfx_node_count counts hosts, not chain nodes — rename to vfx_host_count
The field increments once per `data-vfx-chain` attribute occurrence, never
per node inside a chain's JSON, so the name promised something the scan does
not measure. Renames the internal `vfxNodeCount` and the wire property
`vfx_node_count` to `vfxHostCount`/`vfx_host_count` across the orchestrator
scan, the perf summary, the CLI render path and the telemetry event. No
dashboard consumes the field yet, so the wire rename costs nothing now and
would cost a migration later.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(vfx): join the preview capture to the seek-completion barrier, not race it
`paintVfx` fired `capturePreviewThenPaint` and forgot it, so nothing the CLI
awaits waited for a `self` chain's paint. Every snapshot-family command
(`snapshot`, `check`, `compare`, `validate`, `layout`) seeks through
`seekCompositionTimeline`, which drains `window.__hfWaitForSeekCompletion`
and then allows one settle race before screenshotting — and only the
`"hf-seek"` event's `waitUntil()` could put anything in that barrier. The
screenshot therefore landed on however many hosts happened to have finished,
which varied with host count and machine speed.
Extracts the "track, untrack on settle, retain the first rejection" block
`dispatch()` built inline into an exported `registerSeekCompletion`, and has
`paintVfx` register the preview capture through it. Also awaits the per-host
paints with `Promise.all` instead of sequentially: N hosts cost about two
animation frames now, not 2N.
Measured on the pre-fix bundle with two `self` hosts, both output canvases
read `[0,0,0,0]` at the moment the barrier returned; they painted only
because the settle race that follows happened to be long enough. Both tests
added here fail on that bundle.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(vfx): report WebGL context loss loudly instead of silently no-op painting
One WebGL2 context per `data-vfx-chain` host, against a browser cap that is
commonly 16 and shared with `colorGrading.ts`'s per-element contexts. A lost
context makes every later call on it do nothing, per spec — so the chain kept
"painting" a blank canvas with no error, which is exactly what the module's
loud-failure contract exists to prevent.
Adds the `webglcontextlost` listener pair's first half, following
`colorGrading.ts`'s precedent: `preventDefault()`, mark the entry, report
once through `reportVfxError`. The entry is then skipped by `paintVfx`,
`capturePreviewThenPaint` and `resolveVfxCapture` — silently, since the one
loud report already happened and repeating it per frame is spam.
Restore is left unhandled on purpose, with the reasoning in the doc comment:
`initVfx`'s existing re-scan already rebuilds every GL object, and a second
narrower rebuild path for `webglcontextrestored` would duplicate it. The
shared-context redesign the review floated is likewise out of scope here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* perf(vfx): cache uniform locations at pass-build time instead of querying every paint
`setPassUniforms` asked the driver for `u_size`, `u_t`, `u_fps` and every
param's location on every paint of every pass, and `bindPass` did the same
for `u_src` on every bind. `buildPasses` already constructs each `VfxPass`
once at init, right after the program links, and a linked program's
locations never change — so they are resolved there now and read from
`pass.locations` in the hot path.
Same values, same `null`-means-optimised-out semantics (`gl.uniform*(null,
…)` is a defined no-op, which is what the per-frame query produced too), so
the existing vfx.test.ts and the browser determinism suite cover it
unchanged — both still green, the latter against a rebuilt runtime bundle.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(vfx): bound the paint wait per host so a stalled compositor can't hang the seek barrier
`paintVfx` registers `capturePreviewThenPaint` into the shared seek-completion
barrier (
|
||
|
|
05d09a7452 |
chore(registry): remove low-use catalog items and variant tails (#4274)
* chore(registry): remove low-use catalog items and variant tails * fix(registry): remove stale references to deleted catalog items * style: format catalog fixture * fix(ci): use surviving catalog preview canary * chore(ci): allow intentional catalog deletions * fix(ci): scope fallow audit for catalog fixtures * chore(catalog): regenerate local search vectors * chore(catalog): update vector revision * fix(catalog): validate registry set delta |
||
|
|
839ae426dd |
feat(studio): typed audio values, clip fades, audible video drops (#4250)
* feat(studio): typed audio values, clip fades, audible video drops Audio rows in the media inspector (Volume, Speed, Media start) take a typed value: click the readout, type "-6 dB", "1.5x" or "2.5s", Enter. Speed presets are hidden on <audio> clips. Clip-edge fades: data-fade-in / data-fade-out in seconds, honoured by the preview runtime (per-tick gain), the render mixer (afade after volume) and Studio (Fade in / Fade out rows, and drag dots at the top corners of audio clips and audible videos). Linear on both sides so preview and render agree; fades that outrun the clip scale to meet inside it. Dropped videos with an audio stream now land with data-has-audio="true" instead of muted, so the mixer keeps their sound. The media metadata endpoint reports hasAudio from the ffprobe call it already makes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(audio): one owner for fades, dB, and afade-after-volume Illegal fade values become no-fade at fadeGain; typed inspector input still returns null so the readout stays red. Master and group mixes share one filter chain with volume then afade. Fade-out stays anchored to the trimmed clip end. * fix(studio): share audio helpers and bound typed media values * fix(studio): reserve sibling fade duration when editing --------- Co-authored-by: Jake Moran <jakemoran2011@gmail.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Miguel Angel Simon Sierra <miguel.sierra@heygen.com> |
||
|
|
16fab47a8e |
perf(player): scope preview readiness to first frame (#4239)
* perf(player): scope preview readiness to first frame * refactor(core): share runtime visibility timing * refactor(core): share readiness timing owner * test(core): pin readiness caller wiring * test(core): cover fonts in first-frame gate * fix(core): restore readiness test contract |
||
|
|
97420736d5 |
feat(studio): audio level meters at the timeline's right edge (#4193)
* feat(studio): audio level meters at the timeline's right edge * test(core): cover metering started before the audio context finishes init * fix(studio): keep meter follow after a dead preview and start bars at silence * fix(studio): keep the 0 dB peak tick inside the meter * fix(studio): keep the 0 dB peak tick visible without calc() * fix(core): tap meters on the program bus, mute on a monitor gain * style(core): wrap applyMasterGain to satisfy oxfmt |
||
|
|
fa44d7621d |
feat(core): a composition with no authored length takes it from its clips (#4174)
* feat(core): a composition with no authored length takes it from its clips A new resolver in @hyperframes/parsers returns a composition length as authored, derived from its latest clip end, or unresolved, and counts clips whose length is still pending. The runtime uses it in its two existing max-end loops with identical results, and as a last resort only when no timeline, floor or caller length exists, so a composition that has a length today keeps it. The derived source is published on window.__hf.durationSource for render telemetry. Lint reports a root that has timed clips but no data-duration as a warning that says where to author it, and still errors when there is nothing to derive from. * refactor(core): resolve the runtime duration floor in one call The declared duration and sub-composition ends were resolved separately and maxed by hand; one resolver call over both gives the same latest end. * fix(core): a derived composition length waits for every clip length and reports honestly Review follow-up. The runtime returns a content-derived length only when no clip is still pending, so a renderer that reads duration once cannot lock in a short one. window.__hf.durationSource is cleared whenever a timeline or floor supplies the length, and the diagnostic fires only for a derived length. Lint says "at least Ns", counts reference-start clips as known only at runtime, and ignores a data-end before data-start. * fix(core): a sub-composition with no known length counts as pending A host whose own timeline is not registered yet no longer lets the content-derived length show early. Tests pin the pending host and that the diagnostic fires only for a derived length. * fix(core): a loaded Lottie with no registered animation keeps the length pending Lottie registers from author scripts with no DOM marker, and nothing re-derives the length after it registers. A composition with clips and a loaded Lottie library therefore stays at zero, as before, instead of locking in the clips length and cutting the animation short. * test(core): a registered Lottie supplies the length and the clips length is not used Pins the other side of the pending Lottie rule. Once an animation reports a length it enters the duration floor, so the content-derived fallback is never consulted. * test(core): the declared and DotLottie pending branches are covered |
||
|
|
f4e00ce2b5 |
fix(runtime): a finished film rests on its last frame instead of a blank one (#4158)
* fix(runtime): a finished film rests on its last frame instead of a blank one The clip-visibility check was half-open (start <= t < end), so a clip whose authored end reached the composition's total duration hid at exactly that instant. The player parks there when playback ends, so a finished film went blank instead of holding its last frame, in both the published player and Studio's scrub-to-end. Extracts the shared half-open comparison used in seven places into isInClipWindow (packages/core/src/runtime/clipWindow.ts) and adds isClipVisibleAt, which additionally treats a clip reaching the composition's terminal instant as visible. Only the DOM-visibility gate uses the terminal rule; playback and media-activation windows keep the plain half-open check, so two back-to-back clips still never both show at their shared boundary and audio never re-activates past the end. * fix(runtime): hold a terminal video on its last frame at the composition end * refactor(player): route the proxy clip-window checks through the shared predicate Makes the composition duration required on syncRuntimeMedia so a caller cannot drop the terminal rule, exposes the predicate as a core subpath, and adds a nested-timeline float-noise test. * build(core): declare the runtime/clip-window subpath in the package-subpaths descriptor * test(runtime): a speed-ramped video that runs to the composition end holds its last frame Covers the composition of the terminal hold with a rate lane: at a time past the clip end the video sits at the source time of its own end. |
||
|
|
09aadd86a5 |
feat(core): video, audio and image length come from one shared resolver (#4166)
A new resolver in @hyperframes/parsers decides how long a video, audio or image occupies the timeline. The core runtime start resolver, clip manifest and clip tree now read length through it. An image with data-start and no data-duration gets the dropped-image default of 3 seconds; a bare image stays a static layer. Video and audio take their length from the file until an authored duration trims it. The playback rate bound (0.1 to 10) now lives in parsers, and core re-exports it. A rate lane keeps its own arithmetic in core. The lint rule that asked images for data-duration is removed, and the docs no longer say an image requires it. |
||
|
|
bdecae066a |
feat(engine): render speed ramps with the same source-time mapping as the preview (#4143)
* feat(engine): render speed ramps with the same source-time mapping as the preview The frame extractor, frame lookup table, coverage check, compile-time duration and audio mixer read a clip's rate lane through sourceTimeAt, so a rendered frame at t shows the source frame the preview shows. Audio bakes a ramp as consecutive source slices stretched by their mean rate, keeping pitch. The compile-time attribute reader now handles single-quoted and entity-encoded JSON attributes. Adds a speed-ramp regression fixture. * test(producer): regenerate the speed-ramp golden audio with the current engine The stored baseline predates the per-slice audio fix, so its audio drifted 1 to 3 percent in pitch from the expected source-time track and the CI render correlated at 0.61. Rendered in the CI test image, the new baseline tracks the expected pitch to 0.1 percent median, and the compare now reports visual 0 failed frames and audio correlation 1.000. * refactor(core): drop data-preserve-pitch, pitch is preserved by construction The engine always time-stretches audio with atempo, so an opt-out read only by the preview made preview and render disagree. Remove the attribute and its reader so both paths keep pitch. |
||
|
|
7f452ad276 |
feat(core): speed ramps as a rate lane in data-automation (#4129)
* feat(core): speed ramps as a rate lane in data-automation A clip can carry a rate lane in data-automation. sourceTimeAt integrates it to source time and is the one mapping the runtime uses for media seeking, playback rate, natural duration, child timelines and the audio-master clock. Rate is clamped to 0.1-10 in one place, pitch is preserved unless data-preserve-pitch is false, and ramped clips play through the media element. Lint warns on a rate lane outside video and audio. * fix(core): format the speed-ramp files and expect the unified rate clamp in the engine tests * test(engine): read the playback-rate clamp from core instead of a literal |
||
|
|
0a5c235173 |
feat(cli): hyperframes timeline prints a project's tracks and clips (#4138)
* feat(cli): hyperframes timeline prints a project's tracks and clips * docs(cli): list the timeline command * feat(cli): timeline command reports unreadable lanes; add skill docs * fix(cli): timeline stays inside the project, shares one start cache, keeps small volumes * fix(cli): timeline resolves symlinks before the project containment check * fix(cli): timeline accepts project folders whose name starts with two dots * refactor(cli): timeline and compositions share the engine's start resolver * docs(skills): point agents at the timeline command where they decide how to read a project * fix(cli): timeline prints absolute main-timeline times and the owning file for nested clips Nested rows carry absStart/absEnd on the main timeline and their owning file, alongside existing local start/end. Text prints absolute time first, local time in parentheses. Adds jq/node one-liners for common queries, tested against a fixture. * fix(cli): timeline places nested media at the runtime start and tests its query one-liners A nested media clip with a negative literal data-start was reported later than it plays, because the raw start was clamped before the host offset was added. The skill's jq and node one-liners now run against the fixture in the test suite. * fix(cli): timeline clamps a negative media start to 0 when its host starts at 0 The runtime skips the host-offset formula for a host at t=0 and clamps the start, so the timeline command now does the same. * refactor(core): one media-start rule shared by the runtime and the timeline command The runtime and the CLI each carried a copy of the rule for when a nested media clip's start takes the host offset, and the copies had drifted. Both now call resolveMediaStartSeconds. * test(cli): timeline fixture for a media start written as an expression parseNumeric and the runtime's parseStrictFiniteTimingNumber are the same function, so the two callers cannot disagree on what counts as a literal; this pins the expression case. |
||
|
|
a7282dcd0e |
fix(player): wait for a cross-origin composition's assets before playing (#4103)
* fix(player): wait for a cross-origin composition's assets before playing The player's readiness gate scans the iframe document, which is null when the composition is embedded from another origin, so it released playback at once and the first frames could play with images still loading. The runtime now runs the same readiness scan inside the iframe and posts assets-ready; its timeline message reports whether assets have settled so an older runtime, which never posts it, is not waited on. Also declares the animation-frame abort handler before a host whose requestAnimationFrame calls back synchronously can reach it. * fix(player): keep a ready cross-origin player ready across a late iframe load The iframe load event reset readiness for any document the player cannot read. The runtime posts its timeline before load and a paused runtime never posts it again, so a load arriving after the assets settled left the player not ready. A ready cross-origin player already holds this document's handshake, because every navigation clears readiness first. * fix(core): stop RuntimeReadinessWindow widening Window.__hf so the runtime typecheck passes * fix(core): a torn-down runtime no longer posts assets-ready |
||
|
|
e36a53d6b6 |
fix(core): hold render-ready on declared compute, not just adapter loaders (#4065)
* feat(core): hold render-ready on declared compute and a build-ready hold, not just duration Adds the compute and paint-and-idle inputs to the composition readiness gate, plus window.__hf.buildReady: a promise registry a piece registers when it has setup work no adapter can see (mesh building, shader compiles). The runtime holds render-ready on it and the player shows its loading state instead of a blank frame while it resolves. * refactor(core): dedupe the paint-and-idle readiness test setup Simplify pass on 23810da1b: fallow flagged the two paintAndIdleReadinessInput tests as a 12-line clone; extracted the shared doc/tracking setup. * fix(core): stop the readiness settled-tracker hanging on 2+ pending promises Promise.all allocates a new promise every call, so comparing ITS identity across repeat polls (isAdapterReadinessSettled, isBuildReadinessSettled) never observes settled once 2+ promises are combined: every poll rebuilds a new combined promise, re-arms, and republishes forever without the caller ever seeing true. Reproduced with two already-resolved window.__hf.buildReady entries, which is the exact multi-piece usage the new authoring doc describes. Fixes both trackers at once with a shared createSettledTracker that compares the source promise array by element instead of the Promise.all wrapper. * fix(core): cancel readiness inputs once settleCompositionReadiness settles computeReadinessInput's poll timer and paintAndIdleReadinessInput's rAF chain kept running after the shared timeout won the race, since nothing told the losing inputs to stop. One AbortSignal now threads through all three inputs and is aborted the instant the race settles. * docs(core): fix a stale sync-callback claim in settleCompositionReadiness paintAndIdleReadinessInput always has a frame to wait on for any real document, so the sync fast path this docstring described is no longer reachable with the default inputs except for a viewless document. Found by the simplify pass on this branch. * fix(core): clear a stale buildReady entry on runtime teardown A never-resolved window.__hf.buildReady promise from a torn-down composition survived into the next init in the same window (window.__hf is never reset), permanently blocking render-ready for whatever loaded next -- the exact black-screen class this branch fixes, reproduced through its own new mechanism. Found by the independent review. Also fixes a stale hyperframes-player.ts docstring (media/images/fonts had not been updated to compute + paint-and-idle) and documents the buildReady key-collision hazard in three.md. * fix(core): skip the compute readiness wait when no runtime ever ran computeReadinessInput polled window.__renderReady for the full shared timeout on any same-origin document with no HyperFrames runtime injected (a probe-only composition using native video/duration, or a blank test iframe) — nothing was ever going to set that flag. Checking window.__hf first (the same signal composition-probe.ts already treats as "has a runtime") lets it return null instead of waiting. * fix(player): debounce the loading overlay and diagnose compute timeouts paintAndIdleReadinessInput always has a frame to wait on for an attached iframe, so settleCompositionReadiness's synchronous-settle path is unreachable in practice now — the loading overlay showed on every single Play, even ones with nothing genuinely pending. Debounce the overlay itself instead: a wait that resolves fast never shows it. Also names compute (window.__renderReady) in the stuck-assets timeout diagnostic, which previously only re-scanned media, images and fonts. * fix(engine): name a stuck buildReady key in the zero-duration diagnostic A build promise a composition registers on window.__hf.buildReady that never resolves left the export path's zero-duration timeout naming nothing useful — hasHf/hasSeek/duration all looked fine, since the runtime was genuinely present and just waiting on that one promise. Probes buildReady's keys for pending ones and names them in the hint. * fix(engine): stop the buildReady diagnostic from crashing on a rejection A microtask race against a bare resolved promise rejected the whole diagnostic expression on any rejected buildReady entry (the runtime's own createSettledTracker rejects deliberately) and mis-sorted a settled non-native thenable as pending, since its extra adoption tick loses the race. Both measured directly, not inferred. Settle each key onto its own record past one macrotask instead: no throw, and pending/resolved/rejected are distinguished correctly. A rejected key gets its own hint, separate from a merely pending one. * fix(player): report a backgrounded document instead of overclaiming a paint bound MAX_PAINT_WAIT_MS only bounds a document that keeps producing frames; one that stops entirely (backgrounded tab suspends rAF, or fewer than 3 frames ever fire) still rides the full shared 8s timeout, same as before this input existed. Corrected the comments that claimed otherwise. That gap is exactly why the stuck-assets diagnostic left paint-and-idle unreported: there was no accurate way to say it might be the cause. Added documentHidden (doc.hidden) to the diagnostic instead, since a backgrounded tab is the reachable, directly observable case. * refactor(engine): simplify the buildReady diagnostic rewrite Skip the macrotask wait entirely when a composition registers no buildReady keys — the common case, since it's opt-in. Nothing to settle means nothing to wait on. Collapse buildZeroDurationDiagnostic's inline parameter type into the existing HfDiagnostic interface instead of maintaining two copies of the same shape. * docs(engine): note the setTimeout(0)-thenable gap the review found An independent adversarial review, executing hostile inputs rather than tracing, found the macrotask wait can still misreport a thenable that resolves via its own internal setTimeout(0), since the diagnostic's own timer is registered before the thenable's. Bounded and self-correcting (only feeds the message text, and the diagnostic re-runs every ~1s), so documenting the boundary rather than chasing an unbounded fix. |
||
|
|
2de3ca5f86 |
fix(player): the interactive playback clock absorbs a main-thread stall instead of skipping past it (#4053)
* fix(player): the interactive playback clock absorbs a main-thread stall instead of skipping past it TransportClock's monotonic time is a bare wall-clock read with no protection against a long gap between reads. On a composition whose first real paint blocks the main thread for several seconds, nothing reads the clock during that time; the next read reported the whole gap as elapsed playback, so the composition jumped forward instead of continuing from where it froze. A gap over 500ms is now treated as a stall and corrected to a 33ms advance instead of reported whole, matching GSAP's own ticker default. The correction lives inside now() itself so every reader benefits, since this clock is read every real frame by more than one driver. Render/export capture is unaffected: it always pauses and seeks to an exact time rather than playing, so the correction never engages there. * chore(player): drop internal tracker references from stall-policy comments * fix(player): stop the stall correction from corrupting the clock while audio is authoritative An independent review found that the previous commit's correction ran unconditionally on every read, including while an attached audio source was providing the time. Audio keeps playing through a JS-thread stall, so a gap between reads there is not a stall — but the correction still shifted the clock's internal reference point, and that corruption only surfaced later, on an unrelated read, once the clock fell back to monotonic timing (audio pausing or buffering). The correction now runs only in the monotonic branch, after audio has had its chance to answer. Added a regression test that fails against the previous placement and passes against this one. * fix(player): keep the stall correction's read timestamp fresh through an audio-authoritative stretch A second independent review found the previous commit's fix was incomplete: it stopped a stall correction from firing while audio was answering a read, but the internal timestamp it compares against only moved on monotonic reads. Any monotonic read from before audio took over stayed the comparison point for as long as audio kept answering, so the whole audio-authoritative stretch read as one giant stall the moment audio dropped out again — reproducing the exact corruption the previous commit set out to fix, through a different door. The same gap also meant a real, non-stalled audio outage got smoothed away to almost nothing instead of advancing normally. The read timestamp now moves on every read, audio-answered or not; only the correction itself stays scoped to the monotonic branch. Two regression tests reproduce both failure modes and pass here; both were confirmed to fail against the prior placement. * fix(player): stop comparing a monotonic read against a timestamp audio made meaningless A third review found the previous commit's fix was still incomplete: keeping the read timestamp fresh during audio-authoritative reads stops it going stale, but a real gap with no reads at all — the main thread genuinely frozen while an attached audio element kept playing on its own, unaffected by JS scheduling — still read as a stall the moment audio next failed to answer, discarding real elapsed time that audio had been correctly tracking the whole way. An audio-answered read now clears the timestamp instead of stamping it, the same as a seek. The next monotonic read then starts from `_playStartMs`, which nothing but a genuine discontinuity (play, seek, rate change, detach) ever touches — an anchor that already reconstructs real elapsed time correctly on its own, without needing the correction to reason about a comparison point it has no way to make meaningful once audio was involved. A stall between two purely monotonic reads, with no audio in between, is unaffected and still corrected exactly as before. Two regression tests cover the transition: a real unread gap while audio was tracking correctly must not be discarded, and a sustained audio outage must still advance at real speed rather than being smoothed to nothing. Both were confirmed to fail against the prior commit's placement. * chore(core): trim clock comments |
||
|
|
0a1c6f5a45 |
feat(engine): sub-frame multi-sample motion blur, capture-level accumulation (#4019)
Deliverable one of issue #4010: average K sub-frame captures into each output frame so rotation, scale and opacity blur the way After Effects does, which the translation-only catalog component (#4008) cannot do. Opt in per render with CaptureOptions.motionBlur; absent means the capture path is unchanged. The blocker was quantizeTimeToFrame flooring every seek onto the output frame grid, which collapsed all K samples onto one instant and made the averaged frame byte-identical to the unblurred one. quantizeSeekTime now owns that decision at all three quantize sites (runtime player, its no-timeline fallback, and the init transport) and refines the grid by an integer subdivision count, which can only contain the output grid, never move a frame-time instant off it. The finer grid rounds rather than floors: a sample time round-trips through the page bridge as a float, and past a few million ticks that error exceeds the floor epsilon. Accumulation sits inside captureFrameCore AFTER the static-dedup early return, so a static frame still costs one reused buffer and only moving frames pay K. It is not a before-capture hook, which would have disabled dedup outright. Callback invariant: one eventful seek per output frame at the frame time, then K suppressed sample seeks, then a suppressed restore to the frame time. The restore matters because a suppressed seek still moves the playhead, so without it the next frame's eventful seek would swallow the callbacks inside the shutter window. Scope of this deliverable: screenshot capture mode and PNG output. beginframe, drawelement and JPEG encoding are rejected with a named error rather than silently rendering unblurred. Video content is rejected for the same reason it is a documented limitation: injected frames are extracted per output frame and cannot follow a sub-frame seek. Blend defaults to sRGB, matching AE's non-linearised 8-bpc working space and the catalog component. Linear light is an explicit opt-in. Samples are folded into a running average as they are captured rather than held until the end, so peak memory is one accumulator plus one decoded sample instead of all K: at 1080p that is a constant 41 MB rather than 141 MB at 16 samples and 540 MB at the 64 maximum, on every frame of the render. PNG chunk CRC32 now has one owner in utils/crc32.ts, shared by the new encoder and ffprobe's metadata reader. The encoder previously imported zlib's crc32 by name, which throws at module evaluation on Node 22.0 and 22.1; ffprobe already carried the guarded version and the comment explaining why. The sRGB transfer function is likewise exported once and shared. Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> |