From 57f67217b6bcbce9ff753aa667c39e31a3504e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 13 Aug 2026 07:53:26 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore(bench):=20a=20seat=20for?= =?UTF-8?q?=20hardware=20HEVC,=20and=20a=20run=20that=20may=20keep=20its?= =?UTF-8?q?=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `bench export hevchw` measures the GPU seat; plain `hevc` still means the software one so a row keeps comparing with the baselines already recorded against it, and `scripts/bench.sh` sweeps both. `BENCH_KEEP=1` leaves the exported file where a run would have deleted it, which is how a seat is checked for decodability -- `ffprobe -count_frames` on what it actually wrote -- rather than for speed. --- crates/engine/examples/bench.rs | 16 +++++++++++++--- scripts/bench.sh | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/crates/engine/examples/bench.rs b/crates/engine/examples/bench.rs index 69807f3..ae88085 100644 --- a/crates/engine/examples/bench.rs +++ b/crates/engine/examples/bench.rs @@ -26,7 +26,8 @@ //! first frame, `BENCH_EXPORT_CAP` (s, default 300) the wall clock any single //! export measurement may take, `BENCH_EXPORT_REPS` (default 5) how many times //! an export is repeated *if the cap leaves room* -- a 4K encode gets one -//! capped rep, the small control gets five. +//! capped rep, the small control gets five -- and `BENCH_KEEP` (unset) whether +//! the exported file survives the run instead of being deleted with the number. use std::path::{Path, PathBuf}; use std::time::{Duration, Instant}; @@ -63,7 +64,7 @@ fn usage() -> ! { eprintln!( "usage: bench open \n bench seek \n \ bench scrub \n bench waveform \n \ - bench export " + bench export " ); std::process::exit(2) } @@ -356,7 +357,11 @@ fn export_bench(path: &Path, seat: &str, out_dir: &Path) { "h264sw" => (Format::Mp4, true), "h264hw" => (Format::Mp4, false), "av1" => (Format::Av1, true), + // `hevc` keeps meaning the software intra seat, so a row measured + // against an older baseline still compares with the one beside it; the + // GPU seat is the new name. "hevc" => (Format::Hevc, true), + "hevchw" => (Format::Hevc, false), _ => usage(), }; let metric = format!("export_fps_{seat}"); @@ -426,7 +431,12 @@ fn export_bench(path: &Path, seat: &str, out_dir: &Path) { } let seats = handle.encoders().unwrap_or_else(|| "?".into()); let outcome = handle.result(); - let _ = std::fs::remove_file(&out); + // A throughput run leaves nothing behind; `BENCH_KEEP=1` keeps the last + // one, which is how a seat is checked for *decodability* rather than + // speed (`ffprobe -count_frames` on the file it wrote). + if std::env::var_os("BENCH_KEEP").is_none() { + let _ = std::fs::remove_file(&out); + } if capped { samples.push(progress * f64::from(span) / elapsed); notes.push(format!("CAPPED at {:.0}s, {:.0}% done, {seats}", elapsed, progress * 100.0)); diff --git a/scripts/bench.sh b/scripts/bench.sh index 87ad407..b2326bf 100755 --- a/scripts/bench.sh +++ b/scripts/bench.sh @@ -98,7 +98,7 @@ for file in "${files[@]}"; do run 1800 "seek_ttff_${t}s" "$file" seek "$t" done run 3600 scrub "$file" scrub - for seat in h264sw h264hw av1 hevc; do + for seat in h264sw h264hw av1 hevc hevchw; do run "$export_limit" "export_fps_$seat" "$file" export "$seat" "$OUT_DIR" done done