The read without the wait (f6906db61e) reports no times for a pair that is not available. Two
things leave a pair that way once its submission signalled: a submission the device cancelled
at a reset, which signals having run nothing, and a driver that makes timestamps available only
after the signal (MoltenVK 1.4.2 on an M3 Max did, for most command buffers, which is why the
read waited; MoltenVK is below the floor now). The second would zero GPU times with no other
sign, so each such read is counted: Metrics::stamps_not_available, through Pair::times, the
one counted read that CbInner::stamps makes.
Reported where the matrix records it:
- rt's device tests: `M2V-MATRIX metric <test>/stamps_not_available <n>` from each device the
device loop opens (tests::command::on_device::on_each_device);
- the harness: `M2V-MATRIX metric harness-<runtime>/device/stamps_not_available <n>`, from the new
Device::totals and Session::totals, before the session finishes (empty for the old runtime);
- the replay player: the `stamps_not_available` counter in each frame's executed counters.
The readback test now reads through Pair::times on counters of its own and checks that the read
counts one, so the device's record stays that of its real command buffers.
The specification read (Vulkan 1.4.366, sections 7.4 to 7.4.4, 23.2, 23.5 and the memory
model's system-synchronizes-with):
- "A query is made available by the operation of ... vkCmdWriteTimestamp2" (23.2);
- 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);
- "signal operations happening before host operations that wait on them" (memory model, the
note under System-Synchronizes-With).
So a pair is available to a read made after a host wait (vkWaitSemaphores) that saw its
submission's value. The completion thread also retires values it learns from
vkGetSemaphoreCounterValue alone (after a wait that returned for an event, for its wake or for an
earlier value), and for that command the specification states no ordering: only that "the value
returned by this command may immediately be out of date". The count covers both.
Public surface: Metrics::stamps_not_available (api_signatures.tsv; signatures.py --check run
here and clean). Not yet compiled or run.