Commit Graph
3713 Commits
Author SHA1 Message Date
Anees Iqbal 3cbc726b7e RUNTIME_VERSION 2030: a dma-buf import tries the dma-buf's other memory types after its class's
NVIDIA (RTX 3090, 620.70.06) answers a udmabuf's memoryTypeBits 0x11 and refuses the import into
the host-visible type 4 the Shared class asks (VK_ERROR_OUT_OF_DEVICE_MEMORY) but takes type 0;
the import now tries the class's candidates, then every other allowed type, so no-copy buffers and
a guest RAM's chunks lie in dma-buf imports there instead of copies.
2026-11-11 05:37:13 -08:00
Anees Iqbal addc45b2e1 Dma-buf imports fall back to the dma-buf's other memory types; NVIDIA imports a udmabuf as its type 0
On NVIDIA (RTX 3090, 620.70.06; RTX 5080 Laptop, 615.71.09) every
import of a udmabuf failed, so a no-copy buffer over sourced memory on a
device that imports no pointer was a copy ("their import failed"), and a
guest RAM's chunks there were never imported (the RAM not listed, its
objects copies): host_ram_dma_buf::without_pointer_imports_a_ram_s_chunks_are_its_dma_bufs
and no_pointer_import::without_pointer_imports_a_sourced_no_copy_buffer_lies_in_its_dma_bufs
failed on both GPUs in the round at b4cd0f9f91.

Cause, from a probe on the 3090 (job m3-max-15245, branch
steelbrain/hkhostmem-2-probe, not for landing): vkGetMemoryFdPropertiesKHR
answers memoryTypeBits 0x11 for a udmabuf of a sealed memfd, types 0
(heap 1, no property flag) and 4 (heap 1, host-visible, coherent and
cached). The import into type 4 answers ERROR_OUT_OF_DEVICE_MEMORY with
or without a dedicated allocation and the device-address flag; into
type 0 it succeeds in all four forms, for one page and for 16. The
runtime asked only the class's types (Shared requires host-visible
coherent memory), so it tried type 4 alone.

