From f29eb171a4e115a824cc76874e4a4fad130454f5 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Tue, 17 Nov 2026 11:27:43 -0800 Subject: [PATCH] harness: gauges at runs 100 and 200 are read with the device idle The matrix at a17eb26a6b failed harness-new/frame/command_buffers flatness: 63 at run 100 against 60 at run 200 on the Hawk Point, 62 against 64 on the RX 550. The new runtime's command_buffers gauge counts command buffers made and not yet retired: the work in flight when it is read, which moves with completion timing. The harness now waits for the runs committed so far before it reads the gauges at runs 100 and 200, so they count what the runs left behind; a leak still grows between them. --- crates/metal2vulkan-harness/src/run.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/metal2vulkan-harness/src/run.rs b/crates/metal2vulkan-harness/src/run.rs index 9282e0936..e1530fb23 100644 --- a/crates/metal2vulkan-harness/src/run.rs +++ b/crates/metal2vulkan-harness/src/run.rs @@ -134,7 +134,8 @@ pub struct Report { /// Each run's process CPU time from before its command buffer's creation through the return /// of the wait for the run before it, in nanoseconds; empty where the host has no such clock. pub cpu_ns: Vec, - /// The device's gauges after the 100th and the 200th timed run, where there were that many. + /// The device's gauges after the 100th and the 200th timed run, where there were that many, + /// read once the work committed by then completed: what the runs left behind. pub gauges: Vec<(u32, Vec<(&'static str, u64)>)>, /// The contents of the plan's outputs after the first run, in its order. pub outputs: Vec>, @@ -587,6 +588,9 @@ impl Session for Harness { report.encode_ns.push(encoded.as_nanos() as f64); report.gpu_us.push(gpu_us); if run == 100 || run == 200 { + // With the device idle, so the gauges count what the runs left behind, not the + // work in flight at that moment, which moves with completion timing. + wait_run::(&in_flight)?; report.gauges.push((run, self.device.gauges())); } }