Commit Graph
2148 Commits
Author SHA1 Message Date
Anees Iqbal 3c86a2a45f Translator: a vertex function's slice and viewport index are stored as it writes them
Metal requires the same [[render_target_array_index]] and [[viewport_array_index]] at every
vertex of a primitive ("If values differ, the behavior and value passed to the fragment function
are undefined.", the Metal Shading Language specification), and Vulkan asks the same of Layer and
ViewportIndex (VUID-VkPipelineShaderStageCreateInfo-stage-02596 and -02597). The translator stored
an index only where the function's structure showed it the same among a primitive's vertices
(uniform_varyings over the raw index varyings) and refused every other one,
NotImplemented(LayeredRendering), on every device. A program that keeps Metal's rule keeps
Vulkan's with the index stored as written, and one that breaks it has no Metal answer to match,
so plan::index_store now stores the index to its builtin wherever the device stores it from a
vertex function (shaderOutputLayer, shaderOutputViewportIndex, both in the floor), whatever the
structure shows; a device without the output is refused needing it, as before. The store keeps
index < count ? index : 0 against the pushed length and viewport count, and an index never written
is still stored as 0. uniform_varyings now lists user varyings alone (the raw index keys decided
nothing else), and uniform_index is gone.

Where a program breaks Metal's rule the layer or viewport is the device's choice: the runtime
README's layered line and docs/API.md (section 4 and section 10's accepted differences) say so in
one sentence, the viewport paragraph and set_viewports no longer name a geometry stage, and
docs/REFUSALS.md is regenerated (LayeredRendering is now a device refusal alone). The runtime's
layered device test draws rt6_per_primitive's three triangles into slices 1, 1 and 2 through
viewports 0, 1 and 1 of a 2D array, checking every texel, in place of the refusal it asserted.

SEMANTICS_VERSION 2283: modules for such functions instead of the refusal, and uniform outputs
without the raw index keys.
2026-11-23 00:13:45 -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 3c5485a207 Conformance: compute-imageblock-sizes declares the SIMD-group access note and its dispatchType row
The runtime's pipeline of a4_imageblock_extent records the static simdgroup-access-order
note on every device, which the card replays announced at the notices site (RTX 3090,
Radeon 780M, Iris Xe: m3-max-70084, 70085, 70086); the case declares it, as
compute-threadgroup-memory-reads-zero does for its kernel, and every value still compares
exactly. The encoder's dispatchType is the consumer's own on every venue, the same ledger
row the other compute-pass cases carry. Every byte of the output compared equal to
Metal's on the three cards.
2026-11-23 00:09:51 -08:00
Anees Iqbal 809f791396 Conformance: compute-imageblock-sizes' Metal recording, and the coverage it adds
Recorded on an Apple M3 Max, macOS 27.0.1 (26A434), job m3-max-70065: three runs, one
outcome, the validated leg ran with nothing announced, and the timing kept. Metal's 832
bytes equal the fixture's answer at each extent: the dispatch before the encoder set a
size read 1 by 1 (its cell and the extent 1, 1), then 4 by 2 and 4 by 4, every byte past
each dispatch's words still its guard.