Fix: import_dma_buf tries dma_buf_candidates: the class's candidates
first, unchanged, then every other type the dma-buf and the resource
allow that the runtime may allocate and that is neither protected nor
lazily allocated. The runtime never maps a dma-buf import (the CPU uses
the caller's mapping), so a type the host does not map serves it. On
drivers whose class types import the dma-buf (RADV, lavapipe, ANV) the
order and the result are as before.

The docs that said NVIDIA refuses every udmabuf now speak of a driver's
refusal; the tests' stand-in for one is unchanged.

Tests: tests::memory::dma_buf_imports_try_the_class_s_types_then_the_dma_buf_s_others
(the 3090's types). The two device tests are unchanged: they hold on
NVIDIA once its driver imports the udmabuf.
2026-11-11 05:37:06 -08:00
Anees Iqbal bcb2d3190e 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-11 05:19:32 -08:00
Anees Iqbal c7b385ad3a attachment_stand_in: the last taker's handle is CommandBuffer::finished (Finished), a name of its own
Completion is already command_buffer's completion module's type (E0255,
m3-max-15240).
2026-11-11 05:18:50 -08:00
Anees Iqbal cdc251d9a2 split_fetch_order: the fetching draw reads the second color, which holds each pass's own number; pooled takes counted by the taker's completion
The in-flight test could not see a race on the second color's pooled backing:
no draw read that color. sfo_filter now fetches it too and adds the number the
plane wrote there (the plane draw's base instance, a number per pass), so a
pass that reads what another pass left in a shared backing, or a zero, holds
other codes. The fixture is regenerated (regen-air-fixtures).

The pool's last-taker handle was a weak command buffer, which made the
queue -> pool -> command buffer -> queue type cycle deep enough that the
auto-trait checks overflowed compiling metal2vulkan-validation (m3-max-15228).
It is now the command buffer's completion gate (CommandBuffer::completion),
which holds nothing else.

Not yet run on a device.
2026-11-11 05:18:50 -08:00
Anees Iqbal cc0c2770c2 Count pooled backings taken, and those taken while another taker is in flight; run split passes in flight together
WorkCounts gains pooled_backings_taken (a pass handed a backing its queue
kept, beside pooled_backings_made for one made) and
pooled_backings_taken_in_flight (of them, those taken while another command
buffer that took the backing had not completed). attachment_stand_in's pool
keeps a weak handle on each backing's last taker to tell.

runtime_lane::split_fetch_order gains a test that runs the split passes in
flight together: each pass over a target, second color and stencil of its own,
its readback in its command buffer, committed with no wait between passes
(each as encoded, or all once encoded) on one queue or two, the targets new
(fetched through scratch) or already in their storage form (fetched in place).
Nothing orders one pass after another but the second color's pooled backing,
which the hazard tracker orders as any texture. Each round prints its passes'
wrong pixels beside the backings each was handed and took in flight; every
pixel must hold its code and the queues must have reused kept backings.

pass() is now encode_pass + encode_readback, shared by both tests.

Not yet run on a device.
2026-11-11 05:18:50 -08:00
Anees Iqbal b9b489f0f7 runtime_lane::split_fetch_order: a split pass's draws read the stencil and colors the draws before left
A device without rasterization-order color access fetches through the pixel
interlock, which leaves the fetched color out of the draw's subpass, so a pass
with plain draws around a fetching draw runs as several Vulkan render pass
instances. This lane draws one such pass of our own MSL (sfo_split_fetch): a
plane that sets the stencil, four draws of rectangles that increment it and
write codes, a fetching draw of overlapping rectangles tested on the stencil
(a map that does not commute), and a cover tested on the stencil, over a
loaded and stored BGRA8 color with a second color and a Stencil8 both
DontCare, private or memoryless, the target kept (storage form) or new each
pass (scratch), at 224x128 and 61x37. Every pixel must hold the code its
draws in order give; wrong pixels are printed with their 8x4 groups, and each
pass prints its split causes, storage forms, placeholders and memoryless
backings, and asserts a split where the fetch takes the storage form.

Not yet run on a device.
2026-11-11 05:18:50 -08:00
Anees Iqbal 58c3147007 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-11 05:13:15 -08:00
Anees Iqbal cf8467e140 RUNTIME_VERSION 2029: a fetch ordered between draws takes its barrier on every driver, no interlocked split
The MoltenVK race split (DriverFact::InterlockedDrawsRaceUnderLoad) now checks only interlocked
storage kinds; a framebuffer fetch ordered between draws takes its by-region barrier there too,
as on every other driver, instead of a new render pass instance per draw.
2026-11-11 05:12:37 -08:00
Anees Iqbal 871c5954e9 public fetch cases without an ordered form: a multisampled one may need sample-rate shading
public_framebuffer_fetch_cases_plan_input_attachments_without_an_ordered_form
failed on vk12-floor for per-sample-integer-read-modify-writes-at-4x. The
product refuses it as Unsupported{FramebufferFetch, AnyOf[[SampleRateShading]]}:
each invocation reads its own sample, which needs sample-rate shading, and
vk12-floor lacks the feature. That is the device's lack, so the test now
accepts this refusal for a multisampled case, and only where the profile
lacks SampleRateShading.

Verified: whole metal2vulkan-validation suite on lavapipe at this tip
(see the hkfbfetch-2 report).
2026-11-11 05:12:37 -08:00
Anees Iqbal 394da4cefb pipeline_selection: a fetch without an ordered form compiles, noted
The integration test a_fetch_without_an_ordered_form_is_refused expected
corpus-pipeline --profile vk12-floor --compile-only to refuse
exf_fetch_blend as FramebufferFetch. Since the between-draws form, the
product compiles it through input attachments and records
PrecisionNote::UnorderedFetchWithinDraw. The test, renamed
a_fetch_without_an_ordered_form_compiles_noted, now asserts the one row
is COMPILED and names the note. The --accept-unordered-fetch check is
gone: it guarded against a switch that compiled the fetch unordered, and
the unordered compile is now the device's only form, noted, with no
switch.

Verified: the whole metal2vulkan-validation suite on lavapipe at this tip
(see the hkfbfetch-2 report).
2026-11-11 05:12:37 -08:00
Anees Iqbal 4575273972 Fetch between draws: the barrier on every driver, and the executor's barriers
On the M3 (MoltenVK 1.4.2) the runtime lane's
fetches_between_draws_read_every_earlier_draw_and_note_the_draw_itself
counted 3 fetch barriers for 4 draws. The cause: the race split
(DriverFact::InterlockedDrawsRaceUnderLoad, held by MoltenVK on Apple's
GPUs) tested InterlockedStorage::meets, which since the between-draws form
includes the fetch kinds. So on the M3's withheld venue each draw after
the first went into a new render pass instance (Split::InterlockedWrites)
instead of after the barrier. The white write took no barrier at all, and
each later fetch took the split plus the new instance's BEGUN barrier.
That ordered the draws twice.

The race is the interlock's. The fact's measure is of interlocked storage
images, which MoltenVK encodes as raster order group 0 with no barrier
inside its Metal render pass. Input attachments ordered between draws are
not interlocked, and their barrier is by region with INPUT_ATTACHMENT_READ
in its destination. MoltenVK's MVKCmdPipelineBarrier::encode (v1.4.2, on a
tile-based GPU) ends its Metal render pass and begins another for exactly
that barrier. The split now tests only the interlocked kinds
(InterlockedStorage::meets_interlocked). The fetch kinds take the Whole
barrier on every driver: one barrier per draw, as on lavapipe and the
RX 550. The lane test now asserts (barriers, interlocked splits) = (4, 0),
(3, 0) and (1, 0). Without the fix the M3 gives (3, 3) in the first section.

The second fallout is the validation executor's planner test
a_framebuffer_fetch_case_plans_its_ordered_input_attachment. It expected a
device with neither ordered form to refuse the fetch, which the product no
longer does. The executor is a consumer of that contract
(GraphicsState::rasterization_order_attachment_access): a pipeline with
input attachments and no rasterization-order access must be ordered between
draws by a barrier of the subpass's dependency on itself.
- The executor's render pass self-dependency now covers both directions:
  color writes to input attachment and color reads, and fragment-shader
  reads to color writes (FETCH_SELF_DEPENDENCY).
- It records that barrier before each of its draws where
  fetches_between_draws holds, after the load operations too, as the
  runtime does.
- The planner tests now plan the neither device: input attachment 0, no
  rasterization-order access, neither ordered feature required, the note
  on the fragment stage. Every public fetch case on lunarg-2023 and
  vk12-floor plans the same way; a multisampled one may be refused as on
  every device.
- The executor's device test of the halving fetch expects one instance
  exact and three (one draw) each texel at some order's 2^-k on a device
  with neither form, where it used to expect the refusal.

Verified: see the hkfbfetch-2 report (M3 lane module, lavapipe whole
validation suite, RX 550 module and executor fetch test, clippy).
2026-11-11 05:12:37 -08:00
Anees Iqbal 3b9e504e85 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-11 05:11:04 -08:00
Anees Iqbal d6fe1fbd56 RUNTIME_VERSION 2028: a dma-buf texture whose driver answers another plane offset binds at the texels' offset
Where the driver lays an explicit DRM_FORMAT_MOD_LINEAR plane at another offset than asked, the
texture's image takes a plane at offset 0 bound at the texels' offset of a non-dedicated import
of the pages, where the driver requires no dedicated allocation and its alignment divides the
offset, instead of a shadow. Honeykrisp (Mesa 25.3.6, Apple M2 Pro, 16 KiB pages) answers offset 0
for every explicit plane offset; there the route reads the texels in place before and after a CPU
write (Asahi host, the plane-offset probe).
2026-11-11 05:10:23 -08:00
Anees Iqbal 68d70b6bda Tests: dma-buf import cycles of one import freed once the device is idle
A variant of the one-import cycle: its copy waited for, then each queue the
runtime submits to waited idle under its lock and its staging queue's last
submission waited for, then the buffer released, so the import's vkFreeMemory
follows a device-idle wait. For the kernel-side leak probe: whether the frees
a driver keeps are the ones that race a GPU job.
2026-11-11 05:10:16 -08:00
Anees Iqbal 82b0ce1237 Tests: dma-buf import cycles of an import released while idle and imported again from its kept dma-buf
What: tests::dma_buf_import_cycles gains the residency's way: a no-copy buffer made once, each cycle
read by a copy, its import released while idle through Device::release_idle_host_imports (as the
residency thread releases it), the dma-buf's descriptor kept, and imported again from it by the
next cycle's copy; counted (host_imports_released, host_imports_reimported) and checked freed.

Why: the consumer's guest releases idle imports and imports the same dma-bufs again, a pattern the
other ways never run, and the kernel's kept imports may follow it.
2026-11-11 05:10:16 -08:00
Anees Iqbal 94514c4cfc dma_buf.rs: the check's dma-buf class judges an image bound at its texels' offset; which drivers take one
What: the module docs say why the in-place check's dma-buf verdicts (images at their pages' first
byte, dedicated imports) cover an image whose plane starts at 0 bound at the texels' offset (the
same texels and row padding in its subresource; the bytes before the binding outside it), and
what the probe found: lavapipe (Mesa 26.2.6) takes such a binding at 64-byte alignment, RADV
(Mesa 26.2.6, PHOENIX) requires a dedicated allocation of every such image.

