From 7e59bca6ef028f72752192d22239ef406b686f40 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 19 Nov 2026 06:56:02 -0800 Subject: [PATCH] rt: forced_flushes_across_queues says what it counts: its test omits three of the own queue's reasons The counter's doc said no path of the submit thread sends a group with no reason of its own queue's, so it stays 0. A boot on a 780M read 119. Its test in close omits three reasons step sends a group for, all of the group's own queue: a command buffer that cannot join it (its queue's expected run not known, or the group at GROUP_RUN or UNSEEN_JOINS), and a segment that leans on a copy for a buffer an earlier segment of the group wrote. So it counts with one queue too. The doc now says so, and that a group sent for another queue's fence waiter is not counted (it goes as a host wait would send it). Verified: a scratch device test (never lands) on lavapipe, one queue, six commits held behind its busy work: forced +1 and submissions +1 while held, the fifth commit past UNSEEN_JOINS sending the group of four (job m3-max-52396). --- crates/metal2vulkan-rt/src/counters.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/metal2vulkan-rt/src/counters.rs b/crates/metal2vulkan-rt/src/counters.rs index d58ecff66..905523880 100644 --- a/crates/metal2vulkan-rt/src/counters.rs +++ b/crates/metal2vulkan-rt/src/counters.rs @@ -1011,10 +1011,13 @@ pub struct Metrics { /// device had three or more in flight across its queues: the ones one queue of the same /// command buffers would have held in a group. pub lone_submissions_across_queues: u64, - /// Groups sent with no reason of their own queue's: neither full, nor ended by an event's - /// signal or a semaphore wait, nor below three submissions in flight, nor asked for by a host - /// wait or the end. No path of the submit thread sends one, so this stays 0; it is counted to - /// show it. + /// Groups sent with none of these reasons: full, ended by an event's signal or a semaphore + /// wait, below three submissions in flight, asked for by a host wait, by another queue's + /// command buffer that waits on a fence the group updates, or by the end. Its test omits three + /// reasons of the group's own queue's, which it counts, with one queue too: a command buffer + /// that cannot join the group (its queue's expected run not known, or the group at its bound + /// of summed expected runs or of joins while none of the queue's retires), and a segment that + /// leans on a copy for a buffer an earlier segment of the group wrote. pub forced_flushes_across_queues: u64, /// Copies a draw that reads an attachment of its own pass through a texture makes into the /// image's shadow first, on a device without the attachment feedback loop, which Metal does