Commit Graph
923 Commits
Author SHA1 Message Date
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 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 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 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 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 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 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 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 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 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
Anees Iqbal 8ed044f2e8 Translator: a replay variant under the identity domains is refused, typed
The commit before this one placed the RootTableAddress a device-replay variant
(VariantKey::replay_bindings) reads its buffer slots' addresses from, so under the identity
domains the variant no longer ends in the internal error "a strategy reads the unplaced push field
RootTableAddress". Its message said the variant then compiles there; it does not. With the field
placed, the plan reaches select::identity_admits, whose admitted push fields hold no
RootTableAddress: the identity domains read no root table, and the variant is refused,
Unsupported{IdentityDomains} (NotImplemented) naming "an encoder value the function reads as
RootTableAddress". That refusal is the true answer: only the binder (bind/replay, bind/dispatch,
bind/graphics) asks for a replay variant, and the runtime, the one consumer of the identity
domains, never sets replay_bindings (no hit in crates/metal2vulkan-runtime/src). The refusal
site and its row are the existing ones, so docs/REFUSALS.md does not change.

So the tests say the refusal:
- pipeline::compile::tests::a_replay_variant_under_the_identity_domains_is_refused_typed (was
  ..._reads_its_root_entries): icb_render_replay_template, icb_render_stride_template under the
  pulled-vertex-buffer variant and icb_replay_template under the identity domains with replay
  bindings are each refused, typed, with that feature, need and symbol.
- tests::engine_device_replay::
  a_replay_variant_under_the_identity_domains_reads_its_slots_from_their_root_entries goes, with
  its module-doc paragraph: no such module is made.
docs/API.md section 5 now says the variant is refused there, and slot_address_field's comment
names the admission that refuses it.

Verified: before this commit, on m3-max-66628 (the product suite at 84c6726dd8, a
card-free host build), both item tests failed with exactly this refusal at the three compile
calls and the engine kernel; without the placement, m3-max-66629 (probe branch
steelbrain/halfmoves-probe-nofix2) failed both with the internal error, so the new test fails
without the placement. This commit's own run is the next compile job.
2026-11-22 02:05:42 -08:00
Anees Iqbal 46a9a57522 Docs: the runtime binds through no stage table; the validation executor sets its buffer ranges
docs/API.md section 5 said of StageTable::buffer_ranges "The runtime sets it on every table it
reads." The runtime builds no StageTable and reads no BindState: crates/metal2vulkan-runtime
names no StageTable, BindState, BufferRanges or buffer_ranges, and of the binder it takes only
alpha_test_code, SamplerDescriptor and AstcDecode. The tables that set it are the validation
executor's: every table its candidate engine builds for a compute, render or mesh case passes
through candidate::engine::lengths_classed with BufferRanges::of its profile's limits. The
sentence now says so.

Verified: grep over crates/metal2vulkan-runtime/src for those four names (no hit) and for
metal2vulkan::bind (the three items above); the validation builders read at
candidate/engine.rs, engine/graphics.rs and engine/mesh.rs, the one other StageTable there
(engine/variants.rs) inside a #[test]. Docs only.
2026-11-22 02:05:42 -08:00
Anees Iqbal 9df6908e36 Translator: a replay variant under the identity domains pushes the root table its slots are read from
Under the identity domains a device-replay variant (VariantKey::replay_bindings) ended in an
internal error, "a strategy reads the unplaced push field RootTableAddress": a vertex function's
buffer arguments, the attribute of the pulled-vertex-buffer variant and a kernel's buffers alike.

The variant reads each buffer slot's address from its replayed command's root entry
(access::replay_guest_base, which a replay variant's SlotGuestBase reads route to), and the
translator already holds it so: the address is not biased in a replay variant
(pointer::biased), and its accesses take no SlotBounds (access::identity_contained). But
place_slots pushed every device-address slot's SlotGuestBase under the identity domains, whatever
the variant, after plan_replay had replaced the selection's SlotGuestBase fields by
RootTableAddress. So nothing pushed the root table's address the derived reads load.

The field is placed: a device-address slot's push field is its own address only under the
identity domains outside a replay variant (slot_address_field), in place_slots and in the census
its spill decision reads, and the root table otherwise. No refusal changes, and no module of a
compile that succeeded before changes: the combination never compiled. The branch's one
SEMANTICS bump (2273, the half-move commit before this one) covers it. docs/API.md section 5
states where a replay variant's slot addresses come from under the identity domains.

Verification:
- pipeline::compile::tests::a_replay_variant_under_the_identity_domains_reads_its_root_entries,
  new: icb_render_replay_template, icb_render_stride_template under the pulled-vertex-buffer
  variant, and icb_replay_template compile under the identity domains with replay bindings,
  every buffer slot at its device address, RootTableAddress pushed and no SlotGuestBase or
  SlotBounds, every stage through L3.
- tests::engine_device_replay::
  a_replay_variant_under_the_identity_domains_reads_its_slots_from_their_root_entries, new: a
  kernel compiled so on every committed profile under the identity domains pushes
  RootTableAddress alone, and on the CPU interpreter reads and writes at the addresses its root
  entries name (guest plus bind_offset, 16 bytes into one buffer), above 4 GiB.
2026-11-22 02:05:42 -08:00
Anees Iqbal 4892518700 Translator: a half the lowering moves through a containment select or a candidate switch keeps its bits
A half moved without arithmetic must keep its 16 bits, a NaN's payload included: a move is not
the device's arithmetic, so no precision note covers it. bb44847705 fixed the contained load of
device memory. Four more moves the lowering makes itself lost the bits:
- the contained loads of the arenas (lower/access/local.rs) and of the constant blob (blob.rs)
  selected the decoded f32 with no bits note;
- the switch-at-use over a pointer's candidate buffers (emit.rs: the device buffers' switch and
  the blob-or-buffer switch) merged the arms' decoded f32 by a phi with no note.
A store of the moved half then re-encoded it by the device's narrowing. On the CPU interpreter
2045 of the 2048 all-ones-exponent patterns came back 0x7e00 (0x7c01 to 0x7e00, for example) at
each of the four, on every committed profile under the resident-table domains (job m3-max-66591,
the new test without this change).

One form for every move the lowering makes: the bits move beside the value and are noted for the
result, so a later narrow::to_bits returns them.
- A containment select is leaf::contained (bb44847705's narrow::select_zero) at every
  containment select of a leaf: device views and addresses as before, the arenas, the constant
  blob, and the pulled fetch's source read. The pulled fetch reads raw integer components and
  decodes a half after the select, so its output does not change.
- A switch merge: each arm carries its value's parts and their bits (leaf::carried, the bits
  from narrow::moved_bits: the bits noted for the value, else its to_bits), the merge's phis
  carry both, and leaf::merged notes each part's bits phi for its value phi
  (narrow::note_moved), chunk by chunk for a chunked vector.
Where the moved value is stored unchanged, the f32 select or phi and the decodes are dead and
leave the module; where it is computed with, the bits ones are.

Not changed: a leaf that is no narrow float (carried and merged pass its value alone); the
program's own select and phi of a half, which stay the device's moves under
PrecisionNote::NativeNanEncoding; typed objects, which hold a half widened.

