Skip to main content

Beat

Struct Beat 

Source
pub struct Beat {
    pub pillar: Option<u8>,
    pub incumbent: String,
    pub incumbent_pinned: Option<String>,
    pub canonical_task: Option<String>,
    pub metric: String,
    pub direction: String,
    pub baseline_value: Option<f64>,
    pub baseline_floor: Option<f64>,
    pub beat_threshold: Option<f64>,
    pub baseline_sourced_date: Option<String>,
    pub approved_compute: Option<String>,
    pub ci_gate_name: String,
}
Expand description

Parameters of a head-to-head BEAT benchmark (metadata.kind: beat-benchmark, PMAT-741): a falsifiable, CI-wired claim that aprender meets-or-beats an incumbent (scikit-learn / PyTorch / Unsloth / Ollama·llama.cpp) on the incumbent’s own canonical task — the measurement backbone of the four-pillar “replace AND beat” mission. Required-shape is enforced by validate_beat_benchmark in the validator (BEAT-001..007).

Fields§

§pillar: Option<u8>

Which pillar (1=sklearn, 2=PyTorch, 3=Unsloth, 4=Ollama/llama.cpp).

§incumbent: String

The incumbent being beaten — must name one of the four pillars.

§incumbent_pinned: Option<String>

How/when the baseline was pinned (free-form provenance).

§canonical_task: Option<String>

The canonical task on which the beat is measured (apples-to-apples).

§metric: String

The measured metric (e.g. accuracy, wall_clock_ms, tokens_per_sec, mse).

§direction: String

higher_is_better or lower_is_better — fixes the regression direction.

§baseline_value: Option<f64>

The incumbent’s pinned baseline value.

§baseline_floor: Option<f64>

Optional worst-case incumbent value (e.g. sklearn min over seeds).

§beat_threshold: Option<f64>

The threshold aprender must meet/beat; CI fails on regression past it.

§baseline_sourced_date: Option<String>

When the baseline was sourced (ISO date).

§approved_compute: Option<String>

CPU or GPU — the compute approved for this gate.

§ci_gate_name: String

The CI test/gate name that enforces this beat.

Implementations§

Source§

impl Beat

Source

pub fn evaluate(&self, measured: f64) -> Option<BeatOutcome>

Evaluate a measured value against this beat’s pinned beat_threshold, honoring direction:

  • higher_is_betterWon iff measured >= beat_threshold
  • lower_is_betterWon iff measured <= beat_threshold

Returns None when the contract is too malformed to judge (no beat_threshold, a non-finite threshold/measurement, or an unknown direction) — the caller should treat that as a hard error, not a pass. The validator’s BEAT-004/BEAT-005 rules reject such contracts up front, so a well-formed contract always yields Some.

Source

pub fn is_won(&self, measured: f64) -> bool

Convenience: true iff evaluate returns BeatOutcome::Won. A malformed contract (None) is not a win.

Trait Implementations§

Source§

impl Clone for Beat

Source§

fn clone(&self) -> Beat

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Beat

Source§

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

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

impl Default for Beat

Source§

fn default() -> Beat

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

impl<'de> Deserialize<'de> for Beat

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Beat, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Beat

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Beat

§

impl RefUnwindSafe for Beat

§

impl Send for Beat

§

impl Sync for Beat

§

impl Unpin for Beat

§

impl UnsafeUnpin for Beat

§

impl UnwindSafe for Beat

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.