Skip to content

regression

diapason.learning.spec_search.gate.regression

Per-cluster regression detection for the benchmark gate.

After an edit is applied, the gate compares the before and after BenchmarkSnapshots. If any cluster's score dropped by more than max_regression, the edit is rejected.

See spec §7.3.

RegressionResult dataclass

Result of a regression check.

regressed_clusters = field(default_factory=dict) class-attribute instance-attribute

Cluster id → negative delta for clusters that regressed beyond threshold.

regression_check(before, after, max_regression=0.05)

Check if any cluster regressed beyond the threshold.

Parameters

before : Benchmark snapshot before the edit. after : Benchmark snapshot after the edit. max_regression : Maximum allowed per-cluster score drop (default 0.05).

Returns

RegressionResult has_regression is True if any cluster dropped more than max_regression. regressed_clusters maps cluster ids to their negative deltas.