Commit Graph
6057 Commits
Author SHA1 Message Date
Anees Iqbal cceefacfa7 RUNTIME 2420: A storage twin's neutral shares the device's zero buffer: the plan says which buffer writes are read-only
What: a new public BindingPlan::read_only_buffer(&DescriptorWrite): true for a uniform buffer and
for a uniform view's storage twin (DescriptorView::UniformWithStorageTwin, PlannedBuffer::twin),
which no function stores through. The runtime asks it where it used to read the descriptor type
alone (binding::descriptor's neutral arm, make_neutrals, binds_own_zeros), and makes the device's
zero buffer a storage buffer too, so a twin bound to nothing binds it.

Why: on the Iris Xe RPL-P profile (DriverWorkaround::PushReadsLengthenThreadPayload) RUNTIME 2413
gave a kernel's constant slot a storage twin. Left unbound, the plan writes the twin from the
ZeroBuffer neutral at a STORAGE_BUFFER binding, which the runtime took for a writable binding: every
dispatch took a fresh 64 KiB upload region, a dedicated VkBuffer allocated and zeroed, held until its
command buffer completed. Round 5974320352's Iris leg:
neutral_zeros_shared::dispatches_share_the_devices_one_zero_buffer, 8 dispatches made 8 VkBuffers
and 16 made 16.

Translation output and plans are unchanged (no SEMANTICS bump); the API addition is blessed in
api_signatures.tsv, and docs/API.md section 5 says it.

Test: engine_access::an_unbound_constant_slot_s_storage_twin_is_a_read_only_write plans
buffer_end_byte_load_constant with nothing bound on intel-irisxe-rplp-anv (the twin's STORAGE_BUFFER
write read-only, the written slot's not) and, as the negative control, on four other profiles (no
twin; read-only exactly at uniform buffers). The device check is the neutral test itself on the
Iris, which fails at the base.

Also, test premises on the Iris profile (round 5974320352's iris:runtime reds):
- a20c0a26d8: the compute creation test counts the forms its profile makes (1 + keyed storage views
  since RUNTIME 2410) and holds the pool only where completion is bounded (under Exact the second
  form runs on the pool).
- 88b8d31a32: set 0 at offsets counts the pipeline binds (draws past offset 0 take the residual form)
  and the push after each where the driver forgets pushed descriptors after a pipeline bind.

Verified in the lane (msi): m3-max-35051 clippy -D warnings -p metal2vulkan -p metal2vulkan-runtime
--all-targets --all-features exit 0, translator tests 71/71 (api_signatures 3/3); m3-max-35053
lavapipe (cpuicd) deferred_calls, neutral_zeros_shared, set_zero_at_offsets, uniform_bind_offsets
43/43. Still to run: clippy gpucfg and cpuicd, rustdoc, ONE Iris run of the three tests.

New Degradation kinds: none.
2026-11-15 21:23:17 -08:00
Anees Iqbal 6434a3d134 dma_buf_in_import: the in-import premise reads the buffer's import too; a test of an import dedicated to its buffer
The RTX 5080's red in round 5974320352: tests::dma_buf_in_import::a_texture_over_a_dma_buf_buffer_s_pages_binds_in_its_import
asserted the texture in place because the DmaBufInImport check passed its reads, yet the texture took no
image. The product was right; the test's premise was short.

The route binds the image in the buffer's import only where the buffer's pages lie in one import
dedicated to nothing (HostPages::in_one_dma_buf_import). NVIDIA's 615.71.09 refuses small dma-bufs
dedicated to nothing (it refuses a page's and takes 64 KiB: dma_buf.rs's ram_takes_dma_bufs), so the
test's 24 KiB udmabuf was imported dedicated to the buffer, which binds no image
(VUID-vkBindImageMemory-memory-10926). The check passed because its buffer is 40 MiB of the device's
own exported memory, imported dedicated to nothing: its verdict says what such an image does once
bound, not whether a given buffer's import holds one. The fallback, an image over a dma-buf of the
texture's own pages, was refused too: NVIDIA lays an explicit plane 512 bytes into a page out at
offset 0 (the 3090's PLANE-OFFSET probe), so the image binds at an offset of an undedicated import
of its own ~20 KiB dma-buf, which 615.71.09 refuses as small. The texture read its texels through
its shadow form.

The change, in the test alone:
- The in-import assertions run where the class's verdict passed and the buffer's pages lie in one
  import dedicated to nothing, the making's own question; elsewhere it asserts no image in the
  import and prints whether the import was dedicated to the buffer.
- The texture is 64x128 (64 KiB of rows), so the buffer's dma-buf (72 KiB) and the control's own
  image dma-buf (68 KiB) are of a size 615.71.09 imports dedicated to nothing: the route and its
  control run on the 5080 rather than skip.
- A second test, the same body with Memory::undedicated_import_refusal (the stand-in for 615.71.09's
  refusal that no_pointer_import uses) set before the buffer: its import is dedicated to it
  (dma_buf_buffer_imports_dedicated + 1, no one import dedicated to nothing) and no image binds in
  it. Under the old premise it fails where the class passed (lavapipe, Iris, the 5080) as the 5080 did.
- The in-place assertion names the counts it saw.

No product change, no new Degradation kind or WorkCounts field.
2026-11-15 21:11:55 -08:00
Anees Iqbal ca6259f7d1 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-15 20:40:36 -08:00
Anees Iqbal da08882991 RUNTIME 2419: Storage twins keep their key only where no other view reads its residual
On ANV (Mesa 26.2.6, Iris Xe RPL-P) a kernel's uniform view with a storage twin read the twin at
its bind offset wherever its own key held, also beside a storage view bound past offset 0, which
keeps reading its pushed residual word. There the thread payload stays long, and the twin's
per-lane storage read cost more than the uniform view's block read at its residual:
dispatch_chain --binds moved ran in 153.96 us a dispatch against base's 143.14 (job
m3-max-34864, 7 interleaved rounds, medians; ref's branch-free storage module 154.01), while
--binds 4, fixed and tex gained 28 to 38 %.

The runtime's uniform_residual_form now sets every twin's RangeAtBindOffset to 0 too where
another RangeAtBindOffset constant of the key is 0 (uniform_residual_form_of): a storage view
bound past offset 0, a twin at an offset no alignment divides, or a uniform view of no twin. The
kernel then reads its uniform views at their residuals, as base does. Where every view holds its
key, nothing changes.

Runtime only: no translation output moves, and no creation key (a creation's prediction binds
nothing, so its storage views and twins all hold). Only dispatch keys of a kernel with a twin and
a view off its bind offset move, on the Iris profile alone.

Docs: residual.rs, keyed_regions, the workaround's profile doc and docs/API.md section 5.

Test: general_form's a_twin_keeps_its_key_only_where_no_other_view_reads_its_residual (fails
with the cut sabotaged, the negative control in the check job).

Verified in the lane at 6d68983cc6: release build of the runtime and its dispatch_chain (m3-max-34932,
BUILD=0). Still running when landed: clippy plain, m2v_gpu and m2v_cpu_icd, rustdoc, the touched
runtime tests and the negative control (34931, 34933), the runtime suite on lavapipe, and ONE Iris
A/B of the arms and native code (base bcd50aba9f / opt2 680fc8997e / cut 6d68983cc6).

New Degradation kinds: none. Fixes the opt2 (SEMANTICS 2132 / RUNTIME 2413) regression of the moved arm.
2026-11-15 20:39:53 -08:00
Anees Iqbal 0cdd3d5399 heap_placed_reads: count the reads through copies, which a draw rebound counts too
What: the lane's Read counts WorkCounts::attachment_reads_through_copies, which every path a
draw takes counts, in place of attached_read_slots, which only a draw that takes every step
counts. Read's doc and the module doc say why: the read of the texture over the attachment's
bytes is a draw of the first read's state, whose kept draw the queue carries into its encoder
(render/carried.rs), so it is rebound (render/draw_again/rebound.rs), except in builds with debug
assertions, where the first carried draw rebound takes every step to check the rebind.

Why: the PHOENIX release failures (m3-max-32457, m3-max-34675: copied_slots 0, announced 1). The
probe f730cfe9c1 (not landed) printed each read's path counts on gem10's Radeon 780M
(m3-max-34911, load 11-15, 3 runs per build): built for release, the over read is a carried
rebound (draws_rebound_carried 1, draws_rebound 1, attached_read_slots 0, through copies 1,
announced 1) in 3 of 3 runs, so the old counter fails there; built with debug assertions, it
takes every step (attached_read_slots 1, draw_shapes_carried 1) and the debug check logged one
rebound checked (KEPT-IDENTITY-CHECKS, m3-max-34877). The draw reads the texture's copy on both
paths. Verified: the new counter reads 1 on both builds' over read.
2026-11-15 20:38:16 -08:00
Anees Iqbal 28510ece64 dma-buf release lane: the rebind step runs again where the busy work ended before it
What: the third part of dma_buf_pages_go_on_a_handler_thread_as_a_command_buffer_completes (busy
work, a copy out of the buffer's old pages, the rebind away from them) runs under
busy_premise::until_premise_held, as device_copies' and first_use's busy steps do. A try whose
busy work ended before the rebind writes its DMA-REBIND step times as a LANE-BUSY-MISS line and
runs again with new pages and new busy work, at most three tries. Every try checks the bytes the
copy read and the busy work's end. Only a try whose premise held checks that the old pages stayed
while the copy was in flight and went on a runtime thread: where the copy completed before the
rebind, the rebind frees them on the test's thread. A call that waits for the busy work misses
every try, and the test then fails with each try's times. busy_premise's doc names the step and
its measured times.

Why: round 4334fadfdc's PHOENIX leg failed it ('the busy work ended before the rebind') inside a
513-test suite, the test taking 3.43 s where it takes about 0.7 s alone. The step times show no
wait on the busy work at that tip or at today's: at 4334fadfdc (m3-max-34877, gem10's Radeon
780M, load 19-21, 3 runs) the busy work committed in 6-54 ms, the copy's commit 0.3-5.8 ms later,
scheduled() 0.2-2.8 ms after it and the rebind 0.4-1.3 ms after that, the end mark 0 at every
step; at 44708b4c3e and 95f8d61a48 (m3-max-34783, m3-max-34807, um790's 780M, 6 runs) the rebind
returned 5-8 ms after the busy work's commit, 45 ms once under load. So the host outlasted the
busy window: the premise, not the runtime.
2026-11-15 20:38:15 -08:00
Anees Iqbal de5612781e 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-15 20:36:13 -08:00
Anees Iqbal c053f814b1 RUNTIME 2418: The in-import dma-buf class takes the dma-buf class's copies verdicts
The check's DmaBufInImport class makes its pages exactly as DmaBuf's
(dma_buf_pages, plus the gate that its buffer lies in one import dedicated
to nothing), and a copies round puts no image over the pages: its copies
rounds repeat DmaBuf's over pages made alike. At its copies turn it now
takes DmaBuf's copies verdicts for both row ends, and runs no rounds of its
own, where DmaBuf's were measured this run or known before (passed or
failed) and both classes' noted memory flags are known and equal, the
same-memory-type rule of RUNTIME 2417's crossing; otherwise its own rounds
run as before. The note names the source verdicts and the flags
("DmaBufInImport copies: DmaBuf's verdicts, Failed and Passed for rows on
lines, its pages made as DmaBuf's in memory of property flags 0x..: no
rounds of its own"). A shared failure is a proof for pages made alike; a
shared pass is one draw of the rounds' race fewer, which errs to the shadow.
CHECK_VERSION 22: a record of 21 may hold the in-import class's own copies.

Tests: tests::in_place's unit test of shared_copies (shared where measured
and memory alike; the control: coherent against cached either way, either
memory unknown, a row end unchecked or pending, every other class: none);
tests::in_place_check's device count (the shared note once and no rounds of
its own where the rule holds, the dma-buf class's verdicts taken; printed
with both classes' memory and the check's wall time).

Also 00ba762437 (test only): the lent targets' test prints every host class's memory on a device made
with VK_EXT_external_memory_host too (LENT-TARGETS-POINTER lines).

Verified in the lane (m3-max-34930, msi, at 937274ec72): runtime clippy --all-targets --all-features
-D warnings plain, m2v_cpu_icd and m2v_gpu exit 0; touched tests 39/39; gpucfg archive built.
On the Iris Xe (RPL-P, m3-max-34910 at 00ba762437): lent_dma_buf_targets passed; Pointer, Fresh,
DmaBuf and DmaBufInImport check pages all lie in memory of flags 0xf. Still to run: the PHOENIX
check wall time base against tip, and the Iris count test with the in-place suite.

New Degradation kinds: none. CHECK_VERSION 21 -> 22: every device runs one fresh in-place check.
2026-11-15 20:35:31 -08:00
Anees Iqbal 5974320352 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-15 20:16:24 -08:00
Anees Iqbal b63bfbfac7 RUNTIME 2417: A render target's lend takes copies' failures through memory of one type
On the Iris Xe walk, a game engine's renderer made 73 RGBA16Float render
targets with free rows' padding over a no-copy buffer's dma-buf pages, and
each was a shadow: their renders failed for rows that end inside a line,
and the dma-buf classes' copies' verdict they lend that padding by
(`in_place::lent_to_copies`) was not failed in the recorded check, while
fresh checks fail it. A class's rounds catch a copy's line write-back only
as often as the CPU's writes race it, so the verdict hangs on a race.

The lend's copies verdict (`in_place::copies_verdict`, through
`InPlaceChecks::decided` at every decision site) now takes another host
class's copies failure, its reads passed, where the class's own kept every
byte or was unchecked, but only where the check's pages of both lay in
memory of a type of the same VkMemoryPropertyFlags as the driver reports
them: a write-back measured through memory of other flags says nothing of
this memory. Each class's memory flags are noted by the check and kept in
its record (CHECK_VERSION 21, eight words more). A shadow that renders with
free padding over host pages names the copies verdict it took in its
shadowed-texture notice. The line-write-back reason and docs (FAST-PATHS
host-pages row and the Iris known gap, API.md section 1 and the catalogue,
the kind's rustdoc) say so.

Tests: the unit test of the rule on the exact shape (same memory in place,
coherent against cached apart in both directions a shadow, unknown memory,
reads not passed, own-memory classes, own failed or pending kept, the
record's memory words); and a device test over a no-copy dma-buf buffer
(tests::lent_dma_buf_targets) whose control notes the pointer class in
memory of other flags and keeps the shadow.

Also 6e1f7b369d: the lend's memory flags are compared and printed as raw bits (ash's
MemoryPropertyFlags has no Debug impl here; clippy's chunks_exact_to_as_chunks).

Verified in the lane (m3-max-34875, msi, at 6e1f7b369d): runtime clippy --all-targets --all-features
-D warnings plain and --cfg m2v_cpu_icd exit 0; tests::in_place, tests::degradation*,
tests::texture_placement 38/38. Still to run: the device test on the Iris, PHOENIX and lavapipe
in-place suites, a sabotaged-build negative control, clippy m2v_gpu, rustdoc.

New Degradation kinds: none. CHECK_VERSION 20 -> 21: every device runs one fresh in-place check.
2026-11-15 20:15:41 -08:00
Anees Iqbal 384ba5ee67 Re-bless the authored compile census after the Iris at-bind and storage-twin work
The authored compile census's expectations at b9cf2070a4, every profile (m3-max-34868, release):
cases 2369, profiles 21, cells 49749, compiled 48670, refused 1079, failed 0, regressions 0,
differences 84, moved artifacts 4303. Rows moved: intel-irisxe-rplp-anv 1897 and its robustness-off
leg 1947 (the RPL-P-only push payload workaround, an unbound storage view taking offset 0's key, and
the kernel storage twins: SEMANTICS 2131/2132); one case's artifact on gate-lavapipe (+x86_64),
amd-780m-radv and nvidia-rtx5080-laptop, each with its robustness-off leg (6 rows). No outcome moved
between compiled and refused.

Wall 132.5 s; slowest compile 817 ms (intel-irisxe-rplp-anv+robustness-off); slowest case 22.4 s
over all its profiles; peak worker RSS 229.5 MB (500 MiB ceiling); peak case-worker RSS 393.4 MB.
2026-11-15 20:13:25 -08:00
Anees Iqbal 24c3923929 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-15 20:11:08 -08:00
Anees Iqbal 45296d9b50 RUNTIME 2416: DmaBufRequest names the alignment of a one-chunk answer apart
A no-copy buffer's, heap's or rebind's request longer than the device's
sparse granule asked every chunk at a multiple of the granule (64 KiB on
RADV of Mesa 26.2.4), one chunk included. That rule was ours: one chunk
is bound to a plain buffer, which vkBindBufferMemory takes at any
multiple of the buffer's memory alignment (VUID-vkBindBufferMemory-
None-10739). The granule binds only an answer of several chunks, as a
sparse buffer is bound at multiples of its alignment in both the buffer
and the memory (VUID-VkSparseMemoryBind-resourceOffset-09491). So a
consumer whose guest buffers lie in a 64 MiB region's dma-buf at page
offsets off 64 KiB (15 of 16 such starts) answered them with dma-bufs of
their own, each one more import on every RADV kernel submission's list.

Expected effect on the consumer (reims's diagnosis of 1910 refused asks
on the 780M, m3-max-34841): only the 212 asks that are one run of pages
inside one region (30 of them 2 MiB heaps) were refused for this rule
alone; about 33 of their objects are live at a time, about 7% of the
~450 imports on each submission's list, and the walk's dma-buf imports
fall about 4092 -> 3900. The other 1698 asks are scattered 4 KiB guest
pages (runs per ask p50 6, 1317 crossing region ends): no piece of a
region holds them (a plain buffer is one range of one memory) and no
split does (the 64 KiB granule needs 64 KiB-aligned runs), so they stay
dma-bufs of their own.

DmaBufRequest gains one_chunk_alignment (the host page, or the plain
dma-buf buffer's memory alignment where larger; it divides alignment
and equals it where the granule is the length); a lone chunk is checked
against it, several against alignment, as before. Answers valid before
stay valid. The rustdoc and HOWTO say how a source picks between them.

How it is verified: tests::dma_buf_shared_files::one_piece_off_the_
granule_binds_a_plain_buffer_at_its_offset (the previous commit's,
refused Invalid without this one) and two_pieces_off_the_granule_are_
refused (its control, refused before and after) on a device whose
granule is coarser than the page (PHOENIX, RADV); tests::one_piece_bench,
a release bench of submission cost with 128 buffers over one region
answered by each rule. The evidence is in the lane's report.

Also: 51768bf6ab (tests: one piece off a device's sparse granule is taken; two such pieces stay refused),
and an ignored release bench, tests::one_piece_bench.

Verified in the lane (m3-max-34863, msi, same tree as 832c48ad2c): api_signatures 3/3; lavapipe
-E 'test(/dma_buf/) | test(/host_memory::a_source/)' 76/76 (lavapipe's granule is a page, so the two new
tests print "shows nothing" there); clippy m2v_cpu_icd --all-targets -D warnings. Still running when
landed: PHOENIX (64 KiB granule) base refusal, tip suite and bench; clippy plain and m2v_gpu.

API: adds the field DmaBufRequest::one_chunk_alignment (additive; a source that checks alignment alone
still answers validly).
2026-11-15 20:10:21 -08:00
Anees Iqbal b9cf2070a4 Re-bless the golden hashes for the Iris's kernel storage twins
SEMANTICS 2132 (765997d91f) declares a storage twin beside each kernel uniform view on the Iris RPL-P profile. The re-bless on the M3 (m3-max-34860 at fc6562aa97: bless_engine_inventory, bless_golden_hashes, bless_engine_goldens all 0) moves 347 rows, every one in the intel-irisxe-rplp-anv column alone; no other profile's cell, no key added or gone.
2026-11-15 20:05:26 -08:00
Anees Iqbal fc6562aa97 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-15 20:01:43 -08:00
Anees Iqbal 47a0a82849 RUNTIME 2415: Pass ends make and compare their open instance's key with no allocation
What: a render pass's end, which works out whether its last instance may stay open for the next
render encoder (encoder_fold.rs's Continued passes), allocates nothing for it:
- a framebuffer holds its attachments' views in place (render_target::AttachmentViews, at most
  each color and its resolve, the depth/stencil attachment and its resolve), not in a Vec copied
  from the list it was made with, and render_target::PassKey holds them so too;
- the key goes by value (EncoderCore::continuable, OpenPass, State::open_pass), not in an Arc;
- InstanceShadows::touches_alone holds each of its draws' uses against the attachments' keys as
  they stand where no use takes another (HostAliases::takes_none), with no list of either; where
  the device's host aliases are live, as before.

Why: round 4334fadfdc's PHOENIX and Iris lanes failed
frame_costs::a_frame_s_draws_and_pass_ends_allocate_within_their_bounds at 20.19 allocations a
pass end, past its bound of 19. RUNTIME 2404 (09a3f0505b) added the key at each pass end: the
attachments' uses listed, the draws' uses collected, the framebuffer's views copied into the key,
the key boxed in an Arc, each per pass.

Verified: in the lane (counts follow).

Also: be328d1804 (the dma-buf lane prints the rebind step's times; test only).

Why: fix forward for RUNTIME 2404 (09a3f0505b): every pass end allocated an Arc'd PassKey whose views
were a Vec, and touches_attachments_alone collected the attachment uses into Vecs, so
runtime_lane::frame_costs::a_frame_s_draws_and_pass_ends_allocate_within_their_bounds failed (20.19 and
20.91 allocations a pass end against a bound of 19; round 4334fadfdc PHOENIX and XTX, m3-max-34783).

Verified in the lane: PHOENIX (m3-max-34783/34807): base b650408113 16.15 / 6.24 allocations a pass end /
a draw; 44708b4c3e 20.91 / 6.37, red 3 of 3; the same product diff on it 16.15 / 6.24, the four frame
tests 3 of 3. lavapipe (m3-max-34811): render_fold 25/25 at base and tip, and the 21 distinct
RENDER-FOLD lines (every continuation and wrong-texel count) identical between bcd50aba9f and the tip.
Still running when landed: clippy x3 and rustdoc (m3-max-34799).
2026-11-15 20:00:58 -08:00
Anees Iqbal b91cca6da5 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-15 19:59:43 -08:00
Anees Iqbal 97da82174b RUNTIME 2414: WorkCounts times the device's dma-buf imports and pieces' joins
The consumer asked for the time its dma-buf import calls take: each
vkGetMemoryFdPropertiesKHR and vkAllocateMemory of a dma-buf import, and
each piece's join of a live shared import.

Three new WorkCounts fields:
- dma_buf_import_calls: imports of dma-bufs of host pages tried, made or
  failed, wherever made (buffers', heaps', rebinds' chunks, shared files'
  imports at a first piece, ahead by a handle or again after the
  residency released them, guest RAM chunks and run lists, images).
- dma_buf_import_nanos: their nanoseconds, on the threads that made them.
- dma_buf_join_nanos: the nanoseconds of the joins dma_buf_pieces_joined
  counts (a map look and a hold, no driver call).

Every import goes through one timed helper (Device::import_timed) that
queries the dma-buf's types and imports it; the four call sites (a
chunk of its own, a shared file, the two image imports) use it.

Verified: the shared-file tests assert one timed import and a positive
join time for four buffers over one file, and four timed imports with
no join time for four dma-bufs of their own.

Why: the consumer's ask (reims dmabufapi): their A/Bs could not report the time the dma-buf import
calls take from WorkCounts.

Verified in the lane (m3-max-34812, msi): clippy -D warnings -p metal2vulkan-runtime --all-targets
--all-features; api_signatures 3/3; lavapipe -E 'test(/dma_buf/)' 73/73: four buffers over one shared
file count import calls 1 with nanos > 0 and 3 joins with join nanos > 0; the control (four dma-bufs of
their own) counts import calls 4 and join nanos 0. Still running when landed: clippy m2v_gpu and
m2v_cpu_icd, the PHOENIX dma-buf suite.

API: adds the fields WorkCounts::dma_buf_import_calls, dma_buf_import_nanos and dma_buf_join_nanos (additive).
2026-11-15 19:58:43 -08:00
Anees Iqbal a7f125fa0c The storage twin's slot test binds its shapes under BufferRanges
RUNTIME 2412 gave BoundBuffer::shape the stage table's BufferRanges; the twin
test landed beside it called the one-argument form. The default ranges tell
every length class apart, as the test's other shapes take them.

Verified: cargo fmt; clippy and the bind tests run as a potluck job.

Fix forward for 765997d91f: the merge of SEMANTICS 2132 with RUNTIME 2412 left one opt2 test calling BoundBuffer::shape(alignment) where 2412 takes (alignment, BufferRanges); the metal2vulkan tests did not compile. Test-only. Checked in m3-max-34828 (clippy on the three crates + the bind::, engine_access, engine_device_replay and interp tests), running when landed.
2026-11-15 19:51:53 -08:00
Anees Iqbal b587d494ca 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-15 19:49:06 -08:00
Anees Iqbal 765997d91f SEMANTICS 2132 / RUNTIME 2413: Kernel constant buffers on the Iris: a uniform view and its storage twin
What: on a profile that takes DriverWorkaround::PushReadsLengthenThreadPayload (ANV on the Iris Xe of
RPL-P), a kernel's uniform view (a read-only constant buffer whose window fits maxUniformBufferRange)
also binds its range as a storage buffer, its storage twin (DescriptorView::UniformWithStorageTwin,
ResourceKind::StorageTwin, BindingSource::StorageTwin). Each load selects, on the slot's
RangeAtBindOffset key, the twin read at the bind offset alone (key 1: a bind at an offset the class
divides, inline bytes, or unbound) or the uniform view at its residual (key 0). Specialization folds
the selection. The binder writes the twin from the slot's own source with a second descriptor range
starting at the bind offset. A twin's kind sorts last, so link numbers put a stage's twins after its
other bindings (docs/API.md section 5). Render stages and every other profile are unchanged: no twin
is declared and translation output is the same.

Why: on the Iris (m3-max-34275, dispatch_chain, us a dispatch) reading a kernel's constant buffer
through a storage view at its bind offset measured binds 4 142.7 -> 102.1, fixed 143.2 -> 101.3, tex
119.6 -> 74.4; at a non-zero residual the storage view lost (moved 143.1 -> 154.0), so the uniform view
keeps the residual case. Creation makes the key and its general form together (RUNTIME 2410), so no
first-use making.

Also: the cache codec lists the new variants; the interpreter binds a twin with no buffer of its own
to its slot's buffer; the device-replay tests name the twin's symbol. Docs: API.md section 5, the
workaround, the DEFECTS row, residual.rs, views.rs.

Verified in the lane: m3-max-34780 (at 7a862493b8) clippy -D warnings, metal2vulkan, runtime and
validation, all targets and features; the metal2vulkan suite 3626 passed, 11 failed: golden_hashes
(re-blessed on development) and 10 fixed at fca91cb055. m3-max-34804 (at fca91cb055) clippy 0. Still
running when landed: nextest over the three crates (34804), the authored compile census on the Iris
profile base against tip (M3), the Iris device tests and dispatch_chain A/B (every arm against base,
the branch-free reference for the folding check).

API: adds DescriptorView::UniformWithStorageTwin, ResourceKind::StorageTwin, BindingSource::StorageTwin
and BufferForm::storage_twin (additive to the enums: a consumer matching them exhaustively must add the
arm; a consumer binding set 0 itself fills the twin as docs/API.md section 5 says).
2026-11-15 19:48:21 -08:00
Anees Iqbal bcd50aba9f C3 venues: the Iris venue allows the RPL-P alone, which its translation key names
Iris venue: allow the RPL-P alone; the RPL-S derives another translation key

Since SEMANTICS 2128 DriverWorkaround::PushReadsLengthenThreadPayload is keyed on the Iris Xe of
RPL-P (8086:a7a0) alone, where it was measured. The UHD Graphics 770 of RPL-S, which the
intel-irisxe-rplp-anv venue also allowed, has a capture that differs from the RPL-P's only in
maxMemoryAllocationSize, but its derived profile does not take the workaround, so its translation
key differs. Venues::check_profiles refuses that, and every test that loads the committed venue
list failed, among them candidate::engine::guards::tests::no_venue_runs_a_guarded_target_under_
robustness_1_alone, the c3 venue tests and the two-device profile test.

The RPL-S leaves the venue: translation tells the two apart, and no cluster host has an RPL-S to
record a venue of its own. Its capture stays committed (other tests read it as a device profile).

- c3-venues.json: the Iris venue's devices are the RPL-P alone.
- c3::tests: the venue allows the RPL-P alone; pushing the RPL-S with its own capture is refused
  as a device that derives another key and needs a venue of its own; the RPL-P's capture under
  the RPL-S's identity is refused as another device's.
- candidate::platform::profiles::tests::the_intel_venue_allows_the_rplp_alone_and_stops_the_rpls
  (was one_intel_venue_allows_both_devices_and_stops_any_other): the captures still differ only
  in maxMemoryAllocationSize, the workaround is the RPL-P's and not the RPL-S's, the keys differ,
  and the venue runs the RPL-P and stops the RPL-S on its name, device ID and driver build.
- c3/venues.rs docs and the regen script's comment say so.

Verified: cargo fmt; built and tested in the next potluck job.

Iris venue tests: the RPL-S also stops on its key and allocation size; six venue devices

The venue no longer allows the RPL-S (51c031e187), so its check against the
RPL-P's venue reports, past its four identity differences, its own
translation key and its host's maxMemoryAllocationSize; and the venues allow
six devices, not seven. Both tests now say so.

Verified: cargo fmt; clippy and the c3/candidate tests run as a potluck job.

Iris venue tests: the venues that present the requirements documents no longer list the RPL-S

The RPL-S is no venue device since 51c031e187, so the presented-on lists of
lunarg-desktop-baseline-2023 and roadmap-2022 drop it.

Verified: cargo fmt; clippy and the c3/candidate tests run as a potluck job.

Fix for development's red since SEMANTICS 2128 (d3b1dbdbe0): DriverWorkaround::PushReadsLengthenThreadPayload is keyed on the RPL-P (8086:a7a0) alone, so the RPL-S capture's derived profile takes another translation key, and every test that loads the committed venues failed (c3::tests x6, guards::no_venue_runs_a_guarded_target_under_robustness_1_alone, profiles::tests x2, integration authored_compile_census and private_corpus_root). Verified (m3-max-34762, msi, at b5d745e599): validation clippy --all-targets --all-features 0; c3:: + candidate:: tests 270/270.
2026-11-15 19:37:36 -08:00
Anees Iqbal 2dae45566e 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-15 19:30:15 -08:00
Anees Iqbal a853d9a944 BufferRanges's docs link no private item; the field check names buffer_ranges
The length-class cut (725d2913d7) added StageTable::buffer_ranges and linked BufferRanges's docs
to the private free function length_class. On development's tip 44708b4c3e:

- rustdoc -D warnings refused the two links ("public documentation for `BufferRanges` links to
  private item `length_class`"); the docs now say "length class" and "its exact class" in words.
- tests::argument_table::the_check_compares_every_field failed on lavapipe: StageTable's Debug
  now prints buffer_ranges, which check_reading already compares (kept.buffer_ranges against the
  device's views.ranges). The test's list names it, and its doc says how it is compared.

Verified: the runtime suite on lavapipe at 44708b4c3e ran 1450 of 1451 passing in partition 1,
the one failure this test; the doc job's two errors are the two links. The rerun at this commit
follows.

Fix forward for RUNTIME 2412 (725d2913d7): rustdoc -D warnings (m3-max-34733, DOC=101: BufferRanges's docs linked a private fn) and tests::argument_table::the_check_compares_every_field on lavapipe (m3-max-34744, 1450/1451: StageTable's Debug now prints buffer_ranges). Docs and a test list only. Re-run (rustdoc, argument_table + grid_classes on lavapipe) m3-max-34760 running when landed.
2026-11-15 19:29:32 -08:00
Anees Iqbal d172da9e5c The compile worker fixture reads its last argument from the back
clippy::double_ended_iterator_last in the cpu_icd lib test build (msi job m3-max-34662,
CLIPPY_CPUICD=101): std::env::args().next_back() in place of .last().

Fix forward for 52a784770c: clippy::double_ended_iterator_last under --cfg m2v_cpu_icd (CLIPPY_CPUICD=101 in m3-max-34662). Verified (m3-max-34725, msi): clippy -p metal2vulkan-validation -p metal2vulkan-devtools --all-targets --all-features -D warnings, cpu_icd 0 and plain 0. Plain validation + devtools suites (m3-max-34721): 1398 passed, 11 failed, all the known C3 venue RPL-S key failure on development since SEMANTICS 2128 (fix in flight); the scan's negative control (m3-max-34745) lists the 88 sites at the base.
2026-11-15 19:27:41 -08:00
Anees Iqbal 44708b4c3e 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-15 19:20:54 -08:00
Anees Iqbal 725d2913d7 RUNTIME 2412: Bind shapes tell buffer length classes apart only as far as the device's range limits do
What: a new public bind::BufferRanges (a device's maxUniformBufferRange and
maxStorageBufferRange, BufferRanges::of(limits)), carried on each StageTable (buffer_ranges,
serde default), which the runtime sets on every table it reads (argument_table's AtBindViews,
beside the view base alignment: stage_table_reading, refresh_reading and the in-part
refreshes, AtBindViews::holds, and the debug check of a kept table). A buffer's shape states its
length class rounded up to the greatest class that fits the same limits
(BufferRanges::length_class); a class past both stays its own. BoundBuffer::shape and same_shape
take the ranges; BoundKind::of_bound and instantiate::bound_buffer class the bound length under
the table's ranges, so the instantiation's kind check takes a binding exactly where its class is
the plan's. The default (both 0) tells every class apart, as before.

Why: a guest compositor's serial compute encoder of ~1,140 fix-up dispatches over buffers of
many sizes made a new bind shape at 46% of its dispatches and planned again at 69% (the
consumer's XTX walks). A plan reads a length class only through class_fits against those two
limits (storage_view_variant and large_view_candidates against maxUniformBufferRange,
psb_variant and range_variant against maxStorageBufferRange); otherwise it only stores the class
for the kind check. On an RX 7900 XTX both limits are 4294967295, so every buffer below 4 GiB
takes the same plan decisions, and the dispatch_chain bench's 44 length-class shapes were one
plan. The bench there (job m3-max-34605, interleaved) matched the walk's split exactly (made
46%, found 18%, kept 36%) at 7.1-7.6 us a dispatch, against 4.1-4.4 us for the same stream of
one shape.

Exact: under the device's own limits, every class_fits answer of the rounded class is the exact
class's, so every plan decision, variant key and specialization is the same; under any other
limits the rounded class still bounds the padded length from above (padded < 2^class), so no
plan reads a range past a limit (it may take only a longer buffer's form).

Digests, cache keys and stored records: none carries the class. BindShape keys only in-memory
memos (Variant::plans, a state's kept Planned entries, the dispatch memo, the render draw
shapes); artifact digests and region keys are functions of the variant key and specializations,
which this leaves equal; validation and executor states keep the default ranges, so their shapes
and plans are unchanged; no pipeline record or warm record holds a shape. The serde form of
StageTable gains a defaulted field. So no SEMANTICS bump, in my reading.

Tests: bind::plan::slots length_classes_are_told_apart_as_far_as_a_plan_reads_them (4 GiB
limits, 64 KiB/128 MiB both ways round, 16 KiB, and none: every length's class answers both
limits' class_fits as the exact class does, bounds its padded length, is exact under none, and
bound_buffer takes a binding for another length's kind exactly where the classes are one, only
where the exact classes answer both limits alike); bind_shape_of's has_shape states and
same_shape pairs over range limits; runtime grid_classes
lengths_the_device_tells_apart_nowhere_plan_once (outputs of four length classes under 16 KiB,
one shape, 23 of 24 dispatches planned as before; 20 without this), and
shapes_and_classes_in_turn_each_plan_once re-made from the constant's binding (inline bytes, a
buffer, a buffer with a per-bind stride), since its three length classes are now one shape.
API: signatures blessed, api_surface, docs/API.md.

Also: 674c995a42 (dispatch_chain --zero-classes and --stay: a guest's fix-up dispatches over buffers of
many sizes), ad406afa87 (clippy in the new test).

Verified in the lane (m3-max-34674, gem10, at ad406afa87): clippy -D warnings -p metal2vulkan
-p metal2vulkan-runtime --all-targets --all-features; translator tests 21/21 (the new
length_classes test, bind_shape_of, the slots tests). Still running when landed: the XTX bench before
and after (release, interleaved), the lavapipe bench, the runtime suite under m2v_cpu_icd on lavapipe,
the negative control (AtBindViews ranges set back to the default fails the new runtime test), clippy
gpucfg and cpuicd, rustdoc.

API: adds bind::BufferRanges and StageTable::buffer_ranges (serde default); additive.
2026-11-15 19:20:06 -08:00
Anees Iqbal a842f346cb 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-15 19:18:52 -08:00
Anees Iqbal 581d870e51 RUNTIME 2411: A continued pass's end takes no barrier after its group's earlier encoders
A continued pass's end takes no barrier after its group's earlier encoders

A render encoder that continued the instance its group's tail held open
noted its whole pass's uses at its end against the group's order, which
still held the earlier encoders' copies (a split's shadow or attachment
copies) and so asked for a barrier; recording it ended the instance the
encoder left open, so in a run of readers only every other encoder
continued (render_passes_continued 53 of 106 boundaries in the glass
walk's branch form on the 780M). The barrier orders nothing: a group
whose tail holds an open instance holds its leader and the encoders that
continued it alone, each of whose last instance touched nothing but its
attachments, so every other access of theirs came before a split's
barrier from everything before that instance began; the continuing
pass's first instance is ordered after their attachment accesses by
rasterization order and after the rest by that barrier, and its later
instances follow its own split's barrier. Its uses still join the
group's summary, so an encoder that joins later orders itself after
them.

Tests: three readers in a row (a draw, a barrier over the render
targets, a sampling draw that splits) each continue the one before, each
band holding what its sampling draw read of its first draw; a compute
encoder after two continued render encoders reads what they drew,
inverted.

render_fold: continuation lanes expect no continuation where the device splits at aliases

On NVIDIA's 620.70.06 on the RTX 3090 (ImageUsesMissBufferWritesInOne-
CommandBuffer) no pass leaves its instance open or continues another, by
the Continued passes rule, so each render encoder begins its own; the
round at 4334fadfdc failed a_dispatch_between_render_encoders_ends_the_
continued_instance there with (6, 0, 6), its texels right. The lanes
that expect a continuation now expect each encoder's own instance on
such a device (Lane::continuing), printed; the rebind lane expects the
last encoder alone encoded again, each encoder a group's alone.

Why: v2 (RUNTIME 2408) continued only every other multi-instance encoder on the glass frame
(branch private: render_passes_continued 53 of 106 boundaries): an encoder that continued noted its
pass's uses at its end, and the group's order asked for a barrier after the earlier members, which
ended the open instance. Also round 4334fadfdc's 3090 red
(render_fold::a_dispatch_between_render_encoders_ends_the_continued_instance (6,0,6)) was the tests'
premise: the 3090's driver fact ImageUsesMissBufferWritesInOneCommandBuffer keeps every pass from
continuing, by design.

Verified in the lane (m3-max-34636, lavapipe, at 622368ab37): the 12 continuation cases (readers in a
row: (1, 2, 4), each band's texels right; compute after a continued group: its own barrier counted,
texels right); hand control with the old ordering (after_fold = true): only the readers case fails at
continued 1; full runtime suite 2869/2870 (the one failure,
dma_buf_standing_refusal, is development's own at b4e6511871 and fixed by 47e6b45475). Compiled under
m2v_gpu (m3-max-34637). Still running when landed: clippy x3, the 3090 render_fold suite, the 780M and
Iris glass A/Bs.
2026-11-15 19:18:08 -08:00
Anees Iqbal 52a784770c Validation tests find their inputs and their compile worker under any archive selection
Validation reads the checkout where the test runner names it, everywhere

A lib-only archive of the validation crate, built on msi and run from another root with
--workspace-remap and the build tree's sources moved away (lavapipe, job m3-max-34590), failed
runtime_lane::tests::a_kernel_runs_the_functions_its_descriptor_links (NotFound at tests.rs:697:
crate::engine::profiles_dir() is env!("CARGO_MANIFEST_DIR")/profiles) and
candidate::engine::graphics::tests::public_render_cases_plan_or_refuse_typed ("0 public render
cases planned": a baked corpus root). Both pass when the build tree is present. The scan
39bff0de2a added covered only runtime_lane/, not the library code the lanes call, nor the rest of
the crate a carried archive holds.

Every env!("CARGO_MANIFEST_DIR") read left in the validation crate moves onto
metal2vulkan-devtools' resolvers, mechanically: the crate's own files onto validation_dir(), the
public fixtures onto fixtures_dir()/engine_dir(), the workspace and crates/ onto workspace_dir().
That is 73 sites in src/ (library ones included: engine::profiles_dir, source::corpus_root,
cutover::list_path, library_module's linked fixtures, mesh_cases, corpus-harvest's default
corpus) and 15 in tests/. The runtime pin's include_str! takes a path relative to its file. A
binary run outside cargo names no manifest directory, so workspace_dir() falls back to the checkout
the dev-tools crate was built in: the same directory as before.

The devtools scan (tests::the_carried_tests_read_the_checkout_where_the_runner_names_it) now
covers all of crates/metal2vulkan-validation/src and tests beside the runtime's src; at the base
it lists the 88 sites.

Test harness and validation tooling only; no product file.

The lib's device tests compile through their own test binary

A lib-only archive of the validation crate (cargo nextest archive -p metal2vulkan-validation --lib,
lavapipe, job m3-max-34590) failed 20 runtime-lane tests whether or not it ran beside its build tree:
the 16 kernels_with_textures_and_samplers_match_metal shards, the two argument-buffer censuses,
sparse_cases_match_metal and public_render_cases_match_metal. All panicked at candidate/tests.rs:63:
compile_worker() looked for the corpus-pipeline binary above the test binary, and Cargo builds a
package's binaries only for a selection that holds an integration test, so a --lib build or archive
never has one.

compile_worker() now names this test binary (CompileWorker::lib_tests), which already installs the
counting allocator (alloc::tests) and already served the compile path's limit probes. A
CompileWorker carries the arguments and variables before the worker argument: none for a binary;
for the lib test binary, `--exact worker::compile::tests::compile_worker_fixture --nocapture
--quiet --` and M2V_TEST_COMPILE_WORKER, so the worker argument run_json's caller appends is a
filter after `--`. The fixture serves a compile, or the probe the variable names, through
worker::serve_process as a binary does, on an 8 MiB thread (a binary serves on its main thread;
the harness runs a test on a 2 MiB one), and exits. It refuses any worker argument but the compile
worker's. run_json decodes the last non-blank line of the worker's stdout as its report, so the
harness's "running 1 test" line before it is not read.

The worker keeps every limit of the boundary: its parent is the same compile() path, so it has
its own process group, the 20-s deadline, the process-group RSS kill, the 500-MiB allocator budget
and scratch removal. The limit probes now go through CompileWorker::lib_tests and compile(),
the exact path the device tests use: deadline (timeout), resident memory (oom), budget
(worker_exit) and the uncounted refusal. New tests:
worker::compile::tests::the_lib_tests_worker_returns_the_pipeline_the_public_api_compiles (the same
comparison tests/integration/compile_worker.rs makes through the real corpus-pipeline,
corpus-vulkan and corpus-moltenvk, which stays) and
worker::tests::a_worker_s_report_is_the_last_line_of_its_stdout.

Test harness only; no product file.

mesh_cases borrows its label for the fixture path; run_json's doc rewrapped

The unbake rewrite moved the row's label into the path join (E0382 in the cpu_icd lib test build,
msi job m3-max-34650); it joins a borrow. Compile fix and doc wrap only.

Why: a lib-only nextest archive of the validation crate (as lanes build) failed 22 tests when run off
its build tree, 20 when run on it (m3-max-34590, lavapipe): the compile worker binary is built only
for selections that include an integration test, and 88 env!("CARGO_MANIFEST_DIR") reads lay
outside the tree the 39bff0de2a scan checks.

Verified (m3-max-34662, msi, at 97feb0e0dc): the lib-only cpu_icd archive, run on lavapipe remapped to
another root with the build tree's sources moved away: 426/426 (the commitwait set, every touched lib
test module and worker::), including the 22 that failed at the base; the four limit probes through
CompileWorker::lib_tests (timeout 20.06 s, RSS kill, allocator budget, uncounted refusal); the new
lib-tests worker equality test. Still running when landed: clippy x3 for validation and devtools, the
plain suites (the corpus-pipeline integration comparison), the widened scan's negative control, rustdoc.
2026-11-15 19:16:35 -08:00
Anees Iqbal 47e6b45475 In-place images in the buffer's import: a free check, a route-(b) test held to its route, and a first-use bench
tests::dma_buf_standing_refusal measures the source's asking, which only an image in a
dma-buf import of its own does: it fails the in-import class's verdicts first, as the other
route-(b) tests do. lavapipe (m3-max-34595) took the in-import route there, so the test saw no
request and failed.

tests::dma_buf_in_import now also checks that the import an image binds in, kept imported for
good, is freed once the textures and the buffer go (host_imports_live and
dma_buf_memories_live back to their values before the buffer), and gains an ignored release
bench (in_import_first_use_bench): new_texture and a one-texel blit's first use, in the import
against in an import of its own, 1920x1080 and 4096x5376, medians of 3.

Test-only follow-up to RUNTIME 2409 (8d617591f8).
- tests::dma_buf_standing_refusal fails the new class's verdicts first (own_dma_buf_images), as the
  other route-(b) tests do: on lavapipe the route (a) image took the texture, and the test counts
  source requests only route (b) makes (it failed at :138 in m3-max-34595).
- tests/dma_buf_in_import.rs drops its textures, buffer and command buffers at the end and polls until
  host_imports_live and dma_buf_memories_live return to their values from before the buffer: the
  import goes with its last holder.
- An ignored release bench, in_import_first_use_bench (IN-IMPORT-AB lines), route (a) against route (b).

Verified (m3-max-34616, msi, m2v_cpu_icd): the in_place, dma_buf, texture_placement, copied_device,
host_pages_placement, host_residency, shadow_causes_device and rebind filter, 232/232. The count test
on llvmpipe: in the import 1, dma-buf images 0, imports live 0, source calls 0; its negative control: 0,
1, -, 1; the free check passed.
2026-11-15 19:11:37 -08:00
Anees Iqbal b4e6511871 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-15 19:03:32 -08:00
Anees Iqbal 66de1cabbc SEMANTICS 2131 / RUNTIME 2410: At-bind storage views: creation makes the offset-0 key and its general form
On a profile that takes DriverWorkaround::PushReadsLengthenThreadPayload (ANV on the Iris Xe of
RPL-P) a storage view bound at offset 0 reads at its bind offset alone (RangeAtBindOffset 1). Every
plan made before a bind (a render state's creation prediction, a compute state's predicted region,
a warm pass's replay of a recorded dispatch) bound nothing, and an unbound storage view took 0, so
the creation made the general form and the commonest command, every storage view at offset 0,
made a second pipeline at its first use; the warm records named the other form.

- bind::plan::slots::range_at_bind_offset: a storage view bound to nothing takes what a bind at
  offset 0 takes; a uniform view keeps 0. Elsewhere no storage view declares the key.
- Render creation (pipeline/predicted.rs): the predicted key keeps its storage views' constants
  (uniform_residual_form) and the creation makes that key and, where it differs, its general form,
  together (RenderVariant::make_at_creation: pooled and waited for within one bound under Bounded,
  joined under Exact). The pool-ahead making of the key is deleted; the creation log names the
  general form's line.
- Compute creation (pipeline/dispatch_making.rs): the predicted region and its residual form,
  made together the same way. A warm pass's dispatch replay makes each region's residual form too
  (pipeline/dispatch_record.rs).
- The executor tells offset 0 apart at every slot (views_told_apart), so its plan of a case on the
  row is the runtime's (runtime_lane::executions).
- Tests: per-row expectations where offset 0 is its own shape or the creation makes two
  (made_at_creation, pipeline_records' Makings, grid_classes, dispatch_work, warm, the kernel
  creation counts in uniform_bind_offsets); the draw-again general-form test now binds
  colored_vertex's positions at 16 and colors at 0, a key neither creation form matches; a new
  device test, storage_views_at_offset_0_make_nothing_at_their_first_use, counts that a draw and a
  dispatch of storage views at offset 0 make, pool and take nothing but the creation's pipeline;
  an ignored timing test, storage_creation_times, times such a state's creation cold, from the
  memo and from the directory.
- Docs: DriverWorkaround::PushReadsLengthenThreadPayload, the DEFECTS row, residual.rs,
  predicted.rs, dispatch_making.rs, dispatch_record.rs, the warm pass, docs/API.md.

Also: c1d0b47a10 (WorkCounts docs name both creation forms; the first-use test types its positions),
6377eafa09 (storage_creation_times prints each round).

Why: fix forward for RUNTIME 2398-2400. Round cc1d619c7a's Iris legs failed about 16 tests on the
pipeline the creation made not being the one first use takes (made_at_creation, pipeline_records,
warm, restart, ycbcr_textures, executions, grid_classes, dispatch_work).

Verified in the lane: m3-max-34579 (at 2e6fbef8f2) clippy -D warnings, metal2vulkan, runtime and
validation, all targets and features; bind::plan::slots tests 14/14. m3-max-34603 (at 6377eafa09)
clippy --cfg m2v_gpu of runtime and validation; validation candidate::engine + worker::compile 103/105:
the runtime-sources pin (re-pinned at landing) and
candidate::engine::guards::tests::no_venue_runs_a_guarded_target_under_robustness_1_alone
(guards/tests.rs:125, under investigation: present on development or not). Still running when landed: the
Iris suites (made_at_creation, pipeline_records, restart, ycbcr_textures, executions, dispatch_work,
grid_classes, warm, uniform_bind_offsets, draw_again) and the creation-time A/B, cold and warm.
2026-11-15 19:02:47 -08:00
Anees Iqbal 57c08ab04f 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-15 18:56:41 -08:00
Anees Iqbal 8d617591f8 RUNTIME 2409: In-place textures over dma-buf pages: the image bound in the buffer's own import
A texture in place over a no-copy buffer's dma-buf pages no longer always asks the pages'
source for a new dma-buf and a dedicated import of its own. Where the pages lie in one import
dedicated to nothing (no sparse buffer over several imports, no import the driver made
dedicated to the buffer), its DRM_FORMAT_MOD_LINEAR image whose plane lies at offset 0 at the
texels' pitches is bound in that import at the texels' offset, beside the buffer
(vkBindImageMemory's memoryOffset): no udmabuf, no import, no new GPU mapping. Every fact is
asked of the driver: the image requires no dedicated allocation (VUID-vkBindImageMemory-
image-01445), the format query takes dma-bufs for it outside one (not DEDICATED_ONLY), its
alignment divides the offset (-None-10735), its size fits the pages' placement (-None-10737)
and its memory types take the import's. An import dedicated to the buffer binds no image
(-memory-10926): DmaBufPages now notes that.

A new check class, PagesClass::DmaBufInImport (CHECK_VERSION 20), measures that image; the
check's textures of each dma-buf class take that class's image alone (a thread-local of the
class the check runs). texture/route.rs takes the new class where its verdicts take the
texture, else DmaBuf's; a shadow waits on DmaBuf's verdict while both pend. Where the making
refuses the image in the import, it falls back to today's image where DmaBuf's verdicts take
it. A pending move re-routes the same way. Binding in the import reads it apart: it is kept
imported for good, as an image in a pointer import's is. A rebind remakes such an image in the
new pages' import by the same order. RADV requires a dedicated allocation of every such image,
so its check leaves the new class unchecked and it never takes the route.

New WorkCounts field: dma_buf_images_in_import. No new Degradation kind.

The route-(b) device tests (parked images, plane offset, import cycles, a texture's residency)
fail the new class's verdicts first, so they keep measuring today's image on any device. A new
device test (tests/dma_buf_in_import.rs) counts the route and its negative control.

Also: 4c3cbe2f1d and 37d2a750ce (the probe, dma_buf_linear_bind: a linear and a modifier image for
dma-bufs bound in the pages' existing import, the dedicated answers, a re-import arm), 5a40c2ef7b
(docs: API.md, HOWTO.md, FAST-PATHS.md, host_residency.rs module docs).

Why: the owner asked how to remove the per-texture dma-buf. Probe answers (Mesa 26.2.6): RADV on
the Radeon 780M refuses LINEAR images for dma-bufs (NOT_SUPPORTED x15) and requires a dedicated
allocation of every DRM_FORMAT_MOD_LINEAR image (m3-max-34443), so there it never fires. ANV on the
Iris Xe takes both images outside a dedicated allocation, bound in the existing import byte-exact;
first use of an 84 MiB texture 1.37 -> 0.21 ms (m3-max-34453).

Verified in the lane (m3-max-34571, gem10, at 5d5dee7901): clippy -D warnings -p metal2vulkan-runtime
--all-targets --all-features, plain and m2v_cpu_icd. Still running when landed: the lavapipe
in-place and dma-buf suites with the new count test (m3-max-34593), clippy m2v_gpu, PHOENIX, and the
Iris count test with its negative control.

API: adds the field WorkCounts::dma_buf_images_in_import (additive; api_signatures blessed in the lane).
2026-11-15 18:55:56 -08:00
Anees Iqbal 15d4b7f640 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-15 18:54:58 -08:00
Anees Iqbal aa9c211eac RUNTIME 2408: Render encoders continue the last of several inline instances, and across barriers between draws
A render encoder's pass now leaves its last render pass instance open
for the next render encoder where every instance recorded inline and
nothing records after the last, not only where it had one instance; the
earlier instances end and store in its command buffer as before. The
key of a kept instance after a split is its render pass's shape, its
framebuffer (its own or the first instance's) and the render area it
began over, the layout's extent; PassKey now carries the render area,
so an instance that began over a smaller area than its framebuffer's is
continued only by one of the same area. An instance whose colors are in
the feedback loop layout stays closed.

A memory barrier between draws no longer keeps an instance from
continuing, or from being continued: it records inside the continued
instance as inside its own, against the subpass's dependency on itself
(VUID-vkCmdPipelineBarrier-None-07889). Compatible render passes are
otherwise identical, so they hold the same dependencies, and every
render pass of a shape depends on itself (render_target's Between
draws), by region and view by view as the barrier is (07891, 07893).

Tests: a barrier between the next encoder's draws continues the
instance; the second of a barrier-split pass's two inline instances
stays open for the next encoder. The render_fold lane's target drops
its queue before the clear's, under the tests' two-queue limit, and the
slice lane expects two instances begun, as the counter counts begins.

Also: e3c23a73fc and b2dab0dd2f (render_fold tests: the continuation cases count pipeline barriers;
what ends or forbids a continued instance: a sampled read of the first encoder's attachment, a
DontCare store, a blit or compute encoder between, another array slice, a 4-sample resolve, a
rebind).

Verified in the lane (m3-max-34559, tip 8711dc6b14, lavapipe): the ten continuation cases 10/10;
the full runtime suite 2864 passed, 0 failed; three negative controls by hand (continuation off:
the 6 continuing cases fail on counts with the same texels; the barrier limit restored: the barrier
and last-instance cases fail; the one-instance limit restored: the last-instance case fails).
780M A/B (m3-max-34567, release, base 190f64ca18): glass frame over pages 8.48 -> 7.87 ms (-7%),
private 5.49 -> 4.92 ms (-10%), snapshot private -24%, branch -16%, plain -76/-77% (v1); render pass
instances per glass encoder 1.68 -> 1.19. Still running when landed: the Iris A/B (m3-max-34570) and
clippy x3 (m3-max-34572).
2026-11-15 18:54:17 -08:00
Anees Iqbal 8a8af67803 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-15 18:49:41 -08:00
Anees Iqbal 873c255ded RUNTIME 2407: Grouping bound: a queue's expected run follows its command buffers' own GPU times
What: the group bound (GROUP_RUN, 16 ms) reads a per-command-queue estimate of its own
(QueueGen::group_run), with the same rule as before: raised at once by a longer run, halved
toward a shorter one. It is fed at each command buffer's completion in place_gpu_times:
- from its GPU duration by its timestamps, the value the long-queue mark already reads;
- where the device answers GPU times from the host, from those placed host times.
Device::flies goes back to the Flight for a VkQueue an unshared queue holds only, so the unshared
hold's Expected and its feed are as they were before 37b1ca8563.

Why: 37b1ca8563 fed the bound from the host's view of each batch's run as its VkQueue's oldest.
That view holds other VkDevices' work on the GPU and the host's latency. Under nextest's parallel
suite on the Radeon 780M (m3-max-34541, at bf0ca5902a), the warm fills' commit-to-completion
times read 0.6 to 825 ms. Queues read past 16 ms, grouping stopped, and five grouping tests
failed. The hazard the bound guards is our own kernel job's length. A command buffer's two
timestamps bracket its own work, and other clients' work does not lengthen them.

Docs: group.rs and the grouping FAST-PATHS row say where the estimate comes from. With
gpu_times_from_host it follows host times, which hold other clients' work too, so under contention
there a queue's batches may stop grouping.

Test: scheduler_held_wakes::a_late_completion_of_short_gpu_work_leaves_its_queue_grouping. A warmed
queue's fill has its completion held unpublished 40 ms (Point::Publish) while its GPU work is
short by its timestamps, then the queue's next group must be kept. Under the host-view estimate
that run reads 40 ms and no batch of the queue would join a group.

Fix forward for RUNTIME 2405 (5021e3b4ac): its regression showed on the 780M as five grouped tests
failing under the parallel suite (m3-max-34541).

Verified in the lane (m3-max-34562, tip c90332ba5e): clippy -D warnings m2v_cpu_icd, runtime and
validation, all targets and features. Still running when landed: the lavapipe set (dropped_work and
the new test), clippy plain and m2v_gpu, rustdoc, and the 75-test 780M rerun under the parallel suite.
Expected, not yet shown: the new test fails against 5021e3b4ac's estimate.
2026-11-15 18:48:54 -08:00
Anees Iqbal 2a13f503ce FAST-PATHS: the grouping row measures its run bound on the Radeon 780M
frame_costs_over_imports, release with --cfg m2v_gpu, before (dcd5b6fc96) and after (37b1ca8563)
on the same node (job m3-max-34529): grouped vkQueueSubmit calls a frame barely move, and no
group went for a batch's expected run.
2026-11-15 18:41:06 -08:00
Anees Iqbal 4334fadfdc Re-bless the engine tables for the 16x16x16 simdgroup matrix fixture
SEMANTICS 2130 (aa5511f61e) added the owned fixture engine/simd_matrix16 (12 kernels). The re-bless on the M3 (m3-max-34524 at 085e1a5e25: bless_engine_inventory, bless_golden_hashes, bless_engine_goldens all 0) adds its 24 rows (.ll and .air.ll x 12) to golden_hashes.tsv and public_fixture_expectations_engine.tsv, and its air_input printout. No existing row moved.
2026-11-15 18:36:47 -08:00
Anees Iqbal a84a88e75a Grouping tests: warm each grouping queue with six fills, and print each warm fill's time
grouped_submissions' warm() prints its fills' times from commit to completion (GROUPED-WARM)

The line bac49a5b1b's message names; it shows how long a grouping queue's first fills ran, which
the queue's expected run takes (unshared_hold::Expected).

Grouping tests warm each grouping queue with six fills in turn

What: the grouped lane's warm(), scheduler_held_wakes' warm() and submit_check_device's paths
test now run six fills in turn on each queue that should group, where they ran one. The lane's
warm() prints each fill's time from commit to completion (GROUPED-WARM).

Why: a queue's expected run takes a first run at once and halves toward later shorter ones, and a
batch groups only within 16 ms of it (GROUP_RUN). On lavapipe, with the merge assumed, two tests
failed at 37b1ca8563 (m3-max-34508), each with one warm fill:
- a_held_group_goes_before_another_queue_s_submission_handler_runs: X was not kept, and no batch
  of the first queue was held at all;
- scheduler_held_wakes::a_held_batch_whose_wake_never_came_goes_at_the_next_slice: the third
  command buffer's group was not kept.
The explanation (a slow first fill on llvmpipe) is inferred, not yet shown; the GROUPED-WARM line
is there to show it. Five halvings bring a first run of up to about 500 ms under the bound.

Fix forward for RUNTIME 2405 (5021e3b4ac): on lavapipe two grouping tests (grouped_submissions::a_held_group_goes_before_another_queue_s_submission_handler_runs, scheduler_held_wakes::a_held_batch_whose_wake_never_came_goes_at_the_next_slice) failed in m3-max-34508 at 37b1ca8563 (73/75): one warm fill there can run past GROUP_RUN, and a queue's expected run takes its first run and only halves toward shorter ones. Test-only. Re-test m3-max-34526 running when landed.
2026-11-15 18:35:27 -08:00
Anees Iqbal 085e1a5e25 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-15 18:32:48 -08:00
Anees Iqbal aa5511f61e SEMANTICS 2130 / RUNTIME 2406: 16x16x16 simdgroup matrix products: refused as their own feature, Metal's rule below Apple10
What: `air.simdgroup_matrix_16x16x16_[widening_]multiply_accumulate` is now refused in every stage
as `Unsupported{SimdgroupMatrix16x16x16, NotImplemented}` (a new `Feature`), ahead of the 8x8
lowering's kernel-only check. The runtime's `compile_error` answers it as Metal does:
`Needs::MetalGpuFamily(1010)` on a device that does not claim Apple10, `NotImplemented` on one
that does (as `IndirectRenderState`). The owned fixture engine/simd_matrix16 shrinks to one form
per class (float, half, widening signed int8), each with the four transpose-flag pairs, 12
kernels; the probe carries the M3's answer in its header.

Why: Metal itself refuses these products below Apple10. The M3 Max (macOS 27.0.1) refused every
pipeline of the fixture at creation, AGXMetalG15X_M1 code 3, "simdgroup_matrix<T,16,16x16>
operations are supported by GPUFamily10 and later" (job m3-max-34410). No device the runtime
presents claims Apple10: the family lists the "SIMD-scoped matrix multiply operations" row (from
Apple7), refused NotImplemented(SimdgroupMatrix) on every device, and the lod-bias row, a gap. So
the refusal is Metal's own answer, not a device gap: no FAST-PATHS known gap.

Tests: engine_simd_matrix::products_of_16x16x16_are_refused_as_their_own_feature (every
committed profile, the fixture's 12 kernels); runtime_lane::simd_matrix16 (the device's compute
pipeline creation answers MetalGpuFamily of Apple10). REFUSALS.md regenerated, api_signatures
blessed, reach mark added. The engine fixture expectation table and golden hashes take the
fixture's rows on development.

Also: f639b74288 adds the owned fixture (MSL we wrote, compiled by scripts/regen-air-fixtures) and
its Metal probe; 5dbfa3d3d5 imports AirLibrary in the runtime-lane test.

Verified in the lane: m3-max-34499 (msi, at 38d4694b12) clippy -D warnings for metal2vulkan, runtime
and validation (all targets and features) and 45/45 tests, incl. the new engine_simd_matrix test (12
kernels on every committed profile), the error tests, refusal_surface, api_signatures, api_surface;
m3-max-34514 (gem10, at 5dbfa3d3d5) clippy m2v_cpu_icd and runtime_lane::simd_matrix16 on lavapipe
(Needs::MetalGpuFamily(1010) for all 12). Clippy m2v_gpu (34516) still running when landed.

API: adds Feature::SimdgroupMatrix16x16x16 (additive; api_signatures blessed in the lane).
2026-11-15 18:32:00 -08:00
Anees Iqbal dc9d9a4ba9 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-15 18:30:39 -08:00
Anees Iqbal 5021e3b4ac RUNTIME 2405: Grouped submissions: a group's summed expected GPU run stays within 16 ms
What: a batch joins a held group only where its queue's expected run is known and keeps the
group's expected runs, summed, within GROUP_RUN (16 ms). Otherwise the group goes first
(GroupEnd::Long, WorkCounts::group_ends_long), and the batch leads the next group where its own
run is known and within the bound, else goes alone. The expected run is unshared_hold::Expected,
which was fed only on a VkQueue an unshared queue holds. It is now fed on every VkQueue whose
batches group: Device::flies enters each batch there in the Flight. The hold's decisions still
read the Flight only where other queues' batches are held back.

Why: the driver runs a group as one kernel job, and Linux's amdgpu ends a job past its 2 s default
timeout with no error the device reports. On a Radeon 780M a single 3.2 s command buffer was ended
and the one behind it dropped. Four batches that each finish alone could cross the timeout
merged. With the bound, merging adds at most 16 ms of the others' expected work to any job. 16 ms
is the owner's line for an intolerable wait, and it also caps how late grouping makes a member's
completion seen (the FAST-PATHS row said about 20 ms behind a 20 ms batch). A queue none of whose
batches was seen complete has no expected run, so its batches go ungrouped until one completes.

Tests:
- tests::group_run: the admission rule (unknown, alone, a full group of quarters, 12 + 5 ms,
  overflow).
- runtime_lane::grouped_submissions::a_queue_s_batches_group_within_their_run: on a grouping
  device with one VkQueue, behind running work on another queue, a fresh queue's batches group
  none, a warmed one's group, and none after a 40 ms command buffer of its own.
- The grouped lane scenarios, and submit_check_device's paths test, warm each grouping queue with
  one completed fill first. The behind-running-work tests measure the fills' rate on a queue of
  its own, so the B queue's expected run stays its first fill's.
- Every place that sums the group ends counts the new end, and frame_costs prints it.

Docs: group.rs and unshared_hold.rs module docs, the grouping FAST-PATHS row (its bound and its
cost line), and WorkCounts::group_ends_long.

Verified in the lane (m3-max-34508, tip 37b1ca8563): clippy -D warnings with m2v_cpu_icd, runtime and
validation, all targets and features. Still running when landed: lavapipe tests (group_run, the
grouped lane, unshared_hold, submit_check_device, kernel_end_device, commit_and_submit,
queue_share_device, frame_costs), clippy plain and m2v_gpu, rustdoc, and the 780M before/after.
Expected, unverified: conformance cost records' grouping counts (not the cases' own, never gated)
may drop in cases that commit on fresh queues.

API: adds the field WorkCounts::group_ends_long (additive; api_signatures blessed at landing).
2026-11-15 18:29:57 -08:00
Anees Iqbal 7ed19b94bb 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-15 18:26:23 -08:00
Anees Iqbal 0ac105376c Parked images: a device-test hook for the parked cap; the shadow bench in 2 MiB pages with an unparked arm
What: Device::park_dma_buf_images_at_most (crate device tests only) sets how many images the
device parks, as keep_resident_host_imports sets the residency's most. 0 parks none: an
in-place image then goes with its import, as before parking. The default stays PARKED_MOST, so
behaviour is unchanged. dma_buf_parked_images checks that path: with the cap at 0, a used and
dropped texture parks nothing, and its image's import is freed.

texture_shadow_bench: each RAM is written through a 2 MiB-aligned shared mapping of the whole
memfd, advised MADV_HUGEPAGE as QEMU advises guest RAM, or MADV_NOHUGEPAGE for a labelled 4 KiB
arm. Every buffer arm runs over both, and the bench prints shmem_enabled and each RAM's
ShmemPmdMapped as evidence of the pages it got. A third arm, unparked, runs the in-place cycle
with the cap at 0 as the same binary's "before".

Why: the 4 KiB-page bench overstated the kernel's per-page import cost about 10x against guest
RAM, and the parked change needs a same-binary before and after.

Verified in the lane (msi job m3-max-34459, tip b4576231cf): clippy -D warnings plain, m2v_cpu_icd and
m2v_gpu and rustdoc of the runtime, all targets and features; lavapipe tests::dma_buf_parked_images
passed (made 5, parked 6, taken 2, missed 5, released 4; the source asked 5 times for 7 textures).
Negative control (m3-max-34461, take_parked answering None): the test failed at "the image taken
after its move rests in GENERAL, no move noted". The PHOENIX bench runs after landing.
2026-11-15 18:25:41 -08:00
Anees Iqbal 45e7a1edeb 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-15 18:24:21 -08:00
Anees Iqbal 09a3f0505b RUNTIME 2404: Runtime: render encoders over one target continue one render pass instance
What: a render encoder whose pass recorded its one instance inline, touched nothing but its
attachments, and records nothing after that instance leaves it open in its group's tail. The
next render encoder whose first instance renders the same subresources through a compatible
render pass and loads every attachment keeps its draws, and at its first split or its end records
them into that instance with no end, barrier or begin between, joining the group; else it closes
the group and begins its own. Rasterization order inside one subpass orders the later draws'
attachment accesses after the earlier ones', as Metal's load after store does. Counted:
WorkCounts::render_passes_continued.

Why: a glass-panel frame of 107 render encoders over one target spends its GPU time in
per-encoder boundaries: on the Iris Xe about 50 us per boundary (23 pass + 15 barrier + 12
command buffer), on the 3090 a frame of one encoder costs 0.59 ms against 1.39 ms with
plain encoders (about 7.5 us per boundary). Folding and carrying across fences did not move the
glass mix; continuing the pass removes the boundary itself.

Also: walk_costs / walk_glass_frame (runtime lane, ignored by default) measure a glass frame of
107 encoders by recipe and the forms that take a plain encoder's GPU cost apart.

Verified in the lane (m3-max-34473, tip 7ab5efb5f0): the runtime lib test build, and on lavapipe the
render_fold, draw_again, inline_splits, inline_continues, snapshot, attached_read and
leading_snapshots suites, 69/69. Expected, not yet run: the 780M and Iris A/B, a negative
control, clippy x3 and the full runtime suite; the lane runs them after landing.

API: adds the field WorkCounts::render_passes_continued (additive).
2026-11-15 18:22:08 -08:00