Commit Graph
6026 Commits
Author SHA1 Message Date
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
Anees Iqbal b650408113 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:18:40 -08:00
Anees Iqbal 1acb205fb0 RUNTIME 2403: Runtime: a command buffer whose timestamps read unavailable after its queue passed it fails as Metal's victim
What: in complete_seen, a command buffer that would complete with no error, but whose own
timestamps read unavailable (Stamped::Read(None)) once its queue's timeline passed its last batch,
now fails with GpuRecoveryVictim. Its GPU times read 0, the new WorkCounts::unrun_command_buffers
counts it, and nothing counts against its queue. Its host-page logs hear of it as of a failed
command buffer.

Why: Linux's amdgpu ends a job past its timeout (2 s by default) with no error RADV reports. On a
Radeon 780M (Mesa 26.2.6, Linux 7.3.3) a 3.2 s fill was ended, and the command buffer queued
behind it on the same queue never ran, yet both completed with no error. Read-only from Mesa
26.2.6:
- radv_device_check_status checks only OpAbortKHR;
- syncobj waits pass no fence error;
- VK_KHR_device_fault reports only GPUVM faults and shader aborts (radv_device.c:2145).
The timestamps are the documented signal. A signal's first scope holds "all commands that occur
earlier in submission order" (Semaphore Signaling), and "a query is made available by the
operation of ... vkCmdWriteTimestamp" (Queries). So a query read unavailable after the signal was
never written. The completion turn already reads both queries with availability: the check adds
no Vulkan call, one comparison.

Docs: gpu_time.rs, the GpuRecoveryVictim and WorkCounts docs, the runtime README's lost-device
section, and two FAST-PATHS known gaps:
- work a driver drops is found only where the command buffer writes timestamps (not with host
  GPU times, MoltenVK on Apple's GPUs, a family of no timestamp bits, no free slot, or an
  adopted device);
- amdgpu's 2 s default job timeout fails a single command buffer that Metal's longer watchdog
  runs.

Test: tests/dropped_work.rs injects the unavailable read (completion::trace::unstamp_of), with no
GPU hang. A command buffer whose stamps read as written completes and counts 0. The injected one
fails as GpuRecoveryVictim with GPU times 0 and counts 1. The queue's next command buffer
completes and its fill lands.

