Skip to main content

Detection

Struct Detection 

Source
pub struct Detection {
Show 16 fields pub head: String, pub gates: Gates, pub walked: usize, pub recorded: usize, pub latest: Vec<Step>, pub earlier: Vec<Step>, pub drift: Vec<Drift>, pub new_at_head: Vec<Key>, pub missing_at_head: Vec<Key>, pub trend: Trend, pub cutoff: Option<Cutoff>, pub allow_empty: bool, pub no_gate: bool, pub accepted: BTreeMap<Key, Acceptances>, pub offered: Acceptances, pub ignored_trailers: Acceptances,
}

Fields§

§head: String§gates: Gates

Every series’ gate, from tak.toml and [gate]. Policy of whoever runs the check, as for tak compare: never read from the notes.

§walked: usize

First-parent commits in the walk, recorded or not.

§recorded: usize

How many of them carry any measurement.

§latest: Vec<Step>

For every series measured at the head with an earlier point in the window: its step onto the head. The only steps that can fail.

§earlier: Vec<Step>

Steps above the gate that end before the head. Report-only.

§drift: Vec<Drift>

Report-only.

§new_at_head: Vec<Key>

Measured at the head with nothing earlier in the window to compare to.

§missing_at_head: Vec<Key>

Measured earlier in the window and not at the head.

§trend: Trend§cutoff: Option<Cutoff>

Set when the walk stopped before the window filled for a reason of its own, so a short history here may be the walk’s rather than the project’s.

§allow_empty: bool

Whether an empty comparison is accepted (allow_empty, from tak.toml, TAK_ALLOW_EMPTY or --allow-empty) rather than failed. Carried here so the report and the exit status cannot disagree.

§no_gate: bool

Report-only (--no-gate): nothing fails, an empty comparison included. The same promise tak compare --no-gate makes, so a workflow that must always exit successfully needs one flag, not two.

§accepted: BTreeMap<Key, Acceptances>

What each step onto the head may be accepted by: --accept, plus the Tak-Accept trailers in that step’s own range. Per series, because two series’ previous points can lie at different commits, and a trailer outside a step’s range says nothing about that step.

§offered: Acceptances

Every acceptance offered, across all ranges, for reporting the ones that accepted nothing.

§ignored_trailers: Acceptances

Trailers found but not honoured because accept_trailers is off.

Implementations§

Source§

impl Detection

Source

pub fn new(head: String, gates: Gates) -> Self

A walk that found nothing, held to gates.

Source

pub fn accept( &mut self, flags: &Acceptances, trailer_logs: &BTreeMap<String, String>, )

Apply acceptances to the steps onto the head.

flags is --accept, which covers every step. trailer_logs maps a step’s from commit to the crate::notes::trailers output for from..head, which is exactly that step’s range: pass it only when accept_trailers is on. A benchmark name covers every tool and runner class it was measured on, as in tak compare.

Source

pub fn accepted_steps(&self) -> Vec<&Step>

Steps onto the head that would fail, waived by an acceptance.

Source

pub fn failures(&self) -> Vec<&Step>

Steps onto the head beyond an enabled gate: what makes the command fail.

Only the head’s. A main-branch workflow runs this once per push, so failing on an older step would fail every run after the one that caused it, and a job that is always red is a job nobody reads.

Source

pub fn reported(&self) -> Vec<&Step>

Steps onto the head beyond a report-only gate: flagged, never failed on.

Source

pub fn uniform(&self) -> bool

Whether every series in the report is held to the global gate.

When it is, the report reads exactly as it did before per-benchmark gates existed — one N% in the prose, no gate column — for the same reason tak compare keeps its wording: a project that never wrote a per-benchmark gate should not have its output change under it.

Source

pub fn nothing_compared(&self) -> bool

No series at the head had anything to be compared against.

Source

pub fn empty_fails(&self) -> bool

Whether comparing nothing fails the command.

By default it does. A check that passes when it examined nothing is indistinguishable, from the outside, from one that examined everything and found it clean — and the ways to get here by accident (a shallow checkout, a recording step that stopped producing instruction counts, a runner class that drifted) are exactly the ones nobody reads a green job’s summary to find. The legitimate cases, a first recording or a new runner class, are rare and known in advance, so they are the ones asked to opt out.

Trait Implementations§

Source§

impl Debug for Detection

Source§

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

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

impl PartialEq for Detection

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 Detection

Auto Trait Implementations§

§

impl Forget for Detection

§

impl Freeze for Detection

§

impl Move for Detection

§

impl RefUnwindSafe for Detection

§

impl Send for Detection
where RawVecInner: Send, NodeRef<Owned, String, Gate, LeafOrInternal>: Send, BoxRaw<(String, Gate)>: Send, NodeRef<Owned, (String, String), Gate, LeafOrInternal>: Send, BoxRaw<((String, String), Gate)>: Send, NodeRef<Owned, (String, String, String), Vec<f64>, LeafOrInternal>: Send, BoxRaw<((String, String, String), Vec<f64>)>: Send, NodeRef<Owned, (String, String, String), Acceptances, LeafOrInternal>: Send, BoxRaw<((String, String, String), Acceptances)>: Send, NodeRef<Owned, String, BTreeSet<Source>, LeafOrInternal>: Send, BoxRaw<(String, BTreeSet<Source>)>: Send,

§

impl Sync for Detection
where RawVecInner: Sync, NodeRef<Owned, String, Gate, LeafOrInternal>: Sync, BoxRaw<(String, Gate)>: Sync, NodeRef<Owned, (String, String), Gate, LeafOrInternal>: Sync, BoxRaw<((String, String), Gate)>: Sync, NodeRef<Owned, (String, String, String), Vec<f64>, LeafOrInternal>: Sync, BoxRaw<((String, String, String), Vec<f64>)>: Sync, NodeRef<Owned, (String, String, String), Acceptances, LeafOrInternal>: Sync, BoxRaw<((String, String, String), Acceptances)>: Sync, NodeRef<Owned, String, BTreeSet<Source>, LeafOrInternal>: Sync, BoxRaw<(String, BTreeSet<Source>)>: Sync,

§

impl Unpin for Detection
where *const u8 is !null: Unpin, *const LeafNode<String, Gate> is !null: Unpin, Box<(String, Gate)>: Unpin, *const LeafNode<(String, String), Gate> is !null: Unpin, Box<((String, String), Gate)>: Unpin, *const LeafNode<(String, String, String), Vec<f64>> is !null: Unpin, Box<((String, String, String), Vec<f64>)>: Unpin, *const LeafNode<(String, String, String), Acceptances> is !null: Unpin, Box<((String, String, String), Acceptances)>: Unpin, *const LeafNode<String, BTreeSet<Source>> is !null: Unpin, Box<(String, BTreeSet<Source>)>: Unpin,

§

impl UnsafeUnpin for Detection

§

impl UnwindSafe for Detection

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.