Skip to content

Add opt-in noise tolerance to Visual Metrics frame elimination#2528

Merged
soulgalore merged 2 commits into
mainfrom
noise-tolerant-visual-metrics
Jul 20, 2026
Merged

Add opt-in noise tolerance to Visual Metrics frame elimination#2528
soulgalore merged 2 commits into
mainfrom
noise-tolerant-visual-metrics

Conversation

@soulgalore

Copy link
Copy Markdown
Member

Browsers can re-rasterize the whole page long after it is visually
done, leaving invisible sub-pixel noise on glyph edges. Duplicate
frame elimination allows only a handful of differing pixels, so on a
page-sized frame the noise counts as visual change: on
wikimedia.sitespeed.io a page visually complete at 1.2 s with no
network activity after 8 s reported Last Visual Change 17.9 s, with
VisualComplete95/99 and Speed Index inflated the same way.

Add videoParams.noiseTolerance, a percentage of the compared area
that is allowed to differ between frames. When set, a final
elimination pass drops every frame that does not differ from the
previously kept frame by more than the allowance; comparing against
the last kept frame keeps slow real changes, since the accumulated
difference eventually crosses the allowance. Off by default and the
new pass is skipped entirely, so existing metrics are unchanged;
instances that see the noise can opt in (0.05 fixes the Wikimedia
case while a real change as small as 20x20 px is still detected).

Co-authored-by: Claude Fable 5 noreply@anthropic.com

Browsers can re-rasterize the whole page long after it is visually
done, leaving invisible sub-pixel noise on glyph edges. Duplicate
frame elimination allows only a handful of differing pixels, so on a
page-sized frame the noise counts as visual change: on
wikimedia.sitespeed.io a page visually complete at 1.2 s with no
network activity after 8 s reported Laith
metrics JSON, VisualProgress, and the  where LVC ≫ VisualComplete85 should
collapse; runs without that signature his is also how you calibrate whether0.05 is right rather than trusting my synthetic estimate. I can write the replay/diff script now so it's ready the moment videos exist.
2. Regression tests in the repo. The synthetic generator + assertions I used (noise video,
real-small-late-change video, mid-run-hecked-in test — browsertime CI already has ffmpeg and Python for visual metrics. That converts "changes in visualmetrics.py require a lot of testing" from a fact into a solved problem, permanently. Happy to add it to the branch.
3. Production soak with a canary metric. Enable --videoParams.noiseTolerance 0.05 on the instance and
watch Grafana: LastVisualChange, Visuadex should step down on noisy pages —and FirstVisualChange must not move at all. FVC is the canary: the forward pass runs over the whole video, so if the tolerance were eating real small changes, FVC on pages with small first paints is where it would show first.

Change-Id: I42d46bdbef705aad8f5eee90f4d70deb1ff20577

--- commit message ---
Add opt-in noise tolerance to Visual Metrics frame elimination

Browsers can re-rasterize the whole page long after it is visually
done, leaving invisible sub-pixel noise on glyph edges. Duplicate
frame elimination allows only a handfuon a
page-sized frame the noise counts as visual change: on
wikimedia.sitespeed.io a page visually complete at 1.2 s with no
network activity after 8 s reported Laith
VisualComplete95/99 and Speed Index inflated the same way.

Add videoParams.noiseTolerance, a perca
that is allowed to differ between frames. When set, a final
elimination pass drops every frame tha
previously kept frame by more than the allowance; comparing against
the last kept frame keeps slow real changes, since the accumulated
difference eventually crosses the allowance. Off by default and the
new pass is skipped entirely, so exist
instances that see the noise can opt ia
case while a real change as small as 2.

Co-authored-by: Claude Fable 5 noreply
Change-Id: I1e97119695bddbda48df1c14218f26ccc21eb059
@soulgalore
soulgalore force-pushed the noise-tolerant-visual-metrics branch from df759f0 to a5fb9fb Compare July 20, 2026 05:47
@soulgalore
soulgalore merged commit 0241d7e into main Jul 20, 2026
17 checks passed
@soulgalore
soulgalore deleted the noise-tolerant-visual-metrics branch July 20, 2026 05:51
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.

1 participant