You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tighten the visual tolerance, chosen by measurement
`maxDiffPixelRatio: 0.01` sounds small and is not. On a 1240x923 baseline it
permits 11,445 pixels to differ — a whole axis label, a moved legend, a bar that
changed height. It hid real changes three times: a reference line's label was
repositioned and the baseline did not regenerate, so the fix looked like it had
failed; 13 of 30 baselines turned out stale, one where every y-axis tick had
drifted from 12/24/36/48 to 10/20/30/40/50 at 0.986% of pixels; and before that,
a full change of axis label text from ISO dates to "Jan 3" passed as identical.
My first instinct was 0.001. Measuring showed that was still mostly blind.
Nudging every category label down two units — the kind of thing a refactor does
by accident — changed nine charts by between 339 and 10,505 pixels:
maxDiffPixelRatio 0.01 allows 11,445 caught 0 of 9
maxDiffPixelRatio 0.001 allows 1,144 caught 2 of 9
maxDiffPixels 100 allows 100 caught 9 of 9
So the fix is not a smaller ratio but a different shape. A ratio hands the
largest images the largest blind spot, and those are the charts with the most to
get wrong — the 10,505-pixel change slipped under 1% only because that baseline
is big.
100 absolute pixels still absorbs an antialiasing fringe. Four consecutive runs
pass on unchanged code, and the whole suite of 36 passes.
The reasoning is recorded in playwright.config.ts, including the instruction to
raise it deliberately if an upgrade makes it noisy rather than reaching for a
ratio again. The Known gaps entry in ROADMAP is closed and CLAUDE.md's testing
convention updated.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments