Skip to content

Glyph position drift flags identical screenshots as changed #15

Closed as duplicate

Description

@sentry-junior

Visually identical screenshots get flagged as changed. Example: getsentry/junior PR #2140 flags 12 screenshots, but the PR doesn't touch the dashboard (report).

Cause
Chrome places glyphs on fractional pixel positions. Some test runs lay text out a tiny fraction of a pixel to one side, so some letters get drawn at the next position. Edge pixels change colour by up to ~70, so no colour threshold filters them. Honeydiff's anti-aliasing filter removes 0 pixels here. Raising the threshold to 3.5 (1427d57), or even 12, still flags them.

  • It is all or nothing per test. In #2140, every shot from 3 tests flipped, and every other test was byte-identical.
  • The flipped rendering recurs identically across PRs. Two main-branch baselines were captured in it too, so every PR built on them gets flagged.

Proposed fix
After Honeydiff reports a change, accept the screenshot as unchanged only when every changed area:

  • keeps its total ink (in linear light), colour balance and row profile
  • moves its ink centre less than ~0.45px horizontally and ~0.16px vertically
  • changes no flat-colour pixels
  • is not explained by a whole-pixel move

Validation

  • 147 changed screenshots from 30 junior reports: all 71 drift-only changes hidden, all 76 real changes kept. The closest real change is 8x past a limit.
  • Pairs of main baselines: it hid only the 15 shots caused by the flipped baselines.
  • Synthetic edits are still flagged: 1px move, swapped digit, hue change, text 10% lighter.
  • pnpm check and pnpm action:smoke pass.

A branch with this change (packages/action/src/glyph-drift.mjs, wired into compare.mjs, plus tests) is ready as commit cc00a0a on top of b08384b. Junior can't push to this repo, so the patch is in the linked Slack thread.

via David Cramer.

--

View Junior Session [Sentry]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions