Repository navigation
perf(producer): the audio mix runs while capture starts its browsers - #6632
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head 0fb4477c
- blocker — required
CI › Producer: unit testsfails at this head:renderOrchestrator.masterBus.test.ts > the local renderer gives the shared audio stage its master chain and video clockexpects"audio stage reached"but getsNo network in unit tests: 127.0.0.1. ItsrunAudioStagemock throws to stop the render. With the stage no longer awaited atrenderOrchestrator.ts:3496, that rejection only surfaces at the join (:4538), so setup runs first and hits the file server. The test needs to stop the render some other way (or stub setup), and still check thatmasterFxChainand the video clock reach the stage.
Scope
Read the full diff and the setup window between the audio start and the join: no return or capture path runs before the join, hasAudio/audioOutputPath are only read after it, and pendingAudio's .catch keeps an early audio rejection from going unhandled. Other workflows were still running when this was posted.
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 120 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
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.
What
A render's audio mix now runs while capture sets up (file server, drawElement gate probe, calibration, worker sizing) instead of before it. Capture starts as soon as both are ready.
Why
The audio stage (decode, mix, AAC encode) ran to completion before capture setup began, but nothing in setup reads its output. Audio is first needed by the disk encoder input, encode observability and the final mux. So every render with audio waited for the mix and then for the browsers, one after the other.
Related work
None.
How
runAudioStagestarts at the same point and with the same arguments, but is no longer awaited there.await audioStage), with its perf, limiter and warning-policy handling moved unchanged, sits right after the capture plan and encoder preset resolve, before any capture path runs. SohasAudio/audioOutputPathare settled before the disk encoder input is built, exactly as before.--strict, an audio failure still fails the render; it now surfaces after setup instead of before it.Test plan
renderOrchestrator.audioOverlap.test.tsholds the mix open and checks that worker sizing ran while it was pending, and that a setup failure is reported only after the mix settles.renderOrchestrator.audioOverlap.test.ts > sets up capture while the audio mixes, and a failure waits for the mix. With only the test applied, worker sizing never runs before the mix is released. With the error-path wait removed, the failure arrives while the mix is still running.renderOrchestrator.masterBus.test.tsstopped the render by throwing from the audio stage, which now surfaces only at the join. It now stops at capture setup's file server and still checks the master chain and video clock reach the audio stage: 1 passed.tsc --noEmit(producer) exit 0; new test 1 passed;renderOrchestrator.stall.test.ts7 passed; oxfmt and oxlint clean.Before / after
Published
[email protected]vs the same bundle with only this change, Apple M4 Pro (14 cores, 24 GB),hyperframes render, repo fixtures with an audio track, interleaved, 5 runs each, medians.wall - compiledrops compile, which is network-bound for these fixtures (a remote video).style-11-prod, 1080x1920, 14 s, audiooverlay-montage-prod+ one mix-blend layer, 42 s, audioThe CLI's stage line still reports
audiowith its own duration; it now overlapssetup.