Commit Graph
6072 Commits
Author SHA1 Message Date
Anees Iqbal 4f35dfd6f9 The authored compile census re-blessed at 44505b3807 (executor v183)
What: corpus/authored-compile.tsv re-blessed at the pin candidate 44505b3807 (m3-max-35212): 2369
cases over 21 profiles, 49749 cells, failed 0, differences 0, regressions 0; 2016 rows take the
artifact digests of ENGINE_EXECUTOR_ABI vulkan-engine-v183 (the executor classes buffer lengths
under the device's range limits, 6e6762cf37..175706d3f2).

Why: the census currency check reads the executor version the table was blessed at (v182 until now).

Verified: census wall 214 s, slowest compile 3.3 s, peak worker RSS 234 MB; golden bless
m3-max-35211 at the same sha changed no byte.
2026-11-15 22:17:39 -08:00
Anees Iqbal 62c3708211 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 22:17:13 -08:00
Anees Iqbal 68731202fe RUNTIME 2422: The buffer recycler parks a command buffer's upload chunks whole: 1024 buffers, at most 64 of them holding their own allocation
What: the recycler's buffer bounds keep 64 MiB and a second, and now admit 1024 buffers, the bytes
bound over the upload arena's largest chunk (upload::CHUNK_BYTES), where they admitted 64. Of the
parked buffers, at most 64 may hold an allocation of their own (Placement::holds_allocation: a
dedicated block, an import of their own pages), the earliest parked of those going first past it
(one no take handed out first); the images' bounds are unchanged (32, any of them alone).

Why: a kernel's unbound written device slot takes a fresh 64 KiB region a dispatch (by design: it
may be stored through), past half the arena's chunk, so one dedicated 64 KiB VkBuffer a dispatch.
Its command buffer's chunks parked as it completed, but the count bound of 64 destroyed all but
64, and the next command buffer of 256 such dispatches made 192 new VkBuffers (the Iris probe
m3-max-35104: 34.5-41 us encoded a dispatch against 19-21 us with the slot bound or read-only,
192 VkBuffers made a round). The bytes (16 MiB) were well inside the bytes bound. Every parked
buffer that holds its own VkDeviceMemory counts against maxMemoryAllocationCount, so those stay
at today's 64: the larger count admits only buffers of shared blocks, which add no allocation.

