Commit Graph
9557 Commits
Author SHA1 Message Date
Anees Iqbal b20fb4a89d Translator tests: the mechanism table covers RuntimeFact::RobustStorageBuffers
Its pipeline state, the consumer's VkPipelineRobustnessCreateInfo. Clippy of the workspace's
tests stopped at the two exhaustive matches (job m3-max-75002, a CPU build).
2026-11-26 05:04:53 -08:00
Anees Iqbal c2fc914a3e Translator and runtime: a kernel's buffer arguments as set-0 storage buffers under robust buffer access 2
The twelfth form a Vulkan query chooses. Under the identity domains, on a device that answers
five queries (DeviceProfile::binds_kernel_buffers: pipelineRobustness enabled,
robustBufferAccess2 supported and not enabled, robustBufferAccessUpdateAfterBind,
maxPerStageDescriptorStorageBuffers >= 31, and maxStorageBufferRange holding a 2 GiB buffer with
the max(minStorageBufferOffsetAlignment, 16) - 1 bytes a descriptor starts before it), a kernel
reaches each buffer argument through its storage view, a storage buffer of set 0 bound over its
buffer, in place of its device address with each run-time-offset access checked in the shader.
The pipeline's robust buffer access 2 (VkPipelineRobustnessCreateInfo, storageBuffers) contains
the view: a load or store of a view is not checked in the shader; an atomic is, against the
view's array length (RBA2 leaves an out-of-bounds atomic's result undefined). A slot a wide
pointer, a typed atomic or the stage-in fetch reaches, and one the dispatch binds below its
argument's alignment (word_bound_buffers), keeps its device address; render stages keep theirs.

Translator: VK_EXT_pipeline_robustness and its feature, robustBufferAccess2 and
robustBufferAccessUpdateAfterBind and robustStorageBufferAccessSizeAlignment in Limits,
RuntimeFact::RobustStorageBuffers (Mechanism::PipelineState), the bound slot's
AddressAlignment fact so the runtime checks its address, DeviceProfile::buffer_base_alignment;
SEMANTICS_VERSION, ARTIFACT_FORMAT_VERSION and RUNTIME_VERSION bumped.

Runtime: the optional extension and feature in the floor; set 0's layout of 31 compute storage
buffers where the profile binds (one pipeline layout); every kernel pipeline made with the
robustness there, the stage helper's too; Interface::views and FieldValue::BindOffset; each
dispatch's descriptors (a buffer over its own bytes from its first byte rounded down to the
base alignment, a set_bytes copy over its bytes at the ring's alignment, nothing bound a null
descriptor), bound from a set the command buffer wrote last where they begin it, else from the
next set of its pools (crate::bound, mirroring the occlusion pools: 256 sets a pool, 16 kept
free); the ring's writes at the buffer base alignment; Metrics bound_dispatches,
address_dispatches, buffer_sets_written, buffer_sets_held and Gauges buffer_set_pools.

Verified: nothing yet; the first build follows on this branch.
2026-11-26 05:04:53 -08:00
Anees Iqbal da7577de03 Runtime README: a compute buffer argument's checked address access, against a native build's bound buffer
A known gap of pipeline states: a compute function's buffer argument is reached at its device
address with its non-constant accesses checked in the shader, where a native Vulkan program binds
the buffer and the device's range check applies. The entry gives the price as our kernel's GPU time
over a native Vulkan build of the same kernel (a particle kernel, two convolutions), what a build
that bound the arguments under robust buffer access 2 ran them at, and why buffers are not bound:
a descriptor set per dispatch lost GPU time on the Iris Xe's recorded streams and on dependent
dispatch chains on the Radeon cards, and a table of descriptors indexed by a pushed word moves the
range check into the shader on the Iris Xe's driver. The Iris Xe's convolution and copy gap at
equal shape did not move when the buffers were bound, so it is not this gap's.

Every figure was read again from its job's log before it was written: particle kernel jobs
m3-max-74926 (Radeon 780M), 74927 (RX 7900 XTX), 74928 (Iris Xe), 74929 (RTX 3090); convolutions
m3-max-74957, 74959, 74960; Iris Xe at equal shape m3-max-75079; the bound build m3-max-75061 to
75064; descriptor set per dispatch m3-max-75119, 75120 (dispatch chain) and m3-max-75124, 75128,
75132 (Iris Xe streams). The table's form is from Mesa 26.2.6's ANV source, not run.

Docs only: no Rust or Cargo input changes, and the README is not included in any crate's rustdoc.
2026-11-26 04:57:42 -08:00
Anees Iqbal c6518caf3b Runtime: an unbound write's barrier after its dispatch, and an arena dispatch kept in the hazard sets
What: two dispatch-barrier ordering fixes, and nothing else.
- A dispatch in a serial encoder that writes through an address outside its resources owes its
  barrier once it is recorded (ComputeCommandEncoder::dispatch, after the record), so the next
  command pays it after the dispatch. dispatch_hazards owed it before the record, and the
  dispatch's own record_dispatch paid it, before the dispatch: two barriers before it and none
  after.
- A dispatch over a Private arena puts what it touches back in the hazard sets after its pieces
  (mark_dispatch, split out of dispatch_hazards): the barriers before its later pieces started
  the sets again and dropped the marks the dispatch made, so a later dependent dispatch got no
  barrier.

Why: both left a dependent dispatch without the barrier Metal orders it by. The barrier before
an unbound-writing dispatch was redundant with its own hazard check (a write outside its
resources after anything touched already takes one), so moving it adds none: a dispatch that
writes outside its resources takes one barrier before it where it conflicts, and its next
command pays the one after it. Re-marking an arena dispatch leaves exactly its own marks after
its last piece's barrier, so no barrier is added for commands before it. The runtime README's
arena paragraph says so.

Verified: the two tests of the commit before fail at it on lavapipe, job m3-max-74991
(compute.rs:760, the unbound source [0,0,0,0,0,1,0,0,0] against the write dependency
[1,0,0,0,0,0,0,0,0]; private_arena.rs:288, write dependency 0 against 1). The gate on this
commit follows.
2026-11-26 01:12:49 -08:00
Anees Iqbal 1af01940f6 Runtime tests: the barrier after an unbound write, and after an arena dispatch's pieces
What: two device tests of a dispatch barrier that 5b260257e0 places wrong.
- every_device_records_an_unbound_write_s_barrier_after_it: in a serial encoder, a dispatch
  that writes outside its resources, then one that reads and writes the buffer it wrote. The
  barrier between them counts as the second's dependency on the write
  (dispatch_after_write_barriers 1, every other source 0), and the segment's end is the only
  other barrier.
- every_device_orders_a_dispatch_after_an_arena_dispatch_s_pieces: in a serial encoder, an
  arena dispatch of 7176 words split into four pieces, then plain over the same buffer. plain
  takes a barrier for its dependency on the arena dispatch's write
  (dispatch_after_write_barriers 1).

Why: two ordering bugs read in the code. An unbound write's owed barrier is paid by the same
dispatch's record, before that dispatch, and starts the hazard sets again, so the dispatch
after it gets no barrier. The barrier before an arena dispatch's later piece starts the sets
again too, which drops the marks the dispatch made, so a later dependent dispatch gets no
barrier. Lavapipe runs dispatches one after another, so the values cannot show a missing
barrier; the counts by source show which dispatch paid it.

Verified: nothing in this commit; both are expected to fail at this commit on lavapipe, and
the fix follows in the next.
2026-11-26 01:10:52 -08:00
Anees Iqbal 5b260257e0 Runtime and replay player: count each dispatch barrier in one source, and print the device's buffer alignment
What: Metrics::dispatch_hazard_barriers is now the sum of nine sources, each such barrier in
exactly one: dispatch_after_write_barriers and dispatch_write_after_read_barriers (the
dispatch's own dependencies), then dispatch_encoder_end_barriers, dispatch_pass_end_barriers,
dispatch_indirect_barriers, dispatch_unbound_barriers, dispatch_arena_piece_barriers,
dispatch_heap_barriers and dispatch_other_barriers. The replay player prints the nine on each
frame line's executed counters and in the report's totals. The tally's bit mask is a u128 (69
metrics).

The rule for a barrier with several causes: it counts under the dispatch's own dependency where
it has one, first a write (it reads or writes a resource a command since the last barrier
wrote), then a write after a read (it writes one that was only read), both by the resource's own
id; otherwise under the first source in this order: an encoder that wrote ended; a render pass
moved nothing home (or copied a resolve into a buffer); an indirect dispatch after a write since
the last barrier that reached argument reads, whatever buffer was written; an access outside
every resource (a read after a write, a write after any access, or the barrier such a write
owes); a Private-arena piece after the first; a conflict through a heap's one id alone (an
exported surface's buffer and planes, which share one id, count here too); anything else (a
memory barrier call, a release to another API, a concurrent encoder after commands that touched
anything). An owed barrier keeps the first of its causes in that order. In a concurrent encoder
the dependency is read only where a barrier is owed, as Metal orders nothing else there. Two
buffers of one heap over the same bytes count under the heap: at buffer level they are two
resources.

How: a heap's resources are marked in the hazard sets by the heap's id, as before, and also by
their own ids in a second table of the sets that places no barrier and only tells a dependency
on the resource from a conflict through the heap's id. Building::owe takes its cause and no
longer starts the sets again; the command that pays the owed barrier does, after reading them:
Building::command clears them after paying, and dispatch_hazards takes its command buffer
without paying (current_command) and pays the owed barrier itself, counted by every cause it
has. Where barriers go is unchanged: each path that paid an owed barrier records the one
barrier it recorded before, and the sets start again at the same barriers.

Rider: Device::buffer_alignment (no Metal counterpart) returns the alignment Vulkan's memory
requirements gave the runtime's buffers, which the pool read at the device's making. The replay
player's device line prints it (`device NAME runtime rt buffer alignment N`), and the device
test prints it and checks it is a power of two. The runtime prints no line of its own at a
device's making, so a consumer's log shows it only by reading this accessor.

Why: the planner's reading of the dispatch-hazard barriers: whether the sources that are not the
guest's own dependencies reach a quarter of a frame's barriers on any stream. The buffer
alignment goes into every lab log because the ring and the zero address assume a multiple of 16
with no query behind it.

