Files
metal2vulkan/docs
Anees Iqbal b1b5168fd6 Replay report: untimed waits, the runtime's stage sums and its stage histograms by frame
The 5080 play of a 3090 compute recording waited 42.5 s of 95.1 s wall with 23.1 s of gpu_busy;
before a fix is ruled on, the report must say where the other 19.4 s went. Three reads were
missing from it:

- A waited command buffer with no GPU interval (start 0, or end not past start) adds nothing to
  gpu_busy while its wait counts in full. Each frame's end line now has untimed_waits and
  untimed_wait (the wait spent on them), and the report sums them in an `untimed waits` line.
- The runtime already histograms every command buffer's commit to scheduled, scheduled to GPU
  start, GPU run and GPU end to handler, but only in power-of-two buckets, which give no seconds.
  Metrics now keeps each stage's sum beside its histogram (commit_to_scheduled_nanos and the
  three like it), counted in the same call as the bucket.
- The player printed none of it. The backend's executed counters, so every frame line and the
  total, now carry the four sums, held_starts and held_start_gap_nanos, runtime_command_buffers
  and runtime_command_buffer_gpu_nanos (the uploads and copy-ins that run outside every Metal
  command buffer's GPU interval), and untimed_command_buffers. The four histograms print at the
  play's end as `stages F ...` lines, cumulative as each frame ended, and `stages end ...`.
  They are not per-frame counters, so the 69k `completed` lines of a long play do not grow by
  92 keys each.

Tests: the runtime's stage histogram test also checks each sum against the three command
buffers' own times (exact for the first three stages, bounded by the host time after each
finished for the fourth); a player test on the synthetic backend counts a frame's untimed
waits (none and zero-length intervals) and the report's sum; a lavapipe replay test reads the
new counters and the stages lines across two frames.
2026-11-20 19:44:55 -08:00
..