From f78da2d674728f786c2c7c51f221550792960a84 Mon Sep 17 00:00:00 2001 From: Vance Ingalls Date: Wed, 11 Nov 2026 01:49:42 +0000 Subject: [PATCH] fix(engine): cap static-frame dedup verification at 60 s so it cannot outlast the first-frame stall (#7532) Long caption overlays plan thousands of verification screenshots, so the verification budget clamped at its 300 s ceiling in every render worker. That equals the producer's 300 s first-frame and session-init stall floor, so the stall always won and the render failed before its first frame. Verification fails closed on exhaustion (dedup is disabled for unverified runs and normal capture proceeds), so a lower ceiling costs only some frame reuse. Co-authored-by: Claude Sonnet 5.5 --- .../frameCapture-staticDedupVerifyDensity.test.ts | 6 +++--- packages/engine/src/services/frameCapture.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/engine/src/services/frameCapture-staticDedupVerifyDensity.test.ts b/packages/engine/src/services/frameCapture-staticDedupVerifyDensity.test.ts index fcdc540dd5..256e858cb2 100644 --- a/packages/engine/src/services/frameCapture-staticDedupVerifyDensity.test.ts +++ b/packages/engine/src/services/frameCapture-staticDedupVerifyDensity.test.ts @@ -135,8 +135,8 @@ describe("verifyStaticFramesSafe catches drift the old fixed-point density would expect(result.outcome).toBe("time_budget"); expect(result.verifiedFrames.size).toBe(0); - // 8 s shots: the 300 s ceiling, not the 15 s floor, ends it - expect(pageScreenshotCapture).toHaveBeenCalledTimes(38); + // 8 s shots: the 60 s ceiling, not the 15 s floor, ends it + expect(pageScreenshotCapture).toHaveBeenCalledTimes(8); }); }); @@ -256,7 +256,7 @@ describe("composition-wide static verification planner", () => { { now: () => nowMs, capture: async () => { - nowMs += 1_000; + nowMs += 500; return Buffer.from("same"); }, }, diff --git a/packages/engine/src/services/frameCapture.ts b/packages/engine/src/services/frameCapture.ts index 880a13e18e..82e82b4d1b 100644 --- a/packages/engine/src/services/frameCapture.ts +++ b/packages/engine/src/services/frameCapture.ts @@ -3929,12 +3929,12 @@ export async function computeStaticFrameSet( const STATIC_VERIFY_REFERENCE_STRIDE = 24; // Wall budget for verification: 15 s is the floor; above it the budget is 1.5x -// planned shots x the first shot's seek+capture time, capped at 300 s (nothing -// was gained past 600 s on a 4K job). Exhaustion fails closed: dedup is -// disabled for the unverified runs and normal capture proceeds. +// planned shots x the first shot's seek+capture time, capped at 60 s so it ends before +// the producer's 300 s first-frame stall that every worker's verification runs inside. +// Exhaustion fails closed: dedup is disabled for unverified runs and capture proceeds. const STATIC_VERIFY_MAX_MS = 15_000; const STATIC_VERIFY_HEADROOM = 1.5; -const STATIC_VERIFY_CEILING_MS = 300_000; +const STATIC_VERIFY_CEILING_MS = 60_000; // Two captures (anchor + comparison) are the minimum proof for a run. Four hundred // therefore permits 200 fully verified runs while bounding pathological schedules. const STATIC_VERIFY_MIN_SCREENSHOT_CAP = 400;