docs/CONFORMANCE-COVERAGE.md regenerated: MTLComputeCommandEncoder's
setImageblockWidth:height: is now an implemented item the Metal leg exercises (29
implemented, 26 exercised).
2026-11-23 00:09:50 -08:00
Anees Iqbal 58148264f8 Conformance: compute-imageblock-sizes, one encoder's dispatches before any imageblock size and at two it sets
A compute step for setImageblockWidth:height: on both sides, and a case that runs
a4_imageblock_extent three times in one encoder: before the encoder sets a size (one
thread, Metal's 1 by 1), then at 4 by 2 and at 4 by 4, each one threadgroup of the
imageblock's extent, into a guarded slot each. The case's test holds Metal's recorded
answer equal to the fixture's own at each extent.

The runtime README states the size as a specialization: each size a kernel runs at is
one VkPipeline made at prepare_dispatch or at the dispatch, a first-use wait, where Metal
changes the size with no compile (m3-max-69983); prepare_dispatch and dispatch_variant
take the size. REPLAY-STREAM and VALIDATION say the player and the engine candidate set
it; the ledger row for the state's imageblock length drops the dispatch refusal.

The recording follows in its own commit (taken on the M3).
2026-11-23 00:09:50 -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 39498a602f Translator: a vertex function's slice or viewport index it never writes is stored as 0
A vertex function that declares [[render_target_array_index]] or [[viewport_array_index]] and
never writes it returns the index undef (Apple's compiler inserts nothing into the returned
struct's field). The translator took undef as divergent among a primitive's vertices (each use of
OpUndef may read another value) and refused the function, NotImplemented(LayeredRendering).
Metal gives such an index no value, so an index undef at every return
(stage_io::returns_undefined: an undef or poison inserted there, a member of one, or a member no
insertion writes into one) is stored as 0 wherever it is stored (PlannedOutput::unwritten: the
Layer and ViewportIndex builtins and their raw varyings), the same at every vertex, as Vulkan
asks (VUID-VkPipelineShaderStageCreateInfo-stage-02596 and -02597), and uniform_varyings lists
it among the uniform outputs. The offset of a draw of one amplification and the count each
index is held below apply as to any written index. The member walk returns_no_nan used is
shared (returned_member); its answers are unchanged.

SEMANTICS_VERSION 2282: modules for such functions instead of the refusal.
2026-11-23 00:09:50 -08:00
Anees Iqbal 82f0ceca53 Identity domains: a storage cube written or read by face is the 2D-array element of its faces
The translator declares every storage cube and cube array as the 2D array of its faces, at layer
6 * cube + face (cube_as_array). Under the resident-table domains the binder supplies that view.
Under the identity domains no class held it, so a kernel that writes a cube by face was refused
with "texture argument S: a type the identity arrays hold no element of". In the private corpus
on runtime-floor that refusal covered 30 guest functions alone, and 6 more together with a
sampled cube read by face.

Now:
- Translator: identity_class takes a storage declaration that views a cube as an array as the
  2D-array storage class, and a storage cube states no ImageViewShape fact under the identity
  domains. A sampled cube read by face (access::read or access::sample) still has no class and
  stays refused.
- Runtime: a cube's or cube array's storage element, for a texture and for a texture view, is a
  VK_IMAGE_VIEW_TYPE_2D_ARRAY view of its 6N layers (storage_view_type). Vulkan takes that view
  of any cube-compatible image, so every device gets the same form, at no copy and no cost. The
  sampled element stays the cube view.
- docs/API.md states the storage element a consumer holds for a cube. The runtime README says
  what a cube's storage view is, and its identity-domain gap list keeps only sampled cubes read
  by face.
- The same README list adds the refusal of a storage texture written at a run-time level, with
  what Metal does on Intel Macs: an owned kernel's writes at levels 1 and 2, read from a buffer,
  landed exactly on a Radeon Pro 5300M and a UHD 630 under macOS 26.7.1, with Metal's
  validation off, with API validation, and with shader validation (job m3-max-70040, probe built
  in m3-max-70037).

Under the resident-table domains nothing changes: both translator changes apply only under the
identity domains.
2026-11-23 00:09:48 -08:00
Anees Iqbal 059835018a Translator: the floor's tail folds into each other pushed field through a select, not a never-taken return
The floor's tail guard read the tail in the first block and returned where it held a value the
consumer never pushes, so every stage that pushes more than one field ran its whole body under a
never-taken branch. AMD's open driver (AMDVLK 2025.Q2.1, LLPC) dies in vkCreateGraphicsPipelines
making a fragment stage of that shape whose loop holds convergent instructions under
MaximallyReconvergesKHR (an implicit-LOD sample and an f32-f16-f32 round trip): the setup
streams' render content 295d5723 ([65] RG16Float, 1 sample) died on the Radeon 780M, and the
owner's Windows driver died making the same stream's states.

Now the stage reads the tail in its first block, tests it as before (lower/push.rs
tail_never_pushed), and each other field read from its push member is, as every use of it
recalls it, its member's value where the test fails and the null of its type where it holds
(fold_never_pushed, EmitCx::fold_tail): a select per field, no branch, no return. The tail's load
lives while any other push read does, which is what the tail is for (a driver that uploads push
bytes up to the highest one a stage reads). A tail field of the stage's own folds into the others
alone. The fields read from their members load first, then the tail folds, then the spilled and
derived fields, which may read through the folded parameter block's address. Same pushed bytes,
same placement, no interface change.

- lower/push.rs: emit_tail_guard becomes tail_never_pushed (the test) and fold_never_pushed.
- lower/emit.rs: load_push_fields loads, folds (fold_tail), then loads the rest; emit_module no
  longer calls a guard.
- SEMANTICS_VERSION 2280.
- Test: the_floor_s_tail_folds_into_the_other_pushed_fields_with_no_branch (one select per
  other pushed field, no branch on the tail's test, one return), which fails on the guard.
- Docs: lower/push.rs, PushField docs, docs/API.md section 5.
2026-11-22 23:09:52 -08:00
Anees Iqbal a677cb74b3 docs/API.md: the bicubic catalogue's RGBA16Float figure names what lavapipe measured at the edges
What: the precision-note catalogue's largest RGBA16Float difference under the bicubic filter
note now also gives 4.73e-4, measured on lavapipe in the authored bicubic edge cases
(bicubic-edges-of-random-texels-in-a-12x10-rgba16-float, at values in [1, 2), where a half step
is 9.77e-4), at normalized and at pixel coordinates alike. The conformance case's 3.74e-4 stays.

Why: the catalogue changes with the behaviour it describes. The pixel-coordinate form beneath
this commit put those cases through the runtime, and their largest RGBA16Float difference is
above the listed figure. The normalized column of each case shows the same difference, so it is
the note's arithmetic, not the pixel form.

Verified: read from the bicpix lane's run m3-max-69926 on lavapipe at 86bea53a4e (the same tree
as these commits before their rebase): all 7 cases NotedDifference, the pixel column equal to the
normalized column on 64 of 64 lanes in the candidate and in Metal.
2026-11-22 22:54:13 -08:00
Anees Iqbal 12f8a9f06a Identity domains: a bicubic sample at pixel coordinates
The identity domains refused every function that samples a 2D texture through a bicubic
constexpr sampler at pixel coordinates ("a bicubic filter at pixel coordinates"), though its
lowering is the normalized sample's with no position step: a pixel coordinate is already in
texels, so the emulation reads the coordinate itself, the level-0 size by OpImageQuerySizeLod of
the bound image (which under the identity domains is the slot's set-1 element), and the format's
treatment from the slot's PushField::BicubicTexels, as at normalized coordinates. Nothing in it
reads state the identity domains do not source, so the refusal goes: SamplerPlan::bicubic_pixel
and BICUBIC_PIXEL_FORM are deleted. Metal's front end admits pixel coordinates only with clamping
modes (MSL 2.10), and a mirrored axis at pixel coordinates stays refused by bicubic::check, as on
the resident-table domains. A bicubic sample of a 1D texture keeps its own refusal.

The runtime README's known gaps and docs/API.md no longer list the form.

No SEMANTICS bump of its own: 2278, beside the shared bicubic switch fix, covers both.

Metal reads the two forms alike: in the committed M3 observations of the three bcu_address cases
(macOS 26.7 and 27.0.1), the clamp-to-edge and clamp-to-zero samples at pixel coordinates equal
the same samplers' samples of the same point at normalized coordinates, bit for bit, on 64 of 64
lanes each. The sample keeps PrecisionNote::BicubicFilterArithmetic, as at normalized
coordinates.
2026-11-22 22:54:11 -08:00
Anees Iqbal 64be1d50ae Conformance coverage: regenerated for the float depth upload's ledger rows
The ledger has ten fewer rows (18 dropped, 8 added), and one more module (format_copies)
declares a notice. Generated by scripts/conformance-coverage/coverage.py at 72e5c3e571
(m3-max-69942).
2026-11-22 22:40:56 -08:00
Anees Iqbal 4551aa9f3c Float depth upload note: names what each measured device keeps
The note RestrictedDepthUpload and the runtime README's known-gap line now say what
the upload kept on one card per vendor, under the validation layer 1.4.363.0, on a
Private 4x4 Depth32Float filled by a blit's copy_from_buffer with 16 values:

- NVIDIA 620.70.06 (RTX 3090, m3-max-69834) kept every value bit for bit and
  compared it unclamped, as Metal does.
- RADV, Mesa 26.2.6 (Radeon 780M, m3-max-69832), and ANV, Mesa 26.2.6
  (Iris Xe, m3-max-69833), clamped to [0, 1]. NaN of either sign, -inf, negatives,
  denormals and -0.0 became +0.0, and +inf with values above 1 became 1.0.
  Comparisons followed the stored value.
- The validation layer reported none of these copies.

The note's line "a value within [0, 1] is copied exactly" now excepts a denormal
and -0.0, which RADV and ANV store as +0.0.

Docs only: artifact.rs, the runtime's texture.rs, docs/API.md, the runtime README.
2026-11-22 22:40:56 -08:00
Anees Iqbal aae58c6acb Runtime: an upload into a 32-bit float depth is the device's copy, under a static note
What: replace_region, upload_region and the blit's copy_from_buffer(_with_options) into a
32-bit float depth (Depth32Float, or Depth32Float_Stencil8's depth) no longer answer
Gap::FloatDepthUpload, which is gone: each is the plain vkCmdCopyBufferToImage into the depth
aspect, on every device, and carries Texture::FLOAT_DEPTH_UPLOAD_NOTE
(PrecisionNote::RestrictedDepthUpload, metal2vulkan-degrade-restricted-depth-upload). A value
within [0, 1] is copied exactly; one outside it is the device's, as
VUID-vkCmdCopyBufferToImage-pRegions-07931 leaves it without VK_EXT_depth_range_unrestricted,
which the runtime enables nowhere. No byte is read and no query chooses anything.

Translator: the new note's variant, codec tag (ARTIFACT_FORMAT_VERSION 592), validation's
allowance (unbounded), the conformance degradation (not native, as restricted-depth-range is
not) and docs/API.md's catalogue; RestrictedDepthRange's docs name the upload note.

Conformance: the rt side announces the note at each upload into a 32-bit float depth; the
compare cases declare it; heap_sizes' round trip writes depths within [0, 1] for Depth32Float.
2026-11-22 22:40:56 -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 d11697b000 Conformance: the twelve compute visible-table cases match Metal on the runtime
The replay on lavapipe (m3-max-69685, llvmpipe of Mesa 26.2.4) compares
every visible-tables-compute case exactly with the M3's recordings, so their
known-gaps rows, which recorded the runtime's Slot refusal, are dropped.
The six render-stage cases stay refused as recorded. CONFORMANCE-COVERAGE.md
is regenerated.
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 bbb3d53484 Runtime: a compute state's visible-function tables call the functions their entries hold
A compute pipeline state answers functionHandleWithFunction: for its linked
functions (the translator's FunctionHandle words), makes visible-function
tables (newVisibleFunctionTableWithDescriptor:) whose words sit in a Shared
block the runtime takes, writes their entries (setFunction:atIndex:,
setFunctions:withRange:) and answers each table's gpuResourceID. The compute
encoder binds a table at a buffer index (setVisibleFunctionTable:atBufferIndex:)
through its buffer path, and the command buffer keeps the words until it
retires. The device answers supportsFunctionPointers YES. An entry past a
table's size is Refusal::FunctionTableIndex and writes nothing.

The translator's bind module makes the table's header and entry offsets
public, so the runtime writes the layout the shader reads.

Tests: function_tables (device cfg) dispatches through tables of two orders,
a null entry, no entries, an unbound slot and an entry set after encoding,
and compares every word; the conformance rt side runs the compute
visible-table cases. Evidence is in the lane's jobs.
2026-11-22 22:11:28 -08:00
Anees Iqbal de764fc389 Translator: a threadgroup atomic at a constant offset outside the arena writes nothing and yields zero
The sibling of the out-of-arena load and store. An unchecked threadgroup atomic at a constant
offset outside the arena built an access chain past the arena's word array, which the builder's
range rule rejects, an internal error. It now writes nothing and yields zero, as a contained atomic
out of bounds does (`guarded`), decided by the same plain-constant test (`local::outside_arena`):
an atomic inside the arena, or at an offset that is not a constant, is unchanged. Metal leaves the
access undefined. docs/API.md's threadgroup bullet names the atomic too. No census row reaches it.
2026-11-22 21:53:53 -08:00
Anees Iqbal 0b1053f0cc Translator: a threadgroup load or store at a constant offset outside the arena is a zero load or no store
An unchecked threadgroup arena access whose offset is a plain constant outside the arena built an
OpAccessChain into the arena's word array with a constant index past its length, which the SPIR-V
builder rejects (OperandRule::Range), so the function failed with an internal error instead of
translating or refusing. Such an access lies outside every threadgroup object, which Metal leaves
undefined, so it is now decided at translation time as a contained arena's constant access is: a
zero load, or no store. The decision reads the offset and the arena's size as plain constants and
interns nothing, so every access inside the arena, and every module that built before, is
unchanged; an arena whose size is a specialization constant is never decided this way (its word
array has no constant length to break).

The shape: Apple's compiler, knowing t == 0 in a branch, writes tg[t - 1u] of a static
threadgroup array at arena offset 0 as element 0xFFFFFFFF, a wrapped arena offset of 0xFFFFFFFC.
It is the whole of the translation census's internal errors at da020e5d7b (18 functions in 4
libraries on all five profiles, kindcount's m3-max-69549): each a load of an i32 word from a
static [N x i32] or [N x float] threadgroup global through an inbounds GEP [0, 4294967295], in a
branch, on the arena's u32 words.

SEMANTICS_VERSION 2277: those functions' outcome moves from an internal error to a module.

Verified: probe m3-max-69624 (base da020e5d7b plus a report at the builder's range rule) found
that one site and shape for all 18 rows; probe m3-max-69654 reproduced the same internal error
from owned MSL. The new test drives a load and a store at element 4294967295 of a 64-word
threadgroup array through from_queries on four profiles, in an arena of u32 words and one of
float words, and checks L3 and the interpreter's answers (the load reads 0, no word takes the
store).
2026-11-22 21:18:45 -08:00
Anees Iqbal 75c3e49bd6 Conformance coverage: regenerated for the overlapping-copies row's new refusal
docs/CONFORMANCE-COVERAGE.md quotes each ledger row's reason; the row's words moved with its
refusal (python3 -I scripts/conformance-coverage/coverage.py).
2026-11-22 21:06:39 -08:00
Anees Iqbal c358d9afd7 Runtime: a copy between buffers takes any offsets and size, as plain Metal copies them
A guest's blit copy of 62,302 bytes at offsets 0 and 0 met Refusal::BufferCopyUnaligned. Apple's page
for copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size: asks for multiples of 4 on macOS,
but plain Metal does not stop or round such a copy: it copies every byte of the range and no other.
vkCmdCopyBuffer has no alignment rule for its regions, so the copy is its one region at the
offsets and size the call names, and the refusal is gone.

Measured with probe crates/metal2vulkan-conformance/probes/blit_buffer_copy_unaligned.m, one
universal binary (built in m3-max-69612), copies (source offset, destination offset, size) =
(0,0,62302) (0,0,1) (0,0,3) (1,0,8) (0,2,8) (3,5,4097) and the controls (0,0,64) (4,8,4096),
each between two Shared, two Managed and two Private buffers, every destination byte read back:
- Apple M3 Max, macOS 27.0.1 (26A434), job m3-max-69613: 24 of 24 exact with validation off
  (AGXG15CDevice), 24 of 24 exact under MTL_DEBUG_LAYER=1 (MTLDebugDevice), which printed only
  its banner and took every copy.
- AMD Radeon Pro 5300M and Intel UHD Graphics 630, macOS 26.7.1 (25G241), job m3-max-69614:
  24 of 24 exact on each, validation off.
Every command buffer completed with no error.

The variant, its basis line, its REFUSALS.md rows and its api_signatures.tsv line go; the runtime
README says what Metal measured. The conformance ledger's overlapping-copies row now holds the
overlap refusal its first copy meets (the alignment check ran before it). The consumer's checkout
names the variant nowhere (git grep BufferCopyUnaligned at reims-vgpu 6d83a5d4f8: 0 hits).

Test: every_device_copies_between_buffers_at_any_offset_and_size copies the six ranges between
two Shared buffers and reads every byte back; it fails without the change (the refusal).
2026-11-22 21:06:39 -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 6adfe028d8 Translator: a half vector joined from read lanes keeps their bits; 20 NaN ledger rows
The RTX 5080 Laptop's replay at 2953064a1c (NVIDIA 615.71.09, job m3-max-68835) read 34 sites of
attribute-format-fetches that known-gaps-rt.tsv does not list.

The 29 at attribute3 (`half2 h`, read as Half or Half2) were ours. The case's inputs there are half
NaNs: attribute_coding.rs's Half codes 0x7E01 and 0xFE01, at threads 9 and 10 in component 0 and 6
and 7 in component 1. Metal's recording returns every attribute3 input unchanged at all 29 leaves.
The 5080 differs at as many elements as there are NaNs (2 at Half, 4 at Half2), first at a NaN
(Metal 0x7e01, ours 0x7fff), and its largest difference, 32258, is 0xFE01 - 0x7FFF. That every
differing element is a NaN is read from the counts, the first element and the largest difference,
not from a full print. The kernel only reinterprets the fetched value (`bitcast <2 x half> to
<2 x i16>`), which the module's own contract keeps as the field's bits (PrecisionNote::
NativeNanEncoding: "a `half` stored back unchanged keeps its bits"), so no note covered it.

The cause: fetch::decode joins the lanes it widened with one OpCompositeConstruct. from_bits noted
each lane's bits, but narrow::known_bits looked through struct members and lane inserts only, so
the bitcast's to_bits found no bits for the vector and encoded it: the device's narrowing of the
device's widening. On NVIDIA a half NaN widens to 0x7fffffff (attribute0's answer on all three
NVIDIA cards) and narrows to 0x7fff. Mesa's widening keeps the payload and its narrowing gives it
back, so the Mesa cards showed nothing; the RTX 3090 and RTX 2080 (620.70.06) showed nothing either
(expected: that compiler folds the round trip; unverified).

The class, at the base: three product sites join half lanes whose bits are noted with a vector
construct and lose them there: the pulled fetch (fetch::decode, for a kernel's [[stage_in]], a
pulled vertex attribute and a post-tessellation attribute), math::unpack_float (air.unpack of the
11/11/10 float formats into half lanes) and chunk::from_words (a chunked bitcast's half lanes), and
one test-only one, the arith tests' own load of a narrow vector. Texture reads, ops::of_lanes_bits
and narrow::unpacked_from_bits widen the whole vector at once and note it; lane inserts were
already followed. So the fix is in known_bits, for the whole class at once:

- spirv::builder records the parts of every OpCompositeConstruct of an f32 vector
  (ModuleBuilder::vector_parts, FunctionBuilder::vector_parts), counted in the builder's
  footprint.
- narrow::constructed_bits: a vector constructed of parts whose bits are each known (noted, a
  constant's, or a lane of a vector's noted bits) has the construct of those bits. Nothing is
  emitted when a part's bits are unknown. known_bits tries it before the lane inserts.
- SEMANTICS_VERSION 2275 -> 2276: the modules of every such vector's store or reinterpretation
  change (the encode becomes the construct of the known bits). The golden table is re-blessed on
  development.
- docs/API.md's native-nan-encoding entry and NativeNanEncoding's doc name the vector join among
  the paths that keep a half's bits.

The other 5 sites (attribute0, the `float4` widening of Half, Half2, Half3, Half4 and FloatRG11B10)
are the device's own answer under device-nan-encoding, as the 3090's rows. The ledger takes each
card's rows from the replays of the round at 2953064a1c, named no wider than the card that ran,
each row's detail equal to what the replay printed and its text the template card's whose answer
it shares:
- RTX 5080 Laptop GPU (job m3-max-68835): every payload bit set (0x7fffffff), as the RTX 3090.
- RTX 2080 (NVIDIA 620.70.06, job m3-max-68939): the same 5 answers as the RTX 3090.
- "AMD Radeon 780M Graphics (RADV PHOENIX)" (Mesa 26.2.6): the PHOENIX run (job m3-max-68941) and
  the HawkPoint run (job m3-max-68942) print that one venue and answer as the RX 7900 XTX:
  0x7fc02000 for the halves, 0x7ffe0000 at 9 RG11B10 elements.
- "AMD Radeon RX 550 / 550 Series (RADV POLARIS12)" (Mesa 26.2.6, job m3-max-68993): the same
  answers as the RX 7900 XTX.
The 2080, 780M and RX 550 runs show no attribute3 site. docs/CONFORMANCE-COVERAGE.md regenerated
(ledger rows 7968 -> 7988).

Tests, each failing at the base's product code and passing with the fix:
- lower::arith::tests::narrow::a_constructed_narrow_vector_keeps_its_lanes_bits (interpreter):
  four decoded lanes, two beside the constants 0 and 1.0, and the harness's loaded vector keep
  0x7E01, 0xFE01, 0x7C01, 0xFDFF and the rest bit for bit, where the encode answers 0x7E00.
- tests::engine_kernel_stage_in::a_half_attribute_reinterpreted_unchanged_encodes_no_half:
  stage_in_fetch with Half2 and Half at attribute 3 holds no OpFConvert to a 16-bit float and no
  PackHalf2x16 on any committed profile, with each half form among them (Controlled, Converted,
  and Device, the profiles without shaderFloat16).

Verified:
- This change on 5f93a64342 (probe 73dead9f70, tree 56642f49), compile job m3-max-69015:
  the two tests against 5f93a64342's product code FAIL, with the fix PASS; fmt,
  signatures, clippy --workspace --all-targets --all-features -D warnings plain, under
  --cfg m2v_gpu and under --cfg m2v_cpu_icd, and workspace Rustdoc -D warnings exit 0; the
  metal2vulkan and metal2vulkan-air suites: 3348 tests passed, 22 skipped, peak 11.3 GiB.
- The tree at 8134bb4201 (on c38852d665; its crates/metal2vulkan/src and
  metal2vulkan-air equal 73dead9f70's), recheck m3-max-68965: against the base's product
  code the engine test reads "30 of 30 modules encode a half": every committed profile with Half2
  and with Half, one OpFConvert to 16 bits each, two PackHalf2x16 each on nvidia-pascal-linux and
  runtime-floor (no shaderFloat16). Compile job m3-max-68956 at 9f921a841c (the same translator
  code): the metal2vulkan and metal2vulkan-air suites 3348 passed, 22 skipped, peak 11.9 GiB.
  golden_hashes_match_the_table passed at SEMANTICS 2276 in both suite runs: 0 cells of those it
  compares on Linux moved, so no "bless due"; the cells that need metal-as are compared at
  development's bless.
- RTX 5080 Laptop GPU (NVIDIA 615.71.09), the conformance replay on rt: at 8134bb4201, job
  m3-max-68961, and at 73dead9f70, job m3-max-69047: exit 0, no unlisted site;
  attribute-format-fetches differs only at its listed rows (the 8-bit unsigned normalized
  formats' 1-ulp rows and the 5 new attribute0 rows), none of the 29 attribute3 sites differs,
  and "the 4607 row(s) above are exactly the open gaps known-gaps-rt.tsv expects on this venue".
- States-only play on lavapipe, 9 streams, every MODE line states-only: 8134bb4201 (job
  m3-max-69001) against c38852d665 (job m3-max-68979). In each stream both made the same render
  and compute states and pipelines (gb-3090-r2: 10643 render, 15299 compute, 568 pipelines;
  glbench-780m-r4-recnil: 3756, 484, 498), refused 0 and left 0 unattempted. 8134bb4201's
  translator code equals 73dead9f70's.
- Not run: the RTX 2080's, the 780M's and the RX 550's rows are as those cards' replays printed at
  2953064a1c; their replays with this change are the next round's. "The RTX 3090 shows nothing at
  attribute3" stays unverified.

The branch is rebased onto development after the jobs; the commits between 5f93a64342 and its
base change runtime files alone (crates/metal2vulkan-runtime), none of this change's.
2026-11-22 15:51:40 -08:00
Anees Iqbal 58e9267b6c Conformance coverage: the ledger rows the three cards' NaN answers added
docs/CONFORMANCE-COVERAGE.md regenerated by scripts/conformance-coverage/coverage.py after
edb361410a added fifteen ledger rows: the ledger count reads 7968 and the gaps table lists the
fifteen. Job m3-max-68716 at edb361410a failed only its coverage check on this document (the
conformance crate ran 1024 tests, and 1023 passed); its replay on lavapipe read 0 ledger drift.
2026-11-22 13:33:00 -08:00
Anees Iqbal 41b5038342 Player: a commit waits on the CPU for the backend's own surface fill before it goes
What: the replay player's surface backend keeps its last command buffer on its own queue, a
fill at a shape's making or the refill a picture owes at its first use (Surfaces::unwaited). The
stream's next commit waits for it on the CPU, once, before committing, counted as
surface_host_waits (an executed counter, and in the report's surfaces line). New test
a_surface_picture_fills_before_its_use_behind_another_queues_long_work plays the same picture
behind 256 dispatches over 4 MiB committed first on another queue, and checks the second
picture, one refill and one host wait. The runtime README's queue rule now says what Metal and
the code do: a command buffer sharing a tracked resource with an earlier-committed one of another
queue goes after it only once that one is submitted (the M3 Max rows of that section, jobs
m3-max-52432 and m3-max-52415), a cut command buffer that has begun counting as submitted until
its next piece waits for an event; an event wait holds only its own queue; the fence sentence
says what the code does, Metal's side measured only by jobs m3-max-52186 and m3-max-52188. Its
known gaps name a program that relies on commit order between queues for a shared resource with
no event or fence. docs/REPLAY-STREAM.md gives the wait and its counter.

Why: a_surface_picture_fills_its_shapes_at_their_first_use read the first picture's inverse on
the RX 550, the 780M, the Iris Xe and lavapipe at 62183f55af. On the RX 550, alternated in one
job (m3-max-68619), f979769faf passed 4 of 4 and 62183f55af failed 3 of 4, each failure reading
[239 223 207 64]x4 for [175 159 143 128]x4. The player fills an owed shape by a blit on its own
queue and relied on commit order alone to run it before the stream's kernel on queue #2. Under
the device's room the player's queue had turn 1 (its making fill still in flight) and #2 turn 0,
so has_room and rank sent the kernel's submission first; it took the upload of the first
picture's replace_region, as that upload's contract says, and the refill ran after the kernel.
At f979769faf room was per queue with no rank, so the refill went as it was staged. Metal's
hazard tracking orders such a pair only against work already submitted (the M3 Max rows above),
so the runtime owes no order there, and the player does what a program must: it waits for its
own fill, as the consumer's video paths wait on the CPU.

Verified (check tree 5c42e1bae6, this commit's code; this commit rewords the new test's doc
comment only):
- fmt, clippy plain / --cfg m2v_gpu / --cfg m2v_cpu_icd and workspace Rustdoc, all -D warnings:
  m3-max-68681.
- lavapipe under --cfg m2v_cpu_icd, LP_NUM_THREADS=1, m3-max-68682: with the fix, 129 of 129
  validation replay:: tests pass; with surfaces.rs of f21db0934c (the fix out, the test in), the
  original test reads [239 223 207 64]x4 (rt_replay.rs:2338).
- RX 550 (RADV POLARIS12), m3-max-68686 (archive m3-max-68684): both surface tests pass 4 of 4.
- The new test is not a forcing test. Without the fix it read the first picture in 9 of 9 runs
  started alone with --no-capture (m3-max-68698 one at 256 dispatches; m3-max-68707 four at 256
  and four at 1,024), and the right picture, failing only its host-wait count, in all 3 suite
  runs (m3-max-68682 at 256, m3-max-68711 at 1,024, m3-max-68717 at 1,024 run alone under
  threads-required). What tells those runs apart is not found. With the fix it passes in every
  run above.
2026-11-22 13:32:09 -08:00
Anees Iqbal f21db0934c Conformance: the stage-in cases' lavapipe answers, and StageInKind's doc no longer opens a list
The first replay of the stage-in cases through the runtime on lavapipe (llvmpipe, Mesa 26.2.4, job
m3-max-68623) compared every row the old refusal had hidden. stage-in-region-clamps was refused at
its one indirect row alone (its 27 other rows Metal's), attribute-format-class-crossings exact, and
twelve sites differed, each now a ledger row or a declaration:

- The three cases over stage_in_fetch_wide declare simdgroup-access-order, as the other cases whose
  kernels store at an index of the grid's width do: the runtime's pipelines note the store's
  SIMD-group access pairs on every device. It loosens the notices site alone.
- attribute-format-fetches, five normalized 8-bit formats, on every venue: the pulled fetch's own
  product of the code and its maximum's reciprocal, which DeviceVertexConversion's recorded bound
  computes one f32 ulp high of Metal's quotient at 126 of the 256 unsigned codes (127 reads
  0x3efeff00 where Metal reads 0x3efefeff).
- attribute-format-fetches, the half and RG11B10 formats, on llvmpipe: the device's widening keeps
  a NaN's payload (0x7fc02000, 0x7ffe0000) where Metal reads 0x7fc00000, under DeviceNanEncoding.
  Each GPU's rows follow from its own replay.

clippy refused StageInKind::IndexedStepRate's doc, whose second line began "1. ", a list item
(doc_lazy_continuation, the same job); it is reworded.
2026-11-22 13:07:16 -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 a1ca99880a Stage bound: a subgroup instruction weighs 64, the re-plan takes the lighter module, and a subgroup multiply-add's steps are one loop of paired shuffles
What:
- spirv::roll::bound_weight beside entry_weight: entry_weight with each subgroup instruction
  (OpGroupNonUniform*) counted as SUBGROUP_WEIGHT, 64. Only the stage bound reads it
  (stage_bound::emit); the roll keeps entry_weight as its trigger. ModuleStats::entry_weight
  carries it, so the runtime's in-process or helper choice reads it.
- The re-plan holds both plans and compares them. A kernel past the bound only as the widest pin's
  emulation is planned again keeping the pin: the re-plan takes the pinned module where it weighs
  less than the emulated one by the stage weight; otherwise the emulated one goes on. The other
  plan and module are dropped and their ledger share released.
- tile_mad on a subgroup tier: one vec2 shuffle carries a step's two b cells, one the a cells of
  steps 2m and 2m + 1 (one owner lane: owner_bits keeps bit 0 of k out of the a owner), and the
  dim / 2 step pairs are a DontUnroll loop, the sums in Function variables. Each step reads the
  same cells and accumulates in the same Fma order. The emulated tier is unchanged.
- SEMANTICS_VERSION 2273 -> 2274.

Why: a driver's compile grows with a subgroup instruction far faster than with any other. A
kernel of entry weight 24,814 holding 3,772 subgroup instructions passed 6 GiB compiling on an
RTX 3090 (NVIDIA 620.70.06; job m3-max-67936), where the bound's 39,014 kernel grew 148 MiB. Under
the term it leaves the process; with the cut its module (22,238 instructions, 644 subgroup
instructions, bound weight 62,810) filled in the helper at 2,699 MiB of the consumer's 3,072 MiB
cap in 59 s (m3-max-67936): a thin margin. On the Iris Xe of RPL-P its pinned module, which the
re-plan took whatever it weighed, met the helper's memory (killed at 6,144 MiB, m3-max-67973);
now the emulated module (46,491, no subgroup instruction) goes on, against the pinned one's 56,163
with the cut, and filled at 792 MiB in 18.8 s (m3-max-67863).

Verified:
- Census, states-only (each play's MODE line read): the nine standard streams on the RTX 3090's
  and the Iris Xe's profiles (m3-max-68045, 68047, 68087, 68100, 68101, 68132): 259 distinct
  kernel modules a card, none holding a subgroup instruction, no re-plan, and no pass, render
  stages included, that holds one; a recorded pass on the RX 7900 XTX (m3-max-68146): 819
  compute states, none. The weigh tables of four staged kernels and a 63-kernel library on both
  profiles, no driver compile (m3-max-68033, 68034): on the RTX 3090 two kernels cross, that of
  24,814 and one of 7,470 (615 subgroup instructions, 46,215), which fills in the helper at
  1,011 MiB (m3-max-67690); on the Iris Xe only the kernel of 24,814 re-plans. The library's ten
  kernels past the bound today hold no subgroup instruction.
- Bit-equal and run time: the owned stage-bound fixture (512 multiply-adds a simdgroup, compiled
  by Apple's metal) through the harness, before (development 951285e7a7) and after, the arms
  alternating, 3 rounds of 200 runs, every kernel in the process. Output digest f0794c86d4c553e1
  in every round of both arms on the RTX 5080 Laptop (NVIDIA 615.71.09; m3-max-68191), the RX
  7900 XTX (RADV, Mesa 26.2.6; m3-max-68202) and the Iris Xe (ANV, Mesa 26.2.6; m3-max-68203).
  Steady time, before -> after: RTX 5080 2,781 -> 2,356 us (-15%); RX 7900 XTX 1,856 -> 653 us
  (-65%); Iris Xe 58,962 -> 11,600 us (-80%: there the re-plan now takes the emulated module,
  113,727, over the pinned one, 134,101).
- Translation of the kernel of 24,814, GPU-free (DeviceProfile::compile_entry, the arms
  alternating, m3-max-68190): on the Iris Xe's profile, where both plans are held, 39.0-40.3 ms
  -> 43.3-43.4 ms, ledger peak 11.9 -> 15.8 MiB, resident growth 15.3 -> 20.2 MiB, work units
  823,737 -> 899,773; on the RTX 5080's and the 780M's profiles, no re-plan, 23.5-24.6 ->
  23.4-23.9 ms, ledger peak 7.3 -> 7.0 MiB. Within 20 s and 500 MiB.
- Tests: the_stage_bound_fixture_takes_the_lighter_module_or_states_its_weight (was
  ..._keeps_the_pin_or_states_its_weight): on the Iris Xe's profile the fixture's pinned module
  is under the bound by the entry weight and heavier than the emulated module by the stage
  weight, and the emulated module goes on. With the pin taken whatever it weighs it fails (left
  (Direct, 0), right (Emulated, 1); m3-max-68214). The other two widest-pin tests weigh by the
  stage weight; only_divergent_multiply_adds_ballot_their_lanes counts the loop body's 3 bit
  extracts a multiply-add where the written-out steps held 16.
- clippy --workspace --all-targets --all-features clean; the product suite 3067 of 3068
  (m3-max-68180), the one failure golden_hashes_match_the_table: 176 cells of the matrix and
  multiply-add fixtures move, re-blessed on development.

Docs: the runtime README's "Kernels past the stage bound" (the 64 and why, the re-plan's rule),
docs/API.md's entry_weight, ModuleStats::entry_weight, the stage bound's module docs and the
fixture's MSL comment.
2026-11-22 10:18:19 -08:00
Anees Iqbal 10f83b636d Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-22 10:16:32 -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 c87452da05 Validation: the device tests the own-context executor ran assert what the runtime route does
The own-context executor's deletion pointed six device tests at the runtime route, and on
lavapipe (m3-max-67674) they failed: the route draws one library's stages with a generated
companion, and the runtime compiles under the identity domains. Each now asserts what the runtime
route does, or goes where the route cannot express it:

- a_loaded_pointers_buffer_written_past_its_end_is_refused_uncontained (was ..._is_guarded):
  under the identity domains a loaded pointer is used as given and no check bounds it
  (docs/API.md, section 1), so the run refuses the target, Uncontained naming LoadedPointer.
- cube_and_cube_array_face_reads_are_refused_under_the_identity_domains (was
  cube_and_cube_array_faces_read_the_authored_layers): the translator refuses texture_ops.ll's
  cube_faces under the identity domains (Unsupported{IdentityDomains}, NotImplemented, for the
  cube argument read by face).
- an_index_past_a_one_layer_pass_renders_the_pass_s_slice: the same slice, with no withheld
  validation message (the runtime route withholds none).
- a_constant_fragment_colors_the_quadrant_metal_draws, a_vertex_varying_reaches_the_fragment_stage
  and a_looping_fragment_draws_as_compiled go, with their helpers: each draws a vertex and a
  fragment function of two owned libraries with no companion, which only the deleted executor
  drew. Metal's y-up quadrant stays asserted by
  an_observed_vertex_case_draws_into_its_generated_observer (QUADRANT, top_right); a pipeline of
  two libraries' stages is compared with Metal by the conformance case shader_stencil. A varying
  across two libraries by its user key, and a looping fragment drawn as compiled, have no
  runtime-route test now.

docs/CONFORMANCE-COVERAGE.md is regenerated (python3 -I scripts/conformance-coverage/coverage.py):
the rate-map modules no longer declare the notice, 44 modules to 41.

Verified: the coverage script's output; the device tests are not yet rerun (the check job follows).
2026-11-22 07:37:15 -08:00
Anees Iqbal b5916b2f7b Translator: four public items nothing produces or names go: the replay fault report, the rate-map note, two rate-map errors and the rate-map axis
Four of the eight findings on the binder's public surface, the ones no plan reaches:

- (3) `bind::ReplayFaults`, with `StatusReport::replay_fault` and `replay_faults`,
  `StatusBits::REPLAY_FAULT` and `StatusWord::ReplayFaults`: no module writes the word or the
  bit. `StatusWord::SeqCstFences` keeps index 3, so no module changes; word 2 is now one nothing
  writes.
- (5) `PrecisionNote::RasterizationRateMap`: no module or runtime path records it (the decoder is
  Apple's arithmetic, and the runtime draws no rate-mapped pass). Its API.md catalogue entry goes,
  and so does conformance's `Degradation::RasterizationRateMap` with the notice allowances of the
  three rate-map families, whose runtime side refuses every rate-map call (`Unavailable`,
  known-gaps-rt.tsv), so the allowance never applied. Validation's c3 list of deferred
  near-equivalents drops it, and its tests use `SparseResidency` instead. The translator's
  rate-map tests drop their assertions that the note is absent.
- (6) `RateMapError::NoLayers` and `LayerCount`: only the test support `from_layers` made them; it
  now panics on a count no test passes.
- (7) `RateMapAxis`: in no public signature; now crate-private.

The codec encodes a precision note by its name, so no other note's encoding moves. No refusal in
docs/REFUSALS.md changes (refusal_surface.py --check passes as is).

Consumer search at reims-vgpu development cae6d420df, `git -C ~/Projects/steelbrain/reims-vgpu
grep -n -w ITEM development -- '*.rs'`:
  ReplayFaults 0, replay_faults 0, replay_fault 0, REPLAY_FAULT 0, StatusWord 0,
  RasterizationRateMap 0, Degradation 0, RateMapError 0, NoLayers 0, LayerCount 0, RateMapAxis 0.

Left for later, with the census's re-record: two authored cases' rationales (shard_013, lines 33
and 34) still say the decoder's answers carry the note.

(cherry picked from commit b68324630b4c8446d7fe730b3877b31727546d1c)
2026-11-22 07:37:15 -08:00
Anees Iqbal b92c74e489 Translator: a render or mesh pipeline compiles only as the runtime compiles it; validation stops compiling for a bind shape
`Device::compile_render_variant` and `Device::compile_mesh_variant` leave the public API.
The runtime renders under `VariantKey::new()` alone, and since the census compiles as the
runtime does, the only callers left were validation's bind-shape compiles: the
`PipelineRequest::BoundCompute` request, the `shape` of `VertexDraw` and `Draw`, and
corpus-pipeline's `--pulled` sweep (its `Projection`). Those go with them.
`compile_render_pipeline` and `compile_mesh_pipeline` compile under `VariantKey::new()` as
before, and `compile_render_pipeline`'s doc now carries the call-stack sentence the variant's
doc held. The crate's own tests keep a test-only `compile_render_variant`.

In validation the kernel compile the census and L4 share (`variants::compile_kernel`) stays,
with its partial-simdgroup test now comparing against explicit plain and emulated compiles.
The binder's shape-compile loop moves under `#[cfg(test)]` (`variants::bound`) for the binder
tests that still plan a kernel until the binder goes. The draw test helpers compile as the
runtime does. The worker's bound-compute exchange test goes, and its linking test sends a
`Kernel` request.

Nothing here changes what plan_for is given or returns: the census's artifact digest still
plans the same pipeline for the same shape.

Consumer search at reims-vgpu development cae6d420df:
  git -C ~/Projects/steelbrain/reims-vgpu grep -n -w compile_render_variant development -- '*.rs': 0
  git -C ~/Projects/steelbrain/reims-vgpu grep -n -w compile_mesh_variant development -- '*.rs': 0

api_signatures.tsv drops the two records.

(cherry picked from commit 15766b53448bafc7cd16d9acd335dd3d4c45d734)
2026-11-22 07:37:14 -08:00
Anees Iqbal cd5d336782 Validation: the own-context executor goes; a case runs through the runtime or is refused before it runs
After the profiles layer moved onto the runtime route, kernel rows went through the runtime, and the
layered cases moved too, nothing called validation's own Vulkan executor. This deletes it:
candidate/platform's compute, render (and its multisampled half), plan_resources, buffers and
multisample modules, the own-context device's clamped-layer, extended-dynamic-state, restriction
and environment machinery, the engine's compile_case / compile_render(_case) / compute_request
plumbing, the bind refusal and status verdict it read, the synthetic guest addresses, the attempt's
creation ceiling, and coverage's module census of its own compiles. corpus-pipeline's Vulkan
context for its render rows, and the runtime probe's, stay.

A render case the runtime route does not draw (a depth/stencil attachment of both aspects, a patch
draw through a patch or control-point index buffer, an out-of-bounds target other than an attribute
buffer) is refused not_supported{executor_not_implemented} before it runs, as run_prepared already
did once the gates were gone. The comments and docs/VALIDATION.md that compared with the own
context now say what the runtime route does.

Test-only items move beside their tests: Mechanism's label into the out-of-bounds tests,
Containment::of_compile, its label, Declared and ExecutionClass::of_description into the tier
table. The linked-functions integration test compiles through kernel_request, as the census does.

Deleted tests and what covers their Metal claim:
- a_kernel_runs_with_its_linked_visible_functions: a_kernel_runs_through_the_runtime_with_its_
  linked_visible_functions (engine_compute.rs), kept.
- a_draw_restarts_exactly_its_strips_within_its_class: the conformance case
  primitive_type_crossings compares strip restart with Metal.
- a_combined_depth_stencil_format_moves_both_aspects_together, a_draw_covers_the_whole_target,
  a_guarded_buffer_counts_each_changed_guard_byte, a_target_is_bound_for_its_fetch_form,
  every_state_a_render_pipeline_makes_dynamic_is_recorded,
  multisample_initializers_are_vulkan_legal_for_each_component_class,
  addressed_allocations_take_metal_addresses, the_status_starts_zero_and_stops_non_evidence,
  the_clamped_layer_warning_fails_no_row_of_a_clamped_store_alone,
  a_context_has_the_extended_dynamic_states_where_the_product_reads_them,
  a_store_runs_through_the_binder_under_the_validation_layer,
  a_tessellation_pipeline_census_is_its_functions: the deleted executor's own mechanics, no Metal
  answer of their own.

metal2vulkan-validation is not published, so no consumer can reach a deleted item:
git grep -n -E 'metal2vulkan[-_]validation' development -- '*.rs' '*.toml' in the consumer's
checkout at a11528a7e2: 0 hits.

Verified: cargo check of the validation crate, all targets and features, plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd, clean (m3-max-67506, on the probe branch's identical diff); the dead-code pass
against the base finds only items whose users are macOS-only or tests the binder's deletion takes.
The compile job and the suites follow on this commit.

(cherry picked from commit 5808aaa769e3f44b1bd76dea486b2b150b15e92b)
2026-11-22 07:37:14 -08:00
Anees Iqbal d15ab4501c Validation: command-replay play --states-only yes plays the state records and presents alone, and the report's first line names the mode
A states-only play was a probe's environment variable (M2V_PROBE_STATES_ONLY, on a probe branch
that never lands): a tree without the probe played the streams in full and said nothing, so two
states-only plays of a translator change read as plays of nothing they were meant to check. The
mode is now an option of the validation player itself, --states-only yes|no (no by default), and
every report's first line names it: `mode full: every call` or `mode states-only: the device,
library, function and pipeline state records and the presents alone (--states-only yes)`. A
bad value is a bad command line (exit 2, `error states-only: ...` as that first line).

Player::states_only passes over every call but MTLCreateSystemDefaultDevice, m2v.deviceIdentity,
the newLibrary*, newFunction*, newDynamicLibrary*, newRenderPipelineState* and
newComputePipelineState* calls and m2v.present, the probe's set unchanged, so frames and the
recording range end where a full play's do and the pipeline states are made cold as a full play
makes them. A states-only play writes none of the matrix's judged metrics, since it runs none of
the work they count.

The completion-fix line keeps its place by itself, now after the mode line; its test reads it
there, and a new test reads the mode line for yes, no and a bad value. docs/REPLAY-STREAM.md
section 10 and the player's module doc and usage name the option and the line.
2026-11-22 07:32:38 -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 9675b50e75 Validation: corpus-pipeline makes every kernel row on one runtime device per sweep
At f11d6455e0 each kernel row opened its own runtime instance and device
under the validation layer. A sweep of about 900 kernel rows made about
900 instances and devices. Each instance's layer also opened its own log
file and kept it open after the instance was destroyed: one file
descriptor a row (the 3090, job 67374: 5 descriptors to 24 over 20 rows).
The form the 1b brief asks for is one runtime device of the sweep's kind,
with each row's ComputePipelineState and its dispatch made on it.

candidate::RuntimeKernels is that device:
- open makes the instance (restricted where the process is) and the
  device. The validation layer's variables are set only while the instance
  is made (runtime::under_validation_variables), and the layer logs to the
  process's one log for the device's life;
- accept makes one row's state and encodes its dispatch, as before. The
  row's messages are what the log gained during the row, so a message
  still makes that row INVALID_USAGE;
- finish drops the device and waits for its teardown. A message logged
  at the teardown fails the sweep.
A message logged while the device opens stops the sweep before any row,
because no row on that device would be evidence.

corpus-pipeline opens it at the sweep's first kernel row, so a render-only
sweep opens none, and finishes it after the last row. Render rows keep
their own context.

runtime::opened is split into made_device and torn_down for the held
device; the per-row executors keep opened. create_runtime_kernel is
removed. The device tests make two kernel rows on one device.
2026-11-22 06:05:20 -08:00
Anees Iqbal 71f93243d9 Validation: an L4 kernel row is made through the runtime, its pipeline state and one encoded dispatch
corpus-pipeline asked the driver for a kernel row's compute pipeline at
the region the binder planned for one representative dispatch
(acceptance::dispatch), and tallied the binder's answer (BIND_REFUSED,
BIND_ERROR). That is not the pipeline a guest's kernel gets. A kernel row
is now made as a guest's kernel is made (platform::runtime_acceptance):
- the row's AIR becomes a runtime library, and its function is
  specialized with the row's function-constant values;
- one ComputePipelineState is made on the sweep's device, restricted to
  --profiles-layer's profile where one is given;
- one dispatch of one threadgroup of the state's thread execution width
  (or its maxTotalThreadsPerThreadgroup where that is fewer) is encoded
  into a command buffer that is dropped uncommitted, so the runtime picks
  the module that threadgroup runs on, asks the driver for its pipeline,
  and nothing executes.

The verdicts:
- The creation time is the runtime's own count of it
  (pipeline_creation_nanos).
- A message from the validation layer is INVALID_USAGE.
- A Vulkan error is REFUSED.
- The runtime's typed refusal (the translator's, a known gap, a limit) is
  RUNTIME_REFUSED, counted.
- A kernel the runtime runs as Metal's without effects, and makes no
  pipeline for, is NO_EFFECT, counted.

The row still compiles in its compile worker first, for its words, its
outcome, --compile-only and --keep-modules. The make runs in the sweep's
process, held to the per-attempt ceilings (runtime::within_ceilings).

Removed:
- acceptance::dispatch (plan_compute_row, ComputeCreation, NoCreation,
  BinderAnswer);
- RowCompile::Binder and UnmodelledKind::Dispatch;
- the tally's bind_refused and bind_errors, and the detail's
  imageblock=WxH;
- the own context's compute arm of create_acceptance_pipeline, which now
  takes a render pipeline, with its region test.
The summary line's bind_refused= and bind_errors= become
runtime_refused= and no_effect=.

What is lost: L4 kernel acceptance on Mesa's drm-shim drivers (RADV, ANV
and NVK), which stood for hardware we do not own. The runtime does not
open those devices, so the rung runs on lavapipe and the real cards
only. NVK is lost entirely: the shim was its only venue, and it never
ran here.

Committed rows removed: none. No L4 row is committed. Counted by
environment over corpus/observations/vulkan and observations/refusals at
bcc88a43cf, there are 55 rows in 6 environments (the 780M, Iris Xe,
RTX 5080 Laptop twice, lavapipe twice), and none is from a drm-shim
environment.
2026-11-22 06:05:19 -08:00
Anees Iqbal 9a01f1e8ee rt: an observer's dispatch runs its partial-threadgroups variant only where the variant's threadgroup memory, its vote word included, is within the device's limit
6453edbea7 and f090d99c9a run an observing kernel's whole grids, threadgroup
dispatches and indirect dispatches on its partial-threadgroups variant wherever
the threadgroup is whole groups of the variant's SIMD multiples. The variant's
predicated walk adds a 4-byte vote word of threadgroup memory
(RuntimeFact::PredicationVote, stated for a barrier in a loop) that the plain
module does not hold, and decide() did not count it. So a dispatch whose
threadgroup memory came within 4 bytes of maxComputeSharedMemorySize ran before
5205d18d12, and has been refused as Limit::ThreadgroupMemory since.

decide() now takes the encoder's threadgroup memory lengths and the device's
limit. It moves such a dispatch to the variant only where threadgroup_memory()
accepts the variant with those lengths. Otherwise the dispatch runs the plain
module, as it did before 5205d18d12. This is the fallback decide() already takes
for a threadgroup the variant cannot take, decided per dispatch from the
dispatch's own lengths against a Vulkan limit, so it adds no form. The make-ahead
and prepare_dispatch decide through the same call (Compiled::dispatched, with no
lengths at the make), so a state makes one pipeline: the variant's where its
static memory with the vote word fits, and the plain module's where it does not.
Ragged grids are unchanged: they took the vote word before, and they are refused
as before.

The test uses two observers, each with two barriers in a loop of four
iterations:
- vote_static declares the limit's bytes less 12. Metal reports that as the
  limit to the byte, because staticThreadgroupMemoryLength rounds up to 16, while
  the translator's arena with the vote word fits, so the variant is lowered. Its
  state at requiredThreadsPerThreadgroup 64 must make the plain module's pipeline
  with the state. A declaration of the limit itself never reached the variant:
  the translator refuses that variant at lowering (lower::simd::divergent).
- vote_length takes its region from the encoder, at the limit.
For each, a whole grid, a threadgroup dispatch and an indirect dispatch run on
the plain module, answer the program's words, and are not counted in
partial_variant_whole_grids. A ragged grid is refused as Limit::ThreadgroupMemory
at the limit plus 4.

Where a guest meets it, this is the consumer's answer, read from its code at
8566693615 and not measured:
- The guest reads maxThreadgroupMemoryLength = min(32768, the device's
  maxComputeSharedMemorySize).
- The validation profiles state 65536 for the 780M, and 49152 for the Iris Xe
  and the RTX 5080.
- Not on record per card: the RX 550 and the RX 7900 XTX (65536 by RADV's GFX7+
  value), and the RTX 3090 (49152 by NVIDIA's value; there is no Ampere profile).
- On those devices a guest that keeps to its 32768 bytes reaches at most
  32768 + 4, which fits.
- The one exposed host class is the Mac on KosmicKrisp, if KosmicKrisp states
  32768. That figure is pending: the consumer reads it with vulkaninfo.
The fix stands either way, because the runtime checks against the device's own
limit.

How it is verified: the test is expected to fail at 1133f4290a with only this
commit's test added, and to pass here, on lavapipe. The jobs are in the lane's
report. The test also runs on the round's card legs.
2026-11-22 05:44:19 -08:00
Anees Iqbal f090d99c9a rt: an observing kernel's indirect dispatches run its partial-threadgroups variant too
decide() moved an observer's whole grids and threadgroup dispatches onto the
partial-threadgroups variant but left its indirect dispatches on the plain
module, so a state dispatched both ways made a second VkPipeline of the same
size on the first indirect dispatch. By the translator's dispatch regions
(lower::dispatch), an indirect dispatch states region[1].xyz = 0 and takes
the single-region form, and the variant's partial answers sit only under
region[1].w NONUNIFORM, which the encoder's indirect region never sets. So
the variant runs it unflagged, every invocation live, as it runs a whole grid.
decide() now drops the direct-only condition: one module and one VkPipeline a
size run every dispatch of an observing kernel where the variant takes the
threadgroup. Metrics::partial_variant_whole_grids counts the indirect ones
with the whole grids. No key, version or translator file changes.

Tests: the observing kernel's run table expects its indirect dispatch on the
variant (one first-use wait fewer where it shares a size with a direct
dispatch, and one more count); prepare_dispatch's table gains an indirect
dispatch at the whole grid's size that finds the variant made (0 makes; 1
before this change); the variant-key table groups the indirect dispatch with
the direct ones. The conformance case compute-indirect-threadgroup-grid
dispatches region_k, an observer, indirectly; its dispatch-forms line is the
check that the replay ran it on the variant.

Checks to run on this commit: tests::translate and the conformance replay on
a card per vendor.
2026-11-22 05:00:09 -08:00
Anees Iqbal 6453edbea7 rt: an observing kernel runs its whole grids on its partial-threadgroups variant, one VkPipeline a size for every direct dispatch
A kernel that observes its threadgroup partition made two VkPipelines for one threadgroup size:
the plain module's for whole grids and threadgroup dispatches, and the partial-threadgroups
variant's for ragged grids. The variant already runs a whole grid as the same regions unflagged
(lower/dispatch.rs), so decide() now sends every direct dispatch the whole module would run to
the variant where the variant is lowered and takes the threadgroup whole SIMD groups. Indirect
dispatches, a refused or failed variant, and a threadgroup that is not whole SIMD groups of a
kernel that runs only whole ones (the emulated route) keep today's module. A state with a
declared bound or a required size makes one VkPipeline ahead instead of two.

Metrics::partial_variant_whole_grids counts the whole grids that ran the variant; the player's
executed counters and the conformance runner print it.

Nothing re-keys: the translations are unchanged (the plain module is still lowered: its
interface numbers the samplers, answers Metal's state and runs indirect dispatches), and no
version moves (metal2vulkan-runtime is outside RUNTIME_VERSION's inputs).
2026-11-22 04:37:34 -08:00
Anees Iqbal bcc88a43cf Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-22 04:03:16 -08:00
Anees Iqbal bda5ed08e9 rt: a resolve into a texture in place over a buffer whose linear image cannot render goes through a resolve image
For the consumer: a pass that resolves into a texture in place over a buffer of the runtime's
own memory, whose linear image takes no colour attachment usage, is no longer refused with
Gap::RenderPass{ResolveUsage}. It resolves into the texture's resolve image, and the pass's end
copies the render area into the buffer at the texture's pitch. This is the guest's 600 x 600
BGRA8Unorm_sRGB ShaderRead texture over a Managed buffer, on every NVIDIA host and on KosmicKrisp:
their linear tiling features hold COLOR_ATTACHMENT for no format (count jobs m3-max-67031 and
m3-max-67032), and a pitch of the row rounded up to the alignment answer (128 and 16) lies in place.
It also covers a texture whose subresource reaches past its own rows or its buffer (the render-reach
rule), on every device. Additive public items: Metrics::resolve_copies and resolve_copy_bytes (in
bytes_copied too), Gauges::resolve_images and resolve_image_bytes. Still refused: a texture in place
over a dma-buf's import (an imported surface's memory) and a view of a texture in place.

Why this form: owner's rule 3 allows "where a format query offers no linear image for the format and
usage, a counted copy", the sentence OverCause::LinearFeatures and RenderReach already rest on for a
render target over a buffer. This is the smallest such copy: one per resolve, of the render area
only, and nothing on later uses. The texture stays in place, so shaders keep reading the buffer's
bytes through its linear image. The planner chose it over moving the texture to the copy form at
its first resolve (2,880,000 bytes per resolving pass, then a copy in every submission that uses
it).

How:
- texture.rs: the in-place texture's Image keeps a Resolving where it lies in the runtime's own
  memory (Laid::Own), its linear image took no attachment usage, and its plan's optimal image does
  (Plan::resolves, the image format query that already made it with COLOR_ATTACHMENT). The first
  resolve makes the resolve image from the texture's plan (Plan::resolved, Bind::Pooled) and a 2D
  identity view of it. Every later resolve reuses them, and they are freed with the texture
  (Free::Resolved, the resolve images gauges). resolve_attachment returns the attachment and, for a
  resolve image, a ResolveCopy: the VkBuffer of the bytes shaders reach and the region at the
  texture's pitch. That is Named::region, the region copied_over already built, now shared. A level,
  slice or layer count past the texture's one is Refusal::AttachmentPlace, as attachment_view
  refuses it.
- pass.rs: Resolve carries the copy. Its image's home is TRANSFER_SRC_OPTIMAL and it renders in
  ATTACHMENT_OPTIMAL. Resolve::from moves it away from UNDEFINED: the pass resolves every texel of
  its render area and copies only those, so nothing it held earlier is kept.
- render_encoder.rs: after the pass's back barrier (which moves the image to TRANSFER_SRC_OPTIMAL),
  end() records vkCmdCopyImageToBuffer of the render area (Pass::reach) into the buffer at the
  texture's pitch. It counts the copy and owes the pass's barrier, so the next command, or the
  segment's end, orders the copy before later work. bufferOffset is a whole number of texels, which
  check_over already requires (VUID-vkCmdCopyImageToBuffer-srcImage-07975; the multiple-of-4 rule,
  07978, is depth and stencil only). The block's buffer has TRANSFER_DST.

Readable through the linear image: the copy writes the buffer, and a later pass reads the same
memory through the texture's linear image. Vulkan 12.11 Memory Aliasing says "If two aliases are
both host-accessible, then they interpret the contents of the memory in consistent ways, and data
written to one alias can be read by the other alias". Buffers, and linear image subresources in
GENERAL or PREINITIALIZED, are host-accessible. The in-place form already rests on that sentence:
its linear image starts preinitialized and stays GENERAL through every use, copies included
(Image::copy_layout, "so that it and the buffer are aliases that interpret their bytes alike
(Vulkan's memory aliasing)"). The order between the copy and the read is the owed barrier, a memory
barrier from every command to every command.

Docs: RenderPassKind::ResolveUsage, the resolve texture's doc, resolve_attachment's and resolve()'s
docs, and the pass module say what resolves through the resolve image and what is still refused.
The runtime README's two Render encoders paragraphs and its counters list are updated, the card
names under "measured on". docs/REFUSALS.md is regenerated (two more AttachmentPlace sites, in
resolve_attachment), and so is the signatures table (the four new fields).

Test: every_device_resolves_a_loaded_pass_into_a_shader_read_texture_over_a_buffer runs the
guest's shape over a Managed and over a Shared buffer, at 2,400, at the row rounded to the alignment
answer, and at 2,560. On an in-place row whose linear image took no attachment usage, it asserts:
- the first resolve makes exactly one image;
- one resolve copy of 1,440,000 bytes, and bytes_copied equal to it;
- the buffer reads the clear within one code, with 0 bytes past the texels changed;
- a pass after it in the same command buffer reads the texture at each pixel (own_pixel_fragment
  into a 600 x 600 target), its centre texel (299, 300) the clear within one code;
- a second resolve, in a command buffer of its own, makes no image and no allocation
  (image_creates, consumer_allocations), and the resolve images gauge does not grow.
The other rows are unchanged: in place with the usage, 0 copies; copied, counted copies. Every
gauge is zero at device drop (each_device). Without this change, the RTX 3090's in-place row at
2,432 is refused with ResolveUsage (job m3-max-67081 on the resolve fix's tree).
2026-11-22 04:02:28 -08:00
Anees Iqbal 0aab6200fb rt: a Managed buffer's device copy placed in an exported block is refused
Device::new_managed_buffer took a device copy in any Private block the consumer held, an
exported block included. The copy's zero fill and its copy-ins at Managed events write the block
through the runtime's own commands, and nothing marks those writes for the textures over the
block (over::ExportedOvers), so they wrote the block unseen. Metal has no way to ask for that
placement: it places a Managed buffer's second copy itself, so no Metal program puts it in memory
another API shares.

The consumer at reims-vgpu 0ec951ecaf makes no such placement.
- `git grep -n 'new_managed_buffer' 0ec951ecaf -- '*.rs'` gives 2 calls, both in
  rt_platform/buffer.rs:
  - At :1463 (own_managed) the copy is in a Private block taken for it.
  - At :1625 (range_of) the copy is in a block taken the same way, or at the `copy` known_at()
    found: a known block of class Private that holds the pin.
- `git grep -n -F '.know(' 0ec951ecaf -- '*.rs'` gives 7 lines. The known blocks come from
  take_block (pool/rt_blocks.rs:121, rt_platform/heap.rs:648 and :907), from page imports
  (rt_platform/buffer.rs:2429) and from tests (buffer.rs:3082, :3083 and :3635).
- None of these is an exported block. The one exported make (rt_platform/export.rs:208) is never
  made known.

The placement is now Refusal::ManagedCopyExported { block }, checked after
ManagedCopyNotPrivate, on a device that keeps a device copy. No existing kind fit:
ManagedCopyNotPrivate says the block is not Private, and an exported block is. Wiring the copy's
writes into ExportedOvers would need a mark at its zero fill and at each copy-in; one check is
smaller. The refusal is a public call's own
check of its arguments, so it holds on every device; on a device with unified memory the copy is
refused before it as ManagedCopyOnUnified.

With the placement gone, a Managed buffer's device copy is no longer one of the routes by which an
exported block's address goes out. The runtime README's exported block rule and the ExportedOvers
doc drop it. The README's Managed buffer paragraph and new_managed_buffer's Err list name the new
refusal. docs/REFUSALS.md, error/basis.rs and the signatures table are regenerated.

Test: every_device_places_a_managed_buffer_s_device_copy_where_the_consumer_says. On a device that
keeps a device copy, it also places one in an exported block of the first handle the device
exports, and asserts ManagedCopyExported naming that block. Before this commit that call returned
a buffer, so the test fails without the change (read from code: no check stood between the Private
class test and the buffer's make).

Verified (tree 3b87fced96, the same tree as this commit):
- Compile job m3-max-66867: signatures and refusal-surface checks, fmt, clippy (plain,
  --cfg m2v_gpu, --cfg m2v_cpu_icd), workspace Rustdoc -D warnings and scripts/api-docs all exit 0.
  The runtime suite on lavapipe: 642 tests run, 642 passed, 3 skipped. Lavapipe is a CPU device,
  so it keeps no device copy and does not reach the new check.
- The m2v_gpu archive is from job m3-max-66876. Each card ran the test, then the runtime suite:
  - RX 550, job m3-max-66896 (a rerun of m3-max-66891, whose log filter dropped the printed line):
    "managed placed: ...: a copy in a OpaqueFd exported block refused"; 644 passed, 3 skipped.
  - RTX 3090, job m3-max-66922: "managed placed: ...: a copy in a OpaqueFd exported block
    refused"; 644 passed (1 slow), 3 skipped.
2026-11-22 02:35:40 -08:00
Anees Iqbal 48d7ded3aa Validation: the authored compile census compiles as the runtime does, through no binding plan's variant
The census compiled each case's pipeline through the binder's variant route: a kernel under the
key its plan, and its plan's dispatch_variant, asked for (BindingPlan::variant), a draw through
compile_render_variant, a mesh draw through compile_mesh_variant, each with the storage-format
loop. It now compiles through the translator's public pipeline API the way the runtime does:

- a kernel through the new PipelineRequest::Kernel, compile_kernel: its plain module, or its
  emulated-simdgroups variant (LoweringInputs::kernel_variant) where the dispatch's threadgroup
  is not a multiple of a LocalSizeConstraint the plain module states, the runtime encoder's
  rule (encoder::decide);
- a draw with no shape (Device::compile_render_pipeline);
- a mesh draw through Device::compile_mesh_pipeline. The census was MeshDraw's only builder, so
  its shape field and compile_mesh_for_shape go.

The own-context executor (a profiles-layer run, a render case off the runtime) keeps its
requests (BoundCompute, a draw with its shape) under the resident-table domains, where its plan
asks for variants the runtime route does not compile.

The artifact still digests the plan of the compiled pipeline for the run's bind shape, as the
own-context executor records it (artifact::CaseArtifact::record).

Why: on the probe branch (m3-max-66743, 9 profiles, 20,997 cells), the only variant field the
plan ever set was emulated_simdgroups. Yet the census's old route kept the plain module for 33
kernel cases (174 cells on the six real-GPU profiles) whose threadgroups (1, 4, 8, 16, 40 or 42
threads) are no multiple of the plain module's LocalSizeConstraint { multiple: 32 }. The binder
refuses to plan each of them under the runtime's identity domains, so the old route's variant
step never ran. Every one of the 33 observes its threadgroup partition, so the runtime's whole
module is the plain one and its encoder runs the emulated-simdgroups module for those
dispatches. The new route compiles exactly that module (route probe 8468646957, census
m3-max-66936, every cell compiled: the 174 differ only in stage, dependencies and requirements).
So the census's cells for those 33 described a module no guest gets.

AUTHORED_COMPILE_CENSUS_VERSION 7 -> 8: the compiles a cell is made of changed route.

Verified:
- compile m3-max-66813 and suites m3-max-66814 at the lane's base a9c1a7d012: product 3880,
  validation 1335, conformance 1025, doctests, all green.
- the 33 cases through the runtime (executor runtime-compute, validation layer with
  synchronization validation) against the M3 Max's Metal rows (apple-m3-max-macos27.0.1):
  Radeon 780M 33/33 match (m3-max-66869, 66931), RTX 5080 33/33 (m3-max-66871, 66933), Iris Xe
  RPL-P 21/21 (m3-max-66870, 66932); 0 mismatch, 0 refusal. Not run on the Mac's Vulkan:
  validation runs no Vulkan candidate on macOS.
- that those runs took the emulated module is shown by code, not by a count: encoder::decide
  either runs it or refuses with Gap::PartialSimdgroups, and none refused.
- the census table is re-blessed at the next pin.
2026-11-22 02:35:39 -08:00
Anees Iqbal 85aa6c8dee rt: an exported block's BlockInfo states no device address, so its make hands none out
API change for the consumer: BlockInfo::gpu_address becomes Option<u64>. It is Some for every
taken, imported and sparse block, as before, and None for an exported block
(Device::new_exported_block). BlockInfo stays Clone + Copy. The only way to an address of an
exported block's memory is now Buffer::gpu_address of a buffer in it, which marks the block and
counts it in Metrics::exported_blocks_addressed as be1b2cfe46 built it. The consumer's reads of
the field fail to build until each one is reviewed. At reims-vgpu 095001ddc6,
`git grep -n -F '.gpu_address' 095001ddc6 -- 'crates/reims-vgpu-vulkan/src/rt_platform/*.rs'
'crates/reims-vgpu/src/pool/rt_blocks.rs' 'crates/reims-vgpu/src/platform/rt.rs' | grep -v
'gpu_address('` gives 39 lines. Some of them are the consumer's own structs; their types were not
checked one by one. The rt BlockInfo reads among them include:
- rt_platform/buffer.rs:793, the known-block map's key;
- pool/rt_blocks.rs:118 and :170;
- rt_platform/diag.rs:716;
- rt_platform/fault.rs:1405;
- platform/rt.rs:149.

Why: be1b2cfe46 counted the public make itself as handing the address out, because the Block
handle derefs to BlockInfo and BlockInfo's pub field stated the address. The consumer calls
new_exported_block for every buffer-form video cache (rt_platform/export.rs:208 at 095001ddc6). So
every such cache's textures stayed in the over-copy class from their make on. With no address in
the info there is nothing to read by accident. A bookkeeping read (a map keyed by address, a
diagnostics line) now fails to build instead of silently turning the bound off. The Option says
"this block has none", as contents: Option<NonNull<u8>> already does.

How:
- Memory::info() gives None where the memory is exported.
- new_exported_block no longer marks its block at the make. Its body was the crate's
  exported_block(), which only the copy form of new_exported_surface called, and the two are now
  the same; the wrapper is gone and the surface calls new_exported_block.
- No product code read the field. The runtime's tests and the validation crate's replay player
  read it only for taken and imported blocks, and now read the Option.

Docs: the field's doc and new_exported_block's doc, the exported_blocks_addressed doc, the
ExportedOvers doc, and the runtime README (Exported blocks, the address contract in Known gaps,
the exported block's rule in Textures over a buffer). The signatures table and docs/REFUSALS.md
(whose site column named exported_block) are regenerated.

Test: an_exported_blocks_texture_is_copied_in_once_a_change. The block's handle states no address
and the make counts 0. Then a new row on the block's own texture: three submissions that each read
it and then write through an address into another buffer copy it in [0, 0, 0], with 0 blocks
addressed. After Buffer::gpu_address on the buffer the texture is over, the count is 1, and three
more such submissions copy [0, 1, 1]. The surface row follows, with the store_through kernel's
state and buffers now made once for both rows.

Verified:
- Without the change: the base 015ece4929 product with this row printing instead of asserting, on
  lavapipe, job m3-max-66854. It printed "addressed at the make 1, rows [0, 1, 1] (addressed 1),
  then after the buffer's address [1, 1, 1] (addressed 1)". So the row fails without the change.
- Compile job m3-max-66851 (tree a9636bbcf8, the same tree as this commit): signatures and
  refusal-surface checks, fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), workspace Rustdoc
  -D warnings and scripts/api-docs all exit 0. The runtime suite on lavapipe: 642 tests run, 642
  passed, 3 skipped.
- The m2v_gpu archive is from job m3-max-66852. Each card ran the test, then the runtime suite:
  - RX 550, job m3-max-66873: 644 passed, 3 skipped, peak 0.96 GiB.
  - Iris Xe, job m3-max-66874: 644 passed, 3 skipped, peak 3.72 GiB.
  - RTX 3090, job m3-max-66875: 644 passed (1 slow), 3 skipped, peak 2.44 GiB.
  Each card printed "OpaqueFd block: copies in a submission that writes through an address, the
  block's address not out: [0, 0, 0], then out: [0, 1, 1]; blocks addressed 0, then 1". Lavapipe
  printed the same line in m3-max-66851.
2026-11-22 02:29:05 -08:00
Anees Iqbal 53dd17e008 Translator: delete VkFeature's RobustBufferAccess and RobustBufferAccess2, which nothing reads
The batch deleted the translator's choice between the driver's buffer robustness and the
in-shader check: every buffer access is checked in the shader, and no lowering reads
robustBufferAccess or robustBufferAccess2. The runtime enables neither (its floor table names
neither; robustImageAccess, robustImageAccess2 and nullDescriptor are its robustness features,
and robustImageAccess2 stays: memory::contain reads it for images). What still named the two was
the enable-set vocabulary around them, so it goes with them:

- VkFeature::RobustBufferAccess and VkFeature::RobustBufferAccess2, from the enum, its codec, the
  exposure table (Vulkan 1.0 core; VK_EXT_robustness2 keeps robustImageAccess2 and
  nullDescriptor), the Khronos reader's member table, the ash query's feature sources, and
  required_features (whose Vulkan 1.0 tier held robustBufferAccess alone and goes).
- The co-enable rules only they took part in: robustBufferAccess2 needs robustBufferAccess
  (VUID-...-robustBufferAccess2-04000, a FEATURE_NEEDS row), and the update-after-bind features of
  buffer descriptor types beside robustBufferAccess without robustBufferAccessUpdateAfterBind
  (VUID-VkDeviceCreateInfo-robustBufferAccess-10247: device::enables' crate-private
  BUFFER_UPDATE_AFTER_BIND and BUFFER_UPDATE_AFTER_BIND_VUID, and its branches in
  co_enable_violation and co_enabled). The multiview rules stay.
- DeviceDescription::robust_buffer_access_update_after_bind, which only that rule read, with its
  Khronos and ash readers and the Device's copy.

So a recommendation now keeps every update-after-bind feature a device lists: runtime-floor's,
which used to leave its two texel-buffer ones out beside robustBufferAccess, holds them, and a
device made from it compiles texture buffers. docs/API.md's section 2 and the enable-set docs
say that the recommendation names neither robustness feature, and that a consumer who enables
robustBufferAccess itself keeps VUID 10247.

The consumer's checkout (reims-vgpu development d80a432f3a, `git grep -n -w ITEM development --
'*.rs'`) names none of the deleted public items: RobustBufferAccess 0, RobustBufferAccess2 0,
robust_buffer_access_update_after_bind 0 (BUFFER_UPDATE_AFTER_BIND 0 and
BUFFER_UPDATE_AFTER_BIND_VUID 0, both crate-private). It names no VkFeature and no
DeviceDescription at all, so no glob import or re-export hides a hit.

No module changes: no lowering read either feature. Every committed profile's fingerprint moves
(each listed robustBufferAccess, a Vulkan 1.0 requirement), so every golden cell and every key
under one moves with it: bless-class, a changed fingerprint, no SEMANTICS bump. The codec names
a variant by its tag, so no other feature's encoding moves; an artifact naming a deleted feature
would sit under a fingerprint that no longer exists.

The tests follow: those of the deleted rules go (recommendations_keep_robust_buffer_access_and_
vuid_10247, a_recommendation_keeps_vuid_10247, both robust_buffer_access_update_after_bind
readers' tests); tests that ran every profile "with robustness and without" lose the leg that
was the same profile (engine_access, _atomics, _binder, _buffer_table, _copy, _dynamic_roots,
_gep_index, _index_words, _kernel_stage_in, _link, _pointer_memory, _pointer_values, _rate_map,
_skeleton), and the out-of-bounds cases those tests ran only on the bare leg (short stage-in
buffers, far rate-map coordinates, huge copy lengths, 8- and 16-byte leaves past the end) now
run on every profile; image robustness lists keep their two image features. Validation maps the
two members to no feature (registry names kept), its tier table's robustness-off leg removes
the image features alone, and its tests check the two members unset in the chain. The runtime's
tests stop naming them. profiles_both_encodings' second leg is now the profile unchanged; the
next commit removes it. api_signatures.tsv re-blessed (3 records gone); refusal surface
unchanged.
2026-11-22 02:05:42 -08:00