Skip to content

Grow a delta with hunks within a level of its pixels - #110

Merged
nedtwigg merged 2 commits into
mainfrom
delta-growth
Nov 30, 2026
Merged

nedtwigg merged 2 commits into
mainfrom
delta-growth

Conversation

@nedtwigg

Copy link
Copy Markdown
Member

A delta grouped only identical pixels, so one visual change split whenever what was behind it differed by a level. On #108's batch, the new logo in the review UI's header was 4 deltas across 143 stories:

Stories Behind the logo Before Now
134 The page Offered Offered
4 A dialog's backdrop Offered Offered, with 1 more
4 Dark mode Offered Offered
1 Another dialog, whose backdrop is a level off (228,233,237 against 227,233,237) Never offered: too few Joins the dialog delta

Accepting the three offers now approves 143 of 143 stories, up from 142.

How it grows. Once every hunk is hashed, a straggler (a hunk whose pixels fewer than 3 stories have) joins the first delta of its size whose own pixels it's within a level of, in every channel, on both sides.

  • Deltas only grow, and two are never merged.
  • A straggler is compared with the delta's own pixels, never with another that joined, so a group can't drift.
  • Deltas are tried most stories first, counting every story whatever's decided, so a join doesn't change as images are approved.

What it costs. One comparison per straggler and delta of its size, stopping at the first pixel that's off by more than 1.

  • Only hunks up to MAX_FIT_AREA (500,000 pixels, both sides together) are fitted. Larger ones group only exactly.
  • Each story with a straggler is decoded once for all of them.
  • A delta's own pixels are held only during the pass.
  • On Replace favicon and UI mark with matched tilted-phone SVGs #108 the pass is 3 comparisons of 25×32 crops.

What the reviewer sees. A delta's row says how many stories are "within a level of the rest", and each of those says so as it's gone through, listed after the exact ones.

Accepting. Accepting a delta holds every key it covers, so a story's page redraws the hunks that joined too, wherever it's opened. The approval still redraws each story from its own image, so the tolerance only decides what's grouped.

docs/specs/ui.md → Repeated changes, its rationale, and the glossary's definition of a delta are updated.

Tested:

  • ui/test/deltas.test.ts covers finding stragglers, the fit, the area limit, joined scans, and accepting.
  • cli/test/deltas.test.ts still passes against the real differ.
  • I replayed Replace favicon and UI mark with matched tilted-phone SVGs #108's batch through the shared code.
  • I loaded it in the built UI against the public batch, read-only, where the offers appeared 11 s after the page opened.
  • A new story, pages-batch--a-delta-that-grew, shows a near match.

🤖 Generated with Claude Code

nedtwigg and others added 2 commits November 29, 2026 18:06
A hunk too few stories have joins the first delta of its size whose own
pixels it's within a level of, on both sides. On #108's batch, one logo
change was four deltas by exact pixels, and a dialog backdrop a level off
left one story out; now accepting the three offers finishes all 143.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Accepting a delta now holds the key of each hunk that joined it, so a
story's page redraws them wherever it's opened. Joins are applied to the
scans once, so offering, finishing, and listing group as before. Fitting
decodes each story once for all its hunks, keeps a delta's own pixels
only for the pass, and shares the order of deltas with the offers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nedtwigg
nedtwigg merged commit 7ecd5e4 into main Nov 30, 2026
5 checks passed
@nedtwigg
nedtwigg deleted the delta-growth branch November 30, 2026 06:00
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.

2 participants