Commit Graph
306 Commits
Author SHA1 Message Date
Anees Iqbal d0664f2c10 CI: qualify the float and half function-constant cases on lavapipe
scripts/qualify-public-cases runs a named list of the owned public cases on
lavapipe against their committed Metal observations. It now names lane
fcfloat's 15 cases (engine/fc_float_gate: a kernel's gated argument and a
fragment's gated sample mask; engine/fc_half_gate: the sample mask), so CI
keeps Metal's answer for a float or half predicate: present at 1.5, -0.0
and a quiet NaN, absent at +0.0 and unsupplied (Apple M3 Max, jobs
m3-max-75714, 75716, 75726). The lane's candidate ran these 15 on lavapipe
at 7de0a8c8bb's tree plus the half fixture: 15/15 Match, every slot current
(job m3-max-75728). The script itself runs in the gate at the pin tip.
2026-11-26 17:35:09 -08:00
Anees Iqbal c718924d44 CI: qualify the AIR 1.8 sampling case on lavapipe with the other public cases
scripts/qualify-public-cases runs case 884ad7d75a22 against its committed Metal row. Run by hand
under the same operator environment (ci-lavapipe, job m3-max-73980 on lavapipe 23.1.1): Match,
candidate output 7d65bff73d82, Metal's bytes.
2026-11-25 13:37:09 -08:00
Anees Iqbal ab24c9617f Docs: comments that named a deleted module or file say what is true now
Six comments sent readers to `device::driver_facts` (the release-keyed deviation table) as the
place a driver's measured deviations come from. The module is gone and `Device::from_queries`
reads no identity, so each now says that translation takes no deviation and reads no driver
identity:
- crates/metal2vulkan/src/ash_interop/query.rs (the format query's note),
- crates/metal2vulkan/src/device/description.rs (`device_name`'s doc),
- crates/metal2vulkan/src/device/khronos.rs (the module docs' deviations paragraph),
- crates/metal2vulkan/src/device/tests/description.rs (`a_stated_deviation_is_refused`'s doc),
- scripts/regen-device-profiles/README.md and regen_device_profiles.py (the Deviations text).

lib.rs's note on the crate-private modules drops its design citation and the claim that lowering
and the binder's replay share `indirect_commands`: no lowering reads it, and validation's case
model and Metal executor reach it as `bind::indirect_commands`.

The ASTC HDR probe's header (crates/metal2vulkan-conformance/probes/astc_hdr_textures.m) named
the runtime's `astc.rs`, which does not exist; it now points at `bind::astc_decode`'s docs and
the `astc-*-hdr` recordings. No recording or test fingerprints the probe's source:
`git grep -n 'astc_hdr_textures'` finds only the probe itself, a sibling probe's comment and two
doc comments under bind/astc_decode.

Zeros, at metal2vulkan 733b14ed24 (this commit's parent) and the consumer reims-vgpu d0a7c9614:
- `git grep -nw driver_facts` here: 0 after this commit (6 before, the six above); no file
  `crates/metal2vulkan/src/device/driver_facts*` (`git ls-files`: 0). Consumer: 0.
- `git ls-files '*astc.rs'`: 0.

Comments only: no code, no test or table moves. Verified by `cargo fmt --all` (no change) and
the lane's quick check at the stack's tip.
2026-11-25 12:22:03 -08:00
Anees Iqbal 3c52ee1cf1 Render pass: a colour attachment renders one depth plane of a 3D texture's level
What: RenderPassColorAttachmentDescriptor takes `depth_plane` (Metal's `depthPlane`). A 3D
texture of RenderTarget usage is made 2D-array-compatible (VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT,
in its image format query too: Plan::flags, from the image's type and its colour attachment usage,
no query). attachment_view then takes the plane of a 3D texture's level as a 2D view of that one
layer (base layer = depthPlane, at the level), checked against the level's depth
(Refusal::AttachmentPlace past it). Every barrier on a 3D texture's image (its attachment's, its
copies' and its moves', texture::barrier_layers) names the image's layers as 0 and
VK_REMAINING_ARRAY_LAYERS, so each moves every plane of the level it names. Before, every such pass
was Gap::RenderPass of RenderPassKind::TextureType.

Still TextureType: a 3D texture in a layered pass (renderTargetArrayLength 2 or more), a depth or
stencil attachment of a 3D texture, a 3D resolve texture, and a resolve's depth plane but 0. A draw
that reads, through a shadow (a device without the attachment feedback loop), a 3D texture whose
plane its pass renders is Gap::Draw of DrawKind::AttachmentRead: a shadow's copies are of layers.
The floor asks a device that lists VK_KHR_portability_subset for imageView2DOn3DImage too
(VUID-VkImageCreateInfo-imageView2DOn3DImage-04459), as it asks multisampleArrayImage.

Why: a guest route meets the refusal. A browser's GL layer clears every 3D texture of an RGB-family
format (RGB8, RGB16F) at creation through a pass on each plane, to set the alpha it emulates; it
also renders into a plane for framebufferTextureLayer(TEXTURE_3D, k) then a clear or a draw, for a
level sampled before a full upload, and for copyTexSubImage3D. The consumer's route showed the key
at 205c8d2398 ("a render pass with TextureType is not built", colour 0 RGBA8Unorm Type3D 32x32x4,
usage 0x7, Managed), and every route that renders into a 3D texture read 0.

Metal (MTLRenderPass.h): `depthPlane` is "The depth plane of the texture to be used for rendering.
Default is zero."; Apple's page for the property, as fetched: "If the texture isn't a 3D texture,
then Metal ignores this property." Every Mac renders into a 3D texture's plane, with nothing to ask,
so it is built.

Vulkan (1.4.366): VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT "specifies that the image can be used to
create a VkImageView of type VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY" (core since 1.1);
the image is 3D (VUID-VkImageCreateInfo-flags-00950) and not sparse (-09403); the format query takes
the same flags (Image Creation Limits). The view is 2D, one level
(VUID-VkImageViewCreateInfo-image-04970), its base layer below the level's depth (-02724, -02725),
of an image made with the flag (-06728).
Such a view "can be used as a framebuffer attachment that refers only to the specified range of
slices of the selected mip level" (VkImageSubresourceRange). Dynamic rendering refuses only a 3D
view type (VUID-VkRenderingAttachmentInfo-imageView-12470). The runtime does not enable
maintenance9, so a barrier on the image moves the whole level
(VUID-VkImageMemoryBarrier2-subresourceRange-01488); with maintenance9 its layers would name depth
slices (-maintenance9-10798), and the layer count that names the whole level either way is
VK_REMAINING_ARRAY_LAYERS, which the validation layer asks for on such an image
(WARNING-VkImageSubresourceRange-layerCount-compatibility, met on lavapipe with layerCount 1, job
m3-max-73446). Load and store "only update values within the defined render area" of the view's
plane. The view is bound to no descriptor
(VUID-VkDescriptorImageInfo-descriptorType-06713).

Portability: KosmicKrisp, Mesa 26.3.1's source (src/kosmickrisp/vulkan), names no portability
subset, so the M3 device is not asked: a source read, unaudited at run time. MoltenVK reports
imageView2DOn3DImage (profiles/moltenvk-m3.json) and is below the floor anyway.

Conformance: the suite's `layered-attachment-places` crosses `depthPlane` over a 3D target of three
planes, recorded on Metal. Its runtime side now sets a colour attachment's `depth_plane` (a depth or
stencil attachment's plane stays Unavailable), and its twelve known-gaps-rt.tsv rows go.
docs/REFUSALS.md, docs/METAL-COVERAGE.md (depthPlane implemented), docs/CONFORMANCE-COVERAGE.md and
api_signatures.tsv are regenerated.

Tests:
- tests::depth_planes (device cfgs): RGBA8Unorm and RGBA16Float, ShaderRead | ShaderWrite |
  RenderTarget, Managed, an 8 x 8 x 4 texture of two levels (the second 4 x 4 x 2) and an 8 x 8 x 1
  one, every plane written first by replace_region. One command buffer: level 0's plane 2 cleared
  and drawn, level 1's plane 1 cleared and drawn, level 0's plane 0 loaded and drawn, level 0's
  plane 1 cleared alone, the one-deep texture cleared and drawn; every plane of both levels copied
  out and sampled at each texel's centre through a nearest sampler state (level 1 through a 3D view
  of it). A plane past level 1's depth is AttachmentPlace, a pass of two layers TextureType.
  tests::layouts records each rendering's colour attachment's view type and range and its image's
  type and create flags, which the cell asserts and prints.
- tests::floor: the portability features asked and enabled include imageView2DOn3DImage.
- The validation layer, which every device test runs under and which fails a test on any warning,
  holds the barriers: without barrier_layers the cell drew
  WARNING-VkImageSubresourceRange-layerCount-compatibility on lavapipe (job m3-max-73446).

Verified (tree of this commit, run as f748e9e8d2 on development 6047a2d8b6):
- msi, lavapipe (Mesa 26.2.4), job m3-max-73464: fmt, clippy (no cfg, m2v_gpu, m2v_cpu_icd),
  rustdoc, the refusal, signature, Metal-coverage and conformance-coverage checks all exit 0; the
  runtime's suite under the validation layer 734 passed, 3 skipped (the cell among them); the
  conformance crate's suite 1037 passed; `conformance replay --cpu` exit 0, the ledger exact,
  layered-attachment-places "announced" (the native-nan-encoding degrade notice alone).
- One leg a vendor, a nextest archive and the conformance command built on msi (job
  m3-max-73466), under the Khronos validation layer 1.4.363.0: the cell (its form printed: a 2D
  view, base layer the plane, at the level, of a 3D image made with 2D_ARRAY_COMPATIBLE, 0x28 for
  RGBA8Unorm with MUTABLE_FORMAT, 0x20 for RGBA16Float; every plane of both levels and of the
  one-deep texture exact, copied out and sampled), the blit, floor, layouts, layered, no
  attachment, over, pass, render, resolve, shadow, texture, view and depth/stencil route and copy
  families (123 tests), and `conformance replay --gpu` (exit 0, the ledger exact,
  layered-attachment-places "announced" as on lavapipe):
  - Intel Iris Xe (ANV, Mesa 26.2.6), job m3-max-73476: cell passed, 123 passed, replay exit 0.
  - AMD Radeon 780M (RADV PHOENIX, Mesa 26.2.6), job m3-max-73477: cell passed, 123 passed,
    replay exit 0. (The XTX's node was held by another job for 47 more minutes.)
  - NVIDIA RTX 3090 (620.70.06), job m3-max-73478: cell passed, 123 passed, replay exit 0.
2026-11-24 01:35:19 -08:00
Anees Iqbal 0630c1d9a7 Translator: specialize refuses an instruction it would leave half specialized
pipeline::specialize copied every instruction outside its list as it was. An
OpExecutionModeId (a LocalSizeId mode among them) beside a WorkgroupSize
composite would leave the entry point with two sizes, and an OpDecorationGroup
could carry a SpecId the pass never reads, so that constant would keep its
default. The translator writes neither, so the pass now refuses both with an
Error::Internal that names the instruction. An OpSpecConstantOp of an opcode
outside SpecOp was already refused; its refusal now names the opcode.

Op::ExecutionModeId and Op::DecorationGroup move into every build, and
ExecutionMode::LocalSizeId into test builds. Both come through
scripts/regen-spirv-grammar's items.txt and a regeneration from Khronos's
grammar (vulkan-sdk-1.4.341.0); table.rs comes out unchanged.

Test: a_module_of_an_instruction_the_pass_does_not_specialize_is_refused takes
the deep kernel with an OpExecutionModeId LocalSizeId of its LocalSize
constants, with an OpDecorationGroup, and with an OpSpecConstantOp turned to
ISub. Each must be refused, and the refusal must name the instruction. The
next check job runs it.
2026-11-23 20:59:01 -08:00
Anees Iqbal ed4b0ecd76 rt: storage textures written or read at a run-time level, through runs of set 1's level elements
What: under the identity domains a storage slot written, read or size-queried at a level other
than the constant 0 indexes a run of set 1's storage-image array instead of being refused as
Unsupported{IdentityDomains} ("an encoder value the function reads as TextureLevels(S)"). The
translator pushes the bound texture's level count (PushField::TextureLevels) and the run's first
element (the new PushField::TextureLevelBase, beside it), states no StorageTextureLevels or
StorageTextureLevelViews fact, and an access at level l takes element
first + min(l, max(n, 1) - 1) of the array, NonUniform, inside l < n. A texture of one level
pushes its own index, nil 0 with count 0.

The runtime's binding 1 grows by 65,536 level elements past its 65,536 textures, 4,096 runs of 16
(floor::LEVEL_ELEMENTS, floor::LEVEL_RUN). The first dispatch or draw that binds a texture of more
than one level to such a slot (the encoder's checks, compute and render stages alike) gives it a
run: a single-level storage view of each level, of its storage element's type (a cube's level as
the 2D array of its faces, a view's from its own first level), written at the run's elements. A
later bind takes the texture's lock and pushes the same two words: no Vulkan call. The run goes
back through the pool and reaper once the texture is released and its work retired: elements null,
views destroyed (Gauges::level_elements). Every run held, or a texture of more than 16 levels, is
the new Limit::LevelElements { max: 4096 }, and the dispatch or draw does not run. The floor's
storage-image limits and both totals rise by 65,536: storage 196,608, per-stage resources 327,688,
pools 351,680; every lab device's profile is far above (llvmpipe 1,015,808 storage, the least).

SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION bump in the branch's last commit (a new PushField).

Why: 17 guest kernels in 6 libraries were refused at state creation by this form.

Docs: REFUSALS.md and the signatures table regenerated, RESOURCE-ID.md (binding 1 past 65,536),
API.md (storage levels under identity), the runtime README (Set 1, the floor table, the known-gap
line replaced by the Limit), the runtime-floor profile's limits, and the conformance ledger's
level-sizes-storage row removed.

Checked by: engine_texture_levels' identity test and the runtime's storage_levels device tests
(red at 6ad1c33124: jobs m3-max-70886 and m3-max-70892 on lavapipe), engine_identity's
a_storage_slot_written_at_a_run_time_level_is_an_element_of_its_run; the lane's jobs report the
runs per card.
2026-11-23 09:04:38 -08:00
Anees Iqbal 624c5a38b9 Translator: a fragment's quad votes are OpGroupNonUniformQuadAllKHR and QuadAnyKHR, helpers included
What: in a fragment function, Metal's quad_all and quad_any are now
SPV_KHR_quad_control's OpGroupNonUniformQuadAllKHR and
OpGroupNonUniformQuadAnyKHR of the predicate, in place of the quad's four
bits of the ballot of the predicate (compared with the ballot of the
active lanes for quad_all). Kernels and vertex functions have no helpers
and keep the ballot form. The IR gains GroupInst::QuadAll beside
QuadAny (no scope operand; QuadControlKHR, SPV_KHR_quad_control and
shaderQuadControl), and the builder's group_quad_any becomes
group_quad_vote(all, pred), as group_vote is. The interpreter, the
serializer and the requirement deriver follow. items.txt lists
GroupNonUniformQuadAllKHR, and scripts/regen-spirv-grammar regenerated
spv.rs from SPIRV-Headers vulkan-sdk-1.4.341.0: the opcode loses its
cfg(test); the test parser's table already held it.

Why: Metal's helpers are active lanes of their quad and take part in
its votes. Vulkan section 9.31 runs quad group operations over a quad's
helpers in every entry, and its other group operations, the ballot
among them, only where the entry declares MaximallyReconvergesKHR. AMD's
open Vulkan driver leaves a partly covered quad's helper out of the
ballot even though the entry declares MaximallyReconvergesKHR beside
RequireFullQuadsKHR (report 142), so a vote read through the ballot
missed the helper: the runtime test quad_votes read quad_any(x > y) = 0
and quad_all(x <= y) = 1 on the 12 covered pixels of the diagonal quads,
where Metal answers 1 and 0 (m3-max-70847, AMDVLK 2025.Q2.1 on the RX
7900 XTX and the Radeon 780M; RADV right on both). The quad vote
instructions are right by the spec on every device whatever the entry's
reconvergence (rung 1), the form the quad reductions took (54517169dd).

What full_quads asks: unchanged, shaderQuadControl. A fragment vote's
operation class moves from Ballot to Quad, which Vulkan requires
wherever shaderQuadControl is supported. No new query.

Still through the ballot in a fragment: quad_ballot, the active mask,
is_first, broadcast_first, the quad prefix sums, and every simdgroup
operation.

Tests: operation_classes_follow_the_tier gains a fragment's quad All and
Any (Quad); fragment_quad_votes_are_quad_vote_instructions compiles a
fragment of both votes on every committed profile with quad control (one
QuadAllKHR, one QuadAnyKHR, no ballot) and checks a kernel's votes
(a3_quad_votes_divergent) take neither instruction.
2026-11-23 04:46:38 -08:00
Anees Iqbal 9f6712f172 Translator: spv.rs names OpGroupNonUniformQuadAnyKHR outside tests
The fragment quad reduction emits it (1c64701191), so items.txt lists it
and scripts/regen-spirv-grammar regenerated spv.rs from SPIRV-Headers
vulkan-sdk-1.4.341.0: the opcode loses its cfg(test). The test parser's
table already held it. 1c64701191 alone does not build without this
commit.
2026-11-23 04:05:51 -08:00
Anees Iqbal 5a03a60b6c rt: Device::max_threadgroup_memory_length, Metal's maxThreadgroupMemoryLength less the vote word
The answer is the device's maxComputeSharedMemorySize less the 4-byte vote word a kernel's
partial-threadgroups variant may take beside its threadgroup memory, rounded down to 16, and at
most Metal's 32 KiB: 32,752 on a device of 32,768 bytes (AMD's drivers on the 780M, lavapipe,
MoltenVK on the M3), where a Mac answers 32,768; 32,768 on RADV, NVIDIA and ANV. A guest that
sizes its threadgroup memory from it (a length it sets, or source it compiles at run time) runs
its ragged grids, where 32,768 is refused (Gap::PartialThreadgroups for static memory,
Limit::ThreadgroupMemory for a length). The word is one constant, pipeline::VOTE_BYTES, which the
module interface's vote word reads too.

It changes only the answer: every dispatch is still checked against the device's own limit. An
emulated SIMD group's scratch varies by kernel and is not counted; the runtime README records it
with the refusal a kernel past the answer keeps, and the unaudited cost to a guest that rounds the
answer down to a power of two.

Tests: the scan test reads the answer and checks its formula; a kernel whose variant takes no vote
word runs [25,1,1] and [1024,1,1] in [1024,1,1] with a length of 32 KiB, past the answer
(every_device_runs_a_kernel_without_a_vote_word_at_a_length_past_its_answer). METAL-COVERAGE and
the api_signatures table are regenerated. Not yet run.
2026-11-23 02:31:24 -08:00
Anees Iqbal 058fd25a7b Translator: MSL 3.2 program-scope buffer bindings become buffer parameters; other shapes refused apart
What: `!air.global_bindings` decodes into `AirAbi::global_bindings` (`GlobalBinding`: the
global, and its node's role, type information and name, read by the parameter-node decoder;
the node's index is -1). Canonicalization (`canon::global_binding`, beside the global
built-ins) makes each plain load of a bound buffer's pointer (device or constant space, one
stated slot) a read of a parameter: the entry's own parameter of the binding's role and type
where it takes one, else one appended, shared by the bindings of one role and type. Lowering
then binds it where a `[[buffer(n)]]` parameter binds; the runtime binds nothing new.

Why: the whole module was refused as ProgramScopeBinding (78 functions in 1 library of the
private corpus on runtime-floor and gate-lavapipe: kernels, one constant struct buffer each,
read only by plain loads of its pointer). Metal fills a bound global from the executing stage's
own argument table. Measured on an Apple M3 Max under macOS 27.0.1:
- m3-max-70268: a kernel's globals read and write the buffers bound at their indices;
  reflection lists each as a binding at its index; a parameter and a global of one type at one
  index, and two globals of one type at one index, read the one buffer; a vertex and a fragment
  function reading one global each read their own stage's buffer at its index.
- m3-max-70306: Metal also takes a bound texture and sampler, bound threadgroup memory, a bound
  sampler array, and a linked visible function of another library that reads a bound buffer.

What stays refused, each a refusal of its own (docs/REFUSALS.md regenerated):
ProgramScopeResource (a texture, sampler or threadgroup memory, one or an array),
ProgramScopeSharedSlot (a binding at a slot an entry parameter or another binding binds with
another role or type), ProgramScopeLinked (bindings in a linked or dynamic-library module),
ProgramScopeRead (a read of a bound buffer other than a load of its pointer, which
`xcrun metal` 32023.922 does not write). ProgramScopeBinding is gone: a consumer's exhaustive
match on Feature breaks, and a consumer's AirAbi literal needs the new field (git grep of the
consumer's checkout at aed8655a62: 0 hits for ProgramScopeBinding and for `AirAbi {`).

Tests: the ABI decode of a binding (a node with a parameter's index, or a global that is not the
externally initialized undef constant, is malformed); canonicalization over a kernel with three
bound buffers (two appended parameters, one shared with the entry's own) and the refused
shapes; linking and dynamic-library refusals.
2026-11-23 00:51:10 -08:00
Anees Iqbal 0eb982e471 Runtime floor profile, conformance notices and ledger rows for the LOD-clamp variants
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.
2026-11-23 00:11:46 -08:00
Anees Iqbal 29e54794ca Runtime: a sampler state bound with LOD clamps of its own samples with them
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).
2026-11-23 00:11:19 -08:00
Anees Iqbal afbcfec9a7 Runtime: the compute encoder's imageblock size; a kernel's explicit imageblock is dispatched
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.
2026-11-23 00:09:50 -08:00
Anees Iqbal d825e52482 Validation: the suite's pins for the table work
- 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).
2026-11-22 22:11:30 -08:00
Anees Iqbal 11d8892858 Validation: an authored case calls through a kernel's visible-function table
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.
2026-11-22 22:11:30 -08:00
Anees Iqbal 28e2b0e6ca Validation: a kernel case's visible-function tables run through the runtime
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.
2026-11-22 22:11:29 -08:00
Anees Iqbal da020e5d7b Runtime: a compute kernel that reaches an explicit imageblock gets its state; its dispatch is refused
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" }.
2026-11-22 20:15:34 -08:00
Anees Iqbal a916e61185 Runtime: a kernel's [[stage_in]] is fetched; the three forms not built are Gap::StageIn by kind
A compute pipeline state whose kernel reads [[stage_in]] attributes was refused at its creation as
Gap::KernelInput of KernelInputKind::StageIn, which a guest met (a descriptor-form compute state, the
app's context closed right after). The translator already fetches every attribute in the shader from
the buffer slot at its layout's bufferIndex, through that slot's pushed address, by the stage-in and
dispatch regions the encoder already pushes. Two things stood in the way, both in the runtime:

- interface() refused any kernel whose PipelineInterface::stage_in is non-empty. The line goes.
- The thread-position fetch's reach check reads SpecKey::StageInReach, which the runtime's constant
  loop refused as a specialization it does not set. The runtime now leaves it at the module's default
  (true): one pipeline, the check kept for every dispatch.

What stays refused is a typed refusal naming its own form, Gap::StageIn of a new StageInKind:
- IndirectRegion: setStageInRegionWithIndirectBuffer:indirectBufferOffset:, now the method
  ComputeCommandEncoder::set_stage_in_region_with_indirect_buffer, which always refuses (the
  conformance rt side calls it in place of its own Unavailable);
- DynamicStride: an attribute the kernel reads through a thread-position layout of
  MTLBufferLayoutStrideDynamic (the compute encoder has no attributeStride setter), at the state's
  creation, before the translator's IdentityDomains refusal of StageInStride;
- IndexedStepRate: an attribute it reads through an indexed step at a step rate past 1, at the
  state's creation.
Both creation checks read the descriptor narrowed to the attributes the kernel reads
(kernel_inputs_read), so an attribute it never reads, and a constant step of a dynamic layout,
refuse nothing.

KernelInputKind::StageIn is deleted. Consumer search: `git grep -n 'KernelInputKind'` in the
reims-vgpu checkout at c8201ec2ba: 0 hits (nor any for `StageIn` as a refusal kind).

Tests: the device test every_device_fetches_stage_in_by_each_step_function dispatches
engine/kernel_stage_in's stage_in_fetch under ThreadPositionInGridX at rates 1 and 2,
ThreadPositionInGridXIndexed and Constant, and checks every thread's four attributes (threads past
the region read its last element); without the change the state is Gap::KernelInput.
every_device_refuses_each_unbuilt_stage_in_form_by_its_kind holds the three kinds and the two
states that are made. kernel_input's refusal test of StageIn goes; lowered and the harness's gap
test take Slot. The conformance case stage-in-region-clamps carries on past a refused row (probe,
as attribute_formats does), so its 27 other rows compare where the indirect one is refused. The
ledger drops the 82 rows of the old refusal (stage-in-region-clamps 1, attribute-format-fetches 29,
attribute-format-class-crossings 16, stage-in-unread-attributes 36), takes the indirect row's new
refusal, and the four compute attribute-stride rows' DynamicStride refusal. The validation
requirement KernelStageInput stays: the engine's run through the runtime passes no stage-input
descriptor or region. README, REFUSALS.md, METAL-COVERAGE.md, CONFORMANCE-COVERAGE.md and the
signatures table regenerated.
2026-11-22 13:07:16 -08:00
Anees Iqbal a7dd2e846e Translator: the binder's plan goes, with everything only it reaches, and the TexelRows and YCbCrInPlace forms
The runtime never made a plan (it binds each draw and dispatch by the pipeline's interface), and
since the census digests each pipeline's content alone (two commits back) nothing in the tree calls
one. What only the plan reached goes with it:

- bind: BindState, BindShape and their shapes, BindingPlan and its instantiation
  (DispatchCommands, DrawCommands, push, descriptor and root-table templates and writes),
  plan.rs and plan/ (compute, resources, slots), instantiate.rs, resident.rs, the neutral
  resources' plan side, the heap's member planning and table bytes, the mesh arguments pass
  (MeshArguments, MeshArgumentsForm, fold_object_grid, metal_object_grid), ExecutionStatus and
  StatusBits as public items, TextureShape::Buffer, IndirectRef with the four indirect call
  variants (Dispatch::ThreadgroupsIndirect, DrawCall::Indirect, PatchesIndirect,
  MeshThreadgroupsIndirect) and IndexBufferRef::fetch_end. Dispatch, DrawCall and IndexBufferRef
  stay: validation states its cases' calls with them.
- error::BindError leaves the public surface; a crate-private BindError of three variants stays
  as the error of the heap's view derivation, which lower::texture::slot's storage-read check
  reads (bind::heap::tier_read_gaps). That check keeps only the storage view's format: the
  sampled-view branch and ImageViewDesc were reached by the plan alone.
- vk::DrawCommand, the plan's draw output.
- pipeline: ComputePipeline::plan, RenderPipeline::plan; cache: VariantKey::covers and
  large_buffer_form.
- The TexelRows form (bind::texel_rows, LoweringInputs::texel_rows, RuntimeFact and PushField
  TexelRows) and the YCbCrInPlace form (bind::ycbcr_in_place, lower/sampler/in_place.rs,
  LoweringInputs::ycbcr_in_place and ycbcr_planes_sampled, RuntimeFact and PushField
  YCbCrInPlace, PrecisionNote FloatSampleFilter and HalfSampleFilter, Routine::Quad). Only the
  binder set those inputs.
- The tests of the deleted items, and the plan halves of mixed tests. Of 6810 tests (`#[test]`
  functions in the workspace) 309 leave and 11 come in their place: the lowering halves of mixed
  tests, kept without the plan (the heap layout, the stage-in stride and region facts, the
  emulated-simdgroup and bicubic facts, the iris-xe storage classes), and the kept tests of the two
  renamed files. 50 others are edited to drop a plan half or a deleted item (the api_surface round
  trips; the simd_emulated, extended-range, recursion, dynamic-root, handles, heap-storage-read
  and mesh lowering cases). 6512 remain. engine_graphics_binder.rs and engine_heap_binder.rs keep
  one and two tests and are renamed engine_unattached_colors.rs and engine_heap_groups.rs.
- The runtime guard test's list of files the runtime inputs reach without being inputs drops the
  seven no input reaches since the cut: cache/digest.rs, lower/simd/divergent.rs,
  lower/simd/workgroup.rs, pipeline/artifact.rs, pipeline/layout.rs, pipeline/stage_io.rs and
  pipeline/vertex.rs; three of its reasons that named the plan or the binder say what reaches the file now.

559 public items leave (api_signatures.tsv: 55 structs, 26 enums, 140 variants, 245 fields,
52 methods, 24 associated constants, 7 constants, 5 functions, 5 impls). Consumer search, the
consumer's development at 92ffbed817, `git grep -w NAME` of each of the 112 removed names: 0 hits
for 105; the others are the consumer's own items: TessellationFactors 4 (its
Bound::TessellationFactors), YCbCrMatrix 3 (its own string and doc), texel_rows 2 (its own fn),
ThreadgroupsIndirect 6 (its own Dispatch enums and rt::Dispatch::Indirect), DrawIndexed 1 (a doc
naming MTLIndirectCommandType values), covers 109 and plan 105 (generic words; the `.covers(`
calls are its Extent's, the `.plan(` calls its video encoder's rate.plan). Its one import of
metal2vulkan::bind is the argument-buffer layout types, which stay.

The forms' audit. A texture over a buffer: the runtime's
tests::over::every_device_holds_a_texture_over_a_buffer_in_place. A two-plane YCbCr sample: no
runtime test; the runtime makes no texture of a two-plane YCbCr format (Gap::TextureFormat, the
runtime README's "A format is made where the translator's format table maps it" row), the
conformance cases ycbcr_gathers and ycbcr_textures record Metal's answers, and
known-gaps-rt.tsv lists the runtime's refusals (ycbcr-gathers-*, ycbcr-texel-reads-420v).

Versions:
- RUNTIME_VERSION 2550: it covers plan instantiation and the binder's run-time data. Nothing calls
  those since step 2: the runtime never used the binder, and the own-context executor is gone. A
  run of an unchanged artifact does nothing different, so the guard hash (runtime-sources.sha256)
  moves alone, and the RUNTIME_VERSION doc is rewritten to name what it still covers.
- SEMANTICS_VERSION 2273: no output changes for any input that still exists. The TexelRows and
  YCbCrInPlace forms, their facts, push fields and the two notes were reachable only through
  LoweringInputs::ycbcr_in_place, ycbcr_planes_sampled and texel_rows. Only the binder set those;
  the runtime sets none. The function key appended each of them only when set, so every surviving
  key hashes the same bytes. Two type declarations stay where they were, so module words do not
  move: bool in the bicubic types, uvec4 in the bicubic routines. Byte-identical modules are
  expected, not verified here; the 252-row hash probe is the check.
- ARTIFACT_FORMAT_VERSION 591: the codec tags enum variants by name. The removed RuntimeFact,
  PushField and PrecisionNote variants leave their tags unused, which cache/mod.rs's rule says
  needs no bump: an old entry holding one fails to decode, which is a miss. No codec_struct field
  is removed. That is why SamplerDesc.ycbcr stays.

The guard hash (crates/metal2vulkan-validation/runtime-sources.sha256) moves for the bind/
sources this deletes and edits and for vk/draw.rs, which leaves its list. No run of an unchanged
artifact changes: what stays in bind/ computes what it did (the heap's tier check takes the same
storage format; its removed sampled branch had no caller).

Docs: docs/API.md (section 5 is the interface; the binding and plan sections go), README.md,
docs/ARCHITECTURE.md, docs/HOWTO.md, docs/VALIDATION.md, the runtime README's DrawInput and
identity-domain rows, docs/REFUSALS.md (regenerated; the binder's section goes),
api_reference.md, api_signatures.tsv (blessed: removals only), tests/api_surface.rs, the
signatures floor (5000), the bind modules' own docs, and the public field docs of PushField,
RuntimeFact and SpecKey that named BindState, BindShape or BindingPlan. AGENTS.md: the project
table names pipelines and their interfaces, not binding plans; its "core lives in" line stays
true (bind/ still holds what the lowering reads).

Verified on 31692939d4, this commit's tree (steelbrain/cutbinder-probe-6): job m3-max-68107,
fmt, signatures, refusal surface, clippy -D warnings (workspace plain, --cfg m2v_gpu,
--cfg m2v_cpu_icd; the translator with no feature and with each alone; the AIR crate alone),
workspace Rustdoc -D warnings, each crate's private intra-doc links at 0, api-docs; job
m3-max-68109, the product, validation and conformance suites, doctests, and on lavapipe the
validation and runtime suites under --cfg m2v_cpu_icd, the conformance replay and the public
cases' qualification.
2026-11-22 10:15:34 -08:00
Anees Iqbal d9077dfa0d Push window: each device's maxPushConstantsSize sizes it, up to 256 bytes (rule 2's ninth form)
What: the push window is one value per device, `DeviceProfile::push_window`, the description's
maxPushConstantsSize up to 256 bytes, decided in the profile `Device::from_queries` derives
(device/profile.rs:115). Every window reads it: push placement (`lower::push::window`, `place`,
`spills` and `check_floor` take its bytes; lower/select.rs, lower/access/mod.rs and
lower/access/table.rs pass it), and in the runtime the one pipeline layout's push range
(device.rs:688), the kernel and render pipelines' push checks (pipeline.rs:2119, render.rs:1043)
and the encoder's push bound (encoder.rs:1759). With W that value, a kernel pushes in [0, W), a
vertex function in [base, W - 8) and a fragment function in [base, W); object and mesh functions
keep 0..32 and 32..64. A stage's fields past its window spill to its parameter block, whose
address the window holds, as they did past 256. `from_queries` refuses a maxPushConstantsSize
below 128, Vulkan's least, only (`Unsupported{PushWindow}`, required 128), and the runtime's
floor no longer lists maxPushConstantsSize (floor.rs: its row and PUSH_CONSTANT_BYTES go; the
layout's range was a constant 256). There is no constant 128 path, no switch and no environment
gate: the limit query is the only input. Ported from the held branch steelbrain/amdfloor-window
(d6880ca16b) onto today's development, every line reference confirmed against this tree.

Why: the owner's word choosing option B. A device reporting 128 bytes was refused by the floor;
it now runs with a window of 128.

AGENTS.md rule 2 takes the owner's authorized text: "for eight only" becomes "for nine only",
and the push window joins the list after run-time texel offsets.

Known gap (runtime README, Known gaps of indirect command buffers): in a window of 128 bytes a
command reaches 9 vertex slots, and 8 where the vertex function spills, against 25 and 24 at 256
((W - 8 - 16 - 28) / 8; from code: lower::push's
an_indirect_draw_s_vertex_function_pushes_25_or_9_slot_words). A kernel pushes 8 buffer
addresses beside its dispatch region at 128 bytes against 24 at 256, the rest from its ring.

Caches: a device of 128 and one of 256 share no cached artifact and no pipeline. The profile's
fingerprint hashes every ProfileFields field by Debug (device/profile.rs:312, :327), the limits
included (:346, maxPushConstantsSize at :625); `function_key` hashes the fingerprint
(pipeline/compile/key.rs:182, :189; passed at pipeline/compile.rs:2973), as does
`queried_render_descriptor_key` (key.rs:546); a cached artifact or pipeline loads only under an
equal fingerprint (cache/artifacts.rs:71, :204, :238; cache/envelope.rs:142); and the runtime's
enables digest, which the stage keys check, hashes it (metal2vulkan-runtime/src/device.rs:1533).

SEMANTICS_VERSION stays 2273: no module changes under an unchanged key. Every device
`from_queries` accepted before reports 256 bytes or more (it refused below 256), so its window is
256 as before and its modules are the same bytes; a device of fewer bytes was refused, so it
holds no artifact to go stale, and its modules are new under its own fingerprint. The golden
test at this tree found 0 cells changed under an unchanged key over the 15 committed profiles,
and 1855 under a changed profile fingerprint, runtime-floor's column alone (m3-max-68089; the rows
whose assembler Linux lacks are not observed there).

Golden table: runtime-floor.json and its generator drop the floor block's maxPushConstantsSize
of 256, so the profile reads Vulkan 1.3's least, 128, and its fingerprint moves. Its cells are
re-blessed on development (the bless needs macOS's assembler).

Validation: runtime-sources.sha256 is rewritten (d4a8dbf2...), since device/derive.rs and
device/profile.rs are runtime inputs the guard hashes.

Docs: the runtime README (the floor's limits note and table, compute Parameters, the render push
range, the indirect command buffers' known gaps), docs/API.md section 5 and the from_queries
paragraph, PushWindow's doc, reach.tsv and docs/REFUSALS.md (regenerated; the PushWindow row
only), the device profiles' README, and api_signatures.tsv (DeviceProfile::push_window). The
api_surface table is unchanged: no public type is added.

Tests: lower::push's placement at 256 and 128; from_queries (each committed profile's window is
its limit up to 256, runtime-floor's 128; 128 derives, 64 is refused with required 128); the
tessellation control range, the engine identity and spill tests in each profile's window; and
the runtime's push_window, patch and indirect token tests in two arms each, the device's own
limit and the limit held at 128 by the tests' device shim (tests/command.rs push_window_128,
DeviceOptions::described).

Verified:
- m3-max-68088 (this tree): fmt, the signatures table, the refusal surface, clippy -D warnings
  plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, workspace Rustdoc -D warnings: each exit 0. The
  runtime suite on lavapipe (--cfg m2v_cpu_icd): 647 passed, 3 skipped. Its push lines read
  "push_window: the push window is 256 bytes", "push_window_128: the push window is 128 bytes",
  "window 128, 12 buffers: 3 ring writes and 3 pushes over 3 dispatches", "icb_tokens: ... the
  push window 256 bytes, 25 slot words", "icb_tokens_128: ... the push window 128 bytes, 9 slot
  words", and draw_patches_full_range at 256 and _128 at 128.
- m3-max-68089 (this tree): the core crates 3881 of 3882 passed, 24 skipped; the one failure
  is the golden table, stale under runtime-floor's moved fingerprint (1855 cells, one per row
  observed on Linux, 0 new, 0 gone, 0 under a changed source, 0 changed under an unchanged key).
  Validation 1314 passed, 3 skipped. The translator's push tests print each committed profile's
  window: runtime-floor 128, the vertex function ending at 120, 9 inputs; the 14 others 256.
- m3-max-68067: the whole runtime suite on lavapipe at an earlier tree of this change
  (a98af765ad, before the rebase onto 91fed9449c and the options alias) with a probe commit that
  holds every device's limit at 128 in Device::open (steelbrain/amdfloorb-probe128, never landed):
  647 passed, 3 skipped; the conformance replay exited 0; every push line read 128 bytes.

No card under 256 ran it; the 128 form ran on lavapipe with the limit held at 128.
2026-11-22 10:14:23 -08:00
Anees Iqbal c1bcce40f5 Validation: the drm-shim recipe goes, with its image, its wrapper and its test
The runtime does not open the drm-shim devices as a guest's device (step 0's P2, ruled: the shim
has no venue), so the corpus-pipeline kernel rows that now run through the runtime have no
drm-shim sweep, and nothing else used the recipe. Gone: scripts/drm-shim.Dockerfile,
scripts/drm-shim-exec, scripts/linux-gate's `--recipe drm-shim` with its `--driver` and `--chip`
(and `--recipe` itself, which had only `gate` left), scripts/linux-gate-vulkan's shim ICD block,
and the integration test tests/integration/drm_shim.rs. Driver acceptance on RADV, ANV and NVIDIA
stays on the real cards.

Search at this commit: `git grep -n -i -E 'drm.?shim|M2V_DRM_SHIM'` gives 0 lines; `git grep -n
-e '--recipe'` gives 0. The consumer has no copy of these scripts (they are not part of a
published crate).

(cherry picked from commit 59693588b00825ed312beb67841fe5b8352a6508)
2026-11-22 07:37:15 -08:00
Anees Iqbal 0702b43baf Translator: a kernel's partial-threadgroups variant that cannot be made is refused as PartialThreadgroups
Every refusal of the partial-threadgroups variant (LoweringInputs::partial_threadgroups) named
Feature::GpuEncodedIndirectCommands, the feature of indirect command buffers a kernel encodes,
which none of them is. A new feature, Feature::PartialThreadgroups (NotImplemented), names them
all:
- lower/select.rs (finish): the kernel's simdgroups run on the emulated tier (its profile's
  subgroups, its lockstep order or its pinned widest mode give it that tier), whose exchanges
  are not walked past the grid. This is the one a SIMD-group or quad-group kernel meets on a
  device whose subgroups are narrower than 32 (lavapipe, and the Iris Xe in the equality test).
- lower/simd/divergent.rs (barriers): a kernel whose uniform barriers need a vote word its
  stage's workgroup memory cannot hold beside its static arena.
- lower/mesh/mod.rs (plan_partial_groups): a tile function, a kernel that reads a stage-input
  region, one with compute derivatives or a cooperative imageblock slice write.
- pipeline/compile.rs (analyze_one): the input beside flat_grid, folded_groups, replay_bindings
  or emulated_simdgroups. Its condition was one with the folded and call-threadgroups
  combinations, which stay GpuEncodedIndirectCommands; it is split in two.
Today the four sites build the same refusal with no symbol, so no text tells the causes apart,
and none is added.

The flat variant's refusal at lower/select.rs:1715 (flat_grid with call_threadgroups, on the
emulated tier or with a workgroup synchronization) stays GpuEncodedIndirectCommands: it refuses
the flat variant, not the partial-threadgroups one, with the flat variant's other refusals
(lower/access/mod.rs plan_replay, pipeline/compile.rs analyze_one); the runtime never sets
flat_grid (no hit in crates/metal2vulkan-runtime/src).

