Skip to content

Retry a page that did not settle once, then save its differing frames - #83

Merged
tmashara merged 3 commits into
mainfrom
claude/issue-77-unsettled-retry
Oct 29, 2026
Merged

tmashara merged 3 commits into
mainfrom
claude/issue-77-unsettled-retry

Conversation

@tmashara

@tmashara tmashara commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

What / why

When more than 25% of a shot was unstable, page did not settle was thrown on the first try and nothing was written. That made it hard to tell a page that was slow once from one that really keeps moving, and gave no clue what was moving.

Now:

  • Retry once. The settle check requeues the job with retried: true, so the retry reuses the whole job body: the blank gate, the hook rerun and a fresh goto. done isn't bumped on a requeue, so [N/M] and the totals count each shot once. Results are still sorted by job order.
  • Frames on the second failure. capture() now keeps prev (the frame before png), but only on shots that ended unstable. For each unsettled side, both frames are written and listed as frames on the error result, left before right. The message gives one bounding box of the motion, e.g. page did not settle: 3144495px unstable at /love, again on retry; right: love.1440.right.unsettled-a.png vs -b differ within 1440×2183 at (0,96).

Files written

{slug}.{width}.{side}.unsettled-a.png and …-b.png, only for a side that ended unstable. ours() accepts them, so the out dir is still wipeable. files() returns an error result's frames, so --rerun-failed deletes stale frames once the shot passes.

Cut

Element naming. There's no locate() and no compare() of the two frames: the page is still moving, locate costs up to LOCATE_TIMEOUT, and on a reflow compare can return bands with no regions. Instead each side gets one mask bounding box. Two far-apart movers give one big box, and the frames show which is which.

How tested

  • /unsettled: the test now asserts 4 GETs (2 sides × 2 attempts), the again on retry message with its box, and 2 or 4 frames that exist as images and are named in the message.
  • New unsettled-once generated fixture: only its first render recolours. It must compare clean (code 0, no diff, no unstable pixels) after 4 GETs.
  • The interrupted-run wipe test also plants an x.1440.left.unsettled-a.png and asserts it gets wiped.
  • Without the src/ change, all three new assertions fail: 2 vs 4 hits, exit 3 vs 0, and the dir is refused as not wipeable. With it they pass.
  • npm run typecheck, lint, format:check, npm test (308 pass) and npm run test:visual (336 pass) are all green locally on macOS.

Docs updated: docs/output.md, docs/how-it-works.md, and skills/renderdiff/reference.md (the error table and the results.json fields).

Fixes #77

🤖 Generated with Claude Code

tmashara and others added 2 commits October 29, 2026 18:56
The settle check requeues the job once. If it fails again, each unsettled side's
last two frames are written as <shot>.<side>.unsettled-a/-b.png, listed as
frames on the error result, and the message gives the box they differ in.

Fixes #77

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmashara
tmashara force-pushed the claude/issue-77-unsettled-retry branch from a188fcd to b8d4f2d Compare October 29, 2026 17:59
# Conflicts:
#	tests/fixtures/pages/README.md
@tmashara
tmashara merged commit 15e7981 into main Oct 29, 2026
3 checks passed
@tmashara
tmashara deleted the claude/issue-77-unsettled-retry branch October 29, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"page did not settle": retry once, then save the differing frames

1 participant