diff --git a/crates/metal2vulkan-harness/src/bin/harness.rs b/crates/metal2vulkan-harness/src/bin/harness.rs index 419d60399..99bb72b95 100644 --- a/crates/metal2vulkan-harness/src/bin/harness.rs +++ b/crates/metal2vulkan-harness/src/bin/harness.rs @@ -436,6 +436,11 @@ fn print(runtime: &str, name: &str, report: &Report) { commit(99), gauges(&report.gauges), ); + println!( + "{name:<17} {runtime:<8} timed runs: {:.2} submissions and {} submit infos a run", + report.timed_submissions, + (report.timed_submit_infos).map_or("-".to_owned(), |infos| format!("{infos:.2}")), + ); if report.commit_us.len() > 1 { let places: Vec = (report.commit_us.iter().enumerate()) .map(|(place, times)| format!("#{} {} / {}", place + 1, us(times, 50), us(times, 99))) diff --git a/crates/metal2vulkan-harness/src/lib.rs b/crates/metal2vulkan-harness/src/lib.rs index 5eb1cb6cb..4c41ecd55 100644 --- a/crates/metal2vulkan-harness/src/lib.rs +++ b/crates/metal2vulkan-harness/src/lib.rs @@ -90,7 +90,9 @@ //! first-use waits ([`Waits`]): the count, and their total and longest time in microseconds. //! Each plan workload also prints the runtime's own counts of its work ([`Device::counts`]) over //! one run after the timed ones, run alone; the table shows that run's submissions -//! ([`Device::submissions`]), which timing decides, so they are no matrix metric: +//! ([`Device::submissions`]), and a line of its own the submissions and submit infos +//! ([`Device::submit_infos`]) a timed run made with two in flight, which timing decides, so they +//! are no matrix metric: //! //! ```text //! M2V-MATRIX metric harness-//pipelines_created @@ -227,6 +229,10 @@ pub trait Device: Sized { /// Metal counterpart. fn submissions(&self) -> u64; + /// The submit infos (`VkSubmitInfo2`s) those calls passed so far; `None` where the runtime + /// does not count them. No Metal counterpart. + fn submit_infos(&self) -> Option; + /// The runtime's first-use waits so far; `None` where it does not count them. No Metal /// counterpart. fn first_use_waits(&self) -> Option; diff --git a/crates/metal2vulkan-harness/src/old.rs b/crates/metal2vulkan-harness/src/old.rs index e31134e25..f1e318968 100644 --- a/crates/metal2vulkan-harness/src/old.rs +++ b/crates/metal2vulkan-harness/src/old.rs @@ -67,6 +67,11 @@ impl crate::Device for runtime::Device { self.work_counts().queue_submissions } + /// None: it counts no submit infos. + fn submit_infos(&self) -> Option { + None + } + /// `None`: it does not count them. fn first_use_waits(&self) -> Option { None diff --git a/crates/metal2vulkan-harness/src/rt.rs b/crates/metal2vulkan-harness/src/rt.rs index 41662625d..e5bb798cf 100644 --- a/crates/metal2vulkan-harness/src/rt.rs +++ b/crates/metal2vulkan-harness/src/rt.rs @@ -382,6 +382,11 @@ impl crate::Device for Device { self.device.counters().metrics().submissions } + /// `Metrics::submit_infos`. + fn submit_infos(&self) -> Option { + Some(self.device.counters().metrics().submit_infos) + } + /// `Metrics::first_use_waits`, with their time and the longest. fn first_use_waits(&self) -> Option { let metrics = self.device.counters().metrics(); diff --git a/crates/metal2vulkan-harness/src/run.rs b/crates/metal2vulkan-harness/src/run.rs index ea582ac4b..d5e4c8bac 100644 --- a/crates/metal2vulkan-harness/src/run.rs +++ b/crates/metal2vulkan-harness/src/run.rs @@ -155,6 +155,12 @@ pub struct Report { pub counts: Vec<(&'static str, u64)>, /// The runtime's submissions ([`Device::submissions`]) over that run. pub submissions: u64, + /// The runtime's submissions over the timed runs, two in flight, per run: how many its + /// grouping made of them. + pub timed_submissions: f64, + /// The submit infos those submissions passed, per run ([`Device::submit_infos`]); `None` + /// where the runtime does not count them. + pub timed_submit_infos: Option, /// Each run's encoding thread's wall time from the command buffer's creation through /// `commit`'s return, in nanoseconds. pub encode_ns: Vec, @@ -873,6 +879,7 @@ impl Session for Harness { ..Report::default() }; let completions = (plan.commit_to_complete).then(|| Arc::new(Completions::default())); + let (submitted, infos) = (self.device.submissions(), self.device.submit_infos()); for run in 1..=runs.timed { let wall = Instant::now(); let cpu = clocks::process_cpu_nanos(); @@ -891,6 +898,10 @@ impl Session for Harness { } } wait_run::(&in_flight)?; + let timed = f64::from(runs.timed.max(1)); + report.timed_submissions = (self.device.submissions() - submitted) as f64 / timed; + report.timed_submit_infos = (infos.zip(self.device.submit_infos())) + .map(|(before, after)| (after - before) as f64 / timed); if let Some(completions) = completions { report.commit_us = completions.wait(runs.timed as usize, plan.command_buffers())?; }