The runtime's test of a refused variant (pipeline.rs, the non-observer's lowering) matches the
new feature, so a variant refused now is still kept as a refusal and its state runs the plain
module. A refusal kept in a device's cache directory before this commit still reads: the
marker (cache.rs REFUSED) holds no feature, and it is found by the variant's key
(function_compile_key), which this commit does not move.

No version moves. No persisted outcome records the moved refusals' class:
- the runtime's cache directory: the marker above, under an unchanged key;
- the golden tables (golden_hashes.tsv, 77 GpuEncodedIndirectCommands cells;
  public_fixture_expectations_engine.tsv, 96): every subject compiles under no inputs, where
  partial_threadgroups is false, and every moved site is reached only under it;
- the authored compile census (corpus/authored-compile.tsv): no GpuEncodedIndirectCommands
  cell;
- the committed observations, cutover lists and conformance recordings: no hit
  (git grep -c over corpus/, cutover/ and crates/metal2vulkan-conformance).
The runtime guard's inputs do not change: every file edited here is outside them or on the
guard's list of compile-time files.

The consumer: git grep -n 'GpuEncodedIndirectCommands' cae6d420df in its checkout gives 0
lines (and 0 for PartialThreadgroups).

docs/REFUSALS.md is regenerated (scripts/refusal-surface/refusal_surface.py), with the new
row's reach mark in reach.tsv (app: a dispatchThreads grid that is not whole threadgroups), and
the signatures table (api_signatures.tsv) has the new variant (signatures.py --bless); the
api_surface table lists Feature as an enum, not its variants, so it does not change. docs/API.md
section 5 and the partial_threadgroups input's doc name the new feature. The translator's
partial-threadgroups tests assert it.
2026-11-22 07:17:41 -08:00
Anees Iqbal 5e3477e60a Translator: a buffer slot takes the storage view on every profile; the uniform view goes
A buffer slot took a uniform view only where containment was the device's
(contain::encoding gave Check::None, under robustBufferAccess or robustBufferAccess2): the
uniform arm of the slot's view choice and Profile F's per-stage storage-buffer fallback. The
runtime enables neither feature, so no runtime module took one. The next commit deletes the
robustness choice; memory, lower and spirv are crate-private, so its dead_code would fail that
commit on its own. The uniform view goes first, with everything that only it reached:

