Skip to content

test(producer): regression fixtures for amix crash + remote media bugs#1148

Open
miguel-heygen wants to merge 4 commits into
mainfrom
producer-regression-tests
Open

test(producer): regression fixtures for amix crash + remote media bugs#1148
miguel-heygen wants to merge 4 commits into
mainfrom
producer-regression-tests

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

Summary

Two new producer regression fixtures to prevent #1140 and #1146 class bugs from silently re-entering.

audio-multi-track-mix (guards against #1140amix normalize=0 crash)

  • Three local sine-wave tracks (440/660/880 Hz) at staggered start times and distinct volumes (0.6/0.8/1.0)
  • minAudioCorrelation: 0.85 — fails if output goes silent (the exact failure mode from the taco composition incident)
  • No network dependency — all assets local

remote-media-localize (guards against #1146 — remote S3 src → black frames + no audio)

  • Remote S3 <video crossorigin="anonymous"> + <audio crossorigin="anonymous">
  • Compiled-HTML snapshot verifies both src attrs are rewritten to _remote_media/ paths — fails if localization stops running
  • PSNR check verifies video frames are not black — fails if video regresses to black
  • minAudioCorrelation: 0.85 — fails if audio disappears again
  • Crossorigin stripped from both elements (verified in snapshot)

Baselines

Generated inside Dockerfile.test rebuilt from main@9ead3a83 (post-fix). Audio confirmed via ffprobe: both outputs have H.264+AAC streams at the expected durations.

Test plan

  • bun run --cwd packages/producer docker:test audio-multi-track-mix passes
  • bun run --cwd packages/producer docker:test remote-media-localize passes
  • Both pass with --mode=distributed-simulated (or skip if fixture constraints apply)

miguel-heygen and others added 4 commits June 1, 2026 17:49
Adds two regression test fixtures that lock in fixes from #1140 and #1146
so these failure modes cannot silently regress.

audio-multi-track-mix (#1140):
  Three local sine-wave tracks at staggered start times and distinct volumes.
  Catches any regression where the amix filter graph breaks and output goes
  silent (the normalize=0 FFmpeg 4.x crash pattern).

remote-media-localize (#1146):
  Remote S3 <video> + <audio crossorigin="anonymous"> composition.
  Compiled-HTML snapshot verifies src attrs are rewritten to _remote_media/.
  PSNR check verifies video frames are not black.
  Audio correlation check verifies audio was not silently dropped.

Baselines generated via Dockerfile.test (see packages/producer/tests/README.md).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated inside Dockerfile.test (hyperframes-producer:test, rebuilt from
main@9ead3a83 to include #1140 and #1146 fixes).

audio-multi-track-mix: H.264+AAC 4s, 3 sine tracks audible at correct
relative volumes. Catches silent-output regression from amix normalize=0.

remote-media-localize: H.264+AAC 3s, compiled.html snapshot shows both
<video>/<audio> srcs rewritten to _remote_media/ and crossorigin stripped.
Catches black-frame + no-audio regression from remote S3 localization gap.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
audio-multi-track-mix → shard-7 (lightweight, local assets)
remote-media-localize → shard-6 (alongside chat, same S3 bucket dependency)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two bugs caused the regression fixture to fail in test mode (not --update):

1. HTML comment contained angle-bracket element text that the compiler's
   regex timing pass matched as real video/audio elements. These phantom
   elements (hf-video-0, hf-audio-0, etc.) had data-start but no data-end,
   causing validateElementTiming to report errors on the actual compiled HTML.
   Fix: rewrote the comment to avoid angle-bracket syntax.

2. 3s duration caused an "Unable to parse PSNR output at 2.98749s" error
   on the last-frame boundary. Bumped to 4s to give breathing room.

Both baselines regenerated inside Dockerfile.test (same Docker image,
same Chrome/ffmpeg build as CI).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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