What: SEMANTICS_VERSION 2283 -> 2284.
Why: a kernel that stores an entry buffer's pointer as a value into a thread's private array of
device pointers was refused as Unsupported{Lowering(Access)} under the identity domains, because
the array stayed an open cell. The provenance change before this one closes the cell in two
shapes (an aggregate that stays a value; a whole-slot zero fill beside run-time-indexed
accesses), so those functions now give modules under an unchanged key.
Verified:
- Translation census of the private corpus, every row at the current fingerprint, on
runtime-floor and gate-lavapipe. Before (8ab24c9753, 2283; potluck job m3-max-70360): 17,214
rows; runtime-floor 15,352 translated, gate-lavapipe 15,589, 13 Lowering(Access) on each.
After (this tree; m3-max-70379): 17,217 rows (3 new to the index); runtime-floor 15,361
translated, gate-lavapipe 15,598, 7 Lowering(Access) on each, defects 0 and failed 0 on both.
The six functions of the two libraries this change targets translate on both profiles; the
other seven rows keep Lowering(Access), another shape. Slowest row 813 ms (runtime-floor) and
823 ms (gate-lavapipe), peak resident 221 MB and 226 MB: within 20 s and 500 MiB.
- Suites at this tree (m3-max-70381): metal2vulkan and metal2vulkan-air 3,354 of 3,355; the one
red is the golden table, stale by 45 new cells (kernel_buffer_pointer_arrays' rows), 0 gone,
0 changed, re-blessed on development. Doctests 0 failed.
- fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) and workspace Rustdoc, rc 0
(m3-max-70382).
- Earlier on the branch: red before (m3-max-70329), the two authored cases qualified on Metal
(m3-max-70355) and matched on lavapipe (m3-max-70363).
bless_engine_inventory adds kernel_buffer_pointer_arrays' six rows (both companions, the
pick, by-value and zero-filled entries), each ok on all 15 profiles; no other cell moves. The
air_input bless adds its printout and changes no other (job m3-max-70361, on the M3 Max at
d627145f66).
Two public cases over the owned kernel_buffer_pointer_arrays fixture, one threadgroup of 64
threads over a 0xab fill of the output (buffer 3):
- pointer-array-in-an-array-ref-by-value-reads-and-writes-through-run-time-elements (9fafc659...):
out[i] = {a, b}[(1 + i) % 2][i] + i, read through one element of {a, b, out} and written through
element 2, a[k] = 0x1000 + k, b[k] = 0x200000 + 7k; loop free.
- zero-filled-pointer-array-moves-and-reads-elements-at-run-time-indices (9bdd6be4...): count = 3,
out[i] = (a[i] * 31 + b[i]) * 31 + c[i], wrapping, c[k] = 0x30000000 + 13k; both loops run
min(count, 3) times (authored bounded).
Verified: corpus-case-check accepted and installed both, and corpus-metal qualified both on the M3
(apple-m3-max-macos27.0.1, job m3-max-70355). Metal's outputs equal the words computed on the CPU:
sha256 477dc52f... and 5984245e....
What: two rules of the pointer-cell verification (memory/provenance/cells.rs).
- An insertvalue whose aggregate stays a value (its every use, and every use of each aggregate
built on it, is an extractvalue, the aggregate operand of an insertvalue, or an incoming value
of a phi of such aggregates) no longer opens the allocas of the pointer it inserts. Provenance
already reads each extractvalue through its insertion chain as the inserted pointer, and the
arith family forwards it, so the pointer's accesses are the extraction's, which the walk sees.
- A zero fill beside pointer accesses at an unknown offset keeps the cell closed when every such
access lies at a multiple of the pointer's size (its offset's proven alignment) and so does each
end of the fill; exact slots must still be covered wholly or not at all. A load at an unknown
offset already reads null wherever the cell has zero bytes.
Why: a thread's array of entry buffer pointers stayed an open cell in two shapes, and under the
identity domains a static buffer pointer stored into an open cell is refused
(Unsupported{Lowering(Access)} from pointer::store_pointer, which takes only a buffer destination).
Closed, each element holds its static fat pointer (root, offset) and each access through a loaded
element switches among the slots stored there, the form an array of buffer pointers indexed at run
time already took: no device address, the same form on every device. In the private corpus's
census (runtime-floor) this was 6 functions in 2 libraries: 4 that put the array's address into an
array_ref of a struct passed by value to inlined helpers (refused under every specialization: the
real-make rows), and 2 that zero the array with a memset beside a loop that loads, moves and stores
back an element at a run-time index (plain census only; their specializations translate). The
other route, storing the static pointer's address into the open cell, would make each loaded
element a device address; it is not taken.
How verified: the owned kernel_buffer_pointer_arrays' by-value and zero-filled kernels were refused
at the guest rows' site at the parent (CLI on runtime-floor and gate-lavapipe, m3-max-70315; the
test, m3-max-70329) and compile, pass L3 and compute Metal's words on the CPU interpreter on every
identity profile here (m3-max-70341); the plain array kernel compiled before and after. Lint:
fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), workspace Rustdoc (m3-max-70346). The
translator suites, the census and the golden cells that move are in the SEMANTICS commit's body.
Over the owned kernel_buffer_pointer_arrays on every profile the identity domains derive: each of
its three kernels compiles in the identity form, moves its pointers through cell stores and loads
(3/1, 3/2 and 4/2), passes L3, and computes Metal's words on the CPU interpreter (count 2 and 3 for
the zero-filled one), leaving the other slots as they were. The identity pointer tests' push
placement now fills the stage's parameter block where a profile's push window spills, as
runtime-floor's does for five slots.
Red before the cells change that follows: pointer_array_by_value is refused as
Unsupported{Lowering(Access)} at block 0, instruction 2, the store of its first buffer into the
array (job m3-max-70329).
scripts/regen-air-fixtures compiled kernel_buffer_pointer_arrays on the M3 (Apple metal 32023.922,
SDK 27.2, recorded in TOOLCHAIN as this fixture's toolchain; LLVM 21.1.8), job m3-max-70305. In
pointer_array_by_value the kernel inserts the array's address into the array_ref member it passes
(insertvalue), and move_word extracts it; pointer_array_zero_filled's memset covers elements 1 to
15 before element 0 is stored. Its inventory rows and golden printout follow the lowering.
Three kernels over our own MSL, each storing its buffer arguments into a thread's array of device
pointers and reaching memory through elements read at an index only the run knows:
- pointer_array_pick: the array alone, read through element (pick + i) % 3;
- pointer_array_by_value: the array's address in the array_ref member of a struct passed by value
to a noinline external function, which reads through one element and writes through another;
- pointer_array_zero_filled: an array of 16 pointers zeroed by a memset, its first elements set,
each moved on (a load and a store back at a run-time index) and read through.
The struct holds an array_ref because Apple's compiler passes a struct member by member and an
array_ref member as one aggregate value (compile probes m3-max-70297, 70300, 70304): the kernel
inserts the array's address into it, as the shape the translator refused does. The companions
follow from scripts/regen-air-fixtures on the M3.
0eb982e471 raised the runtime floor profile's update-after-bind sampler limits from 12,000 to
24,000 for the LOD-clamp variants, and an_argument_sampler_array_has_the_heap_sampler_capacity
still asserted the floor's array at 12,000: it failed on development's tip (m3-max-70331 at
8ab24c9753, engine_handles.rs:4496). The lane's checks ran the runtime, validation and
conformance suites, not the translator's. The array follows heap_sampler_capacity, which reads
the profile, so the assertion and the doc comment now say 24,000; no product line moves.
Verified: not yet; the translator suite at this commit follows (named in the pin line).
What:
- golden_hashes.tsv: semantics 2280 -> 2283 and six new rows, the .air.ll and .ll of
cube_face_writes, rt6_unwritten and rt6_per_primitive; 0 rows change, 0 are gone.
- authored-compile.tsv: 32 cases move (288 cells) and 5 cases are new.
- The 52 cases that read not_supported{tooling_requirement:kernel_imageblock} under census
version 8:
- 25 with an explicit imageblock move: 18 compile, 6 now stop at
not_supported{needs_input:StorageTextureFormat} and 1 at the IdentityDomains refusal;
- 26 with a tile pass's implicit imageblock keep the requirement;
- the one case with no imageblock field, icb_imageblock_encode (an indirect command
buffer encoding a compute command), read kernel_imageblock beside
indirect_compute_commands and now reads indirect_compute_commands alone. Before the
change, case_requirements gave the requirement only to a case with an imageblock field,
so that cell is expected to have been stale, cleared by version 9's re-key (unaudited).
- 4 cases move from LayeredRendering to compiled (the plain store of the slice and viewport
index), and 2 from IdentityDomains to compiled (the storage cube by face).
- New rows: the three storage-cube cases, the never-written slice and viewport case, and the
per-triangle slice and viewport case.
Why: the golden class and the authored compile census were stale since SEMANTICS 2281 to 2283
and AUTHORED_COMPILE_CENSUS_VERSION 9 landed.
Verified: the bless job m3-max-70332 on the M3 at 8ab24c9753 (inventory, golden, printouts,
opened chains and the authored compile census each exit 0).
bless_engine_inventory adds rt6_per_primitive's four rows (both companions, both entries), each ok
on all 15 profiles, and moves rt6_first_vertex's four vertex rows from
Unsupported{LayeredRendering; NotImplemented} to ok on all 15; no other cell moves. The air_input
bless adds rt6_per_primitive's printout and changes no other (job m3-max-70261, on the M3 at
7579f5aa42).
Case 44f95cb5f9dd: rt6_per_primitive draws four triangles, two to each half of a 4x4 rgba32_uint
target with no pixel center on an edge, each reading its index from a device buffer at
vertex_id / 3 (0x0000, 0x0001, 0x0102, 0x0103: slices 0 to 3, viewports 0, 0, 1, 1), and the case
observes the flat varying that carries the index. In a one-layer pass with Metal's one default
viewport, a slice index at or past renderTargetArrayLength is interpreted as 0 and a viewport index
past the count draws through viewport 0 or the clamped one, here the same (the Metal Shading
Language specification, 5.10), so each triangle covers its own pixels. Every vertex of a triangle
writes the same slice and viewport, as Metal requires; nothing in the function's structure shows
it.
Qualified on the M3 Max (job m3-max-70249, macOS 27.0.1, output c140c91e): every pixel holds the
index its triangle read, all four triangles drawn.
Metal requires the same [[render_target_array_index]] and [[viewport_array_index]] at every
vertex of a primitive ("If values differ, the behavior and value passed to the fragment function
are undefined.", the Metal Shading Language specification), and Vulkan asks the same of Layer and
ViewportIndex (VUID-VkPipelineShaderStageCreateInfo-stage-02596 and -02597). The translator stored
an index only where the function's structure showed it the same among a primitive's vertices
(uniform_varyings over the raw index varyings) and refused every other one,
NotImplemented(LayeredRendering), on every device. A program that keeps Metal's rule keeps
Vulkan's with the index stored as written, and one that breaks it has no Metal answer to match,
so plan::index_store now stores the index to its builtin wherever the device stores it from a
vertex function (shaderOutputLayer, shaderOutputViewportIndex, both in the floor), whatever the
structure shows; a device without the output is refused needing it, as before. The store keeps
index < count ? index : 0 against the pushed length and viewport count, and an index never written
is still stored as 0. uniform_varyings now lists user varyings alone (the raw index keys decided
nothing else), and uniform_index is gone.
Where a program breaks Metal's rule the layer or viewport is the device's choice: the runtime
README's layered line and docs/API.md (section 4 and section 10's accepted differences) say so in
one sentence, the viewport paragraph and set_viewports no longer name a geometry stage, and
docs/REFUSALS.md is regenerated (LayeredRendering is now a device refusal alone). The runtime's
layered device test draws rt6_per_primitive's three triangles into slices 1, 1 and 2 through
viewports 0, 1 and 1 of a 2D array, checking every texel, in place of the refusal it asserted.
SEMANTICS_VERSION 2283: modules for such functions instead of the refusal, and uniform outputs
without the raw index keys.
indices_are_stored_as_the_vertex_function_writes_them replaces the test that held such a vertex
function refused as not implemented. rt6_per_primitive (its index read per triangle from a device
buffer at vertex_id / 3) and rt6_first_vertex (read per vertex) must compile on lavapipe,
moltenvk-m3, lavapipe without geometryShader and the runtime floor, declare Layer and
ViewportIndex, and make a valid pipeline of their vertex and fragment stages alone; on the floor
without shaderOutputLayer the pipeline is refused needing that feature alone. The test of an index
never written no longer asks for the index among the uniform outputs, which hold user varyings
alone after the change it tests.
Red before the change: every such function is refused NotImplemented(LayeredRendering).
scripts/regen-air-fixtures/regen-air-fixtures.sh rt6_per_primitive on the M3 (job m3-max-70231:
Apple metal 32023.922, macOS SDK 27.2, llvm-dis and llvm-as 21). The vertex function loads its
index at udiv vertex_id 3 from its device buffer and returns its low byte as the slice, its shift
by 8 as the viewport and the index as a flat varying.
An owned MSL source: the vertex function rt6_per_primitive reads one index per triangle from a
device buffer at vertex_id / 3 and writes its low byte as [[render_target_array_index]], the rest
as [[viewport_array_index]], and the index as a flat varying, so every vertex of a triangle writes
the same slice and viewport, as Metal requires, though nothing in its structure shows it. The
fragment function rt6_per_primitive_read reads all three. Its companions follow from
scripts/regen-air-fixtures on the M3.
Taken on the M3 Max with conformance times --runs 8 --write (job m3-max-70276);
times::every_case_is_timed::every_case_carries_its_timing failed without them (job
m3-max-70138).
The committed runtime-floor profile (and its generator's RUNTIME_FLOOR block) states the
floor's raised sampler limits: 24,000 maxPerStage and maxDescriptorSet
UpdateAfterBindSamplers, 286,144 maxUpdateAfterBindDescriptorsInAllPools.
tests::floor::the_floor_profile_states_exactly_the_floor failed without it on lavapipe
(job m3-max-70138) and on the 780M, Iris Xe and RTX 3090 (m3-max-70152, -70153, -70151).
The two sampler-bind-lod-clamps cases declare pixel-sampler-scaling, the static note of a
sample through a runtime sampler slot, which fired on every venue (same jobs). The kernel
case takes the ledger's dispatch_type row every compute-pass case of the rt side takes.
compute-plural-texture-and-sampler-binding now compares its four-bindings site on
lavapipe, which reads lavapipe's one-ulp 8-bit conversion, as compute-inline-bytes does
over the same texture and kernel: a llvmpipe row. The cards compared it exact.
A bind's LOD clamps (setSamplerState:lodMinClamp:lodMaxClamp:atIndex:, its
vertex and fragment forms and the range forms) that read otherwise than the
state's own were Gap::LodClamps. Metal takes the call; on the M3 Max
(conformance cases sampler-bind-lod-clamps-kernel and -fragment) the pair
replaces the state's clamps, a lower bound above the upper reads at the upper's
level, and a plain bind afterwards reads the state's own clamps again.
How: such a bind takes the state's variant of the pair, the state's descriptor
with the pair as its clamps, its device samplers from the shared sampler table,
placed at a variant element of set 1's sampler arrays. The three sampler arrays
grow from 4,000 to 8,000 elements in the runtime's layout; elements 4,000 to
7,999 are the variants'. Shaders declare the heap arrays unsized, so the
translator is unchanged: a slot's sampler index is the runtime's push, and an
argument buffer's sampler index of 4,000 or more still reads element 0, so no
program-written ID reaches a variant. A state keeps its 16 most recently bound
variants; a new one past them takes the place of the least recently bound one
no command buffer holds, and where work holds all 16 the new one is held by its
command buffer alone. Past 4,000 live variants a bind is
Limit::LodClampVariants { max: 4000 }. The lod_clamp_variants gauge counts the
live variants. A NaN bound, which Metal documents no answer for, binds the
state as it is.
The floor's sampler limits rise to 24,000 (maxPerStage and maxDescriptorSet
UpdateAfterBindSamplers) and 286,144 (maxUpdateAfterBindDescriptorsInAllPools);
the lab's least are 500,000 (MoltenVK on the M3 Max) and 1,048,576 (Intel UHD
Graphics 630 on Windows), and Vulkan requires 500,000 of each with
descriptorIndexing.
Gap::LodClamps goes; REFUSALS.md, basis.rs, the signature table, the Metal and
conformance coverage pages regenerate. The validation replay plays clamped
binds (no skipped_clamped_samplers). The ledger drops three rows the clamped
binds now answer (compute-plural-texture-and-sampler-binding steps 11 and 14,
render-state-unread-slots). The compute single clamp form's coverage row named
set_sampler_state; it names set_sampler_state_with_lod_clamps.
Tests: a kernel samples through the binds as Metal reads them; a state's 16
kept variants filled past that; the 4,000 variant elements filled past their
capacity; the gauge flat across a bind and retire loop and zero at device
drop. Verified: see the lane's report (jobs named there).
Recorded on the M3 Max, macOS 27.0.1 (job m3-max-70027 on 87c11aff15), three runs folded into
one outcome each. In both a bind's pair replaces the state's clamps: the state of (1, 3) bound
with (0, 4) reads levels 0 to 4, where narrowing would read 1 to 3. A pair whose lower bound is
above the upper reads every sample at the upper's level ((3, 1) level 1, (4, 0) level 0), and a
plain bind after a clamped one reads the state's own clamps again; the range form reads as the
single form. Metal's validation layer refuses no pair: the fragment leg ran with no message, and
the kernel leg's two messages are an unused binding at sampler index 0 and a redundant setting
of the same state.
The M3 Max's first recording of the two cases (job m3-max-70005 on 6342618acb) read every pair
as replacing the descriptor's clamps, and a lower bound above the upper as the upper twice. It read
(NaN, 4) as the state's own clamps and (0, NaN) as levels up to 2: Metal documents no NaN clamp,
so no case holds a device to that, and the two rows go. Two rows join: (-2, 2) and (6, 9).
The rt side of the suite binds the six LOD-clamped steps (compute, vertex and fragment, single and
range) through the runtime's own calls, where it answered Unavailable.
Two cases put a sampler state's bind-time LOD clamps to Metal: one state (nearest filters, a
nearest mip filter, lodMinClamp 1, lodMaxClamp 3) over a 16 by 16 R32Float texture of five
levels, each level's texels its level plus 1. The kernel case samples at explicit levels 0 to 7
(unv_rpos2d) after each row's binds in one compute pass; the fragment case draws a 10 by 2
target whose q-th quad samples at level q (alv_rect, mip_implicit_fragment), one pass a row.
Rows: a plain bind, the state's own pair, pairs wider, inside, overlapping below and above, wholly
below and above, unbounded, two whose lower bound is above the upper, NaN in each bound, the
range form, and a plain bind after a clamped one and the reverse.
9914598d31 made OverCause public and added OverCopyKind, Counters::over_copy_kinds and
Metrics::over_copies_unkept_kind, and left the committed table behind: the signatures check
failed on the stack's tree (m3-max-70244, STEP signatures, and the_public_signatures_are_the_
committed_table in m3-max-70245). All 21 lines are additions, so nothing breaks for a consumer:
OverCause and OverCopyKind are non_exhaustive.
Verified: scripts/api-signatures/signatures.py --check passes on this tree (it reads source
text only).
The imageblock dispatch commits before this one stop giving a kernel case with an explicit
imageblock the KernelImageblock requirement: its run sets the imageblock's size. The authored
compile census stored that refusal for those cases, 25 of the 52 cases whose cells read
not_supported{tooling_requirement:kernel_imageblock} in authored-compile.tsv (the other 26 have
a tile pass's implicit imageblock and keep it; one has no imageblock). Their cells are keyed on
the census fingerprint, the executor ABI and this version, and nothing in those commits moved
the last two, so a warm census could hand back the old refusal. Bumping the version re-keys
every cell; the expectation file is re-blessed at the next pin.
Verified: the counts are a search of authored-compile.tsv and the case shards at this tree; no
build ran for this one-line change.
The runtime's pipeline of a4_imageblock_extent records the static simdgroup-access-order
note on every device, which the card replays announced at the notices site (RTX 3090,
Radeon 780M, Iris Xe: m3-max-70084, 70085, 70086); the case declares it, as
compute-threadgroup-memory-reads-zero does for its kernel, and every value still compares
exactly. The encoder's dispatchType is the consumer's own on every venue, the same ledger
row the other compute-pass cases carry. Every byte of the output compared equal to
Metal's on the three cards.
Recorded on an Apple M3 Max, macOS 27.0.1 (26A434), job m3-max-70065: three runs, one
outcome, the validated leg ran with nothing announced, and the timing kept. Metal's 832
bytes equal the fixture's answer at each extent: the dispatch before the encoder set a
size read 1 by 1 (its cell and the extent 1, 1), then 4 by 2 and 4 by 4, every byte past
each dispatch's words still its guard.
docs/CONFORMANCE-COVERAGE.md regenerated: MTLComputeCommandEncoder's
setImageblockWidth:height: is now an implemented item the Metal leg exercises (29
implemented, 26 exercised).
A compute step for setImageblockWidth:height: on both sides, and a case that runs
a4_imageblock_extent three times in one encoder: before the encoder sets a size (one
thread, Metal's 1 by 1), then at 4 by 2 and at 4 by 4, each one threadgroup of the
imageblock's extent, into a guarded slot each. The case's test holds Metal's recorded
answer equal to the fixture's own at each extent.
The runtime README states the size as a specialization: each size a kernel runs at is
one VkPipeline made at prepare_dispatch or at the dispatch, a first-use wait, where Metal
changes the size with no compile (m3-max-69983); prepare_dispatch and dispatch_variant
take the size. REPLAY-STREAM and VALIDATION say the player and the engine candidate set
it; the ledger row for the state's imageblock length drops the dispatch refusal.
The recording follows in its own commit (taken on the M3).
ComputeCommandEncoder::set_imageblock_size is Metal's setImageblockWidth:height:. The encoder
keeps the size, 1 by 1 until a call sets one (Metal's size for an encoder that never sets one),
and a dispatch of a kernel that reaches an explicit imageblock runs at it: the translator's
SpecKey::ImageblockWidth and ImageblockHeight are specialized per VkPipeline (Constant::Imageblock),
as a threadgroup memory length is. The dispatch's refusal (Gap::KernelInput naming
RuntimeFact::ImageblockSize) goes.
- encoder: Sizes carries the encoder's threadgroup memory lengths and imageblock size to decide()
and threadgroup_memory(); Lengths holds the imageblock size for a kernel that reaches one (0 by
0 otherwise, so other kernels keep one pipeline whatever the encoder set), and its cells
(w x h x cell bytes, rounded to 16) count in Limit::ThreadgroupMemory with the lengths.
- pipeline: Variant keeps its Lengths (the key is ([u32; 3], &Lengths, bool)); an imageblock
kernel has no main pipeline, as a kernel that takes a threadgroup memory length has none;
keeps_plain counts the imageblock as encoder-sized memory.
- Refusal::ImageblockSize: a side that is not a power of two (0 included) or more than 1024
cells, whatever the state's maxTotalThreadsPerThreadgroup, as Metal's validation layer stops
them at the call (probe crates/metal2vulkan-conformance/probes/imageblock_size_rules.m, job
m3-max-70002, M3 Max, macOS 27.0.1).
- prepare_dispatch and dispatch_variant take the imageblock size as a fourth argument ([1, 1]
where the encoder set none); a size the encoder would refuse makes nothing and answers None.
The consumer's two call sites take the argument (planner, through main).
- Validation: the engine candidate sets a case's explicit imageblock size and passes it to
prepare_dispatch; KernelImageblock narrows to a tile pass's implicit imageblock (the runtime
builds no tile function). No executor ABI bump: no recorded row ran an explicit imageblock
case, which the requirement refused. The replay player plays setImageblockWidth:height:, and the
pre-pass passes each dispatch's size.
Form (step 0, jobs m3-max-69983, m3-max-69984): Metal compiles nothing for a new size (a new
size's first dispatch 202-312 us median against 205-228 us second use and 222 us at the control
size, a state's make 15-20 ms); a pushed size would size the Workgroup arena at Metal's 1024
cells on every dispatch. A new size here is one VkPipeline make at its first dispatch, a known gap.
Tests: tests::imageblock (replacing tests::kernel_input): a dispatch never sized runs 1 by 1; one
encoder runs 4 by 2 and 4 by 4, each read back, two first-use variant waits and no main
pipeline; the setter's refusals.
What: Counters::over_copy_kinds(from) answers the kinds of texture over a buffer the device copied
into an image of its own and back, each once, in the order first copied: an OverCopyKind with its
OverCause (now public), pixel format, width, height and usage. The set keeps the first 256 kinds;
once it holds 256, a copy of a kind not among them counts in Metrics::over_copies_unkept_kind, so a
reader knows the kinds are full. The copy record (OverCopy) carries the kind in place of the cause;
each copy's count (Counters::over_copied) takes it.
Why: the over-copy counters give bytes by cause only; a walk could not say which textures are
copied. A consumer that logs the kinds past the number it has read names each one once.
The README's host-memory gap now also says that every driver asked offers and binds the linear
image over host memory's import, so the bar is the undefined start that
VUID-VkImageCreateInfo-pNext-01443 makes mandatory, not the driver. The probe (a Python ctypes
query, not kept): vkGetPhysicalDeviceImageFormatProperties2 with
VkPhysicalDeviceExternalImageFormatInfo (HOST_ALLOCATION), LINEAR, 13 colour formats by 5 usages
(transfer, plus sampled, storage, colour attachment) and mutable with the sRGB pair, then the image
made at 256x256 and 1920x1080, an anonymous mapping of its size imported, and the image bound:
- lavapipe and RADV 780M (Mesa 26.2.6), m3-max-70177: offered 77 of 77 rows the plain linear query
offers, bound 154 of 154; RADV refuses dma-buf with LINEAR on every row.
- RTX 3090 (NVIDIA 620.70.06), m3-max-70178: offered 77 of 77, bound 154 of 154.
- Iris Xe (ANV, Mesa 26.2.6), m3-max-70179: offered 77 of 77, bound 154 of 154.
- M3 Max (KosmicKrisp, Mesa 26.3.1), m3-max-70180: offered 34, every read and read-write row;
every row with the colour attachment usage is refused by the plain linear query too; bound 68
of 68.
Tests: the_counters_name_each_copied_kind_once_up_to_their_bound (device-free: kinds named once in
first-copy order, a read from a number, filled 3 past the bound, unkept copies counted each time,
a kept kind's never); every_device_counts_each_textures_copies_under_its_cause now also checks that
each copied texture's kind is named once with its format and size, and an in-place one names none.
Verified: see the compile and lavapipe jobs named in the landing.
bless_engine_inventory adds exactly its four rows (both companions, both entries), each ok on all
15 profiles, and moves no other cell; the air_input bless adds its printout and changes no other
(job m3-max-70061, on the M3 at 273ac30971).
a-slice-and-viewport-index-never-written-draw-through-the-one-layer-and-viewport (571c7dea...)
draws rt6_unwritten's triangle (both indices undef) once into a 4x4 rgba32_float target of one
layer with Metal's one default viewport, observing the position: every pixel center at z 0.5,
w 1.
Verified: corpus-case-check accepted and installed it, and corpus-metal qualified it on the M3
(apple-m3-max-macos27.0.1, job m3-max-70054): output sha256 187ca9f8..., the same bytes as
a-viewport-index-past-the-one-viewport-draws-through-it's Metal observation, a full-target
triangle through viewport 0.
A vertex function that declares [[render_target_array_index]] or [[viewport_array_index]] and
never writes it returns the index undef (Apple's compiler inserts nothing into the returned
struct's field). The translator took undef as divergent among a primitive's vertices (each use of
OpUndef may read another value) and refused the function, NotImplemented(LayeredRendering).
Metal gives such an index no value, so an index undef at every return
(stage_io::returns_undefined: an undef or poison inserted there, a member of one, or a member no
insertion writes into one) is stored as 0 wherever it is stored (PlannedOutput::unwritten: the
Layer and ViewportIndex builtins and their raw varyings), the same at every vertex, as Vulkan
asks (VUID-VkPipelineShaderStageCreateInfo-stage-02596 and -02597), and uniform_varyings lists
it among the uniform outputs. The offset of a draw of one amplification and the count each
index is held below apply as to any written index. The member walk returns_no_nan used is
shared (returned_member); its answers are unchanged.
SEMANTICS_VERSION 2282: modules for such functions instead of the refusal.
indices_a_vertex_function_never_writes_are_stored_as_zero compiles engine/rt6_unwritten (both
indices undef in the return) on lavapipe and runtime-floor and asks for both among the uniform
outputs, Layer and ViewportIndex declared, the pipeline with rt6_unwritten_read valid, and no
store to either builtin reading an OpUndef. It fails here: the translator refuses the function
as not implemented LayeredRendering. The next commit makes it pass.
scripts/regen-air-fixtures/regen-air-fixtures.sh rt6_unwritten on the M3 (job m3-max-70024:
Apple metal 32023.922, macOS SDK 27.2, llvm-dis and llvm-as 21). The vertex function's return
inserts only the position into an undef struct, so the slice and the viewport index are undef.
An owned MSL source: the vertex function rt6_unwritten declares [[render_target_array_index]]
and [[viewport_array_index]] and writes neither, so Apple's compiler returns both undef; the
fragment function rt6_unwritten_read reads both. Its companions follow from
scripts/regen-air-fixtures on the M3.
What: SEMANTICS_VERSION 2279 -> 2281.
Why: under the identity domains a storage cube or cube array written or read
by face now lowers to the 2D-array storage element of its faces, where it was
refused as IdentityDomains (texture argument S). That changes output under an
unchanged key. The AMD fix takes 2280, so this change takes the next number.
Verified: the translation census of the private corpus at the change
(f521ab4c14) against its base (a677cb74b3), every row at the current
fingerprint, on runtime-floor and gate-lavapipe (job m3-max-70149): 17,209
rows each, defects 0, budget stops 0, gates pass, slowest row 823 and 827 ms,
peak resident 218 and 222 MB. On each profile 30 functions move from
unsupported to translated, 2 stay unsupported with the refusal now naming
their texture slot 1 instead of slot 0, and no other row changes. The golden
table is re-blessed on development.
Three public cases over the owned cube_face_writes fixture (2 by 2
RGBA32Float, grid 2 x 2 x 6, each output filled with 0xab first):
- write-each-face-of-a-storage-cube-by-its-face-index (51a16094...): every
texel of all six faces of a write-only texturecube holds (x, y, face, 1).
- write-each-face-of-the-second-cube-of-a-storage-cube-array (0d4f03eb...):
slices 6 to 11 of a two-cube write-only texturecube_array hold the same
writes, and slices 0 to 5 keep their fill.
- storage-cube-width-height-and-cube-array-size (6072ce40...): get_width,
get_height and get_array_size read 2, 2 and 2.
Verified: corpus-case-check accepted and installed all three, and
corpus-metal qualified them on the M3 (apple-m3-max-macos27.0.1, job
m3-max-70124). Each Metal output equals the values the kernel writes, computed
on the CPU, byte for byte.
every_device_writes_a_storage_cube_and_a_cube_array_by_face runs the owned
fixture cube_face_writes through the runtime's public API on each device:
a 2 by 2 RGBA32Float cube and a cube array of two, filled with -1, written
by face at level 0. Every face of the cube and of the array's second cube
holds its writes, the first cube keeps its fill, and the width, height and
cube count read 2, 2 and 2.
scripts/regen-air-fixtures cube_face_writes (Apple metal 32023.922.4, macOS
SDK 27.2, LLVM 21.1.8) writes the .ll and .air.ll companions and the
TOOLCHAIN line; the engine inventory bless adds the fixture's two rows, ok on
every profile, and changes no other; the air_input bless adds its printout
(job m3-max-70105).
The plan of the storage-cube kernel under the identity domains carries
PushField::TextureIntegerChannels for each of its two uint storage slots
(a slot without a format), which the test's push loop did not fill and
panicked on (job m3-max-70068, msi, at f521ab4c14). The images are 32-bit
channels, so the word is 0 and each lane stores as written.
One kernel writes (x, y, f, 1) at texel (x, y) of face f of a texturecube<float, write> at level 0,
and of face f of the second cube of a texturecube_array<float, write>. Thread 0 stores the cube's
width and height and the array's cube count. The companions come from scripts/regen-air-fixtures
on the M3.
The translator declares every storage cube and cube array as the 2D array of its faces, at layer
6 * cube + face (cube_as_array). Under the resident-table domains the binder supplies that view.
Under the identity domains no class held it, so a kernel that writes a cube by face was refused
with "texture argument S: a type the identity arrays hold no element of". In the private corpus
on runtime-floor that refusal covered 30 guest functions alone, and 6 more together with a
sampled cube read by face.
Now:
- Translator: identity_class takes a storage declaration that views a cube as an array as the
2D-array storage class, and a storage cube states no ImageViewShape fact under the identity
domains. A sampled cube read by face (access::read or access::sample) still has no class and
stays refused.
- Runtime: a cube's or cube array's storage element, for a texture and for a texture view, is a
VK_IMAGE_VIEW_TYPE_2D_ARRAY view of its 6N layers (storage_view_type). Vulkan takes that view
of any cube-compatible image, so every device gets the same form, at no copy and no cost. The
sampled element stays the cube view.
- docs/API.md states the storage element a consumer holds for a cube. The runtime README says
what a cube's storage view is, and its identity-domain gap list keeps only sampled cubes read
by face.
- The same README list adds the refusal of a storage texture written at a run-time level, with
what Metal does on Intel Macs: an owned kernel's writes at levels 1 and 2, read from a buffer,
landed exactly on a Radeon Pro 5300M and a UHD 630 under macOS 26.7.1, with Metal's
validation off, with API validation, and with shader validation (job m3-max-70040, probe built
in m3-max-70037).
Under the resident-table domains nothing changes: both translator changes apply only under the
identity domains.
A kernel writes (x, y, face, 7) at texel (x, y) of every face of a texturecube<uint, write> slot
and of the second cube of a texturecube_array<uint, write> slot, and stores the cube's width and
the array's cube count. Under the identity domains, on lavapipe and moltenvk-m3, the test asserts
that the kernel compiles and links, that no ImageViewShape fact is stated, and that both slots
are elements of the one 2D-array storage class at their pushed resource IDs. On the CPU
interpreter the writes land on layers 6 * cube + face of those elements, and the width and cube
count are the elements'.
The translator refuses this kernel today, naming "texture argument SlotRef { .. }: a type the
identity arrays hold no element of", so the test fails until storage cubes get an identity class.
What:
- golden_hashes.tsv: semantics 2277 -> 2280. 868 of 1,305 rows change (12,907 cells), 2 rows
are new (kernel_agx_shfl's .air.ll and .ll), 0 are gone. The bulk is the floor's tail fold
(059835018a), which changes the words of every module that reads a pushed field; the bicubic
and llvm.agx2.shfl cells are among them.
- authored-compile.tsv: 12 cases (7 of the owned bicubic cases, 5 private-corpus cases) move
from not_supported{unsupported:not_implemented IdentityDomains} to compiled on all 9
profiles (108 cells), from the bicubic sample at pixel coordinates and the shared bicubic
switch under the identity domains. 8,923 compiled cells keep their outcome and change their
artifact digest (the tail fold). Two new rows: the agx_shfl_pairs and agx_shfl_sweep cases.
Why: the golden class failed on development since the bicubic and shfl commits (2278, 2279)
and the tail fold (2280), and the authored compile census was stale since the bicubic work.
The tail fold's 3% check (gpu_busy, total GPU-busy time over glbench frames 30-400, fix over
base, three alternating rounds after a warm play of each arm):
- Radeon 780M on RADV: -0.43% (m3-max-70218).
- Iris Xe on ANV: +2.71% (m3-max-70219); every fix play is 2.3-2.9% above every base play, a
real cost of the selects, inside the 3% bar.
- RTX 3090: -3.13% (m3-max-70207), its fix arm spreading 23%, so no sign can be read.
Cold makes of the one state found, #424 of the setup2 stream, each from an empty driver cache
on AMDVLK 2025.Q2.1 (Radeon 780M): 24 of 24 crashed before the fix (m3-max-70250), 12 of 12
made at it (m3-max-70252).
Corrections to two earlier messages on this branch:
- 059835018a says the owner's Windows driver died making the same stream's states. We do
not know which state his driver died on. The crash was reproduced on AMD's open driver in
the lab, and the fix is unverified on his Windows driver until his retry.
- 64cb2002f0 says "Verified: not yet; the suite job follows". It was verified after:
m3-max-70095 at 64cb2002f0, and m3-max-70165 at 98f2025df8 (3,592 of 3,593, the golden
table the one red, which this commit blesses).
Verified: the bless job m3-max-70275 on the M3 at 98f2025df8 (inventory, golden, printouts,
opened chains and the authored compile census each exit 0).
64cb2002f0 let the spill test's disassembly trace step through any
OpSelect of a ulong whose false hand is a push load. The bounds checks'
selects of a slot's address against the zero range's pushed address
have that form too, so the trace also counted the 24 slot reads through
them: amd-780m-hawkpoint-radv read (36, 36, 12) where 12 lines were
spilled. The trace now steps only through the fold's own form, a
select whose true hand is the ulong null (lower::push::fold_never_pushed).
Verified: m3-max-70095 (msi-laptop) showed the (36, 36, 12) failure at
64cb2002f0, with workspace clippy and the other 3591 tests of the gate's
first suite line passing (golden hashes aside, re-blessed on
development); this commit's run follows.
Since the floor's tail folds into each other pushed field through an
OpSelect against null (059835018a), the ExecutionStatusAddress the
product's status words are written through is a select of its push
load, and the writes trace stopped there: a multisampled fragment that
only counts resident misses (WIDE_READ) read as writing memory of its
own. The trace now steps through an OpSelect whose one hand is a
constant, and an OpIAdd of two values ends at the status member when
one hand is that member's load, folded or not. A selection of two
values still ends the trace as the function's.
The writes test builds its miss-counting fragments with the floor's
tail folded into every field too; the spill test's disassembly trace
follows the select from the parameter block's pushed address.
Verified: not yet; the suite job follows.
The floor's tail guard read the tail in the first block and returned where it held a value the
consumer never pushes, so every stage that pushes more than one field ran its whole body under a
never-taken branch. AMD's open driver (AMDVLK 2025.Q2.1, LLPC) dies in vkCreateGraphicsPipelines
making a fragment stage of that shape whose loop holds convergent instructions under
MaximallyReconvergesKHR (an implicit-LOD sample and an f32-f16-f32 round trip): the setup
streams' render content 295d5723 ([65] RG16Float, 1 sample) died on the Radeon 780M, and the
owner's Windows driver died making the same stream's states.
Now the stage reads the tail in its first block, tests it as before (lower/push.rs
tail_never_pushed), and each other field read from its push member is, as every use of it
recalls it, its member's value where the test fails and the null of its type where it holds
(fold_never_pushed, EmitCx::fold_tail): a select per field, no branch, no return. The tail's load
lives while any other push read does, which is what the tail is for (a driver that uploads push
bytes up to the highest one a stage reads). A tail field of the stage's own folds into the others
alone. The fields read from their members load first, then the tail folds, then the spilled and
derived fields, which may read through the folded parameter block's address. Same pushed bytes,
same placement, no interface change.
- lower/push.rs: emit_tail_guard becomes tail_never_pushed (the test) and fold_never_pushed.
- lower/emit.rs: load_push_fields loads, folds (fold_tail), then loads the rest; emit_module no
longer calls a guard.
- SEMANTICS_VERSION 2280.
- Test: the_floor_s_tail_folds_into_the_other_pushed_fields_with_no_branch (one select per
other pushed field, no branch on the tail's test, one return), which fails on the guard.
- Docs: lower/push.rs, PushField docs, docs/API.md section 5.