Commit Graph
6950 Commits
Author SHA1 Message Date
Anees Iqbal 56efbd0e13 matrix: the floors measured with the mean statistic on seven legs; the seeded-floor stopgap deleted
scripts/matrix/floors.tsv held floors seeded from old-runtime runs under the nearest-rank
statistic, some of them the old runtime's paired completions read as a fast run (alu 22.066 on
the 780M leg, 19.640 on the Iris). Measured again with the harness of 4cc7963005 (a row's time the
lowest mean of its windows of 10 timed runs, an untimed run after each gauge read): 4 runs of
`harness --runtime old` per leg, A B B A, each its own process on a fresh driver shader cache and
store, a sized row at the first run's size; a row's floor is the largest of its 4 times over the
smallest. Legs: 1002:15bf (gem10's 780M, m3-max-45422), 1002:699f (m3-max-45423), 1002:744c
(m3-max-45424), 10de:1e87 (m3-max-45425), 10de:2204 (um870's 3090, m3-max-45426), 8086:3e9b
(m3-max-45437) and 8086:a7a0 (m3-max-45427). 1002:1900 (um870's 780M) is not measured yet; a leg
the file does not list keeps a floor of 1. The seed's 1002:15bf column came from runs on
1002:1900.

With the table measured, the seeded-floor naming goes: SEEDED_FLOOR_OPEN, seeded_floor() and their
uses in harness_budget, its test, and VALIDATION.md's sentence on the seed.

Verified: the matrix's Python tests in the check job named in the report.
2026-11-18 02:41:31 -08:00
Anees Iqbal 81fa11a105 rt pool: a commit or submission during an idle allocation's free starts the quiet time again where the free ends
The quiet clock was stamped when a commit or submission began. A driver
may hold a submission for a whole vkFreeMemory (NVIDIA in Thunderbolt
enclosures: a 64 MiB free took 57 ms on the 2080 and held a submission
52 ms, probe job m3-max-45391), so when the free ended the device already
looked quiet for longer than 20 ms, and the block-maker thread could start
the next free at once, back to back with the program's next submission.
After each free, where a commit or submission began during it, the quiet
time now starts again at the free's end.

The device test that holds a free open now holds it 30 ms past the
submission it counts, and asserts the next free begins at least 20 ms
after the hold ended. Without the change that free begins as soon as the
hold ends.
2026-11-18 02:35:05 -08:00
Anees Iqbal 5abbd52c0e matrix: the memory pool's blocks gauge fails only on a rise between iterations 100 and 200
The matrix at cbd4644463 failed long_4cb's blocks gauge on the XTX, 2080
and 3090 (9 at iteration 100, 8 at 200). The cause, from the quiet probe
(each idle free logs the time since the last commit): the pool frees an
allocation an earlier workload left idle once the most bytes in use over
its window falls and the device has been quiet for 20 ms, and long_4cb is
the first row after the earlier rows' peak whose runs leave 20 ms gaps
between submissions. On the RTX 5080 (b5080 entry quiet5080, q10
0c0e50688a / q3 6b8cd2b793, 2 runs each) the 10 s window freed a 16 and
two 64 MiB allocations 6.5 and 7.5 s into long_4cb (11 -> 8), the 3 s
window the two 64 MiB ones 0.53 s in (8 -> 8); every free in every run on
the 5080, XTX (m3-max-45392) and 2080 (m3-max-45391) began 20.0 to 52 ms
after the last commit, so the quiet clock saw every commit.

Per the planner's ruling, the pool's gauges (blocks) now fail only if
they rise between @100 and @200; @drop still has to be 0, and every other
gauge stays flat. Verified: scripts/matrix tests, 37 OK, run locally; the
new test fails without the change (a fall of blocks is a problem there).

The commit before this one (1f41099948) shows each row's GPU p50
(store2's harness-gpu-<runtime>/<row> records, parked) beside its time
in the budget's lines and in a list of every row that run and show print
under each leg, and names a row that passes only on a seeded floor over
1.10. Its tests (36 OK at that commit) pin the line formats.
2026-11-18 02:32:53 -08:00
Anees Iqbal 5422cf1825 matrix: every row's GPU p50 beside its time; rows passing only on a seeded floor over 1.10 named 2026-11-18 02:32:53 -08:00
Anees Iqbal e060958855 rt: one StageEntries per device, read by every compute and render creation
What: rt made a fresh StageEntries at three sites:
- every compute creation (Compiled::of);
- the reaper's emulated-variant lowering;
- every render creation (new_render_pipeline_state).
So every creation decoded its module again (the bitstream, the bitcode records and the AIR
metadata ABI) and specialized its stage again. The old runtime gives every creation of a device
one object (pipeline/memo.rs). Core now holds one, and the three sites read it.

The object is the translator's own and is bounded: 32 specialized entries in 64 MiB and 4 module
decodes in 32 MiB, least recently used first. Device::new and the old runtime's use are
unchanged. The translator gains StageEntries::held(), which reads entries, decodes and bytes held.
rt gains two gauges, Gauges::stage_entries and Gauges::stage_entry_bytes. They are set after each
lowering and render creation, zeroed at teardown, and printed on the replay player's end lines as
stage_entries= and stage_entry_bytes=.

A new translator test, an_object_filled_past_its_bounds_keeps_only_the_most_recent, asks one entry
at 40 call-stack depths. It checks that the object holds at most 32 entries and one decode within
its byte bounds, that the latest depth is found again, and that the first depth, evicted, is made
again. Before this, no test filled the object past its entry bound.

Why: store2 timed rt's lowering at 1.5-2.0x old's for the same function. Probe b913909727, on
store2's 0e215f2c80, ran job m3-max-45251 on homelab-gem10-1 (lowering us, median of 3):
- first state: old 711, rt fresh 1144, rt with one object 586;
- second state: old 548, rt fresh 876, rt with one object 434.
The counts showed rt fresh reading one module decode per creation, while old and the shared arm
read it once and copied it after.

Verified: see the jobs named in the landing message.
2026-11-18 02:28:56 -08:00
Anees Iqbal 4cc7963005 harness: an untimed run after each gauge read, so the next timed run waits for a run in flight
The timed loop reads the gauges after its 100th and 200th runs with the device idle. The 101st
run's wait was then for the 100th, already complete, so it timed the encoding alone: on ms01's
Iris Xe 61 us of waves' 2191 us of GPU a run, 196 us of zero_products' 4367 (job m3-max-45380,
probe cb18fded59, every timed wall in order). A median of 10 runs ignored that one short run; the
lowest mean of windows of 10 takes it: the window holding it read 6% under every other unpaired
window (waves 2090, zero_products 4115 against GPU times of 2191 and 4367), on every runtime. An
untimed run after the read puts two runs in flight again, and the next timed run waits for one
the GPU was running. Without the 101st run, the same walls' lowest window mean is 2188 and 4377.

Verified: the arithmetic above on job m3-max-45380's sequences; build, clippy and the harness's
tests in the check job named in the report.
2026-11-18 02:24:58 -08:00
Anees Iqbal d4fe90ab10 harness: each plan workload's GPU time at the 50th percentile as a harness-gpu- record
The matrix shows a row's GPU time beside its wall time: `M2V-MATRIX time
harness-gpu-<runtime>/<row> <us>`, a run's GPU time (its first command buffer's GPUStartTime to
its last's GPUEndTime) at the 50th percentile of the timed runs, scaled to the base size for a row
the device sizes, as its matrix time is. Printed once per row and process, and not for a workload
whose runs wrote no GPU time. A time record under its own prefix, as the matrix's owner asked: a
metric must be an integer count and a rise of one fails its leg, and a key under harness-new/
would be judged against harness-old/; harness_budget, the re-time selection and its sed match
none of harness-gpu-, and the matrix parks it for the cross-GPU time rule.

Verified: the check job named in the report (build, clippy, the harness's tests, rustdoc).
2026-11-18 02:24:58 -08:00
Anees Iqbal 000dfa9a07 harness: a workload's steady time is the lowest mean of its windows of 10 runs
A workload's time was the lowest nearest-rank median of its timed runs' windows of 10. Where a
runtime reports two runs' completions together, one run's wait takes both runs' GPU time and the
next run's wait returns at once, and the nearest-rank median of 10 such alternating runs is the
5th sorted value: the short wait's. On ms01's Iris Xe the old runtime's grouped submissions did
this in whole-harness runs: zero_products recorded 174 us while every run's GPU time was 4367 us
and its 200 timed walls had p10 174, p50 4388, p90 9454 (job m3-max-45343, probe f5be885e3f);
narrow_ints, constant_private and image_filter likewise, on the old runtime only. A window's mean
is the time its 10 runs took over 10, which the pairing does not move; the lowest window still
leaves out a window a clock drop or a hiccup slowed. Fewer than 10 runs take their mean.

Every matrix time record goes through steady (matrix_time, the creation rows), and the matrix's
re-timed pairs are the same records, so one statistic serves both.

Verified: the new unit test's alternating 9454/174 runs give 4814 where a window's nearest-rank
median is 174; the existing cases keep their values. Build, clippy and the harness's tests in the
check job named in the report.
2026-11-18 02:24:57 -08:00
Anees Iqbal 0a894e85fe rt arrays tests: set 1's arrays fill past their capacity through one grant of each class
The index arrays had no fill-past-capacity test. On every device of the cfg's
kind, one grant of the sampler class's whole range takes a sampler state at
each of its 3,999 indices, and one grant of the storage-capable class's whole
range takes a 1x1 shader-write texture at each of its 4,095. Then 128 of each
are dropped one at a time and made again at the index they left, as a
consumer reuses an index: 4,127 sampler states and 4,223 storage-capable
textures in all. Every make is unwrapped, so an index refused as in use
fails the test. The descriptor-slot gauge counts the class's capacity while
the arrays are full and the reuse runs, is zero once the objects are gone,
and the grants are released; after the device, the sampler, texture and
descriptor-slot gauges are zero.

Verified: the next job runs it on lavapipe, then on um790's GPUs from the
archives.
2026-11-18 02:23:46 -08:00
Anees Iqbal 2f362d5f66 replay: a texture its descriptor marks outside takes none of the program's IDs; a gpuResourceID record of one stops the play 2026-11-18 02:22:45 -08:00
Anees Iqbal f1ae24f38d replay: the skipped objects' IDs leave the differing count, beside the compute pipeline states' gap
The new runtime's backend skips render pipeline and depth-stencil states, so nothing in its play reads their IDs; b3's play counted 8,082 of them as differing. It now counts them (skipped_resource_ids) and command-replay leaves them out of differing_ids, as it leaves the compute pipeline states' typed gap. The id lines stay.
2026-11-18 02:18:39 -08:00
Anees Iqbal 853397b72b harness: the command's selection tests build and run (the bin no longer sets test = false)
The --only/--skip selection tests in src/bin/harness.rs never compiled:
the bin target set test = false, which its manifest comment justified by
the command having no unit tests. It has them now, so the bin builds its
test harness under cargo test, nextest and clippy --all-targets.
2026-11-18 02:17:15 -08:00
Anees Iqbal f53edc0d55 harness tests: the selection test's list of workloads does not shadow the function it calls
The test named its list of workloads after workloads(), which its last loop calls: the test
target did not compile (clippy, m3-max-45303). Verified by the check that follows.
2026-11-18 02:17:14 -08:00
Anees Iqbal de2ce035e9 matrix: creation rows timed alone in five processes, per-row floors, an A B B A re-time
The planner's timing rule for the matrix's harness legs:

- The harness takes `--skip NAME,...`, and a name ending in `*` in `--only` or `--skip` names
  every workload it starts. A name that names no workload is an error.
- Each runtime's harness run skips the creation rows (`--skip 'create_*'`); they then run alone
  (`--only 'create_*'`) in five processes per runtime, each with a fresh driver cache and store,
  so no row before them moves their times. The first process's records are kept whole, its
  device's gauges at drop renamed to harness-<runtime>/creates/device/... so every key is
  recorded once; the later processes keep only the creation rows' first samples, as
  harness-first/<row>/<n>/<runtime> (parked records).
- A creation row's first sample (/first, /first_take, /next_take, /first_allocation_total) is
  judged by the ratio of the medians of its five processes; a single first sample is never red.
- A row's limit is 1.03 times the greater of its ceiling and its floor: the widest ratio between
  two of the old runtime's own runs of the row on that GPU (scripts/matrix/floors.tsv, seeded
  from store2's noise table's "widest" column; 1002:1900 has no column there, so its floors are
  1). Ceilings are unchanged.
- A row past its limit is re-timed once, A B B A (two pairs), and fails only if the median of
  the pairs' ratios is past the limit too.

Deterministic counts are untouched. docs/VALIDATION.md describes the new runs and rule.

Verified: scripts/matrix/test_results.py, 33 tests OK locally (new: a row within its floor
passes, past it but back within on its re-time passes, past both fails; first samples by the
median of five, never one alone; the creation processes' sed programs record each key once; the
floors table reads). The generated harness_runs shell passes bash -n for a Linux and the Windows
leg. The harness's selection tests and lint run in the check job.
2026-11-18 02:17:14 -08:00
Anees Iqbal ad1683bb5d rt tests: the staging gauge test grants its textures' indices
new_texture refused both textures the test made without a granted index (legs m3-max-45324,
45325, 45326 failed at the first one). The test now grants eight texture indices first, as the
upload bound test does. Verified by the legs that follow.
2026-11-18 02:16:14 -08:00
Anees Iqbal 1e44e0993f rt: Gauges::staging_bytes counts texture copies' staging region and their own staging buffers
capture_bytes counts the Managed capture ring and its overflow staging; the staging of copies
between textures and the CPU (replace_region, get_bytes) had no bytes gauge, only its
allocations in `blocks`. staging_bytes now counts the 16 MiB staging region once a copy made it
(Work::stage installs it; the device's teardown frees it), and each staging buffer of its own a
copy larger than the region takes, from its making until it drops with the upload that copies
through it. The replay's new-runtime report lists it, and the API signature table has the field.

Test: upload.rs's every_device_counts_its_staging_bytes reads 0 before any copy, the region after
a 256 KiB copy, the region plus 21,233,664 bytes after a copy of 2304 texels square, the region
again once that upload is gone, and zero after teardown.
2026-11-18 02:16:14 -08:00
Anees Iqbal ad35582f61 matrix: the RX 550's constant_managed row takes constant_private's 1.20 ceiling
The planner ruled that the RX 550's (1002:699f) constant_managed row shares constant_private's
ceiling of 1.20: the two rows run the same constant-table kernel, the table Managed in one and
Private in the other, and the cost is the same GPU cause, tiles over a grid one high and one deep
and the RX 550's 64-bit address per read. Matrix cbd4644463 timed constant_managed at 1.180 (the
median of three re-timed pairs) next to constant_private at 1.193. The rt README's known gap now
names both storage modes.

Verified: scripts/matrix/test_results.py, 29 tests OK; HARNESS_CEILINGS reads both rows for
1002:699f.
2026-11-18 02:04:02 -08:00
Anees Iqbal 9ce8924728 rt capture: commits time their host copies and their waits
What: Metrics gain capture_copy_nanos (host time a capture spends copying Managed bytes into
the ring and into staging blocks of its own) and capture_wait_nanos (host time it waits: for a
submission's completion for room in the ring, for its own ring-full from its flush to its
completion, and for command buffers committed before to be submitted). The replay's per-frame
counters carry both, the API signature table is blessed, and the runtime's README names them.
The streaming test runs its three-ring commit twice (the first touching the ring and the device
copy first) and prints each commit's time split into host copies, waits (and a stream's mean)
and the rest, then times a ring-full's copy from a Shared buffer into the device copy alone on
the GPU, twice: the link a stream's copy crosses.

Why: the planner asked for the 44-92 ms 192 MiB streamed commits split into host copy, submit
and wait for the GPU copy, by timers and counters: whether the wait is the link's transfer rate
or a round trip of ours.

Tests: device legs to follow.
2026-11-18 02:00:50 -08:00
Anees Iqbal a565039349 rt README: a take larger than what the pool has kept allocates on the calling thread
The allocator's contract now says where a large take's allocation is made: the pool keeps
8 MiB ahead per class, and a take larger than what it has kept (the very first 64 MiB take,
or a large take on a cold device) allocates on the calling thread. The planner accepted this
cost for create_64MiB/first_take and create_private_16MiB/first_take, which get per-device
ceilings in the matrix. Docs only.
2026-11-18 01:59:47 -08:00
Anees Iqbal 65ab0fa5e4 rt: idle allocations are kept for a 3 s window, with no heap share cap
The pool kept a class's idle allocations while they and its allocations in use stayed within
the most bytes in use over the last 10 seconds, and within an eighth of the heap of the class's
memory type. The window is now 3 seconds, and the heap-share cap (IDLE_SHARE, the pool's caps,
surplus's cap argument, the heap lookup in Device::new) is deleted.

Why 3 s: in the compute harness's full run plus a 15 s idle tail, rt at 3 s made no more
allocations on the consumer's threads than at 10 s, on every GPU measured, and 1 s made more
(rt's consumer_allocations, all rows):

  GPU       w10  w3  w1   job
  RX 550     13  13  15   m3-max-45119
  Iris Xe    14  14  16   m3-max-45120
  RTX 2080   13  13  14   m3-max-45121

and on the 780M a replayed desktop session (1047 frames, rt; the player skips its render
encoders on every sha today, so this is its compute, blits and syncs) made the same number at
3 s as at 10 s, played twice alternately: w10 20 and 21, w3 20 and 21, the same frames, the
same 3 frees and the same idle bytes throughout (m3-max-45172).

Why the cap goes: no run reached it. The most idle bytes in any run were 153 MiB Shared and
176 MiB Private (167 MiB Private in the replay), against the smallest caps of the lab's GPUs
(heap / 8 from each device's vulkaninfo, jobs m3-max-44935 to 44940): 512 MiB Private on the
RX 550 and 0.73 GiB Shared on the 780M; the 2080's are 1.00 and 2.73 GiB, the Iris's 2.90 GiB
each. With no device bounded by it, it was a second rule that did nothing.

Host memory (the process's VK_EXT_memory_budget usage of the system-memory heap, MiB): the
most in the run, then each second of the idle tail after the last row:

  GPU       arm     peak   tail 0s  1s   2s   5s   10s
  RX 550    rt w10   198      160  160  160   70   70
            rt w3    182       86   86   86   86   86
            rt w1    176       86   86   86   86   86
            old      448      409  409  409  320  320
  Iris Xe   rt w10   341      267  267  267  178  114
            rt w3    341      178  178  114  114  114
            rt w1    325       98   98   98   98   98
            old      691      691  691  627  448  384
  RTX 2080  rt w10   174      101  101  101  101   37
            rt w3    174      101   37   37   37   37
            rt w1    174       37   37   37   37   37
            old      307      163  163   99   99   99

rt peaks at about half of old's and is at its floor within 2 s of going idle at 3 s; old holds
320 and 384 MiB after 10 s on the RX 550 and the Iris, 99 MiB on the 2080. Arms: rt and old
at the probe stack on 84ff56eb79 (the take fix), window only changed: w10 f3801fa006, w3
9092445857, w1 f588d03c9e; the old rows ran the w10 build with --runtime old. On the 2080 the
old arm's process segfaulted at exit after its idle tail (exit 139, a probe build, cause not
examined); its rows and tail are complete. The replay arms: w10 9970821a68, w3 83cbb9d6cf.

The window's unit test and the idle device test follow 3 s (2 s within the window, 4 s past
it, 2 s more for the peak to fall); release_block's doc, the idle gauges' doc and the README
state the window and the 20 ms quiet test, one sentence each.
2026-11-18 01:59:47 -08:00
Anees Iqbal 95137cd2f9 replay texwrites: the module doc names the wait in words, not by the selector
gpu::tests::device_waits_exist_only_in_the_bounded_wait_module reads every source of the
validation crate as text and fails on a Metal or Vulkan wait spelled outside gpu/wait.rs, comments
included. 48f7079244's module doc for the Managed-texture write count spelled the Metal wait's
selector, so the test failed on lavapipe in matrix cbd4644463 (job m3-max-45191). The doc now says
the same in words.

Verified: git grep for the five spellings over the crate's src and tests finds them only in
gpu/wait.rs and the test itself.
2026-11-18 01:58:21 -08:00
Anees Iqbal 31e639145b rt floor: the features Vulkan 1.1 to 1.3 require, enabled for the translator
The translator's shaders take a form of their own where each of these is
enabled, and the floor enabled none of them, though Vulkan requires each of
every device the floor admits (spec 55.1):

- multiview (Vulkan 1.1): the translator's multiview forms;
- shaderSubgroupExtendedTypes (Vulkan 1.2): SIMD-group operations on 8-, 16-
  and 64-bit values (lower/simd);
- shaderDemoteToHelperInvocation (Vulkan 1.3): a discarded fragment demoted
  to a helper (lower/fragment/discard), which the render census finds 102 of
  gb's 267 render pipelines and 97 of b2's 259 take where it is enabled;
- shaderTerminateInvocation and shaderZeroInitializeWorkgroupMemory
  (Vulkan 1.3).

The planner ruled that features 1.3 already requires are used. No device
drops: every device at the floor's Vulkan 1.3 reports them. The README's
floor table names them. The floor test's at-floor device reports them; the
test refuses a device that lacks any one (cases 31 -> 36) and checks that
device creation and the translator's enable set include them.

Verified: lint (floor tests, golden hashes); harness rows of this commit
against development on the 2080, XTX, Iris, RX 550 and UHD 630.
2026-11-18 01:48:18 -08:00
Anees Iqbal b6b303f8a0 matrix: the RX 550's constant_private ceiling, 1.20; the rt README gap names what was measured
The planner set the RX 550's (1002:699f) constant_private row a ceiling of 1.20 in
HARNESS_CEILINGS, based on the row's measured median. The matrix's limit is that ceiling times
HARNESS_BUDGET (1.236). The pushed-flag branch for 256x1x1 tiles was tried and dropped under the
planner's time box.
- v1 (probe a29d4d4fde): 0.884 of tiles on the RX 550, but the untaken branch cost 6.7% on the
  UHD 630's grid3l (m3-max-45077) and 1.6% on the RX 550's (m3-max-45076).
- v2 (probe 559c61a305), where the branch covers the extent test too: 0.954 of tiles on the RX
  550's constant_private (m3-max-45131), under the 5% bar.

The README bullet now says what was measured, not the earlier attribution:
- On the RX 550 the row runs at 0.90 of tiles in 256x1 workgroups, 0.89 through storage-buffer
  descriptors, and 0.89 with both (probe 4f8a9df6b5 on 80bd8ca764, m3-max-45027).
- The decode's instruction count does not explain it: the decode's masks as constants gave 1.000
  of tiles (m3-max-45076).
- The 64-bit address per read is from the ISA (m3-max-44342).
- The Iris clause is corrected. In an exclusive 7-round run (m3-max-45057) the Iris Xe took
  1.027 of the old runtime's GPU time, with 0.999 in 256x1 workgroups and 1.002 through
  descriptors. It pays neither cause, and it has no gap (under 1.03).

Verified: scripts/matrix/test_results.py, 29 tests OK, including
test_every_ceiling_is_over_the_budget. README lines are 100 columns or fewer.
2026-11-18 01:29:02 -08:00
Anees Iqbal af2f79d33b rt README: the known gap of a buffer kernel over a grid one high and one deep
A kernel that does not observe its threadgroup partition and is not image-only takes the remap
over the pushed tile on every grid. On a grid one high and one deep, its prologue still decodes
the position in all three dimensions. The harness row constant_private runs past the old runtime
on the RX 550 because of it: 2^20 threads in a line, 64 reads of 16 bytes from a 64 KiB constant
table, and a 4-byte store per thread. The planner ruled out a 1-D fold. In the two recorded streams
such grids are 0.00% and 0.59% of non-observer threads (replay, job m3-max-44422), under the 5%
threshold. So the gap is written where a user reads it.

Evidence:
- Matrix at 61f2799088, RX 550 (1002:699f, RADV Mesa 26.2.6, homelab-gem10-1), harness job
  m3-max-44941: matrix time new 2387.1 us over old 1970.0 us (1.212). Re-timed in 3 pairs:
  2380.8/2018.3, 2360.1/1998.8, 2465.2/1994.8 (1.180, 1.181, 1.236), median 1.181.
- Same matrix, Iris Xe (8086:a7a0, Mesa 26.2.6, homelab-ms01-1), job m3-max-44934: matrix time
  new 2591.8 us over old 2410.7 us (1.075); GPU p50 2655.8 against 2495.8 us (1.064). The matrix
  re-timed other rows, not this one.
- Same matrix, RX 7900 XTX (1002:744c), job m3-max-44930: re-timed median 1.036 in host wall
  time. GPU p50 is 65.8 us new against 67.5 us old (0.975). The XTX's excess is host-side, not
  this kernel's prologue or loads, so it gets no line here.
- Decomposition: probe 4f8a9df6b5 on development 80bd8ca764 (post-pace), RX 550, job
  m3-max-44309, 2 rounds. Old 2025.3 us. The rule's tiles 2472.4 us (1.221 of old). Declared 256x1
  workgroups with no decode 2217.8 us (1.095 of old, 0.897 of the tiles).
- ISA, jobs m3-max-44342 and m3-max-44347 on 4f8a9df6b5: the tile is a push constant, so the
  prologue is the full 3-D decode, 28 instructions against 2 for a declared group. The module is
  742 instructions, against 717 declared and 603 old. Each of the 64 reads through the device
  address pays a 64-bit v_add + v_addc before its flat_load. The old runtime's buffer_load_dwordx4
  takes a 32-bit offset off its descriptor. That second share comes from the ISA, not from timing:
  the probe's descriptor arm also emitted software bounds checks and did not recover it.
- UHD 630 (jobs m3-max-44328/44329): declared 256x1 is 0.997 of the tiles for this row.

Docs only. README lines are 100 columns or fewer.
2026-11-18 01:27:52 -08:00
Anees Iqbal cbd4644463 rt tests: the hold test commits the held command buffer before the bytes are named
What: every_device_takes_staging_of_its_own_behind_a_held_command_buffer commits the command
buffer that waits on the event before it makes and names the Managed buffer.

Why: on every discrete leg of edfa66f02e (jobs 45072-45074) the held command buffer's own
commit captured the bytes named at the buffer's making, streaming them with nothing held ahead,
so the later commit named nothing and took no staging of its own (0 overflows, 1 expected); the
bytes checks passed.

Tests: legs rerun.
2026-11-18 01:23:02 -08:00
Anees Iqbal 2c524be253 rt capture: a chunk ends in place and becomes a copy-in after; the upload is made before a stream
What: Chunk::end records and ends the command buffer in place, and Chunk::ended makes the
copy-in, so a failure gives the chunk up through its one path; the capture takes or makes the
upload before WorkState::stream, which can no longer fail. ManagedOvers::into_after and
capture::into are renamed copies_in_after and copies_in.

Why: clippy's result_large_err and wrong_self_convention lints on 20073b5d43 (check 45026).

Tests: check rerun.
2026-11-18 01:23:02 -08:00
Anees Iqbal 76042ac0b8 rt capture: a commit's ring-fulls stream as copy submissions of their own; behind a host hold, staging of its own
What: the planner's ruling on a full capture ring, replacing the live read.
- A capture that finds the ring full waits for the oldest span's submission. Where the oldest
  span is of a copy not yet submitted, every queue's held group goes at once and the commit waits
  (on a new condvar the submit thread notifies after each pass) until nothing committed before
  can still go. Then, where everything committed is submitted, the capture's own ring-full is
  ended as a copy-in and goes in the upload's submission (after the upload's commands and any
  copy-ins carried from a failed commit), flushed at once; the commit waits for it to complete
  and reuses the ring. The ring is all the staging a capture holds, whatever it names.
- Where a command buffer committed before waits on the host (an unmet host event wait, or an
  enqueued, uncommitted command buffer ahead of it), nothing can go: the rest of the capture is
  copied into Shared staging blocks of its own from the pool (at most 256 MiB each), which the
  committing command buffer holds and gives back as it retires, so the pool's idle rule governs
  their release. Every byte is still as of the commit.
- The live read and Metrics::managed_bytes_live are gone, with their README known gap. Metrics
  gain capture_streams, capture_overflows and capture_overflow_bytes; Gauges gain capture_bytes
  (the ring once made, plus live overflow blocks), also in the replay's per-frame counters.
- Copy-ins are recorded through capture::Chunk: one vkCmdCopyBuffer per run of copies from one
  source into one device copy. Copies back owed to textures over the ranges go at the head of the
  capture's first copy-in, copies in at the tail of its last (ManagedOvers::captured is split into
  backs_before and into_after). Copies read the buffer's mapped contents, which the naming keeps.
- The API signature table is blessed for the new Metrics and Gauges fields.

Why: the planner ruled that a commit's own captures stream and that only a host hold, where
waiting could deadlock, takes one-off staging; no byte may be read after its commit.

Tests: managed.rs's past-the-ring test now names three rings' worth with nothing held and checks
that it streams (two or more streams, no overflow, capture_bytes equal to the ring after the
commit) and that the bytes arrive; the hold test commits behind an unsignalled event with a ring
and a half named and checks one overflow of half a ring, the commit's bytes (a write and a
didModifyRange after the commit are not seen), and the staging given back after retirement.
2026-11-18 01:23:02 -08:00
Anees Iqbal 8780c1da83 rt managed tests: the image peek commits first; the past-the-ring buffer holds both parts
Texture::image_bytes (test-only) read a texture's image once the upload had run, which carried a
Managed buffer's changed ranges before; the ranges now wait for a commit, so the peek commits a
command buffer first. The over test's image over a Managed buffer failed on the XTX and the 2080
without it (job m3-max-44933, archive of 6a8b901008). The past-the-ring test's buffer was shorter
than its two three-quarter parts (a slice past its end on the same legs); it is a ring and a half.

Verified: the next check and legs.
2026-11-18 01:23:02 -08:00
Anees Iqbal 0d22e7958e rt managed tests: the past-the-ring test's Shared buffer asks no zeroing in new_buffer's new form
Development's new_buffer takes the offset to zero from (None for none); the rebase over it left
one call in the old form, which failed to compile (job m3-max-44925).

Verified: the next check job compiles it.
2026-11-18 01:23:01 -08:00
Anees Iqbal 246df18113 rt capture: copy-ins live in the command buffer's first segment; carried ones are taken last
The Gpu field pushed the completion item's command variant past clippy's large-variant bound,
so the copy-ins move to the first segment, ahead of whose commands they go. A capture that
fails before its end leaves the carried copy-ins carried. Retire reads every copy-in field it
gives up (the images were never read, a dead-code error), and the drains are mem::take, as
clippy asks (job m3-max-44896).

Verified: the next check job compiles it.
2026-11-18 01:23:01 -08:00
Anees Iqbal 1389f31a19 rt capture: the ranges a capture takes are named apart from each buffer's
The loop variable shadowed the list the unwind calls give back, so the build failed (job
m3-max-44888). The past-the-ring test also prints each three-quarter-ring commit's time and the
rate of its copy into the ring.

Verified: the next check job compiles it.
2026-11-18 01:23:01 -08:00
Anees Iqbal d330e61475 harness: a Managed buffer on the new runtime is the runtime's Managed buffer
What: the rt backend places a Managed buffer in a Shared block and makes it with
Device::new_managed_buffer (bytes zeroed through a zeroed Shared buffer over the range, nothing
copied), and forwards did_modify_range. constant_managed, refused on rt so far (no CPU copy),
now runs there, through the capture at the commit on a two-copy device.

Why: the planner sizes the Managed capture ring on the harness's own workloads; the harness
compares rt's commit time with the old runtime's on them.

Verified: the check job that compiles it (clippy, harness tests).
2026-11-18 01:23:01 -08:00
Anees Iqbal 692606f978 rt capture: the capture's unwind helper is named apart from the queue's abandon
The two methods of Work shared a name, so the build failed (job m3-max-44878).

Verified: the next check job compiles it.
2026-11-18 01:23:01 -08:00
Anees Iqbal 92adb7ffac rt: a Managed buffer's named ranges are taken at the commit, through a capture ring
What: didModifyRange (and a new Managed buffer's first bytes) only names a range, merged per
buffer; it submits nothing. The next commit of a command buffer with commands copies every range
named since, once, into a 64 MiB host-visible capture ring on the committing thread, and records
the ring-to-device-copy copies into a command buffer of its own (a copy-in) that goes ahead of the
committing command buffer's first segment, after its waits, between barriers. Textures over the
ranges in images of their own take their owed copies back before the copies and their copies in
after them, in the same copy-in. Commits take turns (a turn mutex taken before the work lock) so
command buffers keep the order of their captures while a capture copies without the work lock.
A full ring waits for its oldest span's submission; where the oldest span is of a command buffer
not yet submitted (held, possibly on a host event, or the capture's own), the held groups go and
the rest is copied from the consumer's bytes when the copy runs, counted in
Metrics::managed_bytes_live (a README known gap). Metrics gain managed_bytes_captured,
managed_bytes_live and capture_waits. Managed is one copy when Vulkan's device type is integrated
or CPU (Core::unified_memory, the answer Device::has_unified_memory gives), two otherwise, in
place of the Shared type's DEVICE_LOCAL flag.

Why: the planner's ruling. The old live read at submission let a write made after a commit reach
a command buffer committed before it (gb's Managed traffic); Metal takes the bytes shortly after
the commit, before scheduling, and a write while the command buffer runs does not reach it. The
deviceType rule makes the 780M (whose Shared type is not DEVICE_LOCAL) one copy, as reims reports
hasUnifiedMemory from it.

Also: queue abandonment and commit-time errors give the ring spans of copy-ins never staged back
and name their ranges again; the submit thread's end forgets named ranges and carried copy-ins
(they hold device copies, which hold the core); a texture over a Managed buffer joins its buffer's
entries only after its move home is recorded.

Tests: managed.rs gains the at-commit test (written, named, committed behind an event wait,
written and named again before the event: the kernel reads the commit's bytes on a two-copy
device; a write after naming and before the commit is read on both forms) and the past-the-ring
test (a range 16 MiB past the ring arrives whole, part live; two commits of three quarters of the
ring arrive whole); the changed-ranges test checks that changes submit nothing.
2026-11-18 01:23:01 -08:00
Anees Iqbal af28fabe97 rt floor: independentBlend and fragmentStoresAndAtomics required and enabled
In Metal, each of a render pipeline's color attachments blends by its own
state, and a fragment function may write and atomically update device memory.
The translator asks Feature(IndependentBlend) for the first (it refuses with
Unsupported(IndependentBlending) without it) and Feature(FragmentStoresAndAtomics)
for the second. The floor enabled neither, so the translator, which sees only
what device creation enables, refused them. Vulkan 1.4 requires both of every
graphics device (55.1), Roadmap 2022 lists both, and every lab profile
reports both (RADV, ANV, NVIDIA, lavapipe). The planner ruled them required
floor features.

The README's floor table names them. The floor test's at-floor device reports
them; the test refuses a device that lacks either one, and checks that device
creation and the translator's enable set include both.

Found by the render census under the floor's real enable set (job 45000, on
the draws branch with robustBufferAccess): gb translated 144 of 274 render
pipelines, with 123 refused as IndependentBlending and 1 needing
FragmentStoresAndAtomics (b2: 141 of 266, 118 and 1). With both enabled
(job 45063), gb translates 267 and b2 259, the same counts as under the
profile's whole feature set.

Verified: lint of this commit (floor tests); census 45063 for the counts.
2026-11-18 01:07:05 -08:00
Anees Iqbal c15cebf4d1 rt: a take finds a block given back before the block-maker thread has kept it
The create_64MiB regression (matrix 61f2799088: next_take 7-27x old on RADV, NVIDIA and the
Iris). Each create in the harness's loop takes a 64 MiB Shared block, which takes an
allocation of its own, and gives it back; the next create takes again straight away. A take
looked only at the kept blocks, and the block-maker thread keeps a given-back block only when it
gets to the queue. While the thread was inside a driver call (a 16 MiB vkAllocateMemory or a
vkFreeMemory, 3-70 ms on the NVIDIA cards), the take found nothing, allocated a fresh 64 MiB
on the guest thread (fresh pages, their first touch in the memset), and the block it missed
left its allocation idle and over the window's peak, to be freed: a free that kept the thread
busy for the next take. Shown by the new test at the parent of this change
(every_device_takes_a_long_block_given_back_again_at_once, draft at 30cc1a0b69): on the RTX
3090 (m3-max-45044) rounds 3-19 each allocated one and freed one; on the RX 550 (45043) round
16 did; lavapipe (45042) none.

- Pool::take, after the kept blocks, takes a block from the give-back queue that the thread
  would keep (not spilled) and of the length asked: its allocation stays in use throughout, so
  no bookkeeping changes but the reuse count and the window's note.
- The block-maker thread holds the lock from popping a kept block off the queue to pushing it
  on the kept blocks (it dropped it in between, with nothing to do for a kept block), so a take
  finds the block in one or the other.
- The test: 20 takes of a 64 MiB Shared block, each given a zeroed buffer and given back, each
  take straight after the give-back before: only the first allocates, 19 reuse, none is freed.
2026-11-18 01:04:47 -08:00
Anees Iqbal 4d803e2a33 rt tests: a long block given back is taken again at once (diagnostic draft) 2026-11-18 01:04:47 -08:00
Anees Iqbal 871c54fc5f rt tests: the pending-upload test counts the allocations in use in the pool, not from the gauges
every_device_bounds_the_pending_upload failed now and then on the Iris (ms01 jobs 44922 and
44970; passed in 44962): "copy 0: 4 allocations live, at most 3 expected". Its count of the
allocations in use was the Blocks gauge less the idle gauges' allocations. The Blocks gauge
rises in allocate() before vkAllocateMemory, and the allocation joins the pool (and the idle
gauge) only once make_allocation returns; and it falls in free_allocation after vkFreeMemory,
where the idle rule took the allocation out of the pool (and the idle gauge) before. So while
the block-maker thread makes or frees an idle allocation, that count is one more than the
allocations with a block in use.

The test now counts the allocations with a block in use where the pool keeps them
(Pool::in_use, test-only), which neither window touches. The bound itself is unchanged.
2026-11-18 01:04:47 -08:00
Anees Iqbal 366ff410a3 replay: the old runtime's backend tells a texture's storage mode too, for the texture_writes line 2026-11-18 00:55:17 -08:00
Anees Iqbal 48f7079244 replay: the report counts CPU writes into Managed textures a committed user may still be using
Whether rt must capture a Managed texture's bytes at replaceRegion (rather than when the GPU copy
is next used) turns on how often a program writes one while a command buffer that used it may
still be running. The report now says.

- The player keeps, from the stream alone (replay/texwrites.rs): the textures and each view's
  texture; each encoder's command buffer; the textures each command buffer used (an encoder call
  naming the texture or a view of it, or an encoder made with an MTL...Descriptor object, or one
  made on such an object, that names one); each texture's latest committed user per queue; and the
  completions the stream records, which are only the program's CPU waits (waitUntilCompleted of a
  command buffer or a later one of its queue, waitUntilSignaledValue:timeoutMS: reaching a value
  one of its queue's command buffers signals). The play itself waits at each commit, so this is the
  recording's order, not the play's.
- At each call on a texture that carries bytes (replaceRegion:...), blobs resolved, it asks the
  backend whether the texture is Managed (Backend::managed_texture, default None; the rt backend
  answers from the texture's descriptor) and counts the write, and where a committed user has no
  recorded completion, counts it by the presents since that user's commit (0, 1, 2, 3+) and names
  the first eight.
- Report::texture_writes (TextureWrites) carries the counts and the report's texture_writes line
  says them, with the writes into textures whose storage the backend does not tell.

REPLAY-STREAM.md section 10 documents the line.
Verified: a replay test (Kept backend) writes a Managed texture used through a view by a committed
command buffer, before and after a present, writes a texture that is not Managed, and writes again
after the CPU waited: 3 writes, 2 with the user not seen complete (one per present bucket), the
first two named; clippy and the plays in the check job.
2026-11-18 00:55:16 -08:00
Anees Iqbal 4814a3356c rt README: a Managed texture's replace after a commit is seen until the GPU reaches the upload
A replace_region on a Managed texture lands in its named bytes at the call, and the upload
that copies them into the image reads them when the GPU reaches it. On a discrete Mac (Radeon
Pro 5300M, macOS 26.7.1, API validation off) a replace made after the commit is seen by that
command buffer only until it is scheduled; one made after the GPU started it is not (the
consumer's oracle runs 45008/45010; the UHD 630 control saw the replace in every step). So rt
can show a replace that Metal would not, in the window between Metal's scheduling and rt's
upload. The replay streams make no such write: every Managed texture replace in gb (301) and
b2 (111) precedes the texture's first use (replay census 44999/45028). Recorded as a known
gap; nothing built.
2026-11-18 00:50:12 -08:00
Anees Iqbal 714e21400a harness: texture_read, a texel read out to a buffer over 2048x2048 in 16x16 threadgroups
Each thread of a 2048x2048 grid, in threadgroups of 16x16, reads its texel of an RGBA16Float
texture and stores it as a float4 at y * 2048 + x: the harness's own texels_out kernel as a timed
workload, 64 MiB stored, the reference the texels themselves (sixteenths, exact in half).

Why: on Intel's Windows driver (101.2145) for the UHD 630 this shape took 2.05 times the old
runtime's time when rt ran it in 16x16 workgroups through its device address (7614 against
3711 us), and 0.98 in the tiles the landed rule gives a kernel that does not observe its
partition and is not image-only. No harness row held it, so nothing in the matrix would catch a
change that put such kernels back in a declared 16x16 workgroup. The kernel reads its grid
position alone, so it takes the tiles; the matrix's 1.03 budget now guards it on every leg.

Verified: see the jobs named in the landing message (clippy and the harness suite, and the row
under both runtimes on the UHD 630 and the RX 550 at this commit).
2026-11-18 00:44:57 -08:00
Anees Iqbal 77b4f7b91a rt store: a 128 MiB default cap, its measured costs in the README, and a test of a process exiting in a removal
The default cap where the consumer names none was 512 MiB. Half the cap is what the store is
sure to keep, and the larger of the two recorded sessions filled 15.4 MB (379 pipeline files,
6.25 MB; 282 lowerings, 9.16 MB), so 128 MiB keeps about four times that.

The README quotes the store's measured costs, which do not grow with the number of files: the
scale probe (4229ae3525, whose cache.rs is this one's but for the default cap) at 100,000 and
1,000,000 files of 100 bytes, release build, on btrfs (msi, m3-max-44602) and NTFS (the Windows
host, m3-max-44612 and m3-max-44627).

A new test runs a child process that makes generation 3 young with its last write and exits at
once, while its removal thread has generation 1 to remove; the parent finds generation 1 still
there, and the next open removes it with the state whole and no listing.
2026-11-18 00:39:31 -08:00
Anees Iqbal 2b034aa3b0 rt tests: the render device test finds the pipeline's file under its generation
Its cache directory helper read pipelines/ at the directory's root, where the generation store
no longer keeps it, so it found no file (lavapipe, job m3-max-44584). It now reads each
generation's pipelines/ directory.
2026-11-18 00:39:31 -08:00
Anees Iqbal ca46749b95 rt: the cache directory's docs and device tests follow its generations; the stress test proves each child ran
The rt README's cache directory section, its teardown paragraph and the pipeline_cache_dir and
pipeline_cache_cap docs say what the generations keep: half the cap is what the store is sure
to keep (a set used over and over that is larger thrashes), at most the cap on disk plus what
is left of a generation a removal is taking, a file larger than half the cap is not kept,
devices on one directory share one count and should pass one cap. The device tests that read
the directory's files skip the state file and find pipeline files under their generation. The
multi-process stress reads each child's output and requires its one test to have passed, so a
child that matched no test cannot pass silently.
2026-11-18 00:39:31 -08:00
Anees Iqbal dd26d127bd rt: the pipeline store keeps two generations, counted in a shared state file, with no scan, no per-file memory and no search to evict
The landed store scanned the whole directory at open and kept every file in a map, so at
100,000 / 1,000,000 entries an open took 128 ms / 1.07 s and 18 / 164 MiB, a write at the
cap 424 us / 16.2 ms (a linear search for the oldest), and an open that evicted 1,000 files
0.49 s / 30.6 s (probe c09cae29ce on 8cfda4b5e1, job m3-max-44067). The consumer passes a
25 GiB cap, one store per host user, several processes at once.

The files now live in two generation directories, g<N> (young) and g<N-1> (old). A lookup
tries young, then old; a hit in old is renamed into young (its mark of use, with no bytes
rewritten and no file time read). A write goes into young. The bytes young holds are counted
in `state` (young's number, its bytes, a checksum), read and written under the file's lock
(flock / LockFileEx through std's File::lock), which each store holds open for its life,
beside an in-process mutex, since threads sharing one open file share its lock. The write
that takes young past half the cap makes the next generation young, in the same locked
state write; a thread of the store's own (at most one, not joined) makes the state durable
and removes every generation below old, so no thread that submits, waits for or completes
work removes files. Bytes are counted before they are written and given back when the write
fails, the write goes into the generation read under the lock, and the generation's own
directory is made only at the move under the lock, so a write into a removed generation is a
miss. Every file is checked before use (the translator's encoding, the pipeline data's
checksum); one that does not check is a miss and is removed. A state file that is missing or
does not check is rebuilt from the generations' names with young counted full; an open looks
for the generation below old (one stat) and finishes a removal a process left.

Gone: the map of every file, the scan and the eviction at open, the hourly time touch and its
stat on every hit, the stale temporary file sweep (a temporary file leaves with its
generation), and the pipelines directory made at device creation.
2026-11-18 00:39:31 -08:00
Anees Iqbal 1d9ceb87c8 rt: the compute encoder's use_heap keeps the heap's block for its command buffer, and the new-runtime player plays useHeap
Metal's useHeap: names a heap the encoder's work may reach. rt had no such call, so the player
skipped and counted each one. ComputeCommandEncoder::use_heap takes the heap's block number (a
HeapRange's block, or the block a placement heap's buffers sit in) and keeps that block in the
command buffer until it retires, exactly as use_resource keeps a buffer's block (keep and the new
keep_block share one list). Metal states no retention for useHeap:, so keeping is the safe
reading. The call declares no access: a kernel that reaches a heap's resources through addresses
outside its slots already orders against every write since the last barrier. A number no handle
names answers Error::NoSuchBlock, as new_buffer's does.

The player's compute encoders now call use_heap with the heap's block, and still skip and count
a useHeap: of a skipped object. REPLAY-STREAM.md's skip list and the rt README say so.

Test: heap::every_device_holds_a_used_heap_until_its_command_buffer_retires takes a Private
block, uses it twice in one encoder (the command buffer holds it once), releases it while the
encoder is open (the command buffer still holds it, and a new use of its number answers
NoSuchBlock), commits, and waits for the block's last holder to go once the command buffer
retires. api_signatures.tsv regenerated (one new method); REFUSALS.md unchanged.
2026-11-18 00:37:03 -08:00
Anees Iqbal c3e10e5ba9 runtime_lane replay_streams: two plays compare the counts the stream fixes, not the executed ones
The matrix's lavapipe leg at aaf4d16993 (job m3-max-44768) failed
a_pointer_written_at_a_recorded_address_is_relocated: the test played one stream twice on the old
runtime and asserted the two whole reports equal. Since 2ac0ea6799 the old backend's executed
counters carry its vkCreate*Pipelines and shader-cache nanoseconds
(compute_pipeline_create_nanos 9055654 against 5423492, shader_cache_read_nanos 24416 against
27420 in that run), so two plays never report equal executed counts. REPLAY-STREAM.md section 10
already says executed counts differ between plays and only the stream's counts compare.

The test now compares each report with its executed counts (groups, frames, total, the split's)
and frame ends left out: the stream's counts, checks, IDs, private bytes and the rest still have to
match.

Verified: the test on lavapipe (--cfg m2v_cpu_icd, LP_NUM_THREADS=1) in the job named in the
hand-over.
2026-11-18 00:35:00 -08:00
Anees Iqbal 0280c19285 rt: the block-maker thread frees idle allocations one at a time, only in quiet gaps
The planner's ruling (free when quiet), replacing "free whenever the window lets go": a driver may
hold every submission of the process for the whole of a vkFreeMemory, and on the NVIDIA cards we
measured in Thunderbolt enclosures freeing host-visible memory takes about 1.1 ms per MiB (15-17 ms
for one 16 MiB allocation), where an internal NVIDIA card frees 16 MiB in about 0.5 ms (store lane
and planner rows). Under the 10 s window a give-back freed every surplus allocation at once, back
to back, beside the guest's submissions.

What changed:
- The idle rule (which allocations are surplus: the window's peak, the cap, the reserve) is as it
  was. It now answers one allocation at a time (Rule::Free), and the block-maker thread frees it
  only once no commit or submission has come on any of the device's queues for 20 ms
  (QUIET_NANOS), then looks again. CommandBuffer::commit and the submit thread's vkQueueSubmit2
  stamp the pool (one atomic fetch_max of host_time, nothing else on those paths).
- The rule runs on the block-maker thread's own time too: it sleeps until the next change, the
  end of the quiet time where it has an allocation to free, or the second the window's peak can
  fall where it keeps idle allocations. So a program that goes quiet gives its idle allocations
  back without a call of its own (before, the rule ran only on a take or give-back).
- A spilled allocation that empties retires: no take lands in it, its bytes are not free bytes,
  and it is the rule's next to free, through the same quiet path (it was freed at once).
- Metrics::allocations_freed counts the frees; Metrics::submissions_during_frees counts the
  submissions made while the thread was inside a free's vkFreeMemory. The replay's per-frame
  counters carry both.
- README: the idle paragraph, and a known gap of memory blocks in the planner's wording.
  release_block's doc. api_signatures gains the two fields.

Tests:
- every_device_frees_idle_allocations_as_the_window_s_peak_falls: the three oldest freed one at
  a time when the clock passes the window, and the fourth freed five seconds later with no take
  or give-back (the timer path); four frees counted.
- every_device_frees_idle_allocations_in_quiet_gaps: command buffers committed every 2 ms while
  four idle allocations are surplus; every free begins at least 20 ms after the last commit before
  it (checked against the test thread's own commit times, whatever its gaps); the four are freed
  once the commits stop. Then a free held open: a submission during it is counted, one after it
  is not.
- The spill test exercises the retiring path (it failed while a newly made spilled allocation was
  taken for an emptied one: 3090, 2080, RX 550 in m3-max-44872/44873/44874; fixed).

Verified at d7918e27fa (this commit's code on a6520161e8; the tree here is the same diff applied on
development 61f2799088): check m3-max-44879 (clippy all-features, --cfg m2v_gpu, rt under
--cfg m2v_cpu_icd, translator no-feature; rt and harness suites); legs 3090 m3-max-44882,
2080 44883, RX 550 44884, lavapipe 44885: 174/174 each. The old runtime and the translator are
untouched.
2026-11-18 00:20:41 -08:00
Anees Iqbal 61f2799088 replay: --until-frame, frame lines as each frame ends, and the rt backend's unwritten line
A play that hangs (gb's fault at frame 1095, b2's at 312) wrote no report: report.txt got its frame
and end lines only at the play's end, so every hung play left 0 frames in its timing table, and the
cold and warm plays of the frames before each fault could not be read.

- Player::until_frame(F) stops after frame F's present (frames counted from 0 as Report::frames
  counts them), completes the work committed so far and reports as at the stream's end;
  command-replay's --until-frame F sets it and says `until-frame F`.
- Player::with_frame_lines(out) writes each frame's lines (Report::frame_lines: its frame and end
  lines) to out as the frame ends, flushed; command-replay passes its open report.txt and writes
  the rest at the end (Report::lines_but_frames). Report::lines keeps every line, the completed
  groups' first.
- The rt backend's report gets an `unwritten N` line: the Shared buffers made without bytes that a
  compute encoder bound or used and whose command buffer committed before any recorded write,
  upload or GPU pass reached their bytes since their making, with the first few named and the
  command buffer that read each. It is where a recording that missed the program's writes shows
  (b2's uniform ring #58725 had no recorded byte in its life). What reaches a buffer: an m2v.write
  into it, into its block over it or into another buffer of the block over it; a blit or render
  encoder call naming it or such a buffer (skipped encoders included); the commit of a dispatch
  binding it. It counts and stops nothing (new_runtime/unwritten.rs, hooks in the make paths,
  write, release, the encoder calls and the commit).

REPLAY-STREAM.md section 10 documents --until-frame, the per-frame lines and the unwritten line.
Verified: replay tests for the frame stop and the per-frame lines (Kept backend) and for the
unwritten count (the tracker alone: block writes, a blit naming, a write before the commit, a
release, a later commit, an alias made later); clippy and the device plays in the check job.
2026-11-18 00:16:31 -08:00