Repository navigation
fix(producer): segmented and sequential capture check drawElement samples - #7255
Conversation
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head 24686388
- blocker (PR body, process gate): a fix PR here needs a
fails without the fix:line that names a test. The body has only "Fails without the fix. The segmented tests go red…", which doesn't name one. I checked the claim, and it holds: with the two newverifyDrawElementSamplecalls removed, exactly these 4 fail and 69 pass. Adding this line clears it:
- fails without the fix: "drawElement self-verify > compares every armed sample against its ground truth" and "> fails the render before a sample below the floor is encoded" (captureSegmentedStage.test.ts); "drawElement self-verify on the sequential loop > compares the armed sample against its ground truth" and "> fails the render on a sample below the floor" (captureStreamingStage.test.ts).
I found no code blockers. Once the body is fixed, this is an approve.
Scope
Read the whole diff. The extraction matches the old drain-guard body, and the only change is that stats is now optional. The drain guard still passes stats, so its telemetry is unchanged. verifyDiskDrawElementSamples doesn't run on either new path: segmented doesn't go through parallelCoordinator, and streaming is skipped. Truth frames exclude deRiskFrames, so screenshot-substituted risk frames aren't compared. The error is thrown before writeFrame on both paths. At head, the 73 tests in captureSegmentedStage and captureStreamingStage pass under bun.
— Genesis V2 reviewer
There was a problem hiding this comment.
Verdict: APPROVE — 1 resolved, 0 open, 0 new · 24686388 (head unchanged). The body now has a fails without the fix: line naming the 4 tests, the same 4 I saw fail with the two new call sites removed. Some CI runs on this head were cancelled and others were still running; none had failed.
Edit accuracy: accurate 267 (base branch 267), smooth 118 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (1)
|
…view Adopts heygen-com#7240 (deferred frame extraction leaves the distributed code), heygen-com#7241 (a capture segment extracts and deletes its own frames), heygen-com#7255 (segmented and sequential capture check drawElement samples), heygen-com#7254 (normalize-audio --reference stops short of the peak ceiling), heygen-com#7256 (engine names a failed script's origin first), heygen-com#7258 (SVG gradient text judged by its stops) and heygen-com#7242 (windowed source frames, off unless HF_VIDEO_FRAME_WINDOW=true). Release v0.9.17 is not synced wholesale; the producer packed budget takes upstream's +12000 from this range. Watermark advances to 32eb4c3. Co-authored-by: Vance Ingalls <[email protected]> Co-authored-by: Miguel Ángel <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
What
Segmented capture, and the streaming stage's sequential loop (drawElement without worker encode), now run the drawElement self-check: at each sampled frame, the drawElement frame is compared against the screenshot taken before the canvas was injected, and a frame below the PSNR floor fails the render with
DrawElementVerificationErrorbefore it reaches the encoder.Why
The check existed only inside the streaming stage's drain guard. The segmented stage and the streaming sequential loop both capture with
captureFrameToBufferand never readsession.deVerifyFrames, so a drawElement render on either path had no quality net: a damaged frame was encoded and shipped. This has to land before segmented capture becomes the default.Related work
Refs the segmented capture work (Phase 2). Does not touch the GPU-less Linux BeginFrame hang or its stack.
How
createDrainFrameGuardinto one exported function,verifyDrawElementSample. The drain guard calls it exactly as before, so the worker-encode drain does not change.captureSegmentFramesand the streaming sequential loop call the same function on every frame before writing it. Sessions not in drawElement mode, and frames that are not samples, return immediately.captureFrameToBufferalready runs the engine's own blank guard on this path.DrawElementVerificationError(renderOrchestrator.segmentedDeRetry.test.ts), so nothing changes there.Test plan
DrawElementVerificationError, and is never written to the encoder.DrawElementVerificationError.captureSegmentedStage.test.tsandcaptureStreamingStage.test.ts: 73 pass, 3 runs in a row.renderOrchestrator.segmentedDeRetry.test.ts(vitest): 7 pass, 3 runs in a row.tsc --noEmit(producer), oxlint and oxfmt on the changed files: clean. Run on a Linux box.