Skip to content

fix(producer): reject regression audio stream mismatches - #5228

Merged
jrusso1020 merged 10 commits into
heygen-com:mainfrom
user-github-me:fix/producer-audio-presence-regression
Oct 25, 2026
Merged

jrusso1020 merged 10 commits into
heygen-com:mainfrom
user-github-me:fix/producer-audio-presence-regression

Conversation

@user-github-me

@user-github-me user-github-me commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

A regression render can lose its audio track and still pass because the harness assigns correlation 1 when either side lacks audio. Require matching audio-stream presence before comparing envelopes. Both mismatch directions fail even with a zero correlation threshold; two silent renders still pass.

Preserve the reviewed silent pip-video-late-host baseline: 144 H.264 frames at 24 fps, six seconds, no audio stream. Its LFS content hash remains 7e29ebc1c3851394d7ca1abe2ef57d742b04f21911d4e1f72e5d7f7086d12ee5. The current-main integration retains the current integration-test classifications and refreshes their reachability fingerprint.

Validation: 46 harness/audio tests pass with their declared Bun/Vitest runners, including four real render audio-presence cases; five classification tests also pass. FFprobe and SHA-256 verification confirm that the exact reviewed silent baseline is retained. Producer rebuild/typecheck, classification and reachability checks, lint, formatting, normal commit hooks and both comment checks pass against the built current-main workspace.

#5297, which had the same tested commit, is closed as a duplicate. This PR retains the earlier review history and is the active review and merge target.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself reads correctly, but the required regression check is red at this head, and the cause is this PR's new rule, not a flake. It failed the same way on a rerun.

What fails. Shard 2, pip-video-late-host:

✓ Visual quality: PASSED (0 failed frames, threshold: 5)
✗ Audio stream mismatch: rendered=missing, snapshot=present
✗ Audio quality: FAILED (correlation: -1.000, threshold: 0)
❌ Test FAILED: Pip video inside late-starting sub-composition host

Why. The fixture's only media element is a muted <video> (src/compositions/pip.html) with no data-has-audio. So a render with no audio stream is the correct output. The committed output/output.mp4, though, carries a real AAC track (volumedetect: mean -25.2 dB, max -4.5 dB). That snapshot was last regenerated in #3928. #4625 put this fixture into CI later and changed only the HTML, not the snapshot. Under the old rule a one-sided audio stream scored correlation 1, so the stale snapshot passed. Your stricter check now catches it, which is the behavior this PR is meant to add.

To land this, the PR needs to keep regression green:

  • Regenerate packages/producer/tests/pip-video-late-host/output/output.mp4 with the Docker baseline flow, so the snapshot matches the muted composition (no audio stream). Include it in this PR.
  • Then check whether any other fixture with a muted-only composition has an audio-bearing snapshot. Only shard 2 reached a verdict here. Shards 1, 3, 4, 7 and 9 were cancelled when shard 2 failed, so this run doesn't tell you whether they're clean.

I'll approve once regression is green at the new head.

— Rames

@jrusso1020

Copy link
Copy Markdown
Collaborator

Thanks for this, @user-github-me. This PR now has merge conflicts with main. Could you rebase it onto the latest main? Once it's conflict-free we'll review it and get it into the merge queue.

@miguel-heygen miguel-heygen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 69a31a0. The two things the earlier review asked for are done:

  • The pip-video-late-host snapshot is now a silent render. I pulled the LFS object at this head: one H.264 stream, 144 frames at 24 fps, 6 seconds, no audio stream, and its hash matches the description. regression passes, including the shard that runs this fixture.
  • Every regression shard ran to completion and passed under the stricter rule, so no other fixture has a snapshot whose audio presence differs from its render.

The branch also merges cleanly with current main now.

On the change itself: presence is based on whether any PCM comes back, so a silent but present track still counts as audio, and a failed extraction counts as missing. Against a snapshot that has audio, that now fails instead of quietly passing, which is the right direction. The new test goes through the real runTestSuite for all four combinations, and its two mismatch rows fail against the old condition, so it pins the fix.

#5297 is open with this same commit, so please keep one of the two so review and the merge queue happen in one place.

Verdict: APPROVE
Reasoning: The stricter audio check is correct, the stale snapshot is replaced with a verified silent one, and regression and every other check pass at this head.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed exact 69a31a0. The earlier blocking baseline concern is resolved.

The committed pip-video-late-host output matches its muted-only composition: independently verified SHA-256 7e29ebc1c3851394d7ca1abe2ef57d742b04f21911d4e1f72e5d7f7086d12ee5, one H.264 video stream, 144 frames at 24fps, six seconds, no audio stream. The previous audio-bearing snapshot is replaced.

packages/producer/src/regression-harness.ts:1379–1388 rejects either direction of audio-presence mismatch independently of the correlation threshold; both absent still passes, and both present retains correlation/residual checks. The four real-render cases exercise the actual runTestSuite with silent-but-present audio and assert visual/compilation success too. Reverting the presence gate makes the two mismatch cases fail while the matching cases pass; source restored and verified unchanged.

Fresh validation: 4 real-render cases + 5 audio-envelope tests pass under Vitest; 19 harness parse/PSNR tests pass under Bun; 5 classification tests pass. Discovery independently places the new test in the integration/Vitest lane, and the reachability fingerprint matches that classification. The relevant packages build successfully. Exact-head CI run 40068558469 names this commit and all 10 regression shards succeeded, including pip-video-late-host's shard 8; later skipped reruns add no execution evidence.

Audited: five changed files, surrounding harness result/failure/summary propagation, audio helper contracts, fixture source/binary and test classification/reachability. Fresh adversarial and review-gap passes completed. Unverified: full Docker regression was not rerun locally; unrelated current-main changes are outside this review. Pre-existing extraction failures can still be represented as empty audio on both sides; this change is an audio-presence check, not a general decoder-validity guarantee.

Need: yes · Size: focused guard and baseline correction · Reuse: existing envelope comparison and integration runner · Simpler: one symmetric presence gate · Structure: fine.

— hf-review

Verdict: APPROVE
Reasoning: The prior stale baseline is corrected, both audio-loss directions are caught by discriminating real-render tests, and the exact-head full regression run covers the fixture concern.

@jrusso1020
jrusso1020 added this pull request to the merge queue Oct 25, 2026
Merged via the queue into heygen-com:main with commit f2aa62b Oct 25, 2026
337 of 339 checks passed
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.

3 participants