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: PathBufArtifact 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
impl ParsedRun
Sourcepub fn final_metadata(&self) -> RunMetadata
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);Sourcepub fn is_gate_valid(&self) -> bool
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());Sourcepub fn metric_samples(&self) -> BTreeMap<String, Vec<MetricSample>>
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);