Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<Measured> {
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: seed 63098 only reproduces #7596 while generate.ts keeps producing the same composition for it. A change to the generator (a new feature, a reordered draw) quietly turns this into a different random case, and the test still passes. If you want the check to last, add a cheap assertion that generateComposition(63098) still has the leftTop/svgClip/onUpdateMover/tlCall features, or copy the case into a fixed fixture.

const FAILURES_FILE = process.env.HF_BLUR_FAILURES_FILE;
const REQUIRED = process.env.HF_BLUR_REQUIRED === "1";

Expand Down
Loading