Skip to content

test(player): playbench measures first play, audio joins, automation, cuts and the autoplay fallback - #6418

Merged
miguel-heygen merged 2 commits into
mainfrom
test/player-playbench
Oct 26, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
test/player-playbench

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

What

bun run playbench in packages/player: plays a composition in headless Chrome and prints the numbers for five player problems reported by a user's detailed report. It ships two fixture edits generated on our own media: a 3-take edit (24.8 s, 30 fps, 6 media elements) and a 10-take edit (53.08 s, 25 fps, 20 media elements).

No visible change

Test tooling only; the one non-test edit adds a playbench script to packages/player/package.json. No Studio or player behaviour changes.

Why

The fix lanes for first play, audio joins, automation and the autoplay-blocked fallback need one shared before/after measurement, so each fix is judged on the same numbers.

Related work

None open on this surface.

How

  • Follows tests/browser/player-box.ts (standalone bun script), tests/perf/runner.ts (launchBrowser) and tests/perf/browsers/make-media.sh (media generated at run time, gitignored _media).
  • instrument.js is injected into every frame: rVFC on every video, a per-rAF sample against __player.getTime(), AudioParam calls wrapped, and an AudioWorklet on the destination reporting which stretch of the file is heard.
  • analyze.ts is pure, covered by 6 vitest tests (no real timers).
  • --audio sink|none|both, --edit primary|tentake|both, --runs N, --blocked (unmuted play() rejects, which exercises the parent-proxy fallback).
  • Run with a real sink (PulseAudio null sink, 48 kHz) and without one. Fixture media has a keyframe every second.

Printed per problem: overrun frames at cut 1 after first play; joins with a mid-play audio seek in the first 600 ms and their jump sizes; automation landing offset; incoming second-frame gap and playhead hold per cut; takes heard in the blocked fallback.

Test plan

  • Unit tests added: vitest 6/6, three runs in a row; dropping the visibility filter fails a test
  • Manual testing performed: full runs on a Linux box, Chrome 156, with and without a sink
  • Documentation updated (not applicable)
  • Comments follow CONTRIBUTING.md

Baseline tables on origin/main follow in a comment once the final runs finish.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES · 1 blocker · 1 important · 0 nits · head 8ae2ce78

  • blocker: the required check PR captures / Studio and player captures fails. The body has no Before/After sections and no No visible change section. Everything else in the diff is under tests/, so the only watched change is 5 lines in packages/player/package.json. Adding a ## No visible change heading to the body should clear it.
  • important: problem 5 uses the wrong clock (↓ inline).
Scope

Read all 9 files end to end. I simulated the make-media.sh marker tones against the worklet's Goertzel decode over both files: 96–99% of 0.1 s windows decode to within ±0.75 s, which is enough for the >50% rule. CI at review time: CI typecheck/lint/Test (support) green, Player perf green, PR captures red, Safari perf/Windows/CodeQL still running. No prior reviews.

— Genesis

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 165 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-pct-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

…yhead

The host page has no player, so its samples carry no playhead.

The windows fell back to nominal cut times.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: APPROVE — 2 resolved, 0 open, 0 new · 8ae2ce78 → fc5ef49c

— Genesis

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 7d6c02f Oct 26, 2026
116 of 117 checks passed
@miguel-heygen
miguel-heygen deleted the test/player-playbench branch October 26, 2026 15:33
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Oct 26, 2026
Merge 8 upstream commits (85dcc19..7d6c02f: heygen-com#6418, heygen-com#5273, heygen-com#6245, heygen-com#5593,
heygen-com#5447, heygen-com#6415, heygen-com#6373, heygen-com#6375). Keep the fork's Windows-only ci.yml. For
cancellableProcess.ts take upstream's heygen-com#5273, which supersedes the fork's own
744a620 port (same StringDecoder design, but the output limit counts raw
bytes). Record the batch in docs/DECISIONS.md, mark heygen-com#6373/heygen-com#6375/heygen-com#6415/heygen-com#6418
as merged, and advance the commit watermark to 7d6c02f.

Co-Authored-By: Claude Sonnet 5.5 <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