From cf270fa34e75dfe35a1a38e6b246f217bce607ce Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 26 Nov 2026 02:04:33 -0800 Subject: [PATCH] Harness and replay player: count dispatches by the form their kernel reaches its buffers in The harness's matrix counts gain bound_dispatches and address_dispatches, and the replay player's executed counters gain those two with buffer_sets_written and buffer_sets_held, so a run shows which form its dispatches took. Built only; the harness run is the Iris read that follows. --- crates/metal2vulkan-harness/src/rt.rs | 7 ++++++- .../metal2vulkan-validation/src/replay/new_runtime/mod.rs | 4 ++++ docs/REPLAY-STREAM.md | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan-harness/src/rt.rs b/crates/metal2vulkan-harness/src/rt.rs index a23d1b102..73db61000 100644 --- a/crates/metal2vulkan-harness/src/rt.rs +++ b/crates/metal2vulkan-harness/src/rt.rs @@ -454,7 +454,10 @@ impl crate::Device for Device { self.device.counters().metrics().pipelines_created } - /// `Metrics`' passes (encoders), barriers, bytes copied and resolves. + /// `Metrics`' passes (encoders), barriers, bytes copied and resolves, and its dispatches by + /// the form their kernel reaches its buffers in: through set 0's storage buffers + /// (`Metrics::bound_dispatches`) or at their device addresses + /// (`Metrics::address_dispatches`). fn counts(&self) -> Vec<(&'static str, u64)> { let metrics = self.device.counters().metrics(); vec![ @@ -462,6 +465,8 @@ impl crate::Device for Device { ("barriers", metrics.barriers), ("bytes_copied", metrics.bytes_copied), ("resolves", metrics.resolves), + ("bound_dispatches", metrics.bound_dispatches), + ("address_dispatches", metrics.address_dispatches), ] } diff --git a/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs b/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs index 4b02413b9..4f70a11ab 100644 --- a/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs +++ b/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs @@ -3137,6 +3137,10 @@ impl Backend for NewRuntime { ), ("dispatch_heap_barriers", metrics.dispatch_heap_barriers), ("dispatch_other_barriers", metrics.dispatch_other_barriers), + ("bound_dispatches", metrics.bound_dispatches), + ("address_dispatches", metrics.address_dispatches), + ("buffer_sets_written", metrics.buffer_sets_written), + ("buffer_sets_held", metrics.buffer_sets_held), ("segment_end_barriers", metrics.segment_end_barriers), ("upload_barriers", metrics.upload_barriers), ("other_barriers", metrics.other_barriers), diff --git a/docs/REPLAY-STREAM.md b/docs/REPLAY-STREAM.md index 486ac6c78..0e0d73674 100644 --- a/docs/REPLAY-STREAM.md +++ b/docs/REPLAY-STREAM.md @@ -739,7 +739,10 @@ records as text, and `dispatch_write_after_read_barriers`, `dispatch_encoder_end_barriers`, `dispatch_pass_end_barriers`, `dispatch_indirect_barriers`, `dispatch_unbound_barriers`, `dispatch_arena_piece_barriers`, `dispatch_heap_barriers` and `dispatch_other_barriers` - (`Metrics::dispatch_after_write_barriers` and the rest). They differ between commits, and + (`Metrics::dispatch_after_write_barriers` and the rest), and the dispatches by the form their + kernel reaches its buffers in: through storage buffers of set 0 (`bound_dispatches`, with the + sets written for them, `buffer_sets_written`, and those that kept the set written last, + `buffer_sets_held`) or at their device addresses (`address_dispatches`). They differ between commits, and between plays of one commit where what the runtime records depends on timing. Only the stream's counts are compared between plays.