pub struct OptimizationStats {
pub ops_before: usize,
pub ops_after: usize,
pub bindings_before: usize,
pub bindings_after: usize,
pub literals_before: usize,
pub literals_after: usize,
pub iterations: usize,
pub converged: bool,
}Expand description
Per-pipeline-run statistics. Useful for benchmarks, regression
diagnostics, and --verbose emit modes.
Fields§
§ops_before: usizeTop-level body op count before optimization.
ops_after: usizeTop-level body op count after optimization.
bindings_before: usizeNumber of bindings before. After equals bindings_before minus
what drop_unused_bindings stripped.
bindings_after: usize§literals_before: usizeNumber of literals in the top-level body’s pool, before/after.
literals_after: usize§iterations: usizeHow many run_all_once iterations actually fired (1 to
RUN_ALL_MAX_ITERS). 1 means the pipeline converged on the
first pass; higher means later-pass changes exposed work for
earlier passes and the fixed-point loop kicked in.
converged: boolTrue iff the fixed-point converged within the cap. False means the pipeline stopped mid-way; output is still valid (every individual pass is total) but may have residual optimization opportunities.
Implementations§
Source§impl OptimizationStats
impl OptimizationStats
Sourcepub fn ops_eliminated(&self) -> usize
pub fn ops_eliminated(&self) -> usize
Total ops eliminated (top-level body only). Saturating, so the rare case where output exceeds input (e.g. loop_unroll inlining) returns 0 rather than wrapping.
pub fn bindings_dropped(&self) -> usize
Sourcepub fn is_no_op(&self) -> bool
pub fn is_no_op(&self) -> bool
True iff the pipeline made no change at all - no ops eliminated, no bindings dropped, no literals dropped, AND op count is stable. The kernel was either already optimal or out of the pipeline’s reach. Useful for tooling that wants to skip emit re-runs when nothing changed.
Sourcepub fn off_graph_dropped(&self) -> usize
pub fn off_graph_dropped(&self) -> usize
Total off-graph data dropped (bindings + literals). Useful as a single-number “how much cleanup did the tail of the pipeline do?” signal.
Sourcepub fn merge(&mut self, other: OptimizationStats)
pub fn merge(&mut self, other: OptimizationStats)
Merge another OptimizationStats into a running aggregate.
Adds counts and ORs the converged flag (any non-converged run
→ aggregate is non-converged). iterations accumulates.
Useful for tooling that runs run_all_with_stats over a corpus
of N kernels and wants a single rolled-up summary.
Sourcepub fn zero() -> Self
pub fn zero() -> Self
Identity element for Self::merge. Useful as the seed of a fold
over a corpus.
Sourcepub fn format_short(&self) -> String
pub fn format_short(&self) -> String
One-line human-readable summary suitable for log lines.
Format: "ops X→Y (-N), bindings A→B (-M), iters K (converged|stopped)".
Mirrors the format_short pattern on the audit reports.
Trait Implementations§
Source§impl Clone for OptimizationStats
impl Clone for OptimizationStats
Source§fn clone(&self) -> OptimizationStats
fn clone(&self) -> OptimizationStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OptimizationStats
Source§impl Debug for OptimizationStats
impl Debug for OptimizationStats
Source§impl<'de> Deserialize<'de> for OptimizationStats
impl<'de> Deserialize<'de> for OptimizationStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for OptimizationStats
impl Display for OptimizationStats
impl Eq for OptimizationStats
Source§impl PartialEq for OptimizationStats
impl PartialEq for OptimizationStats
Source§impl Serialize for OptimizationStats
impl Serialize for OptimizationStats
impl StructuralPartialEq for OptimizationStats
Auto Trait Implementations§
impl Freeze for OptimizationStats
impl RefUnwindSafe for OptimizationStats
impl Send for OptimizationStats
impl Sync for OptimizationStats
impl Unpin for OptimizationStats
impl UnsafeUnpin for OptimizationStats
impl UnwindSafe for OptimizationStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.