- the uniform forms of a view (UniformWords and UniformVec4) and their reads, and Profile F's
  fallback (fallback_view, fallback_rank). Profile F (runtime-floor without device addresses,
  below the runtime's floor) now refuses a stage past maxPerStageDescriptorStorageBuffers as
  DescriptorCount, where before it read its read-only slots through uniform views, under robust
  descriptors only;
- SlotPlan::lane_read and its planner pass, and Uniformity::among_active_lanes, which only that
  pass ran;
- the storage-view variant: LoweringInputs and VariantKey storage_view_slots, the binder's
  storage_view_variant and large_view_candidates;
- RuntimeFact::UniformViewAliasing and UniformViewRange with UniformViewChoice, and the binder's
  aliasing check with its refusal BindError::UniformViewAliased (docs/REFUSALS.md regenerated:
  binder refusals 9 to 8);
- SpecKey::RangeAtBindOffset (only uniform views declared it), BindState::view_base_alignment and
  uniform_views_at_residual, StageTable.at_bind_views and StageTable::class_alignment;
  BoundBuffer::shape, BoundBuffer::same_shape and StageTable::shape lose their
  view_base_alignment parameter;
- BufferRanges.uniform: BufferRanges::length_class and the binder's offset alignment now read
  maxStorageBufferRange and minStorageBufferOffsetAlignment alone. Nothing in the runtime crate
  reads BufferRanges, BindState, BoundBuffer, StageTable or BindShape (git grep: 0 hits); it
  reaches validation's candidate engine only;
- AccessClass::Uniform, DescriptorView (Storage, UniformWords, UniformVec4) and
  BufferForm::uniform_view; BufferForm::Descriptor loses its DescriptorView field.

The loop hoist stays: the argument table's Uniform block (lower::access::table, the spilled
push fields) still feeds it. Its docs no longer name a buffer slot's uniform view.

Removed or changed public items and the types that own them, each with 0 hits in the
consumer's checkout at bd9d6ae85a and at ad28ebd881 (git grep -w -F over *.rs, *.toml, *.md):
DescriptorView, UniformWords, UniformVec4,
UniformViewChoice, UniformViewRange, UniformViewAliasing, UniformViewAliased, RangeAtBindOffset,
storage_view_slots, view_base_alignment, uniform_views_at_residual, at_bind_views,
class_alignment, uniform_view, same_shape, AccessClass, BufferRanges, buffer_ranges, BufferForm,
StageTable, BoundBuffer, BindState, VariantKey, LoweringInputs, RuntimeFact, SpecKey, BindError.
crates/metal2vulkan/tests/api_signatures.tsv and api_surface.rs are blessed in this commit, and
docs/API.md (the uniform-view form, the bind-offset key, BufferRanges) changes with it.

Stored: VariantKey's storage_view_slots, and the codec tags of BufferForm::Descriptor (no
field), SpecKey (RangeAtBindOffset gone), RuntimeFact (two variants gone) and DescriptorView
(gone). The batch's ARTIFACT_FORMAT_VERSION bump (590 to 591), applied last once for the
batch, covers them; no version moves here.

