Files
metal2vulkan/crates
Anees Iqbal 614d97a5b0 Runtime: count what an unshared queue's long waits waited behind
The compositor-isolation decision needs to know, for an unshared queue's command buffers that wait
over 16 ms behind another command queue's work on a one-queue GPU, whether they wait behind many
batches queued ahead or behind one long batch. Four counters, always on, for those waits:

- WorkCounts::unshared_waits_over_16ms_batches_ahead: the batches in flight ahead of each on its
  VkQueue as its first batch took its value (timeline values past the one the host saw complete),
  summed; ..._most_batches_ahead the most;
- ..._longest_runs_nanos: the longest run each waited for, summed, where a run is the host's view of
  how long the VkQueue's oldest batch in flight was so (completion seen to completion seen, or from
  its submission onto a VkQueue the host saw idle);
- ..._behind_one_long_run: those whose longest run alone was over 16 ms.

How (queue_wait.rs): each VkQueue keeps the host time its oldest batch became so, and, while a wait
is timed, a sliding maximum of the runs seen since the oldest timed wait began (a deque falling from
the front; a wait's longest run is its front once runs from before it are dropped). O(1) a
completion amortized, plus one clock read per completion; no more runs kept than the batches the
oldest wait was behind.

The queue_share example gains a `frames` mode: a compositor committing one draw every --period-ms
(16) beside an application keeping --in-flight long command buffers of --long-ms (30) in flight,
with the compositor's latencies, the application's rate and these counts.

The API signatures table is re-blessed (scripts/api-signatures/signatures.py --bless).
2026-11-11 09:44:37 -08:00
..