Tests: every_device_counts_each_dispatch_barrier_in_one_source checks the write after a read,
two encoders' ends (the second's dispatch reading the write before it counts as that
dependency), a render pass's end that moved nothing home, an indirect dispatch after a write of
another buffer, a read outside every resource and a memory barrier in a concurrent encoder, each
in its one source with the sources summing to the dispatch barriers;
every_device_places_barriers_at_hazards_only checks the dependent and concurrent encoders' in
the write dependency and none for independent dispatches;
every_device_orders_a_heap_s_resources_as_one checks the heap's source, and the write dependency
for one buffer of a heap used twice; the arena test checks its pieces' barriers in the arena
source; the hazard sets' unit tests check the own-id table. The signatures table is blessed (9
fields, 1 method).

Verified: nothing yet in this commit; the gate (fmt, clippy in three configurations, Rustdoc,
the runtime suite on lavapipe and the validation suite) runs on it next.
2026-11-26 00:54:46 -08:00
Anees Iqbal 0b7d408201 Runtime and replay player: count barriers by cause, the guest's blits and buffer binds, and over-copy bytes by frame
What:
- Metrics counts every barrier in one of seven causes, whose sum Metrics::barriers now is:
  pass_start_barriers (a render pass's first), pass_home_barriers (the move of its attachments
  home at its end), blit_barriers, dispatch_hazard_barriers (a dispatch's own, at a hazard or
  paying one owed), segment_end_barriers, upload_barriers (the uploads' and Managed copy-ins'
  barriers, the over copies they carry among them) and other_barriers (inside a pass, over
  copies in a command buffer, heap moves ahead of a command or segment, releases). Metric::Barriers
  is gone: each site that records a barrier counts its cause, and the shared helpers
  (Building::barrier, alias::record, over::record_side) take the cause from their caller.
- The replay player's executed counters carry the seven, so each frame line prints them.
- The player's stream counts (the guest's, fixed by the stream) add blits, an encoder's copy,
  fill, mipmap, synchronize, reset and optimize commands, and the buffer slots the set-buffer
  calls set on render and on compute encoders, each split into buffer changes (another buffer
  than the slot held, or its first set) and offset-only changes (replay/binds.rs).
- The runtime backend's report adds an `over copies by frame` line: over-copy bytes a frame,
  mean and largest frame, by memory class (Private, Shared) and by cause (pitch, dma-buf, host
  memory, every other cause as own_image), and the number of textures in an image of their own
  the largest frame's calls named (new_runtime/over_frames.rs), from counters the runtime keeps.
- docs/REPLAY-STREAM.md and the runtime README name them; the signatures table blessed (7 fields).

Why: the planner's reading of round d9b644bae7's plays: whether pass-boundary and blit barriers
are half or more of a frame's barriers (the two pass forms), and whether over copies of Private
buffers reach 1 MB or 5% of a frame's copied bytes (the third form), needs the barrier split and
the over-copy split a frame, beside what the guest asked for; the guest's buffer binds per draw
and per dispatch size the descriptor work.

Tests: every_barrier_rt_records_is_counted adds a pass over a texture whose home is shader-read
and checks each cause's count against the barrier commands recorded (pass start 1, pass home 1,
blit 2, dispatch hazard 0, segment end 1, upload 6 or more, other 0);
every_device_places_barriers_at_hazards_only checks the dispatch-hazard and segment-end counts on
dependent, independent and concurrent encoders;
every_device_reads_its_attachment_through_a_texture_after_a_memory_barrier checks the causes on
the feedback-loop and the copy path; the player's
the_stream_fixes_its_calls_commits_encoders_draws_dispatches_blits_and_binds checks blits and
every bind count; over_copies_by_frame_give_the_mean_and_the_largest_frame checks the line.
2026-11-25 23:55:46 -08:00
Anees Iqbal 8c3bffc079 Runtime: count over-copy bytes by the buffer's memory class, and the renderings an encoder ends and begins again
What: two counters, so reach is counted rather than guessed.
- Metrics::over_copy_bytes_private and Metrics::over_copy_bytes_shared split over_copy_bytes by
  the memory class the bytes shaders reach are in (MemoryClass of the buffer's block; a Managed
  buffer's device copy counts in neither). OverCopy carries the class; Counters::over_copied
  takes it.
- Metrics::rendering_interrupts counts each vkCmdEndRendering and new vkCmdBeginRendering inside
  one render encoder (RenderCommandEncoder::interrupt, its one site): barriers, copies a draw or
  a visibility result mode needs first, feedback and heap moves, an execution's count kernel.
  The passes counter counts encoders and cannot show these.
- The replay player's executed counters carry the three, so every play's frame lines print them;
  docs/REPLAY-STREAM.md and the runtime README name them; the signatures table blessed (3 fields).

Why: the per-frame counts of round d9b644bae7's plays put over-copy bytes at 4.87 MB a frame on
the desktop stream (5080) and 34.5% of bytes copied on the 780M recording (Iris), with no way to
tell how much lies over Private buffers, whose bytes no host write reaches; and no counter shows
how often a render encoder's rendering is cut.

Tests: each_memory_class_counts_its_copies_bytes_alone (device-free); the device test
every_device_counts_each_textures_copies_under_its_cause checks the class split for each copy
and adds a texture over a Private buffer (pitch cause on lavapipe);
every_device_reads_its_attachment_through_a_texture_after_a_memory_barrier holds the count at 2
on both the feedback-loop and the copy path.
2026-11-25 23:24:36 -08:00
Anees Iqbal 1af54e162d Conformance and runtime README: the UHD 630's rows for the read-write and sRGB storage cases
What: the known-gaps ledger's 14 rows for Intel's Windows driver 101.2145 on the UHD Graphics 630
in srgb-storage-writes, read-write-tier-held and read-write-tier-round-trip-float, which that venue
had not run before. Two entries in the runtime README's known gaps of textures. Coverage
regenerated. No product code.

- srgb-storage-writes RGBA8Unorm_sRGB fpv_srgb_write/dispatch, refused: the driver makes no
  extended image for an 8-bit sRGB texture made for shader writes, so there is no UNORM twin and
  the write at a slot is Gap::StorageElement (Absent). README entry: the image format query rt
  makes for the extended image (R8G8B8A8_SRGB, optimal, MUTABLE_FORMAT | EXTENDED_USAGE, the format
  list with R8G8B8A8_UNORM, the plain usage with STORAGE) answers no. That is read from
  tests::storage_element's every_device_writes_an_srgb_texture_through_its_unorm_view, which
  asserts the image is extended exactly where that query takes it and passed there (m3-max-74877),
  and from the case (m3-max-74873). Not probed apart; the README says the resolve usage's part
  was not asked.
- read-write-tier-held RGBA8/BGRA8 sRGB stored-bytes and texels: the same cause through the
  argument buffer, in the A8Unorm "*" rows' words (an undeclared write to a texture with no
  storage element is dropped; the read answers zeros).
- BGR10A2Unorm (held stored-bytes and texels, round-trip refused) and A8Unorm (round-trip
  refused): no storage image by the device's format queries, in the NVIDIA, llvmpipe and RX 550
  rows' words (vulkaninfo of that card lists no STORAGE_IMAGE bit for A2R10G10B10).
- R8Unorm tier2, RG8Unorm beyond and RGBA8Unorm tier2 texels, one ulp: rule 1, the reciprocal
  product, in llvmpipe's words.
- BGRA8Unorm beyond texels (held 256 elements, round-trip 1,024): the driver lists
  VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT for B8G8R8A8_UNORM while
  shaderStorageImageReadWithoutFormat is false; rt follows the per-format bit on every device
  (VUID-vkCmdDispatch-OpTypeImage-07028), and the reads differed from Metal's (the largest
  difference is what a read of zero gives). BGRA8Unorm is outside Metal's read-write tiers. A
  known gap at rung 4 by the planner's ruling, with a README entry; not reproduced outside the
  runtime.

Verified: every row is one of the 14 lines conformance leg m3-max-74873 printed as unlisted
(Windows UHD 630, pin d9b644bae7), with its venue, verdict, site and answer copied from them. The
ledger's read on that venue is verified at its next Windows conformance leg.
2026-11-25 21:29:20 -08:00
Anees Iqbal 4cb149c918 Runtime tests: the stored-slot refusal test keys on the texture's twin, the device's own answer
every_device_refuses_a_stored_slot_bound_to_a_texture_with_no_storage_element decided whether an
RGBA8Unorm_sRGB texture's write is stored from R8G8B8A8_UNORM's format features alone. The
runtime stores it through the UNORM twin only where its image format query also makes the image
extended for the twin, and Intel's Windows driver 101.2145 on the UHD 630 makes no such image,
so the test expected a store the runtime refuses there (StorageElement, Absent). It now reads the
texture's own answer (Texture::encodes, the plan's twin), as tests::srgb_twin does.

Verified: the failure it fixes is win:rt at pin d9b644bae7, job m3-max-74877 (758/759, this test
the one failure: "rrp_sw_write_f, written through the twin true: Err(Unsupported(StorageElement
{ .. case: Absent .. }))"). The fix itself runs in development's checks after this commit and on
the UHD 630 at the next Windows leg.
2026-11-25 21:28:52 -08:00
Anees Iqbal d9b644bae7 Conformance: Metal's recording of vector-word-phases-vec16-4-8, taken on the M3 Max
Recorded on an Apple M3 Max, macOS 27.0.1 (26A434), by `conformance record` and
`conformance times --runs 8 --write` in job m3-max-74565 (build m3-max-74559), three runs, one
outcome. Plain Metal ran the pass to completion; its API validation stopped it ("Compute
Function(vwp_vec16): the offset into the buffer a that is bound at Buffer index 0 must be a
multiple of 16 but was set to 4", and the same for b at 8), which the recording keeps as its
validated fact. The case's tests hold plain Metal's four buffers equal to answer_at (every
access at its own address) and the validated words to those two messages.

docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py).

(cherry picked from commit 944d20922983e7932a591b6c3d0e1090dc5f3300)
2026-11-25 19:17:03 -08:00
Anees Iqbal 52f65d1418 Conformance: vector-word-phases-vec16-4-8, vwp_vec16's float4 buffers bound 4 and 8 bytes past a multiple of 16
What: a fifth vector-word-phases case, vwp_words's buffers at 0 and vwp_vec16's float4 arguments
(alignment 16) at 4 and 8 (devtools VEC16_AT_WORDS), every buffer read back whole and held to
answer_at, every access at its own address. Its known-gaps row is its siblings' (dispatchType,
the consumer's own). The phase cases' inputs are unchanged, so their recordings stand.

Why: the runtime now runs such a bind (the translator holds an argument of 8- or 16-byte
alignment to a multiple of 4); this case records plain Metal's answer for it and compares the
runtime's byte for byte. Metal's API validation refuses the bind ("must be a multiple of 16"),
which the recording keeps as its validated fact. Metal's recording follows in its own commit.

