From 0f61ed6b637ddca1da38a3be793ac644d0e0d281 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Thu, 15 Oct 2026 03:29:56 +0200 Subject: [PATCH] benchmark: Apple GPUs by name (Metal has no vendor ID) Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/benchmark.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/crates/horizon-client/src/benchmark.rs b/crates/horizon-client/src/benchmark.rs index 7f3464782..00b0f1076 100644 --- a/crates/horizon-client/src/benchmark.rs +++ b/crates/horizon-client/src/benchmark.rs @@ -132,7 +132,11 @@ fn run(control: &Control, setup: Setup) -> Result { let renderer = &title["renderer"]; report.hardware.gpu = Some(horizon_bench::Gpu { name: text(&renderer["gpu"]), - vendor: text(&renderer["vendor"]), + vendor: match text(&renderer["vendor"]) { + // Metal reports no vendor ID. + v if v.is_empty() && text(&renderer["gpu"]).starts_with("Apple") => "apple".into(), + v => v, + }, driver: text(&renderer["driver"]), backend: text(&renderer["backend"]).to_lowercase(), kind: text(&renderer["device_type"]), @@ -297,8 +301,8 @@ const QUIET_MESHES_PER_S: f64 = 100.0; /// the last of these happened (`tools/perf_bench.py`'s `wait_loaded`). fn wait_loaded(control: &Control, near: impl Fn(&Value) -> bool) -> Result { let deadline = Instant::now() + LOAD_LIMIT; - let (mut last, mut changed, mut previous, mut meshing) = - (None, Instant::now(), None, Instant::now()); + let (mut last, mut changed, mut meshing) = (None, Instant::now(), Instant::now()); + let mut previous: Option<(Instant, f64)> = None; while Instant::now() < deadline { let s = control.status(); let now = Instant::now(); @@ -315,10 +319,10 @@ fn wait_loaded(control: &Control, near: impl Fn(&Value) -> bool) -> Result QUIET_MESHES_PER_S * (now - at).as_secs_f64() { - meshing = now; - } + if let Some((at, before)) = previous + && meshed - before > QUIET_MESHES_PER_S * (now - at).as_secs_f64() + { + meshing = now; } previous = Some((now, meshed)); let done = changed.max(meshing);