fix(producer): keep video captures viewport-bound on software#1788
Merged
Conversation
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
Fixes #1715 by stopping video compositions from forcing Chrome's beyond-viewport screenshot compositor under software rendering.
Why
The latest #1715 analysis checks out at source level: both the in-process renderer and distributed chunk renderer forced
captureBeyondViewport: truewhenever a composition had native videos. That preserves a hardware-rendering workaround, but on SwiftShader/software render hosts it sends every frame through a much more expensive full-surface compositor path. Distributed chunks are explicitly software-only, so they were always taking the slow path for video compositions.How
resolveVideoCaptureBeyondViewport(videoCount, browserGpuMode)so the video workaround is only enabled on resolved hardware rendering.resolveBrowserGpuMode(...)before building capture options.autotherefore uses the real probed hardware/software result, not the requested string.captureBeyondViewport: falsefor video chunks.undefined, so existing engine/browser defaults still apply.Test plan
Verification run:
bunx vitest run packages/producer/src/services/render/captureBeyondViewport.test.tsbun --filter @hyperframes/producer typecheckbun run format:checkbun run lintbunx vitest run packages/producer/src/services/render/captureBeyondViewport.test.ts packages/producer/src/services/renderOrchestrator.test.tsbun test --timeout 60000 packages/producer/src/services/distributed/renderChunk.test.tsbun --filter @hyperframes/producer buildgit diff --checkNote: I verified the source-level root cause and both affected call sites locally. I could not run the reporter's private benchmark suite from the issue thread, so the perf delta still needs validation on the same software-render host/fixture after merge.