SEMANTICS_VERSION 2272 to 2273 (2272 is lane irisvsimd's, landed first): a module that
stores a half moved through one of these paths changes.

Verification:
- tests::engine_half_moves::our_own_moves_keep_every_half_patterns_bits, new: four kernels move
  the patterns through a contained private-arena load, a contained constant-blob load, the switch
  over two device buffers (an eight-lane half vector, so chunked) and the switch over a constant
  buffer or the blob, each module's path asserted (its census key, or its switch-at-use), on every
  committed profile under the resident tables. Without this change it fails at all four (job
  m3-max-66591: 2045 of 2048 changed, 5 distinct modules each); with it every pattern keeps its
  bits (job m3-max-66584, 2 distinct modules each).
- Compile job m3-max-66584 at this tree: fmt, signatures, refusal surface, clippy plain,
  --cfg m2v_gpu and --cfg m2v_cpu_icd, workspace rustdoc -D warnings, api-docs.
- The 252-row hash probe over the two app libraries on validation's runtime description: 252 ok,
  0 of 252 module hashes move (job m3-max-66587 against m3-max-66590 at fd18d75085).
2026-11-22 02:05:42 -08:00
Anees Iqbal 4c21ead93c bind: the items nothing outside bind/'s own tests reached go, with the tests of them alone
What goes: every item of the translator's bind/ that no product code, no other crate of the
workspace and no consumer reaches, by rustc's own dead-code answer with bind/'s items made
crate-private (no table is trusted), and the tests that test only them. Six files go whole
(acceleration, chroma_decode, rate_map/regions, replay/rules, sample_interleave, tile_map), and
with them replay/draws, replay/generated, fan_out's tests, the device replay's preprocess and the
host replay (replay.rs keeps the merged draw's reads), the heap element and raw-form readers, the
resident set, the mesh arguments module, the rate-map regions, the sparse tile map, the chroma
decoders and the sample interleave modules. Also the empty `impl Device {}`, and the three Device
calls nothing in the tree made: render_descriptor_key, mesh_descriptor_key and
compile_function_with_report (compile_function keeps its body). The old-key test
(the_old_render_descriptor_key_keeps_its_value) goes with render_descriptor_key: one bless item
fewer at every pin.

What stays: what anything reaches. The consumer-reached ArgumentBufferLayout family, the merged
draw's reads (replay/merged and the helpers replay.rs keeps), ycbcr_convert's and
mesh_arguments' reached items, and every bind item validation, conformance, the runtime, the
harness or the examples name. A CPU oracle, accessor or constructor that only tests call, and
whose tests check kept behaviour, becomes #[cfg(test)] test support where it is (812 lines: the
argument layout's `argument`, the YCbCr read model, YCbCrPlanes and YCbCrInPlace's constructors
and accessors, the rate map's accessors and constructors, FunctionTableWords and the snapshot's
bytes, the ASTC and ETC texel formats and block values, heap_classes and image_classes). The
public types without a constructor (TexelRows, YCbCrInPlace, IndirectRef, ViewMapping,
TileThreadgroupMemory, TileThreadgroupArgument, ArgumentFunctionTable, ResidentRange,
BoundAccelerationStructure) stay: a public field or parameter of the library takes each.

Lines (from the batch's tip): product 9,219 removed and 728 added; test 7,758 removed and 381
added. 137 test functions or helpers outside the deleted ones are edited off a deleted item, the
largest by 22 lines. Validation, conformance, the harness and the runtime change only in doc
comments that named a deleted item.

Docs: docs/API.md says what is true now (no replay, no heap element reader, no has_shape, the
texel-buffer parts rule stated inline), docs/REFUSALS.md regenerated, api_signatures.tsv blessed
(522 records out), the api_surface table drops 79 bind names.

Consumer hits at its development (git grep -n -w ITEM development -- '*.rs'). The consumer
imports from metal2vulkan::bind only ArgumentBufferLayout, ArgumentDescriptor,
ArgumentLayoutError and ArgumentType, with no glob, and the runtime re-exports only
bind::SamplerDescriptor; every non-zero count below is a generic word whose hits are the
consumer's own items (none of their lines names metal2vulkan; its 22 `.argument(`/`.place(`
calls are on its own types).

Device::render_descriptor_key 0, Device::mesh_descriptor_key 0,
Device::compile_function_with_report 0.

Deleted public top-level items (93):
ARGUMENT_BYTES 0, bit_index 0, bit_set 0, ChromaDecode 0, draw_merge_module 0, draw_replay_draw 0,
draw_replay_indexed 0, draw_replay_merges 0, draw_replay_module 0, draw_replay_preprocess 0,
draw_replay_primitive_type 0, draw_replay_slots 0, draw_replay_state 0, draw_replay_vertex_layouts
0, DRAW_REPLAY_WRITES 0, DrawMergeModule 0, DrawReplay 0, DrawReplayLayout 0, DrawReplayModule 0,
DrawReplayPreprocess 0, DrawReplayRule 0, extent_of 0, FORMAT 5, GeneratedLayout 0, GeneratedReplay
0, GeneratedVariant 0, geometry_flags 0, GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION 0, GEOMETRY_OPAQUE
0, geometry_table_offset 0, handle_entry_flags 0, HANDLE_TABLE_CAPACITY 0, heap_element 0,
heap_raw_form 0, HeapElement 0, HeapElements 0, InheritedBytes 0, instance_record 0, InstanceRecord
0, interleave_merge_modules 0, interleave_split_module 0, InterleaveMergeModules 0,
InterleaveSplitModule 0, level_extent 0, MAX_DRAW_REPLAY_TYPES 0, MAX_REPLAY_DISPATCHES 0,
MAX_REPLAY_REGIONS 0, MAX_REPLAY_SLOTS 0, MAX_REPLAY_VARIANTS 0, MAX_SEGMENT_COMMANDS 0,
merge_fragment_typed_module 0, MERGED_CHUNK 0, MERGED_HEADER_BYTES 0, MergedLayout 0, MergePhase 0,
mesh_arguments_module 0, MeshArgumentsModule 0, MeshGridRule 0, MetalInstance 0,
NEUTRAL_HEAP_ELEMENT 0, NO_HOLE 0, PARAMS_BYTES 0, PlanesCopy 0, primitive_wrap 0, RateMapRegion 0,
RateMapRegions 0, REGION_BYTES 0, RegionError 0, RegionLimits 0, replay_preprocess 0,
replay_preprocess_generated 0, replay_preprocess_module 0, ReplayExecution 0, ReplayLayout 0,
ReplayPreprocess 0, ReplayPreprocessModule 0, ReplayVariant 0, resident_view 0, ResidentSet 0,
ResidentView 0, resolve 179, SCRATCH 0, SLOT_TABLE_BYTES 0, SOURCE 7, SparseTileMap 0,
split_typed_module 0, STATUS 42, TEMPLATE_HEAD_BYTES 0, texel_buffer_parts 0, TileMapError 0,
TileMapping 0, typed_module 0, VARIANT_BYTES 0

Deleted public methods and associated items (126; the count is of the member's name):
ArgumentFunctionTable::at_address 0, BindingPlan::heap_elements 0, BindingPlan::instantiate_replay
0, BindingPlan::relisted_sampler_tables 0, BindingPlan::sampler_tables 0,
BindingPlan::unit_axes_variant 0, BindState::has_shape 0, BindState::has_shape_beside_used 0,
BoundBuffer::same_shape 0, ChromaDecode::ALL 62, ChromaDecode::BLOCK_BYTES 0,
ChromaDecode::block_extent 0, ChromaDecode::decode 2087, ChromaDecode::decode_into 26,
ChromaDecode::of 20774, ChromaDecode::TEXEL_BYTES 0, ChromaDecode::texel_format 0,
DrawMergeModule::HEADER_PUSH 0, DrawMergeModule::LOCAL_SIZE 0, DrawMergeModule::PUSH_BYTES 0,
DrawMergeModule::push_constants 0, DrawMergeModule::STATUS_PUSH 0, DrawReplay::new 9170,
DrawReplayLayout::argument_offset 0, DrawReplayLayout::fragment_table_offset 0,
DrawReplayLayout::params_offset 0, DrawReplayLayout::vertex_table_offset 0,
DrawReplayModule::LOCAL_SIZE 0, DrawReplayModule::PUSH_BYTES 0, DrawReplayModule::RECORDS_PUSH 0,
DrawReplayModule::RESIDENT_PUSH 0, DrawReplayModule::STATUS_PUSH 0, EtcDecode::block_extent 0,
ExecutionStatus::WORDS 7, GeneratedLayout::count_offset 0, GeneratedLayout::dispatch_offset 0,
GeneratedLayout::INDEX_OFFSET 0, GeneratedLayout::max_sequences 0, GeneratedLayout::PUSH_OFFSET 0,
GeneratedLayout::sequence_offset 0, GeneratedVariant::new 9170, HeapElements::element 103,
ImageViewDesc::new 9170, InstanceRecord::bytes 7067, InstanceRecord::BYTES 29,
InterleaveMergeModules::SET 43, InterleaveMergeModules::WIDE_BINDING 0,
InterleaveSplitModule::LOCAL_SIZE 0, InterleaveSplitModule::SET 43,
InterleaveSplitModule::SOURCE_BINDING 0, InterleaveSplitModule::WIDE_BINDING 0,
MergedLayout::draw_offset 0, MergedLayout::group_count 0, MeshArguments::ARGUMENT_BYTES 0,
MeshArguments::new 9170, MeshArguments::OBJECT_RECORD 0, MeshArguments::scratch_bytes 0,
MeshArgumentsModule::PUSH_BYTES 0, MeshArgumentsModule::SCRATCH_BINDING 0, MeshArgumentsModule::SET
43, MeshArgumentsModule::SOURCE_BINDING 0, MeshArgumentsModule::STATUS_BINDING 0, MeshGridRule::of
20774, MetalInstance::new 9170, ObjectFold::bytes 7067, PlanesCopy::ALL 62, PlanesCopy::format 3896,
PvrtcDecode::BLOCK_BYTES 0, PvrtcDecode::block_extent 0, PvrtcDecode::decode 2087,
PvrtcDecode::decode_rows 0, PvrtcDecode::level_bytes 0, PvrtcDecode::linear 144,
PvrtcDecode::TEXEL_BYTES 0, PvrtcDecode::texel_format 0, RasterizationRateMap::regions 39,
RateMapRegion::scissor_extent 0, RateMapRegion::scissor_offset 0, RateMapRegion::viewport 45,
RateMapRegions::admits 17, RateMapRegions::admits_planned_layers 0, RateMapRegions::MAX_REGIONS 0,
RateMapRegions::physical_size 4, RateMapRegions::precision 24, RateMapRegions::regions 39,
RegionLimits::new 9170, ReplayExecution::new 9170, ReplayFaults::ACTION 4, ReplayFaults::BARRIER 2,
ReplayFaults::BUFFERS 0, ReplayFaults::ENCODING 0, ReplayFaults::GROUP_COUNT 0,
ReplayFaults::PIPELINE 11, ReplayFaults::RANGE 0, ReplayFaults::RECORD 15, ReplayFaults::REGIONS 0,
ReplayFaults::VARIANT 0, ReplayFaults::VERTICES 0, ReplayLayout::argument_offset 0,
ReplayLayout::params_offset 0, ReplayLayout::region_offset 83, ReplayLayout::table_offset 0,
ReplayPreprocessModule::PUSH_BYTES 0, ReplayPreprocessModule::RECORDS_PUSH 0,
ReplayPreprocessModule::RESIDENT_PUSH 0, ReplayPreprocessModule::STATUS_PUSH 0, ReplayVariant::flat
30, ReplayVariant::new 9170, ReplayVariant::with_imageblock_size 0, ResidentSet::bytes 7067,
ResidentSet::holds 3097, ResidentSet::is_empty 1066, ResidentSet::len 4763, ResidentSet::with 6328,
RootTable::resident_ranges 0, SparseTileMap::byte_len 0, SparseTileMap::is_mapped 4,
SparseTileMap::new 9170, SparseTileMap::tile 141, SparseTileMap::to_bytes 6, SparseTileMap::update
185, StatusWord::ALL 62, TexelRows::elements 50, TexelRows::new 9170, TexelRows::size 3417,
TypedModule::requirements 11

Out of the public API into #[cfg(test)] test support (41; the count is of the last name):
ArgumentBufferLayout::argument 298, ArgumentPlace 0, AstcDecode::block_values 0,
AstcDecode::texel_format 0, EtcDecode::ALL 62, EtcDecode::texel_format 0,
FunctionTableSnapshot::byte_len 0, FunctionTableSnapshot::bytes 7067, FunctionTableWords 0,
FunctionTableWords::byte_len 0, FunctionTableWords::new 9170, heap_classes 0, image_classes 0,
RasterizationRateMap::from_layers 0, RasterizationRateMap::layer 325,
RasterizationRateMap::parameter_data_size 0, RasterizationRateMap::physical_granularity 4,
RasterizationRateMap::physical_to_screen 4, RasterizationRateMap::shader_physical_to_screen 0,
RasterizationRateMap::shader_screen_to_physical 0, RasterizationRateMap::vertical 19,
RateMapAxis::from_tiles 0, RateMapAxis::granularity 24, RateMapAxis::screen_extent 0,
RateMapAxis::tiles 148, ycbcr_read 0, ycbcr_texel 0, YCbCrCodes::units 507, YCbCrInPlace::bits 940,
YCbCrInPlace::element_bytes 0, YCbCrInPlace::elements 50, YCbCrInPlace::format 3896,
YCbCrInPlace::of 20774, YCbCrInPlace::view_bytes 3, YCbCrInPlace::with_planes_image 0, YCbCrPlanes
0, YCbCrPlanes::new 9170, YCbCrPlanesSampler::bits 940, YCbCrPlanesSampler::format 3896,
YCbCrPlanesSampler::matrix 122, YCbCrPlanesSampler::range 1784
2026-11-22 01:44:19 -08:00
Anees Iqbal 03e13a12c9 Docs: object and mesh SIMD-group functions are a recorded refusal; the vertex quad row says shuffles
- docs/API.md, "Mesh pipelines": an object or mesh function that calls a SIMD-group, quad-group or
  SIMD-group matrix function is refused on every device, including a device that lists the task
  and mesh stages in subgroupSupportedStages. The translator models no subgroup facts for those
  stages (device/subgroup.rs, UNMODELED_STAGE). [[thread_index_in_simdgroup]] alone compiles there
  (the Linear tier). Until now no doc recorded this open gap where a user reads it. Of the corpus
  index's 14 object and 32 mesh functions, none calls an air.simd* or air.quad* intrinsic.
- fixtures/public/engine/README.md, gsm2_vertex_quad_permutes' row: it said the translation emits
  Vulkan's quad instructions where the vertex stage takes them. It lowers each one to a subgroup
  shuffle through the ballot of the live lanes, on every device: a group plan takes quad
  instructions only in a kernel, as tests::engine_simd's
  vertex_quad_permutes_shuffle_through_the_live_lanes asserts.

The runtime-sources.sha256 move from 032b641117 (device/derive.rs and device/subgroup.rs are runtime
inputs) is a hash-only re-pin at landing, with no RUNTIME_VERSION bump. A run's behaviour does not
change: the device's enables and caps are the same, and only the translator's subgroup model loses
a field.
2026-11-22 00:57:03 -08:00
Anees Iqbal e3fbf2ca99 PrecisionNote::VertexSimdgroupGrouping: a vertex function's simdgroup and quad operations run over the device's grouping
A vertex function that runs a simdgroup or quad operation (any group operation or AGX
multiply-add: the simd plan's observes_lanes) records PrecisionNote::VertexSimdgroupGrouping on
every device (lower::simd::finish). Metal's shading language defines its SIMD-group and
quad-group functions for kernel and fragment functions (MSL 4.1 sections 6.10.2 and 6.10.3) and
names no lane among a vertex function's inputs (Table 5.2), so in a vertex function the groups
are the device's own, as FragmentSimdgroupGrouping already says of fragment functions. Validation
takes the note as unbounded (a difference is a noted difference) and C3 defers its rows
(DEFERRED_NEAR_EQUIVALENTS), as it does the fragment note; conformance names it
metal2vulkan-degrade-vertex-simdgroup-grouping; docs/API.md's catalogue states it. SEMANTICS 2272.

Why: on the Iris Xe (RPL-P, Mesa 26.2.6) 8 authored vertex cases mismatched the M3 Max while the
Radeon 780M and the RTX 3090 matched. A raw Vulkan probe outside the runtime (a SPIR-V 1.5 vertex
shader over 64 rasterizer-discarded points, validation layer on, 0 messages; Iris Xe job
m3-max-66302, Radeon 780M m3-max-66303, RTX 3090 m3-max-66304) read SubgroupSize 32 in every
Iris vertex invocation with lane ids 0 to 7 only: 8 subgroups of 8, in each run of 16 vertices
the even ones in one and the odd ones in another, every vote, sum, shuffle and quad broadcast
exact over the driver's own groups. The 780M runs one 64-lane group in vertex order, the 3090
two 32-lane groups. Vulkan holds SubgroupSize to subgroupSize for a SPIR-V 1.5 module and
promises full subgroups only to stages with workgroups, so the driver answers per its
properties, and the translator's tier follows the stage's queries (Iris: vertex not in
requiredSubgroupSizeStages, Direct at the API size 32). The 8 cases' outputs on the Iris
(m3-max-66342) equal, word for word, Metal's semantics over the Iris's own groups with the
partly-live rule's own-value read for a lane that takes no part (0 differing words in each of
the 8; the grouping of the 40- and 42-point draws is inferred from the 64-point rule).
2026-11-22 00:57:02 -08:00
Anees Iqbal 54cd974bae Translator: a signalling float NaN constant records NativeNanEncoding
Observation: the RTX 3090 run of the authored case b315adcc
(float-operations-decided-by-a-bound-constant-fast, fixture sfold_fast.ll, job m3-max-66255)
differs from Metal at words 16-19 and 68-71. That is f[4] = fma(float4(k_snan), x, x) with
k_snan bound to the signalling NaN 0x7f800321: Metal stores 0x7f800321 and the 3090 stores
0x7fc00321. The module recorded no precision note, so validation counted it as a mismatch.

Cause: no fma reaches the module. canon::sccp's float_fold folds an fadd, fsub, fmul, fdiv or
air.fma with a NaN operand beside operands only the run knows to that operand, unquieted, as
Metal's compiler does once the constants are bound. So the module stores a float4 constant
0x7f800321, and the device's move of it as a float quiets it. No Vulkan rule forbids that, so
the stored NaN's bits are the device's. AGENTS rule 1 counts a NaN's bits among the device's own
answers and asks for a static note.

Fix: nan::holds_signalling_float, called from the arith family's finish(), records
PrecisionNote::NativeNanEncoding where the entry's module holds an f32 constant whose bits are a
signalling NaN: every exponent bit set, the quiet bit clear and a nonzero payload
(nan::signalling_f32).
- The rule is decided from the constant's bits alone, never from a name or a case.
- An entry's module holds exactly the constants its function reaches (canon::prune), so the note
  follows the entry, not its library.
- It covers every operation of the fold family, because it keys on the stored constant, not on
  the operation, and it covers a signalling NaN the program wrote itself.
- f32 only. A half constant moves as its bits (narrow::constant_bits): h[2] of the same case
  matches Metal. double is not measured and not claimed.
- The scan ticks the meter once for the table's length.

Validation reads the note from the module: the candidate takes the pipeline state's precision
notes (candidate/platform/runtime.rs), and the comparison class is derived from them
(observation_contract::comparison: NativeNanEncoding is Allowance::Unbounded). b315adcc's
difference is therefore expected to count as a noted difference instead of a mismatch. That is
expected, not yet run.

Docs: docs/API.md's NativeNanEncoding entry and the note's doc comment gain the case. They claim
only what was seen: the 3090 quiets an f32 constant on the move, the other cards in the runs so
far kept its bits, half constants move as bits, and double is not measured.

Test: engine_float_call_notes::a_signalling_float_nan_constant_records_the_devices_nan_encoding.
A kernel storing the f32 constant 0x7f800321 records the note. One storing the quiet 0x7fc00321
does not, and neither does one storing the half 0x7c01. Without the finish() call the first
assert fails.

Bless class at the next pin, expected and not audited: authored compile-census rows of cases
whose module keeps a bound signalling f32 NaN beside a run value (the sfold cases binding k_snan,
b315adcc among them) gain NativeNanEncoding. The golden tables compile with function constants
unbound and hold no NaN literal (no public fixture spells one), so they are expected unchanged.
No SEMANTICS bump: the batch's last commit carries it.
2026-11-22 00:17:43 -08:00
Anees Iqbal 556707ed79 Translator: containment is the in-shader check on every profile; Robustness goes
The translator chose a containment form from the device's buffer robustness: with
robustBufferAccess or robustBufferAccess2 enabled, a descriptor view's access carried no check
and the device bounded it. The runtime enables neither feature (its floor's feature table names
only nullDescriptor, robustImageAccess and robustImageAccess2), so that form never ran there; it
ran only on validation's committed descriptions, as stated. It goes, with the choice:

- Robustness (None, Rba, Rba2), DeviceProfile::robustness() and
  DeviceProfile::checks_buffers_in_shader(), and contain::encoding. A descriptor view's access is
  the in-shader check on every profile; Check::None remains only for a device-address access that
  nothing bounds (AccessPlan::psb_contained false).
- A texel buffer is checked in the shader on every profile (it was the device's under
  robustBufferAccess2). Images keep their device form: device_reads_texels and
  device_drops_texel_writes still read robustImageAccess2 and robustImageAccess, which the
  runtime's floor requires.
- Vertex input: outside the identity domains every attribute is pulled through a checked view;
  before, a device with robustBufferAccess fetched in fixed function. Under the identity domains
  nothing changes: fixed function, or the refusal of what it needs.
- The loop hoist loses its robustness parameter and the speculative path only Rba and Rba2
  reached: a load in the loop's entry run still moves, other loads stay.
- Validation: of_compile states buffers as Unused or Checked, the out-of-bounds contract states
  Check::Shader for a descriptor view and a texel buffer and Unchecked for a fixed-function
  attribute. BufferEncoding::Robust and Check::Robust stay as stored vocabulary: committed
  observations hold them, and no compile states them now.

Removed public items, each with 0 hits in the consumer's checkout at bd9d6ae85a and at
ad28ebd881 (git grep -w -F over *.rs, *.toml, *.md): Robustness, Rba, Rba2, robustness,
checks_buffers_in_shader (DeviceProfile, their owner, has 0 hits too). api_signatures.tsv and api_surface.rs are
blessed here; docs/API.md (the bounds bullet, the profile facts list, vertex_input) and the
runtime README's not-enabled row for robustBufferAccess change in this commit;
docs/REFUSALS.md is regenerated and unchanged. No version moves: the batch's SEMANTICS and
ARTIFACT_FORMAT_VERSION bumps are applied last, once for the batch.

Tests: the hoist's a_guarded_uniform_load_at_a_fixed_word_leaves_its_loop goes with the
speculative path; without_robust_access_only_a_load_every_entry_runs_leaves becomes
only_a_load_every_entry_runs_leaves; robustness2_selects_the_rba2_encoding keeps its MoltenVK
asserts as moltenvk_m3_derives_its_stride_and_format_usages; engine_texture_interp's
contains_texel_buffers helper goes, its tests always running N+3 threads. Rewritten to the one
form: engine_texture_oob's texel-buffer classes ([Class::Shader]), engine_texture_ulong,
engine_graphics_binder's per-device assert, the coverage tier-table and containment tests, and
the out-of-bounds contract's fixed-function test. None was the sole proof of a kept behaviour.

Golden: the table's columns are validation's committed descriptions as stated, all with
robustBufferAccess and 13 with robustBufferAccess2; no column is the runtime's. Every column's
fingerprint moves (ProfileFields loses its robustness field). Bless items: 24 rows, 312 cells,
24 in each of the 13 columns that state robustBufferAccess2 and 0 in moltenvk-m3 and
runtime-floor, every one hash to hash, in the 14 texel-buffer fixtures now checked in the shader.
The .air.ll half (567 typed-pointer fixtures, which need metal-as) is unchecked per commit; the
batch's golden bless on the M3 covers it.

Verified:
- On unshipped's tip before this rebase (96d953bb0b), the same change: compile job
  m3-max-66123 green (fmt, signatures, refusals, clippy plain, m2v_gpu and m2v_cpu_icd,
  workspace Rustdoc, api-docs).
- At the batch's top on that base (all four commits, probe job m3-max-66130): the hash probe's
  252 rows equal unshipped's arm at 4861c9863d (m3-max-65976); the golden probe's set without
  buffer robustness (the runtime's state) equals the base arm 96d953bb0b (m3-max-66128), 1855 of
  1855 rows; the stated set moves exactly the 312 cells above.
- Here: cargo fmt; signatures check; refusal surface regenerated. The compile job follows on the
  branch tip.
2026-11-22 00:17:42 -08:00
Anees Iqbal 5e3477e60a Translator: a buffer slot takes the storage view on every profile; the uniform view goes
A buffer slot took a uniform view only where containment was the device's
(contain::encoding gave Check::None, under robustBufferAccess or robustBufferAccess2): the
uniform arm of the slot's view choice and Profile F's per-stage storage-buffer fallback. The
runtime enables neither feature, so no runtime module took one. The next commit deletes the
robustness choice; memory, lower and spirv are crate-private, so its dead_code would fail that
commit on its own. The uniform view goes first, with everything that only it reached:

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

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

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

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

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

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

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

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

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

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

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

Verified: cargo fmt; refusal surface and signatures regenerated locally. The compile job and the
host suites follow on the branch.
2026-11-22 00:17:40 -08:00
Anees Iqbal e10fa7ba23 Docs: the mesh lowering is only compiled and validated, never compared with Metal on a GPU
The rule keeps the mesh lowering (a sole lowering a supported device
could run, and large) with an honest known-gap line. The runtime README's
mesh gap said "The translator compiles mesh pipelines"; it now says the
lowering is only compiled and validated and has never been compared with
Metal on a GPU. docs/API.md's Mesh pipelines section says so before it
describes what the lowering emits, and its "Every device runs a grid of
up to 2^29 threadgroups" becomes what the lowering takes. Validation's
README says a compiled cell of an object or mesh case in the authored
compile census means it compiles, not that it draws as Metal does.

Searched README.md, docs/*.md (METAL-COVERAGE and CONFORMANCE-COVERAGE
included), the runtime, validation and conformance READMEs: METAL-COVERAGE
lists mesh render pipelines as missing, and CONFORMANCE-COVERAGE counts
Metal-side cases only, so neither reads as mesh working. Docs only.
2026-11-22 00:17:22 -08:00
Anees Iqbal c78ff4022c Translator: a ulong texture's atomics are refused on every device; the 64-bit image form goes
The rule: a sole lowering under 150 lines that nothing executes is
deleted to a typed refusal. Metal's atomic_min and atomic_max on a ulong
texture lowered to OpAtomicUMin/UMax on an R64ui image, which needs
shaderImageInt64Atomics; no runtime enables it, so nothing ran the form.

texture::atomic::select now refuses the pair as
Unsupported{ImageAtomics} not implemented, on every device. Gone with
the form: TexAtomic.ulong, the R64ui slot declaration and its reads and
writes in the emitter, RuntimeFact::UlongAtomicView with its codec, name
and mechanism rows, the binder's R64_UINT view and neutral,
DeviceProfile::ulong_atomic_gaps, LeafCaps.image_int64_atomics, and
R64_UINT in the queried formats. VK_EXT_shader_image_atomic_int64 is
described and never enabled. Product lines +34 -142.

Tests: the four tests of the 64-bit form and the fact's round trip go;
ulong_atomics_are_refused_on_every_device asserts the refusal on every
committed profile; the legacy-offset test takes the refusal as a gap;
the mechanism table renumbers; the recommendations test lists
shaderImageInt64Atomics as unread. The runtime README's known gap says
the atomics are refused, and its Not enabled row for
shaderImageInt64Atomics goes (the profile reads it no more).
docs/REFUSALS.md and api_signatures.tsv regenerate.

Consumer search (reims-vgpu ad28ebd881): ulong_atomic_gaps 0,
UlongAtomicView 0, image_int64_atomics 0.
2026-11-22 00:17:22 -08:00
Anees Iqbal 317613d939 Translator: an 8-bit float widens by the integer decode on every device; the native form goes
Where a profile enabled shaderFloat8 an 8-bit float of an OCP encoding (f8e4m3fn, f8e5m2, a
tensor's e4m3 and e5m2) widened through the device's own type (OpTypeFloat 8 with its
FPEncoding, Float8EXT, SPV_EXT_float8), and a tensor's element recorded
PrecisionNote::NativeFloat8. The runtime never enables shaderFloat8 (its README listed it under
Not enabled), so on its devices every 8-bit float already widened by integer arithmetic on its
fields, as Metal reads them; once validation enables what the runtime enables nothing runs the
native form. It goes with what only it reached: Fp8Layout's native field and Fp8Layout::on
(every caller takes Fp8Layout::of), fp8_native, native_float8, the crate-private LeafCaps.float8
and its derivation, the IR's Type::Float8 with its type facts, builder, serializer, requirement
and interpreter arms (the interpreter's OCP decode with it), and the public
PrecisionNote::NativeFloat8 with its cache codec entry (the batch bumps ARTIFACT_FORMAT_VERSION
once), conformance's Degradation::NativeFloat8 and validation's allowance arm. The enable-set
facts class VK_EXT_shader_float8 as described and never enabled (the matmul2d refusal its
comment named is not in the tree). The VkFeature, VkExtension and SPIR-V vocabulary stays.

Docs: docs/API.md's precision-note catalogue loses the native-float8 entry; the AIR front end's
matmul2d docs and the vocabulary docs say the integer decode; the runtime README's "Not
enabled" row for shaderFloat8 goes (tests::feature_enables fails on a row the profile no longer
reads).

Tests: the widening, matmul2d and SIMD-group matrix 8-bit float tests take the integer decode on
every profile, the RTX 50 profile (which lists shaderFloat8) included: no module declares
Float8EXT, and the matmul2d sums hold no NaN.

Class 1 of the planner's rule (an alternative to what the runtime runs). Public item removed:
PrecisionNote::NativeFloat8, here and as the runtime re-exports it (api_signatures.tsv
blessed); a consumer that matched it no longer compiles. The consumer's checkout (reims-vgpu at
bd9d6ae85a) holds 0 uses of it. Product lines: +23 -190. Modules change only on profiles that
enabled shaderFloat8 (their golden rows move, re-stamped at the pin); no SEMANTICS bump (the
profile fingerprint changes with the field and is in every cache key).
2026-11-22 00:17:21 -08:00
Anees Iqbal 58b5fad7f3 Translator: reads no VK_EXT_depth_range_unrestricted; a depth comparison notes the range everywhere
Where a profile enabled VK_EXT_depth_range_unrestricted the translator clamped a fragment
function's depth output to [0, 1] itself (Vulkan then stores it unclamped) and recorded no
PrecisionNote::RestrictedDepthRange for a depth comparison. The runtime never enables the
extension (its README: the floor does not require it, and replace_region refuses a float depth
upload as Gap::FloatDepthUpload), so on its devices the depth was already Vulkan's own clamp
and every depth comparison already recorded the note; once validation enables what the runtime
enables nothing runs either arm. Both go: DepthClamp::clamps and clamps_fragment_depth (the
[0, 1] selects now run under the depth clamp range input alone, as they did on every profile
without the extension), and depth_comparison records the note unconditionally. The enable-set
facts class the extension as described and never enabled (the core reads none of it), so
recommended_enables no longer names it. The VkExtension vocabulary stays.

Docs: PrecisionNote::RestrictedDepthRange's doc and docs/API.md's catalogue entry say the note
is recorded on every device, the runtime enabling no VK_EXT_depth_range_unrestricted.

Tests: the test that compared a depth output with and without the extension and the test that
the extension is read from a description go; the comparison test records the note on every
profile, RADV's (which lists the extension) included; the kill and depth-clamp-range tests stay.

Class 1 of the planner's rule (an alternative to what the runtime runs). No public item goes
(signatures.py --check clean); the consumer's checkout (reims-vgpu at bd9d6ae85a) calls no
recommended_enables and names the extension nowhere. Product lines: +34 -57 (most of both
are doc lines). Modules change only on profiles that enabled the extension (RADV, lavapipe,
NVIDIA golden rows move, re-stamped at the pin); no SEMANTICS bump (the profile's enabled set
is in every cache key).
2026-11-22 00:17:20 -08:00
Anees Iqbal 4ff156420f Translator: a float fma is the device's Fma on every device; OpFmaKHR goes
The OpFmaKHR route (Route::Khr, chosen where a profile enabled shaderFmaFloat32) was a second
form chosen by a query outside the nine rule 2 allows. The runtime never enables
VK_KHR_shader_fma (the owner's fma ruling stands: GLSL Fma with PrecisionNote::NativeFma), so
on its devices a float fma was already the device's Fma, and once validation enables what the
runtime enables nothing runs the KHR route. It goes with what only it reached: the
crate-private LeafCaps field and the routes' float field (a float fma's route is
Route::Native on every profile), the IR's Inst::Fma and FunctionBuilder::fma with their arms
in every pass, the serializer, the interpreter and the requirement derivation (FMAKHR,
SPV_KHR_fma, shaderFmaFloat16/32). The SpirvExtension and VkFeature vocabulary stays.

PrecisionNote::NativeFma's doc and docs/API.md's catalogue entry say a float fma is the
device's Fma without naming a device that had OpFmaKHR. The runtime README's "Not enabled" row
for shaderFmaFloat32 goes (tests::feature_enables fails on a row the profile no longer reads).

Tests: the interpreter, builder and derivation tests of OpFmaKHR go; the route, fast-fmod and
fused tests take the device's Fma on every profile; the tests that took one profile per float
route take the first committed profile (one route now).

Class 1 of the planner's rule (an alternative to what the runtime runs). No public item goes;
the consumer's checkout (reims-vgpu at bd9d6ae85a) holds no use of the items removed. Product
lines: +44 -143. Modules change only on profiles that enable shaderFmaFloat32 (moltenvk-m3's
golden rows move, re-stamped at the pin); no SEMANTICS bump (the profile fingerprint changes
with the field and is in every cache key).
2026-11-22 00:17:20 -08:00
Anees Iqbal a347af5f65 Two stage bounds by path: kernels leave the process past 39,014, render stages are refused past 99,109
COMPILED_STAGE_WEIGHT is now 39,014: the heaviest kernel measured to compile in its creating
process within 512 MiB of that process's resident growth on every driver measured. Made cold (no
pipeline cache, shader cache off) and alone in its own process, the app library's heaviest kernel
under the old bound (entry weight 39,014) grew the process by 350 MiB in 6.8 s on the Iris Xe of
RPL-P (ANV, Mesa 26.2.6; job m3-max-66048), 148 MiB in 1.8 s on an RTX 3090 (NVIDIA 620.70.06;
job m3-max-66050) and 80 MiB in 0.55 s on a Radeon 780M (RADV, Mesa 26.2.6; job m3-max-66049).
No real stage between 39,014 and 99,109 is measured (the app's 63-kernel library, job
m3-max-65984; the nine standard streams and the app's two recordings, states-only on lavapipe, job
m3-max-66001). The older build's 1.76, 2.24 and 3.65 GiB (job m3-max-26147) and the helper's
2,620/2,763 MiB and 3 GiB breaches (job m3-max-65807) stay in the docs as what lies above it.

No helper compiles a render stage, so the runtime keeps 99,109 as its own render bound
(stage::RENDER_STAGE_WEIGHT): past it a render pipeline is refused (Gap::StageSize,
StageGap::RenderStage), at or under it it compiles in the process with no cap. The heaviest real
render stage measured (35,063 beside a vertex stage of 431; 39,424 as lavapipe's profile weighs
it) grew the process by 316 MiB in 3.8 s on the Iris Xe (job m3-max-66048), 180 MiB in 2.5 s on
the RTX 3090 (job m3-max-66050) and 58 MiB in 0.6 s on the 780M (job m3-max-66049). The docs say
the two numbers measure two things and become one when a render helper exists. Metrics gains
render_makes_past_kernel_bound and render_weight_past_kernel_bound_max: render pipelines translated
with a stage past the kernels' bound, and the heaviest such weight.

The translator's re-plan keeping the widest pin follows the constant (StageBounds::MEASURED), so
SEMANTICS_VERSION 2269 -> 2270. The rt README's stage-bound section, its render-pipeline known gaps (the
uncapped range), Gap::StageSize's docs, docs/API.md, docs/REFUSALS.md and the signature table are
updated; the "132 s and 3.65 GiB" basis is replaced by today's figures.

Test: a_render_state_past_the_kernel_bound_is_made_in_process_and_counted (with the kernels'
bound set to 1, a render state is made, not refused, and counted once at its heaviest weight); it
fails before this change, where the render check read the kernels' bound.

Verified: the figures are the rows of jobs m3-max-66048, 66049 and 66050 (probe branch
steelbrain/boundread-probe 7dd5c2f52e, never lands: each make's peak reset before it, VmHWM after
it less VmRSS before it). Checks on the branch (f8ed8d8953, the same change on 4e9aad67d5 with its bump numbered 2271):
compile job m3-max-66144 green (fmt, clippy plain / m2v_gpu / m2v_cpu_icd, workspace Rustdoc,
signatures, refusal surface, api-docs); the rt device suite on lavapipe m3-max-66148, 640 passed;
suites m3-max-66146, product 4023/4027 with the four bless-class failures development's own run
showed, validation 1334/1334, conformance 1025/1025, doctests. Golden: 0 cells moved by this change
(887 changed in both arms, jobs m3-max-66226 and m3-max-66260, lists identical); the render key
moves with SEMANTICS. States-only play of the 9 standard streams (m3-max-66274): 0 refused, 0 not
attempted, every count equal to m3-max-65778's. Landed on 626cbd9846 with SEMANTICS 2270, as it
landed before the batch.
2026-11-21 23:13:25 -08:00
Anees Iqbal dd150e4f46 Delete the 14 Feature variants and 3 Needs variants nothing builds
Nothing in the product crates built these 14 Feature variants: SamplePositions, TextureSize,
TextureSampleCount, TextureView, MipmapGeneration, HostMemory, GpuTimes,
ViewFormatReinterpretation, SeparateMultisampledDepthStencil, SparseTextures,
TimelineSemaphores, HeapTextureTiling, UndeclaredTextureUsage and RenderTargetSize. They were
refusals of the runtime this tree cut over from, and so they were docs/REFUSALS.md's last 14 '-'
rows. Nothing built the Needs variants DeviceCapability, MetalGpuFamily and MetalRefuses either,
nor called their constructors Unsupported::device_capability and Unsupported::metal_gpu_family
outside tests. No doc or test showed one to be the vocabulary of a Metal refusal anything
answers: the three Feature docs that said the runtime answers MetalGpuFamily or MetalRefuses
were corrected in the previous commit.

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

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

Verified (locally, source-reading scripts): refusal_surface.py --check and --selftest pass;
signatures.py --check passes after --bless.
2026-11-21 19:04:10 -08:00
Anees Iqbal 7f156bc920 Error::basis answers a translation error from what its refusal needs
The runtime's Error::basis answered None for every Error::Translation, so each translator
refusal a guest met sat in a consumer's census unsorted between Metal's own refusal and our
gap, and 36 of the translator's 133 Feature variants showed no basis in docs/REFUSALS.md.

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

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

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

Verified: compile m3-max-65442 (fmt, refusal_surface.py --check and --selftest, signatures.py --check,
clippy plain / --cfg m2v_gpu / --cfg m2v_cpu_icd, workspace Rustdoc -D warnings, scripts/api-docs);
host suites m3-max-65443 (metal2vulkan, -air, -runtime: 3969/3969, the golden hashes and the old
render key among them; doctests); before-run m3-max-65444 (development plus the new test alone):
a_translation_error_answers_the_basis_of_what_it_needs fails as expected (None against Some(Device)).
2026-11-21 18:25:57 -08:00
Anees Iqbal 6c1dff3f09 Translator: under the identity domains, constexpr samplers a lane chooses among beside an argument buffer's texture are one sample through the set-1 sampler array (SEMANTICS 2265)
Some kernels sample a texture their argument buffer holds through a sampler that the run picks
among constexpr samplers with consecutive handles: a program-scope table of samplers read at an
index only the run knows. Under the identity domains, the runtime's, each such sampling was a
switch over the candidates: one arm per candidate, each a NonUniform sample of the heap element
through that candidate's set-1 sampler, and a null arm. RADV wraps each NonUniform sample in its
own waterfall loop (read_first_invocation). The 780M library's heaviest kernel holds 284 such
switches of eight arms, so 2,272 samples and 2,272 driver loops. Its cold create on a 780M peaked
at 7.8 GiB.

select_heap_array now takes the identity domains too. Where every candidate is a constexpr sampler,
their handles are consecutive, the use is not tangled (no fragment implicit level), and every
candidate's sampling is the same but for its sampler, the sampling is one sample. It reads the
set-1 sampler array of its use, NonUniform, at the pushed index (PushField::ConstexprSampler) of
the candidate the handle names. emit::identity_element selects that index among the candidates'
at run time. A handle outside the array still reads zero. finish pushes each candidate's index
and records the use in SamplerPlan::heap_array_identity in place of a binding. Sampling::words
counts each candidate's selection (Source::HeapArray::pushed, 0 outside the identity domains, so
the resident-table domains' weights are unchanged).

Under the identity domains the switch stays where the sampling compares, reads an integer class,
or reads pixel coordinates. Metal's bicubic filter on an argument buffer's texture is refused
before this (bicubic::check). Raw-texel states do not arise here, because the element is read in
its declared class. The resident-table domains keep their form unchanged.

One form for every device: the runtime's floor requires
shaderSampledImageArrayNonUniformIndexing (floor.rs), every committed profile reports it, and a
heap image sampled at all already needs it (texture/slot.rs).

The form is ported from 4b7d9d48ef (steelbrain/privarena-sampler-b, unlanded) and narrowed to the
ruled domain.

SEMANTICS_VERSION 2264 -> 2265. The golden table and the old render descriptor key get
re-blessed at the pin: m3-max-65203 shows "bless due" with exactly 16 cells changed, all
engine/sampler_table.ll sampler_table_held, one per committed profile.

Tests:
- engine_identity's
  chosen_constexpr_samplers_beside_an_argument_buffer_texture_are_one_sample_where_alike
  (replaces ..._is_a_switch_over_them). On every committed profile under the identity domains, a
  kernel's float sample through three chosen constexpr samplers is one sample: one sampled image,
  no switch, one ConstexprSampler pushed per candidate, and L3 passes. The switch stays, with a
  sampled image per candidate, for pixel coordinates (two linear pixel samplers that differ only
  in their border color), an integer texture, a comparison and a fragment's implicit level. The
  resident-table domains take their set-0 array for all but the fragment case, which shows the
  candidates' samplings are alike and only the identity domains' rule keeps the switch.
- argument_sampling's
  every_device_samples_an_argument_buffers_texture_through_a_table_of_constexpr_samplers now reads
  the module the device's translator gives sampler_table_held, asserts 1 sample and 0 switches,
  and prints that, then compares each of the 20 texels with Metal's answer as measured on an
  Apple M3 Max. The fixture has four candidates. The form is the same for any count of two or
  more, so it covers the eight-arm sites, and its texels are M3-measured.

Verified:
- Compile: m3-max-65200 (fmt, signatures, refusal surface, clippy plain / m2v_gpu / m2v_cpu_icd,
  workspace Rustdoc -D warnings), m3-max-65203 (translator suite 3210 passed, lavapipe runtime
  suite 625 passed).
- The execution test passed on llvmpipe (65203), RTX 3090 (65223), RX 7900 XTX (65224) and Iris
  Xe (65225).
- Rows: development 21baf79e79 against this tree, one runner (probe 7faf595d33 / 88125605ae, its
  probe variable choosing the arm), every run cold, validation layer off, arms A B B A in one
  exclusive job per card:
  - ec13339c (780M library, 284 sampler switches) on a Radeon 780M, RADV, job m3-max-65216:
    helper peak 7,772 / 7,773 MiB -> 816 / 819 MiB (89.5% less), driver compile 63.39 / 62.34 s
    -> 21.94 / 21.55 s (65.4% less). Final NIR (RADV_DEBUG=nir): loops 2,571 -> 583,
    read_first_invocation 2,272 -> 568, blocks 34,289 -> 17,533, phis 27,537 -> 13,526.
  - The same kernel on an RTX 3090, job m3-max-65238: 2,447 / 2,443 MiB -> 1,975 / 1,976 MiB
    (19.2% less), 57.72 / 57.70 s -> 51.88 / 51.85 s (10.1% less).
  - d45af8b7 (780M library, 70 sampler switches) on an Iris Xe, ANV, job m3-max-65240:
    4,528 / 4,530 MiB -> 2,622 / 2,622 MiB (42.1% less), 135.54 / 136.55 s -> 67.17 / 67.28 s
    (50.6% less).
- Our module for ec13339c on the 780M's profile (job m3-max-65215): blocks 22,746 -> 19,906,
  explicit-level samples 2,272 -> 284, OpSwitch 625 -> 341, spirv-val clean.
- The ledger over both libraries' 252 rows, plain and partial, both arms (job m3-max-65215): every
  row translates on both arms, none past 20 s, slowest 5.19 s, k12 unchanged at 440.2 MiB, and no
  rise. 20 rows of 10 kernels change, all of the 780M library. The Iris library's kernels sample
  through the program's own switches, one constexpr sampler per case, so no lane chooses a
  sampler there and its modules are byte-equal (probes m3-max-65233, 65241, 65246).
2026-11-21 17:15:11 -08:00
Anees Iqbal b20dc87d22 Translator: the outline pass goes; a repeated region is written in line again (SEMANTICS 2263)
What: spirv::outline (a repeated region of 500 or more instructions written once, as a kept
routine declared DontInline) is deleted with its tests, its call in the stage bound and in
pipeline::testing, its notes in weights.rs, ir::Function::kept, ModuleBuilder::kept_routine and the
serializer, docs/API.md and docs/ARCHITECTURE.md. roll's items and its spine take back their own
visibility and signature (the loop-body sequences only the outline search read). The
bounded-growth test's chain is all one group again: no pass now folds a repeated graph.
cache::SEMANTICS_VERSION 2262 to 2263. The sampling and texel routines stay kept routines,
DontInline as before.

Why: a regression on NVIDIA. Job m3-max-64837 (RTX 2080, 620.70.06, um790, exclusive) made k7
(610e4b3d of the Iris capture's library, weight 320,401) cold through the runtime's helper, arms
A db5fefc2ce (before the pass), B 71014cd7bc's product (the pass in), C 36ed0d15b2, alternated
A B C A B C. The helper's CPU time and peak resident set (VmHWM):
- A: 37.74 s, 1,749 MiB; 37.90 s, 1,750 MiB.
- B: 85.82 s, 2,040 MiB; 87.44 s, 2,041 MiB (10 kept routines; largest function 195,769
  instructions against A's 336,129).
- C: 87.35 s, 2,049 MiB.
B is 2.3 times A's CPU and 16.6% more memory. The pass's only gain on file was synthetic (one
function called from 50 places, m3-max-64453). RADV and ANV cannot gain from it: Mesa 26.2.6
inlines every function before either backend sees the shader, RADV in radv_shader_spirv_to_nir
(src/amd/vulkan/radv_shader.c:574, nir_inline_functions) and ANV through the common runtime
(src/intel/vulkan/anv_device.c:792 sets the shader ops; src/vulkan/runtime/vk_pipeline.c:211 calls
vk_spirv_to_nir, whose src/vulkan/runtime/vk_nir.c:176 runs nir_inline_functions).

Verified: the compile job of this commit and a states-only play of nine streams against
development follow; the golden table and the render key are re-blessed at the pin.
2026-11-21 13:15:45 -08:00
Anees Iqbal 7e92b1d0fa Translator: a repeated region of 500 or more instructions is written once, as a kept routine
What: a new pass, spirv::outline, runs on every module after rolling and hoisting. It finds a set
of regions of one function that are the same code (one sequence of the function's spine, loop
bodies included; entered only at the start and left only at the end), each of at least 500
instructions with a call of a kept routine counting one, writes the first as a new kept routine
(Function::kept, declared DontInline, the form ModuleBuilder::kept_routine makes) and replaces
every region with a call of it, then looks again, at most 64 times. Values from before a region
are parameters (one per distinct set of the regions' values; a constant that differs only where
any value may stand); a pointer parameter is a Function, Private, Workgroup or UniformConstant
variable itself or a PhysicalStorageBuffer pointer; values read after a region are the routine's
results (several in a struct). A Function variable only its region uses becomes the routine's
own where the region is in no loop or its first use stores the whole variable in a block the
region always runs; otherwise it is passed. Anything else that differs keeps the regions in line.
Candidates come from the spine's keys (16-item windows hashed, extended both ways); a set whose
exact comparison fails at an operand or result is compared again without that item. The spine
(roll::spine) takes a flag to walk loop bodies as sequences; rolling passes false and is
unchanged. SEMANTICS_VERSION 2259. API.md and ARCHITECTURE.md say the routines exist.

Why: NVIDIA's driver compiles a DontInline routine once and Mesa's drivers inline it either way.
On the RTX 3090 (620.70.06, job m3-max-64453) a generated kernel calling a 1,984-instruction
function from 50 places was created in 21.5 s inlined and 52 ms as a kept routine (51.8 s and
75 ms with 64 values live across every call); its dispatch GPU time was the same with few values
live and 20.6% lower as a routine with 64 live. A 497-instruction function: 0.1% and 19.7% lower.
500 is the smallest size measured within 3%. RADV and ANV (Mesa 26.2.6) compiled identical code
for the call, DontInline and inlined forms (jobs m3-max-64357, m3-max-64379).

How verified: spirv::outline::tests build kernels with three equal regions (a variable, a
selection's phi, a counting loop), a chain where each region reads the previous one's result, a
middle region that differs, and two regions in a loop whose accumulator is read before it is
written; each checks the routine and call counts, the module through the verifier and spirv-val,
and the words the interpreter writes against the unrewritten module's and the expected ones.
2026-11-21 12:18:23 -08:00
Anees Iqbal 19620c6f4d API.md: the fractional viewport's accepted difference names the devices measured
What: section 10's Draws entry on a filled primitive past a viewport edge that crosses a pixel. It
said a Vulkan device covers such a pixel where its sample lies in the clipped primitive; it now says
what was measured: RADV (RX 7900 XTX, two Radeon 780Ms, RX 550) and NVIDIA's driver (RTX 3090,
RTX 2080, RTX 5080) cover every pixel the viewport overlaps, as Metal on the M3 Max does; lavapipe
covers such a pixel only where its sample lies in the clipped primitive; the Iris Xe (ANV) covers
every pixel the near edges cross and none the far edges cross, the accepted difference where that
pixel's sample is outside or on the edge and a driver bug (the runtime README's known gap) where it
is inside.

Why: the entry claimed more than was measured; seven GPUs show no difference at all.

How verified: replays of fractional-viewport-coverage through the runtime, each differing pixel
printed against Metal's recording: m3-max-64279 (XTX), 64288 (780M 1002:15bf), 64280 (780M
1002:1900), 64323 (RX 550), 64286 (3090), 64287 (2080), 64282 (5080): 0 differing pixels;
m3-max-64281 (Iris Xe): 120 pixels, all far columns and rows; lavapipe's 344 elements from its
ledger row. The entry's bold lead-in (the allowance slug) is unchanged.
2026-11-21 10:46:52 -08:00
Anees Iqbal 339d8f05c7 Runtime docs: a waiter on a signal held for room reads Committed until it is staged; the 2019 MacBook Pro's order as job 64081 shows it
A wait for an event's value is met once a signal of it is submitted (staged); a signal its
queue holds for room is not yet staged, so its waiter reads Committed for as long as the
signaller's queue takes to reach it. The Scheduled doc, newSharedEvent's and docs/API.md's
accepted difference now say so: within the M3 Max's own hold, which keeps a shared-event
waiter at Committed until the value lands.

The README's 2019 MacBook Pro sentence now states what job 64081 showed and no more: on the
Radeon Pro 5300M an unrelated read of a second process completed 0.99 to 1.97 ms after its
commit beside about 160 ms of another process's submitted work; a dependent read completed
after its writer and 19.06 to 19.26 ms before the first of 4 command buffers committed after
the write (committed, not shown submitted); the UHD 630 ran both processes first in, first
out in all 18 rounds, so its reader-after-writer is not told apart from that order.

Docs only.
2026-11-21 09:35:12 -08:00
Anees Iqbal 7911c011a0 Runtime: a queue keeps on the VkQueue only what it has room for, and another queue's later command buffer passes the rest
A queue sends a group only while it has room (submit::room): with fewer
than two submissions not seen complete always, and with fewer than
IN_FLIGHT while the expected runs behind the oldest, the group's with
them, stay within GROUP_RUN (16 ms). Without room, a command buffer the
held group does not take (by GROUP_RUN, UNSEEN_JOINS or GROUP) waits in
its queue's list, not staged, with the queue's later commits behind it;
the submit thread skips that queue and other queues' later commits go on.
Each held command buffer is scheduled as it would be in a group, in
commit order once its waits are met, its scheduled handlers run: only
its vkQueueSubmit2 waits for room (WorkState::hold). One that presents a
drawable, has nothing for the GPU, or ended sends its queue through to it,
as its group would go at once. Everything that sent a group still sends
it: a signal as staged, a host wait or send_now, stop, a busy completion
thread, an empty command buffer, a conflict with a texture copy.

A group no longer goes at its sixteenth command buffer: the seventeenth
finds it full and waits for room. A queue whose expected run is not yet
known has room for two.

Fences: a wait on another queue also goes after an update in a command
buffer held for room there, scheduled before the waiter was; that queue
goes through to it first. A held head with no group is staged before any
other command buffer, the earliest held first, so the order of holds is
the order fences read.

abandon ends the queue's command buffers not yet scheduled in place, in
the queue's order behind those held for room, which go at once.

Metrics::held_for_room counts the command buffers scheduled while held
for room (api_signatures row).

Why: one queue's backlog no longer delays another queue's command buffer
by more than about GROUP_RUN of that queue's expected GPU time.
2026-11-21 09:18:56 -08:00
Anees Iqbal 6da9a2bca2 Fractional viewport coverage is an accepted difference beside a point's
The planner's ruling on Metal's recorded answer (fractional-viewport-coverage, m3-max-64012):
MTLRenderCommandEncoder.h's setViewport: states only that fragments outside the viewport are clipped,
not which a pixel the viewport's edge crosses is; the M3 covers every pixel the viewport overlaps, a
partly held pixel included, and a Vulkan device covers a pixel where its sample lies in the clipped
primitive. Rule 1 does not emulate what Metal leaves unstated, and a static note would be decided by a
viewport's value at the draw, so docs/API.md's Draws list gains the entry beside the point's and the
lavapipe row's reason becomes it. The GPU venues' rows come with the next round's replays.
2026-11-21 09:09:38 -08:00
Anees Iqbal 3a6d244ae2 Translator: runtime-floor's recommendation leaves out its texel-buffer update-after-bind pair, and a device made from it refuses texture buffers naming the feature
Texture buffers (817463704e) made runtime-floor the first committed profile that lists texel-buffer
update-after-bind features with robustBufferAccess and without robustBufferAccessUpdateAfterBind,
so recommended_enables keeps robustBufferAccess and leaves those two out by
VUID-VkDeviceCreateInfo-robustBufferAccess-10247. recommendations_are_closed_fixed_points_on_every_
committed_profile asserted the recommendation left out nothing on any committed profile, an
observation over the profiles, which no longer holds; it now names runtime-floor's pair. The
runtime enables those features and never robustBufferAccess (floor.rs), so no product change.

recommended_enables' doc said the core does not read the buffer update-after-bind features. Since
texture buffers it reads the two texel-buffer ones; the doc and docs/API.md now say a device made
from the recommendation on such a device gets no texture buffers, each refused naming the feature,
and how to have them. A new test builds runtime-floor's device from its own recommendation and
shows the typed refusal (Unsupported ArgumentBufferTextures, needs
DescriptorBindingUniformTexelBufferUpdateAfterBind), and the same member compiling once the
features are enabled without robustBufferAccess, as the runtime does.
2026-11-21 08:33:22 -08:00
Anees Iqbal 0f2067150f rt: a draw of lines carries DeviceLineRasterization on every device; the raster test holds the diamond-exit rule's cells
What:
- RenderCommandEncoder::LINE_NOTE (PrecisionNote::DeviceLineRasterization)
  is the static note of a draw of lines or a line strip, and of a draw of
  triangles under the Lines fill mode, on every device.
- A render pipeline state no longer carries the note; it carried it only
  under alpha to coverage or alpha to one.
- The note's text (artifact.rs, docs/API.md's catalogue, its items list
  and the accepted difference on a line's tie-break, the runtime's README)
  names its grounds, and keeps what it said of a state with alpha to
  coverage or alpha to one: there the device's default line rule draws,
  not Bresenham's mode. One note, both facts.
- The conformance side announces LINE_NOTE for each line draw and each
  Lines fill mode set. The note is among replay's NATIVE_NOTES, so it
  loosens the notices site alone.
- known-gaps-rt.tsv: the 12 primitive-type-restart-indices rows (NVIDIA,
  RX 550, Iris Xe) cite the note. Their lines run through the boundary
  point (3.5, 1.0).
- api_signatures.tsv gains the const's two rows
  (scripts/api-signatures/signatures.py --check passes).
- Tests:
  - raster.rs's Lines pass draws the triangle (-0.65, -0.675), (3, -0.675),
    (-0.65, 3) through the target's own viewport. Its edges at x 1.4 and
    y 6.7 lie inside the target with a pixel on each side, and strictly
    inside the clip volume and the viewport.
  - The pass holds the diamond-exit rule's cells exactly, column 1 and
    row 6, on every device. A device that draws another cell fails with
    the target drawn. It does not read the corner where the two lines'
    ends meet.
  - draw.rs's alpha-to-coverage test now holds that no state carries the
    note, and that LINE_NOTE is it.

Why the note: a card draws a line pixel that differs from Metal's. The 12
ledgered rows are lines through the boundary point (3.5, 1.0): Metal on an
Apple M3 Max covers the lower pixel there, NVIDIA's driver the upper. The
runtime draws lines with VK_LINE_RASTERIZATION_MODE_BRESENHAM. Its diamond
is open, so no Vulkan control decides that pixel. The Vulkan
specification's section "Bresenham Line Segment Rasterization" also lets an
implementation's fragments "not deviate by more than one unit in either x or
y framebuffer coordinates from a corresponding fragment produced by the
diamond-exit rule", with a fragment count within one. Rule 1: a line's pixels
are the device's answer, so the operation carries a static note.

Why the test changed: the old Lines pass put its bottom edge at y 7.7 through
a viewport of y -0.3 and height 8. The Iris Xe drew none of row 7 there
(m3-max-63429 at ce998742d7, m3-max-63507 at 7c1baad228). With both edges
strictly inside the clip volume and the viewport, the Iris Xe draws the
diamond-exit rule's cells, as the other cards do. The fractional viewport's
cut row is a separate item, not a line rule.

Verified, column 1 and row 6 at the test's geometry:
- Iris Xe: m3-max-63735
- RTX 2080: m3-max-63736
- lavapipe: m3-max-63737
- RX 7900 XTX: m3-max-63707, at the same edges
The exact-cell form's legs are named with its sha.

Not a regression: the Lines pass came with a5fac6fa9b (11-20 22:51), and its
viewport moved at 2a36291a80 (23:32). No Iris run of the old pass passed.
2026-11-21 08:02:39 -08:00
Anees Iqbal 895b3f845a PrecisionNote::NativeHalfQuantize: a zero may round to the other zero
What: the note's text (its doc comment and the docs/API.md catalogue)
says what may differ: where a half rounding's input is a zero or too
small for a normal half, the result may be either zero, so a negative
zero may come out positive; and what a program sees of it: a
reciprocal's or atan2's sign, the bits written to a half target or
buffer. The catalogue names the form not taken (copying the input's
sign bit into the result by integer operations, about 4 instructions
per half rounding on every device without shaderFloat16) and its cost.
No code changes; the planner ruled the note (11-21).

Why: the 11-21 round at ce998742d7 read the RX 550 (RADV, Polaris)
answering +0 for a -0 float attribute rounded to a half parameter
(vertex-format cases), where Metal answers -0. The SPIR-V specification
defines OpQuantizeToF16 so: "If the magnitude of Value is too small to
represent as a normalized 16-bit floating-point value, the result must
be either +0 or -0." A zero's magnitude is in that range. So the answer
is the quantize's own, documented, and rule 1 gives it a static note.
The note already covered a denormal rounding to a zero of either sign,
but its text did not name a zero's own sign. SignedZeroInfNanPreserve
is not the fix: it only restrains optimizations ("does not perform
optimizations on floating-point instructions that do not preserve sign
of a zero") and does not narrow what the instruction may answer.

How verified: a text change only. The RX 550's vertex-format rows go to
the ledger under native-half-quantize with the per-card rows.
2026-11-21 08:01:36 -08:00
Anees Iqbal 418494f380 rt: a texture's image accessor no longer shadowed by TextureObject::image; the texture buffer's docs
TextureInner's Option-returning image() lost method resolution to the
TextureObject trait's image() -> vk::Image on Arc<TextureInner>, so
ae747745df did not compile (compile job m3-max-63551 on msi: E0599 at
nine call sites). It is image_of() now. texel_form asked
supports_format with the ash format; it takes the translator's.

Docs for the texture buffers of ae747745df: RESOURCE-ID.md's arrays
paragraph names set 1's bindings 5 and 6 (uniform and storage texel
buffers, 65,536 each) and the null elements of the other kind; API.md's
identity forms list texture buffer reads, writes and atomics, slots and
members alike, and keep refusing the parts or rows forms; the runtime
README's known gaps of textures add the swizzle, the view and blit
copies, and the both-usages format rule.

Verified: rustfmt; the compile job follows on the rebased tip.
2026-11-21 07:27:27 -08:00
Anees Iqbal d245bab9d1 rt: an execution over a range the GPU writes counts its parts with a kernel; parts bounded at 2 MiB of preprocess bytes
What: an execution of an indirect command buffer runs in parts of the most commands whose
preprocess bytes, as vkGetGeneratedCommandsMemoryRequirementsEXT answers with the inherited
pipeline, stay at or under 2 MiB (indirect::PART_BYTES), one rule on every device, in place of
parts of 64 commands. The device is asked from one command up, doubling while the answer stays at
or under the bound, then again at fewer in proportion to the last answer until it is, so no answer
at far more commands than a part takes is trusted (lavapipe's grows with the square of the count
and wraps at 32 bits). An execution over a range a buffer holds (executeCommandsInBuffer:
indirectBuffer:indirectBufferOffset:), location 0 included, ends the rendering, runs the
translator's new count kernel (pipeline::own_kernel(OwnKernel::ExecutionCounts), one workgroup a
part, its parameter block pipeline::ExecutionCounts in the ring), one global barrier, and begins
the rendering again; each part's vkCmdExecuteGeneratedCommandsEXT reads its count at
sequenceCountAddress: its commands through the range's last, none past it or wholly before its
location. A CPU-given range runs no kernel. While a visibility result's query counts the draws,
the execution is refused (Gap::Draw VisibilityResultInterrupt, counted), as the rendering cannot
end inside the query. The runtime makes its own kernels once a device, at first use, through the
pipeline cache and layout (runtime src/own.rs), and destroys them with the device. The idle
preprocess pool's bound goes from 128 to 64 MiB: one frame of the sample now takes about 27 MB of
commands' bytes plus at most one part an execution.

Why: an execution over a GPU range ran the buffer's whole capacity, every command past the range
costing its vertex work. Parts of 64 commands cost 61 times one execution's GPU time on the 2080.
RADV fails past about 4 MiB of generated commands in one execution (draws nothing on a 7900 XTX,
loses the device on a 780M): it chains by sequence count, not bytes. The 2 MiB bound is half that.

Verified: on the probe branch (d59701c670), jobs 63460 and 63481 measured the frame of Apple's
rendering sample: at the 2 MiB bound 931.8 us of GPU time on the 2080 (920.0 at whole capacity)
and 588.5 on the XTX. This commit: compile job and the lavapipe rt suite, reported with the sha.
Tests: the count kernel against a brute-force count on the interpreter and valid on every
committed profile; held ranges at 0, past a part, past the commands, and a CPU range across
parts; a held range in a Boolean visibility mode before and after its first draw; the widest
layout's part at or under the bound on every device.
2026-11-21 06:47:06 -08:00
Anees Iqbal b5ac9fd07b rt: visibility results, one precise occlusion query per mode, copied into the buffer at the pass's end
What: `setVisibilityResultMode:offset:` builds `Boolean` and `Counting`. Each such mode set is one
segment counted by one precise occlusion query (`VK_QUERY_CONTROL_PRECISE_BIT`), begun in the
pass's rendering before the segment's first draw and ended there at the next mode set or the
encoder's end; a segment with no draw begins and ends its query as it ends, so its word is 0.
After `vkCmdEndRendering` the pass copies the counts (`vkCmdCopyQueryPoolResults`, 64-bit, WAIT)
straight into the visibility result buffer's `VkBuffer` at place+offset, one copy for each run of
consecutive offsets in one pool, before the pass's second barrier (recorded or owed), which orders
them before every later command; a Shared buffer's segment end barrier reaches the host, and a
Managed buffer's write and a texture over the buffer in an image of its own are kept as a blit's
write is. `Boolean` writes the count too, nonzero exactly where a sample passed (Metal documents a
nonzero word; the M3 Max writes 1): an accepted difference in docs/API.md section 10, and the
conformance cases compare a `Boolean` word as nonzero alone.

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

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

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

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

Verified: cargo fmt; scripts/api-signatures --bless/--check, refusal_surface (0 without reach or
basis), metal-coverage and conformance-coverage regenerated, check_device_profiles (0 findings).
The compile job (fmt, signatures, clippy plain / --cfg m2v_gpu / --cfg m2v_cpu_icd, workspace
Rustdoc -D warnings) and the lavapipe rt suite, with tests/visibility.rs (Boolean and Counting
against the CPU's counts, pool reuse and the 16-pool bound past 17, Metal's refusals, Accumulate,
the barrier and attachment-read interrupts), are named in the lane's report.
2026-11-21 06:16:57 -08:00
Anees Iqbal c3f9f55e63 rt: a kernel past the stage bound is made from its helper's compile alone, never compiled in the process
A driver's compiler takes memory that grows faster than the stage, in the process that creates the
pipeline. The translator refused every stage past COMPILED_STAGE_WEIGHT (99,109, the heaviest
measured to compile within host-sized memory, ANV on the Iris Xe of RPL-P), where Metal makes it.
Now the translator states the weight and the runtime compiles such a kernel only in a helper
process the consumer starts, caps and times.

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

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

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

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

Tests: tests/stage.rs: the directory past capacity on both bounds, oldest use out first, a hit
outliving older entries, a breach under the same bounds; cut, foreign-key, other-header and
unknown-breach entries a miss and removed; the wire's version and cut frames; the request's
joinable bounds; and on a device (m2v_gpu, m2v_cpu_icd), with the bound lowered for the test, the
refusal with no directory, lavapipe's NoPipelineCache, and elsewhere refused unfilled, filled by
serve_stage over two pipes, made from the entry alone with the shared cache's data unchanged,
then refused by a recorded breach.
2026-11-21 05:55:29 -08:00