Repository navigation
revert: stop releasing a WebGL context when its clip's window has ended - #7020
Conversation
Edit accuracy: accurate 271 (base branch 271), smooth 114 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (2)
|
There was a problem hiding this comment.
Requesting changes at 095217fd. The code is fine; this is a merge-gate block.
Blockers
- The PR is held, but approving it would merge it. The body says it is "held, not for merge, until a repro shows 3D blank on 0.9.x and back with the revert". In this lane, one approval on the head is enough for the merge loop to merge. The PR is not a draft and has no hold label. Its own evidence so far points the other way: two Three.js fixtures, with 1 and 3 workers, rendered byte-identical frames on 0.8.230 and 0.9.2. Approving now would ship the revert without the evidence the PR asks for.
- There is no
fails without the fix:line. The PR is a fix for the "3D vanishes from exports" report, so it has to name a test that fails without it. That test is the missing repro: a Three.js/WebGL fixture that renders blank on 0.9.x and renders 3D with this revert, for example with several workers or a nested clip whose window ends early.
What I checked (no code concerns)
- The diff is the exact inverse of #6984 (
26d6e3ee), apart from thepackedsize budget (461788 → 456397). It is current with main (ahead 1, behind 0).
To clear this: add the repro test and the fails without the fix: line, then re-pin the head here. I'll re-review it. Until then, keep it in draft or add a hold label so another approval can't merge it.
095217f to
ebfb8fb
Compare
|
Pushed ebfb8fb. What changed since the last head:
|
There was a problem hiding this comment.
Approving at ebfb8fba. I found no blockers. The earlier hold is lifted by the maintainer's decision to ship it today.
- Change: it removes only the three places where
frameCapture.tswires in the release (the import,evaluateOnNewDocument(recordWebglContexts)andreleaseEndedWebglContexts(page, quantizedTime)).webglRelease.ts, its unit tests,clipWindowand the size budget stay for the follow-up fix. Nothing outside tests still calls the module. - Fail-without-fix check: the
fails without the fix:line names one test, and I ran it both ways.- With this head,
webglRelease.test.tspasses (4/4). - With
frameCapture.tsput back as on main, the named test fails withexpected [ '3d' ] to deeply equal [], meaningloseContextwas called once, as the body says.
- With this head,
- Dead code:
webglRelease.tsis now only imported by its test. I ranfallow audit --base origin/main --fail-on-issueslocally on this head: "No issues in 50 changed files". - Main: the branch is one commit behind main, and that commit is #7015 (CLI catalog files only), so there's no overlap.
- Nit (not blocking): the test's page mock only acts on functions whose source contains
__hf_gl_contexts. That makes it a guard against the wiring coming back, not a 3D render repro. The repro is still owed for the real fix.
CI: CI, regression, Windows render verification and CodeQL were still pending or running when I reviewed. The runs that had finished passed, apart from one cancelled duplicate PR captures run (its rerun passed).
Stops the renderer from releasing a WebGL context when its clip's window has ended (the behaviour #6984 added), by removing the lines in
frameCapture.tsthat wire it in. The module, its unit tests,clipWindowand the size budget stay, so the follow-up fix can build on them.Why
A report says 3D (Three.js/WebGL) visuals vanish from some exports made with 0.9.2 and later. It is not reproduced yet: a first check on two Three.js fixtures with 1 and 3 workers found 3D present and the frames byte-identical on 0.8.230 and 0.9.2. #6984 is the one change that can blank a canvas for the rest of a render: it calls
loseContext()on a canvas whose clip's window ended at the current capture time, and a lost context never comes back, so parallel or out-of-order capture, or a wrong nested window, could release a canvas a later frame still needs. This ships by the maintainer's decision to remove that risk now.The real fix follows: release a context only when no later frame of any worker can need it, and recreate it on demand if one does.
Test
fails without the fix:
It drives a frame capture with a page holding an ended hidden clip's canvas and asserts
loseContextis never called; withframeCapture.tsas on main it is called once. It passes 3 runs in a row with this change; the frame-capture tests (349) pass, tsc and oxfmt are clean.Size
Four lines of wiring removed and one test added.