Commit Graph
5103 Commits
Author SHA1 Message Date
Anees Iqbal f489825ff1 Test that a recycled memoryless texture's resolve reads zero, never old samples
What: tests::memoryless_fresh (a device test). A memoryless 4x BGRA8Unorm
color and a 4x Depth32Float depth are each cleared by a pass of no draw call
and resolved, then released. A memoryless texture of the same descriptor
takes the parked image (images_recycled). A pass of no draw call that loads
it DontCare and resolves it must write zero into its resolve texture, never
the earlier clear. It prints MEMORYLESS-FRESH with what it read.
memoryless_dont_care_pass_costs (ignored) prints MEMORYLESS-COST: commit to
completion of one such pass over a 1920x1080 4x attachment, made once,
after warm-up passes.

Why: a new memoryless texture held what its image's memory held, and a
DontCare load left it there. Its resolve, or a draw's depth and stencil
tests, read it. That memory may hold a released texture's samples, of
another process where a consumer's processes share the device.

Verified: the neg ran as 1e042c1a00 (an earlier form expecting the clear
depth): lavapipe job 24146 and Iris job 24160 ("MEMORYLESS-FRESH
BGRA8Unorm on Intel(R) Iris(R) Xe Graphics (RPL-P): other bytes").
2026-11-12 21:16:23 -08:00
Anees Iqbal e9e48221d8 Hand glibc's free heap back after a large pipeline making
A driver's compiler frees what it took when the making returns, and glibc's malloc keeps
what a thread frees in that thread's arena, so a process whose threads each made a large
pipeline holds each one's compile peak as free heap until it ends. On an RX 7900 XTX (RADV,
Mesa 26.2.6) a kernel of 200,000 fused multiply-adds with 600 values live, made as 9
VkPipelines, took the process's resident set from 105 MiB to 7.3 GiB; malloc_trim handed
back all but 327 MiB, and the VkPipelines and live VkPipelineCaches held about 170 MiB of
that (a probe, m3-max-24140). A guest's Blender run on the XTX grew about 0.5 GiB per large
compute variant until its VkDevice went, and died at its cgroup's cap.

