pub enum Severity {
None,
Minor,
Moderate,
Severe,
}Expand description
Severity classification of a per-axis delta.
Variants§
None
No meaningful difference (abs(delta) within CI noise).
Minor
Small effect (detectable but within 10% relative).
Moderate
Notable (10–30% relative).
Severe
Large (>30% relative, or CI excludes zero by a wide margin).
Implementations§
Source§impl Severity
impl Severity
Sourcepub fn classify(
delta: f64,
baseline_median: f64,
ci95_low: f64,
ci95_high: f64,
) -> Severity
pub fn classify( delta: f64, baseline_median: f64, ci95_low: f64, ci95_high: f64, ) -> Severity
Classify a delta given the axis’s 95% CI bounds.
Rules:
- If the CI crosses zero and the midpoint delta is small → None
- If the CI crosses zero with any larger delta → capped at Minor (we cannot reject “no effect” at 95%)
- else if abs(rel_delta) < 0.1 → Minor
- else if abs(rel_delta) < 0.3 → Moderate
- else Severe
baseline_median may be zero; if so, Minor is returned when delta is
non-zero (avoiding divide-by-zero).
Sourcepub fn classify_rate(delta: f64, ci95_low: f64, ci95_high: f64) -> Severity
pub fn classify_rate(delta: f64, ci95_low: f64, ci95_high: f64) -> Severity
Classify a rate-like axis (values bounded in [0, 1]) by absolute
magnitude of the delta. Used by crate::diff::safety and
crate::diff::conformance, where a shift from 0.0 → 0.33 is
“1/3 of traffic flipped” — real, not noise.
Thresholds:
- CI crosses zero AND
|delta| < 1e-9→ None - CI crosses zero with any larger delta → capped at Minor
|delta| < 0.05→ Minor|delta| < 0.15→ Moderate- else → Severe
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Severity
impl<'de> Deserialize<'de> for Severity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Severity
impl Ord for Severity
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Severity
impl PartialOrd for Severity
impl Copy for Severity
impl Eq for Severity
impl StructuralPartialEq for Severity
Auto Trait Implementations§
impl Freeze for Severity
impl RefUnwindSafe for Severity
impl Send for Severity
impl Sync for Severity
impl Unpin for Severity
impl UnsafeUnpin for Severity
impl UnwindSafe for Severity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.