Tests deleted whole, neither a containment proof: engine_storage_view_variant.rs (the
variant's fixed point) and engine_lane_reads.rs (the uniform view's lane choice). Deleted with
the forms they tested: the uniform-view cases of engine_access.rs and engine_binder.rs, the
slots tests of the large-view candidates and the bind-offset range, the variant's cache round
trip, and the active-lanes tests of lower/simd/uniform. The kept containment proof, a constant
buffer shorter than its window, runs on the storage form
(a_constant_buffer_shorter_than_its_window_is_contained_in_shader). Profile F's new refusal has
its test (a_stage_past_the_storage_buffer_limit_without_device_addresses_is_refused).

Golden: at the batch's top only the stated set's 24 texel-buffer rows moved, the 312 cells
commit 2 alone moved before the rebase; no other row moved on either set. The .air.ll half (567 typed-pointer fixtures,
which need metal-as) is unchecked per commit; the batch's golden bless on the M3 covers it.

Verified:
- On unshipped's tip before this rebase (96d953bb0b), the same change: compile job
  m3-max-66120 green (fmt, signatures, refusals, clippy plain, m2v_gpu and m2v_cpu_icd,
  workspace Rustdoc, api-docs). Before that rebase, this commit alone (hash probe job
  m3-max-65979) read 252 rows equal to its base's arm.
- At the batch's top on 96d953bb0b (all four commits, probe job m3-max-66130): the hash probe's
  252 rows equal unshipped's arm at 4861c9863d (m3-max-65976); the golden probe's set without
  buffer robustness (the runtime's state) equals the base arm 96d953bb0b (m3-max-66128), 1855 of
  1855 rows.
- The states-only play at the batch's top (render and compute states made and refused,
  pipelines_created, made_ahead_variants) is the coordinator's, run on the branch; it is not
  evidence here.
- Here: cargo fmt; signatures check; refusal surface regenerated. The compile job follows on the
  branch tip.
2026-11-22 00:17:41 -08:00
Anees Iqbal 4aee2fa9f1 Translator: the ordered fetch form goes; its computed writes are refused on every device
The framebuffer fetch had a second form chosen by rasterizationOrderColorAttachmentAccess: over
a rasterization-order input attachment, a fragment function computed writes no Vulkan blend,
write mask or logic operation gives. No runtime enables that feature, so the form ran on no
guest's device. It goes (rule 2: a second form chosen by a query outside the named list; rule 4).

What changes:
- A fetch reads its input attachment ordered between draws alone on every device, noted
  UnorderedFetchWithinDraw. Under the identity domains it reads the pushed texture
  (PushField::FetchedColor).
- These states are refused on every device: a padded extended-range attachment's blend; a write
  of some of the codes one word of an extended-range attachment holds; and a blend no Vulkan
  state gives on a rotated (ARGB8Unorm) attachment. Each refusal is FramebufferFetch, not
  implemented (lower::fragment::fetch::computed_write_refused).
- A word attachment under a partial mask takes its format's own attachment, and is refused where
  the device lacks that format.
- A private logic operation on a device without logicOp is refused naming
  PrivateRenderState(LogicOperation) and logicOp.
- Deleted: lower/fragment/input_blend.rs, word_input.rs, the shader logic operation in logic.rs,
  lower/arith/extended_range/blend.rs, pipeline/link/fetch.rs, and the arithmetic only they used
  (the fma emulation cluster, div_exact, encode_keeping).
- Deleted public items:
  - LoweringInputs.framebuffer_fetch and .logic_operation;
  - FramebufferFetchInputs, FetchedAttachment, BlendEquation;
  - GraphicsState.rasterization_order_attachment_access and
    FragmentCaps.rasterization_order_color_access;
  - metal::format::extended_range_blend, Feature::ExtendedRangeBlend and the ExtendedRangeBlend
    enum;
  - RuntimeInput::FramebufferFetch and ::LogicOperation;
  - RuntimeFact::ExtendedRangeInputBlend, ::RotatedInputBlend and ::WordInputMerge;
  - PrecisionNote::ExtendedRangeBlendSource and ::ExtendedRangeFloatBlendSource.
- The enable-set facts class VK_EXT_rasterization_order_attachment_access as described and never
  enabled.

Docs, in this commit:
- rt README: Known gaps of render encoders gets one line per refused state, each built on the
  runtime's own fetch form if a guest meets it. The Not-enabled row of
  rasterizationOrderColorAttachmentAccess goes, and so does logicOp's mention of the shader form.
- docs/API.md loses the two blend-source notes from the precision-note catalogue, the
  rasterization-order form and the word merge.
- REFUSALS.md is regenerated (reach row of ExtendedRangeBlend removed), along with
  api_signatures.tsv and the api_surface table.
- The conformance ledger: the 39 rows refused naming rasterization-order access (on llvmpipe and
  the UHD 630; on other venues the case read as lacks-feature) become 22 every-venue rows,
  refused, needs NotImplemented. The matrix replay on development confirms the scope.

Lines: product sources (crates/metal2vulkan, -air, -runtime src, tests excluded) +238 -4647;
product tests +277 -2279; validation and conformance +61 -182; docs +48 -67.

Consumer search (reims-vgpu at 71573a84c8, git grep -w over *.rs, *.toml and *.md):
- 0 hits: ExtendedRangeBlend, rasterization_order_color_access, BlendEquation,
  FramebufferFetchInputs, rasterization_order_attachment_access, framebuffer_fetch,
  extended_range_blend, ExtendedRangeBlendSource, ExtendedRangeFloatBlendSource,
  ExtendedRangeInputBlend, RotatedInputBlend, WordInputMerge, DualSource.
- Hits that are not these items: FetchedAttachment 2 (rt's DrawKind); logic_operation 8 (its
  own structs and rt's private state).
- RuntimeInput: only LinkedFunction is used.
- No glob import or re-export of a metal2vulkan module (only `use metal2vulkan_runtime as rt`).

Verified: cargo fmt; refusal surface and signatures regenerated locally. The compile job and the
host suites follow on the branch.
2026-11-22 00:17:40 -08:00
Anees Iqbal 3f8f9d352d Translator: the grammar items drop FPEncoding, which no 8-bit float type names
The native 8-bit float deletion left spv.rs's FPEncoding (Float8E4M3EXT,
Float8E5M2EXT) unused, which clippy refuses (dead code). items.txt drops
the enum and spv.rs is regenerated from SPIRV-Headers vulkan-sdk-1.4.341.0;
the test parser's table.rs regenerates unchanged.

Found by clippy in compile job m3-max-65654.
2026-11-22 00:17:21 -08:00
Anees Iqbal 87b78f0ebd Translator: the grammar items drop the two execution modes nothing emits
The sample interlock and the post-depth coverage deletions left
ExecutionMode::SampleInterlockOrderedEXT and ::PostDepthCoverage
unconstructed, which clippy refuses (dead code), and the interlock
serializer test looping over one mode. items.txt drops the two values and
spv.rs is regenerated from SPIRV-Headers vulkan-sdk-1.4.341.0 (an unchanged
regeneration reproduced the committed spv.rs and table.rs byte for byte
first); the test builds its one mode directly.

Found by clippy in compile job m3-max-65620.
2026-11-22 00:17:21 -08:00
Anees Iqbal 3d8e01d2c2 Translator: the coverage after the depth tests is refused on every device; its lowering goes
[[sample_mask, post_depth_coverage]] read SampleMask under the PostDepthCoverage execution mode
where a profile enabled VK_EXT_post_depth_coverage, and was refused as needing the extension
elsewhere. The runtime never enables the extension, so it refused every such function all along,
and nothing ever executed the lowering: no test runs it, and the golden tables only compile it.
It goes to a typed refusal, Unsupported::not_implemented(Feature::PostDepthCoverage), at the
parameter's plan; the IR's ExecMode::PostDepthCoverage goes with its builder, serializer and
requirement arms, and the enable-set facts class the extension as described and never enabled.
The AIR decode of the parameter (Builtin::PostDepthCoverage) and the SPIR-V and Vulkan
vocabulary stay, the decode being what the refusal reads.

The refusal moves from a device's to ours: Feature::PostDepthCoverage's doc, its reach mark and
docs/REFUSALS.md (regenerated) say every device. The runtime README's known gaps of render
pipeline states gain its line: refused on every device, built on the extension with its tests if
a guest meets it.

Class 3 of the planner's rule (a sole lowering under 150 lines that nothing executes). No public
item goes (signatures.py --check clean). The consumer's checkout (reims-vgpu at bd9d6ae85a)
names it once, Metal's supportsPostDepthCoverage in a guest test's protocol member list, not an
item of ours. Product lines: +15 -34. The golden tables' pdc_after rows move from compiled to
refused on the profiles that enabled the extension (re-stamped at the pin); no SEMANTICS bump
(the refusal changes no module that compiles).
2026-11-22 00:17:21 -08:00
Anees Iqbal c5209e66ba rt floor: alphaToOne is enabled where the device reports it, no longer required
A user's Radeon under AMD's own Windows driver was refused at device start, partly because it
reports no `alphaToOne`. The feature leaves the floor's required features and joins the tables
device creation enables where the device reports it (`floor::ALPHA_TO_ONE`, beside the min-LOD and
fill-mode ones). Nothing else changes. Where the device reports the feature, creation enables it,
the translator's description states it, and a render pipeline that sets `alphaToOneEnabled` takes
the device's own `alphaToOneEnable`, as before. Where it does not, the translator's existing typed
refusal applies: `Unsupported{AlphaToOne, Feature(AlphaToOne)}` from `link::graphics_state`, already
in docs/REFUSALS.md, which `refusal_surface.py` regenerates unchanged. This change adds no other
form, in the shader or elsewhere.

- floor.rs: `ALPHA_TO_ONE` in `ENABLED` and in `decide()`'s reported-copy chain; `REQUIRED` loses it.
- rt README: the Features row moves to its own "Alpha to one" table, and a known-gap row under
  render pipeline states. 0 of the 58,976 render states of the nine standard streams set
  `alphaToOneEnabled`, and 0 set alpha to coverage (states-only plays plus dumps on lavapipe, job
  m3-max-66153).
- runtime-floor.json and its generator lose `alphaToOne` from the m2v_runtime_floor block, which
  `the_floor_profile_states_exactly_the_floor` holds equal to `REQUIRED`.
- Tests: `the_alpha_to_one_feature_is_enabled_where_reported` (decide and shader_enables, with
  and without the feature); `at_the_floor` no longer reports it; the missing-feature list drops it;
  the README table check covers the new table. The device test
  `every_device_draws_lines_under_alpha_to_coverage_or_one` expects the typed refusal on a device
  without the feature. The translator test `alpha_to_one_is_refused_only_without_the_feature` reads
  `runtime-floor` as it is.

Honesty line: no AMD card runs Windows in the lab. On that driver this is expected, not verified.
This commit says what the code now does; it does not say that user's device now starts.
Verified: see the compile job named in the landing message.
2026-11-21 23:35:24 -08:00
Anees Iqbal 072eaaba18 profiles: delete amd-rdna3-radv, whose every cell is the Radeon 780M's
What: the RX 7900 XTX capture amd-rdna3-radv derives the same translation fingerprint as
amd-780m-radv: the Radeon 780M and the RX 7900 XTX under one RADV build. So every golden and
census cell of the profile equals the 780M's (dff8c48964). Nothing outside the translator
derives from it: no runtime, conformance, harness or devtools use. Under the planner's rule,
such a profile is deleted.
- The profile file, its regen_device_profiles.py source entry, and its README row and venue
  sentence go. profiles/README.md now names amd-780m-hawkpoint-radv alone as the capture no
  venue runs on.
- Its two opened-chains contexts go from opened_chains.txt (device and restricted).
- The shared-fingerprint pair dff8c48964 added to fingerprints_distinguish_committed_profiles
  goes, with its comment.
- Rows of tables that already hold amd-780m-radv lose the rdna3 row:
  description.rs COMMITTED, profile.rs the_profile_holds_the_largest_whole_point_size (8191 on
  both), subgroup.rs GOLDEN and its own-limits table (equal rows), fetch/tests.rs,
  engine_device_replay.rs, engine_lane_reads.rs and engine_widest_pin.rs (equal rows).
- Every other test stem "amd-rdna3-radv" is now "amd-780m-radv": 43 translator files (42 test files and metal/format/word.rs's test module),
  plus validation's c3, worker/device and candidate/platform/enables tests (one line there,
  depth_range_unrestricted_is_enabled_where_the_device_lists_it, which the 780M lists too).
  The two descriptions are equal in everything a translation reads (the fingerprint test's own
  equality check), so no asserted value changes. Comments that read "the committed RDNA3
  description" stay true: the 780M is RDNA3.
- corpus/observations/vulkan/shard_056.jsonl drops the row recorded under the old gpuinfo
  profile, which is gone: environment amd-780m-radv@engine@amd-rdna3-radv, case
  atomics-past-a-device-buffer (case_id fdbf7c9b9e09e38aff99a04768f8375ac8e7a604dfcacf21e236b2d2482b3896,
  air e1382758476864b76c1eab9d944b033c016808309fe44581fe38f539f23d67e5), executor
  vulkan-engine-v131. The shard keeps the same case's other row.
- cutover/c1-reviewed.json's note names the profiles that remain in the bucket:
  intel-irisxe-anv and nvidia-rtx50-linux.
- scripts/drm-shim.Dockerfile no longer lists the profile among the 26.2.3 captures. The example
  in scripts/linux-gate uses --chip rembrandt with amd-rdna2-apu-radv (the Radeon 680M, RADV
  REMBRANDT).

Left to the next pin's bless: three generated tables still name the profile, and only a bless
drops their columns. They are tests/golden_hashes.tsv (its profile row and column),
tests/public_fixture_expectations_engine.tsv (its column) and corpus/authored-compile.tsv (its
census column).

Search: `git grep -n amd-rdna3-radv` gave 118 hits at dff8c48964. After this commit it gives
4, the three tables above. `git grep -n amd-rdna3-radv` in the consumer's checkout gives 0.

Verified: m3-max-65582 at the series' tip 0f732c1141: fmt, signatures, clippy plain, --cfg m2v_gpu
and --cfg m2v_cpu_icd, workspace Rustdoc -D warnings and the device-profile pyunit green;
conformance 1025/1025; validation 1330/1331 and product 4015/4026 (24 skipped), every red a
bless item: the golden table (1861 rdna3 cells gone), ten fixture-inventory tests on
tests/public_fixture_expectations_engine.tsv (the column's drop; every one of its 3499 rows
holds the same cell under amd-rdna3-radv as under amd-780m-radv), and the opened-chains pin
left by the enables move. bless_engine_inventory needs metal-as, so that bless is the pin's,
on a Mac.
2026-11-21 19:40:54 -08:00
Anees Iqbal 591f813569 REFUSALS.md: a rate map outside the compile's measured bounds is ours
docs/REFUSALS.md section 4 showed '-' for its five rows (UnpinnedCompile: ScreenExtent,
LayerCount, DenseSamples, SampleOutOfRange, SampleCount). The code says the basis: each is
built in one place, `RasterizationRateMap::new` (bind/rate_map.rs), through
`RateMapError::Unpinned`, which refuses a descriptor outside the bounds where Apple M3's compile
was measured, and the enum's own doc states "The bounds are this crate's, not Metal's". So the
script derives `ours` for the section, as it does for the translation caps and the deadline.
No row of another section moved. Every section's '-' total is now 0.

