Repository navigation
fix(producer): a BeginFrame capture that draws no first frame in 20 s switches to screenshot - #6701
Conversation
Edit accuracy: accurate 271 (base branch 271), smooth 141 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (2)
|
There was a problem hiding this comment.
Verdict: APPROVE · 0 blockers · 0 important · 0 nits · head 8c46b848
The deadline only applies while beginframe sits at frame 0. Both stall errors it raises are already in shouldRetryViaPinnedFallback, so they retry on a screenshot session. With the field unset, stallBudgetMs gives back the same budget as before. Only the CLI's local-auto branch sets the field. All runs are green. Windows engine-cli hit its 16-minute step deadline on attempt 1 with no failing test, and passed when rerun.
Scope
I read the engine, producer and CLI diffs. The 10 compiled.html files are LFS-pointer churn. I checked that chromeLaunchFailure keeps the old detector order and titles. Not covered, by the body's own scope: the disk and segmented capture stages still use the plain stall budget, and the parallel watchdog arms only at frame_capture, as before.
Description
A local
hyperframes renderon a Linux host with software GL (Docker, CI, no GPU) can sit at frame 0 for minutes. Four recent reports on 0.8.214, all in Docker: capture stayed atframesCompleted=0for 120 to 240 s withcaptureMode=beginframe, then the automatic screenshot fallback rendered the film correctly, or the person gave up and reran with--no-browser-gpu.Local "auto" GPU opts out of the software-GPU screenshot clamp on purpose (#3927: BeginFrame on SwiftShader captured a 15 s card in 15.7 s against 19.0 s by screenshot), so these hosts run BeginFrame. On some of them BeginFrame never delivers its first frame. The only way out was the 60 s no-progress guard, and only once it armed, before the render retried on a fresh screenshot session.
A BeginFrame capture that draws no first frame in 20 s now gives up and takes that same screenshot retry. Once a frame is drawn, the usual 60 s no-progress budget applies. BeginFrame stays the default, so hosts where it works keep its speed, and a host where it hangs loses about 20 s instead of minutes. Both stall watchdogs in the streaming capture stage use it: the single-session loop, and the parallel one (two of the reports used
--workers 2and--workers 4).The 20 s deadline is a new engine config field,
beginFrameFirstFrameDeadlineMs, unset by default. Only the CLI's local render sets it, together with the existing local-auto opt-out from the screenshot clamp. No environment variable reads it.The cloud render path is unchanged. The cloud producer builds its own engine config and never sets the field. With the field unset,
stallBudgetMsreturns the stall budget exactly as before, and the existing parallel BeginFrame stall tests, which set no deadline, pass unchanged.handleRenderErrorwas over the complexity limit, so any change torender.tsfailed the pre-commit check. Its four Chrome-launch detectors moved intochromeLaunchFailure, with the same order and the same messages;render.launchFailure.test.tscovers it.Testing
fails without the fix: in
captureStreamingStage.test.ts,gives up on frame 0 at the first-frame deadline, not the ten-minute stall budgetandgives up on a parallel BeginFrame capture at the first-frame deadlineboth hang until bun's 5 s test timeout on main. Inrender.test.ts,forwards browserGpuMode='auto' into producer configfails on main because the deadline is missing from the config.captureStreamingStage.test.ts: 30 passed, 3 runs in a row;leaves a screenshot capture on the stall budgetshows a screenshot session keeps the full budget.render.test.ts: 113 passed; the--resolutioncase asserts no deadline is passed.tsc --noEmitfor engine, producer and CLI: clean. Fallow and the comment ratchet: clean.What I did NOT exercise
The BeginFrame hang itself. Four renders in Docker on a Linux box all progressed (same CLI, auto resolved to SwiftShader), so the deadline is tested against a simulated hang, not a real one. Why BeginFrame never answers on the reporters' hosts is still unknown.