// vtebench-driven cell path workloads. On fw13 these shell out to the // vtebench binary (https://github.com/alacritty/vtebench) and time shop's // consumption of the corpus. The runner spawns shop, pipes the corpus to its // stdin (or through the PTY primary once shop-bench can drive one), and // samples PTY-drain throughput + wl-presentation-time frame stamps. use anyhow::{Result, bail}; use super::{Workload, WorkloadResult}; pub(crate) struct Cat; pub(crate) struct Scrolling; pub(crate) struct Unicode; impl Workload for Cat { fn name(&self) -> &'static str { "vtebench-cat" } fn description(&self) -> &'static str { "vtebench --dat cat: raw byte throughput, hot cell path" } fn run(&self) -> Result { run_vtebench("cat", &["cell_throughput_mb_s", "frame_time_p99_ms"]) } } impl Workload for Scrolling { fn name(&self) -> &'static str { "vtebench-scrolling" } fn description(&self) -> &'static str { "vtebench --dat scrolling: scroll+render frame time" } fn run(&self) -> Result { run_vtebench("scrolling", &["frame_time_p99_ms", "frame_time_p50_ms"]) } } impl Workload for Unicode { fn name(&self) -> &'static str { "vtebench-unicode" } fn description(&self) -> &'static str { "vtebench --dat unicode: grapheme + width fast path" } fn run(&self) -> Result { run_vtebench("unicode", &["cell_throughput_mb_s"]) } } fn run_vtebench(_dat: &str, _metrics: &[&str]) -> Result { // fw13-only wiring lives here. Steps: // 1. Resolve the vtebench binary (env SHOP_BENCH_VTEBENCH or PATH). // 2. Spawn shop under a headless-Wayland fixture (weston --backend=headless // or sway --no-outputs, TBD; see docs/typed-protocol.md phase 0). // 3. Open a PTY, launch `vtebench --dat <_dat>` inside shop, and time // the read-drain via a wrapper shell that timestamps EOF. // 4. Sample presentation-time timestamps from shop via a debug socket // (added under `--feature bench-hooks` on the shop binary). // 5. Emit each name in `_metrics` as an f64. bail!( "vtebench workloads are fw13-only and not yet wired; \ see crates/shop-bench/src/workloads/vtebench.rs for the checklist" ) }