From 2df837be9efbe1d4346ee7f19be806dd51c56f16 Mon Sep 17 00:00:00 2001 From: Vance Ingalls Date: Thu, 12 Nov 2026 22:51:07 +0000 Subject: [PATCH] test(engine): the blur trail mask covers the shutter's sweep, not only whole frames (#7624) A mover that moves further than its own width between frames leaves gaps in a trail built from whole-frame blur-off poses; the shutter's smear lands in them and read as a leak outside the trail (nightly seed 63098). The mask now adds the shutter's sub-frame poses, captured in time order. Seed 63098 joins the default seeds as the regression case. Co-authored-by: Claude Opus 5.5 --- .../motionBlur/differentialPage.ts | 21 ++++++++++++++++--- ...aptureMotionBlur.generated.browser.test.ts | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/packages/engine/src/services/__fixtures__/motionBlur/differentialPage.ts b/packages/engine/src/services/__fixtures__/motionBlur/differentialPage.ts index 7f4bcd7a31..b3032de6e2 100644 --- a/packages/engine/src/services/__fixtures__/motionBlur/differentialPage.ts +++ b/packages/engine/src/services/__fixtures__/motionBlur/differentialPage.ts @@ -76,17 +76,32 @@ export interface Measured { mask: Uint8Array; } +async function wholeFramesAndShutterSweep( + page: Page, + t: number, +): Promise<{ wholeFrames: Rgba[]; sweep: Rgba[] }> { + const whole = neighbourTimes(t); + const times = [...whole, ...shutterTimes(t)].sort((a, b) => a - b); + const wholeFrames: Rgba[] = []; + const sweep: Rgba[] = []; + for (const time of times) { + if (whole.includes(time)) wholeFrames.push(await captureFrame(page, time)); + else sweep.push(await captureFrame(page, time, { subFrameDivisions: SUB_FRAME_DIVISIONS })); + } + return { wholeFrames, sweep }; +} + export async function measureOutside( browser: Browser, f: BlurFixture, t: number, tier?: Tier, ): Promise { - const offFrames = await captureInOrder(await referencePage(f), neighbourTimes(t)); + const { wholeFrames, sweep } = await wholeFramesAndShutterSweep(await referencePage(f), t); const onFrame = await onFreshPage(browser, f, "on", (p) => captureFrame(p, t), tier); - const reference = offFrames[INVARIANTS.radiusFrames]; + const reference = wholeFrames[INVARIANTS.radiusFrames]; if (!reference) throw new Error("missing reference frame"); - const mask = trailMask(offFrames, radiusPx(f)); + const mask = trailMask([...wholeFrames, ...sweep], radiusPx(f)); const d = compareTiles(reference, onFrame, mask, "outside", { block: INVARIANTS.block, maxMae: INVARIANTS.outsideMaxMae, diff --git a/packages/engine/src/services/captureMotionBlur.generated.browser.test.ts b/packages/engine/src/services/captureMotionBlur.generated.browser.test.ts index ad2459eca2..96b1764fbd 100644 --- a/packages/engine/src/services/captureMotionBlur.generated.browser.test.ts +++ b/packages/engine/src/services/captureMotionBlur.generated.browser.test.ts @@ -21,7 +21,7 @@ import { } from "./__fixtures__/motionBlur/generate.js"; import { INVARIANTS } from "./__fixtures__/motionBlur/thresholds.js"; -const SEEDS = parseSeeds(process.env.HF_BLUR_SEEDS ?? "1,2,3"); +const SEEDS = parseSeeds(process.env.HF_BLUR_SEEDS ?? "1,2,3,63098"); const FAILURES_FILE = process.env.HF_BLUR_FAILURES_FILE; const REQUIRED = process.env.HF_BLUR_REQUIRED === "1";