Comparison thresholds

Every comparison option — tolerances, warning and critical thresholds, visual and scroll settings, severity overrides.

On this page
  1. comparison.scroll
  2. Overrides
  3. From the command line
TypeScript
comparison: {
  failOn: "critical",                 // exit 1 at this severity or worse
  timing: { warnRelative: 0.2 },      // only change what you need; the rest keeps its default
  severity: { visual: "off" },        // per-rule overrides
},

What the thresholds mean, with examples, is explained in Severity.

OptionDefaultDescription
comparison.failOn"critical"Exit 1 for differences at this severity or worse; never disables
comparison.failOnUncertainfalseAlso fail on uncertain differences
comparison.timing.toleranceMs1Ignore declared duration/delay differences up to this
comparison.timing.startToleranceMs34Ignore start/latency differences up to this (≈2 frames)
comparison.timing.warnRelative0.15Warning when the relative change reaches this…
comparison.timing.warnAbsoluteMs50…and the absolute change reaches this
comparison.timing.criticalRelative1Critical from this relative change (1 = doubled/halved); null disables
comparison.easing.tolerance0.005Curves closer than this are equivalent
comparison.easing.warnDeviation0.05Max progress deviation at which an easing change is a warning
comparison.properties.positionTolerancePx2Ignore position differences up to this
comparison.properties.warnPositionPx12Position differences from this are warnings
comparison.properties.sizeTolerancePx2Ignore size differences up to this
comparison.properties.opacityTolerance0.02Ignore opacity differences up to this
comparison.properties.warnOpacity0.15Opacity differences from this are warnings
comparison.visual.enabledtruePixel comparison of settled frames and filmstrips
comparison.visual.pixelThreshold0.1Per-pixel colour threshold for pixelmatch (0 strict … 1 lenient)
comparison.visual.maxDiffRatio0.002Share of differing pixels above which a checkpoint is visually changed
comparison.visual.includeAntialiasingfalseCount anti-aliased pixels
comparison.visual.ignoreRegions[]Viewport rectangles { x, y, width, height } (CSS px) excluded
comparison.visual.frameDivergencetrueChart per-frame pixel divergence (PNG frames)
comparison.uncertainOnLowConfidencetrueChanges on elements matched by DOM position are uncertain
comparison.severity{}Per-rule override: critical, warning, info, uncertain or off. See Severity

Relative timing changes are measured against the baseline duration for durations, and against the animation's duration for delays and start offsets.

comparison.scroll

Scroll motion is compared by its own metrics (see Lenis).

KeyDefaultDescription
comparison.scroll.positionTolerancePx2Start/end/target differences up to this are ignored
comparison.scroll.warnPositionPx24Position differences at or above this are warnings
comparison.scroll.durationToleranceMs60Movement-duration differences up to this are ignored
comparison.scroll.warnDurationRelative0.2Duration change is a warning above this ratio…
comparison.scroll.warnDurationMs120…and above this many ms
comparison.scroll.curveTolerance0.04Normalized progress-curve deviation treated as noise
comparison.scroll.warnCurveDeviation0.1Curve deviation at or above this is a warning
comparison.scroll.velocityTolerance0.25Relative peak-velocity change ignored (warning above 2×)
comparison.scroll.overshootTolerancePx4Overshoot differences ignored
comparison.scroll.settleVelocity0.02Velocity (px/ms) below which a scroller counts as settled

Overrides

comparison.severity maps a rule name to critical, warning, info, uncertain or off. Every rule name is listed in Severity and exported as SEVERITY_RULES. An unknown rule name is a config error.

From the command line

Shell
npx motionpr run --threshold warning     # override failOn for one run (alias -t)