Skip to content

Remove maxDiffPixelRatio tolerance from screenshot tests#271

Merged
frewsxcv merged 4 commits intomainfrom
remove-max-diff-pixel-ratio
Mar 10, 2026
Merged

Remove maxDiffPixelRatio tolerance from screenshot tests#271
frewsxcv merged 4 commits intomainfrom
remove-max-diff-pixel-ratio

Conversation

@frewsxcv
Copy link
Copy Markdown
Collaborator

Summary

  • Remove maxDiffPixelRatio from global Playwright config, expectScreenshot helper, and raster layer tests
  • Snapshots are generated and compared within CI on the same platform, so pixel-ratio tolerance shouldn't be needed
  • If tests fail without tolerance, it will surface the actual source of non-determinism rather than masking it

Test plan

  • CI screenshot tests pass without tolerance
  • If any tests fail, investigate the specific source of non-determinism

Snapshots are generated and compared within CI on the same platform,
so pixel-ratio tolerance shouldn't be needed. If tests fail, it will
help identify the actual source of non-determinism rather than masking
it with tolerance.
@frewsxcv frewsxcv enabled auto-merge March 10, 2026 07:10
GPU rendering with --use-angle=default produces 1-3% pixel differences
between CI runs due to hardware GPU non-determinism. SwiftShader is a
CPU-based WebGL implementation bundled with Chromium that produces
deterministic output, eliminating the need for maxDiffPixelRatio
tolerance.
SwiftShader (CPU-based WebGL) is too slow for this app — screenshot
stabilization times out. Hardware GPU rendering is inherently
non-deterministic between CI runs, so maxDiffPixelRatio is necessary.

Consolidate tolerance to a single global 0.05 (was 0.03 global + 0.05
per-test for real_data/). Remove the per-test override and options
plumbing from expectScreenshot since all tests use the same tolerance.
@frewsxcv frewsxcv added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit 9e7816c Mar 10, 2026
3 checks passed
@frewsxcv frewsxcv deleted the remove-max-diff-pixel-ratio branch March 10, 2026 13:09
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