Verified (locally, source-reading scripts): refusal_surface.py --check and --selftest pass.
2026-11-21 19:04:11 -08:00
Anees Iqbal dd150e4f46 Delete the 14 Feature variants and 3 Needs variants nothing builds
Nothing in the product crates built these 14 Feature variants: SamplePositions, TextureSize,
TextureSampleCount, TextureView, MipmapGeneration, HostMemory, GpuTimes,
ViewFormatReinterpretation, SeparateMultisampledDepthStencil, SparseTextures,
TimelineSemaphores, HeapTextureTiling, UndeclaredTextureUsage and RenderTargetSize. They were
refusals of the runtime this tree cut over from, and so they were docs/REFUSALS.md's last 14 '-'
rows. Nothing built the Needs variants DeviceCapability, MetalGpuFamily and MetalRefuses either,
nor called their constructors Unsupported::device_capability and Unsupported::metal_gpu_family
outside tests. No doc or test showed one to be the vocabulary of a Metal refusal anything
answers: the three Feature docs that said the runtime answers MetalGpuFamily or MetalRefuses
were corrected in the previous commit.

Searches:
- The tree, outside the definitions, the reach rows and the generated tables:
  - Feature::SeparateMultisampledDepthStencil in one translator test
    (bind/depth_stencil_copy/tests.rs), now Feature::StencilExport, since
    depth_stencil_copy_modules refuses with whatever feature its caller names;
  - Feature::SparseTextures, SparseNeed and Unsupported::device_capability in one conformance
    test of verdict::device_gap_of's DeviceCapability arm. That test pinned a chain from the
    runtime's `sparse_refusal`, which no longer exists, so the test and the arm go together;
  - Unsupported::metal_gpu_family and the three Needs variants in error/tests.rs
    (one_of_each and the retry table);
  - the golden and public-fixture tables' refusal cell (golden_hashes.rs, public_fixtures_engine.rs)
    named the other Needs through a wildcard arm, now unreachable: the three arms are the cell;
  - stale prose naming them in conformance cases/sparse_heaps.rs, probes/bgra4_write_and_mipmap.m,
    the engine fixtures README and docs/API.md (its TextureSampleCount sentence now names the
    runtime's Limit::TextureSamples, which refuses that texture);
  - the payload enums SparseNeed and LinearNeed are used by nothing else, and go too.
  The other hits for these names are other enums' variants (the runtime's Limit::TextureSize,
  Refusal::TextureSampleCount, Gap::TextureView, ImportHandle::HostMemory, ...).
