feat(screenshot-diff): replace odiff with unified Rust diff engine#2333
Draft
jsfez wants to merge 1 commit into
Draft
feat(screenshot-diff): replace odiff with unified Rust diff engine#2333jsfez wants to merge 1 commit into
jsfez wants to merge 1 commit into
Conversation
Replace the two odiff spawns (and their four PNG decodes) with a single call to @argos-ci/mask-fingerprint's diffScreenshots: both thresholds are evaluated in one pass over in-memory images, x3 faster on big screenshots. The engine also compensates vertical layout shifts: when a section is inserted, the content below is realigned before comparison so the mask only marks the new section instead of everything below it. Inserted rows are fully counted in the score and painted on the mask; deleted rows are scored and marked with a thin seam. Behavior notes: - scores are quantized to 1e-4 to reproduce odiff's two-decimal percentage rounding (diffs under 0.005% still count as a match) - same-width images are now compared without going through sharp enlarge (the diff pads with transparency natively); different-width images keep the historical scale-to-fit behavior - the color-sensitive pass differs from odiff by +0.1-2% relative (float precision), snapshots updated accordingly Requires @argos-ci/mask-fingerprint 0.3.0 (to be published, package bump will follow). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the odiff-based diff pipeline with a single call to
diffScreenshotsfrom@argos-ci/mask-fingerprint(see argos-ci/mask-fingerprint#6), which evaluates both thresholds in one pass over in-memory images and compensates vertical layout shifts.What changes for users
When a section is inserted in a page, the content below it is realigned before comparison: the mask only marks the new section instead of painting everything below it red. The inserted section is fully counted in the score; removed sections are scored and marked with a thin seam at their former position.
layoutShift)big-images)Implementation
diffImagesis now a thin wrapper: one native call + the existing score gates (selectDiffResult, unchanged logic).odiff-bindependency removed (two process spawns and four PNG decodes per diff gone).resolveComparablePaths).minorChange2).odiff parity
test/diff.test.ts.Tests
Draft until
@argos-ci/mask-fingerprint@0.3.0is published (argos-ci/mask-fingerprint#6):package.jsonstill pins^0.1.3so local installs keep working — bump to^0.3.0here once published, then CI can pass.Follow-ups (from design review)
insertedRows/deletedRowsare available to surface a "section added/removed" badge in the frontend🤖 Generated with Claude Code