Struct ParsedRun

Source
pub struct ParsedRun {
    pub path: PathBuf,
    pub start: Option<RunStartRecord>,
    pub metadata_updates: Vec<MetadataUpdateRecord>,
    pub events: Vec<BenchEventRecord>,
    pub end: Option<RunEndRecord>,
    pub unknown_records: Vec<Value>,
    /* private fields */
}
Expand description

Parsed representation of one run.

Missing start/end records and protocol-order violations are retained for diagnostics but make Self::is_gate_valid return false.

§Examples

use ailloli_ui_bench::ParsedRun;
let run = ParsedRun::default();
assert!(!run.is_gate_valid());
assert!(run.events.is_empty());

Fields§

§path: PathBuf

Artifact path supplied to read_run.

§start: Option<RunStartRecord>

First and only parsed run_start, or None when absent.

§metadata_updates: Vec<MetadataUpdateRecord>

Metadata overlays in wire order.

§events: Vec<BenchEventRecord>

Event records in wire order.

§end: Option<RunEndRecord>

First and only parsed run_end, or None when absent.

§unknown_records: Vec<Value>

Unrecognized record objects retained verbatim.

Implementations§

Source§

impl ParsedRun

Source

pub fn final_metadata(&self) -> RunMetadata

Returns the last complete metadata view. A metadata update is an overlay so providers can publish only the values learned after GPU creation.

With no run_start, the result begins from RunMetadata::default. Sparse updates never erase existing optional fields.

§Examples
use ailloli_ui_bench::ParsedRun;
assert_eq!(ParsedRun::default().final_metadata().scenario, None);
Source

pub fn is_gate_valid(&self) -> bool

Whether the artifact is complete and suitable for a regression gate.

Gate-valid files require exactly one compatible start and end, matching nonempty run IDs, ordered records/events, prior-only causes, no unknown records, a valid end flag, zero drops, and an exact record count.

§Examples
use ailloli_ui_bench::ParsedRun;
assert!(!ParsedRun::default().is_gate_valid());
Source

pub fn metric_samples(&self) -> BTreeMap<String, Vec<MetricSample>>

Extracts finite numeric samples and their regression roles.

Explicit metric events carry their serialized role. Metrics derived from legacy provider events are diagnostics so an incidental renderer field can never silently become a release gate. A missing or unknown role in an older artifact also falls back to Diagnostic.

Non-finite values and warmup events are omitted. A synthesized correctness.get_current_texture_err sample is always present and counts acquisition-error events with saturating u64 arithmetic.

§Examples
use ailloli_ui_bench::{MetricRole, ParsedRun};
let series = ParsedRun::default().metric_samples();
let sample = series["correctness.get_current_texture_err"][0];
assert_eq!(sample.value, 0.0);
assert_eq!(sample.role, MetricRole::Correctness);
Source

pub fn metric_series(&self) -> BTreeMap<String, Vec<f64>>

Extracts only numeric values for callers that do not need gate roles.

§Examples
use ailloli_ui_bench::ParsedRun;
let series = ParsedRun::default().metric_series();
assert_eq!(series["correctness.get_current_texture_err"], vec![0.0]);

Trait Implementations§

Source§

impl Clone for ParsedRun

Source§

fn clone(&self) -> ParsedRun

Returns a copy 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 ParsedRun

Source§

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

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

impl Default for ParsedRun

Source§

fn default() -> ParsedRun

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.

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> 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.