`array<texture2d<half, sample>, 32>` states its length twice -- in the type
name and as the second `air.location_index` operand -- and the decoded
`TextureShape` already carried it. The interface pass still emitted
`OpTypeArray` of 128 and reflection still reported `count: 128` for every
handle array, fixed or runtime, so one `ResourceBinding` contradicted itself:
`texture_shape.array_length` said 8 while `descriptor.count` said 128, and a
consumer following the reflection had to supply 128 valid descriptors (or
`descriptorBindingPartiallyBound`) for an array of 8.
Both sides now derive from `TextureShape::descriptor_count`, the only reader of
the capacity constant. Only a runtime `array_ref`, whose length is a function
constant rather than part of the type name, still reports it. 40 of 14579 local
corpus sources declare a fixed array, lengths 2, 3, 4, 8, 32 and 80; every one
of the 76 declarations agrees with its `air.location_index` count operand.
The same unification fixes a depth-texture array bound as a single image. The
interface pass asked `contains("array<texture")` while the shared type-name
decoder asked about `array<depth` too, so `array<depth2d<float, sample>, 2>`
was not recognised as a handle array at all: the module declared one `depth2d`
where the shader indexes two, while reflection reported a `TextureArray` of 128
at that binding. There is now one predicate, `TextureShape::array_ref`, and one
scan behind it -- "is this an array" and "how long is it" can no longer be
answered by two different rules.
`tests/reflection_covers_declared_bindings.rs` now requires the reported count
to EQUAL the array the module declares rather than merely cover it, which is
what makes over-reporting detectable; the runtime fixture cannot catch it,
since its declared capacity IS the ceiling. Two fixed fixtures are added, one
of them spelled over `depth2d`, because a handle-array test that only ever says
`texture` cannot tell whether the emitter recognised the depth spelling.
Reverting either half of the fix fails them.
A/B over the 2880-source sample: 0 status changes; 8 modules change, each only
an `OpTypeArray` length 128 -> 2/8/32/80 and the ids that renumber behind it.
`REFLECTION_VERSION` is now 40.
Translation refuses a `kernel_local_size` whose product exceeds the entry's
`[[max_total_threads_per_threadgroup(N)]]`. A bound a consumer has no way to
read leaves it guessing at the dispatch shape until it hits the refusal, so
`ShaderReflection` now reports `max_work_group_size`.
Reflection reports it and does not enforce it: discovering the bound is the
reason to call it, and refusing the call that asks would be circular. The
authored test drives both halves off the one declaration -- it reads the ceiling
out of reflection, then dispatches exactly that many threads and one more --
so the number reported and the number enforced cannot drift apart. A kernel that
declares no ceiling reports `None` and bounds nothing.
`REFLECTION_VERSION` is now 39; `docs/REFLECTION.md` documents the field.
Verified: `cargo fmt --all --check`, `cargo clippy --workspace --all-targets -D
warnings`, warnings-denied all-features Rustdoc, `cargo test -p metal2vulkan` in
debug and release, `cargo test -p metal2vulkan-validation`. Dropping the field
back to `None` fails the new test and no other. A/B against the previous commit
over 2880 corpus sources: 0 status changes and 0 SPIR-V byte changes.
Whether a module carries a buffer-address table is a property of the pointer
graph the emitter constructs, and the emitter decides it with
`requires_device_address_model` over the parsed source. Metadata-only reflection
has to answer the same question, and answered it separately: a scan of the AIR
text for lines beginning `inttoptr` or `load ptr addrspace(1)`.
Two derivations of one fact, and the second was much the worse. Over 2880 corpus
sources the scan disagrees with the finished module 63 times. 49 of those report
a binding no module declares, which costs a consumer a descriptor slot. The
other 13 report none for a module that does declare one, which costs a consumer
a binding the shader reads -- and the scan cannot be fixed into seeing them,
because they are modules with no device pointer written anywhere in the AIR at
all: the address model is chosen for them during construction.
Asking the emitter's predicate leaves 8 disagreements, four in each direction,
and the remainder are the same kind -- decisions made after the pointer graph is
parsed. It costs a parse: metadata-only reflection goes from about 1.6 ms to
about 13 ms per shader, against 39 ms to translate one, so the path stays the
cheap one it is there to be.
The authored case for this was previously a bare `inttoptr` with nothing reading
it. That is precisely what the scan over-reports, so it now loads through the
pointer, and its dead twin is pinned beside it as the case that must report no
table. A second case loads a device pointer out of a struct member, which no
line-prefix scan can see and the pointer graph reads directly.
No module's SPIR-V changes and reflected translation is untouched, since it reads
the table off the module either way. `REFLECTION_VERSION` is 38.
`air.struct_type_info` gives each member an offset, a byte size, an array
length, and a type name. When the member is a user struct or class the name is
all the metadata says about its interior -- `Espresso::padding_params_t`,
`VFX_RE_C_LightSpot`, `vfx_light::(unnamed)` -- and there is no nested node to
recurse into. The decoder answered `float` for every one of those, which states
a type AIR never stated and sizes the member at four bytes no matter what it
declared. Over 2880 corpus sources 2513 such members appear across 817 modules,
and 2357 of them declare a size other than four; the largest understates a
408-byte member by 404.
`AirType::Opaque { size }` makes the case representable, so the decoder can say
what AIR said and nothing more. Every consumer that needs a concrete type still
gets one -- the same size-derived storage shape that argument-buffer handles and
non-strict nested structs already use -- but the two consumers that need the
truth now get it. `air_metadata_extent` bounds a decoded layout against
`air.arg_type_size`, so understating a member let a layout that over-runs its
argument pass the check; with true sizes every corpus layout still fits, which
is the corroboration the old numbers could not give. And the emitter's member
matcher no longer demands a shape the metadata never stated: an emitted member
occupying exactly the declared bytes is the member AIR meant, where a float leaf
matched nothing and threw away the declared offsets for the entire buffer.
Making the variant explicit also forces the question at every site: four
exhaustive matches on `AirType` had to decide, rather than silently inheriting
`float`. Over the corpus no module changes status and no module's SPIR-V changes
by a byte. `REFLECTION_VERSION` is now 37 because reflected `type_layout`
reports the new variant.
Metal spells a resource-handle member of an argument buffer with the type it
points AT -- `char` for a `device char *`, `float4x3` for a `device float4x3 *`,
`texture2d<half, sample>` for a texture, an opaque class name for a
`device Foo *` -- while the member itself stores an eight-byte handle. Reading
that name as the member's storage put a 64-byte matrix where the buffer holds an
address, and shifted the meaning of every member after it. `MTLGenericBVHData`
reported a 120-byte member layout for its 72-byte argument, with eight of its
nine members mistyped.
The member's `air.indirect_argument` node already says which it is, and nothing
read it: `air.indirect_constant` is the one role that means "stored inline";
`air.buffer`, `air.texture`, `air.sampler`, `air.indirect_buffer`, and the
pipeline-state / command-buffer roles are all references. `parse_struct_info`
walked past that suffix to find the next member; it now binds it to the member it
trails, exactly as `embedded::embedded_argument_members` does, and lets the role
decide. An unrecognized role is treated as a reference, since the declared size
describes the bytes either way while a handle mistaken for its pointee corrupts
the rest of the layout.
Over 2880 corpus sources the split is clean: 63,137 members carry no suffix or an
`air.indirect_constant` one and every single one of them agrees with its name;
2,762 carry a resource role and every single one of them declares eight bytes.
1,736 of those were mis-sized before -- 795 named a primitive of the wrong width
across 9 type names, 941 named a type AIR never defines, which silently became a
four-byte float.
This is not only a reporting fix. Twenty-one modules' SPIR-V changes, because
`infer_metadata_buffer_pointees` types a buffer from the same reconstruction:
they declared four-byte floats at eight-byte member offsets and now declare the
addresses AIR does. No corpus source changes status, and spirv-val is clean over
all 2880.
Reflection schema v36.
`ResourceAccess` is what a consumer reads to decide whether a buffer's contents
have to be staged, whether results have to be read back, and which barriers the
resource needs. It came from AIR metadata, tightened by the specialized entry's
parameter attributes -- neither of which is the module. AIR's declared access is
not a guarantee about the body: over 2880 corpus sources, 20 buffers reflected
`ReadOnly` are stored through, 9 reflected `WriteOnly` are loaded from, and 3
reflected `Unused` are both. `ReadOnly` on a buffer the shader writes is not a
lost optimization; it is a missing barrier, and a write into memory a consumer may
have placed as read-only.
The footprint analyzer already resolves each load and store to the descriptor it
belongs to -- through access chains, copies, phis, and function parameters -- so
the direction is one more field on the access it already collects, not a second
walk. `MemoryAccess` gains it, `analyze` returns the per-descriptor union
alongside the footprints, and `attach_buffer_footprints` widens the reported
access to cover it.
It only ever widens. The walk follows the pointer graph it can attribute, so
finding no write is not proof there is none -- an access through a device address
it cannot attribute would be missed -- and narrowing on that basis would turn a
conservative answer into a wrong one.
`OpCopyMemory` needed the direction to belong to the access rather than the
instruction: it has a reading pointer and a writing one. Atomics are classified
read-modify-write, which is conservative for the two that only read.
Verified over 2880 corpus sources: SPIR-V bytes identical, failure count unchanged
at 204, and 34 modules' reflection changed -- the 32 the access sweep named plus
two the sweep's per-class conditions did not separate. The sweep now reports 0.
New `tests/reflection_access_covers_the_module.rs`: an authored kernel that
contradicts both of its declared accesses -- `air.read` stored through, `air.write`
loaded from -- plus the same check over every public fixture. Verified as a
detector: dropping the widening fails the fixture test.
`REFLECTION_VERSION` 34 -> 35, `docs/REFLECTION.md` follows, and
`reflect_sanitized`'s doc comment now lists all three per-binding fields that are
the declaration rather than the module when no module is built.
Gate: fmt, clippy -D warnings, warnings-denied all-features rustdoc, cargo test
-p metal2vulkan (debug and release), cargo test -p metal2vulkan-validation.
`docs/REFLECTION.md` tells a consumer to group reflected entries by
`(set, binding, descriptor type)` and take the largest `count`. That number is
what sizes `VkDescriptorSetLayoutBinding::descriptorCount`, so if it does not
reach the largest array the module declares at that binding, the layout is smaller
than the array the shader indexes into. The rule was documented and untested.
`assert_counts_cover_declared_arrays` reads the largest `OpTypeArray` behind each
decorated binding out of the module and requires the grouped maximum to cover it.
An authored `array_ref<texture2d<float, sample>>` kernel is the case with a real
array -- it declares the descriptor-ABI capacity, 128 -- and the fixture sweep
runs the same check. Verified as a detector: reporting one fewer descriptor for a
`TextureArray` fails both.
Measured over 2880 corpus sources first, since a test that only ever passes is not
evidence: 0 bindings where the module's array outruns the grouped maximum. The
naive comparison -- each entry's own `count` against the module -- reports 193
across the function-constant-gated modules, where one binding legitimately carries
both a scalar and a 128-element variable and reflection reports an entry for each.
That is the case the grouping rule exists for.
The same sweep compared `local_size` against `OpExecutionMode LocalSize`: 0
disagreements over 2880 sources, so no check was needed there.
No product change.
Gate: fmt, clippy -D warnings, warnings-denied all-features rustdoc, cargo test
-p metal2vulkan (debug and release), cargo test -p metal2vulkan-validation.
`ShaderReflection::texture_shape` is what a consumer feeds into
`VkImageViewCreateInfo`, and Vulkan requires the created view's type to match the
`Dim` and `Arrayed` of the image variable the descriptor is read through. The
shape was decoded from the AIR type name, and the emitter does not always bind the
image that name implies: SPIR-V has no cube texel fetch, so `resources::discovery`
binds a `texturecube` that is only ever texel-read as a `Dim2D` ARRAY image with
the face in the layer slot. Reflection kept saying `Cube`, so a consumer following
it created a `VK_IMAGE_VIEW_TYPE_CUBE` view for a 2D-array image variable and the
dispatch was invalid.
`reconcile_texture_shapes` corrects each shape from the module's own `OpTypeImage`
at that binding, the same way `reconcile_buffer_address_table` and
`report_synthesized_placeholders` read their facts off the finished module.
`array_ref` and `array_length` describe the descriptor array rather than the
image, so they stay with the metadata that decides the descriptor count.
A binding is only corrected when its image variables all declare the SAME image
type. A function-constant-gated `air.location_index` puts several
differently-shaped variables on one binding -- 67 corpus modules do -- and there
the module has no single answer to read: the consumer picks one by choosing its
function constants. `reflect_sanitized` builds no module and keeps the
type-name-derived shape; its doc comment already listed what it approximates.
`TextureFormat::from_spirv_format` inverts the existing `to_spirv_format` over a
new `TextureFormat::ALL`, with a round-trip test that also proves the mapping is
injective -- otherwise the inverse would not be single-valued.
Measured over 2880 corpus sources by comparing every reflected shape against the
`OpTypeImage` behind its binding: 2 modules disagreed, both cube textures
reflected as `Cube` while the module declares 2D arrayed; 0 after. SPIR-V bytes
identical and the failure count unchanged at 204; exactly those 2 modules' -- and,
from the version bump, every module's -- reflection changed.
New `tests/reflection_describes_the_image_it_binds.rs`. The cube fixture binds one
AIR type name, `texturecube<float, ...>`, as two different emitted images: the
texel-read source as a 2D array, the written destination as a cube. Verified as a
detector -- with the reconcile removed it fails. A second authored kernel covers
four shapes across dimensionality, component class, and storage format, and
asserts they stay four distinct shapes so a decoder that widened them all could
not pass by moving both sides together. Only one public fixture binds a texture,
which is why the grammar probe carries the coverage; the fixture sweep is there
for when that changes.
`REFLECTION_VERSION` 33 -> 34: a cached v33 shape can name a view type the module
rejects. `docs/REFLECTION.md` follows.
Gate: fmt, clippy -D warnings, warnings-denied all-features rustdoc, cargo test
-p metal2vulkan (debug and release), cargo test -p metal2vulkan-validation.
Two passes bind a real resource with no Metal argument behind it, so an AIR value
has a legal SPIR-V type: `air.get_null_texture_*()` gets an `OpTypeImage`,
`air.get_read_sampler()` gets an `OpTypeSampler`. The parent commit retracts those
whose value nothing consumes. One that IS consumed stays -- and nothing in the AIR
metadata describes it, so a consumer building its `VkDescriptorSetLayout` from
`ShaderReflection` produced a layout the module reads outside of.
This was the last of the module-vs-reflection descriptor mismatches. Over 2880
corpus sources the count is now 0, down from 267 when the oracle was first run.
`ResourceKind::SynthesizedNullTexture` and `ResourceKind::SynthesizedReadSampler`
report them. Which placeholders survive is a fact only the passes hold, so
`transform` now returns it -- `Transformed` replaces the `(Module, EmitSidecar)`
tuple -- and `finish_module` narrows the list to what the finished module still
declares, since the steps after `transform` delete instructions and the liveness
pass there can take a variable with them. Reflection reads each placeholder's
class from the module's own `OpTypeImage`/`OpTypeSampler`, and a null texture's
`texture_shape` off that image's operands, so nothing is inferred from binding
numbers. That mirrors `reconcile_buffer_address_table`, which closed the same kind
of gap for the address table.
`validate_descriptor_abi` constrains a placeholder to its ABI band rather than to
a recomputed `base + index`: it takes the first binding in the band no Metal
argument claims, so there is no index to recompute from.
Validation: `unsupported_reflection_requirements` marks a reflection carrying a
placeholder with the new `ToolingRequirement::SynthesizedPlaceholderDescriptor`.
The Vulkan executor has no authored resource to write at a descriptor no Metal
argument produces, and the Metal oracle has nothing to encode, so the row is
honestly not executable until the harness can supply a deterministic placeholder
resource. It is not claimed as supported without execution evidence. Before this,
such a row built a layout that omitted a binding the shader reads, so it was
already failing rather than silently passing. The exhaustive `ResourceKind` match
in `executor_contract.rs` is what forced the decision; that is what it is for.
`reflect_sanitized` builds no module and therefore reports neither placeholder;
its doc comment now says so alongside the address-table approximation it already
documented.
`REFLECTION_VERSION` 32 -> 33: a cached v32 reflection is missing a binding its
module declares. `docs/REFLECTION.md` gains both kinds in its binding-map and
descriptor-type tables.
Verified over 2880 corpus sources: SPIR-V bytes identical, failure count unchanged
at 204, and -- measured before the version bump, which changes every reflection
hash -- exactly one module's reflection changed, the one the mismatch scan named.
New authored fixture in `tests/reflection_covers_declared_bindings.rs`: a kernel
that queries the placeholder's width, the counterpart to the unconsumed probe
beside it. Verified as a detector: passing an empty placeholder list to
`report_synthesized_placeholders` fails exactly that test.
Gate: fmt, clippy -D warnings, warnings-denied all-features rustdoc, cargo test
-p metal2vulkan (debug and release), cargo test -p metal2vulkan-validation.
`ShaderReflection::bindings` is a work list: a consumer walks it and acts once per
entry, allocating a descriptor, writing it, and sizing per-resource budgets from
the length. `from_fragment` called `append_embedded_resources` twice with the same
arguments, so every fragment entry with an `air.indirect_buffer` argument listed
each of its argument-buffer residents twice and asked for that work twice.
Nothing in the emitted module records the repeat -- the decorations it duplicates
are already there once -- so `reflection_covers_declared_bindings.rs`, which asks
whether reflection covers what the module declares, cannot see it. Measured over
2880 corpus sources: 405 fully-identical duplicate entries across 19 modules, all
fragment `EmbeddedArgBufferTexture` and `EmbeddedArgBufferBuffer`. After: 0.
To keep the class from returning silently, `validate_descriptor_abi` -- which both
`reflect_sanitized` and the reflected translation path run -- now rejects two
entries that agree in every field. Equality is the right test rather than the
`(set, binding)` pair, which raw-word alias buffers legitimately share and which
this check deliberately still allows; genuinely distinct resources always differ
somewhere, in the Metal index, the entry-parameter index, or an argument-buffer
resident's field offset.
New `tests/reflection_describes_each_resource_once.rs` with an authored fragment
fixture: one `air.indirect_buffer` holding a writable texture and a nested device
buffer. Verified as a detector -- with the second append restored the fixture test
and the gate test both fail. It also sweeps every public fixture and pins the gate
itself, so deleting the check cannot make the other two pass by not looking.
`REFLECTION_VERSION` 31 -> 32: a cached v31 reflection for such a fragment carries
entries a consumer would act on twice. `docs/REFLECTION.md` follows.
Verified: 2880 corpus sources, SPIR-V bytes identical and the failure count
unchanged at 204; 19 modules differ in reflection only, the same 19 the duplicate
scan named.
Gate: fmt, clippy -D warnings, warnings-denied all-features rustdoc, cargo test
-p metal2vulkan (debug and release), cargo test -p metal2vulkan-validation.
The interface pass materializes a descriptor-backed render-target plane wherever
it lowers an `air.load/store.implicit_imageblock.*` call, and the detector that
finds those calls scans the module body -- it never looks at the stage. Reflection
did look at the stage: `KernMeta` carried the detected attachments and `from_kernel`
reported them, while `from_fragment` and `from_vertex` hardcoded an empty list.
A fragment entry that reads its render target back through the implicit imageblock
therefore emitted `OpDecorate %n Binding 200` and reflected nothing, so a consumer
building its `VkDescriptorSetLayout` from `ShaderReflection` produced a layout that
did not cover the shader. Verified on the authored fixture: before this change the
module declared Binding 200 with `implicit_imageblock_attachments: []`; now it
reports the plane at that binding.
`FragMeta` and `VertMeta` now carry the field, filled by the same stage-agnostic
detector, and one `implicit_imageblock_planes` helper does the meta-to-reflection
mapping for all three constructors instead of the one copy `from_kernel` had.
Scope of the evidence: all five corpus users of those intrinsics are kernels, so
this is not a claim about how common fragment imageblock read-back is in real AIR.
It is the module and its description disagreeing, which is a defect whether or not
a shipped shader has hit it.
`REFLECTION_VERSION` 30 -> 31, since a cached reflection from v30 is missing a
binding its module declares. `docs/REFLECTION.md` said 29 and now says 31.
Verified: 2880 corpus sources byte-identical (this changes reflection, not
emission).
The sweep in `tests/reflection_covers_declared_bindings.rs` stays at each fixture's
declared stage. Translating a module at a stage its AIR does not declare leaves the
stage parse with no source at all, so the reflection is a stub regardless of what
the module contains; that is a different question from this one.
Gate: fmt, clippy -D warnings, warnings-denied all-features rustdoc, cargo test
-p metal2vulkan (debug and release), cargo test -p metal2vulkan-validation.
Squash 147 commits (2026-08-20 through 2026-08-31) into one change on top
of the exact-kernel-grid work. Covers native lowering and pointer/layout
construction, AIR intrinsic and funnel-shift coverage, BDA address
preservation across aggregate calls, CFG structurization, function-constant
and visible-function specialization, the 30-second translation ceiling, the
authored-case corpus and linkage validation suite, and refreshed byte-exact
MoltenVK evidence.
The kernel-grid lowering in this tree supersedes the 324-line variant in
the parent commit; that file is reduced to its current 139-line form here.
Resulting tree is identical to 7174c7b. Prior history remains reachable at
tag pre-squash-backup and branch backup/pre-squash-7174c7b.
Claude-Session: https://claude.ai/code/session_01D1u4vU7Mr5QNWrnnRHC8iS
Model kernel dispatch geometry as a typed contract shared by lowering, reflection, validation, and the CLI. Cull surplus dispatchThreads invocations using fixed or reflected push-constant grid bounds, make that safe dynamic-grid path the default, and require an explicit whole-workgroup assertion to omit it.
Reject unsafe source-barrier kernels before every product emission facade by following the selected AIR entry graph, including quoted LLVM symbols. Exercise the same default contract in authored candidate validation and document the host ABI.
Keep corpus audit parent concurrency bounded by feeding isolated translation workers from scratch-backed stdin files instead of creating one feeder thread per row. This removes the scoped-thread exhaustion that aborted late full censuses while retaining child decoding inside the time and memory watchdog.
Verified with format checking, warnings-denied workspace clippy and Rustdoc, validation tests at concurrency 16, the unchanged downstream repro, a forced 88,819-row audit completing in one invocation at jobs 16, failure retries, and a zero-read warm pass.
Distinguish image descriptors from texel buffers, scope synthesized binding occupancy by descriptor set, and decouple the Metal texture source limit from configurable descriptor ranges. Centralize retry finalization and runtime sampler projection so layout and specialization contracts cannot drift across paths. Refresh consumer documentation and add adversarial descriptor tests.
Thread a versioned, validated descriptor layout through emission, reflection, synthesized resources, retry-created address tables, and Vulkan validation. Preserve the existing ABI as the explicit default and cover cross-stage separation, static samplers, embedded textures, raw aliases, invalid ranges, and default byte identity.
Enforce runtime storage-image component compatibility at the metadata-only reflection boundary as well as executable translation. Update every matching reflected storage binding, cover the authored embedded-texture checker path, and advance reflection and executor fingerprints to prevent stale reuse.\n\nVerified with cargo fmt, warnings-denied workspace clippy and Rustdoc, 1364 serial product tests, and 144 serial validation tests.
Route writable argument-buffer textures, including fixed descriptor arrays, through the runtime storage-image format and capability contract. Reflect their applied state by synthetic resource index and teach authored validation to resolve structural owner/offset identities through reflection before candidate translation. Bump reflection and executor fingerprints so stale outputs are not reused.\n\nVerified with cargo fmt, warnings-denied workspace clippy and Rustdoc, 1364 serial product tests, and 144 serial validation tests.
Accept runtime storage surface formats and host feature facts by Metal texture index, specialize image types before interface creation, and reflect the exact explicit or formatless contract. Track runtime origins through arrays and image aliases so every read, write, imageblock write, emulated fetch, and atomic operation checks the required capability or refuses honestly.\n\nWire authored validation resources into the same product options, bump the reflection and candidate executor contracts, document consumer use, and cover type splitting, dependent loads, exact formatless capabilities, atomics, incompatibility, missing bindings, imageblock writes, and pixel-gather storage reads.\n\nVerified with workspace clippy -D warnings, warnings-denied all-features Rustdoc, serial product and validation suites, both packaged AIR reproductions plus spirv-val Vulkan 1.3, and release measurements under 0.5 seconds / 23 MiB RSS.
Accept bounded pipeline sampler state by Metal index, attach it to the emitted runtime sampler SSA value, and reuse the static sampler lowering seam for pixel-coordinate sampling, addressing, depth, comparison, and LOD refusals. Reflect only applied sampler states and make the validation executor consume that synchronized contract.\n\nCover normalized/pixel switching, fragment and kernel indices, all supported address modes, offsets, depth comparisons, serde, validation plumbing, and honest unsupported-state refusals.
Replace overlapping resource bases with checked sampled-texture, sampler, color, imageblock, storage-texture, and synthetic descriptor bands shared by emission and reflection. Reject unknown or cross-class descriptor layouts at the final module boundary, keep constexpr/default allocation inside its band, and bump reflection ABI version 22.
Also resolve kernel function-constant resource locations consistently, coalesce compatible aliases in the Vulkan validation consumer, and cover high/last indices plus sampled/storage aliases end to end.
Verified with serial product and validation tests, warnings-denied workspace clippy and Rustdoc, the packaged descriptor collision repro, a 500-row current-fingerprint translation checkpoint, and release translation at 0.02s / 22,216,704-byte max RSS.
Preserve and parse the source datalayout, use allocation strides through aggregate byte walkers, and correctly map uchar vectors from AIR struct metadata. Record typed mapping outcomes so authoritative metadata cannot disappear silently.\n\nCover scalar families, custom vector alignment, raw and inline lowering, retry emission, metadata matching, and path-based translation.
Overhaul the validation workflow around sharded authored cases, dependency-exact observations, incremental indexed corpus audits, bounded parallel translation, and native Metal/Vulkan comparison.\n\nExpand native AIR lowering, reflection, linked-function specialization, resource and stage-interface support, and structural CFG/pointer repair across the harvested macOS 26 corpus. Add exact intrinsic inventory, distributed 16x16x16 matrix lowering, explicit opaque tensor linkage, and regression coverage for the newly supported feature classes.\n\nThe final corpus verification accounts for all 88,819 indexed AIR modules under the current product fingerprint: 65,355 translate and validate directly, 23,464 require exact authored linkage, and zero fail or remain unresolved.
Expand structural image, buffer, control-flow, and passthrough lowering, including driver-safe relooper limits and regression coverage.\n\nExpose buffer extent, type, and refined access in reflection v4 for downstream consumers.\n\nHarden corpus oracle planning and loop safety, quarantine non-semantic rows, and refresh the affected translation and execution ledgers.\n\nVerified with cargo fmt --all, workspace clippy with warnings denied, and serial product and validation test suites.
Reserve translator-owned constexpr samplers inside the sampler descriptor\nband instead of allowing framebuffer-fetch bindings to push them into the\ncolor-input range. Decode the full two-word AIR sampler state and expose it\nthrough reflection schema version 3 so Vulkan consumers can create the exact\nimmutable sampler rather than guessing from the emitted descriptor.
Keep emission and reflection ordering aligned by the stable AIR sampler\nglobal suffix, and cover the pipe25 shape with runtime sampler, two static\nsamplers, and a framebuffer-fetch color input.
Verified with:\n- cargo test --workspace --all-features -- --test-threads=1\n- cargo clippy --workspace --all-targets --all-features -- -D warnings