Now a large making (65,536 SPIR-V words or more, the makings pipeline/compile_memory.rs
already holds words for) whose return leaves glibc more than 256 MiB free (mallinfo2's
fordblks, every arena's) calls malloc_trim(0) on its thread before it gives its words back,
counted in the new WorkCounts::heap_trims. It trims glibc's arenas process-wide; on any
other allocator nothing is called. The trade, in compile_memory.rs's docs: the next large
making faults its working set in again (about 1 s per 3.5 GiB).

For a consumer: WorkCounts gains a field (api_signatures.tsv blessed).

Test: tests/heap_trimmed.rs (m2v_gpu, Linux GNU): three large makings of one kernel keep
the resident set within 1 GiB of where it began, and count a trim.
2026-11-12 21:16:23 -08:00
Anees Iqbal 3d95d813bb Re-bless the authored compile census at d35800a4a2
The census at the pin-64 tip (m3-max-24201): 2351 cases, 21 profiles, 48292 compiled, 1079
refused, 0 failed, 0 differences, 0 regressions. Only the product fingerprint moved. The golden
tables at the same tip (m3-max-24200) needed no change.
2026-11-12 21:16:03 -08:00
Anees Iqbal d35800a4a2 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-12 21:11:25 -08:00
Anees Iqbal 09ec2e00d4 RUNTIME_VERSION 2187: the shader cache keeps large driver records as shared chunks
Driver records of 256 KiB or more are stored as manifests over content-defined chunks, each
shared run kept once (driver::VERSION 4). The sweep removes the version 3 records. That changes
the cache's on-disk form, so recorded runtime results from before it are stale.

Verified by the change's own runs: on um790's NVIDIA records the measure gives 8,061 MB -> 180 MB
(24117). Load times in release on um790 (24178): worst case +0.55 ms cold, +0.32 ms warm. clippy,
rustdoc, 44 shader_cache tests and the runtime suite (1512) pass (24179).
2026-11-12 21:10:46 -08:00
Anees Iqbal 8bc2e7e1ac Keep the content directory's large records as content-defined chunks, each shared run once
NVIDIA's pipeline cache data (620.70.06, an RTX 3090) held one 1,851,552-byte section, the same
bytes, in 3,565 of um790's records: its 11,853 NVIDIA records were 8,061 MB. A read-only measure
of that node's 42,860 records (cut as below, averages of 16, 32 and 64 KiB) stores them in 296 MB
at 32 KiB (NVIDIA's in 180 MB, 2.2%); 64 KiB keeps each shared run's end chunks apart (634 MB),
16 KiB doubles the files a read opens for 1.3x the bytes.

shader_cache/chunks.rs (new), store.rs, driver.rs:
- A content record of 256 KiB or more is cut by a gear rolling hash (FastCDC's normalized cut,
  8 KiB to 128 KiB around 32 KiB): boundaries from the bytes alone, nothing of any driver's
  format read. Each chunk is kept once at <root>/chunks/<2 hex>/<SHA-256>, outside <root>/v1, so
  a build whose scans know nothing of chunks never removes one. The record's file is a manifest
  (M2VCHNK1, length, count, each chunk's SHA-256 and length, its own SHA-256); a read joins the
  chunks and the record's decoder checks it end to end as before (a driver record's checksum, a
  library's content hash). A missing or short chunk is a miss; the next write brings it back,
  and a chunk whose bytes are not its digest's is written again. Smaller records stay whole.
- Crash-safe: every chunk (temporary + rename) before the manifest's rename. An advisory lock
  (std File::lock, <root>/chunks/lock): writers hold it shared from their first chunk look to
  their manifest's rename; the cleanup takes it exclusively with try_lock and removes only
  chunks no manifest names. Neither waits: a writer that meets a cleanup writes its record
  whole.
- Bounded cleanup, in the scans the store makes already: the sweep at device creation where no
  cleanup ran yet or the chunks grew past 110% of what the last kept, and after a cap scan that
  freed chunks. It reads each content record's first 8 bytes (a manifest whole) and lists the
  chunks once. The chunks count against the cap; a removed manifest frees the chunks only it
  named.
- Upgrade: driver::VERSION 3 -> 4, its frame's magic M2VPPLC -> M2VPPL4 (an older build names
  and frames otherwise, never misreads one). The old records are removed by
  Store::sweep -> Chunks::due (no state yet) -> Chunks::cleanup -> Chunks::manifests, which
  removes each content record whose magic is in driver::RETIRED. Each family pays one cold
  making after the upgrade. The validation lanes read the new magic.
- Linux reads: every chunk opened first and posix_fadvise(WILLNEED) on each, so cold chunks
  are read together.

Tests (tests::shader_cache_chunks, 8): round trip and the 256 KiB bound; a shared 1.5 MiB run
kept once (the second record wrote 95,310 of 1,580,864 bytes); no manifest when its chunks
cannot be written; a missing or damaged chunk; the sweep removing a synthetic v3 tree (four
M2VPPLC records, one of 2 MiB), unnamed chunks and a dead writer's temporary; a writer's
shared lock putting the cleanup off; a cleanup's lock making a writer write whole; the cap
evicting the older record with its own chunks.

Verified on msi (m3-max-24179, at this tree's code): clippy -D warnings all features, rustdoc,
shader_cache tests 44 passed, the runtime suite 1512 passed.

Load time, release mode on um790 (NVMe), a store load with a SHA-256 decode in both
(m3-max-24178; the SHA-256 of 1.85 MB alone is 0.80 ms), median of 20 cold (every file dropped
from the page cache) and 200 warm:
- 1.7 MB, 40 chunks (NVIDIA p90): cold 1.56 ms whole, 1.47 ms chunked; warm 0.77 / 0.95 ms.
- 2.5 MB, 67 chunks (worst): cold 2.07 / 2.62 ms (+0.55 ms; one of 20 at 12.1 ms); warm
  1.12 / 1.44 ms (+0.32 ms).
- 20 families sharing the section, all cold, in turn: per family median 0.86 ms whole,
  1.13 ms chunked (first 0.94 / 1.65 ms); whole's slowest 138.6 ms, chunked's 1.18 ms.
A family's later makings on the device use its live cache and read nothing.
2026-11-12 21:10:10 -08:00
Anees Iqbal 020b04a13c Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-12 21:04:59 -08:00
Anees Iqbal ae77d1b882 ICB setters: cpu_writes counted by a load and a store under the lock; write_field reads the stage-in region and lengths only for an action
reims measured a render ICB's encode at 120-130 ns a command in the runtime alone (a guest's
16384-command commit about 11 ms on the 780M against 0.06-0.1 ms natively). The release bench
(tests::icb_encode_bench, the same loop: indirect_render_command_at, a vertex buffer, a fragment
buffer, a draw) profiled on the Iris Xe of RPL-P's host (i9-13900H) put 44-48% of the self time
in IndirectCommandBuffer::edit, three quarters of it on its three locked instructions: the
pipelines lock, cpu_writes' fetch_add and the unlock, each waiting for the setter's stores.

- cpu_writes: every writer holds pipelines, so a Relaxed load and a Release store count it, with
  no locked instruction; it stays an AtomicU64 its readers (indirect_execute.rs,
  render/executions.rs) load with Acquire without the lock, as before.
- CommandRecord::write_field read the stage-in region and the first two threadgroup lengths
  (the record's tail line) for every field; only an action's checks use them, so they are read
  there alone. The refusals are unchanged: RecordView::new still validates the record first.

Measured once each (least of 20 loops of 16384 commands, ns a command): three fields 150.8 ->
117.7 (median 162.9 -> 120.7), a draw alone 61.7 -> 56.6, a 256-command buffer whose records fit
in L2 137.3 -> 113.1; the command alone 11-15 either way. No behaviour changes: what a setter
writes, refuses and counts is the same.
2026-11-12 21:03:48 -08:00
Anees Iqbal b1b935779b icb_encode_bench: a buffer whose records fit in L2 beside one whose records outgrow the LLC
The Iris's profile put three quarters of IndirectCommandBuffer::edit's self time on its three
locked instructions (the pipelines lock, cpu_writes' increment, the unlock), each waiting for the
setter's store into a 2248-byte record of 16384 (36 MiB): a cache miss. The small buffer's cost
beside the large one's parts the misses from the rest.
2026-11-12 21:03:48 -08:00
Anees Iqbal 5e9dbb10a4 icb_encode_bench: the CPU's cost a command of a render ICB's setters
A release benchmark (ignored) of indirect_render_command_at, set_vertex_buffer,
set_fragment_buffer and draw_primitives over 16384 commands, a consumer's loop, beside the
draw alone and the command alone, and the sizes of Result<(), Error> and Error: the measure
before a change to the setters' path.
2026-11-12 21:03:48 -08:00
Anees Iqbal 1cc6e8af41 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-12 21:03:32 -08:00
Anees Iqbal 30d5549ad6 SEMANTICS_VERSION 2075, RUNTIME_VERSION 2186: fan-out pipelines begun at commit, copies in a loop
A fan-out draw's copies are now emitted as a loop the driver does not unroll, which changes the
translated SPIR-V (SEMANTICS_VERSION). The fan-out's probe and draw pipelines begin at the
commit's settle rather than at the host step, which changes when the runtime makes them
(RUNTIME_VERSION). The golden tables change with the loop; they are re-blessed on development.

Verified by the change's own runs: signatures --check, clippy (m2v_gpu + hazards) and the
translator's fan_out tests 8/8 (24023). The device test and the pieces lane ran on the Iris
(24112) and the 780M (24113) at the same three diffs: FanOut warm 40.0 / 31.5 ms against Exact's
514 / 303 ms. The 3090 run (24111) is still queued.
2026-11-12 21:02:53 -08:00
Anees Iqbal 9e19371285 Pieces lane: default pipeline waits, the commit's time, the fan-out's makings taken
The lane's device ran under exact_answers(), whose PipelineWaitPolicy::Exact
made every pipeline a commit settles on the program's thread: with the
fan-out's begun at commit, the cold frame's commit took 86.9 ms on an RTX
3090 and 69.8 ms on an Iris Xe, a cost a consumer's device, under the
default Bounded waits, hands to the pool. The lane's device now makes them
under the default waits, as a consumer's does. Its line adds the program's
time in commit (the host's clock) and the fan-out's makings the commit
began that the step found made or waited for
(WorkCounts::rate_map_fan_out_pipelines_ready, _waited).

The lane's docs and the fan-out row's cost cell in docs/FAST-PATHS.md carry
the three GPUs' numbers with the fan-out's pipelines begun at commit and
the copy loop (m3-max-24007 RTX 3090, 24008 Iris Xe, 24009 Radeon 780M),
command buffer GPU time FanOut against Exact, cold then warm:
- Iris Xe: 47.3 and 40.6 ms against 514.3 and 496.8 ms; commit 2.1 ms.
- Radeon 780M: 42.3 and 29.4 ms against 299.3 and 232.6 ms; commit 1.8 ms.
- RTX 3090: 44.2 and 7.5 ms against 71.2 and 65.5 ms, the step waiting for
  the fan-out's makings in the cold frame; commit 7.4 ms.
2026-11-12 21:02:13 -08:00
Anees Iqbal 32ea055bd8 Emit a fan-out draw's copies in a loop the driver does not unroll
The fan-out draw's geometry stage unrolled its copies: 16 bodies of three
vertices each, each under its own test of the triangle's count. Creating
the probe's and the draw's pipelines took 81.3 ms on an RTX 3090 (NVIDIA
620.70.06), 66.9 ms on an Iris Xe and 44.5 ms on a Radeon 780M (Mesa
26.2.6), the pieces lane's cold frame. The copies are now one loop
(LoopControl DontUnroll) over at most the stage's copies, its index in a
Function variable; OutputVertices stays three a copy.

Measured once on each GPU, a scratch build choosing either form
(m3-max-23980, 23981, 23982): creation 45.2, 20.0 and 14.4 ms; the warm
frame's command buffer the same, 5.8 against 6.3 ms, 40.3 against 41.5 ms
and 35.1 against 35.6 ms. The runtime's fan-out device tests passed in the
loop form on all three, the pixels the encoder's region-by-region draws'.

The link test a_fan_out_variant_s_triangle_stage_emits_its_copies now
checks the draw's triangle stage holds one loop and three EmitVertex and
declares three output vertices a copy; the translator's fan-out tests and
clippy (m2v_gpu, m2v_gpu_hazards; 0 messages) passed (m3-max-23992).
2026-11-12 21:02:13 -08:00
Anees Iqbal 6a6327e772 Begin the fan-out's probe and draw pipelines at commit's settle
A host step that fanned a rate-mapped pass out made the probe's and the
fanned-out draws' geometry-stage pipelines itself on the first frame of a
state, on the step's thread, inside the command buffer's GPU window: 82.1
of an RTX 3090's 88.6 ms cold fanned-out frame in the pieces lane, while
the commit's settle had already begun the regions variants on the
device's pool.

RenderExecution::settle now also settles, where the pass's host step fans
out (DeferredPass::fans_out: the policy and features, no memoryless
attachment, no shadowed texture; an execution over a map, without
shadows), each foreseen state's draws under the probe's and the fanned-out
draw's fan-out, beginning their VkPipelines on the pool. settle_draw_of
takes the encoder's fan-out through fan_out_asked and settles nothing for
a draw the fan-out does not take. Those makings are kept apart from the
ones the host step waits for before it records the pass, each once
(Pending::same: a strip's and a list's draw settle to one key where the
topology is dynamic): fan_out_routes takes them made or waits for them
(hastened, as Pending::wait does) and counts each
(WorkCounts::rate_map_fan_out_pipelines_ready, _waited). A pass the step
does not fan out leaves them.

The device test a_host_step_fans_out_the_commands_the_probe_does_not_flag
checks that the commit began at least the probe's and the draw's pipelines
and that the FanOut step makes as many pipelines as the same frame's under
Exact (one: the regions variant, which the settle's key misses at the
step under either policy); before this change it made two more.

Verified once on each GPU under the default pipeline waits, the copy loop
of the next commit included (m3-max-24007 RTX 3090, 24008 Iris Xe, 24009
Radeon 780M; counts before each making was counted once): the device test
passed on all three, the step made no pipeline of the fan-out's. The
pieces lane's cold fanned-out frame: 3090 command buffer 44.2 ms (was
88.6), the step 37.7 ms waiting for its two makings, commit 7.4 ms; Iris
47.3 ms (was 110.4), both found made at the step, commit 2.1 ms; 780M 42.3 ms
(was 84.3), commit 1.8 ms. Warm: 7.5, 40.6 and 29.4 ms.

At the landing tip one rebase earlier (440f133b4b, on c6365b3dc7), each
making counted once (m3-max-24112 Iris Xe, 24113 Radeon 780M):
the device test passed, the commit beginning two makings the step waited
for and the step making the one pipeline Exact makes. The pieces lane's
cold fanned-out frame: Iris 49.4 ms, both makings found made at the step,
commit 2.1 ms; 780M 53.3 ms, both waited for, commit 2.6 ms. Warm: 40.0
and 31.5 ms.
2026-11-12 21:02:13 -08:00
Anees Iqbal a5a0ecbd30 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-12 20:54:04 -08:00
Anees Iqbal 9ba9cee3b7 RUNTIME_VERSION 2185: a heap texture in memory of its own reads zero
A heap's unaliased and lossless-route textures, made in memory of their own, now start zeroed,
as a new heap's bytes read, instead of with what their recycled memory held. That changes what
such a texture reads, so recorded runtime results from before it are stale.

Verified by the change's own runs on lavapipe: the test fails without the fix (24114), the full
runtime suite passes with it (2428), the heap, fresh and multisample lanes pass 175/175 (24115),
clippy and rustdoc are clean (24116).
2026-11-12 20:53:22 -08:00
Anees Iqbal 47d852a810 A heap texture in memory of its own reads zero: never the bytes its memory held
What: a heap texture on AliasRoute::Unaliased (a two-plane extended-range
texture past the device's moves, a mipmapped or 3D one-plane YCbCr one) or
AliasRoute::Lossless (a multisample texture no shadow of its samples
serves) starts at zero in every texel (Start::ZeroUnpatterned), written at
its first use, a multisampled one's by a clear, instead of holding what its
memory held. new_image_owned and new_image_as_it_lies keep their other
callers; their docs drop the heap routes, and heap.rs's module docs say the
Lossless texture reads zero.

Why: the image lies in memory of its own from the device's pool and
recycler, which may have held a released texture's texels, of another
process of a consumer whose processes share the device. Zero is what a new
heap's bytes read on Metal.

Verified: tests::heap_one_plane_rows on lavapipe, reported with this sha.
2026-11-12 20:52:29 -08:00
Anees Iqbal 13f1fd0602 Test that an unaliased heap texture reads zero, never a released one's texels
What: tests::heap_one_plane_rows gains
an_unaliased_heap_texture_reads_zero_never_a_released_one_s_texels. A
mipmapped one-plane YCbCr Private texture in a placement heap lies in
memory of its own (AliasRoute::Unaliased). One is written and released with
its heap; one made in a new heap takes its parked image (images_recycled)
and must read zero in its first level, what a new heap's bytes read. It
prints HEAP-UNALIASED-FRESH with what it read.

Why: a heap's texture in memory of its own started as that memory lay
(Private held through new_image_owned, Lossless through
new_image_as_it_lies), so it could read a released texture's texels, of
another process where a consumer's processes share the device: the same
leak the new-texture path had.

Verified: the lavapipe lane run reported with this sha (expected to fail
here; it passes with the fix after it).
2026-11-12 20:52:29 -08:00
Anees Iqbal 8da551b8a5 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-12 20:37:36 -08:00
Anees Iqbal 53fdc5b70e RUNTIME_VERSION 2184: a new Private texture reads zero
A new Private texture is zero-filled on every device, instead of starting with whatever its
recycled memory held (an image released by another program could be read through it). That
changes what a new texture reads, so recorded runtime results from before it are stale.

Verified by the change's own runs: the lavapipe test fails without the fix (24027 neg), the full
runtime suite passes with it (2423, 24027), lanes 22/22 (24071), clippy m2v_gpu (24072), clippy
and doc (24029). Iris Xe cost (24088) is below 0.6 ms per burst, largest 2x Depth32F 2048^2.
2026-11-12 20:36:56 -08:00
Anees Iqbal 7cafb7c6c8 Lanes that asked whether a new Private texture was left unfilled ask whether it is zero-filled
What: compressed_decode (a new Private BC texture reads zero blocks too, counted
as zero-filled, no BCFRESH-UNFILLED), depth_denormals, fresh_writes and
parallel_encodes now take fresh_contents::zero_filled in place of unfilled. The
texture module's and heap_tiled's docs say what a new Private texture reads now.

Why: the commit before retired private_textures_unfilled and the helpers that read
it; the validation crate did not build under --cfg m2v_gpu (job m3-max-24030).

Verified: the lint and lane runs reported with this sha.
2026-11-12 20:36:13 -08:00
Anees Iqbal 5eb107ac89 A new Private texture reads zero on every device: never the bytes its memory held
What: new_texture_image starts a Private texture zeroed (Start::Zero) on a
device that presents an Intel or AMD Mac, as it did on an Apple GPU presenting
one: its first move clears it, or copies zeros, or takes the driver's zeros
where the block is fresh. Only a Memoryless texture starts held.
private_textures_zero_filled counts each. WorkCounts::private_textures_unfilled
goes, as nothing counts it now.
- The recycled image a new texture takes (recycle.rs) and a recovery's remade
  texture (texture/carry.rs, Remake::Own through texture_as) go through the
  same making, so both read zero.
- Tests: mac_class (an Intel or AMD Mac's new texture reads zero, counted as
  zero-filled); the parent's recycle test.
- Lanes: fresh_contents and fresh_costs expect zeros there, counted.
- Docs: API.md's accepted difference, the runtime README, MacClass::IntelOrAmd,
  conformance's without_compression.
- api_signatures re-blessed (the field goes).

Why: Start::Held matched a Mac with an Intel or AMD GPU, where a new Private
texture can read a released texture's texels. On such a Mac those texels are
the same process's. A consumer that serves several processes from one device
showed one process another's pixels that way. The 780M read a released
texture's colour through a recycled image (m3-max-23995). After a forced
recovery on the RX 7900 XTX, a guest window read other windows' pixels. Zero is
what those Macs read where their memory held nothing, and Metal leaves the
contents undefined.

Verified: the lane run reported with this sha (the recycle test of the commit
before fails on lavapipe, the 780M and the XTX; this one passes).
2026-11-12 20:36:13 -08:00
Anees Iqbal 66761ac4cb Test that a recycled Private texture reads what a new one reads, zero, never the old texels
What: tests::recycle's a_recycled_texture_reads_what_a_new_one_reads and the
burst leg now ask the same of every device. The recycled texture reads what a
texture of its descriptor made while nothing was parked read, never the parked
image's colour. Where the device presents no compression, that is zero, and the
making counts as zero-filled (private_textures_zero_filled). Each prints
RECYCLE-FRESH with what it read.

Why: on a device that presents an Intel or AMD Mac, a new Private texture
started holding what its memory held (Start::Held). The 780M (job
m3-max-23995) printed "the parked image's texels": a texture released and one
made after it of its descriptor read its colour. A consumer whose processes
share one device thereby shows one process another's pixels. A recovery's
remade texture takes the same path; after a forced recovery on the RX 7900 XTX,
a black guest window's thumbnail showed other windows' pixels.

Verified: the lane run reported with this sha (expected to fail here on
lavapipe, the 780M and the XTX; it passes with the fix after it).
2026-11-12 20:36:13 -08:00
Anees Iqbal 640718ab9a Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-12 20:34:27 -08:00
Anees Iqbal b95bd50ae6 The encoder trail's API.md paragraph: the stall probe and the watchdog count as without it
Rewrapped after the rebase onto the watchdog (b6c52f1fa9); says the trail's line comes before
the stall probe and the watchdog, which count with the trail on as without.
2026-11-12 20:33:17 -08:00
Anees Iqbal efcb6851ce The encoder trail: name the encoder a stalled GPU stopped in, and the last one that completed
A GPU hang (a CTX SWITCH TIMEOUT on an RTX 3090) left the runtime with no way to say which
encoder never completed: encoders share batches and grouped submissions, and neither
METAL2VULKAN_LOG_PASSES nor METAL2VULKAN_QUEUE_TIMES logs anything at a stall.

METAL2VULKAN_ENCODER_TRAIL (env_vars.rs), or DeviceOptions::encoder_trail for one device, is a
default-off diagnostic (encoder_trail.rs):

- Each encoder, and each part of one a host step splits off, ends its batch (Batches::alone),
  and no batch waits in a group, so each goes in a vkQueueSubmit of its own that signals its
  queue's timeline. When work goes to the driver changes; what it computes does not.
- Each encoder notes what it was: its kind, its command buffer's object ID, its place, a
  render pass's area, samples, attachments' formats and sizes, instances and rate map, its
  indirect command executions, and the label hash of each state it bound (the first 8 bytes
  of a SHA-256 of the state's label and its functions' names; no name, no shader text). A host
  step adds the states its indirect commands named, as the GPU and the CPU left the records.
- Once no work of the device advanced for 2 s with some pending, completion.rs's stall path
  logs one Info line (id name metal2vulkan-encoder-trail) for each VkQueue whose oldest batch
  is pending: that batch's encoders and the last batch the queue completed, with how long
  before; once a stall.
- A submission a host step makes and waits for itself (a rasterization-rate map's fan-out
  probe, a predicated loop's check run again) signals no timeline; once it ran 2 s, one line
  names it, the encoder whose step made it and the states its commands named.

Off, a device reads the switch once and notes nothing.

Verified on msi (lavapipe, --cfg m2v_cpu_icd), at the branch tip this commit's tree equals:
- tests::stall::the_encoder_trail_names_the_stuck_encoder_and_the_last_one_completed: a cb
  stuck on an event wait before two blit fills; the line names the stuck cb's encoder 0 (not
  its encoder 1) and the earlier completed cb's encoder 0:
  "VkQueue 0's oldest pending batch: Blit encoder 0 of command buffer 3, states []; the last
  batch it completed: Blit encoder 0 of command buffer 2, states [] (2.106823047s before)".
- tests::rate_mapped_fan_out::the_encoder_trail_fans_out_the_same_pixels: with the trail on,
  probes/flagged/fanned [1, 1, 6] as without, no texel differs from the encoder's own draws.
- The host-step families (rate_mapped_fan_out, rate_mapped_pieces,
  indirect_command_buffer_device, host_step_neutrals, ycbcr_in_place_loop) with
  METAL2VULKAN_ENCODER_TRAIL=1: 11 passed.
- encoder_trail's unit test (one state's hash pinned: a reader of the pipeline creation log
  computes it again); the runtime suite 1504 passed; api_ tests 16 passed; clippy all features
  and the runtime under m2v_gpu and m2v_cpu_icd; rustdoc of the runtime and metal2vulkan.

The runtime-sources pin moves (not re-pinned here).
2026-11-12 20:33:17 -08:00
Anees Iqbal b6c52f1fa9 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-12 20:30:23 -08:00
Anees Iqbal 25173758b1 RUNTIME_VERSION 2183: Metal's command-buffer watchdog
The watchdog fails a front batch whose timeline has not moved for 20.2 s as Metal's
timeout (GpuHang). That changes what a hung submission reports, so recorded runtime
results from before it are stale.

Verified by the change's own runs: lavapipe m3-max-24017 (99/99), RTX 2080 m3-max-24039
(tests::stall 3/3), lint m3-max-24018, API tables m3-max-24076.
2026-11-12 20:29:43 -08:00
Anees Iqbal d4ab197556 Metal's command-buffer watchdog: a front batch 20.2 s without its timeline advancing fails as Metal's timeout
reims's 3090 boot after an Xid 109 (CTX SWITCH TIMEOUT) had its graphics queue's batch never
complete while the copy engine ran on: the staging probe completed 23 times in under a
millisecond, so the stall rule found the GPU running and nothing failed. The probe stays; beside
it each queue's front batch now has its own clock (stall::Clock::front_held), which runs while
its waiter's waits run out with it pending and stops whenever its queue's timeline advances,
whatever the probe answers. Past stall::WATCHDOG (20.2 s, the x86 AMD Mac's measured bound and the
largest of Metal's) the front fails as Metal's timed-out command buffer (GpuHang, code 2, named
exactly: its queue is known, no inference), the rest in flight as GpuRecoveryVictim, and the
generation is marked stopped (Stop::Watchdog), parked and recovered from as a wedge; the notice
says the watchdog stopped it. Counted: WorkCounts::watchdog_timeouts (wedges_declared keeps the
unanswered probe's stops).

Measured on the M3 Max (macOS 27.0.1, a Swift probe): a command buffer waiting for an event no one
signalled, shared or plain, failed with MTLCommandBufferErrorTimeout ('Caused GPU Timeout Error
(00000002:kIOGPUCommandBufferCallbackErrorTimeout)') 5.00 s after its commit, nothing of it run;
two such on one queue revoked it (the next fill failed AccessRevoked 0.24 ms after its commit,
a new queue ran). So the clock counts event waits, as Metal's does, and the watchdog's GpuHang
counts against its queue as any timeout (revocation.rs says so; the count is QueueCommon's and
carries over a recovery, as Metal's queue keeps it).

Tests (tests::stall): the stuck front with an answered probe fails at the hooks' 1 s bound, no
sooner, as GpuHang, parks the generation and runs the next command buffer; the answered leg
whose front advances within the hooks' 3 s fails nothing. Docs: stall.rs, revocation.rs,
docs/FAST-PATHS.md known gap, docs/API.md, the runtime README, WorkCounts, api_signatures.
2026-11-12 20:29:01 -08:00
Anees Iqbal c6365b3dc7 Re-bless the authored compile census at 32969e6cc6
2351 cases on 21 profile-legs (49,371 cells), 0 failed, 0 regressions, 64 differences, all new cases: the 64 authored
cases of tns_coop_left and tns_mm_left (SEMANTICS_VERSION 2073).

Verified: corpus-triage --audit authored-compile --bless on the M3 at 32969e6cc6 (m3-max-23999, release, 132 s wall,
slowest compile 1.2 s), the private sources read in place through the index.
2026-11-12 20:06:49 -08:00
Anees Iqbal e008a9f97a Re-bless the golden tables at 32969e6cc6
SEMANTICS_VERSION 2073 adds the owned fixtures tns_coop_left and tns_mm_left (with the tns_init_left kernel): their
golden rows, their engine inventory rows (ok on all 19 profiles) and their engine printouts, recorded under LLVM 21.
No existing row moves.

Verified: bless on the M3 at 32969e6cc6 (m3-max-23997): golden hashes blessed, engine goldens pass; merged check at the
same sha on msi (m3-max-23996): clippy every crate with --cfg m2v_gpu, api_signatures, api_surface, fast_paths, the
engine and fixture-inventory tests, the runtime's exit_guard and compile_memory tests, rustdoc -D warnings.
2026-11-12 20:06:49 -08:00
Anees Iqbal 32969e6cc6 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-12 20:01:10 -08:00
Anees Iqbal e13f827097 RUNTIME_VERSION 2182: a making's copy-in goes with the next submission again
The two commits before this one. RUNTIME_VERSION 2171 made every copy-in a reached-only upload, sent only with a batch
whose commands reach the buffer; that included the first copy-in a two-copy Managed buffer makes at its creation. On a
device without a fill queue (reims's RX 7900 XTX) that copy used to go with the device's next submission; it then
waited until some batch used the buffer, holding its host import meanwhile, so over Launchpad live dma-buf imports
grew from 185 to 629, RADV listed each in every kernel submission, the scheduler fell behind and commits left their
batches to it (batches submitted at commit 426.8 -> 14.7 a second, guest frames 1-3 refreshes late). Uploads a buffer
gets at its making (the two-copy copy-in, a recovery's remade device copy), which no command buffer can have read, now
register as plain fills that go with any batch (buffer.rs's Replaces::Unread); did_modify_range at commit, completion
undo and rebind copy-ins stay reached-only uploads with their commit stamps (Replaces::Read). Docs: managed_copy.rs.

Verified (on the branch): RX 7900 XTX RADV (m3-max-23984): managed_copy_device::makings_copies_in_go_with_the_next_
submission fails before the fix ("copies in waiting 8 at their making, 8 after another buffer's command buffer") and
passes after ("8 at their making, 0 after"); tests::managed, tests::managed_copy_device (the ranges_named_* race tests
on two queues and one included), texture::first_move and tests::commit_and_submit 52/52 on the XTX and on lavapipe
(23977, where the new test skips: unified memory makes no two-copy buffers). Clippy plain, m2v_gpu and rustdoc
(23978, 23979).
2026-11-12 20:00:27 -08:00
Anees Iqbal 70fcece3f5 A making's copy in goes as a plain fill: no command buffer can have read its bytes
What: buffer.rs's Replaces says what a copy from a buffer's host copy into its
own bytes replaces.
- Unread: the buffer's making (a two-copy no-copy buffer's first copy in,
  managed_copy.rs; Device::new_buffer_with_descriptor's upload), or its device
  copy's making on a recovery's new VkDevice. It registers as a plain fill
  (FirstMoves::register_bytes), as before 56a8aa5283.
- Read(commit): a did_modify_range's copy at a commit, a completion's undo or a
  rebind. It stays the reached-only, stamped upload (register_upload) of the
  race fixes.
Buffer::upload, copy_in_from, CallerCopy::copy_in and stage_in take it in place
of the commit stamp. Docs: managed_copy.rs's copies-in paragraph.

Why: 56a8aa5283 made every copy in reached-only. On a device without a fill
queue, where every batch took every fill before, a making's copy then waited for
a batch that reaches its buffer, holding its import. A guest's Launchpad step on
the RX 7900 XTX made about 538 two-copy buffers: 444 imports stayed resident and
dma_buf_memories_live reached 629 (185 at pin 61). RADV lists every imported
memory in each kernel submission, so submissions slowed (submit_stalls_on_work
2 -> 32/s) and the scheduler's thread was nearly always mid-pass (sleeps
773 -> 48/s). commit_and_submit then left its batches and checks to that thread
(passes at commit 1088 -> 36/s), and heads waited behind checked heads (held for
earlier commits 495 -> 2531/s).

Verified: the lane run reported with this sha (the test commit before it fails
on the XTX, this one passes; the did_modify_range race tests stay green).
2026-11-12 20:00:00 -08:00
Anees Iqbal 28372c1a5f Test that two-copy buffers' making copies in go with the next submission
What: managed_copy_device's makings_copies_in_go_with_the_next_submission. On a
two-copy device without a fill queue, it makes 8 Managed no-copy buffers over
imported pages that no command buffer uses, completes one command buffer of
another buffer, and asserts that none of their copies in still waits
(FirstMoves::fills_wait). It prints dma_buf_memories_live, host_imports_live,
host_imports_resident and host_imports_released at the making and after. Then
each buffer reads its pages' bytes. Unified-memory devices and devices with a
fill queue skip it, naming why.

Why: since 56a8aa5283 a making's copy in is a reached-only upload. On the
RX 7900 XTX it waited for a batch that reaches its buffer and held its import
meanwhile: 444 imports resident during a guest's Launchpad step, 629 dma-buf
memories live against 185 at pin 61. RADV lists every one of them in each
kernel submission.

Verified: the lane run reported with this sha (expected to fail here and pass
with the fix after it).
2026-11-12 19:59:59 -08:00
Anees Iqbal ba77737154 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-12 19:42:44 -08:00
Anees Iqbal 699486b4cb SEMANTICS_VERSION 2074, ARTIFACT_FORMAT_VERSION 513, RUNTIME_VERSION 2181: a fan-out probe spreads its copy count over 32 words a draw
The two commits before this one. A rate-mapped host step's fan-out probe had every triangle of a draw add its copy
count atomically into one word, about 4,800 adds on one word a draw: on an RTX 3090 that took 15 to 21 ms a frame
(0.5 ms without the adds), so a small rate-mapped pass fanned out (98 ms at 64 commands) was slower than region by
region (54 ms), a regression of SEMANTICS_VERSION 2072 on NVIDIA. Each draw's count is now spread over 32 words chosen
by PrimitiveId (bind::fan_out::PROBE_DRAW_WORDS, PROBE_COUNT_WORDS), which the host sums; no capability is needed. The
pieces lane runs each frame cold then warm; the lane docs and the fan-out row's FAST-PATHS cost cell carry the three
GPUs' numbers. The translator's API surface table (tests/api_surface.rs) names the two new constants.

Verified (one run each, 64 commands at the host step, cold then warm, m3-max-23899/23900/23901): RTX 3090 probe 1.45 ms
(was 15.4 cold, 20.7 warm), warm FanOut 6.0 ms against Exact 63.0 (was 26.8), cold 88.6 ms (82.1 ms creating the two
fan-out pipelines) against 61.9; Iris Xe probe 1.13 ms, warm 40.3 against 499.1, cold 110.4 against 514.6; 780M probe
0.40-0.49 ms, warm 34.7 against 231.7, cold 84.3 against 299.5; the fan-out device tests pass on all three with pixels
equal to the region-by-region draws. The link test fails against the one-word probe stage (m3-max-23925); clippy with
m2v_gpu and m2v_gpu_hazards over the three crates clean; signatures blessed, REFUSALS unchanged. The golden table's
probe cells re-bless on development.
2026-11-12 19:42:04 -08:00
Anees Iqbal 4906f145e3 Pieces lane: each frame cold, then warm; the fan-out row's cold and warm costs
The lane's one frame mixed two costs at the host step: the GPU work, and on
the first frame of a state the driver making the fan-out's probe and draw
pipelines inside the step (82.1 of the RTX 3090's 88.6 ms cold fanned-out
window). The frame now runs twice on the same device, cold, then warm,
each printed and checked, and the line adds the host step's time
(WorkCounts::host_step_nanos), the pipelines it made
(host_step_pipelines_made) and the time creating render pipelines
(render_pipeline_create_nanos).

The lane's docs and the fan-out row's cost cell in docs/FAST-PATHS.md carry
the three GPUs' cold and warm numbers after the probe spread, from one run
each (m3-max-23899 RTX 3090, 23900 Iris Xe, 23901 Radeon 780M), command
buffer GPU time FanOut against Exact:
- Iris Xe: 110.4 ms cold, 40.3 ms warm, against 514.6 and 499.1 ms.
- Radeon 780M: 84.3 and 34.7 ms against 299.5 and 231.7 ms.
- RTX 3090: 88.6 and 6.0 ms against 61.9 and 63.0 ms.
The guest-scale fanned-out figure, measured before the spread, is dropped;
its region-by-region one stands.
2026-11-12 19:41:07 -08:00
Anees Iqbal 685ff90c1c Spread a fan-out probe's copy count over 32 words a draw by PrimitiveId
The host step's probe added each triangle's copies into one word per draw,
so every triangle of a draw was an atomic add on the same address. On an
RTX 3090 (NVIDIA 620.70.06) that made the probe 15.4 ms (cold) to 20.7 ms
(warm) of GPU time for the pieces lane's 64 draws of 306,036 triangles,
20.7 of the warm frame's 26.8 ms, the fanned-out pass itself 3.0 ms. A
scratch build whose probe added nothing ran it in 0.5 ms. Iris Xe and
Radeon 780M ran the same probe in 1.1 and 0.5 ms.

Each probed draw now takes bind::fan_out::PROBE_DRAW_WORDS words: its flag,
then PROBE_COUNT_WORDS (32) counts, a triangle adding into the one its
PrimitiveId picks (PrimitiveId & 31). The probe's geometry stage reads
PrimitiveId whether or not the fragment function does. The host sums a
draw's counts as it reads the flags back, so the routes see the same flag
and copies pair as before.

Verified, the pieces lane at 64 commands, each frame cold then warm, once
per GPU (m3-max-23899, 23900, 23901):
- RTX 3090: probe 1.45 ms; warm FanOut command buffer 6.0 ms (was 26.8)
  against Exact's 63.0.
- Iris Xe (Mesa 26.2.6): probe 1.13 ms; warm FanOut 40.3 ms against 499.1.
- Radeon 780M (Mesa 26.2.6): probe 0.40 to 0.49 ms; warm 34.7 ms against
  231.7.
The runtime's fan-out device tests passed on all three: pixels equal to
the encoder's region-by-region draws, counts [1, 1, 6].

Test: link::tests::fan_out::
a_probe_adds_a_triangle_s_copies_into_the_count_its_primitive_picks checks
the probe's triangle module adds once, reads PrimitiveId (and passes it on
where the fragment function reads it) and masks it by 31. It passes, and
fails against the one-word probe stage (negative control, m3-max-23925);
clippy with m2v_gpu and m2v_gpu_hazards over the translator, the runtime
and validation, 0 messages.
2026-11-12 19:41:07 -08:00
Anees Iqbal 476fe4c0bf Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-12 19:33:30 -08:00
Anees Iqbal aea963e10f RUNTIME_VERSION 2180: a recovery's lost VkDevice goes at its rest while carried textures and pipeline states live
The five commits before this one. A carried texture or pipeline state kept its lost generation's image or program, so
the lost VkDevice stayed alive for as long as any carried object lived. One guard in device/carry.rs (PartsCalls and
CallHold, generalised from the buffer's, with a LetGo<T> cell; MadeOn is LetGo<Device>) now carries buffers, textures
and pipeline states alike: at the lost generation's rest a LostProgram drops the lost program in place (reached()
skips it; label() reads the state's own copy), and a LostTexture leaves the texture's slot on the lost generation,
hands the caller's range token to the next generation's parts and drops its parts in place (parts with a handed-out
VkImage stay until the texture goes, as buffers' do). The public state and texture methods that reach those parts, the
argument encoder's and ICB's set paths, and vk_image take the hold; command-buffer work relies on its queue slot.
ComputePipelineState::device(), RenderPipelineState::device(), FunctionHandle::device() and
VisibleFunctionTable::device() answer an owned Device (the last two borrowed the program's, which now goes at rest).
Counters WorkCounts::lost_programs_released and lost_textures_released. The no-copy heap recovery test says whether it
ran and fails where the device lists VK_EXT_external_memory_host but imports nothing.

Verified (on the branch, lavapipe): the four tests fail before the fix with 2 live VkDevices and pass after
(m3-max-23879), device_recovery 32/32 serial with lost_programs_released 1 per pipeline test and lost_textures_released
3 and 1, the no-copy heap test "ran"; recovery wall 23.4 ms with no state, 23.5 ms with 200 compute states, 78.5 ms
with 200 drawing states (debug); the lib tests the one-process run failed passed alone (23905) but
exit_guard's name scan, fixed by naming TextureParts (23910: clean build, that test and device_recovery 32/32). Clippy
plain, m2v_gpu, m2v_cpu_icd and rustdoc (23896..23898). api_signatures blessed. A 780M run is queued (23883).
2026-11-12 19:32:40 -08:00
Anees Iqbal 23312709ef Name a texture's per-generation parts TextureParts
What: the struct of a texture's parts on one generation (TextureShared's
LetGo cell) is TextureParts, not Parts.

Why: tests::exit_guard::only_the_listed_modules_keep_the_device_s_functions
reads the sources by type name, and device/mod.rs's Parts keeps the
device's functions: a second Parts made it count TextureShared, and so
texture/heap_tiled.rs's Weak<TextureShared>, as a copy outside the listed
modules (job m3-max-23905).

Verified: that test, alone, in the rerun that follows.
2026-11-12 19:32:06 -08:00
Anees Iqbal 5c50f55b36 Clippy: take the waiting releases whole, and let auto-deref reach the program
What: CallHold's drop takes the waiting releases with mem::take instead
of draining them into a new Vec, and StateShared::program lets auto-deref
reach the program through its LetGo cell (compute and drawing states).

Why: clippy -D warnings refused both forms (job m3-max-23880 and its
m2v_gpu and m2v_cpu_icd twins).

Verified: the lint jobs that follow.
2026-11-12 19:32:06 -08:00
Anees Iqbal c7362776d0 Let carried textures' and pipeline states' parts go at the lost generation's rest
What: a recovery's carried textures and pipeline states let go of their
parts on the lost generation once it comes to rest, as buffers already
did, so the lost VkDevice goes while they live.

- device/carry.rs: LetGo<T>, the let-go cell MadeOn was (MadeOn is now
  LetGo<Device>), and PartsCalls/CallHold, one guard generalised from the
  buffer's calls and HeldParts: a call outside command buffers' work counts
  itself, and a release at rest waits for the last call to end. Buffers
  use it unchanged in behaviour (Buffer::held_parts, LostBuffer,
  LostPlaced, LostHost).
- Pipeline states: StateShared.program and ProgramLink.program are LetGo
  cells. The carry hands the lost generation a LostProgram, which drops
  the state's program there in place at rest (its variants' objects,
  plans, makings and its Device). reached() skips programs let go of. The
  state keeps its own copy of its label, so label()'s borrow outlives the
  program. Holds: the public state methods that reach the program,
  program(), Debug, and the argument encoder's and indirect commands' set
  paths.
- Textures: TextureShared's per-generation parts (storage, moved,
  pending_move, usage_shadow(_making), faces, snapshot, kept_backings,
  render_shadow, facts, planes_in_place) move into Parts in a LetGo cell,
  read through Deref. The carry hands the lost generation a LostTexture.
  At rest it leaves the texture's slot in the lost generation's table and
  heap sets, hands the caller's range token to the parts on the next
  generation, and drops the parts in place. Parts with a handed-out VkImage
  (Texture::vk_image) stay until the texture goes. Texture::s() skips parts
  let go of. Holds: the public texture methods that reach parts, and
  vk_image; a view's hold holds its root texture too. slot_keeper names a
  texture buffer's generation by its texel views, not by the buffer's
  serving generation.
- WorkCounts::lost_programs_released and lost_textures_released, counted
  on the line.
- Public signatures: ComputePipelineState::device,
  RenderPipelineState::device, FunctionHandle::device and
  VisibleFunctionTable::device now answer an owned Device. The last two
  also borrowed from the state's program. Command-buffer paths use the
  crate-private borrowing generation(). api_signatures is blessed.
- Docs: the carry module docs (device, pipeline, texture), docs/API.md's
  recovery entry, the runtime README's recovery paragraph, vk_image's doc.
- Tests: the four recovery tests in 99dbc69666 also assert the counters.

Why: a carried texture kept its images on the lost generation, and a
carried state its program there, until the object went, so the lost
VkDevice lived as long as any of them. A long-lived program kept it for
good.

Verified: cargo check of the workspace, all targets and features, under
no cfg, m2v_gpu and m2v_cpu_icd, clean but for one validation call site
fixed here (jobs m3-max-23824, 23852). The lavapipe lane (the tests of
99dbc69666 before and after), the suite, lint and the 780M run follow.
2026-11-12 19:32:06 -08:00
Anees Iqbal 292b6ecbae Say whether the no-copy heap recovery test ran, and why it skipped
What: the no-copy heap recovery test prints a line naming the device when
it ran, and where the device imports no host memory it skips with the
importer's refusal named. A device whose physical device lists
VK_EXT_external_memory_host must import: the test fails there instead of
skipping (no_import reads the serving generation's refusal and the
extension list).

Why: the 780M run's output could not tell a pass from a silent skip.

Verified: not run yet; it runs in item 6's lavapipe and 780M lanes.
2026-11-12 19:32:06 -08:00
Anees Iqbal 981b7fc477 Test that the lost VkDevice goes at rest while carried textures and states live
What: the recovery tests of a compute state, a drawing state, carried
textures (of new_texture, a view and one over a carried buffer) and a
Private heap's texture expect one live VkDevice after the recovery while
those objects live: the lost generation came to rest, nothing records
there, and their parts there were let go of. The pipeline tests also hold
a borrow of the state's label taken before the recovery and read it after
the rest, and each test uses its objects again after.

Why: a carried texture keeps its images on the lost generation, and a
carried pipeline state its program there, until the object goes, so the
lost VkDevice lives as long as any of them; a long-lived program keeps it
for good.

Verified: the lane that follows runs these before (they fail: two live
VkDevices) and after the fix.
2026-11-12 19:32:06 -08:00
Anees Iqbal e29906282f SEMANTICS_VERSION 2073: matmul2d takes a cooperative left input
The nine commits before the two batch-directory commits (which are validation-only: a Metal batch's out directory
key carries the validation crate's fingerprint, so an oracle-only change refuses an old directory; batch tests 19/19,
m3-max-23885). A matmul2d run whose left input is a cooperative tensor (the 36
mps_gather_qmm_rhs_* rows of the macOS 27 census) was refused. Measured on the M3 Max (fixture tns_coop_left, 22
cases): the left input of an m x k run follows the destination's block model with K/8 columns, coordinates (k, m),
whichever the right input's transpose; Metal's construction of a cooperative left input zeroes it (tns_init_left).
The lowering holds it as Holds::Left, m/8 x k/8 blocks, split (1,1), for shapes 16x32x32 and 32x32x32 on one simdgroup;
a transposed left input is a typed refusal, as is any unmeasured shape. New owned fixtures tns_coop_left and
tns_mm_left (float, half and bfloat products, plus the tns_init_left kernel), 64 authored cases and their Metal rows.

Verified (on the branch, at cb7bb3833a, rebased clean onto bab584d04b with the same patch-id): Metal on the M3 Max 22/22
(m3-max-23724) and 42/42 (23813) qualified, the construction cases reading zero; lavapipe candidate 64 cases x 2
robustness modes all Match (23821); engine and layout tests 36/36 (23810), the left fused-sum tests on moltenvk, radv
and lavapipe among them; validation 1387/1387 (23874); translator suites failing only golden-table rows re-blessed on
development (23849); lint (23850, 23862). Census: the 36 rows now stop at LinkedFunction postfixPrimary_4xf, a pipeline
input (23818; slowest 0.08 s, largest 22.4 MiB).
2026-11-12 19:24:15 -08:00
Anees Iqbal 15e5d84f74 candidate batch help: wrapped 2026-11-12 19:23:40 -08:00
Anees Iqbal d7c915aa99 Batch out directories carry the validation crate's fingerprint
What: BatchBuild, the record (build.json) a corpus-metal, corpus-vulkan or corpus-moltenvk
batch's out directory keeps of its runs' build, gains `validation`, this crate's source
fingerprint (worker::device::VALIDATION_FINGERPRINT). A batch resumes an out directory only of
its own build, so a build that changed only this crate's sources claims none of an earlier
one's, and is_this_build (batch-report's and batch-install's this_build) answers no for it. A
record from before the field reads it empty, which is no build's.

Why: the record held the executor ABI, the product fingerprint (which leaves this crate out),
SEMANTICS_VERSION and ORACLE_ABI. A fix in the oracle alone, such as the fuel transform's AIR
2.9 atomics (87e88c0706), moved none of them, so a batch resumed in an out directory of the
build before it would have skipped as done every Metal qualification metal-opt refused there.
ORACLE_ABI stays where it was: no committed Metal row is of a case the old oracle could
qualify and the new one answers differently.

Tests: an_out_directory_resumes_only_its_own_build claims a fresh directory and checks the
record holds this build's fingerprint, refuses a directory whose record differs only in it (an
oracle-only change, finished runs and all) and one from before the field, and answers
is_this_build no for both.
2026-11-12 19:23:40 -08:00