Skip to main content

Comparison

Struct Comparison 

Source
pub struct Comparison {
    pub changes: Vec<Change>,
    pub added: Vec<Key>,
    pub removed: Vec<Key>,
    pub accepted: Acceptances,
    pub ignored_trailers: Acceptances,
    pub gate_source: Option<String>,
    pub allowed_empty: bool,
}

Fields§

§changes: Vec<Change>

Every metric present on both sides, in a stable order.

§added: Vec<Key>

Series measured on the head commit and not the base — a new benchmark, or the first run on a new runner class. Reported, never gated: there is nothing to compare against.

§removed: Vec<Key>

Series on the base and not the head. Usually a benchmark that was removed, occasionally a run that failed to record — worth surfacing either way, because a silently vanishing benchmark stops gating.

§accepted: Acceptances

Benchmarks the change declared it regresses on purpose. Their regressions are still reported, and still counted by regressions, but not by failures — the set the gate actually fails on.

§ignored_trailers: Acceptances

Tak-Accept trailers found in the range and deliberately not honoured, because accept_trailers is off. Kept only to say so in the report.

§gate_source: Option<String>

One Markdown line on where the gate came from, when that is worth saying: the base had no tak.toml, or the head’s would gate differently. Rendered below the verdict rather than above it, because scripts read the report’s first line as its outcome.

§allowed_empty: bool

Set when nothing was compared and allow_empty passed it rather than failing it. Carried here, as detect carries its own, so the report and the exit status cannot disagree.

Implementations§

Source§

impl Comparison

Source

pub fn regressions(&self, gates: &Gates) -> Vec<&Change>

Changes beyond an enabled gate, accepted or not.

Source

pub fn failures(&self, gates: &Gates) -> Vec<&Change>

What tak compare fails on: regressions no acceptance covers.

Layered on regressions, so each series is still judged against its own effective gate, and an acceptance can only waive a change that would otherwise have failed. A report-only series never reaches this, so it never needs accepting.

Source

pub fn accepted_regressions(&self, gates: &Gates) -> Vec<&Change>

The regressions an acceptance waived.

Source

pub fn with_accepted(self, accepted: Acceptances) -> Self

Attach what the change declared. Separate from compare because the numbers and the declaration come from different places — notes and commit messages — and a comparison is meaningful without either.

Source

pub fn with_ignored_trailers(self, ignored: Acceptances) -> Self

Record trailers that were present but not honoured. They never affect the gate; they exist so the report can explain why a trailer did nothing.

Source

pub fn reported(&self, gates: &Gates) -> Vec<&Change>

Changes beyond a report-only gate: flagged, never failed on.

Source

pub fn gated_uniformly(&self, gates: &Gates) -> bool

Whether every instruction count here is held to the global gate.

When it is, the report and the error read exactly as they did before per-benchmark gates existed. Scripts grep them — tak’s own perf-pr workflow among them — and a project that never wrote a per-benchmark gate should not have its output change under it.

Source

pub fn is_empty(&self) -> bool

True when there is nothing to compare — no overlapping series at all.

Trait Implementations§

Source§

impl Debug for Comparison

Source§

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

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

impl Default for Comparison

Source§

fn default() -> Self

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

impl PartialEq for Comparison

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Comparison

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.