forge
Explore
Log in

Don't you dare go Hollow

A seat for hardware HEVC, and a run that may keep its file

Browse files at this commit

57f67217b6bcbce9ff753aa667c39e31a3504e49Ahmet Kaan GümüşParent: bacbe9f
  • chore
    • a seat for hardware HEVC, and a run that may keep its file
Show full message
🔧 chore(bench): a seat for hardware HEVC, and a run that may keep its file

`bench export <file> 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.rsmodified+13 -3
@@ -26,7 +26,8 @@
26 //! first frame, `BENCH_EXPORT_CAP` (s, default 300) the wall clock any single26 //! first frame, `BENCH_EXPORT_CAP` (s, default 300) the wall clock any single
27 //! export measurement may take, `BENCH_EXPORT_REPS` (default 5) how many times27 //! export measurement may take, `BENCH_EXPORT_REPS` (default 5) how many times
28 //! an export is repeated *if the cap leaves room* -- a 4K encode gets one28 //! an export is repeated *if the cap leaves room* -- a 4K encode gets one
29-//! capped rep, the small control gets five.29+//! capped rep, the small control gets five -- and `BENCH_KEEP` (unset) whether
30+//! the exported file survives the run instead of being deleted with the number.
30 31
31 use std::path::{Path, PathBuf};32 use std::path::{Path, PathBuf};
32 use std::time::{Duration, Instant};33 use std::time::{Duration, Instant};
@@ -63,7 +64,7 @@ fn usage() -> ! {
63 eprintln!(64 eprintln!(
64 "usage: bench open <file>\n bench seek <file> <secs>\n \65 "usage: bench open <file>\n bench seek <file> <secs>\n \
65 bench scrub <file>\n bench waveform <file>\n \66 bench scrub <file>\n bench waveform <file>\n \
66- bench export <file> <h264sw|h264hw|av1|hevc> <out_dir>"67+ bench export <file> <h264sw|h264hw|av1|hevc|hevchw> <out_dir>"
67 );68 );
68 std::process::exit(2)69 std::process::exit(2)
69 }70 }
@@ -356,7 +357,11 @@ fn export_bench(path: &Path, seat: &str, out_dir: &Path) {
356 "h264sw" => (Format::Mp4, true),357 "h264sw" => (Format::Mp4, true),
357 "h264hw" => (Format::Mp4, false),358 "h264hw" => (Format::Mp4, false),
358 "av1" => (Format::Av1, true),359 "av1" => (Format::Av1, true),
360+ // `hevc` keeps meaning the software intra seat, so a row measured
361+ // against an older baseline still compares with the one beside it; the
362+ // GPU seat is the new name.
359 "hevc" => (Format::Hevc, true),363 "hevc" => (Format::Hevc, true),
364+ "hevchw" => (Format::Hevc, false),
360 _ => usage(),365 _ => usage(),
361 };366 };
362 let metric = format!("export_fps_{seat}");367 let metric = format!("export_fps_{seat}");
@@ -426,7 +431,12 @@ fn export_bench(path: &Path, seat: &str, out_dir: &Path) {
426 }431 }
427 let seats = handle.encoders().unwrap_or_else(|| "?".into());432 let seats = handle.encoders().unwrap_or_else(|| "?".into());
428 let outcome = handle.result();433 let outcome = handle.result();
429- let _ = std::fs::remove_file(&out);434+ // A throughput run leaves nothing behind; `BENCH_KEEP=1` keeps the last
435+ // one, which is how a seat is checked for *decodability* rather than
436+ // speed (`ffprobe -count_frames` on the file it wrote).
437+ if std::env::var_os("BENCH_KEEP").is_none() {
438+ let _ = std::fs::remove_file(&out);
439+ }
430 if capped {440 if capped {
431 samples.push(progress * f64::from(span) / elapsed);441 samples.push(progress * f64::from(span) / elapsed);
432 notes.push(format!("CAPPED at {:.0}s, {:.0}% done, {seats}", elapsed, progress * 100.0));442 notes.push(format!("CAPPED at {:.0}s, {:.0}% done, {seats}", elapsed, progress * 100.0));
scripts/bench.shmodified+1 -1
@@ -98,7 +98,7 @@ for file in "${files[@]}"; do
98 run 1800 "seek_ttff_${t}s" "$file" seek "$t"98 run 1800 "seek_ttff_${t}s" "$file" seek "$t"
99 done99 done
100 run 3600 scrub "$file" scrub100 run 3600 scrub "$file" scrub
101- for seat in h264sw h264hw av1 hevc; do101+ for seat in h264sw h264hw av1 hevc hevchw; do
102 run "$export_limit" "export_fps_$seat" "$file" export "$seat" "$OUT_DIR"102 run "$export_limit" "export_fps_$seat" "$file" export "$seat" "$OUT_DIR"
103 done103 done
104 done104 done