diff --git a/crates/metal2vulkan-rt/README.md b/crates/metal2vulkan-rt/README.md index ade3d0b54..c5f27d59d 100644 --- a/crates/metal2vulkan-rt/README.md +++ b/crates/metal2vulkan-rt/README.md @@ -876,9 +876,10 @@ that touch blocks first. again. A command buffer whose pair reads as not available once its submission signalled has times of 0 too, and `Metrics::stamps_not_available` counts it: a submission the device cancelled at a reset, or a driver that makes timestamps available only after the signal. A command buffer - retires only once a host wait has seen its submission's progress value: where the semaphore's - counter read runs ahead of that wait, `Metrics::waits_behind_counter` counts the round, and - nothing retires until the wait agrees. The device tests, the harness and the replay player + retires only once a host wait has seen its submission's progress value: with one value pending + the completion thread asks only that wait, and with more, where the semaphore's counter read + runs ahead of the wait, `Metrics::waits_behind_counter` counts the round, and nothing retires + until the wait agrees. The device tests, the harness and the replay player report both counts. Vulkan states no most queries a pool may hold or most pools a device may make; the runtime's 4,096 a pool is the smallest met: Mesa's Apple-GPU driver makes each pool a Metal counter heap, of at most 4,096 entries and at most 32 live in a process, so there at most diff --git a/crates/metal2vulkan-rt/src/readback.rs b/crates/metal2vulkan-rt/src/readback.rs index 4e4822b21..8c9fb6a4b 100644 --- a/crates/metal2vulkan-rt/src/readback.rs +++ b/crates/metal2vulkan-rt/src/readback.rs @@ -17,15 +17,13 @@ use ash::vk; /// state"). /// /// The caller reads a pair only once a host wait of the completion thread has seen its submission's -/// progress value (a wait with a timeout of 0 after the counter read, where the counter told it -/// first). The signal's first synchronization scope "includes every command in the same batch that -/// the signal operation is defined in, and all commands that occur earlier in submission order" -/// (`vkQueueSubmit2`), "a query is made available by the operation of ... `vkCmdWriteTimestamp2`", -/// and the host wait happens after the signal ("signal operations happening before host operations -/// that wait on them"): the pair of a submission that ran is available at the read. A driver that -/// makes timestamps available only after the signal (MoltenVK 1.4.2 on an M3 Max did, for most -/// command buffers; it is below the floor) would read none here and leave the GPU times 0 with no -/// other sign, so the caller counts each pair that reads as not available +/// progress value (with one value pending, a wait with a timeout of 0 on it; with more, that wait +/// on the value the counter read found). The read has no wait bit, and Vulkan defines a dependency +/// on the timestamp writes only for a read with `VK_QUERY_RESULT_WAIT_BIT`: the signal says nothing +/// about the queries' availability, so a pair can read as not available though its submission ran, +/// as from a driver that makes timestamps available only after the signal (MoltenVK 1.4.2 on an M3 +/// Max did, for most command buffers; it is below the floor). Such a pair leaves the GPU times 0 +/// with no other sign, so the caller counts each pair that reads as not available /// (`Metrics::stamps_not_available`), and every play and suite leg reports the count. /// /// Bound: the values only decide that command buffer's `GPUStartTime`, through arithmetic defined