harness: each row prints the submissions and submit infos a timed run made

The runtime's submissions and submit infos (Device::submit_infos, Metrics::submit_infos on the
new runtime, none on the old) over the timed runs, two in flight, per run: what grouping and
shared submit infos made of a run, where the row's submissions column counts one run done alone.
This commit is contained in:
Anees Iqbal committed 2026-11-17 21:55:44 -08:00
1 parent 45d18535d3
commit c65a4fb740
5 files changed
+33 -1

No files matched your search

@@ -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<String> = (report.commit_us.iter().enumerate())
.map(|(place, times)| format!("#{} {} / {}", place + 1, us(times, 50), us(times, 99)))
+7 -1
View File
@@ -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-<runtime>/<set>/pipelines_created <n>
@@ -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<u64>;
/// The runtime's first-use waits so far; `None` where it does not count them. No Metal
/// counterpart.
fn first_use_waits(&self) -> Option<Waits>;
+5
View File
@@ -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<u64> {
None
}
/// `None`: it does not count them.
fn first_use_waits(&self) -> Option<crate::Waits> {
None
+5
View File
@@ -382,6 +382,11 @@ impl crate::Device for Device {
self.device.counters().metrics().submissions
}
/// `Metrics::submit_infos`.
fn submit_infos(&self) -> Option<u64> {
Some(self.device.counters().metrics().submit_infos)
}
/// `Metrics::first_use_waits`, with their time and the longest.
fn first_use_waits(&self) -> Option<Waits> {
let metrics = self.device.counters().metrics();
+11
View File
@@ -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<f64>,
/// Each run's encoding thread's wall time from the command buffer's creation through
/// `commit`'s return, in nanoseconds.
pub encode_ns: Vec<f64>,
@@ -873,6 +879,7 @@ impl<D: ComputeDevice> Session for Harness<D> {
..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<D: ComputeDevice> Session for Harness<D> {
}
}
wait_run::<D>(&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())?;
}