pub struct EffectEstimate {
pub shift_ns: f64,
pub tail_ns: f64,
pub credible_interval_ns: (f64, f64),
pub pattern: EffectPattern,
pub interpretation_caveat: Option<String>,
}Expand description
Estimated timing effect decomposed into shift and tail components.
The effect is decomposed using a 2-component linear model:
- Shift: Uniform timing difference across all quantiles (e.g., different code path)
- Tail: Upper quantiles shift more than lower (e.g., cache misses)
See spec Section 2.5 (Bayesian Inference).
Fields§
§shift_ns: f64Uniform shift in nanoseconds.
Positive value means the sample class is slower (timing leak detected). Negative value means the sample class is faster (no leak, or unusual). This captures effects like branch timing where all operations take a fixed additional time.
tail_ns: f64Tail effect in nanoseconds.
Positive value means the sample class has a heavier upper tail. This captures effects like cache misses that occur probabilistically.
credible_interval_ns: (f64, f64)95% credible interval for the total effect magnitude in nanoseconds.
This is a Bayesian credible interval, not a frequentist confidence interval. There is a 95% posterior probability that the true effect lies within this range.
pattern: EffectPatternClassification of the dominant effect pattern.
interpretation_caveat: Option<String>When Some, the (μ, τ) decomposition may be unreliable.
This is set when model fit is poor (Q > q_thresh), indicating that the observed quantile pattern is not well-explained by the shift+tail basis. The shift_ns and tail_ns values should be interpreted with caution.
Implementations§
Source§impl EffectEstimate
impl EffectEstimate
Sourcepub fn total_effect_ns(&self) -> f64
pub fn total_effect_ns(&self) -> f64
Compute the total effect magnitude (L2 norm of shift and tail).
Sourcepub fn is_negligible(&self, threshold_ns: f64) -> bool
pub fn is_negligible(&self, threshold_ns: f64) -> bool
Check if the effect is negligible (both components near zero).
Trait Implementations§
Source§impl Clone for EffectEstimate
impl Clone for EffectEstimate
Source§fn clone(&self) -> EffectEstimate
fn clone(&self) -> EffectEstimate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EffectEstimate
impl Debug for EffectEstimate
Source§impl Default for EffectEstimate
impl Default for EffectEstimate
Source§fn default() -> EffectEstimate
fn default() -> EffectEstimate
Source§impl<'de> Deserialize<'de> for EffectEstimate
impl<'de> Deserialize<'de> for EffectEstimate
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EffectEstimate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EffectEstimate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for EffectEstimate
impl Serialize for EffectEstimate
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for EffectEstimate
impl RefUnwindSafe for EffectEstimate
impl Send for EffectEstimate
impl Sync for EffectEstimate
impl Unpin for EffectEstimate
impl UnwindSafe for EffectEstimate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.