euv-performance 0.51.0

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

/// Measured A/B comparison result for one real-hardware CPU+GPU parallel benchmark case (`AB-1..AB-6`).
#[derive(Clone, Data, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct ParallelAbCaseResult {
    /// Stable benchmark identifier (`ab1_*..ab6_*`).
    pub(crate) name: String,
    /// Label of the baseline Arm A execution strategy.
    pub(crate) arm_a_label: String,
    /// Label of the candidate Arm B execution strategy.
    pub(crate) arm_b_label: String,
    /// Mean wall-clock execution time of Arm A in microseconds per iteration.
    #[get(type(copy))]
    pub(crate) arm_a_us: f64,
    /// Mean wall-clock execution time of Arm B in microseconds per iteration.
    #[get(type(copy))]
    pub(crate) arm_b_us: f64,
    /// Speedup factor (`arm_a_us / arm_b_us`, or `arm_b_us / arm_a_us` for AB-1 where Arm A is the fast lane).
    #[get(type(copy))]
    pub(crate) speedup_ratio: f64,
    /// Real hardware GPU compute + render execution time in nanoseconds reported by Metal (`0` on CPU-only lanes).
    #[get(type(copy))]
    pub(crate) gpu_exec_ns: u64,
    /// Real hardware GPU draw calls submitted during benchmark verification (`0` on CPU-only lanes).
    #[get(type(copy))]
    pub(crate) draw_calls: usize,
    /// Maximum absolute pixel error between candidate output and CPU reference (`<= 0.01 px`).
    #[get(type(copy))]
    pub(crate) max_error_px: f32,
    /// Upload byte reduction ratio in `[0.0, 1.0]` achieved by dirty-span coalescing (`0.0` when not applicable).
    #[get(type(copy))]
    pub(crate) upload_savings_ratio: f32,
    /// Steady-state heap allocations per frame measured via `CountingAllocator`.
    #[get(type(copy))]
    pub(crate) steady_state_allocs: usize,
    /// Active execution lane selected by `AdaptiveExecutionRouter` for this workload.
    pub(crate) router_selected_lane: String,
    /// True when all hard acceptance gates for this case passed.
    #[get(type(copy))]
    pub(crate) passed: bool,
}

/// Complete report produced by `euv-performance --parallel-ab`.
#[derive(Clone, Data, Debug, Default, Deserialize, New, PartialEq, Serialize)]
pub struct ParallelAbReport {
    /// Active GPU compute backend string (`MetalHardware` on Apple Silicon, else `CpuReferenceParity`).
    pub(crate) gpu_backend: String,
    /// True when real hardware Apple Metal compute + indirect draw was executed.
    #[get(type(copy))]
    pub(crate) hardware_gpu_verified: bool,
    /// True when `CountingAllocator` (`allocation-tracking`) was active during measurement.
    #[get(type(copy))]
    pub(crate) allocation_tracking: bool,
    /// Number of host worker threads available to `EngineWorkerPool`.
    #[get(type(copy))]
    pub(crate) worker_threads: usize,
    /// Ordered A/B results across `AB-1..AB-6`.
    pub(crate) cases: Vec<ParallelAbCaseResult>,
    /// True when every executed case met its hard acceptance gate.
    #[get(type(copy))]
    pub(crate) all_passed: bool,
}