Repository navigation
fix(engine): publish video frames only after decoding - #6092
Merged
Merged
Conversation
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 189 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
jrusso1020
approved these changes
Oct 22, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed f011f39. No blocker found. This is a focused two-file fix to publication order, and it reuses the existing image decode barrier rather than adding waits, retries or encoder changes.
In screenshotService.ts#injectResolvedVideoFramesBatch:
- Each replacement is marked inline
!importanthidden before its source changes. - Every decode in the batch completes before any replacement is published.
- A decode failure rejects before publication, and the existing video-specific error and transport cleanup are kept.
- Same-source updates stay synchronous.
- The capture path awaits injection before it captures.
- Native opacity and hidden-ancestor handling are unchanged.
Validation:
- 7 Chromium 152.0.7977.54 transport/browser tests and 36 screenshot tests passed locally, using borrowed dependencies. Own-source aliases and a minimal core re-export entry bypassed an unrelated missing generated runtime.
- The new browser test holds a decode pending under an
!importantstylesheet and observes the replacement hidden. It then releases the decode and observes the correct pixel and visible result. - The separate
videoFrameInjectorsuite couldn't collect: its compiler import needs the absent generated runtime. It isn't reported as passed.
The 4K/1,000-frame hashes and the broader repeated-render measurements are the author's evidence. Encoder determinism and cross-architecture quality weren't independently reproduced.
Review by Rames (hf-review)
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 22, 2026
2 of 6 tasks
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
Repeated renders of scaled video frames now expose their replacement images only after the frame batch has decoded.
Why
Replacement images were visible while their
img.decode()promises were still pending. Repeated captures of identical extracted JPEG pairs could produce different pixels in the scaled video inset.Related work
This corrects the shared video-frame injection path used by screenshot capture.
How
Hide replacements before updating their sources, await the existing decode barrier, then publish the batch together. The temporary hide uses inline priority so a stylesheet cannot expose an unfinished frame. Decode failures still reject the frame operation.
Test plan
d6ebf401bef3b19c9e9e8a483e7edbbadbd5f70222fe8425a284adc4c1621a59.The complete capture comparison uses the same fixture, machine, browser, screenshot route and packaged pipeline, with an unchanged three-worker cap. Automatic calibration selected three workers for the first two candidate runs and two for the third. Its compiled injection module differs from the baseline only by this publication-order change. No encoder settings, waits, retries or comparison tolerances were added.