fix(core): root-cause id-less media wash in timingCompiler getAttr, drop the band-aid#1792
Merged
Merged
Conversation
…d-aid The blank-wash/dropped-audio fix in #1790 added assignMissingMediaIds in the producer to stamp ids onto id-less timed media. That was a band-aid: the real cause is timingCompiler's getAttr, whose regex had no name boundary at all, so getAttr(tag, "id") matched the trailing id="…" inside data-hf-id="…". compileTag saw a phantom id and skipped its existing hf-video-N/hf-audio-N injection, leaving the element with no real el.id — which the render pipeline keys off of. Fix getAttr with the same (?<![\w-]) lookbehind used for the lint readAttr fix. compileTag's auto-id injection now fires for data-hf-id-only media, in both the main composition and sub-compositions (parseSubCompositions runs the same compileTimingAttrs pass), so assignMissingMediaIds is removed entirely. Extends the regression fixture with a standalone id-less <audio> (the dropped- audio side, previously untested) and raises minAudioCorrelation to 0.9. Adds a timingCompiler test for the data-hf-id/id boundary.
…udio A continuous sine anti-aligns under the audio cross-correlation (correlation -1.0 from a sub-period offset). Broadband seeded noise correlates robustly.
…e video-only The audio render-baseline used synthetic sine/noise, which anti-aligns under the harness audio cross-correlation (deterministic -1.0). Real audio fixtures are unaffected. Cover the audio side of the boundary fix with a deterministic timingCompiler unit test (id-less <audio> gets hf-audio-N) instead, and keep the render fixture video-only.
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.
Follow-up to #1790. That PR fixed the blank-wash/dropped-audio symptom with a producer-side band-aid (
assignMissingMediaIds). This fixes the actual root cause and removes the band-aid.Root cause
timingCompiler.tsgetAttrbuilt its regex with no name boundary at all:So
getAttr(tag, "id")matched the trailingid="…"insidedata-hf-id="…"and returned a phantom.compileTagsaw a "present" id and skipped its existinghf-video-N/hf-audio-Ninjection, leaving the element with no realel.id— which every render stage keys off (__render_frame_<id>__, runtime frame-swap,audio[id][src]). Hence the blank wash + dropped audio. Same bug family as the lintreadAttr\bissue fixed in #1790.Change
getAttr→(?<![\w-])lookbehind (one line).compileTag's auto-id injection now fires fordata-hf-id-only media, in both the main composition and sub-compositions (parseSubCompositionsruns the samecompileTimingAttrspass).assignMissingMediaIds— redundant once the root is fixed (net −4 lines).timingCompilerunit tests for the video + audio id-injection boundary; regression fixture baseline regenerated on linux/amd64 (nowhf-video-0fromcompileTag).Review findings (from post-merge review of #1790)
getAttrboundary bug → fixed at root; band-aid removed.timingCompilerunit test (id-less<audio>→hf-audio-N). The render fixture stays video-only: a synthetic sine/noise audio track anti-aligns under the harness audio cross-correlation (deterministic −1.0); real audio content is unaffected, so a brittle audio render-baseline wasn't worth it.compileTagauto-id is long-standing intended behavior, and the loud signal is the (now-fixed)media_missing_idlint rule.studio_missing_editable_idwarning still fires for id-less media — correct and unchanged; a realidremains the contract for Studio targeting / GSAP selectors. The compiler auto-id is a render safety net, not a license to omitid.