Skip to content

Fork patch: Probe data-var-src media whose value differs from its src - #14

Closed
valeriangalliat wants to merge 1 commit into
mainfrom
patch/probe-var-src-media
Closed

valeriangalliat wants to merge 1 commit into
mainfrom
patch/probe-var-src-media

Conversation

@valeriangalliat

Copy link
Copy Markdown
Collaborator

🤖 AI agent: Arcade fork patch. Do not merge.

This draft shows patch/probe-var-src-media against main, the upstream mirror, so the patch has one page for its diff, its revisions and its reason. Arcade's /hyperframes-update rebases the branch onto main and cherry-picks it onto arcade; this PR is not part of that flow. When a rebuild changes the patch, its git range-diff against the previous sync/<date>/probe-var-src-media tag is posted as a comment.

Not needed yet and not in scripts/arcade/patches.json. Arcade doesn't use data-var-src today. This is the prerequisite for moving scene settings onto HyperFrames variables (ARC-17433), and the first candidate to send upstream. Split out of #13.

Why

hasVariableBoundMedia only probes when render-level --variables set the bound variable. A value from the composition's declared default or a host's data-variable-values is applied by the runtime in the browser, while extraction reads the static src, so the export shows the fallback clip. HyperFrames' own lint treats a default that differs from src as normal (the src is the authored fallback), and its docs present data-variable-values as the way to give each instance its own values.

While inlining, the compiler now stamps data-hf-var-src-changed on bound <audio>, <video> and <source> when any value in its scope chain differs from the static src: the top-level declared defaults, or any enclosing composition's merged defaults and host values. The trigger probes when it sees the stamp. A bound clip whose value equals its src doesn't load the page. The comparison runs before remote sources are localized, while both still read as authored.

Review notes

  • The stamp checks every value the scope chain could supply rather than replicating the runtime's lookup, so a doubtful case loads the page and never exports a stale clip. The inlined scene keeps its authored data-composition-id inside the host's runtime id, which is why a nearest-scope lookup alone misses the host's values.
  • Same pattern as data-hf-auto-start: compiler stamps, probe trigger reads.
  • Images are unchanged: they render live in the page.

Verification

  • htmlCompiler.test.ts: a compiled sub-composition is stamped when the host value differs, stamped when the declared default differs, and left alone when the host value equals the src.
  • probeStage.test.ts: stamped versus unstamped bound clip. Upstream's hasVariableBoundMedia tests unchanged. 228/228 across both files. tsc, oxfmt, oxlint and lefthook clean.
  • Arcade render corpus on prod's a318cd008 plus this change (bundled with Fork patch: Probe untraced media src writes #13 at the time): two temporary data-var-src scenes, scene default and host override, pass; both export the stale clip without it.

Upstream

No issue or PR filed yet. Strong candidate: it's a gap in HyperFrames' own variables feature.

Drop when

Upstream probes data-var-src media whose declared default or host value differs from its src.

Arcade

ARC-17433 · ARC-17431

@github-actions

Copy link
Copy Markdown

Edit accuracy: accurate 271 (base branch 271), smooth 150 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

Unstable (1)

  • seqplainkeys-none-center-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

@valeriangalliat

Copy link
Copy Markdown
Collaborator Author

🤖 AI agent: Dropped at sync/2026-11-10. Upstream heygen-com/hyperframes#6501 (v0.8.207) loads the page for data-var-src media when the value comes from a mount's data-variable-values or a declared default on the root; both render correctly on 0.9.30, which the fork is now based on.

One case is left upstream: a default declared in the sub-composition file itself, with no value from the mount. That is reported as heygen-com/hyperframes#7505 with a repro. It is not carried here, because a host can pass the value on the mount instead.

The patch's history stays under the sync/2026-11-09/probe-var-src-media tag.

@valeriangalliat
valeriangalliat deleted the patch/probe-var-src-media branch November 10, 2026 18:01
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