Repository navigation
Recheck differing shots for content that varies per load - #66
Merged
Merged
Conversation
A differing shot reloads its right side once in a fresh context. Elements that differ between the two loads are painted out on both sides like a mask, left out of the score, never accepted, and listed with the --mask and config masks entry that would cover them. --no-recheck turns it off; --cache-right never rechecks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t's host as the mask Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / why
A counter, a rotating banner or an "N minutes ago" that differs between two loads of the same site reads as a regression today, so you only find it with a base-vs-base baseline. Now a shot with a difference reloads its right side once, in a fresh context. Any elements that differ between the two right loads are reported as
varies.total - unstable - varies). The painted area is the located element's box, or the region rect when no element was found. Painting only the pixels that changed between the two right loads would miss the left side's own value, and so would painting the cell rects when a digit happens to repeat between loads. The element box is exactly what the suggested mask would cover.--progresssummary:results.jsongetsvaries(regions withelements) andvariesPixels. Both are optional and only written when a recheck found something, so older files and the--cache-rightdeepEqualtest are unaffected.N px vary per load. evidence.html adds the noteN shot(s) vary per load (painted out).locate: if it fails for any reason, the shot keeps its first measurement. The context is created inside thetryand closed infinally.Behaviour changes
--no-recheckturns it off. It is CLI-only (no config key, not in the config hash), like--cache-right.--cache-right. A replay serves the same bytes on every load, so a recheck would find almost nothing, and it would also touch the HAR recording.clean:line, reusable, exit 0) but is still listed undervaries.unacceptablereturns"varies per load", for the same reason asunstable: the painted pixels change from run to run, so the region hashes don't reproduce. The fix is the printed mask.Cost
Shots with no difference cost nothing extra. Each differing shot pays for one more context create/close, one full right capture (one extra GET on the right origin), one more
compareand one morelocate. When something varies, it also pays one morecancelUnstableandcompare. That is roughly +50% wall time on a differing shot. During a redesign, where every shot differs, use--no-recheck.Cut
recheckkey, rechecking the left side, more than one recheck, and a cap on recheck count or area.variesregions, and avariestoken in compact rows or progress lines.textdiff: a shot that only varies hides its row anyway.page did not settle-style cap for varies: a mostly-varying page is listed with its pixel count.Known limits
How tested
tests/visual/guardrails.test.ts, masks):--no-recheckand also asserts that there is novaries./driftingplus/color./driftingis clean, hasdiffPixels0 andvariesPixels> 0, and its element isdiv.drift. Thevaries,--maskandmasks:lines are printed./colorstill differs and has novaries./driftingplus a left-onlyh1 { color: red }hook. It still differs and hasvariesPixels> 0, and--acceptprintscan't be (1 varies per load).mainand pass with this change. I ran them 6 times in a row and they passed every time.--helplists--no-recheck.npm run typecheck,npm run lint,npm run format:check,npm test(294 pass) andnpm run test:visual(332 pass) all pass on macOS. No accepted-diff hashes were recorded.docs/output.md,docs/how-it-works.md,README.md,skills/renderdiff/reference.md,skills/renderdiff/SKILL.md.Fixes #47
🤖 Generated with Claude Code