Validation: a play's gauges at frames 100 and 200 go out as the matrix's records, every kind on its end lines

What:
- The runtime backend's end lines (`Backend::live`) carry every count of an object kind the
  runtime keeps live: samplers, LOD clamp variants, level elements, kernel variants and entries,
  render contents, attachment views, descriptor slots, device samplers, shadows, resolve images,
  plane stand-ins, buffer set pools, surface buffers, indirect command buffers, releases waiting
  and handles out join them, and the pipeline cache's bytes.
- At the ends of frames 100 and 200 (GAUGE_FRAMES) the player reads them once they hold still
  (Backend::settled_live): the runtime backend reads them every 10 ms until no release waits and
  two reads in a row agree on every recorded kind, for at most 2 s, a wait no frame's time holds.
  What the program released goes on the runtime's block-maker and reaper threads after the work
  before it retired, so a read straight after the frame's waits could differ between two plays.
- command-replay prints, where the play ended frame 200 and skipped nothing by then,
  `M2V-MATRIX gauge replay-rt/STEM/GAUGE@100` and `@200` for each kind of GAUGED (gauge_records).
  scripts/matrix/results.py judges them as it judges the harness's: equal at 100 and 200, blocks
  no higher at 200.
- Left out, and why: handles_out (1 while the play holds the device), releases_waiting (lowered by
  the block-maker thread whenever it runs), private_units (a layout of memory that follows the
  bytes the program holds), and every byte and age gauge, which follows the program's content and
  the pool's idle clock: the pipeline cache's data (bound 128 MiB), the translator's entries'
  bytes (bound 64 MiB), the staging bytes, the pool's allocated, idle, reserved, reused, taken and
  block bytes, and the shadows', resolve images' and stand-ins' bytes, whose counts are recorded.

Why: the matrix's leak rule (live gauges per resource kind flat between iterations 100 and 200)
reached only the harness's compute workloads. The kinds only draws and passes make (render
contents, attachment views, shadows, resolve images, stand-ins, the samplers draws reach) had no
such check, and a play's end lines lacked 17 of the kinds.

