euv-performance 0.47.0

Reproducible CPU, layout, rasterization, and allocation benchmarks for the cross-platform euv runtime.
Documentation
use super::*;

/// Supported target platforms enumerated in `schemas/report-v1.schema.json`.
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum ObservabilityPlatform {
    /// Browser Web / WASM host.
    Web,
    /// Android mobile host.
    Android,
    /// Apple iOS phone host.
    Ios,
    /// Apple iPadOS tablet host.
    Ipados,
    /// Microsoft Windows desktop host.
    Windows,
    /// Apple macOS desktop host.
    Macos,
    /// Linux desktop/server host.
    Linux,
    /// Huawei HarmonyOS / OpenHarmony host.
    Harmonyos,
    /// Wearable watch/band host.
    Wearable,
    /// MiniApp container host.
    Miniapp,
    /// QuickApp container host.
    Quickapp,
    /// Terminal PTY / CLI host.
    Terminal,
}

/// Execution environment honesty tag for an observability report.
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ObservabilityExecutionKind {
    /// Physical target device or real OS desktop session.
    RealDevice,
    /// Android/HarmonyOS/Wearable emulator.
    Emulator,
    /// Apple iOS/iPadOS simulator.
    Simulator,
    /// In-process headless software renderer.
    Headless,
    /// Pseudo-terminal (PTY) character grid host.
    Pty,
    /// Piped stdin/stdout CLI host.
    CliPipe,
}

/// Four-state observability report verdict (`pass`, `fail`, `inconclusive`, `unsupported`).
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ObservabilityStatus {
    /// Every required scope measured, every threshold met, and zero blocking findings.
    Pass,
    /// Confirmed regression, threshold breach, or confirmed leak.
    Fail,
    /// Required coverage missing, permission denied, or insufficient samples.
    Inconclusive,
    /// Target platform or metric family not supported by the active backend.
    Unsupported,
}

/// Per-scope measurement coverage classification.
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ObservabilityCoverageStatus {
    /// Scope was actively collected and verified.
    Measured,
    /// Scope could not be collected on this run.
    Missing,
    /// Scope is not supported on this platform/host.
    Unsupported,
    /// Scope does not apply to this platform/backend.
    NotApplicable,
}

/// Per-metric measurement availability classification.
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ObservabilityMetricStatus {
    /// Metric was validly measured.
    Measured,
    /// Metric was not measured (numeric fields must be null).
    Unmeasured,
    /// Metric is unsupported on this host.
    Unsupported,
    /// Metric is not applicable to this platform/backend.
    NotApplicable,
    /// OS or container permissions blocked collection.
    PermissionDenied,
    /// Too few samples collected for a statistically valid result.
    InsufficientSamples,
}

/// Canonical metric units allowed by `schemas/report-v1.schema.json`.
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ObservabilityUnit {
    /// Raw byte count.
    Bytes,
    /// Discrete dimensionless count.
    Count,
    /// Milliseconds.
    Ms,
    /// Microseconds.
    Us,
    /// Percentage in `[0.0, 100.0]`.
    Percent,
    /// Frequency in Hertz.
    Hz,
    /// Throughput in bytes per second.
    BytesPerSec,
    /// Ratio in `[0.0, 1.0]`.
    Ratio,
    /// Temperature in degrees Celsius.
    Celsius,
}

/// Canonical summary statistic tag for an observability metric sample.
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ObservabilityStatistic {
    /// Point scalar observation.
    Value,
    /// Median (50th percentile).
    P50,
    /// 95th percentile.
    P95,
    /// 99th percentile.
    P99,
    /// Maximum observed value.
    Max,
    /// Arithmetic mean.
    Mean,
    /// Minimum observed value.
    Min,
    /// Event rate over window.
    Rate,
    /// Live object/allocation count.
    LiveCount,
    /// Cumulative window total.
    Total,
    /// Linear slope per lifecycle cycle.
    Slope,
}

/// Threshold evaluation rule attached to a metric.
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ObservabilityThresholdRule {
    /// Observed scalar value must be `<= threshold`.
    Max,
    /// Observed scalar value must be `>= threshold`.
    Min,
    /// Observed `slope_per_cycle` must be `<= threshold`.
    MaxSlopePerCycle,
    /// Observed destroyed-owner `after_drain` count must be `<= threshold`.
    MaxDestroyedOwnerCount,
    /// Observed `after_drain` value must be `<= threshold`.
    MaxAfterDrain,
    /// Observed value must match `threshold` within tolerance.
    Exact,
}

/// Forensic classification for an entry in `findings`.
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ObservabilityFindingClass {
    /// Intentionally retained bounded cache or frozen page within budget.
    ExpectedRetained,
    /// Confirmed resource or memory leak attributed to an owner.
    UnexpectedLeak,
    /// Performance or parity budget violation.
    BudgetViolation,
    /// Monotonic resource growth lacking owner attribution.
    UnattributedGrowth,
}