PhaseDisplayOptions

Struct PhaseDisplayOptions 

Source
pub struct PhaseDisplayOptions {
    pub no_phases: bool,
    pub phases_only: bool,
    pub steps_only: bool,
    pub phase: Option<u16>,
    pub phase_threshold: Option<f64>,
}
Expand description

Re-export of the comparison-policy types so downstream crates using ktstr::cli as their public surface don’t need to reach into the internal ktstr::stats module (which is pub(crate) — see lib.rs — and therefore not a stable public path). The policy is the only item in stats that a CLI or external consumer constructs directly; every other item is internal plumbing reached via cli::compare_partitions. CLI-controlled rendering of the per-phase spread block in cargo ktstr perf-delta --noise-adjust. Bundled as a struct so the 5-flag clap surface threads through compare_partitions_noise as a single positional rather than five. Default value renders every phase / every metric / every paired row — equivalent to passing no phase flags. All 5 flags require --noise-adjust (per-phase output exists only there).

The flags compose via AND on independent axes (block-level suppression × phase-id × row-significance), with three mutex constraints enforced at CLI parse time:

  • --no-phases excludes every other phase flag (the whole block is suppressed; refining what to render is a contradiction).
  • --phases-only excludes --no-phases (same reason).
  • --steps-only excludes --phase (one of them collapses to a single bucket; the other suppresses BASELINE — both together are confused phrasing).

The 5 flags trigger renderer behaviour ONLY — the --noise-adjust per-phase pass always computes the full set of NoisePhaseFindings and coverage entries so programmatic consumers see the unfiltered surface. Filtering is render-time projection.

Fields§

§no_phases: bool

--no-phases: suppress the --noise-adjust per-phase spread block entirely. The aggregate spread table and footer render unchanged; the only effect is hiding the per-phase block (and its footer hint). Mutually exclusive with every other phase flag at CLI parse time.

§phases_only: bool

--phases-only: suppress the aggregate spread table and the host-context delta; render ONLY the per-phase spread block. Useful for narrowing investigation to a phase regression when the aggregate rollup is noise. Composes with --steps-only, --phase, and --phase-threshold.

§steps_only: bool

--steps-only: within the per-phase block, suppress the BASELINE bucket (step_index == 0); render only scenario Step buckets. Useful when the BASELINE settle window is dominated by scheduler startup transients. Mutually exclusive with --phase.

§phase: Option<u16>

--phase <N>: within the per-phase block, render only rows whose step_index == N. 0 selects BASELINE; 1..=N selects scenario Step ordinals (1 → Step[0], 2 → Step[1], …). Integer chosen over label so a label rename ("Step[0]""Step:0") doesn’t break operator CI invocations. Mutually exclusive with --steps-only.

§phase_threshold: Option<f64>

--phase-threshold <PCT>: render-side relative-spread gate for the --noise-adjust per-phase pass. Suppresses paired rows where |delta-mean| / |a.mean| < PCT / 100.0; a value from a ~zero baseline (|a.mean| < ZERO_MEAN_EPS) is an unbounded relative change and clears any finite threshold. 0.0 shows every paired row; absence falls through to the registry’s per-metric default_rel. Independent from --threshold — the aggregate and per-phase passes have separate filters so an operator can widen the per-phase view without widening the aggregate view.

Implementations§

Source§

impl PhaseDisplayOptions

Source

pub fn rel_threshold( &self, policy: &ComparisonPolicy, metric_name: &str, default_rel: f64, ) -> f64

Resolve the per-phase relative threshold for a given metric. Returns the override fraction when phase_threshold is set, else falls through to the ComparisonPolicy resolution the scalar pass uses. The metric_name + default_rel shape mirrors ComparisonPolicy::rel_threshold so the two surfaces stay symmetric.

Source

pub fn matches_phase(&self, step_index: u16) -> bool

True when a phase row at the given step_index should render under the current display flags. Combines the two step-axis predicates (--phase <N> filter and --steps-only BASELINE-suppressor) into a single row-level decision the renderer applies uniformly across the --noise-adjust per-phase findings and coverage rows. Returns true when no relevant flag is set (default path: every step renders).

Trait Implementations§

Source§

impl Clone for PhaseDisplayOptions

Source§

fn clone(&self) -> PhaseDisplayOptions

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 PhaseDisplayOptions

Source§

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

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

impl Default for PhaseDisplayOptions

Source§

fn default() -> PhaseDisplayOptions

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

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSend for T
where T: Send,