Tests: tests::recycle_bounds (CPU, the recycler's book): 256 chunks park whole and the next 256
takes find them all, 1024 park and the 1025th evicts the earliest; 64 own-allocation buffers park
beside 100 of shared blocks, two more evict the two earliest own ones and no shared one.
tests::neutral_zeros_shared::steady_dispatches_with_a_written_slot_unbound_make_no_vk_buffer
(device): command buffers of 256 dispatches with the written slot unbound make 0 VkBuffers once
the first's chunks parked, and recycle at least 256; it prints the host time per dispatch against
every slot bound.

Verified in the lane (m3-max-35234, msi, at ee16b6d58d; each step's own exit code): clippy -p
metal2vulkan-runtime --all-targets --all-features -D warnings 0; tests::recycle_bounds 2/2;
lavapipe (m2v_cpu_icd) neutral_zeros_shared 6/6 (steady test: first command buffer 256 made, the
3 steady ones 0 made and 256 recycled each); lavapipe recycle, recycle_bounds, upload_chunk_zeros,
idle_sweep, posted_frees, fresh_pages, churn_counts, clip_bursts, managed_copy_device,
exported_textures, submit_check_device, storage_form_recycle 73/73. Still running when landed:
the Iris timing run, clippy m2v_gpu and m2v_cpu_icd, rustdoc.

New Degradation kinds: none.
2026-11-15 22:16:25 -08:00
Anees Iqbal 44505b3807 dma_buf_in_import: back to 64x32; the 5080's 615.71.09 imports a 72 KiB buffer's dma-buf dedicated too
The 5080 run of the landed fix (b5080 batch m3-max-35075, entry nvinimport-inimport-212418,
615.71.09) passed both tests (TESTS_5080=0), but the main test took the elsewhere branch: "the
buffer's pages in one import dedicated to nothing false (imports dedicated to the buffer 1); the
texture in place false: in the import 0, dma-buf images 0, their imports live 0, source calls 1".
The driver imported the 72 KiB buffer's dma-buf dedicated to the buffer as it did the 24 KiB one,
so the 64x128 size, chosen so that 615.71.09 would take the import dedicated to nothing, bought
nothing there; the module docs said it did.

The texture is 64x32 again, and the docs state what the 5080 measured: a buffer's dma-buf of one
page, or of 72 KiB, imported dedicated to the buffer alone there, though the class's check
passed over the device's own exported memory. The premise gate and the stand-in test stay.

Verified: build, clippy and the two tests on lavapipe in the job that builds this commit.
2026-11-15 21:44:39 -08:00
Anees Iqbal 175706d3f2 The executor classes buffer lengths under the device's range limits, as the runtime does
What: views_told_apart takes the device's BufferRanges and sets every stage table's
buffer_ranges to them, so the executor's bind states state the length class the runtime's
states of the same binds state (RUNTIME 2412 rounds a buffer's class under
BufferRanges::of(limits); the executor kept the defaults, which tell every class apart). The
compute, render and mesh builders (bind_state, compute_shape, graphics::bind_state,
render_shape, mesh_shape) take the ranges; the executor passes its device profile's limits
(case_compiles from the worker device, platform run/execute from the opened device), the
runtime-lane tests their compile device's, and the unit tests the defaults. ENGINE_EXECUTOR_ABI
goes to vulkan-engine-v183: every executed artifact whose plan binds a buffer changes digest.

Why: a BindingPlan states its bound length class (BoundKind::Buffer), so the runtime path's plan
digest differed from the executor's and from the authored compile census's on every device:
candidate::engine::runtime_run's parity (run.census.artifact == on_context.census.artifact)
and runtime_lane::executions' plan digest check failed on lavapipe and the Iris. With both on
the device's ranges the executions test is back to its single digest equality, and the earlier
split of compute_state for its decision-only comparison is folded back.

The authored compile census owes a re-bless after this landing (executor ABI and digests
change); it is re-blessed once, at the next pin sha.

Verification: a lavapipe (cpuicd) job runs the three runtime_run tests, executions, and the
touched engine, graphics, public_cases, argument_buffer_members, worker::compile and
runtime_lane suites, plus a negative control (views_told_apart on default ranges) that must
fail the runtime_run parity; results go to main with the job id.
2026-11-15 21:43:46 -08:00
Anees Iqbal 5328cb1149 executions: the shapes the plan check compares outlive their plans 2026-11-15 21:43:46 -08:00
Anees Iqbal 6e6762cf37 The execution record's plan check classes the executor's lengths under the device's ranges
runtime_lane::executions::the_execution_record_names_each_dispatchs_compiled_pipeline compared the
runtime's plan of its recorded bind shape with the executor's plan of the case, digest for digest.
Since RUNTIME 2412 the runtime's tables carry the device's BufferRanges, so its shape rounds each
buffer's length class up, while the executor's bind state keeps the default ranges (exact
classes), as 2412 meant, to leave executor digests and the compile census unchanged. A plan states
the class it bound (BoundKind::Buffer's length_class, for its instantiation's kind check), so the
two digests differ while every decision is the same (round 5974320352's Iris lane: runtime
[167, 4, ..] against the executor's [199, 127, ..], which was the runtime's before 2412).

The test now plans the executor's case state with each table's buffer_ranges set to the device's
(BufferRanges::of), as the runtime classes lengths, and requires that digest to be the runtime's;
and requires the executor's own plan to make the runtime plan's decisions: its variant,
specialization and descriptor writes. engine::compute_state is compute_shape's state before its
shape, so the test builds it as the executor does. Test only; the executor's shapes, plans and
artifact digests are unchanged.
2026-11-15 21:43:46 -08:00
Anees Iqbal 5e7f470da3 alias_split_device: the one-pass case compares texels only where the texture's image is linear
On RADV PHOENIX (job m3-max-35102) the one-pass case's heap texture is an optimal image, and
252 of its 256 texels read other than the buffer's bytes under them: an optimal image's texels
lie in its own layout over the memory, which Vulkan does not define, nor Metal for a heap's
aliasing resources. The case now asserts the texels only over a linear image (the buffer form
on every device, the heap form where its image is linear) and prints the rest.

Verified: the same run's buffer form read every texel right; lavapipe (m3-max-35085), whose heap
image is not linear either, matched only by its layout.
2026-11-15 21:35:43 -08:00
Anees Iqbal d822ca6ad6 grouped_submissions: behind_running_work's device takes its queue plan
The 5080 lane's red in round 5974320352 (m3-max-34982):
runtime_lane::grouped_submissions::a_command_buffer_committed_behind_running_work_is_scheduled_while_its_group_is_held
failed on the runtime's notice metal2vulkan-queue-limits-reached: "the program's command queue 2 on
a round robin of 1 VkQueue(s), took VkQueue 0, which another took, where the plan's 14 give it one
of its own: the device's queue limits (DeviceOptions::queue_limits) changed that". Those are the
lane's own limits (LANE_QUEUE_LIMITS, round_robin 1), not the driver's: RUNTIME 2405 gave
behind_running_work a second command queue (A's calibration on a queue of its own) and not its
device the plan. LANE_QUEUE_LIMITS's contract is that a test whose work places a second command
queue makes its device at the plan (at_plan), and the harness fails on the notice by design; every
other two-queue helper in the file already does. Only a family of several queues shows it (NVIDIA's
16); on the Iris, lavapipe and RADV the round robin's family has one queue and the limits change
nothing. All three callers (the plain and the consumer-carried held-behind tests, and
the_exact_completion_keeps_no_group_behind_running_work) take the fix.

The adjust calls at_plan(options), with a doc line saying why.

Verified: build and clippy in the job that builds this commit; the three tests on an NVIDIA family
of several queues (the 2080) through main.
2026-11-15 21:34:51 -08:00
Anees Iqbal 365bbd6ed0 in_place_textures: the check's report counts eight classes, DmaBufInImport among them
The Iris lane's red in round 5974320352 (m3-max-34993):
runtime_lane::in_place_textures::a_failed_check_keeps_the_shadow_and_no_record found 128 verdicts where
VERDICTS said 112. VERDICTS was seven classes x eight accesses x two row ends; RUNTIME 2409 added a
class, DmaBufInImport, and the report gives every class on every device, so it is 8 x 8 x 2 = 128.
The report in that log lists DmaBufInImport's verdicts, each Failed as the test forces.

VERDICTS is 128 and its doc names the eight classes. The runtime's PagesClass::ALL is
crate-private, so the lane keeps the count.

Verified: the lavapipe run of the test, in the job that builds this commit.
2026-11-15 21:34:51 -08:00
Anees Iqbal 1db9ad2f97 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 21:34:34 -08:00
Anees Iqbal 92a77c7025 RUNTIME 2421: Continued passes on a device that splits at aliases, where no buffer write meets their images
What: on a device whose driver has DriverFact::ImageUsesMissBufferWritesInOneCommandBuffer
(NVIDIA's 620.70.06 on the RTX 3090), an inline pass's last instance may now stay open, and
the next render encoder may continue it, as on every other device. Before it continues,
EncoderCore::continue_pass checks the group's byte writes (FoldOrder::byte_writes, the
leader's summary or the group's order) against every image the continuing pass uses:
its draws' images (AliasWrites' images noted apart), its attachments, and the uses of the
copies and steps before its later instances (render/inline_splits.rs, waiting_uses), all
of which record into the tail after what the group wrote there. Where one meets, the pass
begins its own instance in its own VkCommandBuffer, the measured form, counted in
WorkCounts::command_buffers_split_at_aliases. Where none meets, it continues and takes
the group's writes as its own (AliasWrites::continues), so what it records into the tail
after its pass is checked as a joining encoder's is.

Why: continuation cut the glass-panel frame's GPU time 11-26% on the 780M and Iris but was
off on the 3090. The open instance itself never holds a buffer write: its draws touch only
attachments, and anything else that records into the tail ends it first. The tail before
it can hold one, though (the leader's earlier inline instances and what records between
them), so the check is what the fact needs.

Also: render_fold's Lane::continuing (622368ab37) goes, since its lanes continue on every
device now. A test-only DeviceShared::aliases_split_forced lets lavapipe take the 3090's path.
New tests: tests::alias_split's continues unit test; tests::alias_split_device's count case,
a copy out of a texture after a continuation, a later instance of one pass reading an
earlier one's buffer write, and a texture over another buffer of the same host pages
(the last two are byte cases for two possible gaps on the 3090).

Also e818e7b442: Continued passes: a pass's uses of bytes count in the alias check, as an aliasing texture's are.
What: AliasWrites notes the bytes of buffers that the commands noted apart use (bytes_apart).
AliasWrites::continues now refuses a continuation where those bytes, or a Bytes use among
the pass's other uses, meet the group's byte writes, besides its images.

Why: a texture whose linear image aliases a buffer's bytes (Storage::Alias) names them as
the buffer's bytes (Texture::image_use), not as an image range. The lavapipe run with the
split forced (m3-max-35002) showed a pass sampling such a texture over bytes the leader had
just written continuing anyway: (1, 1, 1, 2, 0) where (2, 1, 0, 3, 1) was expected. A
continuation is refused rather than guessed at: a draw that reads, through a buffer, bytes
the group wrote also begins its own instance on such a device.

Tests: the count case now reads the written bytes through a texture over a buffer and

And dae7c2cad8: alias_split_device: the counted and copy-after cases read a texture over a buffer alone.

Verified in the lane (m3-max-35085, msi, at dae7c2cad8): clippy -p metal2vulkan-runtime --all-targets
--all-features -D warnings exit 0; lavapipe (m2v_cpu_icd) alias_split and render_fold 36/36; the
count test forced: written read (2,1,0,3,1), quiet read (1,1,1,2,0), unforced (1,1,1,2,0), texels
right. Still running when landed: the 3090 correctness job (alias_split, render_fold; F1-F3 byte
cases), PHOENIX render suites, clippy m2v_gpu and m2v_cpu_icd, rustdoc, the 3090 glass A/B.

New Degradation kinds: none.
2026-11-15 21:33:46 -08:00
Anees Iqbal feb99ed5db dispatch_chain: --heap's heap is tracked, so its encoders are ordered as Metal orders them
--heap placed the words and zeros in a no-copy Placement heap made with
ResourceOptions::shared(), whose hazard tracking mode is Default: a heap's
Default resolves to Untracked (heap.rs, as Metal resolves it), and so did
every buffer placed in it. Metal leaves untracked resources unordered
between encoders (the program orders them with fences), so the shapes of
several encoders over the words (encoders, blits, loads) raced: the
tracker leaves untracked uses out of an encoder's summary and the host
alias uses of the RAM's key carry the same tracked: false, so no barrier
went between the encoders, and on RADV they overlapped. xtxhost's
'encoders: word 0 is 243, not 900' (PHOENIX; 157 of 900 with --binds tex,
1210 of 7200 on the XTX) is about one increment a command buffer of six
dispatches, a race's signature; one serial encoder and one dispatch a
command buffer passed, as Metal orders those even for untracked memory.
Lavapipe and MoltenVK ran the shapes serially, which hid it.

The heap is now Tracked: Metal tracks a tracked heap's resources as one,
so the encoders over its words are ordered as the plain shapes' tracked
words are, and --heap differs from them only by the heap over host pages
(still a copy beside the RAM's import, copied-host-pages). No runtime
change.

Verified in the heaplost proof job: the bench at the previous commit
(untracked heap) and at this one, --heap --only encoders and --binds tex,
on PHOENIX and lavapipe, with the command barriers each counted.
2026-11-15 21:31:49 -08:00
Anees Iqbal b4f27d3df9 dispatch_chain: a shape's lines print before its word check
A failed word check returned before the shape's CHAIN/HOST lines and counts,
so a run that lost words showed no counts (barriers, folds, copies) to read
the loss by. Each shape now prints its lines, then checks the words; a failed
check still fails the run with the same message.

Bench only; no runtime change. Built and run in the heaplost proof job.
2026-11-15 21:31:49 -08:00
Anees Iqbal 10b4b054d4 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 21:24:01 -08:00
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