Repository navigation
fix(producer): shader transitions blend in Node when the page cannot composite them - #7840
Conversation
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 0539c8781b8ee28414dfb485676be2b6a6fbcf0b.
No introduced blocker found. pageInstallsShaderCompositor observes installation rather than sniffing a browser version, closes its probe in finally, and reuses the existing layered path when the compositor canvas is absent.
Validation:
- Full build and all 304
renderOrchestrator.test.tstests pass. Forcing the probe to always report installed fails the new branch test. - Native Chrome 152.0.7977.42, regression harness: the unavailable-compositor fixture matches its golden at all 100 checkpoints. Reverting the orchestrator change produces 46 failed checkpoints, minimum 10.97 dB. I inspected the golden at 1.15 seconds: it visibly contains the glitch transition.
- The working-compositor fixture produces byte-identical output.mp4 files on base and head, retaining page-side capture without Node blending. Its golden mismatch is unchanged on both trees: 41 checkpoints, minimum 37.69 dB.
Pre-existing limitations: this is not fallback on every failure. The catch at renderOrchestrator.ts:4712 retains page-side mode after a probe error; canvas presence does not establish that every shader program initialized; GIF still has no Node layered fallback. The patch improves the missing-canvas case without worsening those cases.
Not tested on dev: local native renders and regression/mutation tests instead. I did not run Chrome 156.0.8078.80 or 157, or a newer shader-transitions build.
Need: yes · Size: ok · Reuse: existing layered compositor and capture plan · Simpler: already minimal · Structure: fine (checked installer and capture routing; no split)
Risk: medium — selects the shader render route.
Verdict: APPROVE
Reasoning: The missing-compositor regression is reproduced and fixed, while the working-compositor control stays byte-identical on the tested browser.
— Rames
jrusso1020
left a comment
There was a problem hiding this comment.
Approve. Re-reviewed at 4c13ff07696857543eba17444ee01804d08868c1. The only change since the last approval (0539c878) is minPsnr going from 45 to 30 in this fixture's meta.json. No code or golden changed. 30 is what 64 of the repo's fixtures use.
30 dB still catches the regression it was added for. This is a 2 s clip with the glitch transition at 0.75 s to 1.6 s. The harness checks 100 evenly spaced checkpoints against maxFrameFailures: 0, so about 40 of them land inside the transition. To bound what a render without the transition would score, I compared each frame of the committed golden against a pure scene A frame and a pure scene B frame. A flip render shows one or the other. Frames 24 through 47 (0.77 s to 1.53 s) are below 30 dB against both: the best of the two tops out at 26.8 dB, and most sit at 9.5 to 14 dB. Wherever the flip lands, that is about 24 failing frames where zero are allowed. Distributed modes floor at 10 dB but take the max with the fixture's 30, so they are unaffected.
The fixture's shard (regression-shards shard-3) passes at this head.
— Rames
* chore: release v0.9.53 * chore: release v0.9.53 notes include heygen-com#7836 and heygen-com#7839 * chore: release v0.9.53 notes include heygen-com#7840 and heygen-com#7843
What
A render with shader transitions uses page-side compositing only when the composition's own
@hyperframes/shader-transitionsbuild actually installs its compositor in this browser. When the build declines, the render blends the transitions on the Node-side layered path instead of capturing the bare opacity flip.Why
On Chrome 157 every shader transition renders as a plain overlap of the two scenes. Chrome 157 replaced
<canvas layoutsubtree>withcontent="drawable". #7626 taught the engine's fast capture the new form, but@hyperframes/shader-transitionsstill probes onlylayoutSubtree, so its page-side compositor declines to install:The producer had already chosen page-side compositing before the page loaded, and so bypassed the Node-side blend:
Neither side drew the shader. Compositions load a pinned shader-transitions build, so teaching the package the new form would not help projects that already exist. The producer has to follow what the page did.
Related work
Refs #7626 (fast capture on Chrome 157+).
How
pageInstallsShaderCompositor(renderOrchestrator.ts) loads the page with the page-side stub and checks for the canvas every published shader-transitions build adds once its compositor installs,#__hf-page-side-compositor. That id has been unchanged since the compositor shipped.Test plan
New regression fixture
page-side-shader-compositor-unavailable: a copy ofpage-side-shader-compositor-render-compatwhose page deletesHTMLCanvasElement.prototype.layoutSubtreebefore the shader-transitions build loads. That reproduces Chrome 157's condition on CI's Chrome 152. Its baseline was generated with--updateinDockerfile.test. It uses the repo's usualminPsnrof 30: the layered shader blend differs a little between machines (CI's runner bottomed out at 39.4 dB in the transition frames), while the bug scores about 11 dB.Lowest-scoring checkpoints, regression harness, lowest PSNR against the fixture's baseline:
page-side-shader-compositor-unavailable, Chrome 152Dockerfile.test(layered route)page-side-shader-compositor-render-compat, Chrome 152page-side-shader-compositor-render-compat, Chrome 157page-side-shader-compositor-render-compatis inexcludedinshard-schedule.jsonand does not match its baseline on this machine on main either (37.69 dB, both natively and inDockerfile.test), so its column compares main to this PR, not to a pass. On Chrome 157 its page-side baseline and the layered render draw the transition at different scales, so the PSNR stays low even though the shader is back. I checked those frames by eye. The new fixture goes intotimings, so CI runs it.fails without the fix:
page-side-shader-compositor-unavailable(regression harness) fails on main against its baseline: 44 of 100 checkpoints under the 30 dB threshold, lowest 10.97 dB, because the bare opacity flip is captured. "answers from the canvas every published shader-transitions build adds once it composites" inpackages/producer/src/services/renderOrchestrator.test.tsfails when the check always answers "installed".pageInstallsShaderCompositor, 2 tests, 3 runs in a row; the wholerenderOrchestrator.test.tspasses (304).bun run typecheckinpackages/producer,oxlintandoxfmt --checkon the changed files.page-side-shader-compositor-render-compaton Chrome 152 and Chrome 157, before and after.Not exercised:
usePageSideCompositing: false.content="drawable". None is published yet; with one, the check simply answers "installed".