-
-
Notifications
You must be signed in to change notification settings - Fork 54.1k
feat: use blazediff instead of pixelmatch #54941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use blazediff instead of pixelmatch #54941
Conversation
|
|
|
Caution Review failedThe pull request is closed. 📝 WalkthroughSummary by CodeRabbit
Walkthrough将视觉回归对比库由 pixelmatch 更换为 BlazeDiff(@blazediff/core)。更新了自托管流程的两篇文档说明、替换脚本中的库调用,并在 package.json 中增删相关依赖。整体对比流程与输出产物保持不变。 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
👁 Visual Regression Report for PR #54941 Failed ❌
Important There are 4 diffs found in this PR: 🔄
|
|
|
Hi @teimurjan. Thanks for your contribution. The path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @teimurjan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request focuses on optimizing the performance of the visual regression testing system. It achieves this by replacing the existing image comparison library, pixelmatch, with the more efficient blazediff. This change is a direct performance enhancement, aiming to speed up the visual difference detection process without altering the accuracy or functionality of the tests.
Highlights
- Performance Improvement: Replaced the
pixelmatchlibrary withblazedifffor visual regression testing, leading to a 20-25% speed increase in image comparison operations. - Library Features: The new
blazedifflibrary offers the same API and produces identical results aspixelmatch, while also being actively supported and providing out-of-the-box type safety. - External Adoption:
blazediffhas already been successfully integrated intovega/vegaand is approved for integration intoantvis/G, demonstrating its reliability and performance in other projects.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request replaces pixelmatch with blazediff for visual regression testing to improve performance. The changes are straightforward and correctly implemented across the board. The package.json file has been correctly updated to reflect the dependency change. The visual regression script now correctly imports and uses blazediff, which serves as a drop-in replacement for pixelmatch due to its compatible API. The documentation has also been updated to mention the new tool. Overall, this is a solid and well-executed performance optimization.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
More templates
commit: |
Bundle ReportChanges will increase total bundle size by 190 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #54941 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 775 775
Lines 14089 14089
Branches 3745 3745
=========================================
Hits 14089 14089 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hey @afc163! FYI: I've checked the failed test cases with Pixelmatch, and the results are the same. It's not because of this PR's changes. |














中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
Replace pixelmatch with BlazeDiff. BlazeDiff is 20-25% faster than pixelmatch, using the same API and producing the same results. It weighs twice as much, is actively supported, and is type-safe out of the box.
📝 Change Log