(cherry picked from commit e3993b67c876216d6c45726245170df45087be42)
2026-11-25 19:17:03 -08:00
Anees Iqbal b42ef61b9b Runtime: a buffer bound at a multiple of 4 below its argument's alignment runs the state's variant that holds it to 4
What: a dispatch's alignment check (check_alignments) no longer refuses a buffer whose argument's
alignment is 8 or 16 (mask past 3) bound at a multiple of 4 below it: it answers the mask of those
slots, bit i slot i. A non-empty mask picks the state's variant (PipelineInner::variant, srgbwrite's
sRGB variant generalised to both masks): Compiled::of lowers the state's function with those slots
in LoweringInputs::word_bound_buffers, kept in the device's bounded map of contents under
KernelKey's new words mask (1,024 entries), held by the command buffer that dispatched it. The
dispatch then checks the variant's own alignments strictly, so a buffer a 64-bit atomic may reach,
which the variant holds to 8, is refused off a multiple of 8. A kernel the consumer compiled has no
variant: its own module's strict check refuses the bind as before. One bit per slot: a second class
(8 at a multiple of 8) would need a second mask in the key and the input.

Still refused: an address off a multiple of 4 (off 2 for an alignment of 2), a 64-bit atomic's
buffer off a multiple of 8, every draw's (render_encoder keeps the strict check_alignment: the
draw side would need the render path's variant key), and a consumer-compiled kernel's.
Refusal::BufferOffsetAlignment's doc says so; its message and `alignment` now name the alignment
the function holds the address to, as the variant's 8 for a 16-aligned argument is not the
argument's. The buffer-bind-off-alignment ledger row carries the new message;
docs/CONFORMANCE-COVERAGE.md regenerated (unchanged); REFUSALS.md regenerated (unchanged: its row
takes the doc's first words).

Why: a guest's system texture-decode kernel (library db82b13f114fbeef #0) binds buffer 0 at offset
1871700 (4 mod 16) under a 16-byte argument alignment and met the refusal 60 and 72 times in two
sessions; plain Metal runs it with each element at its own address. Only such a dispatch runs the
variant: an empty mask keeps the state's key, hash and module.

Tests (not yet run): translate.rs every_device_places_each_vector_access_at_its_own_address runs
vwp_vec16 at VEC16_AT_WORDS too, holds Metal's words, and asserts a variant lowered exactly at the
runs off a multiple of 16; every_device_keeps_a_word_bound_variant_in_the_bounded_map_of_contents
(cap 2: one variant a mask, kept, the map at its cap, a forgotten one lowered again);
an_argument_bound_off_its_alignment_is_refused binds vwp_vec16 2 and 3 bytes off (alignment 16).
compute.rs's for_test kernel still refuses all 17 binds (no variant to lower).

Docs: the runtime README's compute-encoder rule and a known gap of pipeline states (the relaxed
form, with the unconditional build's 3090 constant_* rows), docs/API.md sections 1 and 10.
2026-11-25 19:17:03 -08:00
Anees Iqbal ab18b5cdcf Translator: LoweringInputs::word_bound_buffers holds a buffer bound at a multiple of 4 below its alignment to what its accesses need
What: a new lowering input, the buffer slots a dispatch binds where the address is a multiple of 4
and not of the argument's alignment (8 or 16). Under the identity domains such a device-address
slot states RuntimeFact::AddressAlignment as its argument's alignment up to what its accesses
need: 4 for words and wider units, 8 where a 64-bit atomic reaches it, and 8 for every such slot
of a function whose 64-bit atomic goes through a wide pointer (AccessPlan::wide_atomics64). The
slot's direct accesses claim no more Aligned than the address is held to: AccessPlan::aligned now
maps each slot to that alignment, psb::Reach::Direct carries it, and whole_place declares the
proven multiple of 8 or 16 up to it. A slot of alignment 4 or less is unchanged by the set.

Why: a guest's system texture-decode kernel binds a 16-aligned argument's buffer at an offset that
is 4 mod 16 (1871700), and the runtime refused it (Refusal::BufferOffsetAlignment). Plain Metal
reaches each element of such a bind at its own address (an Apple M3 Max, macOS 27.0.1,
probes/misaligned_buffer_binds.m). The unconditional form (steelbrain/offsetalign, 8ed59d496e) cost
the 3090's constant_* rows 99-122 us -> 234-252 us (job 74651), so the relaxed form is a variant
only a dispatch bound so compiles.

The empty set leaves everything as it is: the key appends the set only when non-empty, the base's
held alignment is the argument's, which is at least every proven offset alignment of its leaves
(MemoryPlan::proven_align takes the base's twos), so min(proven, held) is the proven one, and
note_reach's 8 for a 64-bit atomic is read only as reach.min(4) outside the set. No
SEMANTICS_VERSION bump: no existing input's translation changes.

Tests (not yet run): engine_word_phases a_word_bound_variant_claims_and_states_4 (vwp_vec16 claims
and states 4 under the set, vwp_words's words unchanged by it) and
vec16_answers_metal_bound_at_a_multiple_of_4 (the CPU interpreter, VEC16_AT_WORDS: the variant
answers Metal's words, the plain module traps on its Aligned 16); engine_access_offsets
a_word_bound_slot_is_held_to_what_its_accesses_need (plain 8/16 both ways; under the set 8/4, and
8/8 through a wide 64-bit atomic). devtools: VEC16_AT_WORDS and answer_at, from 8ed59d496e.
api_signatures.tsv blessed (one field).
2026-11-25 19:17:03 -08:00
Anees Iqbal 158f4a7c38 Runtime README: a udmabuf over a large folio's pages is imported only on Linux 7.2 or later
The Imported blocks section now says that on Linux 6.11 to 7.1 a udmabuf made over the pages of a
large folio is malformed (one entry a 4 KiB page at an offset past that page's size), and that the
AMD kernel driver's import of it then binds other pages than the buffer's; Linux 7.2 fixes it. So a
consumer hands import_dma_buf or import_dma_bufs such a udmabuf only on Linux 7.2 or later, and the
runtime, which reads no kernel version, does not check it. No code changes.

Basis: read in the kernel's drivers/dma-buf/udmabuf.c at v6.18, v7.1 and v7.2, drm_prime.c and
amdgpu_ttm.c at v6.18, and the fixing commit 5bf888673e0d. Not reproducible in the lab, whose
kernels carry the fix.

Verified: docs only; the workspace Rustdoc check runs on development after this commit.
2026-11-25 19:15:54 -08:00
Anees Iqbal 4fadeef846 Conformance: the ledger's 8-bit sRGB rows after the twin form
What, from the whole replay at 5bcb3c3253 on four venues (Iris Xe m3-max-74599, RX 7900 XTX
m3-max-74606, um870's RTX 3090 m3-max-74604, lavapipe in the quick check m3-max-74595):

- read-write-tier-held's BGRA8Unorm_sRGB and RGBA8Unorm_sRGB stored-bytes rows (venue *) go: the
  undeclared argument-buffer writes now land in the twin, unencoded, and the case's colours encode
  to the codes that store, so the bytes match Metal's on every venue run.
- Its two texels rows (venue *) become one row per venue: the read through the argument buffer's
  read_write member now answers the twin's codes as linear values where Metal decodes them (192
  elements on the Iris, the XTX and the 3090, 219 on lavapipe, the largest difference 30440712),
  and on the Iris BGRA8Unorm_sRGB's twin is B8G8R8A8_UNORM, which ANV there cannot read without a
  format (256 elements, 1055846126). The AMD rows are written for RADV from the XTX's run; the
  780M's and the RX 550's runs follow.
- read-write-tier-round-trip-float's twelve sRGB rows, one a venue, become one row a format for
  every venue: rt refuses an access::read_write slot bound to an 8-bit sRGB texture on every
  device now, with the same answer on every venue run; the old reason (the device's format
  queries) no longer holds.

srgb-storage-writes itself is announced on all four venues: the bytes equal Metal's and the one
difference is the notices site's DevicePackConversion, a native note. docs/CONFORMANCE-COVERAGE.md
regenerated.

tests::srgb_twin's map test also prints the translation time of fpv_srgb_write's state and of
its sRGB variant, for the release-mode measurement.

Verified: the replays named above; the ledger as edited is verified by the next round.
2026-11-25 18:23:38 -08:00
Anees Iqbal 5bcb3c3253 Conformance: srgb-storage-writes' Metal recording, from the M3 Max
What: conformance record and times --runs 8 --write srgb-storage-writes on the Apple M3 Max,
macOS 27.0.1 (26A434), job m3-max-74594 at 121122cd7f; the recording copied out of its
workspace. docs/CONFORMANCE-COVERAGE.md regenerated (the case module now holds 1 case, its Metal
leg reaching 39 items).

What Metal stored, read off the recording: in every one of the four sweeps (RGBA8Unorm_sRGB and
BGRA8Unorm_sRGB, float and half) each row-0 texel holds codes (i, 255 - i, (i * 37) & 255, i) in
the format's channel order, 0 mismatches of 256; row 1's values past either end clamp to 0 and
255 before the encode, alpha linear.
2026-11-25 18:14:40 -08:00
Anees Iqbal 121122cd7f Runtime: the view's root is the viewed texture's Arc, and the variants' map test skips a device without twins
The check m3-max-74574 at 71388e89d7 failed to compile texture.rs:4396 (E0308): a view's root
was taken as &TextureInner where the viewed texture is held as &Arc<TextureInner>. Both arms now
borrow the Arc. tests::srgb_twin's map test now asks the textures themselves whether they have
their twins' storage views, and skips a device whose do not, as the encode test asserts that
answer against the device's features; its half bits are parenthesized.

Verified: the next quick check.
2026-11-25 18:13:16 -08:00
Anees Iqbal 71388e89d7 Conformance: srgb-storage-writes, what access::write stores into an 8-bit sRGB texture
What: a case over the owned fixture fpv_srgb_storage's fpv_srgb_write and fpv_srgb_write_half,
each writing a 256 by 2 RGBA8Unorm_sRGB texture and a BGRA8Unorm_sRGB one from buffer 0 and
recording the texture's bytes, one code a channel. The values are the linear values each code
decodes to (every code in red, green and blue, each in its own order, alpha i / 255), and row 1
starts with values past either end, which Metal clamps. A unit test checks each value encodes
within a hundredth of a code of its code in float and a twentieth through its half, so no side's
encode meets a value between two codes. half_bits is extended_range_targets'.

Why: Metal promises write access to both formats on every device (8.7.7: the write encodes,
alpha linear); the runtime now stores them through the UNORM twin with the encode in the
kernel. read_write is not in any read-write tier for an sRGB format, so the case writes only.

Verified: not yet run; the recording on the M3 follows. docs/CONFORMANCE-COVERAGE.md
regenerated.
2026-11-25 18:09:09 -08:00
Anees Iqbal 41f82346dd Runtime: an 8-bit sRGB texture is stored through its UNORM twin, and a kernel's write there encodes
What: an 8-bit sRGB texture made for shader writes, whose image is extended for its unorm
sibling, has that twin's storage view for its storage element (Plan::twin, TextureInner::twin;
a view of one lists the twin from its image). stores() takes no sRGB format on any device, so
MoltenVK's native sRGB storage view goes and the form is one on every device. A dispatch whose
kernel writes, and does not read, a texture slot bound to such a texture runs the state's sRGB
variant (PipelineInner::srgb_variant): the state's function lowered with those slots in
LoweringInputs::srgb_storage, kept in the device's map of contents under KernelKey's new srgb
mask (bounded by its 1,024 entries), and held by the command buffer that dispatched it
(Kept<Arc<Compiled>>), as no state holds it. Every other use stays Gap::StorageElement: a
read_write slot, a draw's slot, and a declared write beyond the slots (unstored() still names the
texture). ComputePipelineState::precision_notes carries DevicePackConversion for a function
kernel that writes a texture slot it does not read: the note is fixed at creation and never
decided at dispatch. A unorm view of such a texture still counts in extended_view_dispatches.

Why: a guest's OS kernel writes a write-only BGRA8Unorm_sRGB texture hundreds of times a
session and met Gap::StorageElement on every device without native sRGB storage, which is every
Linux device the runtime runs on. Dispatch only: the draw side would need the render path's
variant key, not a small share.

Known gap, in the README: a write that reaches such a texture through an argument buffer or a
resource ID with no use_resource declaring it now lands unencoded in the twin (each channel's
linear code), where it was dropped, and a storage read there answers the codes as linear values.
The format such a write reaches is unknown when its function compiles, so nothing encodes it. A
typed refusal of that write is not reachable at the same cost: nothing the runtime is told names
the textures an undeclared argument reaches, and refusing by declared reads or by bindings would
refuse programs Metal runs. A declared write stays refused.

Tests: tests::srgb_twin (new) writes RGBA8Unorm_sRGB and BGRA8Unorm_sRGB through the twin with
fpv_srgb_write and its half form and checks every code against the MSL encode within one, and
fills the kernel map past a cap of 2 with the variants' keys; tests::storage_element now
expects the write slot to dispatch where the twin stores and the read_write slot refused on
every device.

Verified: not yet built; the lane's quick check and device runs follow.
2026-11-25 18:09:02 -08:00
Anees Iqbal b6a57f7958 Translator: LoweringInputs::srgb_storage writes an 8-bit sRGB texture through its UNORM twin
What: a new LoweringInputs field, srgb_storage, names texture slots whose texture is an 8-bit sRGB
texture held for storage through its UNORM twin's view. Such a slot, where storage_images names
no choice for it and its image class is float, declares its storage image without a format, of
class SrgbEncode: a write encodes red, green and blue by the MSL transfer (8.7.7) through the
device's conversion and keeps alpha linear, recording PrecisionNote::DevicePackConversion, and a
read decodes. A device that cannot write or read storage without a format refuses it as
Feature::Format. Under the identity domains the slot's element is the storage array's element of
its declaration's class, as an Unknown-format storage slot of class SrgbEncode now is.

Why: a guest dispatch writes a write-only BGRA8Unorm_sRGB storage texture hundreds of times a
session, and no device the runtime runs on stores an sRGB format; the runtime refused it
(Gap::StorageElement). The runtime's kernels compile from LoweringInputs, not VariantKey, so the
resident-table domain's srgb_textures and storage_images (another meaning) are not reused.

The compile key appends srgb_storage only when it is non-empty, so no existing key moves and no
version is bumped; with the field empty nothing a translation emits changes.

Verified: not yet built; the lane's quick check and suites run next. api_signatures.tsv is
blessed (one record) and docs/REFUSALS.md regenerated (one Feature::Format site more).
2026-11-25 18:08:49 -08:00
Anees Iqbal fe382b5f70 Census at f69c237c91: the authored compile census's outcomes are unchanged after the dead variants' deletion; 666 artifact digests move
What: corpus-triage --audit authored-compile --bless at f69c237c91 (m3-max-74463, from the check
m3-max-74462's cells). 137 case rows change, and so does the artifacts_at line, now at product
a0b0295ed473...: 666 of the table's 10,486 executed-artifact digests moved. Every cell's outcome
is unchanged: with the artifact digests stripped, the old and new tables are equal line for line.
The check read differences 0 and regressions 0 over 2348 cases on 9 profiles.

Why: the only translator change since the last bless (a26b61b3b2, at efd7dbcd4d) is the deletion of
the one-row, unit-axes and pulled-vertex-buffer variants (aa2b0fc670, 85e34d3080). Its golden
table diff on the M3 (m3-max-74453) was 0 rows removed and 0 added, so no SPIR-V module moved. The
moved digests are expected from the UnitAxes relief fact, which those commits stopped emitting and
the runtime ignored, together with ARTIFACT_FORMAT_VERSION 597 -> 598. That cause is expected, not
verified case by case.
2026-11-25 17:27:06 -08:00
Anees Iqbal f69c237c91 Validation: the runtime guard's hash for the deleted one-row and unit-axes facts
The suites job m3-max-74443 at 64f15d57a9 failed one test,
candidate::engine::artifact::tests::the_runtime_sources_are_the_committed_ones. 6df965ee26 edits
two of the guard's inputs. No run of a given artifact changes, so only the hash moves, to the
35e965ba... that the test printed in job m3-max-74454:

- crates/metal2vulkan/src/lower/dispatch.rs loses the inserts of RuntimeFact::OneRow and
  RuntimeFact::UnitAxes. They ran only when the compile's inputs had one_row or unit_axes set,
  and only VariantKey's one_row and unit_axes set those, which no product code set. Every product
  compile records the same facts as before.
- crates/metal2vulkan/src/device/mechanism.rs loses the Mechanism arms of those two deleted
  variants. The arms of every fact a pipeline still carries are unchanged.

The runtime crate's edits are not guard inputs, and they change no run either:
- crates/metal2vulkan-runtime/src/pipeline.rs loses an arm that ignored RuntimeFact::UnitAxes,
  which the translator no longer emits;
- crates/metal2vulkan-runtime/src/tests/translate.rs is test code.

RUNTIME_VERSION is unchanged. The validation suite at this tip checks the guard green.
2026-11-25 17:16:50 -08:00
Anees Iqbal 85e34d3080 Translator: delete the pulled-vertex-buffer variant
VariantKey::pulled_vertex_buffers had no product setter: every product path
builds VariantKey::new(), so the layouts it named were always empty and its
form (item 7 of pipeline::link::vertex: pull the remaining fixed-function
attributes of the named layouts) ran only under tests.

Deleted with it: RenderLinkInputs::pulled_vertex_buffers (set only from the
key), VertexInputState::variant_pulled (the layouts item 7 moved) and its
codec field, resolve()'s variant argument and the variant arguments of
vertex_fetch_projection_for and vertex_input_state. The de-indexed and
private list forms and a pipeline made for indirect command buffers keep
pulling every attribute (now item 7).

Tests: the pulled form of engine_identity_render's from_queries test (now
from_queries_pulls_the_de_indexed_form_s_layouts_at_their_pushed_strides,
which keeps the de-indexed and private list forms), and the
icb_render_stride_template case of the replay refusal test, which existed for
the pulled variant (icb_render_replay_template and icb_replay_template stay).

Keys and bytes: a render pipeline's PipelineKey hashes the derived Debug of
RenderLinkInputs, so every render PipelineKey changes once (the runtime keeps
it in memory only: its kernel map keys by queried_render_descriptor_key and
its directory by function and content keys). VertexInputState's encoding
loses a field: covered by ARTIFACT_FORMAT_VERSION 598 (previous commit).

Consumer search: consumer-uses.sh at the consumer's 19b32575f: 0 code hits
for pulled_vertex_buffers, variant_pulled, RenderLinkInputs,
VertexInputState, VariantKey. In-tree grep after the change: no
pulled_vertex_buffers or variant_pulled.

Checked by the lane tip's jobs, named in the lane report.
2026-11-25 17:16:50 -08:00
Anees Iqbal aa2b0fc670 Translator: delete the one-row and unit-axes kernel variants, and the unit-axes relief
VariantKey::one_row and VariantKey::unit_axes had no product setter: every
product path builds VariantKey::new() (the runtime's render_variant_key call,
compile_render_pipeline, compile_mesh_pipeline, render_pipeline_key, the stage
entries), and the runtime's kernel route builds its LoweringInputs through
kernel_inputs_read and kernel_variant, which set neither. Their forms ran only
under tests.

Deleted with them:
- LoweringInputs::one_row and ::unit_axes, their key tags ("one-row",
  "unit-axes", appended only when set, so no product key moves);
- RuntimeFact::OneRow (emitted only under the variant) and the one-row
  branches of the lockstep order (OrderKey::one_row, the cleared-rows
  retain); a device's profile now fixes the whole OrderKey, so a stage entry
  keeps one ordered entry (KEPT_ORDERS 2 -> 1);
- RuntimeFact::UnitAxes and its computation (divergent::unit_relief, the
  relief at workgroup.rs and divergent.rs, up to seven uniformity analyses a
  predicated kernel), and the unit-axes support of the uniformity analysis
  (Uniformity::with_unit_axes, the `unit` parameter). Readers checked: the
  runtime ignored it (pipeline.rs, `UnitAxes { axes: 0, .. } => {}`, gone);
  validation, the harness and the conformance suite name it nowhere; the
  CLI's --emit-meta writes every dependency generically, so the fact leaves
  that JSON and nothing there reads it; docs/API.md's paragraph is rewritten.
- Tests of the variants: the one-row halves of
  engine_simd_emulated (now a_row_tile_keeps_its_lockstep_barriers_and_records_row_lockstep),
  engine_simd_lockstep (now ..._clears_a_tree_reduction_in_rows, which asserts
  RowLockstep on the plain pipeline and its absence for the mixed guard), the
  harness's cells test, and the runtime test's relief check (now
  every_device_runs_a_kernel_whose_walk_diverges_by_row, which still runs the
  predicated walk and checks Metal's sums).

ARTIFACT_FORMAT_VERSION 597 -> 598: the codec loses RuntimeFact::OneRow and
::UnitAxes (and, in the next commits, VertexInputState::variant_pulled).
SEMANTICS_VERSION unchanged: no product output changes under a kept key.

Consumer search: consumer-uses.sh at the consumer's 19b32575f (development
and 9 steelbrain/* refs younger than a day): 0 code hits for one_row,
unit_axes, OneRow, UnitAxes, VariantKey, LoweringInputs, RuntimeFact.
In-tree grep after the change: no one_row, unit_axes, OneRow or UnitAxes
outside unrelated locals (dispatch.rs's DeepThreadgroup `one_row` spec value,
conformance locals).

Checked by the lane tip's jobs (quick check, suites, golden diff, states-only
play), named in the lane report.
2026-11-25 17:16:50 -08:00
Anees Iqbal 6db36df158 Tests: the refused device's memory view has three doors, and a device opens through it only by the floor's choice
What: cached_types_incoherent moves from tests/mod.rs into tests::command::on_device and is no
longer crate-visible. The tests reach it through three doors alone:
- each_device_under_the_view, the one way a test opens a device through the view; the floor's
  choice over the viewed types decides the arm, and a refused make is asserted and printed;
- viewed, which returns a device's memory properties read through the view (the coherence test's
  read of the types a device under m2v_shared_view reads); it takes and returns a value, so it is
  no DeviceOptions::memory;
- suite_view, compiled only under m2v_shared_view, the suite-wide hook in Device::new that gives
  every device the view where the test gives none.
The doc mentions of the old path (coherence.rs, floor.rs, the settle test, docs/VALIDATION.md)
name the new one.

Why: the planner's ask after the second red of this class today. kkview (cb3d913139) fixed two
view tests that opened KosmicKrisp through the view raw, and the settle test (f78d45b9e0) was a
third, landed beside that fix. With the view private, a new test cannot pass it to
DeviceOptions::memory in the device cfgs; it has to take each_device_under_the_view. The
m2v_shared_view hook stays a door of its own because that cfg runs the whole unchanged suite
through the view on cards the floor opens under it (docs/VALIDATION.md), which no per-test helper
gives. Test only; the runtime does not change.
2026-11-25 16:54:02 -08:00
Anees Iqbal 5f3ffaaa28 Tests: the early member's settle test takes the floor's choice over the view as its arm, on every device
What: every_device_settles_an_early_members_shared_writes_at_its_own_completion's second arm,
under m2v_gpu, opened each device through the refused device's memory view
(cached_types_incoherent) with each_device_with and panicked where the make was refused. It now
runs through each_device_under_the_view, the helper the view tests share since cb3d913139: the
floor's choice over the viewed memory properties decides the arm. Where it chooses, the device
opens through the view with the chosen types and the body runs as before. Where it refuses, the
make is refused with exactly that refusal, which is printed.

Why: round 6c43304e65-1125-1610's Mac leg (m3-max-74364, KosmicKrisp on the M3, Mesa 26.3.1) was
red on this one test, 747 of 748: "the device is below the runtime's floor: it lacks a memory type
with DEVICE_LOCAL | HOST_VISIBLE | HOST_COHERENT for buffers (the device offers buffers: type 0
with DEVICE_LOCAL | HOST_VISIBLE | HOST_CACHED)". That device's one host-visible, host-cached
buffer type also holds the parameter ring, so under the view no coherent type is left for the
ring, and the floor refuses it, as it should. This is the class kkview fixed in the two view tests
(cb3d913139). The test came with the submit-thread stack, which landed beside that fix and was
never run on that venue. Test only; the runtime does not change.
2026-11-25 16:51:23 -08:00
Anees Iqbal e9484b7d03 Replay dumps: a texture the cover rule holds covered is dumped with a whole-texture cover
A heap texture that another placement's texture wrote over after its last write was reported by
compare-dumps as a difference: the dump loop passed no cover for a texture (dumps.rs: "always `-`
for a texture"), so the bytes Metal leaves undefined there were compared. Each texture a listed
command buffer stores or binds is now dumped, when the dump reads it (after the wait that saw
the command buffer complete, the moment a buffer's ranges are taken), with the cover 0..N, N its
dump's length, where the cover rule holds any byte of it covered (Covers::covered), and `-`
otherwise. A texture's ranges in the rule are its bytes in its heap, which the dump's parts are
not laid out as, so a covered texture is covered whole. The compare then leaves its words out
as it leaves out a covered buffer word. dumps.rs and docs/REPLAY-STREAM.md section 10 say so.

Test: the_dump_compare_leaves_out_a_covered_texture_and_reports_one_outside_every_cover (no
device; Kept reads a texture part's first word from a per-texture word where it holds one). Of
three textures placed in a heap, #5 and #6 over each other and #7 apart, two dispatches of a
state that writes slot 0 write #5 then #6, which covers #5; the second play reads #5 and #7
otherwise. #5's cover is 0..32 and its differing word is counted covered; #7, covered by
nothing, is the one difference reported.

Verified at this commit: nothing yet; the lane's jobs follow.
2026-11-25 16:41:51 -08:00
Anees Iqbal f6b1adf204 Replay player: a layered pass plays as the runtime builds it, and its dump holds each slice
The player marked a pass whose renderTargetArrayLength is 2 or more as one the runtime's
descriptor does not hold (Unheld(renderTargetArrayLength)) and skipped its encoder, though
RenderPassDescriptor::render_target_array_length takes it: the runtime renders that many slices
from each attachment's slice, refuses an attachment with fewer slices (AttachmentPlace) and
answers a length past maxFramebufferLayers with Gap::RenderPass of ArrayLength. The player now
sets render_target_array_length from the recorded value (narrowed to u32 as the other counts
are) and lets the runtime decide: a gap is a skipped encoder counted by the gap, and a refusal
stays the play's error. The attachments already carry slice and resolveSlice into the
runtime's descriptor; no other field is dropped for a layered pass.

The dump's stores read a layered pass's attachment as its first slice alone. They now keep each
pass descriptor's renderTargetArrayLength from its m2v.setPass record and store that many slices
from the attachment's slice (or the resolve's), through the MTLStoreActionUnknown path too.
dumps.rs and docs/REPLAY-STREAM.md (sections 10's skipped encoders and the dump) say so.

Tests: a_layered_pass_plays_and_its_draw_renders_the_layer_it_selects (device cfg; a stream of
a 2D array of two slices, R32Uint, renderTargetArrayLength 2, cleared to 7, and rt6_layered's
triangle selecting layer 1: no encoder or draw skipped, the blit's check of both slices matches
7 then 0x101, and the dump of the command buffer holds both slices) and
a_layered_pass_s_dump_holds_each_slice_it_renders (no device; Kept: length 3 stores slices 1 to
3 of a Store attachment and 0 to 2 of an Unknown one, length 1 the slice alone).

Verified at this commit: nothing yet; the lane's lavapipe job and the quick check follow.
2026-11-25 16:41:37 -08:00
Anees Iqbal 6c43304e65 Tests: the poke guard stages its hold only where the busy work is seen complete behind the gate
ce87e6bc96's gate hung the guard on lavapipe: the quick check (job m3-max-74323) and a run alone
(m3-max-74325) each timed out in a wait at 60 s, while the RX 7900 XTX passed it (m3-max-74331:
"X held with 6 seen complete behind the gate, the busy work's last 6; 1 pokes"). A probe that
printed each step and the stall reports (m3-max-74338, steelbrain/pokeguard-diag e3e2cc5345,
never landed) showed why. The GPU had finished the busy work (the progress counter at 6). The
completion thread had retired busy1 (progress 4), poked once, and was still in that round, "its
step last entered reading 1 retirees' timestamps". Y waited staged for room that only the next
round gives. Lavapipe does not return that vkGetQueryPoolResults read (no WAIT flag) while its
queue waits on the test's gate batch, a semaphore only the test signals, so the round never
ended. The runtime missed no wake: a guest cannot submit a wait ahead of its signal (the README:
the submit thread holds such a wait, its command buffer Committed). The one such wait is the
test's own gate.

The hold is now staged where the device shows it can be: after the busy work opens, the test
gives the completion thread SEEN (5 s) to see the busy work's last value. Where it does, the
round that raised it has poked already, so the group and Y go and X is held. The test asserts as
before that nothing past the busy work was seen behind the gate, X's hold, and the one poke from
X's hold to L's handler. Where it does not, the test opens the gate at once and prints "the hold
not staged" with the completion side's stall report, and asserts neither the hold nor the poke.
Lavapipe can stage it too, where one round sees the whole busy work. There is no device-kind guard.

Test only; no product change. Verified at this commit: nothing yet. The quick check, the device
runs on the RX 7900 XTX, the Iris Xe and an RTX 3090, and the red control follow in the lane's
jobs.
2026-11-25 16:09:21 -08:00
Anees Iqbal df39c2eea4 Tests: the poke guard holds the group behind a gate of its own until X's hold is asserted
every_device_pokes_the_submit_thread_for_a_completion_that_leaves_room needed S, sized to about
100 ms from a measured run, to still be running when X was held, and retried with S's copies
doubled where the completion thread had seen S complete by then. On lavapipe in the quick
check's whole-suite run at b87236c3fc (job m3-max-74285, llvmpipe LLVM 23.1.1) S was seen
complete first in all 4 attempts and the test failed. Run alone at the same commit (job
m3-max-74322) it passed at its first attempt, with 1 poke; its two sizing runs read 4.7 ms and
16.7 ms for the same 8 copies a moment apart. The red is the host's timing, not the merged tree:
kkview's run_settled keeps each_device's steps and their order.

The test now submits a second gate (Busy:🆕 a batch on the device's one VkQueue that waits
for a timeline semaphore only the host signals) after the busy work and before the group goes,
which it does only once the busy work is seen complete. A semaphore wait holds every later
command in submission order, so S, A, L and Y cannot run, and no completion past the busy work
can come, until the test opens the gate after it has read the pokes and asserted X's hold. The
test now asserts what the retry read, that the completion thread has seen nothing past the busy
work's last value at that point, and asserts X's hold unconditionally. The retry loop and S's
100 ms aim go; S and L both take one sizing of about 10 ms. Every assertion stays: S, A and L
held in one group, sent member by member after the long run, Y then X held behind them, and one
poke from X's hold to L's handler.

The gate is made just before the busy work opens: its batch's fence follows the busy work, so
dropped by a failed check before that, it would wait forever for the closed busy gate.

The stack's siblings rely on L's GPU run, not on S's outlasting the host's calls, and no gate
fits them: every_device_signals_each_member_of_a_group_sent_apart reads A's value while L runs,
and every_device_settles_an_early_members_shared_writes_at_its_own_completion asks, where the
device holds a coherence state, for A's sight before L's GPU end. Both need L running on the GPU
while the host looks; the submit thread submits A's and L's batches under one hold of the queue
lock, so no batch goes between them, and a host-set VkEvent may not gate a pending command buffer
(VUID-vkSetEvent-event-09543). every_device_feeds_an_early_members_run_to_its_queue_as_the_last_retires
uses fills and no length. They are unchanged.

Test only; no product change. Verified at this commit: the classification runs above. Not yet
run at this commit: the quick check (lavapipe rt suite), the runtime device suite on the RX 7900
XTX, the Iris Xe and an RTX 3090, and the guard alone with Work::completed's wake_at test
reverted, which is expected to fail; their jobs follow.
2026-11-25 16:09:21 -08:00
Anees Iqbal c43f1a5447 Replay player: setSamplePositions:count: plays on a pass descriptor, and passes at other positions are counted
The runtime player refused setSamplePositions:count: on a render pass
descriptor ("not played on a render pass descriptor"), so every play of a
stream whose 2D renderer sets positions on its 4-sample pass stopped before
that pass.

It now plays the call as the runtime treats it: the runtime's descriptor has
no field for the positions and every multisample pass rasterizes at Vulkan's
standard sample locations, so nothing is set and nothing is refused. The pass
keeps the positions its last call set, and each render encoder the runtime
makes of a pass whose positions differ from Metal's defaults for the pass's
sample count (its attachments', or defaultRasterSampleCount with none) is
counted on a report line, with the first one's frame and call:
"passes at sample positions other than Metal's defaults N: rasterized at the
defaults, Vulkan's standard locations; the first at frame F, call C".

Metal's defaults are taken as Vulkan's standard locations at 1, 2 and 4
samples (the spec's Standard Sample Locations table; the runtime's floor row
standardSampleLocations and its known gap name them Metal's defaults at those
counts; the conformance rows sample-positions-default-4x/-2x). No other
count's defaults are held, so a set at any other count counts as differing;
an empty list (count 0) is the defaults.

Tests: rt_replay's sample_positions_play_and_a_pass_at_other_positions_is_counted
writes its own stream, two passes over a 4-sample target, one at the 4x
defaults and one at four others; it plays through with nothing skipped and
the line counts only the second (call 12). Without the fix the play stops
refused at call 5. new_runtime's
sample_positions_differ_from_metal_s_defaults_of_the_pass_s_count checks the
comparison (defaults, one coordinate off, reordered, fewer positions than
samples, Vulkan's 8x locations) and the line at zero, without a device.

Docs: docs/REPLAY-STREAM.md lists the call among the pass descriptor's
setters and says how the backend plays and counts it.
2026-11-25 15:48:21 -08:00
Anees Iqbal e5bac28d23 Runtime docs: a compressed copy at the clamped size into the inside of a larger level stays refused, and why
What: place()'s doc and the runtime README's refused list for copy_from_texture name the basis
for refusing, as Refusal::TextureRegion, a size of no whole blocks that stops at the source
level's edge and inside the destination's level (4 x 2 texels of a BC level of 4 x 2 into the
second block of a level of 8 x 4, the size Apple's page for the copy asks for). Three facts:
- Metal's validation layer stops it, "size.height(2) must be a multiple of
  MTLPixelFormatBC1_RGBA blockHeight(4)" (2 x 1: the width too), taking a size of no whole
  blocks only where both places reach their edges;
- plain Metal lands the source's block by no one rule: from level 9 (4 x 2) at the block named,
  level 8 (4,0) ("dm"); from level 10 (2 x 1) at level 8's first block, (0,0) ("md"), not the
  (4,0) the copy names;
- Vulkan's copies chapter still says "Copy regions for each image must be aligned to a multiple
  of the texel block extent in each dimension, except at the edges of the image, where region
  extents must match the edge of the image", while in Vulkan 1.4.366 only the source's extent
  has a valid usage of that (VUID-vkCmdCopyImage-srcImage-01728/-01729); the destination's
  dstImage-01732/-01733/-01734 were removed in 1.4.316 ("Remove common copy image VUs
  constraining extent with compressed destination images", internal issue 4113), leaving
  dstOffset-00150/-00151 and pRegions-07281/-07282.
The README's "Not built" sentence becomes a bullet of its own after the refused one. The probe's
header line on copies between levels no longer says 10to8 lands the block named: it lands it at
level 8's first block.

Why: the bug row's case left after the blockedge lane. Metal's answer for it is recorded, and it
is not well defined, so the refusal stays (main's ruling of the stop, 11-25) and its doc names
the basis instead of "no texel is there to copy".

Verified: Metal's answer is read from job m3-max-73696's log (an Apple M3 Max, macOS 27.0.1,
26A434): bc1/bc3, mp and pp, 9to8-clamp and 10to8-clamp, layer on (signal 6 at the call) and off
(status 4; levels fnv BC1 905021b8270b2f7d / e29c43c95a986a65, BC3 0e3db2fa9a018635 /
ba80003e40f740e5, each equal to its 4x4 form's). Vulkan's terms are from vkspec.txt 1.4.366 and
its ChangeLog.adoc. refusal_surface.py --check: unchanged. No code changed; the quick check runs
at this commit.
2026-11-25 15:47:58 -08:00
Anees Iqbal b87236c3fc Landing note: the submit-thread stack's cost and wall on the 780M and the XTX, as measured
An empty commit: published history is never amended, so the stack's measured cost is stated here,
on top of it. It changes no file.

The stack (each member of a group sent apart signals its own progress value; a completion wakes
the submit thread only when it can leave room; an early member feeds the expected run as the last
retires; enqueue and commit wake waits only where a thread waits), rebased onto development
efd7dbcd4d. Budget jobs: the harness's instruction rows and the draw and dispatch instruction
tests, before (development efd7dbcd4d) and after (da6afd1b74, whose product code equals this
tip's), alternated three times in one exclusive job per card. Each figure below is per timed run,
the three passes in order. Instructions are own_per_run: the runtime's threads and the harness's,
in user space.

Per dispatch 0.944 on both cards (780M 38434 -> 36275/36274/36274, XTX 38427 -> 36266/36267/36267)
and per draw 1.000 on both (12244 in both arms).

780M (RADV PHOENIX, job m3-max-74155), the rows that failed (b):
- burst_160: instructions up by 1.0218 (before 4334360/4342825/4356199, after
  4445226/4434268/4438013); wall before 624.5/607.8/610.0 us, after 578.8/572.8/584.0 us, wholly
  below; submissions before 17.59/16.78/16.87, after 13.23/14.43/13.26.
- burst_160_shared: instructions up by 1.0224 (before 4366162/4352586/4353147, after
  4443101/4470494/4450471); wall before 640.2/630.1/633.5 us, after 585.3/594.1/585.1 us, wholly
  below; submissions before 17.98/18.23/17.88, after 14.03/16.27/14.53.
- burst_2000: instructions up by 1.0226 (before 49203922/49011492/49099261, after
  50271148/50106146/50265990); wall before 7483.9/7469.9/7332.6 us, after 7013.3/6891.9/6948.3 us,
  wholly below; submissions before 241.69/250.09/239.58, after 218.75/216.88/214.50.
- burst_2000x5: instructions up by 1.0088 (before 98762327/98831256/98938899, after
  99773524/99728752/99642838); wall before 11853.0/11648.5/11613.5 us, after
  11766.1/11658.5/11857.6 us, the ranges overlap; submissions before 193.64/206.46/194.78, after
  185.68/182.57/186.84.

XTX (RADV NAVI31, job m3-max-74154):
- burst_160_shared, failed (b): instructions up by 1.0076 (before 4671450/4693624/4686014, after
  4707679/4713619/4737142); wall before 1097.2/1103.4/1096.2 us, after 1100.4/1097.8/1100.6 us,
  the ranges overlap; submissions before 13.88/13.72/13.76, after 13.76/13.81/13.63.
- burst_2000, failed (b): instructions up by 1.0084 (before 48405591/48482937/48645781, after
  48906000/48952717/48892406); wall before 9346.9/9465.9/9298.0 us, after 8986.1/8954.1/9068.0 us,
  wholly below; submissions before 391.11/411.76/393.94, after 312.56/302.02/321.07.
- burst_160, read under (c) (spread 5.70% in the after arm; ratio of means 1.0388): instructions
  before 4308890/4306596/4337184, after 4335127/4582028/4538356, the ranges overlap; wall before
  830.0/829.9/823.0 us, after 866.3/790.2/796.4 us, the ranges overlap; submissions before
  21.62/23.97/20.57, after 29.87/14.82/15.76.
- burst_2000x5, passed (b) at 1.0035: whole-process instructions before
  97575132/97961952/97592923, after 98067782/98145547/97956382; wall before
  17543.8/17768.5/17594.0 us, after 17033.4/16983.0/17281.6 us, wholly below; submissions before
  543.60/605.65/549.99, after 450.69/432.33/478.58.

(b) of the budget rule was not met; it did not decide, because the change moves the submission
count and a submission's kernel side is in neither user-space measure, so each failing row was
read with its wall, and no row's wall rose.

This is not a known gap, and the runtime's README gains no line for it.

Gates at the tip's tree (f38f8d527c, whose tree this commit keeps): quick check m3-max-74172
(signatures, clippy plain, m2v_gpu and m2v_cpu_icd, rustdoc, rt's whole suite on lavapipe 752/3,
the conformance replay on lavapipe); suites m3-max-74126 at 7224d73dd9 (validation, conformance,
doctests green; product red only on the golden table's bless due, development's, with no
translator change here); rt's device suite under the validation layer with the GPU-hazard tests
out, 755 passed and 3 skipped on each of: Iris (ANV) m3-max-74184, XTX (RADV) m3-max-74176,
Iris under --cfg m2v_shared_view m3-max-74175, RTX 3090 (NVIDIA) m3-max-74257; the control
m3-max-74158 on the RTX 3090, at da6afd1b74 (an early member's settle deferred to the group's
last, a scratch patch never committed), failed the settle test (A's handler read 0 invalidates
against 1 of 256 bytes) and the unpatched archive passed it in the same job.
2026-11-25 15:34:17 -08:00
Anees Iqbal 3cafd30596 Tests: the early member's settle test asks for A's early sight only where the device holds coherence state
every_device_settles_an_early_members_shared_writes_at_its_own_completion failed on lavapipe in
the quick check's whole-suite run (job m3-max-74149, msi-laptop, llvmpipe) with "A seen complete
before L's GPU end" after its four attempts. Lavapipe retires A together with L: its completion
thread's round does not see A's own value before L completes, as the stack's lane found for the
poke guard. Lavapipe's one memory type is host-coherent, so the device holds no coherence state
there, and the test's only checks are that no flush or invalidate is made and each handler
reads its fill. Neither depends on A being seen early.

A's sight before L's GPU end, and the retries that look for it, are now asked for only where the
device holds a coherence state. That covers every GPU through the refused device's view, and
every GPU under --cfg m2v_shared_view. There the invalidate counts at A's handler and at A's
status are exact only for a sight before L's end. On a device with no state the test asserts
zero calls at A's handler, at A's status and at L's handler. The pass line now prints whether A
was seen early.

On the Iris under the view (job m3-max-74153, at da6afd1b74) A's handler ran 7.68 ms and its
status was seen 7.40 ms before L's GPU end, with one invalidate of 256 bytes each time. The
control job with the settle deferred to the group's last is m3-max-74158.

Test only.
2026-11-25 15:34:17 -08:00
Anees Iqbal b9da46258e Tests: the poke guard and the early member's settle test print the attempt that asserted
every_device_pokes_the_submit_thread_for_a_completion_that_leaves_room asserts X's hold only on an
attempt where S was not seen complete first (1b4595dea9). An attempt where it was goes again, up
to four. The fourth fails, so a pass always has one attempt that asserted the hold. The failure
now says the hold was never observed. The pass line names the attempt that asserted it, so each
run shows the hold was checked and on which attempt.
every_device_settles_an_early_members_shared_writes_at_its_own_completion's line names its
attempt as well.

Test only.
2026-11-25 15:34:17 -08:00
Anees Iqbal cd6797fb47 Tests: an early member of a group sent apart has its Shared writes invalidated at its own completion
The stack moves a member of a group sent member by member to retire at its own progress value.
A-narrow's invalidate of the Shared memory a command buffer may write sits in that retirement
(command::retire, coherence::Coherence::settle), ahead of its status and its handlers. Until now
no test read the invalidates for such a member. tests/coherence.rs reads them for one command
buffer filled and finished alone. The stack's guards read progress values, runs and pokes.

every_device_settles_an_early_members_shared_writes_at_its_own_completion builds on those guards'
helpers (behind_busy, halves, halves_for, Arena). A fills one Shared buffer of the arena. L runs
copies sized to about 10 ms and then fills another. Both are held behind the busy work in one
group, which goes member by member. Where the device holds a coherence state, the test asserts
three things, each counted since the group was held:
- at A's completed handler, run while L still runs (its host time before L's GPU end), one
  invalidate of A's 256 bytes and no failed call;
- at A's status seen complete on the test thread, also before L's GPU end, the same;
- at L's handler, two invalidates over 512 bytes.
Each handler reads its own buffer's fill. Where the device holds no coherence state, it asserts
that no flush or invalidate was made at all. Each device runs the test as it reads its types:
the coherent lab cards and lavapipe make no calls, and under --cfg m2v_shared_view every GPU holds
the state. Under plain m2v_gpu it also runs through the refused device's view
(tests::cached_types_incoherent), so every GPU leg runs both forms. An attempt where A was seen
complete only after L's GPU end goes again with L's copies doubled, up to four attempts.

The test fails if the invalidate moves to the group's last or past the handlers. A control job
with the early members' settles deferred to the group's last retirement (a scratch patch, never
committed) shows that; its job id is in the lane's report.

Test only; no product change.
2026-11-25 15:34:17 -08:00
Anees Iqbal 541068fb7b Tests: the poke guard reads X's hold only where S was not seen complete first
every_device_pokes_the_submit_thread_for_a_completion_that_leaves_room asserted that X was held
behind the group and Y before it read whether the completion thread had already seen S complete.
The test's own retry, for an S that completes before X is held, came after that assertion and
never ran. On lavapipe in the quick check's whole-suite run (job m3-max-74125, homelab-gem10-1,
llvmpipe, nextest at its default parallelism and no LP_NUM_THREADS), the count read AHEAD + 5
against AHEAD + 4: X was submitted, not held, at the first attempt, 0.44 s into the test.

X gets room only once the group's last member is seen complete. Behind the group and Y, the
queue's in-flight list holds the group's entry until L's value retires. The expected run the
test set (1 s), halved by the busy work's three retirements, stays far above GROUP_RUN, so no
shorter run frees room. Any completion past the busy work raises Done::completed above
busy_last before the test reads it, so an attempt where X got room always reads `early`. The hold
is now asserted only where `early` is false. Where it is true, the attempt goes again with S's
copies doubled, as the test already did, and the final `assert!(!early)` still fails a fourth
such attempt. S is sized from a run measured under the suite's load, so it can run shorter than
its 100 ms aim once the load eases.

Test only; no product change. Verified: expected to pass again in the next quick check's lavapipe
whole-suite run (STEP lvp_rt), with the guard's red control unchanged (its poke count assertion
is untouched).
2026-11-25 15:34:17 -08:00
Anees Iqbal c4aded723b Tests: wake_at's guard opens its window before S's round can poke
The guard passed with wake_at reverted on lavapipe (job m3-max-72805): S's
round poked the submit thread before the window opened, while S's status still
read scheduled, its round stalled in the timestamp read behind the queue's
later work. A round raises what the completion thread has seen before it pokes,
so the test now reads that against the busy work's last value as the window
opens, and runs again with S's copies doubled where the completion thread had
seen S by then; S's copies are sized to about 100 ms.
2026-11-25 15:34:17 -08:00
Anees Iqbal 3668435cfb Runtime: a command buffer's enqueue and commit wake its waits only where a thread waits
Every commit called notify_all on the command buffer's condition variable, at
its enqueue and again at its commit: each a futex wake, a system call whether
or not a thread waits, about 1.2 us a commit in a consumer's profile. The
command buffer's state now counts the threads waiting on it, under the same
lock, and both notify only where one waits. A device test has a thread wait
for a command buffer not yet committed: the commit wakes it, and the wait
returns once the command buffer completed.
2026-11-25 15:34:17 -08:00
Anees Iqbal 6930e494d6 Tests: guards for the submit thread's wake at a group's last and the expected run's feed
Two device tests, each failing without its change:
- an early member of a group sent member by member leaves its queue's
  retirement count and expected run as they stood until the group's last
  retires: A's handler and L's see the count two apart and the run fed twice;
- while a queue holds a command buffer behind such a group and one more
  submission, the members ahead of the group's last complete without poking the
  submit thread, and the last's completion pokes it once (a count of pokes the
  device tests read).

The apart-group test's long copies and their sizing become helpers the new
test shares.
2026-11-25 15:34:17 -08:00
Anees Iqbal 7e945bc38b Runtime: a member that completes before its group's last feeds the expected run as the last retires
With each member of a group sent member by member signalling its own value,
a member retires early, and its GPU run fed its queue's expected run and its
retirement count at once. The submit thread's joins, its count of joins since
a retirement and its parting of groups then read runs the single signal never
showed them, at other points: on an RTX 3090 the per-member signal made 7.8-40%
more vkQueueSubmit2 calls per command buffer (jobs m3-max-72705, 72726).

A member that completes before its submission's last still retires, and its
handlers run, at once; only its run waits, kept in order on the completion
thread, and feeds the queue as the last retires, where it did with one signal.

On the RTX 3090 (job m3-max-72726, every arm at P0) it made 0.466 and 0.472
calls per command buffer with 6 shorts a long, 16 in flight, against the base
arms' 0.518 and 0.513 and the threshold form's 0.538 and 0.574: fewer than the
base, as a host that hears a member complete at its own end commits while the
group is still in flight, finds no room and joins a held group. On the
consumer's RX 7900 XTX guest run (job m3-max-72747) the w3 burst took 567.06 us
a buffer against the base arms' 575.21 and 570.52. The lavapipe test, clippy
in three configurations and rt's suite passed with it (job m3-max-72725).
2026-11-25 15:34:17 -08:00
Anees Iqbal e42fc0cc53 Runtime: a completion wakes the submit thread only when it can leave room
Since each member of a group sent member by member signals its own progress
value, every member retires in a round of its own, and each such round woke
the submit thread while its queue held work. A member's completion cannot leave
room: a queue's submission in flight is the group's, at its last value, and
room changes only as that completes.

The flag that said a queue holds work becomes the value whose completion can
leave room: the first submission in flight of each queue that holds, the lowest
of them; 0 while the thread passes, so a completion during the pass still wakes
it, and none while nothing is held. The completion thread wakes the thread for
a round that reached it, and for a round that fired events or found the device
lost, as before.

On an RTX 3090 (job m3-max-72705, every arm at P0, base, per-member signal,
this, this, per-member signal, base at 8 s), the submit thread's timeslices per
command buffer over the base fell from +47.6% to +16.4% (2 shorts a long, 16
in flight) and from +34.8% to +6.8% (6 shorts a long), and its CPU per command
buffer from +3.94% to +3.51% and from +8.55% to +0.78%, at rates within 0.2%.
The lavapipe test, clippy in three configurations and rt's suite passed with
it (job m3-max-72695).
2026-11-25 15:34:17 -08:00
Anees Iqbal 3f3dc7fd73 Runtime: each member of a group sent apart signals its own progress value
A held group whose summed expected run passes GROUP_RUN as it goes is sent member by member,
one vkQueueSubmit2 each, and only the last call signalled the progress semaphore. A member ahead
of a long one was then seen complete (its status, its completed handlers, waitUntilCompleted)
only at the group's end, late by the GPU runs of the members after it. Metal completes each
command buffer at its own end. On an RX 7900 XTX (RADV) a guest's compute work showed it: its
8-16 ms spans from GPU end to handlers matched its 8-16 ms GPU runs one for one, with submissions
equal to commits, so those groups went member by member.

Each part of such a group now signals its own value, the last part the group's, and each member
retires at its own part's. The calls, their submit infos and the room rule are unchanged: the
queue counts the group one submission in flight, at its last value. Uploads and copy-ins retire
at the group's value as before, and the held-start gap keys on the group's value. A group sent in
one call keeps its one signal.

Verified on lavapipe, job m3-max-72649: the new device test polls the progress semaphore while
a group of a fill A and a long copy L (about 10 ms) goes member by member. In three repeats it
read A's value 59-254 us after A's GPU end, and the group's last at L's end, 9.3-10.9 ms after.
With this commit's runtime files taken back, the counter went from the busy work's value to the
group's at L's end (9.6 ms) and the test fails. rt's suite on lavapipe: 714 passed, 3 skipped.
Clippy with -D warnings plain, under --cfg m2v_gpu and under --cfg m2v_cpu_icd: clean. On
lavapipe A's handler still begins after L's end: the round before it waits in
vkGetQueryPoolResults behind the queue's execution there (jobs m3-max-72643, m3-max-72616), so
the handler times are read on a card.
2026-11-25 15:34:17 -08:00
Anees Iqbal cb3d913139 Runtime tests: the view tests take the floor's choice over the view as their arm, on every device
What: tests::floor's a_device_with_no_cached_coherent_type_opens_where_the_floor_chooses_its_types
and tests::coherence's view test (renamed from every_gpu_read_as_the_refused_device_... to
every_device_opened_under_the_view_flushes_and_invalidates_the_shared_memory_work_reaches) share
one helper beside open_each_device, tests::command::on_device::each_device_under_the_view. For each
device of the cfg's kind it reads the buffer bits from a device made with no view, takes the
floor's choice (floor::choose) over the viewed memory properties, and makes the device through the
view: where the choice refuses, the make must refuse with exactly BelowFloor { missing } from that
choice, and one line names the device and the refusal; where it chooses, the device must open with
the chosen types and the test's body runs on it, settled and with its gauges checked at drop as
open_each_device does (its per-device steps are now run_settled, which both use). The floor test's
`if cfg!(m2v_cpu_icd)` guard is gone, and the coherence test's #[cfg(m2v_gpu)] with it: both run
under every device cfg. The doc comments state the structure: a device whose one host-visible,
host-cached buffer type also holds the parameter ring is refused under the view, with its refusal.

Why: round efd7dbcd4d-1125-1433, leg mac:rt (job m3-max-74110), KosmicKrisp 26.3.1 on the M3: both
tests failed with "below the runtime's floor: it lacks a memory type with DEVICE_LOCAL |
HOST_VISIBLE | HOST_COHERENT for buffers (the device offers buffers: type 0 with DEVICE_LOCAL |
HOST_VISIBLE | HOST_CACHED)". That device's one buffer type also holds the parameter ring, as
lavapipe's does, so the view leaves no ring type and the floor refuses it, as it should. The floor
test took the refusal arm by the device's kind; the coherence test had none.

Test-only; the runtime's behaviour is unchanged. docs/VALIDATION.md's m2v_shared_view note checked:
nothing in it is false, unchanged.

Verified: cargo fmt only; the quick check, the KosmicKrisp rt leg on the M3 and the Iris view leg
follow.
2026-11-25 15:31:35 -08:00
Anees Iqbal 5e8b3cbcd7 Runtime README: the attachment read over a buffer in place keeps its fact, not the forms once ruled
What: the known gap for a draw that reads its own target over a buffer in place keeps what is true
now (refused on every device as AttachmentRead; no play of the replay streams met it) and drops the
sentence naming the forms ruled for it should a stream meet it.

Why: a README says what is true now. That sentence's second form, unified image layouts with a
LINEAR feedback image, needs a unifiedImageLayouts query, which would be a twelfth form under
AGENTS.md rule 2 and is the owner's word alone. The forms stay on file in the planner's plan,
outside the tree.

Verified: docs only; no other file quotes the sentence (grep over *.md, *.rs, *.py, *.tsv).
The whole-workspace docs check runs with development's checks at this tip.
2026-11-25 15:30:53 -08:00
Anees Iqbal 75dfcedf48 Landing note: the host write into a stale heap texture, verified on every venue
What: no change. This notes the evidence for 358a78fcf3..ca3d489bcd, whose own message ends
"Verified so far" before the gates read. Published history is never amended.

Verified:
- The new test reads heap_moves as (at the host write, at the later GPU write) for three later
  writes: generateMipmaps, a blit into another region, a pass that loads the texture.
  - Base 358a78fcf3, lavapipe, job m3-max-74235: (0, 1) in all three, red.
  - Tip ca3d489bcd, lavapipe, job m3-max-74248: (1, 0) in all three, green; 18 of 18 alias,
    heap_alias and heap tests passed.
- The runtime's device suite at ca3d489bcd, from one m2v_gpu archive (m3-max-74252):
  XTX (RADV) m3-max-74254, Iris Xe (ANV) m3-max-74255, RTX 3090 (NVIDIA 620.70.06) m3-max-74256;
  751 of 751 passed on each, the new test (1, 0) in all three rounds, the region kept.
- Quick check m3-max-74249: signatures, clippy plain and under each device cfg, rustdoc, lavapipe's
  rt suite 748 of 748, the conformance replay with 0 ledger drift lines. Suites check m3-max-74251:
  product 3641 of 3641, golden matches, validation 1307 of 1307, conformance 1040 of 1040, doctests.
- No budget job: no harness row times uploads.

The texel loss itself was seen on no device. The base ran only on lavapipe, where the host-written
region read back intact after the move from undefined. The real cards ran only at the tip. The
heap_moves count, its place and its value, carries the proof.
2026-11-25 15:30:30 -08:00
Anees Iqbal ca3d489bcd Runtime: a host write into a stale heap texture moves it in its upload, so its next GPU write keeps the texels
What: Texture::replace_region into a heap texture that takes part in
crate::alias settles the alias state in the upload's own command buffer,
under the work lock, ahead of its copy (alias::host_write). A stale
texture moves from undefined in alias::record's barrier, after every
earlier command's writes, counted in heap_moves and barriers. Its
staleness clears and its texture links turn stale. That state change is
Placement::written, which alias::stage now shares: one write path. A
texture in no heap, or one that takes no part, pays one test and records
nothing. A linked texture that is not stale records no command. No state
is added beyond what the alias module holds.

Why: a host write marked nothing, so a texture that a write over its bytes
had left stale stayed stale through it. Its next GPU write (its mipmaps, a
blit into another region, a pass that loads it, a draw's or a dispatch's
write) then moved its whole image from undefined, and the texels the host
wrote were lost, where Metal keeps them. upload_region reaches no heap
texture (it has no named bytes; the test asserts the refusal), and no
other work.upload caller writes one.

Ordering, by reading submit.rs: three things hold the work lock: the
call's settle, a segment's staging (alias::stage in WorkState::step,
where its checks read the staleness and its writes store it), and the
close of the submission that takes the upload (take_uploads). The upload
is numbered N, the next commit. It runs ahead of every segment of the
first submission whose last leading command buffer has seq >= N, or of
the next submission after a flush.
1. X committed after the call (seq >= N): staged after the settle, and
   run after the upload. Its checks see the host write. Right.
2. X committed before the call and submitted before it, which includes
   every X the program waited for: staged before the settle, and run
   before the upload. The settle sees its stores. Right.
3. X committed before the call, not submitted when the call is made, and
   writing T or a resource over T's bytes:
   (a) staged before the settle, in a held group that a later commit
       joins or a flush sends: the upload runs ahead of X, X overwrites
       the host's texels, and T's next write misses its move;
   (b) staged after the settle, and submitted alone before the upload's
       submission: X runs first. The settle missed X's store, so where T
       was fresh its copy goes in with no move after X's write. X's store
       lands after the clear, so T's next write moves T;
   (c) staged after the settle, in the upload's submission or a later
       one: the upload runs ahead of X, X overwrites the texels, and T's
       next write moves it.
In 3a to 3c, X has not completed at the call. Apple's page for
replace(region:mipmapLevel:slice:withBytes:bytesPerRow:bytesPerImage:),
as fetched on 11-25 and relayed by main: "This method runs on the CPU
and immediately copies the pixel data into the texture. It doesn't
synchronize against any GPU memory operations to the texture. Ensure all
operations that write or render to the texture complete before reading
the texture's contents..." So order 3 is the program's race on a Mac too,
and owner rule 1 does not emulate it. The docs state it as the program's
race and say what the runtime does then. The other side, ordering the
upload after earlier commits, was ruled out: it changes the order of
every upload, or adds a second form for heap ones, and blocks the host on
queue room. When a Mac reuses a heap's bytes is unaudited.

Docs: the alias module's "A use that writes" paragraph,
Metrics::heap_moves, replace_region's doc, and the runtime README's heap
paragraph. No refusal or public item changed.

Verified so far: the new test fails at the base on lavapipe (job
m3-max-74235, msi-laptop, llvmpipe): heap_moves (host write, GPU write)
= (0, 1) for mipmaps, blit and load, against (1, 0) wanted. The tip's
lavapipe run, the gates and the device suites are reported to main as
they read.
2026-11-25 15:20:16 -08:00
Anees Iqbal 358a78fcf3 Runtime tests: a host write into a stale heap texture keeps its texels through the next GPU write
A heap texture that a write of a buffer over its bytes left stale stays
stale through a replace_region: the host write marks nothing in
crate::alias, so its next GPU write moves its whole image from undefined
and the texels the host wrote are lost, where Metal keeps them.

The test places T (64 x 64 RGBA8Unorm, two levels) and then B, a heap
buffer over its bytes. Each round fills B by a blit, writes a 16 x 16
region of T's first level by replace_region, then writes T on the GPU
elsewhere: its mipmaps, a blit from a buffer into another region of its
first level, and a pass that loads its first level. It asserts heap_moves
+1 at the host write and +0 at the GPU write, and reads back only the
region the host wrote. It also asserts that upload_region refuses a heap
texture (no named bytes), so replace_region is the one host write that
reaches one.

Expected to fail at the base: heap_moves +0 at the host write, +1 at the
GPU write. Verified by the lavapipe run reported with the fix.
2026-11-25 15:15:26 -08:00
Anees Iqbal a26b61b3b2 Census at efd7dbcd4d: the authored AIR 1.8 sampling case compiles on every profile
What: corpus/authored-compile.tsv gains case 884ad7d75a22's row (the AIR 1.8 sampling case of
f4f6fd32cf), compiled on all 9 profiles. No other row and no artifacts_at line moves: the
translator's inputs at efd7dbcd4d equal db3a88526b's.

Why: the pin at efd7dbcd4d records the census at its tip.

Verified: census job m3-max-74099 on the M3 at efd7dbcd4d: 2348 cases over 9 profiles, 21132
cells, the 9 new cells compiled, 0 failed, 1 difference (the new case), 0 regressions.
2026-11-25 14:42:35 -08:00