Skip to content

Rust Diff

hypersdk edited this page Aug 7, 2026 · 1 revision

Rust Diff

Optional fast pixel-diff for visual regression (zyvor-diff). Deep: rust/README.md.

Build

make rust
# → rust/target/release/zyvor-diff

Override path: ZYVOR_DIFF_BINARY=/path/to/zyvor-diff.

Enable in pipeline

# .env
ENABLE_REGRESSION=true
ENABLE_RUST_PROCESSOR=true

Python bridge: agents/regression/rust_bridge.py (auto-finds release/debug builds).

CLI

zyvor-diff \
  --baseline screenshots/baselines/homepage-hero.png \
  --current  screenshots/current/homepage-hero.png \
  --diff-output screenshots/diffs/diff-homepage-hero.png \
  --threshold 1.0

Prints JSON to stdout; non-zero exit when over threshold. Mismatched sizes → resize current to baseline before compare.

Note: diff_percent counts any changed pixel (vs Pillow intensity-weighted) — thresholds may differ slightly.

When to use

Use Rust Stick with Pillow
Large baseline suites / CI time Small runs, no Rust toolchain
ENABLE_RUST_PROCESSOR=true in k8s image that includes the binary Default local install without make rust

Related: Visual Regression · Autofix and Regression

Clone this wiki locally