Docs: REPLAY-STREAM.md section 10 (the end line's gauges, the settled read, the records),
VALIDATION.md's gauge row, command-replay's module doc.

Tests: replay::tests the_player_settles_the_gauges_at_frames_100_and_200_alone and
the_gauge_records_are_the_counted_kinds_at_frames_100_and_200; replay::rt_replay
the_end_lines_carry_every_gauge_the_gauge_records_carry (device); test_results.py
test_a_plays_gauges_at_frames_100_and_200_are_held_flat_as_the_harness_s.

Verified: in the hand-over.
This commit is contained in:
Anees Iqbal committed 2026-12-02 14:24:06 -08:00
1 parent da37e9e5df
commit f4eb47d792
10 files changed
+287 -27

No files matched your search

+26 -6
View File
@@ -1129,13 +1129,21 @@ union of the GPU intervals of the command buffers the frame waited for, where th
them, which runs beside the rest, then `gpu_longest` and `gpu_longest_cb`, the longest of those
intervals, one command buffer's, and that command buffer's stream id (the first of equal ones; 0
and 0 where the runtime gives none); and the backend's gauges then, as they stand, never as growth:
the runtime's live blocks, buffers, textures, pipelines, kernels, command buffers, timestamp and
occlusion query pools, spilled bytes, Managed buffers'
the runtime's live blocks, imports, exports, surface imports, surface buffers, buffers, textures and
those copied over, samplers, LOD clamp variants, level elements, pipelines, kernels, kernel
variants and entries, render contents, attachment views, command buffers, descriptor slots,
events, device samplers, shadows, resolve images, plane stand-ins, timestamp, occlusion and buffer
set pools, indirect command buffers, releases waiting, handles out, the pipeline cache's bytes,
spilled bytes, Managed buffers'
spilled bytes (`managed_spilled_bytes`: the bytes of those whose GPU copy the player placed in a
spilled Private block) and idle Shared and
Private bytes the pool keeps, and the bytes
spilled Private block), the pool's Shared and Private bytes allocated, idle (and the idle ones'
ages), reserved and reused long, its Private units and their bytes used, the texture blocks'
bytes and those held, the Private takes' bytes and those held, the textures' own allocations'
bytes, the staging bytes, the translator's entries and their bytes, and the bytes
of the blocks the backend holds for the stream by class, `shared_block_bytes` and
`private_block_bytes`),
`private_block_bytes`; at the ends of frames 100 and 200, the gauges once they hold still: read
every 10 ms until no release waits and two reads in a row agree on every kind the gauge records
below carry, for at most 2 seconds, a wait of the player's own that no frame's time holds),
`devices apart from the guest's: #ID ...` where the stream recorded devices besides the one the
guest makes its objects on (section 4), `check ID frame F SHA256 match|differs|unrecorded|covered|receiver` (`F` the frame it was read in, the presents played before it), ending `(CPU copy)` or `(device copy, read back)` for a buffer with two copies (above), `id ID RECORDED PLAYED` for each object whose runtime
gives another `gpuResourceID` than the program saw (both in hex, `PLAYED` `none` where the
@@ -1251,7 +1259,19 @@ metric replay-rt/STEM/RANGE/NAME N` (`STEM` the first segment's stem, whitespace
`new_texture_zeroed_bytes`, their bytes), each one two plays of one stream at one commit
on one card gave alike, which the matrix's rule (`scripts/matrix/results.py`) holds equal to the
base's, failing a play whose base has a record it lacks; a play that did not finish its range
prints none,
prints none; where the play ended frame 200 and the backend skipped nothing by then, the matrix's
gauge records, one line each, `M2V-MATRIX gauge replay-rt/STEM/GAUGE@F N` for `F` 100 and 200 and
each count of a kind of object the runtime keeps live on the frame's `end` line (its blocks,
imports, exports, surface imports, surface buffers, buffers, textures and those copied over, samplers,
LOD clamp variants, level elements, pipelines, kernels, kernel variants and entries, render
contents, attachment views, command buffers, descriptor slots, events, device samplers, shadows,
resolve images, plane stand-ins, timestamp, occlusion and buffer set pools, indirect command
buffers and the translator's entries), which the matrix's rule holds equal between the two
frames (`blocks`, the pool's allocations, no higher at 200), as it holds the harness's between
its 100th and 200th runs; the handles out (1 while the play holds the device), the releases
waiting (which the runtime's own thread lowers whenever it runs), the Private units (a layout of
memory that follows the bytes the program holds) and every byte and age gauge (which follow the
program's content and the pool's idle clock) are not records,
then `ok`, `ids: played to the end; N objects' gpuResourceID differ from the recording's` where
the play ended but objects whose ID the program saw have other IDs in the runtime, or
`error WHAT`. Where the backend skipped anything, the `skipped` line and the last
+1 -1
View File
@@ -283,7 +283,7 @@ changes the harness sets the base for the next.
|---|---|---|
| `metric` | A deterministic count per frame or per command buffer: submissions, passes, barriers, bytes copied, pipelines created; and the replay player's totals of a play (`replay-rt/STREAM/RANGE/NAME`, [REPLAY-STREAM.md](REPLAY-STREAM.md) section 10), each one two plays of one stream at one commit on one card gave alike, printed only by a play that finished its range and skipped nothing | It is larger than the base's; a replay total, when it differs from the base's either way, or when the base has it and the leg does not (`EQUAL_METRICS`) |
| `instructions` | User-space CPU instructions per draw or per dispatch, and per harness run, the p50 over the row's timed runs: the whole process's (`harness-<runtime>/<row>/per_run`), and where the runtime names its threads, theirs with the harness's thread (`.../own_per_run`) and the rest, a driver's own threads (`.../others_per_run`) | It is more than 1% over the base's; the harness's counts are judged by the instructions gate instead (below) |
| `gauge` | Live objects of one resource kind, the key ending in the point it was read at: `@100` and `@200` (loop iterations), `@drop` (after the device dropped) | `@drop` is not 0, or `@200` differs from `@100`; for the memory pool's `blocks`, which frees allocations an earlier workload left idle once the most bytes in use over its window falls and the device is quiet for 20 ms, only `@200` over `@100` |
| `gauge` | Live objects of one resource kind, the key ending in the point it was read at: `@100` and `@200` (loop iterations: the harness's 100th and 200th runs, and a play's frames 100 and 200, `replay-rt/STREAM/GAUGE`, [REPLAY-STREAM.md](REPLAY-STREAM.md) section 10), `@drop` (after the device dropped) | `@drop` is not 0, or `@200` differs from `@100`; for the memory pool's `blocks`, which frees allocations an earlier workload left idle once the most bytes in use over its window falls and the device is quiet for 20 ms, only `@200` over `@100` |
| `time` | A duration in microseconds: what a program waits on in a harness workload's run, timed on the host: for the frame rows (`frame`, `frame_5cb`), their throughput, two runs in flight, from one run's last completed handler to the next's, and their latency from idle as rows of their own (`<row>_from_idle`), one run in flight, from its first commit to its last completed handler; for another workload that times its command buffers, its last command buffer's commit-to-complete time (the others' lateness is a column of the harness's table and no record), else the host wall time a run adds (a run's GPU time is a record of its own, `harness-gpu-<runtime>/<row>`, parked here) | Only as a cross-GPU outlier: its ratio to the base's is more than 1.25 times the median of that ratio over at least 3 GPUs. A leg with such an outlier of a harness row's time has its harness timed once more after every leg is in, and an outlier fails the leg only where both passes agree |
| `size` | The size a harness row whose size follows the device ran at (`long_4cb`) | Never: it says what work the row's times measured |
| `locks` | The lock budget's locked instructions per million added commands (`lock_budget/draw`, `lock_budget/bound_draw`, `lock_budget/dispatch`; rt's `tests::locks`), the whole process's in user space, on a node whose matrix setup names its CPU's event in `M2V_LOCK_EVENT` (`cpu_core/r21d0`, `r1e25`) | The test fails past 0.25 per added command, on every node alike; on a node whose setup names the event, a GPU leg missing any of the three fails; elsewhere each budget test passes counting nothing and prints `M2V-MATRIX uncounted lock_budget/<key>`, which the leg's line shows as `not counted` |