Verified in the lane (m3-max-34463): clippy plain, m2v_cpu_icd and m2v_gpu and rustdoc of the runtime; lavapipe
35/35 incl. tests::dropped_work (injected unavailable stamps fail the command buffer as GpuRecoveryVictim; the
queue's next command buffer completes), gpu_time, device_recovery, completion and stall.

API: adds the field WorkCounts::unrun_command_buffers (additive; api_signatures blessed at landing).
2026-11-15 18:17:58 -08:00
Anees Iqbal dcd5b6fc96 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:10:43 -08:00
Anees Iqbal 3442c96054 RUNTIME 2402: Park an in-place dma-buf image with its import for the next texture over the same pages
A texture in place over a no-copy buffer's dma-buf pages made a new
DRM_FORMAT_MOD_LINEAR image and a dedicated import of a new udmabuf of its
pages each time, so the kernel pinned and mapped every page again and the
first submission waited for the page tables: on the Radeon 780M an 84 MiB
texture took 1.4 ms to make and its first command buffer 7.1 ms against
2.2 ms over the device's own memory, every frame for a guest that remakes
its texture over the same pages.

As such an image goes (its texture and every command buffer that used it
gone) it now parks, VkImage and import, under the HostImport of its pages,
keyed by its plan, its texels' address among the pages, pitches and memory
type (dma_buf/parked.rs). The next texture in place over the same pages
tries each plan in its usual order and takes a parked image of that plan at
its texels before asking the source. An image whose first move ran rests in
GENERAL on our queue family (spec 12.10, 7.7.6: ownership stays with the
acquiring family; 7.9: host writes are visible to later submissions), so
the taken one notes no move; one never moved notes the same acquire a new
image notes. Not parked: images whose VkImage was handed out, the in-place
check's, rebind or detach replacements, past 64 per device.

Parked images are released by the residency thread after IDLE (2 s), count
as one listed import each against RESIDENT_MOST (released in park order
among the releasable imports' groups), go on host_range_remapped over their
buffer's bytes, and go with the HostImport before its deallocators.

WorkCounts: dma_buf_images_parked, dma_buf_images_taken,
dma_buf_images_missed, dma_buf_images_parked_released (api_signatures
blessed). New device test tests/dma_buf_parked_images.rs.

Verified in the lane (m3-max-34434): clippy -D warnings of the runtime, all targets and features; on lavapipe
(m2v_cpu_icd) tests::dma_buf_parked_images (6 textures over one buffer: 4 images made, 6 parked, 2 taken with
no source call and the CPU's later bytes, equal to a fresh image's; released on host_range_remapped and with the
buffer), dma_buf_plane_offset and host_residency's releasable-import test. The PHOENIX bench follows.
2026-11-15 18:09:55 -08:00
Anees Iqbal 825997e49c 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:08:51 -08:00
Anees Iqbal a9ebe9154b RUNTIME 2401: Draws again keep only a key's own pipeline, never its general form's
A draw whose key's own VkPipeline is still being made draws with its general form's
(begin_graphics_pipeline returns Made with own false), and render.rs kept such a draw to draw
again: its draws again then recorded through the general form after the key's own was made. In
builds with debug assertions a draw again also takes every step, which found the own pipeline
made, and draw_again's check panicked ("a draw again kept another draw: its [\"made\"] differ").
Since RUNTIME 2398 the Iris Xe's profile keys a storage view bound at offset 0
(RangeAtBindOffset), so every first draw of a state with such a slot differs from the creation's
general form there: the consumer's Iris leg (m3-max-34406) panicked in 7 of 2256 graphics tests,
by timing. Release builds drew correct pixels (the general form reads at the residual, which the
binder writes for every form) and only missed the own pipeline while the draw stayed kept.

The draw's lookup now carries whether its pipeline is the key's own (a shape memo hit is: the
memo keeps only a key's own), and a draw is kept only where its pipeline is made and its own;
else it keeps nothing and counts under draws_unkept_making, as the draw-again tests' docs
already said ("a draw recorded against a making, or of a residual form, keeps nothing").

Test: uniform_bind_offsets' a_draw_through_its_general_form_keeps_nothing draws cof_device (a
vertex device buffer at offset 0) four times in one encoder, the first with the pool held: on the
workaround's profile the first takes the general form and keeps nothing, the second takes every
step through its own, the third (checked) and fourth draw it again; elsewhere the first is kept.
Without the fix its first draw again panics there.

Regression of RUNTIME 2398 on the Iris Xe: the consumer's Iris leg (their m3-max-34406) panicked in 7 of 2256
tests at draw_again.rs "a draw again kept another draw: its made differ"; their 780M leg passed. Release
drew correct pixels (the general form reads at the residual). Verified in the lane: clippy 0 (m3-max-34437);
the lavapipe suites and the Iris run with a negative control follow from the lane.
2026-11-15 18:08:08 -08:00
Anees Iqbal af372e849c Lane busy work: one GPU job stays under the kernel's timeout; host copies past the window ask again
What: the runs behind running work (behind_running_work, behind_another_queue_s_handler,
behind_a_kept_signal) calibrate A's fills by the GPU's time of the calibration command buffer
(first_use::gpu_took) instead of its commit-to-completion wall time, and cap every stretched A
(and behind_a_kept_signal's long B) at A_MOST, 1 s of GPU time at the measured rate. A stretch
past the cap repeats at the cap. Each run writes a GROUPED-A line with A's fills, the time they
take at the calibration's rate and A's GPU time.

Why: round e8d0bfc33c's PHOENIX lane leg 2/4 (gem10, m3-max-34259) failed
a_held_group_goes_before_another_queue_s_submission_handler_runs with "buffer 0: bytes off its
fill: left 4096": all four command buffers completed with no error, yet B's whole fill was never
run. A ended before Y's handler in runs 1 to 3, so the loop doubled A to 8 times its calibrated
fills, one kernel job. At 17:18:48 the node's kernel logged "ring gfx_0.0.0 timeout ... Ring
gfx_0.0.0 reset succeeded", naming a metal2vulkan_validation process. amdgpu's default job
timeout on that kernel is 2 s (Linux 7.3.3-cachyos, modinfo: "lockup_timeout ... default:
2000"; no override on the command line). The reset ended A and dropped B, which A's context had
emitted behind it; RADV 26.2.6 reported neither (radv_device_check_status checks only
OpAbortKHR, and the kernel did not refuse the context's later submissions: X and Y ran).
Measured on a Radeon 780M (um790, same kernel, m3-max-34394): one 128 MiB fill takes 2.09 ms of
GPU time; A of 192 fills took 0.39 to 0.45 s, of 384 fills 0.80 s, so 8 x 192 fills is about
3.2 s, past the timeout. The wall-time calibration also stopped at 4 fills (12 or 24 returned,
28 to 50 ms of GPU work) in 3 of 10 quiet runs, where the others took 192: the first
calibration command buffer carries first-use costs, so a short A ends early and the loop doubles.
Windows' default TDR is 2 s too, so the cap is half of it.

Not a regression of c218071502..e8d0bfc33c: both shas passed every run of m3-max-34394 (3 quiet,
1 at stretch 2 and 3 beside 8 busy CPU threads and lane partition 2/4, each), with no stretch
past 2 and no ring timeout.

Test: a_stretched_command_buffer_stays_within_its_job_bound (no GPU) asserts that every stretch
the loops reach keeps one command buffer within A_MOST at the leg's measured rate (192 fills at
2.09 ms), where 8 x 192 fills would take about 3.2 s, and that a calibration already past the
bound is cut to it. It fails without the cap.

first_use: a host copy whose busy window the host outlasted is asked again

What: shared_textures_copy_on_the_host_while_the_gpu_is_busy runs each storage mode's calls
through busy_premise's until_premise_held, as device_copies' did_modify_range steps do. Each try
makes a new texture and new busy work, checks its bytes and the copies' counts on every try, and
where the busy work's end mark turned before the calls (or, for copies on the host or the staging
queue, before they returned) writes a LANE-BUSY-MISS line with the time to the busy work's
scheduling, each call's time and the busy work's GPU times, and tries again, at most 3 times. A
copy that waits for the busy work misses every try and fails with each try's times, as before.

Why: round e8d0bfc33c's PHOENIX lane leg 2/4 (gem10, m3-max-34259) failed it with "Ok(Shared) on
AMD Radeon 780M: a host copy waited for the busy work (get_bytes 139.749us, replace_region
666.597us)": the end mark read 0 right before the calls and ENDED after a get_bytes of 140 us.
The calls did not wait for about 2 s of busy work; the test's thread was held past the busy
window between the check and the call, in a leg at its 3 GiB memory limit (peak 3.0 of 3 GiB)
while a virtual machine booted on the node. The test passed at both e8d0bfc33c and c218071502 in
every run of m3-max-34394 (Radeon 780M on um790: 3 quiet runs, 1 more and 3 beside 8 busy CPU
threads and lane partition 2/4, each), its calls taking 20 to 222 us; the miss did not recur.

docs/VALIDATION.md and busy_premise.rs name the test beside device_copies.

Verified in the lane: lavapipe 10/10 (m3-max-34415, GROUPED-A stretch 1: 48 fills, 447 ms of GPU, cap 1 s) and
clippy under m2v_cpu_icd 0; the m2v_gpu archive built (34416). Not a regression of c218071502..e8d0bfc33c:
both shas pass quiet and loaded on PHOENIX (m3-max-34394), and the red leg's ring timeout followed the
stretch to 8x (~3.2 s in one job, past amdgpu's 2000 ms lockup_timeout). PHOENIX run follows.
2026-11-15 18:03:50 -08:00
Anees Iqbal 28aaeb2721 heap_trimmed's docs: the wide chain's free heap on the Radeon 780M, measured alone
70409f0ea2 gave RADV's free heap for the 20,000-step, 600-live chain as
an extrapolation from the 40,000 and 80,000 rows (about 1.4 times the
trim floor). Measured, the kernel made alone in a process of its own on
the Radeon 780M (RADV, Mesa 26.2.6; probe archive of scratch 648efdb10f,
job m3-max-34324): 345,583,872 bytes free after its first making, 1.6 s,
a trim after each of its two makings. The docs now say that: 346 MB,
1.3 times the floor.

Verified: cargo fmt; comment only. The lint job follows.

Verified: clippy plain, m2v_gpu and m2v_cpu_icd and rustdoc of the runtime crate passed (m3-max-34352).
2026-11-15 17:43:44 -08:00
Anees Iqbal cc1d619c7a heap_trimmed takes ANV's stage-bound refusal of the long chain; the wide chain is 20,000 steps
On the Iris Xe (ANV) the test panicked at its first kernel: the long chain
(320,000 steps, 64 live) weighs 320,038, past COMPILED_STAGE_WEIGHT
(99,109), and the device refuses it honestly (Unsupported { StageSize,
DriverDefect(CompilerMemoryGrowsWithStageSize) }, rounds ef313200e2 and
c218071502, leg iris:gputime). The shapes NVIDIA's compile frees past the
trim floor are all past that bound (the module's table: 303 MB at
240,000 steps, 189 MB at 80,000 with 600 live), so no long chain serves
both.

The test now goes by the device's answer: state() returns None only for
that exact refusal, whose symbol names an entry weight past its bound;
every other error fails the test. trims > 0 and the resident bound stay
asserted on every device, so some in-bound kernel must trim on ANV.

A probe (scratch 648efdb10f, never landed; Iris job m3-max-34234), each
shape made once in a process of its own, free heap from mallinfo2 after
the making: 20,000 steps at 600 live freed 794 MB in 145.7 s (peak 3.0
GiB); 40,000 and 80,000 at 600 live did not finish their first making in
240 s; 96,000 at 64 freed 289 MB in 160.9 s at a 7.2 GiB peak. So the
wide chain takes 20,000 steps: three times past the floor on ANV, and on
RADV, at about 18.6 KB a step at 600 live (739 MB at 40,000, 1,506 MB at
80,000 on the 780M), about 1.4 times; NVIDIA's trim comes from the long
chain, and the shorter wide chain halves its time there. The test line
now prints the free heap after each kernel's first making and each
kernel's time, so every device's run shows its premise.

Verified: cargo fmt. The build, clippy and the runs on the Iris Xe, a
PHOENIX and an NVIDIA GPU follow.

Verified: the test passed on the Iris Xe (m3-max-34319: the long chain refused past the stage bound,
the wide chain 4 trims, 372 s), the Radeon 780M (m3-max-34316, and the wide chain alone trims 1.29x
the floor, m3-max-34324) and the RTX 5080 (b5080 entry trimiris-heaptrim-173211); clippy under
m2v_gpu 0 (m3-max-34306).
2026-11-15 17:40:26 -08:00
Anees Iqbal 45af992f33 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 17:39:13 -08:00
Anees Iqbal 0427b71281 RUNTIME 2400: Uniform views keep their residual form where storage views read at their bind offsets
On the profile that takes DriverWorkaround::PushReadsLengthenThreadPayload (ANV, Mesa 26.2.6,
Iris Xe RPL-P) the runtime read every view at its bind offset, a uniform view's included. A
uniform view read so compiles there to a constant-cache block read (send.hdc_ro
oword_block_read:owords4, job m3-max-34232) in place of the untyped read the residual form takes,
which cost about 18 us a dispatch more than the push word it saved. Now the device reads its
uniform views at their residuals, as on every device without
DriverFact::ConstantOffsetUniformReadsPreloaded, and the plan keeps the storage views' key:
reads_views_at_bind is the fact's alone again, and the plans and dispatch regions take
uniform_residual_form (each uniform view's RangeAtBindOffset at 0, a storage view's as the plan
gives it), which is residual_form wherever no storage view declares the key. Runtime only: no
translation output moves.

Measured on the Iris (job m3-max-34275, dispatch_chain, 4480 groups of 256, 200 dispatches a
command buffer, 7 interleaved rounds, medians in us a dispatch; every run checked its words):

  arm                   base f4082938de   landed d3b1dbdbe0   this change
  binds 1, serial            120.15             55.90             55.84
  binds 1, raw-barrier        55.74             55.75             55.75
  binds 4                    142.71            161.78            142.77
  fixed                      143.19            161.77            143.17
  moved                      143.10            165.23            143.04
  tex                        119.63            128.29            119.40

The storage-only kernel stays at raw speed, and every other arm is within 0.25 us of base.

Tests: general_form's a_plans_key_zeroes_its_uniform_views_and_keeps_its_storage_views (the
uniform-only residual form keeps a storage view's constant, the residual form zeroes both);
pipeline's every_committed_driver_reads_its_uniform_views_at_their_residuals again; and
uniform_bind_offsets' two kernel creation tests now key the kernel's own pipeline where its
output, a storage view bound at offset 0, declares the key (keys_its_own), on the workaround's
profile as on a device with the fact. Docs: residual.rs, the workaround's doc, the bind state's
uniform_views_at_residual, and docs/API.md.

Also: the test suites follow the Iris Xe's new workaround (its profile fingerprint differs from the
UHD 770 RPL-S by it; the stage-bound test's reference profile). Verified in the lane: clippy for
metal2vulkan and the runtime, all targets and features (m3-max-34321); the Iris run of
uniform_bind_offsets and inline_continues follows from the lane.
2026-11-15 17:38:32 -08:00
Anees Iqbal a50148491b Runtime lane: heap storage reads by the formats' bits without the feature
What: runtime_lane/heap_storage_reads.rs makes the cfg's device without
shaderStorageImageReadWithoutFormat (withheld) and runs a kernel that
reads an argument buffer's read_write texture into a buffer and writes
(1, 0, 1, 1) back through the same handle, for the six float read-write
tier formats and BGRA8Unorm, RGB10A2Unorm, RG11B10Float. Each read is the
uploaded texel where the heap's view has STORAGE_READ_WITHOUT_FORMAT and
zero where it lacks it (asserted never for a tier format); each write
stores its bytes either way; the validation layer reports nothing.

Why: device evidence for the bits-alone route (lavapipe with the feature
withheld; the Iris Xe as it is, where the three non-tier views lack the
bit).

Verified: lavapipe with the feature withheld (m3-max-34302): 3/3 lane tests, the six tier formats read
their uploaded texels and every write stored, no layer report; clippy under m2v_cpu_icd 0. The Iris
run (m3-max-34313) follows from the lane.
2026-11-15 17:32:00 -08:00
Anees Iqbal bffeca8021 Re-bless the golden hashes and fixture expectations at SEMANTICS 2129
The heap storage-read change (4a06ce915d) moves 52 rows: the heap fixtures' modules on every profile
(48 cells each on most), and the a8r_buffers expectations, now translated on the profiles that read by
the formats' bits. Blessed on the M3 at a3c1f190cb (m3-max-34299: inventory, golden hashes and
printouts 0). Merged-tree clippy, plain and m2v_gpu, passed at a3c1f190cb (m3-max-34300).
2026-11-15 17:30:08 -08:00
Anees Iqbal a3c1f190cb 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 17:26:42 -08:00
Anees Iqbal 4a06ce915d SEMANTICS 2129, RUNTIME 2399: Heap storage reads by the formats' own read bits on a device without the feature
A compute pipeline that reads a read_write argument-buffer texture was refused
Unsupported{ArgumentBufferTextures, needs ShaderStorageImageReadWithoutFormat}
on a device without shaderStorageImageReadWithoutFormat (ANV on Gfx12.0, the
Iris Xe), so the guest's work waited on a nil pipeline. Vulkan 1.3 and
VK_KHR_format_feature_flags2 enable the SPIR-V capability
StorageImageReadWithoutFormat, and a read of a view without a format is then
valid wherever the view's format has STORAGE_READ_WITHOUT_FORMAT_BIT (spec
19.9.3, VUID-vkCmdDispatch-OpTypeImage-07028). The slot path already took
that route; the heap path checked the feature alone.

- declare_heap takes a storage (and storage texel buffer) read by the
  feature or by the formats' bits (DeviceProfile::storage_reads_by_format_bits),
  and on such a profile needs the read bit of the class's neutral, which a
  null handle reads.
- The binder keeps each storage view as before (writes unchanged). On such a
  profile, a member whose view's format lacks the read bit is held for its
  writes and flagged (new entry flag FLAG_STORAGE_UNREADABLE, bit 28: the
  texel-class field narrows to the 12 bits its indices use), and a storage
  read through its handle reads the null element, as a nil texture's read
  does. A member of one of Metal's read-write tier formats, whose read
  Metal's contract defines, is refused without the bit instead.
- handle_entry_flags takes the profile (the flag is the device's).

On the committed Iris profile every Metal read-write tier format has the
read bit; RGB10A2, BGR10A2, RG11B10Float, BGRA8 and the 16-bit packed
formats do not (Mesa's isl: no Gfx12.0 typed reads).

A read-write tier format whose view lacks the bit is not refused at the member (binding runs for
every shader-writable texture of the runtime's device-wide heap, so a refusal there dropped the
texture's writes on a profile such as roadmap-2022, job m3-max-34236): lower::texture::slot::
declare_heap refuses the function that reads a heap storage class where any tier format would be
held in that class through a view without the bit, naming each view's bit; the member is held for
its writes, flagged. Docs: API.md accepted difference, FAST-PATHS known gap and device-gap row,
REFUSALS.md.

Verified in the lane (m3-max-34272): clippy -D warnings for metal2vulkan, metal2vulkan-runtime and
metal2vulkan-validation, all targets and features; nextest over the heap, handle, storage, profile,
fast_paths, without_format, texel_class and tier tests plus api_signatures, refusal_surface and
api_surface: 317 passed. A synthetic Iris profile with RGBA16F's read bit cleared refuses the
reading kernel naming that format; the committed Iris compiles it. The lavapipe lane with the
feature withheld and the Iris run follow from the lane.
2026-11-15 17:26:02 -08:00
Anees Iqbal a79d16b428 Re-bless the golden hashes at SEMANTICS 2128
The ANV at-bind workaround (d3b1dbdbe0) re-keys the intel-irisxe-rplp-anv profile (fingerprint
6d95bb254f9f9d66 -> 2f820bef4bfb9669). Blessed on the M3 at 726532bd21 (m3-max-34227: inventory,
golden hashes and printouts 0); every changed cell (1939 rows) is in that profile's column, no other
profile's cell moved.
2026-11-15 17:11:33 -08:00
Anees Iqbal 726532bd21 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 17:08:25 -08:00
Anees Iqbal d3b1dbdbe0 SEMANTICS 2128, RUNTIME 2398: Buffer views read at their bind offset where a pushed word lengthens every thread's payload
On ANV (Mesa 26.2.6) on the Iris Xe RPL-P, a compute function that reads a client push word
gets a longer per-thread payload (the base workgroup id moves 17 registers further), and a
light kernel runs about 2.2 times as long: 120.2 us against 55.7 us a dispatch on the same
module with the push read removed (raw Vulkan chains, jobs m3-max-34063 and m3-max-34038).
The 780M (RADV) shows no such gap (m3-max-34031). The runtime's storage views read their
SlotBindOffset residual on every access, so every kernel paid it there.

A measured DriverWorkaround row, PushReadsLengthenThreadPayload, on that driver and GPU:

- the translator declares SpecKey::RangeAtBindOffset for storage views too on that profile
  (access plan's storage_at_bind; the pulled vertex fetch of a shared slot folds its residual
  under the same key), so a key at 1 reads no push word once the driver folds it;
- the binder sets a storage view's key only at bind offset 0, where the runtime tells offset 0
  apart at the slot (StageTable::zero_offset_views, class ZERO_OFFSET_CLASS), and only where
  instantiation's range starts there (starts_at_bind), so the bytes before a bind offset stay
  reachable through the range from the buffer's start at every other offset;
- the runtime keeps the zero-offset slots beside the uniform ones (AtBindViews), leaving out a
  slot once it is bound at another offset, and reads views at their bind offsets on that
  profile (reads_views_at_bind), the uniform views' existing form included.

Every other profile declares no new key and its modules are unchanged; its stage tables leave
zero_offset_views 0, so its shapes and plans are as before.

Also a FAST-PATHS known gap: on the Iris Xe, kernels over exportable or host-pointer-imported
memory run about 2.2x (125.53 and 122.95 us against 55.73, m3-max-33760), cause unobserved;
zero copy stays.

Tests: engine_access (a storage view's module at key 1 reads no SlotBindOffset, at key 0 it
does, answers on the interpreter; no key on the other profiles), the binder's offset-0 rule and
class, the committed profiles' form choice, and a runtime device test of a storage view at
offset 0 and past it.

Verified in the lane: touched tests in msi jobs 34174/34198 (engine_access, bind::, fast_paths,
api_signatures, the runtime pipeline and argument_table tests); lavapipe m2v_cpu_icd 21/21 (34190:
uniform_bind_offsets and the new storage test, answers at offset 0, past it and at 0 again); clippy
plain 0 (34198), m2v_cpu_icd and m2v_gpu 0 (34200); rustdoc 0 (34213). golden_hashes reads stale only
for intel-irisxe-rplp-anv (re-keyed: 1788 cells, fingerprint 6d95bb254f9f9d66 -> 2f820bef4bfb9669); no
cell under an unchanged key moved. The table is re-blessed on development.
2026-11-15 17:07:41 -08:00
Anees Iqbal 244fa02286 SEMANTICS 2127, RUNTIME 2397: Generic pointers move with whole-struct copies of thread memory
A generic pointer stored into a thread struct that a constant-length memcpy or memmove copies
to another alloca was refused as GenericPointer(Memory) when loaded from the copy: the generic
pass counted every copy into a cell as a write of other bytes over its slots. A struct holding
a generic table pointer, copied whole into each callee's argument object, hits this.

canon::generic::cells now has slot copies, mirroring the memory plan's: a copy of a constant
length between two allocas at constant offsets moves each source slot the copied bytes hold
whole to the destination slot at the same distance, along chains of copies, and the
destination slot takes the source slot's pointers in the plan's union-find (nullness flows
from source to destination). It is a slot copy only where neither cell has a generic access
at an unknown offset, no slot straddles either end of the copied bytes, every destination
slot inside them is a moved one and the source is not open; any other copy still writes its
bytes, and a copy from an open cell opens its destination as before.

Tests (canon::tests::generic_pointers): a struct holding a generic pointer, 7 and null copied
whole, and copied on again, is loaded as the device pointer stored with its queries answered;
a copy that splits a slot, and one into a struct read at an unknown offset, still refuse as
Memory.

Verified in the lane: a negative control with generic.rs, generic/cells.rs and generic/plan.rs at their
base refuses the whole-struct copy test while the splitting and unknown-offset test still passes
(m3-max-34173); clippy in all three configurations, rustdoc and the metal2vulkan-air suite 572/572
(34187, 34188). A release linked census of 265 system kernels (34178): 244 translate (was 234),
slowest 1.20 s, largest 198.8 MiB.
2026-11-15 17:02:04 -08:00
Anees Iqbal e8d0bfc33c heap_carried_reads: a heap shadow's decode expectations follow its twin
runtime_lane::heap_carried_reads::a_heap_s_carried_textures_read_as_outside_a_heap failed on the
Iris Xe (round c218071502, iris_lane_1_2): for ETC2RGB8 at Metal's heap answer, "two reads in one
command buffer, shadowed true: Counted { copies: 1, decodes: 0 }" and "a sample after
replaceRegion decoded nothing". ANV samples ETC2 itself, so that texture is a shadow of the heap's
bytes with no twin ("twin none" in its HEAPDECODE line). The test took every shadow to have one: it
asked decodes == copies of the reads and a decode after replaceRegion. Its counts are the
product's rule: read x2 copies 1 (one copy in, the second encoder carrying the image), sample 1,
blit+sample 1, replace+sample 1, as the same Iris's twinned 4:2:2 shadows copy (each plus one
decode). PHOENIX and lavapipe passed because RADV and lavapipe lack ETC2, so their ETC2 shadows
have twins.

Now the case reads whether its texture took a twin (carried-decoded-twin at its making, as its
HEAPDECODE line already did). The two reads in one command buffer must take exactly one copy in
for a shadow, decoded once with a twin and never without; before, a twinned shadow passed with
any number of copies. A Shared shadow's samples after replaceRegion must show a decode with a twin
and a copy in without one. An image in the heap's memory still decodes nothing. So a second copy
inside one command buffer fails both branches. The FORMATS and module docs say ANV samples ETC2.

Verified: the test passed on the Iris Xe (ANV, m3-max-34147: ETC2RGB8 shadows twin none, read x2 copies 1
decodes 0, replace+sample copies 1 decodes 0), PHOENIX (m3-max-34145) and lavapipe (m3-max-34118); clippy in
all three configurations and rustdoc passed (34118, 34146).
2026-11-15 16:55:52 -08:00
Anees Iqbal aaeb7fa475 SEMANTICS 2126, RUNTIME 2396: Static initializers evaluate integer vectors lane by lane
A static initializer's integer arithmetic, comparisons and casts of vectors were left
unevaluated (the folder's integer folds take scalars), so a module whose initializer builds a
vector global from its function constants refused at specialization: Unsupported
StaticInitializer. MPSCore's stitchable functions are such modules (their initializer stores
<4 x i32> and <4 x i8> globals built from two ushort constants by scalar bit tests inserted
into undef vectors and a zext of a <4 x i1>), so every kernel linking them, 257 of the census's
265 refused MPS rows once linked, refused there.

Folder::lanewise applies a scalar integer fold to each lane of constant vectors of the result's
lane count; the static-initializer interpreter takes it for integer binops, icmp and integer
casts. A vector with an undef or otherwise unknown lane is still not evaluated (the module is
refused as before). SCCP's folds are unchanged: only static initializers evaluate vectors.

Test: canon::tests::static_vectors builds that initializer's shape (lanes inserted into undef,
scalar compares into <4 x i1> then zext, trunc/lshr/and of a scalar, and splat/lshr/and/icmp/
zext/trunc on vectors throughout) and checks the kernel's stores fold to the lanes' values;
a vector with an undef lane still refuses.

Verified in the lane: canon::tests::static_vectors 2/2 and a negative control without the fold
(it refuses); metal2vulkan-air clippy clean and its suite 570 passed (m3-max-34114); a release
linked census of the 265 refused MPS rows with this commit (m3-max-34128): 234 translate and pass
spirv-val, slowest 0.39 s, largest 199 MiB.
2026-11-15 16:44:14 -08:00
Anees Iqbal 44904ec1fe 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 16:43:07 -08:00
Anees Iqbal 7049627f79 RUNTIME 2395: Managed no-copy buffers: the caller's promise of zero bytes is zeroed on the device, not copied in
What: `HostMemory::with_zero_from(offset)`, a runtime extension with no Metal counterpart. The
caller promises that a no-copy buffer's bytes from `offset` to its length read zero when it is
made (a buffer its program made with no bytes, or with fewer than its length). A `Managed` one on
a device without unified memory then makes its GPU copy's bytes from `offset` to the length as
zeros the device writes in its own memory (one word-aligned vkCmdFillBuffer registered before the
making's copies in, `Buffer::zero_device_copy_first`). Only the bytes before the offset, and the
rest of the last page past the length, are copied in from the pages, so no import is held for the
zeros. New counters: `WorkCounts::managed_device_copies_zeroed`, `managed_bytes_zeroed`. Nothing
else takes the promise: a buffer that lies in its pages, a copied host buffer's first read, heaps,
rebinds, recoveries (the pages' `made_of` parts keep no promise), `did_modify_range` and
`synchronize_resource` behave as before.

Why: on a discrete GPU behind a 4.8 GB/s link, a compute workload's 131 ms GPU job was the making
copy of six new `Managed` buffers (631 MB across the bus, 12 MB of it named by
`did_modify_range`), and a 72 ms kernel wait for the imports preceded it. A guest's buffer made
with no bytes holds zero pages, which the consumer knows and the runtime cannot.

How verified: tests::managed_copy_device's zero-promise legs (through an import and over pages no
import maps): no promise, and a promise at the length, copy the pages in whole (negative control);
a promise from byte 0 over zero pages copies in and stages nothing, counts one zeroed device copy
of the buffer's bytes, reads zero, and a later did_modify_range copies in as ever; a promise from
an offset inside a word over pages that hold other bytes copies in exactly the bytes before it and
reads zero from it, which only the device's fill can have written. A buffer in its pages reads
them under the promise. The device runs are in the lane's jobs (lavapipe, which has unified
memory, runs only the in-place leg; the XTX runs the two-copy legs).
2026-11-15 16:42:22 -08:00
Anees Iqbal 48c7296fcb device_copies: a did_modify_range step whose calls outlasted its busy work is asked again
runtime_lane::device_copies::exact_answers_take_a_did_modify_range_at_the_commit failed once on the
RX 7900 XTX (round c218071502, m3-max-33927): "the runtime's, step 4: the busy work ended first".
Each oracle step commits about 2 s of busy work (8 links of 250 ms at the kernel's measured rate)
and then makes its calls; the end mark reading 0 as they return is the step's premise, that the GPU
has not run its command buffer yet.

The cause is the host, not the runtime. Host times around each act (probe jobs) show no act waits
on the GPU at ef313200e2 or at c218071502: from the busy work's first commit to the mark check a
step took 13-47 ms alone on the XTX and 5-36 ms in its lane leg 2/2 (m3-max-34065), against links
that spun 240-268 ms each (their GPU times, about 30 samples). On the RX 550 (m3-max-34044, 3 runs
of each sha) per-act times swung with the node's load, the busy work's commit from 3 to 280 ms,
equally at both shas. c218071502 passes alone and in the lane; the failure was one step in one of
8 XTX rounds, in a leg whose node's 16 CPUs also ran the RTX 2080 runtime suite, the PHOENIX
replay and lavapipe 2/4. round.py now runs one round job per node, so rounds no longer pack suites
so; this guards the nodes we don't control.

The window cannot be stretched to fit a host: its length rests on a rate measured once, and Vulkan
does not promise that a running shader sees the host's release (on the XTX alone the first link
never saw it and spun its whole cap). So a step now asserts its premise and asks again, as
device_room's with_room does for a device: runtime_lane/busy_premise.rs's until_premise_held runs
a try, and where the busy work ended before the calls returned the try still checks the bytes it
read (one of the answers allowed whatever the timing), writes a LANE-BUSY-MISS line with each
act's host time, the calls' total and each busy command buffer's GPU time
(BusyWork::gpu_span), and runs the step again with fresh busy work, at most 3 tries. A step that
misses every try fails with each try's times, so a call that waits for the GPU's earlier work
still fails as before, and the next real miss shows which side moved.

Tests: busy_premise's a_held_premise_is_tried_once, a_missed_premise_is_tried_again and
a_premise_missed_on_every_try_fails (no GPU). docs/VALIDATION.md names the rule.

Verified: m3-max-34107 (msi) clippy -p metal2vulkan-validation --all-targets --all-features -D warnings under --cfg m2v_gpu, and on lavapipe 5/5 (busy_premise unit tests x3, device_copies exact_answers_take_a_did_modify_range_at_the_commit and a_did_modify_range_reaches_the_bytes_the_next_commit_finds). Running at landing: the XTX run (m3-max-34117).
2026-11-15 16:39:22 -08:00
Anees Iqbal f4082938de artifact tests: the translator's repro writer is a default-off diagnostic, not a runtime input
RUNTIME 2366 made the runtime's FALLBACK repro bundle (metal2vulkan-runtime/src/repro.rs) use
metal2vulkan::repro (ReproBundle, ReproDevice), so the runtime's inputs reached
metal2vulkan/src/repro.rs, which is neither a listed input nor a listed non-input:
candidate::engine::artifact::tests::the_runtime_sources_are_the_committed_ones failed in the
round at c218071502 (validation, m3-max-33994). The writer acts only where METAL2VULKAN_REPRO_DIR
names a directory and its bundle changes no run's answers, as env_vars.rs's diagnostics, so it is
listed with them as reached but not a runtime input; the runtime-sources pin is unchanged.
2026-11-15 16:04:43 -08:00
Anees Iqbal ddb4bcbfaa 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 16:02:32 -08:00
Anees Iqbal f143091069 RUNTIME 2394: an owned kernel is looked up under the lock and made outside it
Device::owned_kernel held the device's owned-kernels lock across a
kernel's whole making: its module's build and its VkPipeline's
creation, which on ANV can take hundreds of milliseconds to seconds.
So every lookup of a kernel made already waited for an unrelated
kernel's compile: an encoder's rows copy, ICB reset, shadow copies and
merges, YCbCr sample and index kernels on encoding and committing
threads, ycbcr_conversion and made_ycbcr_conversion at a texture's or
a pipeline's creation; and route_counts_kernel's try_lock answered None
while any making ran, so the frame's routed draws took the region-copy
route. The pool's begin_draw_replay_kernels makes three kernels in a
row and begin_route_counts_kernel one, each a trigger.

Now the lock covers only a lookup, a settle and a Y'CbCr conversion's
creation:
- A kernel made is answered at once.
- A kernel in flight (OwnedKernels::making, one InFlight per kernel) is
  waited for: its asker waits on that making's answer alone, holding no
  turn of the budget's (budget::without_turn lends a pool piece's), and
  takes the same kernel or a clone of the same error. No second compile.
- Otherwise the asker records an InFlight, lets the lock go, takes its turn
  (program_turn: what helper_turn took once the kernel was known
  unmade), builds, makes the sampler of a YCbCr or 4:2:2 sample kernel
  under a short lock (the order and the one conversion per sampler that
  the views and the samplers baking it share, as before), and makes the
  objects. Its settle, under one lock, counts the kernel
  (WorkCounts::owned_kernels_made, as before), keeps it, and removes the
  making from those in flight, then answers the waiters. A making whose
  thread unwinds is settled with an internal error by its guard, so no
  asker waits for ever. A failed making is not kept: a later asker makes
  it again, as before.
- route_counts_kernel locks (briefly) in place of try_lock: it answers
  Some once RouteCounts is made, whatever else is being made.

keep_nothing (device/carry.rs) is a LOST generation's recovery step: the
line serves past it, its objects were carried to the new generation,
none of its command buffers records, and no work is made on it again;
it destroys the generation's owned kernels (OwnedKernels::destroy sets
`destroyed`). The only other caller of destroy is DeviceShared's drop,
which no making can overlap (a making holds a &Device). Before, destroy
waited on the lock for a making in flight and then destroyed its kernel;
now a making settled after it destroys its kernel at once and answers
Error::DeviceLost, which is what that generation is. A live device never
has `destroyed` set, so no asker on a live device that got a kernel
before gets DeviceLost now.

The test hold: it stays a field of OwnedKernels (a kernel and a Held,
the same Held type device/holds.rs holds its holders with) rather than
a Holds slot. The holds of device/holds.rs are indexed by Holder, the
runtime's own holders of a device, and are passed in holds_go_on
between a holder's steps, before a making starts, where the lock is not
held. This hold must stop one kernel's making midway (between its
module's build and its objects), on whatever thread makes it, the pool's
or a program's, and be read under the same lock as the lookup, so it is
keyed by the kernel where the kernels live.

The test grows a same-kernel check: a second asker of the held kernel
is seen waiting on its making in flight (a test-only count), the hold
has one making at it, and once let go both askers take one pipeline,
one kernel made.

Verified: at the base f310ebe9ee the test failed on lavapipe (msi job
m3-max-33983: the lookup waited past 5 s, the routes' kernel answered
unmade). This commit's runs follow in the lane's report.

Test: tests/owned_kernel_lookups.rs holds one kernel's making midway and asserts that a made kernel's lookup on another thread returns at once with the same pipeline, that route_counts_kernel answers Some, that a second asker of the held kernel waits on its making, and that the release makes exactly one kernel.

Verified: lavapipe on msi (llvmpipe, LLVM 23.1.1): at the test alone (f310ebe9ee, m3-max-33983) owned_kernel_lookups fails ('a made kernel's lookup waited past 5s for another kernel's making'; the routes' kernel answered unmade); at 2a52418bfc (m3-max-33993) clippy -p metal2vulkan-runtime --cfg m2v_cpu_icd --all-targets --all-features -D warnings 0, and 71/71 tests (owned_kernel_lookups, owned_kernel_builds, owned_pushes, rate_mapped_route_kernel, driver_pipeline_compile, the 15 teardown_threads tests, ycbcr_device, ycbcr_in_place_loop, ycbcr_refresh, described_row_copies, shadow_merge_read, surface_two_planes, icb_carry_race, rate_mapped_*, mipmap_plan). Running at landing: plain and --cfg m2v_gpu clippy, rustdoc. Not run on hardware GPUs; the stall is shown with a deterministic hold, not timed on ANV.
2026-11-15 16:01:47 -08:00
Anees Iqbal 8fee9b86f8 partial_threadgroups: the heavy kernel keeps 8 values live, not 400
ANV's compile time grows with the values live at once. At 94f9436cd8 the heavy test failed on
the Iris Xe (ANV, Mesa 26.2.6; Iris job m3-max-33948): at 10,000 steps with 400 values live a
command buffer waited past the test's 60 s WAIT for its pipelines, and the test failed at that
wait after 224.8 s. With 8 live the same driver is fast at that size: in the same job the
large-kernel test, whose chain is 8,000 steps with 8 values live, made its states' variant and
plain pipelines and passed in 3.6 s in all, and 40,000 steps with 8 live took about 52 s
(m3-max-33783).

WINDOW is now 8. STEPS stays 10,000, which keeps the kernel large by the runtime's measure, and
the test still asserts that premise (`ComputePipelineState::whole_on_partial`: `COUNTED_WORDS`
SPIR-V words or more) for each state it makes. The 400 came with the test and no measurement
chose it. The test's name and docs still say what it checks: the variant's one VkPipeline
against the split's six, with their creation times printed.

Verified at 5a39d9a75f: m3-max-33966 (msi) clippy -D warnings for metal2vulkan-runtime (all targets, all features) plain, --cfg m2v_cpu_icd and --cfg m2v_gpu. Running at landing: the heavy test on the Iris.
2026-11-15 15:51:04 -08:00
Anees Iqbal 18b14cca39 line_beside: a write beside a plane over Private memory keeps its bytes under the plane's writes
On the Iris Xe (ANV), whose GPU writes back the whole 64-byte line its writes end in, a plane's
texture at 0x20 of a Private buffer is in place for RenderTarget and ShaderWrite while another GPU
command may write the bytes beside it in the plane's first and last lines. A device test
(tests::line_beside, under the GPU cfgs) puts two commands with no dependency between them in one
command buffer: a render pass's clear and store, or a kernel's writes, of an R8Unorm plane at
0x20 (a buffer laid by aligned_byte and a plain one; tight rows of 1920 and padded rows of 1000
at 1024; tracked and untracked), and a blit copy or kernel stores into bytes 0x0-0x1f and the
bytes after the plane's last texel to the end of its line; it reads the buffer back. A control
leaves the second command out and must count every one of its bytes lost.

docs/FAST-PATHS.md's Iris known gap now says the line write-back holds over the runtime's own
memory as over host pages (the check's Pooled, ExportedFd and ExportedDmaBuf classes fail renders
for rows that end inside a line, m3-max-33545), and that another GPU command's bytes in the line
are kept.

Verified: Iris m3-max-33919 (ANV, Mesa 26.2.6): 0 bytes lost in all 32 cases x 3 rounds, the
controls counting exactly the left-out bytes ([32, 64], [32, 32], [32, 24], [32, 56]), 0 wrong;
lavapipe m3-max-33912 the same; clippy -p metal2vulkan-runtime --all-targets --all-features
-D warnings under --cfg m2v_gpu (33920), --cfg m2v_cpu_icd (33921) and plain (33926). The doc
commit had cargo fmt only; tests::fast_paths runs on development.
2026-11-15 15:44:07 -08:00
Anees Iqbal 94f9436cd8 partial_threadgroups: the heavy kernel is 10,000 steps, asserted large by the runtime's measure
On ANV (Mesa 26.2.6, the Iris Xe of RPL-P) the heavy kernel's 40,000-step chain took the driver
about 52 s to make with 8 values live (Iris job m3-max-33783: the first ragged grid done at
53.76 s, one VkPipeline) and more than 120 s with the test's 400, and the test makes seven
pipelines of it, so it ran for minutes there. Its compiler took about 3.2 MB of stack for that
chain (3,216,936 bytes measured), about 80 bytes for each value; the runtime now makes every
driver compile on a stack with that room (RUNTIME 2392), so the chain's length no longer stands
in for the stack guard, which tests::small_stack_device and the relay's and the pool's unit
tests cover.

STEPS is now 10,000, and the test asserts the premise that keeps it heavy by the product's own
measure: each state it makes is large (`ComputePipelineState::whole_on_partial`, the module at
`compile_memory::COUNTED_WORDS` SPIR-V words or more), so a smaller chain cannot pass the test
vacuously. LARGE_STEPS (8,000, window 8) already meets that measure, so 10,000 holds it with room.

docs/FAST-PATHS.md records the driver's time and stack as a device gap, with what the runtime
does about the stack: the pool's threads start with 8 MiB, and a call asked for on a thread with
less than 4 MiB of stack left is made on a thread of the runtime's started with 8 MiB.

Verified: an msi job's clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) and the ledger tests,
and an Iris job running tests::partial_threadgroups (the heavy test prints its ANV times) and
tests::small_stack_device from this commit's archive.

Verified at a96a3ef68d: m3-max-33936 (msi) clippy -D warnings for metal2vulkan-runtime (all targets, all features) plain, --cfg m2v_cpu_icd and --cfg m2v_gpu; metal2vulkan tests::fast_paths 34/34. Running at landing: the heavy test and small_stack_device on the Iris (m3-max-33948).
2026-11-15 15:38:35 -08:00
Anees Iqbal 911692b55d 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 15:32:11 -08:00