Skip to main content

EProcessConfig

Struct EProcessConfig 

Source
pub struct EProcessConfig {
    pub lambda: f64,
    pub alpha: f64,
    pub beta: f64,
    pub sigma_ema_decay: f64,
    pub sigma_floor_ms: f64,
    pub warmup_frames: u32,
}
Expand description

Anytime-valid e-process for gating degradation decisions.

§Mathematical Model

The e-process is a nonnegative supermartingale under H₀ (system is healthy):

E_t = Π_{j=1..t} exp(λ * r_j − λ² * σ² / 2)

where:

  • r_j is the standardized residual at frame j: (frame_time − target) / σ
  • σ is the estimated standard deviation of frame times
  • λ is a tuning parameter controlling sensitivity (default: 0.5)

§Decision Rule

  • Degrade only when E_t > 1/α (evidence exceeds threshold). Default α = 0.05, so we need E_t > 20.
  • Upgrade only when E_t < β (evidence that overload has passed). Default β = 0.5.

§Properties

  1. Anytime-valid: The test is valid at any stopping time, unlike fixed-sample tests. We can check after every frame without p-hacking.
  2. Bounded false positive rate: P(E_t ever exceeds 1/α | H₀) ≤ α (Ville’s inequality).
  3. Self-correcting: After a burst passes, E_t decays back toward 1.0, naturally enabling recovery.

§Failure Modes

  • Sustained overload: E_t grows exponentially → rapid degradation.
  • Transient spike: E_t grows briefly → may not cross threshold → PID handles short-term. Only persistent overload triggers e-process gate.
  • σ estimation drift: We use an exponential moving average for σ with a warmup period of 10 frames to avoid unstable early estimates.

Fields§

§lambda: f64

Sensitivity parameter λ. Higher values detect overload faster but increase false positive risk near the boundary.

§alpha: f64

Significance level α. Degrade when E_t > 1/α. Default: 0.05 (need E_t > 20 to degrade).

§beta: f64

Recovery threshold β. Upgrade allowed when E_t < β. Default: 0.5.

§sigma_ema_decay: f64

EMA decay for σ estimation. Closer to 1.0 = slower adaptation. Default: 0.9 (adapts over ~10 frames).

§sigma_floor_ms: f64

Minimum σ floor to prevent division by zero. Default: 1.0 ms.

§warmup_frames: u32

Warmup frames before e-process activates. During warmup, fall back to PID-only decisions.

Trait Implementations§

Source§

impl Clone for EProcessConfig

Source§

fn clone(&self) -> EProcessConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EProcessConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EProcessConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for EProcessConfig

Source§

fn eq(&self, other: &EProcessConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for EProcessConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.