- The consumer's checkout at bd9d6ae85a: 0 hits for Feature:: with any of the 14, SparseNeed,
  LinearNeed, Needs::DeviceCapability, Needs::MetalGpuFamily, Needs::MetalRefuses,
  metal_gpu_family or device_capability( (its own `Piece::SamplePositions` and
  `Piece::SparseTextures` and its own HostMemory types are unrelated).

Needs is now AnyOf, NotImplemented and NotRepresentable; Needs::basis answers Device, Ours and
Device for them. The script drops the two constructors and their condition texts.
docs/REFUSALS.md: section 1 is 119 variants, every one with a site and a basis (device 51,
ours 68, '-' 0). api_signatures.tsv: 35 records removed, all in metal2vulkan::error; the public
surface table loses SparseNeed and LinearNeed.

Verified (locally, source-reading scripts): refusal_surface.py --check and --selftest pass;
signatures.py --check passes after --bless.
2026-11-21 19:04:10 -08:00
Anees Iqbal aecdc8ee84 profiles: amd-rdna3-radv is a capture of an RX 7900 XTX, with per-format sample counts
The RDNA3 census profile was a gpuinfo report (51898, an RX 7800 XT on Mesa 26.2.3). Such a
report holds no VkImageFormatProperties, so the profile stated no color attachment format's own
sample counts, only the device-wide framebufferIntegerColorSampleCounts, which RADV states as
1x. The authored compile census therefore refused integer color targets above 1x on that column
(RasterSampleCount needs FramebufferIntegerColorSampleCount(N) |
ColorAttachmentSampleCount(format, N)), 9 cells. amd-780m-radv, the same driver measured,
compiles all 9, and the runtime on a real RDNA3 card queries each format's counts itself.

The profile is now a local capture of a card we run, made as the other local captures are:
`vulkaninfo --json` and its `corpus-vulkan --capture-formats` supplement on an AMD Radeon RX
7900 XTX (RADV NAVI31, Mesa 26.2.6, job m3-max-65462; device queries only), converted by
scripts/regen-device-profiles (--offline, the pinned vk.xml). Its
m2v_color_attachment_sample_counts states 70 formats, R32_UINT and R32G32B32A32_UINT among
them at 1, 2, 4 and 8 samples. The SOURCES entry and the profiles README row say so; no venue
names the profile. The c3 test that refuses a gpuinfo report under a venue now names
amd-rdna2-apu-radv, a gpuinfo profile still.

Bless items, at the next pin and not here: the golden table's amd-rdna3-radv cells (the
profile's fingerprint moves), the authored compile census's amd-rdna3-radv column (the 9
sample-count cells are expected to compile, and other cells move where Navi31 under 26.2.6
states other features or limits than the old report), and the opened-chains pin's two
amd-rdna3-radv contexts.
2026-11-21 18:50:50 -08:00
Anees Iqbal 7f156bc920 Error::basis answers a translation error from what its refusal needs
The runtime's Error::basis answered None for every Error::Translation, so each translator
refusal a guest met sat in a consumer's census unsorted between Metal's own refusal and our
gap, and 36 of the translator's 133 Feature variants showed no basis in docs/REFUSALS.md.

What:
- RefusalBasis moves to metal2vulkan::error; the runtime re-exports it at the same path
  (metal2vulkan_runtime::RefusalBasis: its signature records do not move).
- Needs::basis: AnyOf, DeviceCapability and NotRepresentable are Device, NotImplemented is
  Ours, MetalGpuFamily MetalDocumented, MetalRefuses MetalMeasured.
- metal2vulkan::error::Error::basis: a refusal's from its Needs; LimitExceeded, Budget and
  Internal Ours; InvalidInput, InvalidDescriptor, NeedsInput and Cancelled None. Both matches
  are exhaustive in the translator, so a new Needs or Error variant must answer (the runtime
  could not match the translator's #[non_exhaustive] enums without a wildcard arm).
- The runtime's arm is `Error::Translation { error, .. } => error.basis()`.
- refusal_surface.py follows the helper a site hands its feature to (a front-end reference is
  NotImplemented; the feature argument of a construction; a helper's argument; the enclosing
  function's computed construction; a function that returns the feature, through its calls in
  its file). Its kind-to-basis table is read from Needs::basis's arms. --check fails on a
  variant with a site whose basis is not settled.
- docs/REFUSALS.md: the 22 variants with a site and no basis are settled, and their Where
  cells filled; no other row's Where or Basis moved. Section 1's totals: device 51, ours 68,
  '-' 14 (the 14 variants nothing builds).
- The docs of SimdgroupMatrix16x16x16, IndirectRenderState and GlobalBuiltinInFragment (and
  three comments that repeated them) said the runtime answers them as Metal's own refusal; no
  code does, and the translation refuses them NotImplemented on every device, so they say that.

Size, past the 200-line mark (hand-written lines, generated tables excluded): 272 added, 50
removed. The script +147/-12 (helper following and its call scan about 60, the Needs table and
derived basis 20, scan bookkeeping 25, the unsettled check 12, selftest cases 20, doc text 10);
the translator +63/-7 (21 of them RefusalBasis moved from the runtime, -23/+8 there); the
runtime test +44; docs/API.md +6.

Verified (locally, source-reading scripts): refusal_surface.py --check and --selftest pass;
with unsettled() emptied the selftest fails; signatures.py --check passes after --bless added
7 records, all on metal2vulkan::error.

Verified: compile m3-max-65442 (fmt, refusal_surface.py --check and --selftest, signatures.py --check,
clippy plain / --cfg m2v_gpu / --cfg m2v_cpu_icd, workspace Rustdoc -D warnings, scripts/api-docs);
host suites m3-max-65443 (metal2vulkan, -air, -runtime: 3969/3969, the golden hashes and the old
render key among them; doctests); before-run m3-max-65444 (development plus the new test alone):
a_translation_error_answers_the_basis_of_what_it_needs fails as expected (None against Some(Device)).
2026-11-21 18:25:57 -08:00
Anees Iqbal 2b265713c8 matrix: two comments name the RTX 3090 by its link, not by its host
scripts/matrix/results.py (the per-process level note above HARNESS_ALONE) and its test in
scripts/matrix/test_results.py named the 3090 of rounds b0c08e51b5, 7cda47f536 and 6b535f55c9 by
the machine it sits in. They now name the card and its link: an RTX 3090 on a 20 Gb/s
Thunderbolt 3 link (the link as read from the kernel's own lines on 11-20). Comments only.

Verified: python3 -m unittest of scripts/matrix/test_results.py in the compile job named in the
report.
2026-11-21 17:28:31 -08:00
Anees Iqbal e734db4be2 Runtime: the translator's description states every feature and extension device creation enables that it names; maintenance4 joins the floor
What: shader_enables, the enable set the translator's description of the device is restricted to
(DeviceDescription::with_enabled), now reads every table of features device creation enables
(floor::ENABLED: the floor, the portability subset, the optional features, the attachment
reads, step rates, min-LOD clamps, fill modes, quad control, the pixel interlock, barycentrics,
the border swizzle, linear attachments, fault reports, and the indirect commands' features, now a
table of their own, INDIRECT_COMMAND_FEATURES, which indirect_commands sets). Each entry the
translator names reaches it where creation enabled it. Entries that were enabled but unnamed now
carry the translator's name: depthBiasClamp, drawIndirectFirstInstance, bresenhamLines and
occlusionQueryPrecise (floor), attachmentFeedbackLoopLayout (the attachment reads),
borderColorSwizzle and borderColorSwizzleFromImage, and maintenance5 (indirect commands).
shader_extension names the extensions those need, and the others creation enables that the
translator names: VK_EXT_line_rasterization, VK_EXT_attachment_feedback_loop_layout,
VK_EXT_border_color_swizzle, VK_EXT_custom_border_color, VK_EXT_external_memory_host and
VK_KHR_maintenance5.

maintenance4 joins the floor (REQUIRED, the README's floor table, runtime-floor.json's
m2v_runtime_floor block and regen_device_profiles.py's RUNTIME_FLOOR): Vulkan 1.3 requires it
of every device, so no device at the floor lacks it. The translator's profile reads it for
spirv-val's --allow-localsizeid alone.

Why: the planner's feature-enable walk (lane texoff, 11-21) found these features enabled at
vkCreateDevice and absent from the translator's profile, the class maintenance8 was in before
38dcc857dd. None changes what the runtime does on its own paths: the runtime sets depth bias,
border colors and indirect draws itself, and the translator's readers of these features
(metal::state::depth_bias, the bind plan's indirect_first_instance_missing, metal::sampler's
opaque-black border) are not on them. The profile now states what the device has. Its fingerprint
moves on every device, and with it every cache key.

64-bit image atomics stay off, and the features the translator reads that the runtime does not
enable are the feature-enable test's (next commit).
2026-11-21 13:39:50 -08:00
Anees Iqbal c5ee8d7919 rt: Error::basis answers each refusal's basis, generated from its Basis: line
What: a public RefusalBasis (MetalDocumented, MetalMeasured, Ours, Device) and Error::basis, which
answers Refused, Limit and Unsupported from the variant's own basis, BelowFloor and
NoDirectDriverLoading as Device, and None for Translation, the platform's and Vulkan's failures and
the consumer's own block, stage or quiesce. Refusal::basis, Limit::basis and Gap::basis live in
crates/metal2vulkan-runtime/src/error/basis.rs, which scripts/refusal-surface/refusal_surface.py
writes from the `Basis:` line each variant's doc comment ends with: 131 arms (Refusal 82, Limit 17,
Gap 32), one per variant in declaration order, no `_` arm. The doc comment stays the one source.

Why: a consumer's census of the refusals its guests meet could only match names, so 67 refusals
whose basis is ours counted as "Metal refuses it". A typed basis tells them apart.

How: the script enumerates the enums structurally (rt_refusal_enums), reads each variant's pattern
(`Name`, `Name(..)`, `Name { .. }`) with enum_arms, and maps the basis value to the RefusalBasis
variant it names. It fails where the enum has no such variant (metal-takes and unknown have none:
the value comes with the first variant that needs it) and where a name is too long for rustfmt to
keep its arm's pattern on one line. It writes the file as `cargo fmt` leaves it (one line per arm,
else rustfmt's block form past 100 columns), so no rustfmt run is needed. `--check` fails where
basis.rs is stale, as for docs/REFUSALS.md, and one run regenerates both. `--selftest` gains three
cases: the arms and the block form, two Basis lines give two files, a missing value fails.

Verified: refusal_surface.py --check and --selftest, signatures.py --check and cargo fmt --check
pass on this tree. The generated forms were checked against rustfmt at five name widths and three
variant shapes. The compile job and the lavapipe rt suite are named in the lane report. Without
the change, the new tests do not build: RefusalBasis is unresolved and `basis` is not found.
2026-11-21 09:41:04 -08:00
Anees Iqbal 817463704e rt: texture buffers are buffer views of their buffer's bytes in set 1's two texel-buffer arrays
What: Buffer::new_texture of a texture buffer's descriptor makes one VkBufferView of the bytes
shaders reach (a Managed buffer's device copy where it has one), from the offset, its width's
texels long: no image, no copy, no new push field. Set 1 gains two arrays of 65,536 elements,
binding 5 (uniform texel buffers, the read ones) and binding 6 (storage texel buffers, the written
ones), at the same index class as textures; a texture buffer's index is the same element of both,
and placing a texture or a texture buffer over the other's index nulls the other's elements. The
translator's identity domains classify a texture_buffer slot or argument-buffer member as a texel
buffer of that array (no TexelBufferRange fact, no swizzle under identity), so a pipeline that
declares one is no longer Unsupported{IdentityDomains}. SEMANTICS_VERSION 2258.

Metal's own refusals are typed: an offset off Device::minimum_texture_buffer_alignment
(minimumTextureBufferAlignmentForPixelFormat:, the device's texel-buffer offset alignment, the
larger of the uniform and storage ones, a single texel's size where the device says it suffices)
is Refusal::TextureBufferAlignment; a bytesPerRow below the row or texels past the buffer is
Refusal::BufferTextureLayout; a descriptor of more than one row, level, slice or sample, and a
swizzle with writes, as Metal refuses them. Device::new_texture (and every other make) of a texture
buffer's descriptor is Refusal::TextureBufferNotOverBuffer: the consumer places the bytes as it
places every buffer. Gap::TextureBuffer goes; a swizzled texture buffer (Gap::TextureBufferSwizzle),
a view of one, and a blit copy of one are recorded gaps. A format needs both texel-buffer usages in
its buffer features (Gap::TextureFormat otherwise): the view's buffer has both usages, and without
maintenance5 its usage is the buffer's.

The floor requires the six texel-buffer descriptor-indexing features (update-after-bind, dynamic
and non-uniform indexing, uniform and storage) and raises the limits the two arrays count against:
uniform texel buffers against the sampled-image limits, storage texel buffers against the
storage-image limits, both against maxPerStageUpdateAfterBindResources and the pools: sampled and
storage per stage and per set 131,072 (196,608 sampled with attachment reads' second elements),
resources 262,152 (327,688), pools 274,144 (339,680). Every recorded device fits: the 8 device dumps'
least are llvmpipe's 1,015,808 sampled/storage/resources and the UHD 630's 1,048,576 pools; all 12
devices there report the six features.

Why: six harvested guest functions declare a texture buffer, and a pipeline that declared one was
refused at creation.

Checked by: tests::texture_buffers (lavapipe: R32Uint read at a buffer offset and written, out of
bounds read zero and dropped, atomics through read_write, every refusal), engine_identity's
a_texture_buffer_is_the_texel_buffer_element_its_resource_id_names (L3 on lavapipe and moltenvk-m3),
the floor tests, the signatures table and REFUSALS.md regenerated; the lane's compile job reports
the runs.
2026-11-21 07:27:27 -08:00
Anees Iqbal b5ac9fd07b rt: visibility results, one precise occlusion query per mode, copied into the buffer at the pass's end
What: `setVisibilityResultMode:offset:` builds `Boolean` and `Counting`. Each such mode set is one
segment counted by one precise occlusion query (`VK_QUERY_CONTROL_PRECISE_BIT`), begun in the
pass's rendering before the segment's first draw and ended there at the next mode set or the
encoder's end; a segment with no draw begins and ends its query as it ends, so its word is 0.
After `vkCmdEndRendering` the pass copies the counts (`vkCmdCopyQueryPoolResults`, 64-bit, WAIT)
straight into the visibility result buffer's `VkBuffer` at place+offset, one copy for each run of
consecutive offsets in one pool, before the pass's second barrier (recorded or owed), which orders
them before every later command; a Shared buffer's segment end barrier reaches the host, and a
Managed buffer's write and a texture over the buffer in an image of its own are kept as a blit's
write is. `Boolean` writes the count too, nonzero exactly where a sample passed (Metal documents a
nonzero word; the M3 Max writes 1): an accepted difference in docs/API.md section 10, and the
conformance cases compare a `Boolean` word as nonzero alone.

A command buffer takes its queries from occlusion pools of 256 the device lends it
(`crate::visibility`), each query reset on the host (`hostQueryReset`) as the command buffer
retires or drops uncommitted; the device keeps at most 16 pools free and destroys the rest
(`Gauges::occlusion_pools`). `occlusionQueryPrecise` joins the floor's required features (every
venue's profile reports it; Roadmap 2022 requires it), with the README floor table, the
runtime-floor profile's `m2v_runtime_floor` block and the regeneration script's list.

Refusals: Metal's own, each where the mode is set, the encoder's mode unchanged:
`Refusal::NoVisibilityResultBuffer`, `Refusal::VisibilityResultOffset` (not a multiple of 8, or
past the buffer), `Refusal::VisibilityResultOffsetTaken` (Apple documents each offset as set once
per pass; Metal's validation stops it), and `Refusal::ArgumentPlace` at alignment 8 for an offset
at an allocation byte off a multiple of 8 (VUID-vkCmdCopyQueryPoolResults-flags-00823). Gaps, each
counted and a README known gap: `DrawKind::AccumulatedVisibilityResults` (a mode in an
`Accumulate` pass; `Metrics::accumulated_visibility_refused`) and
`DrawKind::VisibilityResultInterrupt` (a command that would end the rendering while a query counts:
a memory barrier after a writing draw, a draw that moves an attachment to the feedback layout, pays
an owed barrier before an attachment read or copies into a shadow, and, bounded, a draw that looks
at textures over a buffer in an image of their own or reaches a Managed buffer with textures over
its device copy; `Metrics::visibility_interrupts_refused`). Every refusal is checked before the
encoder changes state; a segment's first draw may still end the rendering, before its query
begins. `DrawKind::VisibilityResults` is gone. `RenderPassDescriptor::visibility_result_type`
(`VisibilityResultType`, Metal's `visibilityResultType`) is a field now.

Translator: `PrecisionNote::DeviceOcclusionCount`, the static note of a `Boolean` or `Counting`
result (`RenderCommandEncoder::VISIBILITY_NOTE`), quoting Vulkan's "Occlusion Queries" (precise
counts differ between implementations: fragments killed before rasterization, counts multiplied
per colour output) and "Fragment Operations" (`earlyFragmentMultisampleCoverageAfterSampleCounting`);
its codec tag, ARTIFACT_FORMAT_VERSION 588, validation's allowance (unbounded, no tolerance), the
conformance degradation `device-occlusion-count` among the native notes, and docs/API.md's
catalogue. The dead `Feature::CountingVisibility` (no construction site) is removed with its reach
row. The old runtime's `Device::new` is untouched; the runtime-floor test profile now states
`occlusionQueryPrecise`, which re-keys that profile's fingerprint.

Why: the visibility-cut ruling. A guest that sets a mode got a refusal; it now gets its results,
or a typed, counted refusal where the cut does not build the shape (continuations and a combine
are not built).

Verified: cargo fmt; scripts/api-signatures --bless/--check, refusal_surface (0 without reach or
basis), metal-coverage and conformance-coverage regenerated, check_device_profiles (0 findings).
The compile job (fmt, signatures, clippy plain / --cfg m2v_gpu / --cfg m2v_cpu_icd, workspace
Rustdoc -D warnings) and the lavapipe rt suite, with tests/visibility.rs (Boolean and Counting
against the CPU's counts, pool reuse and the 16-pool bound past 17, Metal's refusals, Accumulate,
the barrier and attachment-read interrupts), are named in the lane's report.
2026-11-21 06:16:57 -08:00
Anees Iqbal fe6ed10162 rt: the floor profile requires pipelineCreationCacheControl, and the module digest reads its page as 4-byte chunks
Check m3-max-63418 on 2686094aaa: the runtime-floor profile's m2v_runtime_floor block, which
the_floor_profile_states_exactly_the_floor holds equal to floor.rs, lacked the new
pipelineCreationCacheControl row (added to RUNTIME_FLOOR in regen_device_profiles.py and to the
block it writes; the device's own Vulkan 1.3 features already stated it; check_device_profiles 0
findings, the script's 41 unit tests pass), and clippy's chunks_exact_to_as_chunks asked for
as_chunks_mut in the digest's page fill. The lavapipe rt suite otherwise read 573 of 574.
2026-11-21 06:09:05 -08:00
Anees Iqbal c3f9f55e63 rt: a kernel past the stage bound is made from its helper's compile alone, never compiled in the process
A driver's compiler takes memory that grows faster than the stage, in the process that creates the
pipeline. The translator refused every stage past COMPILED_STAGE_WEIGHT (99,109, the heaviest
measured to compile within host-sized memory, ANV on the Iris Xe of RPL-P), where Metal makes it.
Now the translator states the weight and the runtime compiles such a kernel only in a helper
process the consumer starts, caps and times.

Translator: the stage bound refuses nothing. stage_bound::emit still plans a kernel again keeping
its widest-mode pin where only that emulation passed the bound, and returns the module with its
entry weight, now ModuleStats::entry_weight (codec and serde carry it). COMPILED_STAGE_WEIGHT is
public in pipeline. Feature::StageSize and Needs::StageBound are gone. SEMANTICS_VERSION 2257,
ARTIFACT_FORMAT_VERSION 588.

Runtime (new stage.rs):
- Floor: pipelineCreationCacheControl, required and enabled (Vulkan 1.3 requires it), for
  VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT.
- A kernel's VkPipeline of a module past the bound is made from a VkPipelineCache of its own entry
  in the cache directory's stages/ alone, with the fail-on-compile-required flag, the cache
  destroyed when the create returns; the device's shared cache and blob never hold it
  (Metrics::pipelines_from_stage_fills).
- With no entry the make is refused with Error::StageUnfilled(StageRequest), at the state's
  creation, at prepare_dispatch (which now returns Result and reports only this refusal) and at
  the dispatch. A StageRequest is Clone, Send, Sync, Eq and Hash by its stage key, the entry's
  name, so a consumer joins the makes and dispatches of one pipeline into one fill.
- Device::fill_stage writes the request to the helper's pipe, reads its reply and keeps the
  cache data as the entry (Metrics::stage_fills); serve_stage is the helper's main: it opens the
  device of the request's deviceUUID and driverUUID with the parent's options, checks the
  enables, compiles through an empty cache and writes its data. A wire frame is the magic
  m2vstage, the wire version, the length and a checksum.
- Device::record_stage_breach keeps what the consumer ended its helper for (memory, time) as the
  entry; fill_stage keeps a failed compile; a create answered compile-required keeps that. Each
  refuses the pipeline (Gap::StageSize, StageGap::Breach) with no helper asked again, until the
  driver's header changes the key.
- stages/ holds at most 256 MiB and 32 entries, breaches among them, least recently used out
  first (a hit touches the file). An entry that does not check, of another key or another
  driver's header is a miss and is removed. Nothing of an entry stays in memory past the call
  that reads or writes it.
- A device with no cache directory, or whose driver writes no pipeline cache header (lavapipe),
  and a render stage past the bound are refused typed (Gap::StageSize with its StageGap).

The validation runtime executor reports a refused prepare_dispatch; the replay prepass ignores it
as the dispatch reports it again.

Docs: the runtime README's "Kernels past the stage bound" and its known gaps, the stages/
directory, prepare_dispatch's one error, the floor row; docs/API.md's entry_weight;
docs/REFUSALS.md regenerated; the api signature and surface tables.

Tests: tests/stage.rs: the directory past capacity on both bounds, oldest use out first, a hit
outliving older entries, a breach under the same bounds; cut, foreign-key, other-header and
unknown-breach entries a miss and removed; the wire's version and cut frames; the request's
joinable bounds; and on a device (m2v_gpu, m2v_cpu_icd), with the bound lowered for the test, the
refusal with no directory, lavapipe's NoPipelineCache, and elsewhere refused unfilled, filled by
serve_stage over two pipes, made from the entry alone with the shared cache's data unchanged,
then refused by a recorded breach.
2026-11-21 05:55:29 -08:00
Anees Iqbal 22ae7df766 rt: indirect command buffers of indexed draws on VK_EXT_device_generated_commands
What: the first cut of Metal indirect command buffers, the runtime's half, in one commit: the
device's extension, the buffer object, the executions, the reset and the pool depend on each
other, and any part alone would be dead code.

- The device enables VK_EXT_device_generated_commands with VK_KHR_maintenance5 together where
  both are reported (floor::INDIRECT_COMMANDS), and nothing else chooses a form. maintenance5 has
  one form here: rt takes nothing of it but the BufferUsageFlags2 a preprocess buffer needs, and
  its A8 format stays untaken. dgc.rs declares the extension's structures by hand, each size and
  offset checked at compile time against the spec's layout; it goes once ash binds the extension.
- IndirectCommandBuffer, IndirectCommandBufferDescriptor and IndirectCommandType
  (Device::new_indirect_command_buffer): indexed draws that inherit the pipeline state and bind
  their own buffers, at most 31 a stage; records in a Private block, reset from the device's
  template at the next commit. gpuResourceID is the records' device address.
- RenderCommandEncoder::execute_commands_in_buffer (a CPU range) and
  execute_commands_in_buffer_with_range (a range read from a buffer, executed at full capacity
  with the SEQUENCE_INDEX token): one PUSH_CONSTANT token a run of slot words, the index buffer
  token and the indexed draw, through the inherited pipeline; the push constants and the index
  buffer are pushed again after an execution. Every execution runs as one
  vkCmdExecuteGeneratedCommandsEXT a part of CHUNK = 64 commands, in order, on every device (the
  planner's ruling: one execution of more drew wrong on the XTX past ~4 MiB of generated commands
  and out of order on the 2080 past 64 sequences); each later part pushes its first command
  (PushField::IndirectBase) and takes its own preprocess offset in the execution's one region. A slot a command binds is pushed the widest bounds,
  unchecked, as a loaded pointer's access is (README, SlotBounds).
- BlitCommandEncoder::reset_commands_in_buffer (copies from the template in regions) and
  optimize_indirect_command_buffer (no work); useResource of an indirect command buffer in the
  compute and render encoders, and RenderCommandEncoder::use_heap.
- Preprocess memory: sized from vkGetGeneratedCommandsMemoryRequirementsEXT with the inherited
  pipeline per (content, raster state, record layout) at a part's 64 commands in a cache of
  SHAPES = 256; layouts LAYOUTS = 64;
  templates TEMPLATES = 16, each at most 64 KiB. Each a fill-past-capacity test. A new pool of
  regions (its own VkBuffer and VkDeviceMemory each, usage2 PREPROCESS | SHADER_DEVICE_ADDRESS, a
  memory type from the requirements' bits, device-local first, rounded to 64 KiB): one taken at
  record time per execution (an idle one at most twice its need, else one made), given back when
  its command buffer retires, the oldest idle ones freed past IDLE_BYTES = 128 MiB. At rest it
  holds idle regions up to 128 MiB, freed at device drop. No execution waits or is refused for
  the pool's sake. Not the block mechanism: blocks are made with the floor's one usage on every
  device, and adding the preprocess bit on DGC devices alone would be a second form; the memory
  types come from the driver's per-layout requirements. Gauges of the used and idle bytes: flat
  between iterations 100 and 200, zero at device drop (tested).
- Typed refusals by name (Gap::IndirectCommandBuffers with IndirectCommandsKind): no extension,
  other command types, per-command pipelines (everywhere), inherited buffers, bind counts past
  31, capacity, an unflagged state, a draw input the commands cannot carry, more tokens than the
  device takes; Refusal::CommandRange for ranges past the commands.
- README: indirect command buffers and their known gaps (b1's two costs, the preprocess cost,
  lavapipe's preprocess size defect verbatim, the Iris, UHD 630 and Mac host lines, the parts
  and their measured cost), the
  extension rows; METAL-COVERAGE and REFUSALS regenerated; api_signatures blessed.

GetDeviceProcAddr audit (verified by grep of the runtime's loads): every device function rt
loads belongs to an extension enabled at the load. calibrated_timestamps is a floor extension;
feedback_loop_dynamic_state loads only under the feedback loop; device_fault loads only where
device creation enabled it; external_memory_fd,
external_memory_win32 and external_memory_host load only where enabled(); Dgc::load runs only
where INDIRECT_COMMANDS is enabled.

Verified: see the lane's report (compile gate, lavapipe and GPU device tests).
2026-11-21 01:53:50 -08:00
Anees Iqbal 99e5d42deb rt: several viewports and scissor rectangles, and the viewport index, through the with-count dynamic states
setViewports:count: and setScissorRects:count: refused any count but 1 (DrawKind::Viewports). They
now take 1 to 16 each, and every draw records them with their count (vkCmdSetViewportWithCount,
vkCmdSetScissorWithCount, core in Vulkan 1.3). VIEWPORT_WITH_COUNT and SCISSOR_WITH_COUNT replace
VIEWPORT and SCISSOR in every pipeline's dynamic states, whose viewport state counts become 0, so
no pipeline is made for a count. Vulkan takes as many scissors as viewports. Each viewport's
scissor follows the deleted runtime's rule (render_state.rs's vk_scissors at 5d725aeec7^): the
rectangle of its index, the one rectangle where one is set, and none past the rectangles set where
several are, each cut to the pixels its viewport covers. A draw's attachment-read area is the
union of what it covers through the viewports it reaches: every viewport set for a vertex function
that writes [[viewport_array_index]] (GraphicsState::writes_viewport_index, now Draws::
selects_viewport), and viewport 0 for any other.

A vertex function's [[viewport_array_index]] is the translator's one form at the floor: its
ViewportIndex output, written 0 at or past the encoder's count (RuntimeFact::ViewportCount), which
the draw now pushes (PushField::ViewportCount -> FieldValue::ViewportCount, refilled when the count
changes). Its fragment function reads the index as written. An index that is not one value across
a primitive stays the translator's refusal at creation, needing geometryShader, which device
creation does not enable. Out of range: none or more than 16 is DrawKind::Viewports.

Floor: multiViewport and shaderOutputViewportIndex join REQUIRED, and the translator is told.
The venue dumps report both true on every venue: m3-max-48727, 48728, 48729, 48730, 48731, 48736,
48737 and 61508. shaderOutputViewportIndex is also true in the probes 61359 to 61362 and 61366.
tests/floor.rs, the README floor table, RUNTIME_FLOOR and profiles/runtime-floor.json add them.

The translator's tests that read runtime-floor as a device without the viewport index now take it
below the floor: engine_selected_indices (the raw index alone without multiViewport; the zero
indices without shaderOutputLayer and shaderOutputViewportIndex) and engine_stage_io_tail (the
floor declares Layer and ViewportIndex; the zero index below it). runtime-floor joins the stems
whose fragment ViewportIndex needs MultiViewport.

Also, missed in a5fac6fa9b: the README's pipeline bullet names the depth clip and triangle fill
modes among what a VkPipeline bakes.

Conformance: render-state-boxes leaves known-gaps-rt.tsv; CONFORMANCE-COVERAGE.md regenerated.
Docs: README (encoder bullets, floor table, refusal list), REFUSALS.md (Viewports' doc), the
encoder's built list.

Tests: tests/viewports.rs. rt6_select draws through the viewport of its instance, two viewports
(the halves) and two scissors (the whole target and its top half). Instance 0 fills the left half,
instance 1 the right half's top, and instance 2, past the count, draws through viewport 0, its
fragment reading 2. No pipeline is made, and none or 17 viewports or rectangles are Viewports.
draw.rs drops its two-viewport refusal. floor.rs adds the two missing cases, and the translator
sees shaderOutputViewportIndex.
2026-11-21 00:34:20 -08:00
Anees Iqbal 7cd1103a44 rt: cube array textures and views, with imageCubeArray in the floor
A cube array texture (`MTLTextureTypeCubeArray`) is built: an image cube-compatible with six of
its layers a cube (`arrayLength` times six layers), whose shader view is
`VK_IMAGE_VIEW_TYPE_CUBE_ARRAY`. Metal's casts with a cube array
(`makeTextureView(pixelFormat:textureType:levels:slices:)`) are built in the same form: a cube
array's subrange of whole cubes, its faces as a 2D texture (one face) or a 2D array (any faces),
six of its faces as a cube, a cube as a cube array of one cube, and a multiple of six slices of a
square 2D array as a cube array where its image is cube-compatible. A pass resolves into a
one-sample colour cube array as into a cube (`Plan::resolves`), and a layered pass renders a cube
array's faces across its cubes (the attachment view of its layers, as for a cube).

`imageCubeArray` joins the floor's required features. Every probed device reports it (vulkaninfo
dumps m3-max-48727 to 48731, 48736, 48737 and 61508: the RX 7900 XTX, every 780M, the RTX 2080,
the RTX 3090, the RTX 5080 Laptop, the Iris Xe, lavapipe, the UHD 630's Windows driver,
KosmicKrisp and the RX 550), and Vulkan 1.4 and Roadmap 2022 require it of every device. A device
without it gets the floor's refusal. The runtime-floor profile and its generator state it
(check_device_profiles: 0 findings), and the floor's missing-feature test has its case.

`Gap::CubeArrayTexture` is deleted (the consumer's checkout at 9bb622a2c2: 0 hits); REFUSALS is
regenerated and the API table loses the variant. The runtime README's texture and view lines,
its resolve line and its floor table say what is built.

Tests, each on every device of the cfg's kind: `tests::texture` round-trips a cube array's last
face (its second cube's); `tests::view` casts a cube as a cube array of one cube, reporting
Metal's array length 1; `tests::cube_views` samples a two-cube `RGBA32Float` cube array at its
second cube and a cube view of its first six faces through the owned fixture
`unk_cube_grad_lod`, every lane reading its face's slice, with `imageCubeArray` enabled; and
`tests::layered` renders a cube array's slices 4 to 9, across both its cubes (the cube-array
layered case, as the layered change landed first).

The conformance ledger's cube array rows and the runtime-floor contexts' opened chains follow in
the next commits.
2026-11-21 00:19:34 -08:00
Anees Iqbal a5fac6fa9b rt: the depth clip mode Clamp and the triangle fill mode Lines, as pipelines of the draw's class made at first use
setDepthClipMode: and setTriangleFillMode: refused every value but Metal's defaults
(DrawKind::DepthClamp, DrawKind::FillMode). Vulkan 1.3 bakes both in
VkPipelineRasterizationStateCreateInfo, and only VK_EXT_extended_dynamic_state3 makes them
dynamic. The floor cannot require that extension: the UHD 630's Windows driver lists no EDS3, and
KosmicKrisp reports extendedDynamicState3PolygonMode false. So both are now first-use pipeline
variants, the accepted form. The encoder keeps a Raster (clamp, lines) and each draw takes
RenderCompiled::pipeline(topology, raster). The content keeps its primary VkPipeline (the triangle
or patch class at the default state) and a bounded list of the others, by class list topology and
raster state: at most 7 (three more states of the triangle or patch class, two of each other
class). The line and point classes take the clip mode alone, since Metal and Vulkan apply the fill
mode to triangles only. A triangle's edges under Lines chain Bresenham's rule, as the line class
does ("the effective rasterization input topology is in the line topology class"). The first draw
under a state makes its pipeline and waits for it: a first-use wait of a new site,
FirstUse::Raster (Metrics::first_use_raster_waits, _nanos, _max_nanos). The line and point
classes' first draws at the default state count where they did.

Floor:
- depthClamp joins REQUIRED, and the translator is told (=> DepthClamp), so the encoder maps the
  mode through metal::state::depth_clamp_enable. Vulkan 1.4 and Roadmap 2022 require it. The venue
  dumps report it true on every venue: m3-max-48727, 48728, 48729, 48730, 48731, 48736, 48737 and
  61508. tests/floor.rs, the README floor table, RUNTIME_FLOOR and profiles/runtime-floor.json
  add it.
- fillModeNonSolid is enabled where reported (FILL_MODES, told to the translator), and the setter
  maps Lines through metal::state::polygon_mode. KosmicKrisp on the M3 Max reports it false
  (m3-max-48737); every other dumped venue reports it true. There Lines stays DrawKind::FillMode,
  and so does the raw value 2, which no SDK header declares.

DrawKind::DepthClamp is deleted. The consumer's checkout names it nowhere (git grep in
reims-vgpu: 0 hits). Its only call sites are set_triangle_fill_mode and set_depth_clip_mode at
crates/reims-vgpu-vulkan/src/rt_platform/render.rs:371 and :374, whose signatures are unchanged.

The translator's raster-state test reads runtime-floor, which now states depthClamp. Clamp maps
there, and the refusal is asserted on runtime-floor without it, as ab8277a560 did for
depthBiasClamp. Other translator tests that read runtime-floor were grepped for DepthClamp and
FillModeNonSolid, and none reads the floor as lacking them.

Known gaps (README): a content's first draw under Clamp or Lines makes a VkPipeline, which Metal
does not. Under Clamp the depth a fragment function writes is the device's clamp's: Metal stores a
negative NaN as 0 below a range above 0, and the translator's depth_clamp_range variant is not
drawn.

Conformance: render-state-depth-clip and render-state-facing leave known-gaps-rt.tsv;
CONFORMANCE-COVERAGE.md regenerated. Docs: README (encoder, first-use waits, floor and fill-mode
tables, known gaps), REFUSALS.md, the api_signatures table (3 Metrics fields, 1 variant gone).

Tests:
- tests/raster.rs: a triangle in front of the near plane draws nothing under Clip and every
  texel under Clamp (twice: one pipeline made). Under Lines, through a viewport half a pixel
  right of and above the corner, the triangle draws its two edges inside the target, column 0
  and row 7, and nothing inside. Without fillModeNonSolid it is FillMode and fills. Pipelines
  made, raster first-use waits and first-use waits are each 1 + fillModeNonSolid.
- draw.rs: setting both modes makes no pipeline when no draw follows.
- floor.rs: depthClamp's missing case, and the fill-mode feature enabled where reported.
- first_use_sites.rs: the raster site.
2026-11-21 00:14:34 -08:00
Anees Iqbal 57855c6097 Link: the synthesized geometry stage goes, both forms (the barycentric weights and the rate map's fan-out)
The translator built geometry stages in two forms that no Metal function asks for:
- the barycentric weights: a fragment function's [[barycentric_coord]] read as varyings, which a
  generated geometry stage of each topology class wrote, on a device without
  fragmentShaderBarycentric;
- the rate map's fan-out: a draw of a rasterization-rate-mapped pass's triangles once, a geometry
  stage emitting a copy of each per region, with its probe and its region-copy vertex variant.

Neither form reached a guest. The runtime enables no geometryShader, so it refused the weights
form already. It never sets BindShape::region_fan_out, and draws a rate-mapped pass region by
region (the regions route, RateMapRegions, and region_viewports, which stay). Validation never set
region_fan_out either.

After this change, one form is left for each:
- A fragment function that reads [[barycentric_coord]] reads the device's own
  BaryCoordKHR/BaryCoordNoPerspKHR. Without fragmentShaderBarycentric it is refused as
  Unsupported(Barycentrics) needing that feature alone; geometryShader is no longer offered.
- A rate-mapped pass draws through the regions route.

Rule 1: no precision note stops being raised. The fan-out's copies were a near-equivalent of the
regions route, which carries its own note (RateMapRegions::precision), and the weights form
raised none. The catalogue is unchanged.

Removed:
- pipeline::link::geometry (GeometryStages, the three classes' stages) and pipeline::link::fan_out,
  with their tests (link/tests/geometry.rs, link/tests/fan_out.rs) and tests/engine_region_fan_out;
- bind::fan_out (the region table, the probe's word layout and its constants);
- RegionFanOut and FanOutState;
- the region_fan_out fields of GraphicsState, BindState, BindShape, VariantKey and
  RenderLinkInputs, and LoweringInputs::region_copies;
- the region copy's lowering: StageIoPlan::region_copy, RegionCopy and the region table's
  declaration;
- PushField::RegionBox and RegionProbe;
- SyntheticBinding::RateMapRegions and RateMapFlags, and WriteSource::RateMapRegions and
  RateMapFlags;
- RuntimeFact::SynthesizedGeometry, RenderPipeline::runs_stage and Linked::geometry;
- IoRole::Barycentric with VaryingKey::barycentric and its key tag;
- VkProperty::SubgroupGeometryStage;
- the SPIR-V IR's geometry execution model, which only these stages produced: ExecModel::Geometry,
  OpEmitVertex and OpEndPrimitive, the InputPoints, InputLines, OutputLineStrip,
  OutputTriangleStrip and Invocations modes, ModelNeed::Geometry, EntryRule::GeometryModes and the
  builder's geometry ops;
- from scripts/regen-spirv-grammar/items.txt, the opcodes EmitVertex and EndPrimitive, the
  execution model Geometry and those five execution modes. spv.rs is regenerated: the opcodes and
  the model stay as test-only values, which the test parser reads, and the modes go;
- in validation, the census's geometry stage filter, the draw's runs_stage filter and the
  candidate's GEOMETRY stage arm. The census test that read three geometry stages from
  engine/bary_weights goes with them.

The SPIR-V builder now marks only Position Invariant; ClipDistance was the fan-out's.
band::plan loses its geometry flag, and takes the four SPIR-V helpers it shared with the
geometry module. The binder's stage map takes a geometry stage as no render stage.

Validation cases that executed either form: none.
- Fan-out: no validation code sets region_fan_out.
- Weights: two authored cases read [[barycentric_coord]], fa8b920d3cf3 and ae0a7e39b12f. Neither
  has a stored Vulkan observation on a profile without fragmentShaderBarycentric. fa8b920d3cf3 is
  observed on Metal and MoltenVK, and moltenvk-m3 has the feature. ae0a7e39b12f is observed on
  Metal only.

Fourth user of GeometryStages: none. It was used by link, the compile API's splice, the binder's
selection (through RuntimeFact::SynthesizedGeometry and GraphicsState::region_fan_out) and its
own tests.

Tests:
- engine_stage_io_tail's weights test is now without_the_feature_the_weights_are_refused: on
  lavapipe, ANV's Iris Xe, NVIDIA's Pascal (each with geometryShader) and runtime-floor (without
  it), both barycentric entries are refused needing fragmentShaderBarycentric.
- engine_target_indices checks each pipeline's stages valid where it counted geometry stages, and
  loses the_weights_stage_beside_a_vertex_layer_is_not_implemented: that combination is now the
  plain refusal above.
- engine_amplification no longer counts geometry stages.
- The binder's render stage test refuses a geometry stage.
- The builder's invariant test refuses ClipDistance.
- engine_rotated_weights' rotated draw runs on moltenvk-m3 and RDNA3's RADV, each with
  fragmentShaderBarycentric, where it ran on lavapipe through the weights form.
- The fact mechanism test numbers its 100 RuntimeFact variants densely again (PrivateArena,
  which development added, takes 99).

Bless due until the next named pin, where the M3 bless job takes them; nothing is blessed here:
- tests::public_fixtures_engine (the inventory): every [[barycentric_coord]] cell on a profile
  without fragmentShaderBarycentric becomes Unsupported(Barycentrics) needing it alone, where it
  compiled through the geometry stages (with geometryShader) or offered GeometryShader as the
  alternative;
- tests::golden_hashes, and pipeline::compile::tests::the_old_render_descriptor_key_keeps_its_value
  (the render key), as under the commit below: the profiles' fingerprints change;
- the authored compile census.

SEMANTICS_VERSION 2247 -> 2248 and ARTIFACT_FORMAT_VERSION 583 -> 584 are placeholders that main
renumbers.
SEMANTICS: a fragment function's weights and every rate-mapped variant change form. ARTIFACT: the
codec loses the RegionFanOut, FanOutState, GraphicsState::region_fan_out, IoRole::Barycentric,
RuntimeFact::SynthesizedGeometry, PushField, SyntheticBinding and VkProperty tags. RUNTIME_VERSION
stays: the runtime's render-pipeline kind no longer reads region_fan_out, which it never set, and
its SynthesizedStages doc names the bands alone. runtime-sources.sha256 keeps development's (land-pkt
re-pins it), api_signatures and api_surface drop the removed items, and docs/REFUSALS.md is regenerated.
API.md drops the geometry stages from RenderPipeline's stages, its barycentric bullet and its band
bullet. ARCHITECTURE.md's link line drops pipeline::link::geometry, and the runtime README's
Barycentrics gap names the feature alone.

Consumer check (consumer_check.sh, consumer development b76d6ac4a9): region_fan_out,
RegionFanOut, FanOutState, region_copies, region_copy, RateMapFlags, RegionBox, RegionProbe,
SynthesizedGeometry, FEW_COPIES, PROBE_DRAW_WORDS, RegionCopies and runs_stage have 0 hits.
GeometryStages appears in crates/reims-vgpu-c/link-order.txt only. fan_out's hits are the
consumer's own event fan-out in crates/reims-vgpu/src/graphics/decode/cmdbuf.rs, not this
module.

Verified (jobs read):
- m3-max-61801: the suites at this change's work in progress (4f1f934423); its real reds were the
  mechanism numbering and the rotated weights on amd-rdna3-radv, both fixed here; the render key
  reads bless-due.
- At the stack's tip over this change (dvl-5 1fa4aed963 and dvl-6 92fe40c38f): 61978 and 61987,
  fmt, clippy in every configuration, Rustdoc, each feature alone, the API docs and the Windows
  clippy, green; 61891, the suites at dvl-4: 13 failures, each a bless-due golden above or
  development's own (the raster state test, the inventory's sample_fill rows); 61968, the lavapipe
  device suite of metal2vulkan-validation, 1483 of 1483, and public case qualification Match;
  62042, the metal2vulkan-validation suite at dvl-5, 1378 of 1378 passed.
- States-only play of this change's player (p-gd.zst) over 35 distinct streams on gem10 (61919),
  um870 (61924), ms01 (61967) and um790 (62004): 456,384 render and 91,972 compute states made,
  0 refused, every stream exit 0. The msi stream (windrag-780m-b2) is not played: msi had no
  memory free.

Rebased onto development 4cf936ed4d (selidx landed as 3ecf606aa8). The conflicts: the version
lines; the mechanism test, where development added RuntimeFact::PrivateArena; runtime-sources.sha256,
where development's is kept; and api_signatures.tsv and docs/REFUSALS.md, both regenerated
(signatures.py --bless, refusal_surface.py) and differing from development by this change's items
alone. The jobs above ran at the old base; the rebased tip's are in the report to main.
2026-11-21 00:03:34 -08:00
Anees Iqbal aed460e0da rt: indirect draws, of primitives, indexed primitives and patches
The render encoder builds Metal's three indirect draws:
`drawPrimitives:indirectBuffer:indirectBufferOffset:` (`draw_primitives_indirect`),
`drawIndexedPrimitives:indexType:indexBuffer:indexBufferOffset:indirectBuffer:indirectBufferOffset:`
(`draw_indexed_primitives_indirect`) and
`drawPatches:patchIndexBuffer:patchIndexBufferOffset:indirectBuffer:indirectBufferOffset:`
(`draw_patches_indirect`). Each is one `vkCmdDrawIndirect` or `vkCmdDrawIndexedIndirect` on the
buffer at its offset: Metal's argument structs lie as Vulkan's commands do, so the GPU reads
them as they are and nothing is copied. Before, the encoder had no such methods and the README
listed indirect draws as not built.

drawPatches indirect is built: rt's patch draw is vkCmdDraw(patch_count, instances, patch_start,
base), each patch one vertex of the state's patch list, so Metal's patch count is the indirect
command's vertex count unchanged. A patch index buffer stays `DrawKind::PatchIndexBuffer`, as
the direct draw's.

The arguments' buffer counts among the draw's reads as an index buffer does (draw_reaches,
Managed copies), and the command buffer keeps it until it retires. The pass's first barrier
(Reach::Commands, which has INDIRECT_COMMAND_READ) and the encoder's memory barrier make earlier
writes visible to the read. An offset not a multiple of 4 or without the arguments' 16 bytes (20
indexed) is Refusal::IndirectOffset; arguments at a block byte not a multiple of 4 are
Refusal::ArgumentPlace; an indexed draw's index offset must be a multiple of the index size and
inside the buffer. A device that takes firstInstance 0 alone under a divided step rate refuses
an indirect draw through such a state (DividedBaseInstance), since the GPU reads the base
instance.

Floor: drawIndirectFirstInstance joins REQUIRED (Vulkan 1.4 requires it), so Metal's base
instance is the device's own. The translator is not told. The venue dumps report it true on
every venue: m3-max-48727, 48728, 48729, 48730, 48731, 48736, 48737 and 61508. tests/floor.rs,
the README floor table, regen_device_profiles.py's RUNTIME_FLOOR and profiles/runtime-floor.json
add it. The translator's tests that read runtime-floor only see indirect_needs_arguments become
false more often, which none asserts the other way.

Known gap (README): an indexed indirect draw's index count is the GPU's, so a count past the
index buffer is not refused as a direct one is. Without robustBufferAccess2, which the floor does
not require, a count past the block's VkBuffer is outside valid usage
(VUID-vkCmdDrawIndexedIndirect-robustBufferAccess2-08798).

The encoder's doc no longer lists `useResource:` as not built (it is, since 62b3e5a250).

Docs: README, REFUSALS.md and METAL-COVERAGE.md (the three selectors now implemented), the
api_signatures table (three methods).

Tests: draw.rs's every_device_draws_from_indirect_arguments_a_blit_wrote: arguments written by a
blit earlier in the command buffer, at offset 16, draw the constant-step triangle as the direct
draw does (vertex 1, instances 1 and 2 at base instance 1), indexed through [7, 0, 1, 2] from
index 1 at base vertex 1 too; arguments of no instances draw nothing. patch.rs's
every_device_draws_patches_from_indirect_arguments: two patches from arguments 4 bytes in draw
as the direct patch test's, and a patch index buffer is PatchIndexBuffer.
2026-11-21 00:02:34 -08:00
Anees Iqbal 374061b156 Validation: the MoltenVK MSL helper and corpus-pipeline's .cfg writer are deleted
The MoltenVK MSL helper converted a kept module to MSL as MoltenVK
1.4.1 converts it on the moltenvk-m3 device. It had three parts:
- scripts/moltenvk-msl-helper/build, which built helper.cpp against
  SPIRV-Cross at MoltenVK's commit;
- msl_portability::moltenvk, which derived the helper's configuration
  from the pipeline layout;
- corpus-pipeline --keep-modules, which wrote that configuration beside
  each kept module as <hash>.<stage>.<variant>.cfg, or .cfg.err.
Only the helper read a .cfg. No check, CI job or script ran the helper,
and the MoltenVK backend it served is gone. So the module, its tests,
helper.cpp, the build script and the .cfg writer go. --keep-modules
still writes each stage's .spv and its .json (entry point,
specialization layout, strategy census).

The fixtures under fixtures/public/msl_portability/ stay: the
translator's forwarding tests (spirv/testing/forwarding.rs) read them.

The engine's linked translation returned a translated module's words
with the pipeline layout link gave it, "what msl_portability::moltenvk
configures MoltenVK's conversion from". No caller read that output, so
these go:
- translate_new_linked and translate_row_linked. translate_new and
  translate_row validate directly.
- translate_with, which had no caller. specialization::attempt's doc
  now names translate_unvalidated, which is what it runs.
- PendingL3::layout. validated and PendingL3::validate now return the
  Attempt alone.
- Attempt::settle_l3's bool, which no caller reads now.

Not deleted, because of the macOS grep: corpus-pipeline (L4 driver
acceptance, --device-type gpu) still opens a Vulkan device on macOS,
which is MoltenVK there. acceptance::metal_report parses MoltenVK's
reports for it. So VulkanContext's loader-word restore (loader_word.rs
and clippy.toml's list), MoltenVK's withheld diagnostics (device.rs)
and coverage's MoltenVK host class serve a live path, and stay.

Verified: cargo fmt; no file names msl_portability's module,
moltenvk-msl-helper, translate_new_linked, translate_row_linked or
translate_with (git grep). The compile gate follows as a potluck job.
2026-11-20 22:19:52 -08:00
Anees Iqbal d54a1a5568 Validation: the MoltenVK backend, its C3 venue and the old engine's baseline are deleted
The validation executor's Vulkan side runs on Linux through native ICDs
and the runtime. No lane records MoltenVK rows any more, and no MoltenVK
venue is wanted. This commit deletes the MoltenVK backend from the
store up.

Before the deletion, git grep at e35d9098c0 showed these readers of
Backend::Moltenvk rows outside tests:
- C3's input (c3.rs: C3Input::moltenvk, the baseline, the old-mismatch
  ledger), its venue kind (venues.rs), the evidence census
  (index.rs: the index's candidate table and evidence_status);
- the store's own layout check, shard rewrite and rekey;
- the batch's worker store, which linked the other backend's rows;
- the corpus-moltenvk binary, the host and driver checks
  (candidate.rs, platform/compute.rs) and candidate_batch's CPU refusal.
Every one goes or loses its MoltenVK arm here. No reader is left.

What goes:
- The corpus-moltenvk binary (Cargo.toml entry included), and
  Backend::Moltenvk and BatchBackend::Moltenvk. Backend keeps one
  variant, Vulkan. Collapsing it is a follow-up commit.
- corpus/observations/moltenvk: 64 shards, 4,809 rows. 4,802 of them
  are old-engine rows in about 60 slots: apple-m3-max-moltenvk 1,137,
  the byte-exact-* and local-* runs, and probe slots. The other 7 are
  engine rows of apple-m3-max-moltenvk@engine.
  corpus/observations/refusals/moltenvk: 16 shards, 6 refusals.
- The store's MoltenVK shards: its layout check, the aligned rewrite,
  the refusal follow and the rekey now read the Vulkan backend alone.
  The batch's worker store links only the Metal rows. The index stores
  the Vulkan candidates alone, and evidence_status's rows have no
  moltenvk column (corpus-status's evidence line loses it too).
- C3's MoltenVK venue (VenueKind::Moltenvk, c3-venues.json's
  apple-m3-max-moltenvk entry) and with it the old engine's baseline:
  - Population::OldEngineMatched, the baseline closure and the "new
    mismatch" count (SlotReport::new_mismatches);
  - the old-mismatch ledger (LedgerRow, C3Report::ledger, stale_causes,
    unexplained);
  - the reviewed list's old_mismatches part (OldMismatch,
    ListPart, EntryRow::part), and Venues::baseline and by_environment.
  The venue list's MoltenVK-driver check goes too. VenueDevice's
  metal_environment_id, which only an Apple GPU's venue device set,
  goes with Venue::identities_compared_with: a venue run is held to
  all of its devices' identities.
- c3-reviewed.json: the 12 old_mismatches entries (all signed off),
  and the 10 fast_math_regrouping readings whose only observation was
  the apple-m3-max-moltenvk@engine slot. These are the linked-single
  radix 5/7/11/13/15 zero-write cases, two each, all signed off. A
  reading must list an observation, and theirs named a slot that no
  longer exists. A regrouping mismatch of those cases on another venue
  now reads unreviewed until a reading lists that venue's row. The 12
  apple_reading entries are untouched; none named a MoltenVK slot.
- corpus/authored-compile.tsv: the moltenvk-m3 column keeps its cells
  but drops their artifact digests (2,255 cells). Only a C3 venue's
  profile keeps a digest, and moltenvk-m3 is no venue's now. This is
  what a bless writes; the profile itself stays, since the translator's
  tests read it.
- scripts/rerecord-venue's moltenvk kind (and its Homebrew validation
  layer path), and scripts/rerecord-commit's MoltenVK build, install
  and shard paths. docs/VALIDATION.md loses corpus-moltenvk, and its
  venue list names what each venue covers.
- In the docs, the robustness leg's "profile-leg" (validation README,
  corpus README) is now "profile", which 79d95a2887 missed.

What C3 still decides: per venue of c3-venues.json, lavapipe on arm64
and x86 (the public cases) and the 780M, the Iris Xe RPL-P and the RTX
5080 Laptop (every Metal-qualified case), each case's verdict in the
venue's engine slot by the same rules as before (match, reviewed,
device_gap, out_of_scope, reference_gap, mismatch, refused, stale,
missing). It holds when every slot holds, every reviewed observation
holds, every listed reference gap is recorded, every entry and recorded
reference gap is signed off, and no sign-off is refused. It no longer
holds anything to an old-engine population, counts new mismatches
against one, or keeps a ledger of old-engine mismatch causes.

Tests:
- c3/tests.rs: the synthetic MoltenVK venue becomes a native GPU venue
  (GPU, Metal-qualified, still described by the moltenvk-m3 capture).
  Deleted: the baseline test (moltenvk_must_cover_every_case...), the
  ledger test, and the Apple-GPU Metal-environment test.
  Rewritten: the population tests (two populations now) and the
  reference-gap test (on lavapipe's public population). The schema test
  checks its review fields on a reading. The venue checks lose the
  baseline and driver cases.
- index.rs and store.rs tests run their toy rows as Vulkan's. The
  cross-backend checks have no second backend and go.
- vulkan_batch/tests.rs: the MoltenVK batch test goes. The install test
  refuses a Metal batch's record in place of a MoltenVK one.
- tests/integration: the store-layout and worker tests drop
  corpus-moltenvk. fast_trig_within_apples_bound reads the Vulkan store
  and wants one row per venue (5). It wanted 10, which the robustness-off
  and MoltenVK rows made up.

Device-level MoltenVK accommodations stay for the follow-up commit with
the MSL helper, once a grep shows no Vulkan run on macOS: the loader
word, MoltenVK's withheld diagnostics, coverage's robust-buffer host
class and the pipeline flag.

Verified: cargo fmt; no committed observation path, C3 list entry, venue
or script names the MoltenVK backend (git grep). The compile gate of the
Q3 commits follows as a potluck job.
2026-11-20 22:15:53 -08:00
Anees Iqbal 79d95a2887 Validation: the robustness-off leg and its slots are deleted
The ruling Q3: the validation executor runs each case in one context,
which enables every robustness feature its device states. Its second
leg (every robustness feature off, the ID@engine+robustness-off slots)
measured an encoding that metal2vulkan-runtime never runs, since the
runtime's floor fixes the robustness it enables. The tier table keeps
both of its compiles: they are translator coverage of what the runtime
ships, so coverage::Leg stays as the tier table's type alone.

Deleted:
- the executor's leg: corpus-vulkan's and corpus-moltenvk's
  --robustness-off, the device worker's leg, engine_slot's leg (an engine
  slot is ID@engine or ID@engine@P; an ID@engine+robustness-off is no
  engine slot), the enable lists' leg (engine_list enables what the
  description states), and the leg in a row's environment and census
  (ExecutedCensus.leg, environment.robustness.leg) with its validation;
- the batch's legs: corpus-vulkan-batch takes no --leg. Its passes are
  Pass::Engine and Pass::Metal, so a done-list line names "engine" where
  it named "stated", and a log is CASE.engine.txt. Its report lines carry
  no leg= field, and batch-slowest names pass=engine;
- the authored compile census's robustness-off profiles: a profile is
  its committed stem (ProfileStem, which was ProfileLeg); a label with a
  "+" names no profile. corpus/authored-compile.tsv loses its 9
  +robustness-off columns mechanically. Every other cell stays, and the
  reader takes the new layout in this commit. The rows are re-blessed
  at the next named pin. the_committed_expectations_parse holds the file
  to what a bless renders. No test is expected to read red until the
  bless, since no kept cell changed (unaudited until development's census
  runs);
- C3's legs: a venue lists no legs and has one slot (c3-venues.json
  drops its legs fields). c3-reviewed.json drops the 12 observations
  recorded in robustness-off slots;
- the committed rows of the +robustness-off slots: 193 rows and
  refusals out of corpus/observations, which empties and removes 44
  shards. "leg":"stated" is stripped from the remaining rows' census and
  environment;
- scripts/qualify-public-cases' second run per case, and
  scripts/rerecord-venue's --leg; docs/VALIDATION.md's robustness legs.

corpus-triage's usage, corpus-status' --c3 help and the census's file
comment say "profile" where they said "profile-leg".

Verified: cargo fmt. The compile gate follows as a potluck job.
2026-11-20 22:15:02 -08:00
Anees Iqbal 7ba1cdbf30 rt: a blit copy between a buffer and a texture takes MTLBlitOption's plane options
copyFromBuffer:...:options: and copyFromTexture:...:toBuffer:...:options: are
BlitCommandEncoder::copy_from_buffer_with_options and
copy_from_texture_to_buffer_with_options, with a public BlitOption (None,
DepthFromDepthStencil, StencilFromDepthStencil). A plane option copies the aspect it
names, one vkCmdCopyBufferToImage or vkCmdCopyImageToBuffer region of that aspect, where
the pixel format has it: the depth or the stencil of a combined format, and the depth of
Depth16Unorm or the stencil of Stencil8 too, which Metal takes (the conformance crate's
buffer-depth-samples rows put the option to Metal on those formats). The forms without
an option are those of None. The unit is texture.rs's copy_unit of the named aspect, so a
copy into a 32-bit float depth is Gap::FloatDepthUpload as Depth32Float's is, and a
multisample texture stays Gap::TextureBytes; a plane option of a format without its
aspect is Gap::TextureBytes. MTLBlitOptionRowLinearPVRTC is not offered: the runtime
makes no PVRTC texture, and the conformance side keeps it unavailable.

The private buffer_copy takes the direction and the option as one Way, which keeps it
under clippy's argument count without an expect.

Docs: the rt README's blit lines, Gap::TextureBytes's doc, REFUSALS.md (regenerated),
the metal-coverage map (the two options selectors now name the options methods) and
METAL-COVERAGE.md, the public signature table (6 records added, none moved).

Tests: tests/blit_options.rs. On the host, each option's aspect and unit bytes in both
directions, and each refusal. Under a device cfg, a pass clears a Depth32Float_Stencil8
texture to depth 0.25 and stencil 0x5a, a stencil region goes in from a buffer, and both
planes come back out (the region with 0x5a around it, 0.25 at every texel);
Depth16Unorm's depth and Stencil8's stencil go in and come back out bit for bit.
2026-11-20 22:11:29 -08:00