Verified: tests::dma_buf_plane_offset on lavapipe and RADV PHOENIX (gem10).
2026-11-11 05:10:16 -08:00
Anees Iqbal ac0fcfa7fd Docs: a texture over dma-buf pages bound at its texels' offset, where the driver answers another plane offset
What: HOWTO's dma-buf section and API.md's in-place and shadow-cause paragraphs say when a texture
over dma-buf pages takes an image of a plane at offset 0 bound at the texels' offset (a driver
that lays the explicit plane out at another offset, Honeykrisp's answer; an image that requires
no dedicated allocation, which RADV requires, and whose alignment divides the offset), counted in
WorkCounts::dma_buf_images_at_offset; WorkCounts::dma_buf_image_memories_live says such an import
is no dedicated one.

Verified: tests::dma_buf_plane_offset on RADV PHOENIX (requires a dedicated allocation: the
forced route is refused, the texture a shadow that reads its texels) and on lavapipe (Mesa
26.2.6: the forced route binds at offset 2048, in place, and reads its texels and the CPU's later
bytes).
2026-11-11 05:10:15 -08:00
Anees Iqbal 815d982c7e Tests: cycles of each way the runtime imports and frees dma-bufs of host pages
What: tests/dma_buf_import_cycles.rs (device cfgs, Linux), one test per way, each runnable alone
by name for a consumer that reads the kernel's dma-buf account before and after: a no-copy
buffer over one dma-buf import (used by a copy, and unused), over several imports bound sparsely
(one chunk per granule of the device's sparse buffers), an image's dedicated import (a texture in
place over a buffer made once), and one import released while other work is in flight on the
queue, or while its own use is (freed by that use's completion). DMA_BUF_CYCLES names the cycles
(200 by default). Each prints the imports made and freed (WorkCounts) and checks that every import
was freed and that its way ran.

Why: a consumer on Honeykrisp (kernel 6.19.14 asahi) finds the kernel keeping about a quarter of
the dma-buf imports the runtime freed; these isolate which userspace pattern does it.
2026-11-11 05:10:15 -08:00
Anees Iqbal 2e28ce467b dma-buf textures: where the driver answers another plane offset, bind a plane at 0 at the texels' offset
What: a texture over dma-buf pages whose texels lie past their first page's first byte takes,
where the driver lays the explicit DRM_FORMAT_MOD_LINEAR plane at that offset out at another
offset (vkGetImageSubresourceLayout), an image whose plane starts at offset 0 bound at the texels'
offset of an import of the pages that is no dedicated allocation, before the shadow. It is tried
only on that answer, so every driver that answers the explicit offset keeps its dedicated import;
the image must require no dedicated allocation (VUID-vkBindImageMemory-image-01445, -02628), its
memory's alignment must divide the offset (-None-10735), and the image format query must not take
dma-bufs for it in a dedicated allocation alone. Counted: WorkCounts::dma_buf_images_at_offset (of
dma_buf_images). Where it is not made the shadow's notice names both reasons.

Why: Honeykrisp (Mesa 25.3.6, M2 Pro, 16 KiB pages) answers offset 0 for a plane 8192 bytes into a
page, so every such texture was a shadow, where the owner's rule keeps textures over the
consumer's memory in place wherever in place is possible.

Test: tests/dma_buf_plane_offset.rs (device cfgs, Linux) is also the probe: it prints the driver's
answers for explicit planes at several offsets and the dma-buf features, then makes the texture by
the product's route, by the explicit plane unchecked (what such an image reads), and by the plane
at 0 bound at the offset forced on a driver that answers the offset (PlaneRoute, a test-only
DeviceShared field), each read back through a blit before and after a CPU write.
2026-11-11 05:10:15 -08:00
Anees Iqbal 43bddd649a 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-11 04:58:49 -08:00
Anees Iqbal b3532a452e RUNTIME_VERSION 2027: MoltenVK pushes set 0 for a fragment stage writing a set-0 storage buffer in its interlock
Metal leaves a raster-order-grouped device buffer unordered inside an argument buffer whose other
buffer member the function reads; MoltenVK packs a bound set 0 into one argument buffer, a pushed
one discretely. Such pipelines now push set 0 there (RuntimeDriverDefect::InterlockedBoundBuffersUnordered),
and announce interlocked-buffer-order where they cannot.
2026-11-11 04:58:08 -08:00
Anees Iqbal 88e45b574f tests::interlocked_writes: a synthetic instruction's word count is its opcode and operands 2026-11-11 04:57:58 -08:00
Anees Iqbal 95136c87e9 binds_unordered_interlocked_buffers: name the private rule it reads without a link 2026-11-11 04:57:58 -08:00
Anees Iqbal 26440eaa22 Push set 0 on MoltenVK for a fragment stage that writes a set-0 storage buffer in its interlock
MoltenVK, binding through Metal argument buffers (the state device/argument_buffers.rs reads
from the limits; a device without them is refused at open), makes a bound set 0 one Metal
argument buffer, and marks each storage buffer a fragment stage reaches inside its interlock as a
member in raster_order_group(0). Metal leaves such a member unordered where the function also
reads another buffer member of the same argument buffer. A pushed set is discrete in either of
MoltenVK's modes, and Metal orders a discrete [[buffer(n), raster_order_group(0)]].

RuntimeDriverDefect::InterlockedBoundBuffersUnordered names it, on every MoltenVK GPU (keyed on
the driver, as the push holds however the device binds). There a render variant whose fragment
stage writes a storage buffer of set 0 inside its interlock pushes set 0, read from its words
(pipeline/interlocked_writes.rs: an interlock execution mode, a StorageBuffer variable of set 0
not decorated NonWritable). PushedBufferSizesUnset stays: such a variant pushes only where no
stage reads a buffer's length (OpArrayLength, OpUntypedArrayLengthKHR) and no binding of set 0
lists a stage the pipeline adds; otherwise it binds set 0 as before and announces the new
Degradation::InterlockedBufferOrder (`interlocked-buffer-order`, precision), as it does on a
device without the push command or with a set 0 no push layout takes. Nothing is refused.

Every other path is unchanged: the device now loads the push command on MoltenVK too (and primes
it), but pushes_set_zero there admits only those variants; runtime kernels stay bound
(OwnedKernel::pushed requires pushed sets that hold their sizes); every other driver decides as
before. No new DriverFact or WorkCounts field: the lane reads draws_pushing_set_zero.

Tests:
- tests::interlocked_writes: the translator's own modules of ipo_primitive_order for the
  committed MoltenVK profile (only ipo_rog_buffer's fragment stage interlocks with a writable
  set-0 buffer; no stage reads a length), and synthetic words for each fact.
- runtime_lane::interlocked_primitive_order: a RogBuffer draw must push set 0 where the device
  pushes it (draws_pushing_set_zero), and on a driver whose pushed sets lose their sizes no other
  draw may push; a_bound_set_of_interlocked_buffers_is_announced_once, the bound form with
  VK_KHR_push_descriptor withheld, the degrade site BOUND_INTERLOCKS.
- tests::driver_defects lists the defect for the MoltenVK profile; api_signatures.tsv blessed
  (two rows); docs/REFUSALS.md regenerated: unchanged. docs/API.md: section 5's pushed set 0 and
  the catalogue entry.

Evidence so far, Apple M3 Max, macOS 27.0.1, MoltenVK 1.4.2: Metal itself, our own MSL, 96 passes
each: a raster order group buffer member beside a buffer member the function reads lost writes in
96 of 96, with the width read elsewhere 0 of 96, a texture member 0 of 96, the member alone 0 of
96; MoltenVK's own Metal for the lane's stage 48 of 48, the same with the buffer discrete 0 of 48.
Through the runtime at 83d2d86519 (set 0 bound) the lane's RogBuffer lost writes in 96 of 96
passes (m3-max-14866); with every set 0 pushed (a probe arm) 0 of 96 (m3-max-14930). The fix's
own lane run is reported with the tip.
2026-11-11 04:57:58 -08:00
Anees Iqbal 87e717bb4b ipo_primitive_order: companions of the raster order group variants
From regen-air-fixtures on the M3 (job m3-max-14818).
2026-11-11 04:57:58 -08:00
Anees Iqbal cb440b7259 interlocked_primitive_order: the same draws through raster order group 0
Beside the fetch, ipo_rog_texture and ipo_rog_buffer apply the same maps to
a texture's texel and a buffer's word of the pixel in raster order group 0,
which the translator runs in the pixel interlock as it does the fetch's
storage form. A device without the interlock must refuse them typed
(ROG-SKIP). Companions to regenerate on macOS.
2026-11-11 04:57:58 -08:00
Anees Iqbal 063c83ee1b interlocked_primitive_order: show the interlock ran by its storage placeholders
storage_forms_taken counts only a target made again with STORAGE, and the
lane's R32Uint targets have it from the start (0 on the M3, m3-max-14735).
Each pass that fetches in the interlock leaves the target out of its
subpass for a placeholder; the lane prints those attachments per target
and requires some where the device's fetch takes the storage form.
2026-11-11 04:57:58 -08:00
Anees Iqbal a10e67315a A lane measurement: overlapping fetching primitives of one draw in order
interlocked_primitive_order draws, in one draw, 64 overlapping primitives
whose fragments read color attachment 0 and write it back through one of
two maps that do not commute (ipo_primitive_order's ipo_mix), as fullscreen
triangles or as rectangles from stepped corners, one instance or one per
primitive, over 1920x1080, 64x36 and 61x37. Every texel must hold the
in-order composition; the wrong ones are printed per pass with the 8x4
groups they fall in, and the storage forms each target took. This is the
within-draw counterpart of interlocked_draw_order: the runtime records
nothing between a draw's primitives in the pixel interlock, and Vulkan
orders them by rasterization order.

Companions from regen-air-fixtures on the M3 (job m3-max-14725).
2026-11-11 04:57:58 -08:00
Anees Iqbal d23a5549b9 ipo_primitive_order: an owned fixture of overlapping fetching primitives in one draw
One fragment function reads color attachment 0 and writes it back through
3c + 1 or 5c + 3 by the parity of its primitive's number, so a draw of
overlapping primitives leaves the in-order composition only where each
fragment read what the primitive before it wrote. Companions follow from
regen-air-fixtures on macOS.
2026-11-11 04:57:58 -08:00
Anees Iqbal 27393845cb Re-bless the authored compile census at b4cd0f9f91
Its product fingerprint follows the runtime-sources pin at b4cd0f9f91 (dv-m3).
2026-11-11 04:46:16 -08:00
Anees Iqbal 91f6c94525 Re-bless the golden tables at b4cd0f9f91
What moved since 6898863f3f's bless. Blessed on the M3 (dv-m3).
2026-11-11 04:46:16 -08:00
Anees Iqbal 8de0694727 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-11 04:40:14 -08:00
Anees Iqbal 0ef9b10cf8 Error::NotInPlace: say whose making is refused
What: the variant's doc says the check's own texture's making is refused where a program's
texture would take a shadow, instead of a sentence whose subject read as the check.

Why: wording only; no code changes.

Verified: cargo fmt; rustdoc runs on this commit.
2026-11-11 04:37:26 -08:00
Anees Iqbal 54ee74469a tests::in_place_check: the notes test names the shapes lavapipe notes, one note per class and access
What: on a driver that renders an explicit plane's rows past its height (lavapipe), the test now
looks for the notes of the 20x9 RGBA32Float shape at 512-byte rows over pointer pages and over
the pooled memory (the two refusal sites, texture.rs host_shadowed and the image over the
device's memory), each naming the pitch's words and a cause that lasts, instead of a "DmaBuf
reads:" note of rows inside lines.

Why: the check notes one unmade shape per class and access and cause (lasting or passing),
whatever its row ends (in_place_check.rs check_class, `unmade_noted`), and its shapes whose rows
lie on lines run first: on lavapipe the dma-buf class's reads note is the 20x9 shape's (rows on
lines), and its unchecked reads of rows inside lines take no note of their own. The control run
at the test's first commit (21cac7f7af, lavapipe on msi-laptop) printed all 24 such notes, each
"...(a cause that lasts, kept)" with Shadow(Refused(Pitch)) for these shapes, so the lasting
causes asserted here are the ones before the fix.

Verified: the test at 21cac7f7af failed on lavapipe on its first note ("a note in words, no
\"Internal\": Pointer reads, rows on lines: ... Internal(InternalError { kind: Invariant, ... })");
this tip's run is in the report.
2026-11-11 04:30:04 -08:00
Anees Iqbal 50d2c26a33 In-place check: a texture of its own that takes no image in place is refused as Error::NotInPlace, its note in words
What: on the in-place check's thread, a texture making whose route takes no image in place
(texture.rs: host_shadowed over host pages, and the image over the runtime's pooled or exported
memory) is now refused with a new typed error, Error::NotInPlace(NotInPlace { why }), the cause
in the words a program's shadowed-texture notice names it with, instead of
crate::error::internal(..), an Error::Compile(Internal(Invariant)). The check's note of such a
shape (in_place_check.rs `unmade`, `unplaced`) now names the placement's answer in words
(TexturePlacement::words, new, crate-private, with words for each TextureShadowReason,
InPlaceRefusal, InPlaceAccess and InPlaceRowEnds), then the making's cause, on one line, with no
Debug output. Before, e.g. on the RTX 5080:
  "its making failed: compile failed: Internal(InternalError { kind: Invariant, detail: \"the
   in-place check's texture takes no image in place\" }); it took no image in place:
   Shadow(Refused(Pitch))"
Now: "no image the device makes lays the rows at their pitch: <the making's why>".

Why: an Internal error must mean a broken invariant, and an expected refusal is a typed answer
(AGENTS.md); the consumer reads these notes and could act on none of them. "compile failed" was
only Error::Compile's Display of internal(): no shader is compiled in the making.

Verdicts unchanged: whether an unchecked verdict's cause lasts is still the placement's answer
(`unplaced`), or, for any other making error, that or Unmade::of_error's (Unsupported, Invalid);
NotInPlace is neither, as Compile(Internal) was not. Only the runtime's own check meets the new
variant; no program's call returns it. No change of behaviour beyond the notes' words and the
error's kind on the check's thread.

Public surface: Error::NotInPlace and NotInPlace (re-exported at the crate root);
api_signatures.tsv blessed; docs/REFUSALS.md regenerated (no change: not a refusal of anything
Metal takes). The test of the commit before now looks the pitch's words up
(InPlaceRefusal::words).

Verified: tests::in_place_check on lavapipe and the Radeon 780M (PHOENIX); the commit before is
the negative control (evidence in the report).
2026-11-11 04:28:10 -08:00
Anees Iqbal 21cac7f7af tests::in_place_check: the check's notes of shapes it made no image of say why in words
What: a device test that settles the in-place check on a fresh cache and reads its notes of
shapes it made no image of in place: each must hold no internal error and no value's debug form
("Internal", "compile failed", "Shadow(", "Refused(", " { "); and on a driver that renders an
explicit plane's rows past its height (lavapipe), the dma-buf class's reads of rows inside lines
must stay unchecked, noted for the pitch, a cause that lasts. Every such note is printed
(IN-PLACE-NOTE).

Why: on every device the check notes those shapes as "its making failed: compile failed:
Internal(InternalError { kind: Invariant, ... }); it took no image in place: Shadow(Refused(Pitch))"
(seen on the RTX 5080 and others): an internal invariant error for an expected outcome, and the
placement's debug form for its cause. The consumer reads these notes.

Verified: this commit alone is the negative control: the test fails here, at the base, on
lavapipe (run in the next commit's evidence); the next commit makes it pass.
2026-11-11 04:25:00 -08:00
Anees Iqbal b4cd0f9f91 Regenerate docs/CONFORMANCE-COVERAGE.md for the XTX's ledger rows and read_through's notice
The coverage document counts the ledger's rows and lists each one's gap, and counts the modules
that declare a notice: the 27 RADV NAVI31 rows, the corrected text of the extended-range mipmap
rows, and read_through's `shared_memory_notice` (a module that declares a notice outright now)
move it. Written by `python3 -I scripts/conformance-coverage/coverage.py`; `--check` passes.

Found by the conformance suite's run at 0ef30d74db (potluck m3-max-14873, lavapipe on um790):
`the_conformance_coverage_document_is_what_the_sources_derive` failed, the only failure of 1043.
2026-11-11 04:10:13 -08:00
Anees Iqbal bd11f59efa known-gaps: the XTX's linear alignment and extended-range mipmap rows
The round's replay on the RX 7900 XTX (RADV NAVI31, at 6898863f3f) read 27 rows of two cases'
divergences unlisted. Both are the device's answer, written down as the other venues' rows are.

device-linear-texture-alignments (16 rows): Metal answers 16, the runtime 256. The answer is the
probe of texture/linear_alignment.rs: per format, the smallest power of two from 16 at which the
driver lays every probed width's linear image in place at the asked pitch, its memory alignment
dividing it. RADV takes no smaller one on NAVI31 (llvmpipe's row answers 64 the same way). A
texture over a buffer at a smaller multiple of 16 is still made, in place or shadowed.

blit-generated-mipmaps-bgr10xr / -bgra10xr (11 rows): the extended-range formats' mipmaps are the
runtime's compute filter in the device's float (mipmap_filter.rs: no Vulkan format holds an
extended-range code, so no blit filters one), announced `device-filtered-mipmaps`. Measured from
the case's recording: filtering each of Metal's levels from Metal's own level above by the
filter's IEEE f32 rule differs from Metal's level only at fields whose taps' exact average lies
halfway between two codes, by one code, and no single rule for the codes' average (half up, to
even, down) gives Metal's levels; the f32 chain run on the CPU from level 0 differs from Metal's
levels in exactly the XTX's counts (803, 232, 58, 13, 3 words; 58, 78, 46, 18, 5, 1 fields), the
same as llvmpipe's rows. So the XTX computes the filter's rule exactly; the difference is Apple's
datapath's choice at ties, not our extended-range conversion.

The existing llvmpipe and Apple M3 Max rows of those two cases said the levels were the blit
chain (`vkCmdBlitImage`); they now name the compute filter, which is what runs for these formats
(mipmap_plan.rs `blit_lack`). Their matched fields are unchanged.
2026-11-11 04:10:13 -08:00
Anees Iqbal 0e4d2c225c Conformance: read_through and two footprint cases name the shared-memory notice the XTX announces
The round's replay on the RX 7900 XTX (RADV NAVI31, at 6898863f3f) read 15 cases divergent at the
notices site alone (case/notices, and for three of them case/notices/set and case/notices/counts),
unlisted: the runtime announced `shared-in-system-memory`, which none of them declared.

The placement is the runtime's rule, not a shortage of room: without unified memory a `Shared`
buffer prefers a host-cached memory type, then a device-local one (memory.rs `candidates`), because
the host reads uncached memory, resizable BAR included, slowly, and a discrete Mac's GPU reads a
shared resource across the bus the same way. So the notice is the venue's memory model and never a
wrong answer, and the suite's declaration for it is `replay::shared_memory_notice`, which every
other case that reads back through a `Shared` buffer carries. It loosens the notices site alone.

- read_through: all 13 cases bind their positions and output in `Shared` buffers; each declares it.
- format_footprints: one-plane-ycbcr and padded-wide-channels set `shared_texture_buffers`. The
  runtime now makes their formats' `Shared` texture buffers, as Metal does (the recordings hold
  `makes-texture` Ok for them, and the XTX run matches), which was not so when the 5080's replay
  measured only the plain stragglers announcing it.
- docs/FAST-PATHS.md: the replay paragraph no longer says a card without unified memory makes the
  comparison unreadable; it says how the cases declare the notice.

Verified by the XTX replay of this tip (job ids in the report).
2026-11-11 04:10:13 -08:00
Anees Iqbal 8d66bb52cb 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-11 04:10:00 -08:00
Anees Iqbal 8ce6fa4784 RUNTIME_VERSION 2026: sourceless no-copy memory is a copy on a device without VK_EXT_external_memory_host
A no-copy buffer or heap over memory with no dma-buf source, or whose source fails, on a device
that imports no host pointer, is now the copy a refused pointer takes on RADV instead of a
HostMemory refusal; the device's in-place check makes no pointer-pages buffer there.
2026-11-11 04:09:22 -08:00
Anees Iqbal 14eb0642f7 Host RAM window test: wait for the thread's own count, not a sum it passes through
a_copy_takes_its_chunks_as_an_object_does_and_the_window_ahead_moves_past_them
failed on lavapipe under load (job m3-max-14819, msi-laptop, five jobs
there): 'the device's thread went on past the window', 6 against 5.

The thread's import of a chunk counts host_ram_chunks_imported inside
import_chunk (host_ram.rs, Imported::Chunk) and host_ram_chunks_imported_ahead
only after the import ends. The scatter's settle waited for
by_copies + ahead == 2 + WINDOW, a sum that reaches its mark between the
two increments (by_copies 1, ahead 5), so it stopped there and the
thread's later ahead count read as the thread going past the window.

It now waits for ahead == 2 + WINDOW (and no run import live); the
assertion after it still checks by_copies is 0, so a copy that imported
its own chunk still fails it, after the wait.
2026-11-11 04:09:01 -08:00
Anees Iqbal 1f7b2a67cf No-copy memory with no dma-buf source is a copy on a device without VK_EXT_external_memory_host
On a device that imports no host pointer but imports dma-bufs (Honeykrisp
on Asahi lists no VK_EXT_external_memory_host), a no-copy buffer or heap
over memory with no source of dma-bufs was refused, naming the extension.
Metal makes such a buffer, and in place is impossible there, so it now
takes the copy a refused pointer with no source takes on RADV
(CopiedFor::DeviceRefused): announced as copied-host-pages, counted in
copied_host_buffers_device_refused, with every copy's coherence.

How: host_window marks such pages pointerless (the device imports no
pointer, the memory is not dma-buf-only). buffer_over_host_parts no
longer takes the no-route refusal for them, so they reach
import_by_pointer, whose not_importable answer is the device's refusal;
a source that fails counts as the device's refusal there too, as on
RADV. Rebinds to such memory, a guest RAM with no source, and every
no-copy object on a device with neither route stay refused, naming the
extension. The in-place check no longer makes its pointer-class buffer
on a device that imports no pointer (it would be an announced copy now);
its verdict there stays lasting, as before.

Docs: the copied-host-pages detail, CopiedFor, CopiedBecause and the
counter, copied.rs, host_memory.rs, the no-copy buffer and heap calls,
imports_shared_host_pointers, host_ram/copy.rs, the runtime README, the
API catalogue and HOWTO section 6. docs/REFUSALS.md regenerated:
unchanged, as the extension's refusal sites all remain.

Verified by the device test in the previous commit (lavapipe and the
780M, see the hand-off).
2026-11-11 04:09:01 -08:00
Anees Iqbal 472c71ade8 Device tests: sourceless no-copy buffers and heaps on a device without VK_EXT_external_memory_host are copies
A device that imports no host pointer (made withholding the extension, as
a driver that lists none is) but imports dma-bufs refuses a no-copy buffer
or heap over memory with no source of dma-bufs today, naming the
extension. The decision is that such memory takes the copy a refused
pointer without a source takes on RADV.

copied_buffer_and_heap_are_made_on_a_device_that_imports_no_pointer makes,
on that device, a buffer over shared memory with no source, one with a
source that fails, and a heap with no source, and asserts each is a copy
(counted as the device's refusal, announced once, no pointer or dma-buf
imported, the source called once) with the RADV copy path's coherence: a
CPU write before a commit reaches the GPU, those bytes alone copied in,
and a fill reaches the pages at its completion, those bytes alone merged
back. The heap's placed-buffer checks move into placed_lies_in_a_copy,
which the gate-refused heap test now shares, gaining the CPU-write check.
The test that asserted the refusal goes.

Fails at de15678626: the buffer with no source is refused.
2026-11-11 04:09:01 -08:00
Anees Iqbal ddc542474b 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-11 04:05:20 -08:00
Anees Iqbal 41d9d35508 Exported memory: the buffer outlives every access through an import, not the import itself
A consumer keeps its imports of exportable buffers (CUDA's cuImportExternalMemory of each
buffer's descriptor) until a reaper thread lets go of them, a short while after the buffer's
release, never using them after it. That is sound: each descriptor vkGetMemoryFdKHR makes holds a
reference to the allocation's payload, and vkFreeMemory releases only the memory object's own
reference, so the payload stays until the import goes. The docs said the buffer must outlive
every import, a stricter rule than the one that holds; they now say every access through one.
Docs only.
2026-11-11 04:04:42 -08:00
Anees Iqbal d6f6ded707 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-11 04:02:44 -08:00
Anees Iqbal 0693cb9f3c RUNTIME_VERSION 2025: fetch barriers between draws, and a fetching draw that writes is not drawn again
The runtime records a by-region self-dependency barrier between draws that fetch and write the
color, and at an instance's first fetch, on a device with neither raster-order access nor pixel
interlock; a draw that both fetches and writes a color is no longer kept for drawing again.
2026-11-11 04:02:05 -08:00
Anees Iqbal 06aa85c0b6 SEMANTICS_VERSION 2026: framebuffer fetch between draws on a device with neither ordered form
The hkfbfetch branch took 2025 from a base at 2024, and development's Core Image
change (521f778bf6) took 2025 too; translation changed in both, so this takes the next.
2026-11-11 04:02:05 -08:00