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.
What: SEMANTICS_VERSION 2278 -> 2279.
Why: llvm.agx2.shfl now lowers (4 functions in 2 libraries that refused as AgxUnmodeled translate),
and an unmodelled AGX call that takes or returns a pointer is refused as AgxUnmodeled instead of
Lowering(Access) (18 functions in 6 libraries move). Both change output under an unchanged key.
The bicubic pixel-coordinate change beneath this one took 2278, so this change takes the next
number; the earlier commit's body that says 2276 -> 2277 predates both rebases.
Verified: the version only; the golden table is re-blessed on development.
Two public cases over the owned kernel_agx_shfl fixture:
- agx-shfl-interleaves-the-bits-of-edge-and-random-pairs (8e51bda5...): 134 pairs in one
threadgroup (0/0, ffff/ffff, ffff/0, 0/ffff, aaaa/5555, 5555/aaaa, each single bit alone in
either operand, in both and against its mirror, and 64 LCG pairs), each result read back
over a 0xab fill.
- agx-shfl-over-every-16-bit-value-matches-the-bit-by-bit-interleave (93662f10...): 65,536
threads, four pairs each ((t, 0), (0, t), (t, ~t), t with a hash of t), counting the results
that differ from a bit-by-bit interleave and summing every result two ways.
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-69889). Metal's outputs equal the interleave contract's
exactly: the pairs' sha256 f616d0f9... is that of the 134 interleaves computed on the CPU, and
the sweep reads 0 differences, 0xfffe8000 and 0x643d0000, the CPU's values.
An exhaustive 2^32-pair case is not committed: every public case runs on lavapipe with one thread
in the public leg, where it is not cheap; the exhaustive measurement on the M3 (all 2^32 pairs,
zero differences) is the one that decided the contract.
scripts/regen-air-fixtures compiled kernel_agx_shfl on the M3 (Apple metal 32023.922, SDK 27.2,
recorded in TOOLCHAIN as this fixture's toolchain; LLVM 21.1.8): .ll and .air.ll, the calls of the
declared agx_shfl renamed to llvm.agx2.shfl, which metal-as declares nounwind speculatable
memory(none). 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-69866).
Two kernels: agx_shfl_pairs interleaves the halves of each input word, and agx_shfl_sweep
interleaves four pairs per thread over every 16-bit value and counts the results that differ
from the bit-by-bit interleave, beside two wrapping sums of every result. The companions follow
from scripts/regen-air-fixtures on the M3.
corpus-triage refused --hash-file for every audit but translation. The specialization audit now
reads it the same way and plans and attempts those rows alone (the selection applies before
--limit, in rows_to_plan and pending), then prints, per profile, one specialization-row line per
selected row: a 12-character prefix of its hash, its plain outcome and key, how many sets it was
attempted and translated under, whether it translates under every set, some, none, or was not
attempted, and each other outcome with the number of sets that reached it.
The sweep's parameters (jobs, summary-only, limit, selection) travel together as one Run.
Test: a_selection_plans_and_attempts_its_rows_alone_and_each_has_a_verdict builds its own
synthetic index (three rows, a plain census) and holds the selection before the limit in both
selections and each verdict (every, some, none, unattempted).
llvm.agx2.shfl, i32 (i16 a, i16 b), interleaves its operands' bits: bit 2i of the result is bit i
of a, bit 2i + 1 is bit i of b. Measured on an M3 Max over all 2^32 operand pairs, with zero
differences against the interleave and 2^31 against a control with one table bit wrong. MSL
documents the same contract for interleave(ushort, ushort), which compiles to air.interleave.i32
instead. The lowering is per-thread integer arithmetic on every device, with no feature and no
subgroup operation: each operand, held zero-extended in its 32-bit container, is spread to the
even bits by four mask-and-shift steps (0x00FF00FF, 0x0F0F0F0F, 0x33333333, 0x55555555), and the
second is shifted up by one and ORed in. The decode names it AgxOp::Shfl with that signature;
every other AGX operation keeps its refusal (igemm is undocumented and the M3 cannot compile it).
The memory analysis refused a call with no signature that takes or returns a pointer as
Lowering(Access). For an AGX call that means an operation whose contract is not modelled, so it
is now refused as AgxUnmodeled, the refusal the lowering gives the same operation without a
pointer. The census by kind ranks the work, so the label has to name the cause.
SEMANTICS_VERSION 2276 -> 2277 (the shfl rows' modules, and the relabelled refusal class).
api_signatures.tsv gains AgxOp::Shfl: a consumer's exhaustive match on metal2vulkan-air's AgxOp
breaks (git grep AgxOp in the consumer's checkout at 3c4979983e: 0 hits). docs/REFUSALS.md does
not move: AgxUnmodeled is still built at its one helper.
Red before: m3-max-69816 (msi, a0e15aed00, llvm-as 23.1.1): the shfl kernel refused as
AgxUnmodeled, and the wide emask load refused as Lowering(Access).
Red before the lowering: the shfl kernel is refused as AgxUnmodeled on every profile, and the
wide emask load (an unmodelled AGX call with a device pointer) is refused by the memory analysis
as Lowering(Access).
The interleave's contract was measured on an M3 Max over all 2^32 operand pairs: bit 2i of the
result is bit i of the first operand, bit 2i + 1 is bit i of the second.
The identity domains refused every function that samples a 2D texture through a bicubic
constexpr sampler at pixel coordinates ("a bicubic filter at pixel coordinates"), though its
lowering is the normalized sample's with no position step: a pixel coordinate is already in
texels, so the emulation reads the coordinate itself, the level-0 size by OpImageQuerySizeLod of
the bound image (which under the identity domains is the slot's set-1 element), and the format's
treatment from the slot's PushField::BicubicTexels, as at normalized coordinates. Nothing in it
reads state the identity domains do not source, so the refusal goes: SamplerPlan::bicubic_pixel
and BICUBIC_PIXEL_FORM are deleted. Metal's front end admits pixel coordinates only with clamping
modes (MSL 2.10), and a mirrored axis at pixel coordinates stays refused by bicubic::check, as on
the resident-table domains. A bicubic sample of a 1D texture keeps its own refusal.
The runtime README's known gaps and docs/API.md no longer list the form.
No SEMANTICS bump of its own: 2278, beside the shared bicubic switch fix, covers both.
Metal reads the two forms alike: in the committed M3 observations of the three bcu_address cases
(macOS 26.7 and 27.0.1), the clamp-to-edge and clamp-to-zero samples at pixel coordinates equal
the same samplers' samples of the same point at normalized coordinates, bit for bit, on 64 of 64
lanes each. The sample keeps PrecisionNote::BicubicFilterArithmetic, as at normalized
coordinates.
engine_identity's bicubic test now compiles bcu_address (one 2D texture sampled through bicubic
samplers at normalized and at pixel coordinates) under the identity domains and validates it: its
slot's BicubicTexels field pushed, no specialization constant. bcu_forms (a 1D texture) stays
refused with its own form. The shared bicubic switch's identity runs take the pixel sampler too:
its words per arm and every lane against the resident-table domains' lane of its candidate alone.
Red at this commit: the identity domains refuse a bicubic sample at pixel coordinates
("a bicubic filter at pixel coordinates").
A switch-at-use whose arms all take a bicubic sample (an array of textures, or textures chosen by
a function constant, sampled through one bicubic constexpr sampler) emulates once: a facts
dispatch yields the named candidate's size and format bits, and a taps dispatch reads its texels.
Both read each arm's combined binding and its BicubicTexels specialization, which the identity
domains do not declare, so every such switch under the runtime's domains failed with "internal
error: combined binding ... is not declared".
Under the identity domains an arm's image is now its texture slot's element of the set-1 array at
the index its pushed resource ID holds (emit::identity_image, the image half of the sampled image
a candidate's own sample makes), and its bits the slot's PushField::BicubicTexels, which the plan
already pushed (bicubic::format_bits, the one reading of a slot's bits the own and the shared
emulation share). The resident-table form is unchanged.
SEMANTICS 2278 (with the pixel-coordinate form that lands beside it): modules that failed now translate.
The shared emulation of a switch-at-use (an array of textures sampled per lane through one
bicubic constexpr sampler) is now also compiled, validated and run on the interpreter under the
identity domains, the runtime's: its words per arm do not depend on the emulation's, and every
lane equals the resident-table domains' lane of its candidate alone, the null texture zero. The
identity domains refuse a bicubic sample at pixel coordinates, so there the forms are a repeating
and a clamping sampler at normalized coordinates.
Red at this commit: the shared form reads the resident-table domains' combined bindings, which
the identity domains do not declare, and fails with an internal error.
What:
- golden_hashes.tsv: semantics 2276 -> 2277, and the 15 cells of the fixture
kernel_threadgroup_constant_index_outside_the_array (both its .air.ll and .ll rows): 15 new,
0 changed, 0 gone.
- tests/air_input/kernel_threadgroup_constant_index_outside_the_array.txt: that fixture's golden
printout, which its commit left out.
- authored-compile.tsv: the 303 kernel visible-function-table cases now compile on every
profile (they read not_supported{tooling_requirement:kernel_function_table} before compute
function tables were built), and two new rows: the authored table case and the
threadgroup-constant-index case.
Why: the golden class failed on development since the threadgroup arena commits, and the
authored compile census was stale since the table work.
Verified: the bless job m3-max-69975 on the M3 at 64be1d50ae (inventory, golden, printouts,
opened chains and the authored compile census each exit 0). The 302 private kernel-table cases
match Metal as runtime candidates on lavapipe (m3-max-69951, 302/302).
The test held each texture row to its compression and storage declarations alone. The
Depth32Float row now also declares restricted-depth-upload, so the test counts it and asserts
that only that row declares it. Failed on bd98479373's suite (m3-max-69900: left 2, right 1).
Removing Gap::FloatDepthUpload let 18 rows of known-gaps-rt.tsv run past the upload. The lavapipe
replay (m3-max-69820, llvmpipe LLVM 23.1.1, Mesa 26.2.4) then reported:
- fresh-texture-depth32float-private and the nine sampler-compare rows now match Metal. Their
rows are dropped.
- The six format-copies pairs with Depth32Float now stop at the copy between the textures. rt
refuses that copy typed as one Metal documents as invalid, the accepted difference the Depth16
and Stencil8 pairs already hold. Each row now carries that text. The M3 Max (macOS 27.0.1,
m3-max-69887) copied the bytes with API validation off, and its validation layer stops each
of the six: "Copy From Texture Validation [sourceTexture pixelFormat](MTLPixelFormat...) must
equal [destinationTexture pixelFormat](MTLPixelFormat...)".
- texture-fills-252 and -260 now stop at fillTexture:level:slice:region:bytes:length:, which the
rt side answers Unavailable. Their rows carry the text of the family's other fillTexture rows.
The notes these runs now announce are declared where the case's work makes them:
- restricted-depth-upload (the upload's note) in format-copies, the Depth32Float row of
fresh-contents, and texture-fills 252 and 260. Each loosens the notices site alone.
- simdgroup-access-order on the compare rows of sampler-filtering and sampler-crossings. Their
kernel rrp_mc_compare writes out[5 * i + k], which the translator does not prove disjoint
between threads, so the note is static on every device.
How it was verified:
- the M3 validation probe above;
- the replay's listing in m3-max-69820;
- the check that follows on this commit.
The note RestrictedDepthUpload and the runtime README's known-gap line now say what
the upload kept on one card per vendor, under the validation layer 1.4.363.0, on a
Private 4x4 Depth32Float filled by a blit's copy_from_buffer with 16 values:
- NVIDIA 620.70.06 (RTX 3090, m3-max-69834) kept every value bit for bit and
compared it unclamped, as Metal does.
- RADV, Mesa 26.2.6 (Radeon 780M, m3-max-69832), and ANV, Mesa 26.2.6
(Iris Xe, m3-max-69833), clamped to [0, 1]. NaN of either sign, -inf, negatives,
denormals and -0.0 became +0.0, and +inf with values above 1 became 1.0.
Comparisons followed the stored value.
- The validation layer reported none of these copies.
The note's line "a value within [0, 1] is copied exactly" now excepts a denormal
and -0.0, which RADV and ANV store as +0.0.
Docs only: artifact.rs, the runtime's texture.rs, docs/API.md, the runtime README.
What: replace_region, upload_region and the blit's copy_from_buffer(_with_options) into a
32-bit float depth (Depth32Float, or Depth32Float_Stencil8's depth) no longer answer
Gap::FloatDepthUpload, which is gone: each is the plain vkCmdCopyBufferToImage into the depth
aspect, on every device, and carries Texture::FLOAT_DEPTH_UPLOAD_NOTE
(PrecisionNote::RestrictedDepthUpload, metal2vulkan-degrade-restricted-depth-upload). A value
within [0, 1] is copied exactly; one outside it is the device's, as
VUID-vkCmdCopyBufferToImage-pRegions-07931 leaves it without VK_EXT_depth_range_unrestricted,
which the runtime enables nowhere. No byte is read and no query chooses anything.
Translator: the new note's variant, codec tag (ARTIFACT_FORMAT_VERSION 592), validation's
allowance (unbounded), the conformance degradation (not native, as restricted-depth-range is
not) and docs/API.md's catalogue; RestrictedDepthRange's docs name the upload note.
Conformance: the rt side announces the note at each upload into a 32-bit float depth; the
compare cases declare it; heap_sizes' round trip writes depths within [0, 1] for Depth32Float.
What: the known gaps of pipeline states list, under the identity domains' forms, the argument-
buffer textures the identity arrays hold no element of. That list named "a texture buffer"; it
now names "a texture buffer's parts".
Why: since 817463704e an argument buffer's texture_buffer member, as a slot, is the element of set
1's texel-buffer arrays its resource ID holds (lower/texture/slot.rs identity_class maps Dim::Buffer
to a texel-buffer class), so a pipeline that declares one is not Unsupported{IdentityDomains}.
identity_class still answers None for a declaration with parts (decl.parts), and its doc names "a
texture buffer's parts" among what the identity arrays hold no element of.
How verified: read from the tree at fc8d0ccd15: identity_class and its doc
(crates/metal2vulkan/src/lower/texture/slot.rs), and tests::engine_identity's
a_texture_buffer_is_the_texel_buffer_element_its_resource_id_names, which compiles
rlm_runtime_limits' rlm_member_texture_buffer (an argument buffer's texture buffer) to binding 5
under the identity domains and passes L3. Docs only; nothing built or run.
What: the known gap for programmable sample positions no longer says the consumer answers the
query NO until the setter is built. It says what is true: the runtime has no setter and answers
nothing, every multisample pass rasterizes at the standard locations (Metal's defaults at 1, 2
and 4 samples), and a consumer that answers YES owns counting and dropping a set that differs
from the defaults.
Why: the consumer answers YES, as the guest's Mac does; it counts a differing set under its
unbuilt render-pass items and announces it, and none has been seen in its recorded logs. The
NO clause in 375e4770bf was a ruling that has been withdrawn.
Verified: doc-only; the workspace Rustdoc line runs on development after the merge.
What: the known gap of programmable sample positions now says what the consumer answers
programmableSamplePositionsSupported until setSamplePositions:count: is built: NO. The paragraph's
lines are reflowed.
Why: the planner's ruling on the row (11-22): the README names the consumer's answer while the
setter is unbuilt, so a guest is told it cannot set positions rather than having its set dropped.
How verified: docs only; nothing built or run.
What: a known gap of render encoders. The render pass descriptor has no field for
setSamplePositions:count:, and the runtime answers no programmableSamplePositionsSupported, so
every multisample pass rasterizes at Vulkan's standard sample locations (standardSampleLocations,
in the floor), Metal's default positions at 1, 2 and 4 samples. A pass whose set differs from the
defaults samples at the defaults, with no refusal. VK_EXT_sample_locations, Vulkan's form for set
positions, is not enabled.
Why: a guest sets sample positions (arm64 GL walks on the Mac host), and the README did not say
that the runtime does not take them. The consumer answers the support query itself.
How verified: read from the tree at d825e52482. RenderPassDescriptor (pass.rs) has no
sample-position field; no runtime source names sample locations but floor.rs's
standardSampleLocations limit; docs/METAL-COVERAGE.md lists setSamplePositions:count: and
programmableSamplePositionsSupported as missing. Docs only; nothing built or run.
- runtime-sources.sha256: the runtime inputs include the translator's bind
module, where function_table_header and function_table_entry_offset became
public; they lay out the words the shader already read, and no run of an
unchanged artifact does anything else, so RUNTIME_VERSION does not move.
- public_linked_modules_resolve_by_hash_without_a_private_store lists the
new public linked module visible_table_ops.
- coverage.tsv: MTLFunctionHandle's counterpart is the translator's
FunctionHandle (the runtime re-exports it), and
visibleFunctionTableDescriptor is VisibleFunctionTableDescriptor's Default,
as the coverage test finds items.
The three failed in the validation suite at dabc455312 (m3-max-69738:
1291 passed, 3 failed).
The replay on lavapipe (m3-max-69685, llvmpipe of Mesa 26.2.4) compares
every visible-tables-compute case exactly with the M3's recordings, so their
known-gaps rows, which recorded the runtime's Slot refusal, are dropped.
The six render-stage cases stay refused as recorded. CONFORMANCE-COVERAGE.md
is regenerated.
visible-table-entry-by-thread-calls-add-mul-null-sub (af884d65cb): twelve
threads of the owned visible_table_dispatch each call entry tid % 4 of a
table of four, linking table_add, table_mul and table_sub from the owned
module visible_table_ops, entry 2 left null. Installed with
corpus-case-check and qualified on Metal on the M3 in the primary reference
environment (m3-max-69730: three runs, 3, 3, 0xfffffffd, 0, 7, 15,
0xfffffffd, 4, 11, 27, 0xfffffffd, 8).
The public qualification (CI's lavapipe step) now also runs it and the
public table-query case 3a8f75e182, which the runtime refused before.
scripts/regen-air-fixtures --dir linked visible_table_ops on the M3
(m3-max-69721: Apple metal 32023.922, macOS SDK 27.2; its --check of the
directory passed). Three [[visible]] functions of the type uint(uint, uint)
that a case links into visible_table_dispatch's table.
The runtime candidate makes each table the case binds of the pipeline
state (newVisibleFunctionTableWithDescriptor: of its size, each authored
entry set to the handle of its linked function made with the case's
constants, as the Metal oracle sets it) and binds it at its buffer index.
ToolingRequirement::KernelFunctionTable, which held such cases to Metal
alone, is retired; a render stage's table stays the runtime's limit
(RenderFunctionTable). ENGINE_EXECUTOR_ABI does not move: no recorded row
ran a kernel table case (they were refused).
The runtime README states the device answer, the encoder's bind, the
state's handles and tables, and the known gaps (a table's 64 KiB block, a
consumer-compiled kernel's handles, an argument buffer's table). The
coverage table marks the compute items implemented; METAL-COVERAGE.md and
CONFORMANCE-COVERAGE.md are regenerated. Adds the owned linked module
visible_table_ops.metal, whose companions scripts/regen-air-fixtures
writes on the Mac.
Verified: the lane's jobs.
A compute pipeline state answers functionHandleWithFunction: for its linked
functions (the translator's FunctionHandle words), makes visible-function
tables (newVisibleFunctionTableWithDescriptor:) whose words sit in a Shared
block the runtime takes, writes their entries (setFunction:atIndex:,
setFunctions:withRange:) and answers each table's gpuResourceID. The compute
encoder binds a table at a buffer index (setVisibleFunctionTable:atBufferIndex:)
through its buffer path, and the command buffer keeps the words until it
retires. The device answers supportsFunctionPointers YES. An entry past a
table's size is Refusal::FunctionTableIndex and writes nothing.
The translator's bind module makes the table's header and entry offsets
public, so the runtime writes the layout the shader reads.
Tests: function_tables (device cfg) dispatches through tables of two orders,
a null entry, no entries, an unbound slot and an entry set after encoding,
and compares every word; the conformance rt side runs the compute
visible-table cases. Evidence is in the lane's jobs.
The sibling of the out-of-arena load and store. An unchecked threadgroup atomic at a constant
offset outside the arena built an access chain past the arena's word array, which the builder's
range rule rejects, an internal error. It now writes nothing and yields zero, as a contained atomic
out of bounds does (`guarded`), decided by the same plain-constant test (`local::outside_arena`):
an atomic inside the arena, or at an offset that is not a constant, is unchanged. Metal leaves the
access undefined. docs/API.md's threadgroup bullet names the atomic too. No census row reaches it.
The sibling of the out-of-arena load and store: an unchecked threadgroup atomic at a constant
offset outside the arena builds an access chain past the arena's word array, which the builder's
range rule rejects, so the translation fails with an internal error. This test makes that atomic
through from_queries on every test profile and expects the module to build, every thread's atomic
to answer 0, and no arena word to take the add. It fails until the fix that follows.
The rationale named the fix by a commit that a rebase replaced. It now says why the access cannot
be an access chain and what the translator makes of it. The rationale is outside the case's
identity, so its case id, input and Metal observation are unchanged.
threadgroup-constant-index-outside-the-array-in-a-branch-no-thread-takes, over the owned
kernel_threadgroup_constant_index_outside_the_array fixture: two threadgroups of 64 threads, each
storing 3 t + 1 at tg[t], with flag = 0, so no thread runs the branch whose load and store
Apple's compiler writes at the constant index 0xFFFFFFFF of the array (an offset outside the
arena, undefined in Metal). Each thread writes out[gid] = tg[(t + 1) & 63] + tg[t]: 6 t + 5
below t = 63 and 191 at t = 63. Compared exactly.
Verified: corpus-case-check installed it (m3-max-69680: case c97238d294b9, input_sha256
91077149e913), and corpus-metal qualified it on the M3 (apple-m3-max-macos27.0.1, m3-max-69691)
with output_sha256 01a9ad8b1b5c..., the sha256 of those 128 words computed apart from Metal.
kernel_threadgroup_constant_index_outside_the_array reads and writes tg[t - 1u] of a 64-word
threadgroup array, the arena's only object, in a branch where t == 0 and a buffer's flag is not 0.
Apple's compiler, knowing t == 0 there, writes both as the constant GEP [67108863, 63] of the
array: the arena offset 0xFFFFFFFC, outside the arena. It is the public form of the corpus shape
that failed with an internal error (the corpus's is an inbounds GEP [0, 4294967295] instruction;
both reach the arena access with that constant offset). Compiled by scripts/regen-air-fixtures on
the M3 (metal 32023.922, SDK 27.2, recorded in TOOLCHAIN); its inventory rows are ok on every
profile.
Verified: the base translator (da020e5d7b plus a probe report) refuses the fixture's .ll with
"internal error: Build: SPIR-V builder rejected construction: Operand { op: AccessChain, rule:
Range(1) }" on runtime-floor (m3-max-69680), the corpus rows' error.
An unchecked threadgroup arena access whose offset is a plain constant outside the arena built an
OpAccessChain into the arena's word array with a constant index past its length, which the SPIR-V
builder rejects (OperandRule::Range), so the function failed with an internal error instead of
translating or refusing. Such an access lies outside every threadgroup object, which Metal leaves
undefined, so it is now decided at translation time as a contained arena's constant access is: a
zero load, or no store. The decision reads the offset and the arena's size as plain constants and
interns nothing, so every access inside the arena, and every module that built before, is
unchanged; an arena whose size is a specialization constant is never decided this way (its word
array has no constant length to break).
The shape: Apple's compiler, knowing t == 0 in a branch, writes tg[t - 1u] of a static
threadgroup array at arena offset 0 as element 0xFFFFFFFF, a wrapped arena offset of 0xFFFFFFFC.
It is the whole of the translation census's internal errors at da020e5d7b (18 functions in 4
libraries on all five profiles, kindcount's m3-max-69549): each a load of an i32 word from a
static [N x i32] or [N x float] threadgroup global through an inbounds GEP [0, 4294967295], in a
branch, on the arena's u32 words.
SEMANTICS_VERSION 2277: those functions' outcome moves from an internal error to a module.
Verified: probe m3-max-69624 (base da020e5d7b plus a report at the builder's range rule) found
that one site and shape for all 18 rows; probe m3-max-69654 reproduced the same internal error
from owned MSL. The new test drives a load and a store at element 4294967295 of a 64-word
threadgroup array through from_queries on four profiles, in an arena of u32 words and one of
float words, and checks L3 and the interpreter's answers (the load reads 0, no word takes the
store).
A guest's blit copy of 62,302 bytes at offsets 0 and 0 met Refusal::BufferCopyUnaligned. Apple's page
for copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size: asks for multiples of 4 on macOS,
but plain Metal does not stop or round such a copy: it copies every byte of the range and no other.
vkCmdCopyBuffer has no alignment rule for its regions, so the copy is its one region at the
offsets and size the call names, and the refusal is gone.
Measured with probe crates/metal2vulkan-conformance/probes/blit_buffer_copy_unaligned.m, one
universal binary (built in m3-max-69612), copies (source offset, destination offset, size) =
(0,0,62302) (0,0,1) (0,0,3) (1,0,8) (0,2,8) (3,5,4097) and the controls (0,0,64) (4,8,4096),
each between two Shared, two Managed and two Private buffers, every destination byte read back:
- Apple M3 Max, macOS 27.0.1 (26A434), job m3-max-69613: 24 of 24 exact with validation off
(AGXG15CDevice), 24 of 24 exact under MTL_DEBUG_LAYER=1 (MTLDebugDevice), which printed only
its banner and took every copy.
- AMD Radeon Pro 5300M and Intel UHD Graphics 630, macOS 26.7.1 (25G241), job m3-max-69614:
24 of 24 exact on each, validation off.
Every command buffer completed with no error.
The variant, its basis line, its REFUSALS.md rows and its api_signatures.tsv line go; the runtime
README says what Metal measured. The conformance ledger's overlapping-copies row now holds the
overlap refusal its first copy meets (the alignment check ran before it). The consumer's checkout
names the variant nowhere (git grep BufferCopyUnaligned at reims-vgpu 6d83a5d4f8: 0 hits).
Test: every_device_copies_between_buffers_at_any_offset_and_size copies the six ranges between
two Shared buffers and reads every byte back; it fails without the change (the refusal).
On KosmicKrisp (Mesa 26.3.1, Apple M3 Max, macOS 27.0.1), a bare Vulkan program's
one-fill submission after a 2 s pause started 18.45 / 23.88 / 24.44 ms (p50 / p90 / max)
after its commit while its device held 6 x 64 MiB, 12.32 ms of it in vkQueueSubmit2 at
the median, against 8.49 / 10.74 / 11.06 ms holding nothing (14 each, m3-max-69600; the
earlier m3-max-69540 read alike). After a 0.1 s pause the held bytes cost nothing
measurable (0.77 against 0.79 ms at the median). Read from the driver's source, not
instrumented: every VkDeviceMemory is a heap in one residency set added to the device's
Metal queue, and every vkQueueSubmit2 commits that set and calls requestResidency.
A Metal reference in the same job, arms interleaved, says whose cost it is: a Metal
program holding the same 384 MiB in a residency set added to its queue, committed once
and never requested, started 19.44 / 26.15 / 26.25 ms after a 0.03 ms commit; requesting
residency before each commit moved 13.18 ms (median) into the calls and left the start
where it was (20.96 / 23.74 / 26.46 ms); the same buffers in no set read like an empty
set (7.85 against 8.37 ms at the median). A Metal 4 queue, the kind the driver uses, read
alike. So at this size and pause the delay is Metal's own for bytes in a queue's
residency set, and the driver's per-submission request moves it into vkQueueSubmit2.
The README's queue gaps now state these rows, the jobs, that the machine was shared and
that the driver was read, not instrumented.
Docs only; the workspace Rustdoc (-D warnings) and doctest check of this commit is its
own job, named where the commit is handed in.
A compute pipeline state whose kernel reaches an explicit imageblock was refused at its make as
Gap::KernelInput of KernelInputKind::RuntimeFact naming ImageblockSize, which every arm64 macOS
guest boot meets once. The state is now made, and what stays refused is the dispatch, where Metal
reads the extent setImageblockWidth:height: set, which the compute encoder does not have:
- interface() takes RuntimeFact::ImageblockSize, keeping its cell bytes as Interface::imageblock,
and leaves SpecKey::ImageblockWidth and ImageblockHeight at the module's default (0 by 0)
instead of refusing them as a specialization it does not set.
- encoder::decide, which the dispatch, prepare_dispatch, dispatch_variant and the main pipeline's
key all go through, refuses a kernel with an imageblock first, as Gap::KernelInput of
RuntimeFact naming the fact (RuntimeFact::name). So no VkPipeline of such a kernel is made:
finish_pipeline has no main key, and a pre-pass gets no key. A dispatch of such a kernel that
writes no memory records nothing and is not refused, as for any kernel without effects.
- imageblock_memory_length_for_dimensions keeps its typed answer, Gap::ImageblockLength, for a
kernel that declares an imageblock: the one recording of Metal's answer for such a kernel
(conformance pipeline-facts-compute-imageblock, M3 Max, 256 bytes at 8 by 4 by 3) settles no rule.
The translator is untouched. Gap and KernelInputKind keep their variants; the docs of
Gap::KernelInput, KernelInputKind::RuntimeFact and Specialization, Gap::ImageblockLength (and its
basis line), the dispatch and the state's make say where the refusal now is. docs/REFUSALS.md,
docs/METAL-COVERAGE.md (setImageblockWidth:height:'s note) and docs/CONFORMANCE-COVERAGE.md are
regenerated. The runtime README's state facts and its known gap are re-worded, with the counts and
jobs kept. The conformance ledger's pipeline-facts-compute-imageblock row moves from case/state to
the facts' label and device (the consumer's own, as for every state) and imageblock_memory_length
(Gap::ImageblockLength). Validation's KernelImageblock requirement doc and its acceptance test's doc
name the dispatch's refusal and the renamed device test.
Test: tests::kernel_input::an_explicit_imageblock_kernel_is_made_and_its_dispatch_refused_as_its_named_runtime_fact
(replacing an_explicit_imageblock_kernel_is_refused_as_its_named_runtime_fact) makes a4_imageblock_extent's
state, reads its imageblock length as Gap::ImageblockLength, gets no dispatch_variant key, and has
one 4 by 2 threadgroup's dispatch refused as Gap::KernelInput of RuntimeFact { fact: "ImageblockSize" }.