Commit Graph
1986 Commits
Author SHA1 Message Date
Anees Iqbal d54a1a5568 Validation: the MoltenVK backend, its C3 venue and the old engine's baseline are deleted
The validation executor's Vulkan side runs on Linux through native ICDs
and the runtime. No lane records MoltenVK rows any more, and no MoltenVK
venue is wanted. This commit deletes the MoltenVK backend from the
store up.

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

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

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

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

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

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

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

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

Verified: cargo fmt. The compile gate follows as a potluck job.
2026-11-20 22:15:02 -08:00
Anees Iqbal c034220175 Private memory past the 16 KiB floor lives in the runtime's arena, one slot an invocation; a dispatch past its budget splits
A kernel whose private arrays (indexed at run time) passed the translator's 16 KiB floor was
refused as Unsupported{PrivateMemory}. The app's 780M library holds 7 such kernels (19,792 to
34,736 bytes a thread), and the Iris walk refused one at 28,704. Metal holds that memory itself.
The runtime now holds it in device memory it owns.

Translator, under the identity domains only (the default domains' binder supplies no such
memory, so they refuse as before):
- memory::plan::private_memory: a kernel with no call stack whose private bytes pass the floor
  places every alloca it indexes at run time in its private arena, and marks the arena
  ArenaLayout::device. The arena then leaves the private bytes. The kernel's own bytes decide;
  no device fact does.
- Such an arena has no Private variable. Its words are PhysicalStorageBuffer words (Aligned 4)
  at the invocation's slot. The slot is PushField::PrivateArenaAddress (a u64) plus
  i * slot_bytes, with i = ((wz*ny + wy)*nx + wx)*n + LocalInvocationIndex in 32 bits. It is
  computed once in the entry block (dispatch::KernelDecl::arena_slot, Invariant::ArenaSlot).
  RuntimeFact::PrivateArena { slot_bytes } states the slot: the arena's bytes rounded up to 16.
- A tile kernel's arena past the floor stays refused (PrivateMemory). A slot past u32 is
  LimitExceeded(PrivateArenaBytes).

Runtime (crate::arena):
- The arena is one Private pool block, never zeroed: Metal's private memory is undefined until
  the thread writes it. The device keeps a Weak to the last block. Each command buffer that
  dispatches into a block keeps it (keep_block), and a dispatch that needs no more than a block
  still kept takes it again.
- A dispatch's slots take at most 1/16 of the largest DEVICE_LOCAL heap, capped at the longest
  block, or one threadgroup's slots where those are more. A dispatch past that budget runs in
  pieces of whole threadgroups through the existing split loop, each piece's DispatchRegion
  carrying its first threadgroup. There is one split form; vkCmdDispatchBase is not used.
- A barrier (the encoder's owed barrier, so it merges with a hazard barrier) comes before each
  arena piece, except the first piece in a block the dispatch took new. Dispatches of kernels
  without an arena take no new barrier.
- An indirect dispatch of an arena kernel is Gap::IndirectPrivateArena: its counts are the
  GPU's, so the runtime can neither size the arena nor split it.
- Metrics::private_arena_dispatches, private_arena_pieces and private_arena_blocks count the
  path, and private_arena_allocations counts the block takes.
- The budget a device test splits with is Core::arena_budget's test override (cfg(test) with
  m2v_gpu or m2v_cpu_icd), never a DeviceOptions field.

Docs: docs/API.md (the field, the fact, the slot formula), the runtime README (Compute
encoders: the arena, its budget, its order, the indirect gap), docs/REFUSALS.md (regenerated),
api_signatures.tsv (blessed).
SEMANTICS_VERSION 2244 -> 2245, ARTIFACT_FORMAT_VERSION 581 -> 582, RUNTIME_VERSION 2549 -> 2550.

Tests:
- engine_private_memory's
  a_kernel_past_the_floor_keeps_its_private_memory_in_the_runtimes_memory_under_identity:
  7176, 9216 and 51,200 words on the 780M's, the Iris Xe's and an RTX 50's profiles. Each compiles,
  passes L3, pushes the address, states the fact, holds 0 private bytes and records no note.
  The default domains refuse as before.
- rt private_arena's
  every_device_holds_private_memory_past_the_floor_in_its_arena_split_or_whole: 28,704, 36,864
  and 204,800 bytes a thread, 8 groups of 64, under the device's budget (1 piece) and a test
  budget (4 and 8 pieces). Every answer matches a CPU reference. It counts 2 arena dispatches,
  their pieces, and exactly 2*pieces - (blocks taken) barriers beyond a plain command buffer's.
  Four plain dispatches take the barriers one does.

The kernel interface declares the arena's slot (Interface::private_arena, the slot bytes of
RuntimeFact::PrivateArena); the compute test's interface sets it to None.
2026-11-20 22:37:06 -08:00
Anees Iqbal df0ed4188e rt: the blit options test compares aspect bits; the ledger follows the plane copies
7ba1cdbf30's suite (m3-max-61836, msi) did not compile the host test: ash's
ImageAspectFlags has no Debug, so assert_eq! of a (flags, bytes) pair fails. The test
compares the flags' bits.

The lavapipe conformance run of that suite (the conformance binary built) shows what the
options copies answer now. Its ledger rows follow:
- buffer-depth-samples-d16-54-4, -s8-54-4 and -s8-part-4 (every venue) refuse the copy
  into the multisample texture as Gap::TextureBytes at step 1, no longer Unavailable;
  the -54-2 rows of the RX 550, the 780M, the RX 7900 XTX, NVIDIA and the Iris Xe take the
  same answer (expected: the same multisample refusal; lavapipe refuses 2 samples first).
- texture-fills-260 refuses the upload into Depth32Float_Stencil8's float depth
  (Gap::FloatDepthUpload) at step 0.
- texture-fills-261 copies X32_Stencil8's stencil plane at step 0 and stops at
  fillTexture:level:slice:region:bytes:length: (Unavailable) at step 1.
No row of MTLBlitOptionDepthFromDepthStencil or StencilFromDepthStencil is left.
CONFORMANCE-COVERAGE.md regenerated.

The same run also lists 10 argb8-targets-* rows divergent at case/notices
(metal2vulkan-degrade-rotated-blend-rounding) on llvmpipe. They come from development's
own rotated-blend notes, not from this change.
2026-11-20 22:20:00 -08:00
Anees Iqbal 7ba1cdbf30 rt: a blit copy between a buffer and a texture takes MTLBlitOption's plane options
copyFromBuffer:...:options: and copyFromTexture:...:toBuffer:...:options: are
BlitCommandEncoder::copy_from_buffer_with_options and
copy_from_texture_to_buffer_with_options, with a public BlitOption (None,
DepthFromDepthStencil, StencilFromDepthStencil). A plane option copies the aspect it
names, one vkCmdCopyBufferToImage or vkCmdCopyImageToBuffer region of that aspect, where
the pixel format has it: the depth or the stencil of a combined format, and the depth of
Depth16Unorm or the stencil of Stencil8 too, which Metal takes (the conformance crate's
buffer-depth-samples rows put the option to Metal on those formats). The forms without
an option are those of None. The unit is texture.rs's copy_unit of the named aspect, so a
copy into a 32-bit float depth is Gap::FloatDepthUpload as Depth32Float's is, and a
multisample texture stays Gap::TextureBytes; a plane option of a format without its
aspect is Gap::TextureBytes. MTLBlitOptionRowLinearPVRTC is not offered: the runtime
makes no PVRTC texture, and the conformance side keeps it unavailable.

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

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

Tests: tests/blit_options.rs. On the host, each option's aspect and unit bytes in both
directions, and each refusal. Under a device cfg, a pass clears a Depth32Float_Stencil8
texture to depth 0.25 and stencil 0x5a, a stencil region goes in from a buffer, and both
planes come back out (the region with 0x5a around it, 0.25 at every texel);
Depth16Unorm's depth and Stencil8's stencil go in and come back out bit for bit.
2026-11-20 22:11:29 -08:00
Anees Iqbal 83bde8268f docs: under the identity domains, constexpr samplers a lane chooses among are a switch, not a refusal
API.md still listed "an array of samplers" among the forms the identity domains refuse, which
the previous commit made a switch over the candidates. The refusal list drops it, and the sampler
array paragraph says the identity domains always take the switch, each candidate sampled
through the constexpr sampler the consumer pushes (their stages bind no set-0 sampler).

Docs only.
2026-11-20 22:35:58 -08:00
Anees Iqbal afd9686408 rt: a fragment function's stencil output is the device's own where it lists the export
A fragment function's `[[stencil]]` output is the fragment's stencil reference, which Metal's
stencil test and its Replace operations take (Metal's feature set tables give stencil feedback to
the Apple5 family and later and to Metal 3 and Metal 4). rt enabled VK_EXT_shader_stencil_export
on no device, so the translator refused every such function (`StencilExport`): under the
identity domains its pixel-interlock form is never chosen (lower::fragment::fetch::interlock_forms).

floor: VK_EXT_shader_stencil_export joins OPTIONAL_EXTENSIONS, enabled where the device lists it,
and its name reaches the translator's profile (shader_extension), whose fragment stage then
writes `FragStencilRefEXT`, the one form there. A device that does not list it keeps the typed
refusal, naming StencilExport: no answer chooses a second form.

Venues (the supported device extension list of each vulkaninfo dump, read as JSON): RADV on the
RX 7900 XTX, every 780M and the RX 550, ANV on the Iris Xe, lavapipe, KosmicKrisp on the M3 Max
and the UHD 630's Windows driver list it (m3-max-48727 to 48731, 48736, 48737 and 61508); NVIDIA's
620.70.06 on the RTX 2080 and RTX 3090 and 615.71.09 on the RTX 5080 Laptop do not (48727, 48729,
48731).

Docs: the runtime README's extension table, the render pipeline states' refusal line, and a
known gap for a device without the export. REFUSALS regenerated: no change. The public signature
table holds floor::OPTIONAL_EXTENSIONS' value, which gains the extension; no signature moved.

Ledger: stencil-output and stencil-output-loaded move from every venue to NVIDIA, where they
still refuse naming StencilExport. pass-sequence-aspect-actions keeps that row on NVIDIA and,
where the export is listed, refuses one step later as a state with DepthStencilFormats: rows for
llvmpipe and RADV (verified) and for Iris(R) Xe, UHD Graphics 630 and Apple M3 Max (expected
from their extension lists). CONFORMANCE-COVERAGE.md regenerated (7692 ledger rows).

Test: tests::stencil_export on every device of the cfg's kind: where the device lists the
extension, Device::extensions names it, the translator's profile has it, and a draw of
stx_stencil_by_pixel under a Replace depth-stencil state stores each pixel's output's low 8 bits
(two of every three outputs carry higher bits) in the Stencil8 attachment; elsewhere the state is
refused naming StencilExport. floor's an_optional_extension_is_enabled_where_listed and the
README's table test take the list as it is.

Evidence, at 6e1004de4d and 149a5296e7 (earlier forms of this commit):
- The 16 public cases (valexec2's E/F/G proof m3-max-61598): before, at f3418eacb9 on lavapipe
  (m3-max-61725), not_supported naming StencilExport; after, at 6e1004de4d, 16/16 match on
  runtime-render (m3-max-61732).
- Conformance on lavapipe at 149a5296e7 (m3-max-61812, ms01): every stencil row as the ledger
  says; its one other line, blend-interaction-format-srgb8 divergent on LLVM 23.1.4, is that
  lavapipe's blend and no stencil case. At 6e1004de4d: RTX 3090 (m3-max-61739) exactly the
  ledger's NVIDIA rows; RX 7900 XTX (m3-max-61740) the three rows as this ledger states them.
- The device test at 149a5296e7: lavapipe passes (61812); RX 7900 XTX, 64 pixels stored their
  output (m3-max-61859); RTX 3090, refused naming StencilExport (m3-max-61860).
2026-11-20 22:41:02 -08:00
Anees Iqbal 2c5573d598 rt: a refused pipeline state's Error::Translation names its functions
What: Error::Translation is now Error::Translation { error, functions }. new_compute_pipeline_state
and new_render_pipeline_state fill `functions` at their public entry with each Function stage's own
name in its library (FunctionInfo::name), in stage order (the vertex function before the fragment
function), and the Display prints them: "the translator made no pipeline of a, b: ...". A compiled
stage has no name; a sampler state, a device and a dispatch's late kernel variant name none, and
then the text is as before. It is a diagnostic for the program's log, documented as the text of
the NSError Metal's failed creation gives; no lowering or decision reads it.

Why: the consumer logged only the first refusal of each kind, which hid 6 of one 3D modelling
app's 8 refused kernels; with the names it logs every refused create.

How: the existing creation bodies moved to private compute_pipeline_state and
render_pipeline_state, whose translator errors name no function (Error::translation, for map_err),
and the public entries map them through Error::of_stages. The one-token map_err edits are in
pipeline.rs, render.rs, sampler.rs:371 and device.rs:1290 and 1294.

Same commit: 10 rt test patterns; validation's candidate/platform/runtime.rs (2),
candidate/tests/engine_compute.rs, replay/new_runtime/mod.rs and replay/new_runtime/tests.rs (3);
conformance's rt_side.rs, rt_side/states.rs and case.rs. Conformance's Failure::of_rt records the
error's text without the names (they are the case's own functions), so the 484 answers in
known-gaps-rt.tsv stay as they are. The rt README's compute and render state entries say what
`functions` holds; REFUSALS.md and api_signatures.tsv are regenerated (one changed signature).

Consumer break to follow: reims-vgpu builds or matches rt::Error::Translation(..) at 17 sites,
all in crates/reims-vgpu-vulkan/src/rt_platform/: unbuilt.rs (7), diag.rs (5), library.rs (3),
pipeline.rs (1), argument.rs (1). Each becomes Translation { error, .. } in a match, or
Translation { error, functions: Vec::new() } where it builds one.

Tests (device cfgs): every_device_names_the_function_of_a_refused_compute_state (translate.rs):
a compute state of the vertex function colored_vertex is Error::Translation with functions
["colored_vertex"], and its text starts "the translator made no pipeline of colored_vertex: ".
every_device_refuses_the_patch_draws_it_does_not_build (patch.rs) now also holds the
control-point index type's Tessellation refusal to functions ["tess_triangle_points",
"tess_fragment"] and to the text that names them in that order. Without the entry mapping both
fail on an empty `functions`.
2026-11-20 22:25:11 -08:00
Anees Iqbal 62b3e5a250 rt: the render encoder's use_resource, and a draw after a declared write of a texture with no storage element is Gap::StorageElement
What: RenderCommandEncoder::use_resource is useResource:usage:stages:, its plural and their
deprecated forms without stages. The command buffer keeps the buffer or the texture until it
retires and nothing is recorded: every resource is resident to every function, and the pass's
barriers already order its draws. A usage that writes a texture (or a view of one) made for
shader writes with no storage element marks the encoder, and every later draw whose vertex or
fragment function may reach a texture through its storage image beyond its slots
(PipelineInterface::unbound_storage_textures: an argument buffer's write or read_write texture, a
resource ID) is Gap::StorageElement with no slot, as the compute encoder's dispatch already is.
Before this, such a draw ran and Vulkan dropped the writes Metal makes. The declaration
invalidates the encoder's held draw facts, so a draw of an unchanged state and bindings after it
is checked again.

Also: the three redundant explicit links in new_render_pipeline_state's docs (private rustdoc
-D warnings, from 3653240b57) are plain intra-doc links; Refusal::OtherDevice's doc names the
render encoder's calls; the README's storage-element known gap no longer waits for the render
encoder's useResource:, and the render encoder's section describes use_resource; coverage.tsv
marks the four MTLRenderCommandEncoder useResource rows implemented; REFUSALS.md,
METAL-COVERAGE.md, CONFORMANCE-COVERAGE.md and api_signatures.tsv regenerated.

Test: every_device_refuses_a_draw_after_a_declared_write_of_a_texture_with_no_storage_element
(storage_element.rs, device cfgs): an owned fragment function writes an argument buffer's
texture2d<float, write>; for RGBA8Unorm, RGBA8Unorm_sRGB, BGRA8Unorm_sRGB, A8Unorm and an sRGB
view of an RGBA8Unorm texture, a draw before the declaration draws, the same draw after
use_resource(WRITE) is Gap::StorageElement { slot: None, pixel_format } exactly where the texture
has no storage element, and a colored_fragment draw after the declaration draws; the fragment
function's write through its resource ID lands (1, 0, 1, 1). Without the Facts::find check the
refused cases draw and the test panics.
2026-11-20 22:08:11 -08:00
Anees Iqbal a134775713 Simd: Metal's own lockstep, fragment and vertex simdgroups, and full quads go
DriverDeviation::SimdgroupLockstep, MetalFragmentSimdgroups, MetalVertexSimdgroups and
MetalFullQuads were never taken, and neither were their VkProperty twins and codec tags.
Device::from_queries enables no Metal* property, and no committed profile carries one. The forms
that only they reached go with them:
- Lockstep. Kernel ordering no longer leaves out a barrier that only emulated simdgroups make
  exact on a device that runs a simdgroup in lockstep. This removes OrderKey's device bit and the
  Decision's count, air::Lockstep::device in metal2vulkan-air, SimdPlan::device_lockstep, the
  census name barrier.lockstep.device (simd::DEVICE_LOCKSTEP) and the module's
  VkProperty::SimdgroupLockstep requirement. Every such place takes its barrier and tier as on
  every real device.
- Fragment simdgroups. SimdPlan::metal_lane and its requirement go. A fragment's
  [[thread_index_in_simdgroup]] is the device's grouping's lane on every profile, and the SimdWidth
  refusal no longer offers VkProperty::MetalFragmentSimdgroups as an alternative: it needs the
  32-lane width alone, as subgroup::tier's own width refusal does. docs/REFUSALS.md's row and the
  fixture inventory's 24 refusal cells on the eight gsm2_fragment_lanes rows change with it.
- Vertex simdgroups. The prefix lane goes: SimdPlan::prefix_lane, its Private word and entry hook
  (simd::emit_entry), and SubgroupRequirement::metal_vertex_simdgroups with its swap of
  SubgroupStage(Vertex). A vertex function's simdgroup operations need the stage listed, as on
  every real device.
- Full quads. SimdPlan::metal_full_quads and its requirement go. A fragment whose group operations
  count the helpers needs shaderQuadControl, as on every real device.

Rule 1: no note stops being raised. FragmentSimdgroupGrouping was withheld only on a
MetalFragmentSimdgroups profile, so on no real device, and it is now raised wherever the
function's answer reads the simdgroup's members, on every profile. Its catalogue entry already
said "on every device", and its doc in artifact.rs now says so too. The other three forms carried
no note. Their inputs now take a barrier, a refusal or the device's grouping, as on every real
device. The catalogue loses no entry.

Validation: c3.rs's FragmentSubgroupUnderTwoQuads doc clause becomes "every device takes that
note, so the gap's answer is always announced". That is the one validation file that named one of
these deviations. It used the deviation only to explain why the gap's answer is always announced,
because the allowance code never reads the deviation. Nothing else in c3.rs changes. The fixture
README's gsm2_fragment_lanes row drops the Metal lane and the gone driver_deviations lane, and its
gsm2_simd_products and gsm2_vertex_votes_shifts rows drop MoltenVK's measured vertex classes.

Tests: the asserts that no module requires one of these properties, or counts
barrier.lockstep.device, go with them. This covers engine_simd_lockstep's two emulated-tier
tests, its no-barrier lists and LOCKSTEP_NAMES, engine_simd's fragment-lane test (whose narrow
refusal now needs the width alone), and engine_matmul2d's tier assert, which held on every profile
once no profile had the property. Also going: device/tests/subgroup.rs'
a_measured_vertex_stage_states_its_fact_in_place_of_the_stage and the requirement literals' field.
engine_fragment's simd_after_discard takes quad control alone.

SEMANTICS_VERSION 2241 and ARTIFACT_FORMAT_VERSION 579 are placeholders that main renumbers.
SEMANTICS: the profile's fingerprint, the SimdWidth refusal's needs and the census of the same
input change form. ARTIFACT: the codec loses four VkProperty tags and the requirement's field.
RUNTIME_VERSION stays, because the pinned sources' edits remove forms and fields no profile
reached. runtime-sources.sha256 takes the new hash, and api_signatures is blessed.

Consumer check (consumer-uses.sh, consumer development a414607f95, 62 refs): SimdgroupLockstep,
MetalFragmentSimdgroups, MetalFullQuads, metal_vertex_simdgroups and DEVICE_LOCKSTEP have 0 hits
in code. MetalVertexSimdgroups has 0 hits on development. It is used in
crates/reims-vgpu-vulkan/src/gpu/encode_render/tests/metal_tests.rs on 36 of the consumer's
steelbrain/* branches younger than a day, a file its development does not have.
air::Lockstep::device: the consumer's development names no `lockstep` at all.

Verified: m3-max-61467 (homelab-gem10-1): fmt, clippy (all features, --cfg m2v_gpu, --cfg
m2v_cpu_icd) and Rustdoc green at the old base (m3-max-61463 before it failed on four unused test
imports, removed).

Rebased onto development d10a14d5af: the SEMANTICS placeholder is one above its 2235 in stack order
(ARTIFACT_FORMAT_VERSION is already above its 574). The checks above ran at the old base acc706ca47;
the rebased stack's tip is checked by m3-max-61756 (msi-laptop), at the stack rebased on d6d56b8a7c
(tip 5c74fad38d, whose diff from its base is this stack's diff from d10a14d5af): fmt, clippy (all
features, --cfg m2v_gpu, --cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan,
metal2vulkan-validation, metal2vulkan-conformance and metal2vulkan-runtime ran 5877 tests, 5870
passed. Of the 7 failures, the old render descriptor key's test is unpinned; golden_hashes and
engine inventory parts 4, 5, 7 and 8 are bless due (the profiles' fingerprints changed); and
metal::state's encoder_raster_state_needs_its_features fails the same way at development d10a14d5af
itself (m3-max-61802, where runtime-floor gained depthBiasClamp in a529fb658e), as inventory parts
3, 4, 5 and 8 do there. The stack as rebased on 72e1754218 (tip 090d544208: the same product
changes, without the test-only push sweep fix) played 36 distinct streams over 61 runs on five nodes
with 0 refused (player m3-max-61537; plays m3-max-61548, 61549, 61550, 61559 and 61569).
2026-11-20 22:07:19 -08:00
Anees Iqbal 305d85a2a2 Sampler: Metal's own sampler and the cube-gradient routes go
DriverDeviation::MetalSampler, CubeGradientRoute and GraphicsCubeGradientTangents, with
VkProperty::MetalSampler and its codec tag, were never taken: Device::from_queries enables no
Metal* property and always inserts VkProperty::DeviceSampling, and no committed profile carries
a Metal* property. ProfileFields::cube_gradients, with CubeGradients and CubeGradientRoute, had
one reachable value (Vulkan's rule for both stages), so it goes too. The forms only they reached
go with them:
- Cube gradients: CubeFootprint::Metal and ::Projected (MoltenVK's gradientcube and its
  graphics fixup); a cube's explicit gradients take Length, Face or Word by the sampler's
  anisotropy alone, and CubeGradientFootprint is raised wherever the shader does not take
  Metal's level and taps itself.
- The sampler requirement: SamplerFamily::metal_sampler merges into device_sampling. Every
  sample, gather and LOD query, the hoisted no-bias samples and BiasReach::Metal's included,
  requires VkProperty::DeviceSampling and records DeviceSampling, as on every real device.
- The half-texel routine (lower/texture/half.rs) and everything only it read: HalfClass,
  half_class and heap_half_class, TexelLanes and TexelOrigin, the texel argument of texel_value
  and held_value, sample_lanes and word_reads_one, Sampling::one_texel's word forms (one_texel
  now answers whether an access may read one texel, which float_texel_notes reads) and
  half_texel, SamplerSlot::texels, SlotPlan::half_format and unmeasured, TexturePlan::heap_half,
  the declarations half_format, half_routine and plain_half, the module's table of heap texel
  classes (AccessPlan::heap_class, declare_heap_classes, heap_texel_class, HEAP_CLASS_WORDS, and
  texel_format::heap_classes, whose tests now read the layout itself),
  texel_round::f32_to_half_from_even, NoteOn::Unmeasured, SpecKey::UnmeasuredTexels and
  PlainHalfTexels with their plan answers, TexelFormat::YCBCR_8192, MEASURED_ON_METAL_SAMPLER,
  unmeasured_on_metal_sampler and plain_on_metal_sampler, and the identity-domain refusal of a
  heap half sample that only a Metal-sampler profile met.
- The Metal sampler's YCbCr filter note (linear::filter_note and metal_filtered_ycbcr), with
  NoteOn::HeapYCbCr and ArgumentSamplers, SpecKey::HeapYCbCrTextures and
  FilteringArgumentSampler, their plan answers and TexelFormat::two_plane_ycbcr.
- The anisotropic not-mipmapped clamp [0, 0] (vk_sampler's own_anisotropic) and its note's
  source (anisotropic::own_not_mipmapped); PrecisionNote::NotMipmappedAnisotropicFilter, its
  codec tag, conformance Degradation and validation allowance go with its only source.
- The rest: device_texels, device_decode's and fragment/color.rs's Metal decode,
  bind::plan::resources' swizzled_packed profile test, and border_read's metal_sampler (and
  device_opaque_black's format argument, which nothing then read).

Rule 1, per note the commits stop raising: every one is case (b), no difference goes silent.
- filter_note's HalfSampleFilter and FloatSampleFilter (slot clauses on a bound two-plane YCbCr
  format and the bound sampler word, heap clauses on HeapYCbCrTextures and
  FilteringArgumentSampler): raised only on a profile with VkProperty::MetalSampler, so on no
  real device. Such a filtered sample goes to the device's own sampler, and every sample,
  gather and LOD query sets device_sampling, so the stage records DeviceSampling, whose entry
  covers the device's filter of a two-plane texture. The in-place Y'CbCr model's
  HalfSampleFilter and FloatSampleFilter stay as they were.
- NotMipmappedAnisotropicFilter: raised only under own_not_mipmapped, which needed
  MetalSampler. An anisotropic sample on a device with samplerAnisotropy goes to the device's
  sampler (DeviceSampling, its not-mipmapped clamp [0, 0.25] the device's footprint), and one
  without it keeps AnisotropicFilter or DeviceAnisotropicFilter, as on every real device.
- The rest only widen: HalfTexelConversion (now outright at every half read, sample and gather,
  where the Metal-sampler profile tested the bound class), DeviceTexelConversion, SrgbTexelDecode
  and CubeGradientFootprint, each withheld only on a Metal-sampler or Metal-route profile.
The precision-note catalogue loses NotMipmappedAnisotropicFilter alone; the docs of
GradFromBias, HalfTexelConversion, HalfSampleFilter, SrgbTexelDecode, FloatSampleFilter,
DeviceSampling and DeviceTexelConversion lose their Metal-sampler clauses (docs/API.md's entries
already stated the one rule).

Validation: comparison.rs's allowance list loses NotMipmappedAnisotropicFilter (unbounded),
which no device raised; its HalfSampleFilter and FloatSampleFilter reasons now name the in-place
model, their class unchanged (unbounded). No validation file names a deleted DriverDeviation.

Also, from the planner: the citation of VUID-RuntimeSpirv-NonUniform-06274, which spec 1.4.366
no longer has, becomes VUID-RuntimeSpirv-None-10148 and VUID-RuntimeSpirv-subgroupSize-10149 in
spirv/builder/ops/memory.rs, spirv/ir/module.rs (twice), spirv/serialize/mod.rs and the doc of
non_uniform_elements_are_decorated_through_what_carries_them. Comments only.

Tests: each deleted form's tests go with it: lower/arith/tests/half_texel.rs (the routine, its
plain arm, and the steps that bounded the Metal-sampler note) with arith/tests.rs'
quantize_flush_of, which only it read,
f32_to_half_from_even_is_exact_on_every_tie, the projected-footprint test and the swizzle
helper of face/tests/anisotropic.rs, texel_format's ycbcr_8192, wide16 and
metal_sampler_s_read_bits tests, the format version 326 round trip, and the routes' asserts in
engine_handles, engine_heap_binder and engine_sampler_unk. The rest assert the device's sampler
on every profile: half_reads_round_their_texel_to_nearest_even (was
half_reads_convert_by_the_bound_format), heap_half_texels_round_the_device_s_texel (was
heap_half_texels_convert_by_the_handle_s_class), heap_linear_samples_are_the_device_s (no
FloatSampleFilter, outright or specialized), engine_sample_coordinates' requires_the_sampler,
engine_bias_reach, engine_graphics_binder's border test, engine_srgb_decode, engine_sampler,
the routines test, the merged-members round trip, and metal/sampler.rs' and
format/tests.rs' opaque-black calls.

SEMANTICS_VERSION 2239, ARTIFACT_FORMAT_VERSION 577 (placeholders; main renumbers). SEMANTICS:
the profile's fingerprint and the notes of the same input change form. ARTIFACT: the codec loses
the VkProperty, the PrecisionNote and four SpecKey tags. RUNTIME_VERSION stays: the pinned
sources' edits (device/, bind/plan/resources.rs and slots.rs, metal/sampler.rs, cache/codec.rs)
remove forms and keys no profile reached, so no run changes; runtime-sources.sha256 takes the new
hash. api_signatures is blessed; docs/REFUSALS.md and the coverage are unchanged.

Consumer check (consumer-uses.sh, consumer development 2040502291, 62 refs): CubeGradientRoute,
GraphicsCubeGradientTangents, CubeGradients, cube_gradients, FilteringArgumentSampler,
HeapYCbCrTextures, PlainHalfTexels and UnmeasuredTexels 0 hits (code). MetalSampler and
NotMipmappedAnisotropicFilter: 0 hits on development (its answer.rs names neither, and it has no
gpu/rgbx.rs); named in crates/reims-vgpu-vulkan/src/answer.rs and gpu/rgbx.rs on 36 of the
consumer's steelbrain/* branches younger than a day.

Verified: m3-max-61441 (msi-laptop, this tree): fmt, clippy (all features, --cfg m2v_gpu,
--cfg m2v_cpu_icd), Rustdoc green; tests 5861 of 5863 passed. The two failures:
golden_hashes_match_the_table, every one of its 29536 cells under a changed profile fingerprint
(re-blessed on development at a named pin), and the_old_render_descriptor_key_keeps_its_value,
left unpinned until the next named pin.

Rebased onto development d10a14d5af: the SEMANTICS placeholder is one above its 2235 in stack order
(ARTIFACT_FORMAT_VERSION is already above its 574). The checks above ran at the old base acc706ca47;
the rebased stack's tip is checked by m3-max-61756 (msi-laptop), at the stack rebased on d6d56b8a7c
(tip 5c74fad38d, whose diff from its base is this stack's diff from d10a14d5af): fmt, clippy (all
features, --cfg m2v_gpu, --cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan,
metal2vulkan-validation, metal2vulkan-conformance and metal2vulkan-runtime ran 5877 tests, 5870
passed. Of the 7 failures, the old render descriptor key's test is unpinned; golden_hashes and
engine inventory parts 4, 5, 7 and 8 are bless due (the profiles' fingerprints changed); and
metal::state's encoder_raster_state_needs_its_features fails the same way at development d10a14d5af
itself (m3-max-61802, where runtime-floor gained depthBiasClamp in a529fb658e), as inventory parts
3, 4, 5 and 8 do there. The stack as rebased on 72e1754218 (tip 090d544208: the same product
changes, without the test-only push sweep fix) played 36 distinct streams over 61 runs on five nodes
with 0 refused (player m3-max-61537; plays m3-max-61548, 61549, 61550, 61559 and 61569).
2026-11-20 22:07:19 -08:00
Anees Iqbal efa911bc00 Arith: the Metal arithmetic deviations and the profile's float-function and NaN-encoding fields go
DriverDeviation::MetalFloatFunctions, MetalCanonicalNans, MetalFloatDenormals,
MetalUnaryDenormals, MetalMinMax, MetalHalfFma, MetalPackConversions, MetalHalfArithmetic,
MetalNanMoves and MetalHalfConversion, with their VkProperty values and codec tags, were never
taken: Device::from_queries enables no Metal* property, and no committed profile carries one.
Their forms go, and so do the two profile fields each left with one reachable value:
- ProfileFields::float_functions and FloatFunctions (only Native was reachable): the device's
  functions are never Metal's own. Gone with it: pipeline::EntryMath (public), the entry-math
  argument of PrecisionNote::of_float_operator and of_math_call, libm's Mode and its
  device_answers and device_near_equivalent, spirv's ProductForm (a product is an OpFMul, its
  negative-zero Fma form gone), and arith's OpNotes, MetalOwn and metal_functions_in (a call's
  notes are a BTreeSet<PrecisionNote>).
- ProfileFields::nan_encoding and NanEncoding (only Native was reachable): NanAnswer's
  device_answers and nan::encoding go; every NaN Metal answers is noted NativeNanEncoding.
- Denormals: denormal.rs keeps covered() alone (Covered, device_flushes, unary_kept and
  moves_sign go); every f32 denormal left to the device is noted DeviceDenormals.
- MinMax: Metal's minimum and maximum family is the device's NMin, NMax and NClamp, noted
  NativeMinMax (device_min_max goes).
- MetalHalfFma: its arm and test go.
- Pack conversions: every air.pack and air.unpack is noted DevicePackConversion
  (pack::measured and ArithPlan::metal_packs go).
- Half arithmetic: the device's 16-bit half + - * is taken only under the 16-bit float controls;
  F16Basis goes (f16_arithmetic answers a bool), and so do ArithPlan::f16_arith and the
  FastMathRewrites note of the measured form left to the device's compiler.
- NaN moves: a widening's, a negation's and a magnitude's NaN is the device's, noted (moved_nan,
  moves_nan, nan::moves_answered, FloatFacts::nan_moves and ArithPlan's nan_moves and
  held_nan_moves go). A half texel's write to a 32-bit float format notes DeviceNanEncoding on
  every device (texture::half_write_nans' Wide class goes; HeapNanFamilies' NAN_WIDE family
  now holds no deviation).
- Half conversion: every half the module rounds through the device's conversion is noted
  NativeHalfConversion; texture::half_texels (a sample of a 32-bit float texel) and
  half_texel_nans (a 32-bit float or packed small float class) lose their MetalHalfConversion
  exceptions, so both note those classes on every profile. Gone with it, the analyses only the
  measured facts read: narrow::round_measured (round serves) with the
  measured roundings the builder and the IR carried, narrow::rounds_unmeasured,
  narrow::moves_unfolded with the merges module, and the stored texels the texture writes
  recorded for it.
compile.rs's half-rounding block keeps converts, widens, the controlled and fused roundings and
their three notes; the MetalNanMoves, MetalHalfConversion, MetalPackConversions and
MetalHalfArithmetic requirements go.

Notes: the precision-note catalogue loses no entry. Every note the deleted forms withheld is
still raised, now on every device (NativeNanEncoding, DeviceDenormals, NativeMinMax,
DevicePackConversion, NativeHalfConversion, HalfTexelConversion, DeviceNanEncoding, NativeDot,
NativeMix); their docs and docs/HOWTO.md lose the measured exceptions, and the docs of a device
whose functions are Metal's own go from math.rs, arith and artifact.rs.

Validation: c3/bound.rs asks the product's notes of an operation (AirOp::product_notes), part of
how C3 decides a near-equivalent; it passed an EntryMath the product read only for the
unreachable form, so it drops the argument and its answers are unchanged.
fast_trig_within_apples_bound's doc loses the MoltenVK clause.

Tests: each deleted form's tests go with it (the_maths_functions_are_the_device_s, the member
format version 486 round trip, a_measured_half_sum_requires_the_arithmetic_fact_alone,
a_merge_of_a_select_is_followed_through_struct_members, the device_answers asserts), with the
hand-set profile fields only they used (FloatFacts' nans, device_denormals, unary_denormals,
native_min_max, nan_moves). The rest assert the note on every profile: engine_arith,
engine_float_call_notes (its note class is the fma route alone), engine_native_half,
engine_metal_denormals, engine_tiny_products, engine_rate_map, engine_opencl_mode,
engine_texture, engine_extended_range's heap test, from_queries, arith's and narrow's tests.

SEMANTICS_VERSION 2238, ARTIFACT_FORMAT_VERSION 576 (placeholders; main renumbers). SEMANTICS:
the notes and keys of the same input change form. ARTIFACT: the codec loses ten DriverDeviation
and eight VkProperty tags and EntryMath. RUNTIME_VERSION stays: the pinned sources' edits
(device/profile.rs, device/derive.rs, device/requirements.rs, lower/arith/pack.rs and a doc in
bind/heap.rs) remove forms no profile reached, so no run changes; runtime-sources.sha256 takes
the new hash. api_signatures is blessed; docs/REFUSALS.md and the coverage are unchanged.

Consumer check (consumer-uses.sh, consumer development c8407fb6fc, 58 refs): EntryMath,
of_float_operator, of_math_call, MetalCanonicalNans, MetalFloatDenormals, MetalFloatFunctions,
MetalHalfArithmetic, MetalHalfFma, MetalMinMax, MetalNanMoves, MetalPackConversions,
MetalUnaryDenormals, FloatFunctions and NanEncoding 0 hits (code). MetalHalfConversion: 0 on
development; used in crates/reims-vgpu-vulkan/src/gpu/rgbx.rs on three of the consumer's
steelbrain/* branches (gaugetick, recnil-r4, refdump), a crate its development no longer has.

Verified: m3-max-61298 at this tree (WIP arith 10, msi-laptop): fmt, clippy (all features,
--cfg m2v_gpu and --cfg m2v_cpu_icd) and Rustdoc rc 0 (61293, on the tree before, failed clippy
on three unused imports, which this tree removes); nextest over metal2vulkan,
metal2vulkan-conformance, metal2vulkan-validation and metal2vulkan-runtime, 5876 run, 5874
passed, 25 skipped, 2 failed: the render key test
(the_old_render_descriptor_key_keeps_its_value), left unpinned until the next named pin, and
golden_hashes_match_the_table, whose 29536 stale cells are all under a changed profile
fingerprint (0 new, 0 gone, 0 under a changed fixture source): the profile lost two fields, so
every key changed and the table is re-blessed on development.

Rebased onto development d10a14d5af: the SEMANTICS placeholder is one above its 2235 in stack order
(ARTIFACT_FORMAT_VERSION is already above its 574). The checks above ran at the old base acc706ca47;
the rebased stack's tip is checked by m3-max-61756 (msi-laptop), at the stack rebased on d6d56b8a7c
(tip 5c74fad38d, whose diff from its base is this stack's diff from d10a14d5af): fmt, clippy (all
features, --cfg m2v_gpu, --cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan,
metal2vulkan-validation, metal2vulkan-conformance and metal2vulkan-runtime ran 5877 tests, 5870
passed. Of the 7 failures, the old render descriptor key's test is unpinned; golden_hashes and
engine inventory parts 4, 5, 7 and 8 are bless due (the profiles' fingerprints changed); and
metal::state's encoder_raster_state_needs_its_features fails the same way at development d10a14d5af
itself (m3-max-61802, where runtime-floor gained depthBiasClamp in a529fb658e), as inventory parts
3, 4, 5 and 8 do there. The stack as rebased on 72e1754218 (tip 090d544208: the same product
changes, without the test-only push sweep fix) played 36 distinct streams over 61 runs on five nodes
with 0 refused (player m3-max-61537; plays m3-max-61548, 61549, 61550, 61559 and 61569).
2026-11-20 22:07:19 -08:00
Anees Iqbal 5db3215260 Rotated blends: every blend not exact by construction announces its rounding
The planner's ruling on the rotated blend: the note no longer follows a measured table. A blend
on an attachment held with its channels rotated (ARGB8Unorm) raises
PrecisionNote::RotatedBlendRounding unless it is exact by construction: a minimum or a maximum,
which takes no factor, or a blend whose chosen Vulkan factors are all ZERO or ONE, whose result
is the source, the destination, zero, or their sum or difference, a whole code half a code from
any tie. rotated_blend's MEASURED table and measured() go; unmeasured() becomes inexact(), which
reads the state rotated_blend() chooses: a Synthesized state (SRC1 factors) is inexact, and a
Direct one is inexact unless its four factors are ZERO or ONE.

Newly announced, the nine states of the old table that are not exact by construction, each
Metal's color pair and alpha pair under the one operation:
- DestinationColor over Zero, DestinationAlpha over Zero, Add;
- SourceColor over OneMinusSourceColor, SourceAlpha over OneMinusSourceAlpha, Add;
- BlendAlpha over OneMinusBlendAlpha for both, Add;
- the two straight-alpha pairs: SourceAlpha over OneMinusSourceAlpha with the alpha the same,
  and with the alpha One over OneMinusSourceAlpha, Add;
- One over OneMinusSourceAlpha for both, Add and Subtract;
- SourceAlpha over One with the alpha Zero over One, Add;
- SourceAlpha over One for both, ReverseSubtract.
One over Zero and One over One (Add) stay unannounced, now as exact by construction. Newly
unannounced: blends outside the old table whose Vulkan factors are all ZERO or ONE, which Metal
gives with one Zero or One factor for both its color and alpha sources and one for both its
destinations, under Add, Subtract or ReverseSubtract (One over One under ReverseSubtract, Zero
over One, and the like). Minimum and maximum stay unannounced.

StageIo::rotated_blends and LoweringInputs::rotated_blends stay: they are now the attachments
whose blend is not exact by construction. The stage raises the note from the latter, and
color_writes::check reads the former to refuse a fragment compiled for another set than the
pipeline's (NeedsInput(ColorWrites)), so the set still has a reader; its docs lose "measured".

The docs/API.md catalogue entry, PrecisionNote::RotatedBlendRounding's doc, LoweringInputs' and
StageIo's docs, rotated_blend's module doc, and validation's c3 deferral doc, its bound string and
comparison.rs's allowance doc state the one rule. The validation files use the note to defer a
row in C3 (c3.rs) and give it an unbounded allowance (comparison.rs); both follow the note, so
more rows on rotated attachments are deferred, by the note alone.

Tests: rotated_blend's measured-forms test becomes the_lane_s_blends_store_metal_s_rotated, over
the old table kept as test data (LANE): every state stores Metal's blend rotated alike on MoltenVK
and lavapipe, and all but one over zero and one over one are inexact.
inexact_blends_are_announced adds a difference by ones and a held destination, exact.
engine_rotated_colors expects the note on its product and its two second-output blends, and not
on its minimum or its reverse subtraction of ones.

SEMANTICS_VERSION 2237 (placeholder; main renumbers): the rotated blends' set, which the key
carries, and the stage's notes change for the same descriptor. ARTIFACT_FORMAT_VERSION and
RUNTIME_VERSION stay. api_signatures, docs/REFUSALS.md and the coverage are unchanged.

Consumer check: unmeasured and MEASURED were pub(crate); no public name changes.

Verified: m3-max-61259 at this tree (a5396ea291 before the colour commit's message was filled,
msi-laptop): fmt, clippy (all features, --cfg m2v_gpu and --cfg m2v_cpu_icd) and Rustdoc rc 0;
nextest over metal2vulkan and metal2vulkan-validation, 4719 run, 4718 passed, 23 skipped, 1
failed: the render key test (the_old_render_descriptor_key_keeps_its_value), left unpinned until
the next named pin.

Rebased onto development d10a14d5af: the SEMANTICS placeholder is one above its 2235 in stack order
(ARTIFACT_FORMAT_VERSION is already above its 574). The checks above ran at the old base acc706ca47;
the rebased stack's tip is checked by m3-max-61756 (msi-laptop), at the stack rebased on d6d56b8a7c
(tip 5c74fad38d, whose diff from its base is this stack's diff from d10a14d5af): fmt, clippy (all
features, --cfg m2v_gpu, --cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan,
metal2vulkan-validation, metal2vulkan-conformance and metal2vulkan-runtime ran 5877 tests, 5870
passed. Of the 7 failures, the old render descriptor key's test is unpinned; golden_hashes and
engine inventory parts 4, 5, 7 and 8 are bless due (the profiles' fingerprints changed); and
metal::state's encoder_raster_state_needs_its_features fails the same way at development d10a14d5af
itself (m3-max-61802, where runtime-floor gained depthBiasClamp in a529fb658e), as inventory parts
3, 4, 5 and 8 do there. The stack as rebased on 72e1754218 (tip 090d544208: the same product
changes, without the test-only push sweep fix) played 36 distinct streams over 61 runs on five nodes
with 0 refused (player m3-max-61537; plays m3-max-61548, 61549, 61550, 61559 and 61569).
2026-11-20 22:07:18 -08:00
Anees Iqbal 4d17e4593b Colour writes: the Metal colour-write deviations and the premultiplied rotated blend go
DriverDeviation::MetalColorWrites, MetalFloatColorNans, MetalSmallFloatColorWrites and
MetalNorm16ColorWrites, with their VkProperty values, were never taken. Device::from_queries
enables no Metal* property, and no committed profile carries one. Their forms go:
- lower/stage_io/color_write.rs: the Metal conversion (Conversion, conversion()), the skip of a
  half-float channel on a Metal device, and nan_kept's profile read;
- pipeline/color_writes.rs: lowered()'s small-float and 16-bit norm arms, metal_color_writes and
  metal_stored;
- the rotated blend's premultiplied form, which only MetalColorWrites reached:
  rotated_blend::premultiplied, the measured table's premultiplied factors,
  RotatedBlendForm::Premultiplied, PlannedOutput::premultiplied and stage_io's
  premultiplied_blue.
RotatedBlendForm kept one variant, Unmeasured, so it goes too. LoweringInputs::rotated_blends and
StageIo::rotated_blends become a BTreeSet<u32>: the rotated attachments blended in none of the
measured forms. rotated_blend::rotated_form becomes unmeasured().

Notes: RotatedBlendRounding stays, since the unmeasured form raises it; its doc and its docs/API.md
catalogue entry lose the premultiplied clause. DeviceColorConversion and DeviceNanEncoding stay,
since the device's forms raise them. On Apple's own blend the two straight-alpha pairs may round one
code apart in the search's form, unannounced; rotated_blend's module doc says so.

Tests: color_writes' tests lose their Metal branches; api_surface's with_color_writes loses its
device argument; engine_rotated_colors loses the Apple-blend expectations and premultiplies();
rotated_blend's tests read unmeasured(); engine_fragment's profile filter and api_tests follow.

SEMANTICS_VERSION 2236, ARTIFACT_FORMAT_VERSION 575 (placeholders; main renumbers). SEMANTICS: the
rotated blends' key bytes change form. ARTIFACT: the codec loses RotatedBlendForm and four
VkProperty values, and StageIo's field changes type. RUNTIME_VERSION stays; no binder source
changes. api_signatures is blessed; docs/REFUSALS.md is regenerated (DualSourceBlending loses
rotated_blend's premultiplied site).

Consumer check (consumer-uses.sh, consumer development 415d453172, 58 refs):
MetalFloatColorNans, MetalSmallFloatColorWrites, MetalNorm16ColorWrites, RotatedBlendForm and
rotated_blends 0 hits (code). MetalColorWrites: 0 on development; used in
crates/reims-vgpu-vulkan/src/gpu/encode_render.rs (ties_as_metals) on 36 of the consumer's
steelbrain/* branches, a crate its development no longer has. Premultiplied and Unmeasured: the
consumer's hits are its own (a comment in display.rs, its RefusedWait::Unmeasured), not these
items.

Verified: m3-max-61229 at this commit (homelab-um790-xtx-1): fmt, clippy (all features, --cfg
m2v_gpu and --cfg m2v_cpu_icd) and Rustdoc rc 0. m3-max-61208 on the same change before its rebase
onto acc706ca47 (f4ecfa8c4, msi-laptop): nextest over metal2vulkan, -conformance, -validation and
-runtime, 5881 run, 5880 passed, 25 skipped, 1 failed: the render key test
(the_old_render_descriptor_key_keeps_its_value), left unpinned until the next named pin.

Rebased onto development d10a14d5af: the SEMANTICS placeholder is one above its 2235 in stack order
(ARTIFACT_FORMAT_VERSION is already above its 574). The checks above ran at the old base acc706ca47;
the rebased stack's tip is checked by m3-max-61756 (msi-laptop), at the stack rebased on d6d56b8a7c
(tip 5c74fad38d, whose diff from its base is this stack's diff from d10a14d5af): fmt, clippy (all
features, --cfg m2v_gpu, --cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan,
metal2vulkan-validation, metal2vulkan-conformance and metal2vulkan-runtime ran 5877 tests, 5870
passed. Of the 7 failures, the old render descriptor key's test is unpinned; golden_hashes and
engine inventory parts 4, 5, 7 and 8 are bless due (the profiles' fingerprints changed); and
metal::state's encoder_raster_state_needs_its_features fails the same way at development d10a14d5af
itself (m3-max-61802, where runtime-floor gained depthBiasClamp in a529fb658e), as inventory parts
3, 4, 5 and 8 do there. The stack as rebased on 72e1754218 (tip 090d544208: the same product
changes, without the test-only push sweep fix) played 36 distinct streams over 61 runs on five nodes
with 0 refused (player m3-max-61537; plays m3-max-61548, 61549, 61550, 61559 and 61569).
2026-11-20 22:07:18 -08:00
Anees Iqbal b0e351ffbc Validation: multisampled passes and textures run through the runtime
Family H of the executor's move onto metal2vulkan-runtime: a render
case of more samples (raster_sample_count), and any case binding a
multisampled texture, now runs on the runtime's public API, filled and
read back as executor_contract::multisample states for both executors.

Metal uploads and copies no multisampled texture, and neither does the
runtime. So runtime_multisample fills each slice with one draw of the
owned sample_fill fixture (fixtures/public/engine/sample_fill.metal,
compiled by scripts/regen-air-fixtures), whose fragment runs once per
sample (sample_id) and writes that sample's texel from a buffer: a
color texel through an unsigned-integer view of its texel size (the
texture made with PixelFormatView usage), so its bits cross
unconverted, a Depth32Float one as depth(any) under an always-passing
depth test that writes (a depth outside [0, 1] refused as
depth_outside_unit_range, as runtime_depth refuses it). A multisampled
stencil aspect holds one value in every sample (uniform_stencil), which
the case's pass clears it to. After the draw a dispatch of the
fixture's sample_read kernels reads every sample, one threadgroup each,
as whole words in the attachment layout (unpack_words), unresolved,
as the oracle's sample_readback does.

runtime_textures makes a multisampled texture Private (Metal keeps none
Shared), for rendering and, if color, for views of another format, and
fills it by those draws. runtime_render makes each attachment of a
multisampled pass a Private Type2DMultisample texture of the pass's
samples, with a texture index for its read's view, and reads every
sample back for the comparison. engine::runtime_texture no longer keeps
a multisampled texture off the runtime, and
runs_render_through_runtime takes any sample count. An attachment of
both aspects still carries separate_depth_stencil.

What moves: of the committed cases, 49 multisampled passes (all
public; 2 with both aspects keep the requirement) and 8 cases with a
multisampled input texture (7 public kernel cases, 1 private fragment
case).

ENGINE_EXECUTOR_ABI to vulkan-engine-v197. The new owned fixture adds
rows to the golden tables, re-blessed on development.

Tests: engine/tests.rs routes a multisampled pass, multisampled depth
and stencil attachments and a kernel's multisampled texture through
the runtime; engine_render.rs's
each_sample_of_a_multisampled_target_holds_its_own_invocation draws
sample_rate_mask_in into 4 samples and checks each sample's index, on
Linux through the runtime too, bytes equal to the executor's own;
engine_textures.rs's depth_and_multisampled_textures_read_their_authored_texels
runs through the runtime on Linux. Built and run in the lane's compile
job (ids sent with the sha); not yet built when committed.
2026-11-20 21:59:48 -08:00
Anees Iqbal 6593e998d1 Validation: tessellation cases draw their patches through the runtime
Family I of the executor's move onto metal2vulkan-runtime. A
post-tessellation vertex case's patch draw, which the Metal oracle
encodes as setTessellationFactorBuffer: at executor_contract::
tessellation's offset and instance stride and drawPatches: with no patch
index buffer, now draws through the runtime's public API the same way:
the factors a Shared buffer bound by set_tessellation_factor_buffer at
FACTOR_OFFSET and FACTOR_INSTANCE_STRIDE, then draw_patches with the
case's control points, patch start, patch count, instance count and
base instance and no index buffer.

engine::runs_render_through_runtime takes an Assembly::Patches case
whose draw is DrawCall::Patches with neither a patch index buffer nor a
control-point index buffer (the runtime's patch index buffer is
Gap::Draw of PatchIndexBuffer); the authored TessellationDraw spells
neither, so every committed tessellation case meets the structure.
runtime_render's drawn() encodes the patch draw; a patch draw that
reached it with an index buffer fails the run, never draws other
patches.

What moves: the 25 committed tessellation cases (23 public, 2
private), one of them with attribute-buffer out-of-bounds targets of
control-point form, whose facts runtime_bounds::drawn reads as before.

ENGINE_EXECUTOR_ABI to vulkan-engine-v196: these rows' executor
changes.

Tests: engine/tests.rs a_plain_draw_and_only_one_runs_through_the_runtime
routes a patch draw without an index buffer and keeps one through a
patch index buffer, and a patch draw of a primitive assembly, on the
executor's own context; engine_render.rs's
a_back_culled_patch_and_its_mirror_leave_exactly_one_drawn draws each
of its patch draws through the runtime on Linux and compares the
executor's own bytes. Built and run in the lane's compile job (ids sent
with the sha); not yet built when committed.
2026-11-20 21:59:48 -08:00
Anees Iqbal bcc417bc08 Translator: SparseResidency's text names a footprint of the border alone
PrecisionNote::SparseResidency said the device's OpImageSparse* residency may count a texel of
zero weight Metal does not. Public case fd292944c2 (a 256x128 r32_float sparse texture with x
128-255 mapped) found a second way the device's word differs: lavapipe answers not resident for
a clamp_to_border access whose footprint is the border alone (nearest at u -0.5 and 1.5, linear
at u -0.5, -1/256 and -1/512, gather at u -0.5 and 1.5), where Metal answers resident, beside a
mapped edge too. Every value word was equal; 7 of 200 residency words differ (valexec2's proof
m3-max-61595, decoded against the committed Metal rows). Vulkan states only "whether any texels
accessed by the instruction are sparse unbound texels" (vkspec 20.2.6), so the word is the
device's, which the note's first clause already says; its text now names this case beside the
zero-weight texel, in the doc comment and in docs/API.md's catalogue.

Doc only: no emission, key or version change.
2026-11-20 21:37:51 -08:00
Anees Iqbal a529fb658e rt: the floor's depthBiasClamp has its missing-feature case, and the runtime-floor profile states it
The floor requires depthBiasClamp (the first commit of this change). The runtime's
each_missing_feature_is_named gains its case, as its count of cases is held to REQUIRED's. The
regeneration's RUNTIME_FLOOR and runtime-floor.json's m2v_runtime_floor block state it, in the
generator's order (the block the runtime's the_floor_profile_states_exactly_the_floor holds equal
to floor.rs; check_device_profiles: 0 findings over 17 profiles; the JSON line is written as the
regeneration writes it, without refetching its pinned sources). CONFORMANCE-COVERAGE is
regenerated for the ledger row render-state-depth-bias left (7688 rows to 7687).

The runtime-floor contexts' opened chains move with the profile; their bless is the next commit.

Verified: suite m3-max-61635 at 406f39dc90 (msi; the workspace suite and the lavapipe device
tests) failed exactly these three, each_missing_feature_is_named (52 cases against 53),
the_floor_profile_states_exactly_the_floor (depthBiasClamp) and the coverage document; the rerun
follows.
2026-11-20 21:33:04 -08:00
Anees Iqbal 6ef64ae3ee rt: a depth bias's clamp is the device's own
setDepthBias:slopeScale:clamp: bounds the bias by its clamp: "Pass a positive or negative value to
limit the largest magnitude of a positive or negative bias, respectively. You can disable the bias
clamping functionality by passing 0.0" (Apple's page for the method, as fetched). Vulkan's
depthBiasClamp is the same bound (dbclamp: x for 0, min(x, clamp) above 0, max(x, clamp) below).
rt refused every clamp but 0 (DrawKind::DepthBiasClamp), where the deleted runtime passed it.

floor: depthBiasClamp joins REQUIRED. Every dumped venue reports it (vulkaninfo m3-max-48727 to
48731, 48736, 48737 and 61508 for the RX 550: RX 7900 XTX, the three 780Ms, RTX 2080, RTX 3090,
Iris Xe, RTX 5080 Laptop, llvmpipe, the UHD 630's Windows driver, KosmicKrisp on the M3 Max, RX
550), and Vulkan 1.4 and Roadmap 2022 require it.

render encoder: set_depth_bias keeps the clamp beside the bias and slope scale and records it in
vkCmdSetDepthBias, as dynamic state (no pipeline). It returns nothing now, as Metal's call does:
its only error was the clamp. DrawKind::DepthBiasClamp is deleted. The consumer's checkout names
both: rt_platform/render.rs:380 (`e.set_depth_bias(...)?`) and rt_platform/unbuilt.rs:873 (a test's
sample refusal of DepthBiasClamp); each needs a one-line change at its next pin.

AGENTS.md: the Scope sentence on features no guest has used is replaced with the planner's
wording: a feature a program can ask about is answered from the Vulkan query; one Metal gives every
Mac device with no way to ask is built, a typed refusal in the known gaps until it is.

Docs: the README's floor table, its depth bias paragraph and its render encoder known gaps;
docs/REFUSALS.md regenerated (Draw's basis and sites); api_signatures.tsv blessed (the setter's
signature, the variant gone). The conformance ledger drops render-state-depth-bias's refusal row.

Tests: every_device_tests_writes_and_biases_a_depth_attachment's first draw is biased by 2^23
(0.25 or 0.125 in the device's unit at depth 0.25) clamped to 0.0625, and the depth read back is
0.3125 on every device; the later draws' answers are unchanged in kind. The conformance case
render-state-depth-bias (a slope-scaled bias under the clamp -0.0125) now compares against Metal's
recording.
2026-11-20 21:33:03 -08:00
Anees Iqbal 6af76cf309 Validation: separate depth and stencil attachments are the runtime's limit
A fragment case whose depth/stencil attachment holds both aspects is
drawn by the Metal oracle into Metal's separate Depth32Float and
Stencil8 textures, attached to one pass: plain Metal on every Mac. The
runtime does not build that form yet. It renders into no separate depth
and stencil textures in one pass (Gap::RenderPass of DepthStencilViews,
and its pipeline state Gap::RenderPipeline of DepthStencilFormats), both
among the known gaps its README states. The planner's ruling: record
these rows as the runtime's limit with that typed gap, by the
function-table mechanism; the doc comment states the gap as unbuilt in
the runtime, not as Metal's.

ToolingRequirement::SeparateDepthStencil ("separate_depth_stencil"):
Limit::Runtime, it stops the engine's candidate and keeps its cases
Metal-qualified (qualifies_on_metal). The case checker raises it from
the case's literals (executor_contract::case_requirements: a vertex or
fragment case's depth/stencil attachment with both initial aspects),
never from a source's structure, so no census row carries it.
executor_contract.rs is a classifier input, so every cached triage
recomputes. If the runtime builds the form, the requirement goes in the
same commit.

What lost execution: of the committed cases, 5 fragment cases hold
both aspects: the 3 of family G (one sample, observing stencil) and 2
multisampled ones (family H), all of which ran on the old executor
until now.

Tests: requirement.rs's
a_separate_depth_stencil_attachment_stops_only_the_candidate and both
requirement lists; executor_contract's case test (a fragment case's
attachment of one aspect raises nothing, of both raises it alone).

Verified: cargo fmt; the compile gate follows as a potluck job.
2026-11-20 21:27:21 -08:00
Anees Iqbal cca476549f Validation: a draw's depth/stencil attachment of one aspect runs through the runtime
Family G. A render case with a depth/stencil attachment stayed on the
executor's own context. A vertex or fragment case whose attachment has
one sample and one aspect now draws through the runtime
(engine::runs_render_through_runtime), observing a buffer, a texture, a
color target, the attachment's aspect or nothing; a fragment case with
the attachment and no color target renders, as the attachment is the
pass's.

The attachment is made as the oracle makes it (Metal's separate
Depth32Float and Stencil8, Shared, of RenderTarget usage):
- a Depth32Float is filled by a draw of its depths (runtime_depth), as a
  32-bit float depth texture is, since the runtime takes no upload of one
  (Gap::FloatDepthUpload); a depth outside [0, 1] stays
  DepthOutsideUnitRange;
- a Stencil8 is written from its bytes with replace_region.
The pass loads and stores it; the draw's depth-stencil state, stencil
references and pipeline depth and stencil formats were already the
oracle's. The final aspect is read back with get_bytes into the run's
RenderFinals, from which the depth or stencil output is selected.

An attachment of both aspects is the oracle's two textures, which the
runtime renders into in no one pass (Gap::RenderPass of
DepthStencilViews; its pipeline Gap::RenderPipeline of
DepthStencilFormats): such a case, and one of more samples (family H),
stays on the executor's own context.

Rows: of the committed cases, 21 fragment cases are family G's (one
sample, the rest of E/F's structure): 16 stencil-only observing stencil,
2 depth-only (one observing depth, one, private, a color target), and 3
of both aspects observing stencil, which stay where they were. Expected:
the 18 one-aspect cases run through the runtime; the family G proof reads
them.

ENGINE_EXECUTOR_ABI to vulkan-engine-v195.

Tests: a_plain_draw_and_only_one_runs_through_the_runtime (a depth or a
stencil attachment, observed or not, routes; one of both aspects or of 4
samples does not); the device test
a_fragment_case_writes_its_depth_and_stencil_attachment draws each
aspect alone through the runtime on Linux (depth 0.5 over 1.0, stencil 7
over 0xab).

Verified: cargo fmt; the compile gate and the family G proof follow as
potluck jobs.
2026-11-20 21:27:21 -08:00
Anees Iqbal 9a28de4736 Validation: an indexed draw past its index buffer is the runtime's limit
The runtime refuses an indexed draw whose indices leave its index buffer
as Refusal::IndexBufferOffset, as Metal's validation stops the draw
(render_encoder's draw path checks offset + count * size against the
buffer's length; the runtime's README states the refusal among those
Metal's validation makes). A case that declares a draw's index buffer an
out-of-bounds target is such a draw, so no run through the runtime draws
it. The planner's ruling: record these rows as the runtime's limit with
that typed refusal, by the function-table precedent.

ToolingRequirement::IndexBufferPastEnd ("index_buffer_past_end"):
Limit::Runtime, it stops the engine's candidate and keeps its cases
Metal-qualified (qualifies_on_metal). The case checker raises it from the
case's literals (executor_contract::case_requirements: an out-of-bounds
target of OutOfBoundsResource::IndexBuffer), never from a source's
structure, so no census row carries it. executor_contract.rs is a
classifier input, so every cached triage recomputes.

What lost execution: of the committed cases, the 2 public index-buffer
cases d900a10225 and da4185d2a2, which ran on the old executor's padded
copy until now. The old executor's padded index copy is now reached by
no committed case; it goes with the old executor's tables.

Tests: requirement.rs's an_index_buffer_past_its_end_stops_only_the_candidate
and both requirement lists; executor_contract's case test (a vertex
case's index-buffer target raises it alone, an attribute-buffer target
raises nothing).

Verified: cargo fmt; the compile gate follows as a potluck job.
2026-11-20 21:27:21 -08:00
Anees Iqbal 4e465d811a Validation: a draw's attribute-buffer out-of-bounds target runs through the runtime
A render case with an out-of-bounds target stayed on the executor's own
context. A vertex or fragment case whose every out-of-bounds target is
an attribute buffer now draws through the runtime
(engine::runs_render_through_runtime), and its facts are read before the
state is made (runtime_bounds::drawn): the translator's compile of the
state's descriptor on the runtime device's own translator
(Device::compile_render_pipeline, whose stage inputs are the ones the
runtime lowers each stage under, render_pipeline_key of the variant key
its state takes), read by engine::draw_out_of_bounds_run, which now takes
the translator Device for its policy.

The runtime's floor enables no buffer robustness: its README states that
a vertex fetch outside its buffer returns what the device gives. So
fixed-function vertex input on a profile without buffer robustness is
contained as vertex-input:unchecked (Check::Unchecked; it was an Err,
"which contains nothing"), and the case is refused before the make as
not_supported{uncontained:unchecked vertex_input}. A contained target of
such a draw would need guards around its vertex buffers, which the draw
does not place, so it is refused as executor_not_implemented; no routed
case reaches that.

Rows: of the 4 render out-of-bounds cases, 01b45f7c10 (a vertex
attribute fetched past its vertex buffer) is expected to move from the
old executor to not_supported{uncontained:unchecked vertex_input}. The 2
index-buffer cases (d900a10225, da4185d2a2) stay on the executor's own
context: the runtime refuses indices past the buffer
(Refusal::IndexBufferOffset), as Metal's validation does, which the
facts do not state yet. The control-point case a95f41be73 is a
tessellation draw, which stays there too. On the old executor, the
robustness-off leg's fixed-function attribute target is now the same
refusal instead of a failure.

ENGINE_EXECUTOR_ABI to vulkan-engine-v194.

Tests: a_draws_targets_are_contained_by_their_fetch (every committed
profile contains the fixed-function attribute, unchecked exactly where it
checks buffers in the shader, which a committed profile does);
a_plain_draw_and_only_one_runs_through_the_runtime (an attribute target
routes, an index-buffer target does not).

Verified: cargo fmt; the compile gate and the family D proof follow as
potluck jobs.
2026-11-20 21:27:20 -08:00
Anees Iqbal 00e254ac29 validation: an out-of-bounds target is contained as its module's domains decide
containment read a module's facts as if every device took the resident
table and the handle table. The runtime's device takes the identity
domains (DevicePolicy), so a kernel case through the runtime whose target
is a buffer an argument buffer points to, or an argument buffer's texture
array, failed: the module has no resident roots and no handle table.

ModuleFacts now carries the policy of the device the module was compiled
for (Device::policy: the runtime's translator, the executor's own device,
and DevicePolicy::default() for the committed tier profiles, which are
made with it).

- Under the identity pointer domain a pointer loaded from memory is the
  address it holds, used as given: the runtime's README states that an
  access through a pointer loaded from memory is not checked. Such a
  target is contained as device-address with the new Check::Unchecked,
  and out_of_bounds_run refuses every case with an unchecked target
  before the make, as NotSupported::Uncontained with the new `unchecked`
  forms (serde default):
  not_supported{uncontained:unchecked loaded_pointer}.
- Under the identity handle domain an argument buffer's texture-array
  index is the resource id's index masked onto the descriptor arrays
  (the new Medium::ResourceId, resource-id:shader), whose elements no
  live texture owns are null descriptors: its read rule is
  ResidentTexels, as the handle table's.

ENGINE_EXECUTOR_ABI to vulkan-engine-v193.

Rows: the family D proof at 846f7c1428 (m3-max-61319) failed 5 cases
through the runtime on these facts. Expected at this commit: the 4
loaded-pointer cases 22f5d8ab9c, 570c5673f8, 85c504e02e and ad528203ee
move from failed to not_supported{uncontained:unchecked loaded_pointer};
the texture-array case a937d43a67 runs, contained as resource-id:shader.
The family D proof at this commit reads them.

Verified: unit tests the_identity_domains_leave_a_loaded_pointer_unchecked_
and_mask_a_resource_id (containment under both policies, the refusal's
label and text, the masked target's run), the in-layout read-rule test
over the resource-id medium, and the bless round trip of the new refusal;
the gate job is named on landing.
2026-11-20 21:27:20 -08:00
Anees Iqbal 34c8f0e67c Validation: a kernel out-of-bounds case runs through the runtime, its facts every lowered variant's
A kernel case with out-of-bounds targets now routes through the runtime like any other kernel
case of its structure (engine::runs_through_runtime no longer excludes one). Before the state is
made, platform::runtime_bounds lowers each KernelVariant of the case's kernel on the runtime
device's own translator (rt::Device::translator), under LoweringInputs::kernel_variant of the
inputs kernel_inputs_read gives the descriptor's: the inputs the state lowers each of its modules
under, which the runtime's own test pins. A variant the translator refuses is one no dispatch runs.
Each lowered module's facts (its slots, fetches, resident roots, handle table and strategy
census) give the run's out-of-bounds facts through engine::out_of_bounds_run, as the executor's
own context reads its module's. Where two variants give different facts, which module a dispatch
runs would decide the case, so it is refused before anything is made:
NotSupported::Uncontained now carries the variant that differs (None for the device's robust
forms, as before), "not_supported{uncontained:variant PartialThreadgroups}".

Each guarded target (a buffer, or an argument buffer's) is a buffer at the runtime's placement
alignment inside a Shared block of its own, between guards of its declared reach (at least
MIN_GUARD), every guard byte GUARD_FILL, read back through a buffer over the whole block after
the dispatch: GuardCount::escaped, and past_end 0 (the buffer is all its bound memory). The
row's census records the facts with the counts.

Texture-buffer cases stay on the executor's own context (the runtime makes no texture buffer),
and so do the render out-of-bounds cases (vertex fetches); stage inputs do not route.

Tests: the routing test asserts an out-of-bounds kernel case routes; the device test
a_device_buffer_accessed_past_its_end_is_contained_through_the_runtime runs the public
ob1_storage_buffer case through the runtime (loads past the source read zero, stores past the
output do nothing, no guard byte changes, each target DeviceAddress / Shader). ENGINE_EXECUTOR_ABI
vulkan-engine-v192. docs/VALIDATION.md says how the facts are read.

Verified: cargo fmt; the compile gate and lavapipe suites, then the family's proof, follow as
potluck jobs.
2026-11-20 21:27:19 -08:00
Anees Iqbal 47f804e943 Translator: a kernel variant's lowering inputs come from LoweringInputs::kernel_variant; rt answers its translator
rt's kernel state lowered its partial-threadgroups and emulated-SIMD-group variants under inputs it
assembled by hand: a clone of the plain module's inputs with one flag set. Validation's executor is
to lower the same variants on the same device to read each module's containment of an
out-of-bounds target, so the assembly moves into the translator as the one constructor both call:
KernelVariant (Plain, PartialThreadgroups, EmulatedSimdgroups; ALL) and
LoweringInputs::kernel_variant, applied to the inputs kernel_inputs_read gives. rt's
Compiled::of and its translate tests' helpers call it.

metal2vulkan-runtime's Device::translator returns the translator device creation built, the one
every state lowers on. It retains nothing new (it borrows Core::translator) and has no Metal
counterpart.

One rt device test pins the agreement: for icb_replay_grid_template (its plain module checks the
store at a computed index, SlotBounds of buffer 1, and leaves the two constant-offset loads of
buffer 0 unchecked) and gsm2_simd_products' simd_float_products, every lowering a first device
kept in its cache directory is found under the key of one variant's public inputs, byte-equal to
Device::translator's compile_function of that variant, and at least as many are found as the
states made modules.

Surface: api_surface names KernelVariant (N); api_signatures blessed (8 records added, none
changed or removed); docs/API.md and the runtime README's compute-state section say how a
consumer lowers a variant. No public item is removed, so no consumer search applies.

Verified: cargo fmt; the compile gate and the runtime's device tests on lavapipe follow as a
potluck job.
2026-11-20 21:27:19 -08:00
Anees Iqbal 0dc56519c9 translator: the identity domains push a render pass's length to a vertex function that writes its slice
Under the identity domains a vertex function that writes [[render_target_array_index]] was
refused as IdentityDomains (an encoder value the function reads as RenderTargetArrayLength): the
field was not among the encoder values those domains push. The runtime now fills it (the pass's
length, at least 1, rt's FieldValue::RenderTargetArrayLength), so the field joins the admitted
pushed values, beside AlphaTestReference and FetchedColor; nothing else of the form changes.
Found by the runtime's layered device test, which refused rt6_layered on every GPU leg at
912548d4db (m3-max-61476, 61477, 61478, 61480, 61481, 61486, 61490) and on lavapipe (61482).

SEMANTICS_VERSION 2235, one above development's 2234 (placeholder): such a vertex function now
compiles where it was refused. lower/select.rs and cache/mod.rs are not among validation's
runtime inputs, so runtime-sources.sha256 and RUNTIME_VERSION stay. A test pins the form on
lavapipe's profile (engine_identity_render), and docs/API.md names the pushed length.
2026-11-20 21:11:36 -08:00
Anees Iqbal 4e3a6a3555 rt: layered rendering in one form, the vertex function storing Layer in every pass
`RenderPassDescriptor::render_target_array_length` is Metal's `renderTargetArrayLength`. A pass
of length N of 2 or more is one rendering of `layerCount` N: every attachment and resolve texture
is a view of its level and N slices from its own `slice` (a 2D array view; a cube's faces are its
slices), and the rendering's load, store and resolve cover every layer, with no per-layer loop.
At 0 and 1 the pass renders the attachment's slice alone, as Metal's does.

A vertex function's `[[render_target_array_index]]` has one form: the variant that writes
`Layer`, in every pass. Each draw pushes the pass's length, max(len, 1)
(`FieldValue::RenderTargetArrayLength` for the translator's `PushField::RenderTargetArrayLength`),
and the function stores 0 for an index at or past it, so at 0 and 1 every index renders the
attachment's slice. The fragment function reads the raw index through the flat varying the
translator carries. The runtime never asks for `VariantKey::dropped_vertex_layer`; a state whose
fact is `RenderTargetArrayLength { layer_dropped: true }` is refused as a draw input. What still
uses `dropped_vertex_layer`: the old binder (`bind/graphics.rs:905`, the variant it asks for at a
shape's length), stage_io's plan (`lower/stage_io/plan.rs:1600` and `:2305`, also the
non-layered amplification), and the validation crate's engine tests
(`candidate/engine/graphics/tests.rs:907`); it stays for cutxlate to delete.

`shaderOutputLayer` joins the floor's required features: every probed device reports it
(vulkaninfo, jobs m3-max-61359 on gem10: the 780M, the RX 550 and lavapipe; 61360 on um790: the
RX 7900 XTX, the RTX 2080, the 780M and lavapipe; 61361 on um870: the 780M, the RTX 3090 and
lavapipe; 61362: KosmicKrisp, Mesa 26.3.1; 61366: the UHD 630's Windows driver, Vulkan
1.3.215). A device without it gets the floor's refusal. The runtime-floor profile and its
generator gain it.

Refused, in the README's layered-rendering gap line: an attachment or resolve texture with fewer
slices from its own than the pass's length (`Refusal::AttachmentPlace`, naming the last slice); a
3D texture's depth planes (`TextureType`, as for every 3D attachment); a length past
`maxFramebufferLayers` (`RenderPassKind::ArrayLength`, new:
VUID-VkRenderingInfo-layerCount-07817); a draw that reads one of a layered pass's attachments
through a texture on a device without the feedback loop (`AttachmentRead`: a shadow holds one
layer); and a vertex function whose index the translator cannot show the same at every vertex of
a primitive, at creation, naming `LayeredRendering` and `geometryShader`: Vulkan requires one
`Layer` per primitive (VUID-VkPipelineShaderStageCreateInfo-stage-02596), the translator's other
form is a geometry stage device creation does not enable, and Metal calls a differing index
undefined. The feedback-loop move's ranges around the rendered layers (`around`) take the
attachment's layer count.

The conformance runtime side passes the length; the case `layered-render-target-array-length`
loses its ledger row. REFUSALS, METAL-COVERAGE and CONFORMANCE-COVERAGE regenerated; the API
table gains the field and the kind.

Test: `tests::layered`, on every device of the cfg's kind: a 2D array's slices 1 to 3 with an
index past the length, a cube's six faces, a pass of length 0 and one of length 1 whose vertex
function writes index 3 (rendering the attachment's slice, the fragment reading 3), every slice
read back; and `rt6_first_vertex`'s per-vertex index refused naming `LayeredRendering`.
2026-11-20 21:11:36 -08:00
Anees Iqbal 841c6872ac Identity domains: a read through a sampler takes its border texels from the resource ID's word
MSL 4.1's read(sampler, coord[, offset][, lod]) of a texture slot, through a constexpr sampler
with a clamp_to_zero or clamp_to_border axis or through a runtime [[sampler(n)]], reads Metal's
border texel at an index outside the level. The default domains take the border texels from the
slot's BorderTexels specialization (RuntimeFact::BorderTexels); under the identity domains that was
state of the bound texture they did not source, so such a kernel was
Unsupported{IdentityDomains}. The border texels are bits 0-11 of the texture word
(TextureWord::BORDER_TEXELS, docs/RESOURCE-ID.md), already in the slot's pushed resource ID
(PushField::SlotGuestBase). Under the identity domains select_through now sets neither the slot's
border_texels nor the fact, and border_bits reads the word through emit::identity_id and masks
it, as the format's missing alpha is read. SlotPlan::identity_lowered and identity_unsourced drop
the border texels, which the identity domains now source. An argument buffer's texture read so
(its handle-table entry's border texels) is still refused. The default domains are unchanged.

Conformance (known-gaps-rt.tsv, runtime on lavapipe against the committed Metal answers): six
read-through rows translate and match, so their rows go: read-through-int exact;
read-through-half, -layers, -line, -read-write and -volume differ only by notices the suite
declares. read-through-volume reads through a runtime sampler of an opaque-black border, whose
sampler state the runtime notes on every device: the case now declares that notice
(replay::swizzled_border_notice) wherever it reads through such a sampler, as border_swizzles
does. The four plane rows (a8, r32f, rgba8, rgba8-swizzled) now make every pipeline up to
rt_heap_zero, an argument buffer's texture read through a border sampler, where they are still
refused; their rows move there.

Docs: RESOURCE-ID.md says a slot's read through a sampler takes its border texel from bits 0-11
of the word; API.md's identity forms name the read through a sampler (the paragraph's lines
reflowed); CONFORMANCE-COVERAGE.md re-derived for the six rows gone (REFUSALS.md re-derives
unchanged).

Test: engine_identity's a_read_through_a_sampler_takes_its_border_texels_from_the_word:
engine/kernel_read_through's rt_arg (a runtime sampler, offset (1, -1)) under the identity domains
on lavapipe, moltenvk-m3 and moltenvk-m3 without robustImageAccess2: L3, no specialization
constant but the dispatch's, no BorderTexels fact, and on the CPU interpreter, through a sampler
that clamps every axis to the border, each of R32Float, RGBA8Unorm, A8Unorm and RGBA8Unorm
swizzled (a, b, 0, r), under each border color, reads metal::sampler::border_texel's texel past
the right, left and top edges and the texel inside.

SEMANTICS_VERSION 2234, one above the previous commit's (main renumbers at landing): a refusal
becomes a module. The old runtime's render descriptor key changes with it, pinned at landing.

Verified (potluck; the jobs ran this diff on the previous commit's diff on development
846f7c1428, and this commit is the same diff on the previous commit, whose base 62c563f564 touches
none of its lines but SEMANTICS_VERSION and the API.md paragraph's neighbours):
- m3-max-61431 (msi, at the WIP tree b94d87fbf1, this diff but the coverage document): cargo fmt
  --check, clippy with all features, with --cfg m2v_gpu and with --cfg m2v_cpu_icd, and Rustdoc
  -D warnings pass; nextest of metal2vulkan and metal2vulkan-conformance 4364 run, 4362 passed,
  among them both engine_identity tests of this and the previous commit and
  golden_hashes_match_the_table; the two failures the old render descriptor key above and
  the_conformance_coverage_document_is_what_the_sources_derive, for the coverage document this
  commit re-derives (coverage.py --check passes at this tree); the metal2vulkan-conformance suite
  under --cfg m2v_cpu_icd on lavapipe 1014 of 1015 passed, the one failure that coverage document.
- m3-max-61342 (msi, at the WIP tree 80c41fdb12, the code before the ledger rows): conformance
  replay --cpu of the read-through cases and swizzled-storage-atomics: read-through-int exact;
  -half, -layers, -line and -read-write announced (declared notices); -volume divergent by the
  undeclared opaque-black border notice, which the case now declares; the four plane rows
  refused at rt_heap_zero.
- m3-max-61353 (um870, llvmpipe LLVM 23.1.4, at b94d87fbf1): the same replay with the ledger rows
  and the declared notice: announced 5, exact 1, refused 7, "exactly the open gaps
  known-gaps-rt.tsv expects", exit 0.
- States-only play (the probe player, M2V_PROBE_STATES_ONLY=1, on lavapipe) built at b94d87fbf1
  plus the five probe commits (m3-max-61345, um790), run over the 36 recorded streams on five
  nodes (m3-max-61358 ms01, 61377 um790, 61379 gem10, 61404 um870, 61423 msi): 61 runs of 36
  distinct streams, every one exit 0; 502920 render and 108189 compute states made, 0 refused.
2026-11-20 20:27:12 -08:00
Anees Iqbal 2dd8ffce0d Identity domains: a texture atomic's slot is the R32 storage element its resource ID names
A texture atomic (atomic_fetch_*, atomic_exchange, atomic_compare_exchange_weak, atomic_load or
atomic_store on a texture1d, 1d_array, 2d, 2d_array or 3d of uint or int, access::read_write)
declares its slot R32ui or R32i, as Vulkan's image atomics require and as Metal requires an R32Uint
or R32Sint texture there. Under the identity domains identity_class refused every storage
declaration with a format, so such a kernel was Unsupported{IdentityDomains}. It now admits an
R32ui or R32i storage declaration as the class StorageFormatClass::Format(R32_UINT | R32_SINT),
whose variable is the storage-image array's (set 1, binding 1, which every storage class aliases;
no link or declaration change). The atomic's emission takes the element of that array at the
index the slot's pushed resource ID holds (emit::identity_id), as a read or write does; it took the
array variable itself before, which no path reached. The default domains are unchanged.

Still refused under the identity domains: ulong atomics, texture-buffer atomics and an argument
buffer's atomic texture.

The CPU interpreter models OpImageTexelPointer (unmodelled before): a pointer to a texel inside
its image (Root::Texel), through which an atomic reads and writes the texel's first component, as
an atomic of an R32ui / R32i image does. Robustness's atomic outside the image and one on an
unmapped texel stay unmodelled.

Conformance: swizzled-storage-atomics now makes its pipeline and meets the runtime's
Gap::SwizzledReadWrite at its first dispatch (case/RRRR/dispatch), where a read_write slot bound to
a swizzled texture is refused; its known-gaps-rt.tsv row moves there and says why: Metal's atomic
answers the texel unswizzled, but nothing yet says a slot's reads are atomics alone.

Docs: RESOURCE-ID.md's arrays name the R32Uint / R32Sint storage class of a texture atomic;
API.md's identity forms name a texture slot's atomics (the paragraph's lines reflowed);
CONFORMANCE-COVERAGE.md re-derived for the atomics row's reason (REFUSALS.md re-derives
unchanged).

Test: engine_identity's a_texture_atomic_is_the_r32_storage_element_its_resource_id_names: a
generated texture2d<uint, access::read_write> atomic_fetch_add under the identity domains on
lavapipe, moltenvk-m3 and moltenvk-m3 without robust image access; each passes L3, its one image
class is R32_UINT storage at set 1 binding 1, the guard's size query is there exactly where the
device lacks robust image access, and on the CPU interpreter each thread adds 5 to its texel of
element 2 (the one the pushed resource ID names), answers the texel it held, and no other element
changes.

SEMANTICS_VERSION 2233, one above development's (main renumbers at landing): a refusal becomes a
module. The old runtime's render descriptor key changes with it
(the_old_render_descriptor_key_keeps_its_value), pinned at landing.

Verified (potluck; the jobs ran this diff on development 846f7c1428, and this commit is the same
diff on 62c563f564, whose eight commits since touch none of its lines but SEMANTICS_VERSION and
the API.md paragraph's neighbours):
- m3-max-61334 (msi, at the WIP tree e55576964b, this commit's code and test before its ledger row
  and docs): cargo fmt --check, clippy with all features, with --cfg m2v_gpu and with --cfg
  m2v_cpu_icd, and Rustdoc -D warnings pass; nextest of metal2vulkan and metal2vulkan-conformance
  4363 run, 4362 passed, the one failure the old render descriptor key above; the
  metal2vulkan-conformance suite under --cfg m2v_cpu_icd on lavapipe 1015 passed.
- m3-max-61335 (um790, at e55576964b): conformance replay --cpu swizzled-storage-atomics on
  lavapipe makes the pipeline and is refused at case/RRRR/dispatch (Gap::SwizzledReadWrite).
- m3-max-61438 (msi, llvmpipe LLVM 23.1.1, at the WIP tree ad62594111, this diff but the coverage
  document): conformance replay --cpu of swizzled-storage-atomics and the 13 read-through cases
  against the committed Metal answers: 14 refused, "exactly the open gaps known-gaps-rt.tsv
  expects", exit 0.
- scripts/conformance-coverage/coverage.py and scripts/refusal-surface/refusal_surface.py run at
  this tree (the coverage document's one changed row is in this commit).
- The next commit's states-only play over the 36 recorded streams runs this commit's code too.
2026-11-20 20:25:23 -08:00
Anees Iqbal 62c563f564 replay: the over-copies' causes among the executed counters
The report counted over-copies and their bytes, and those over imported blocks, but not why the
runtime keeps each texture in an image of its own. The runtime already splits them by cause in
Metrics (over_copies_host_memory, _pitch and the ten like them, each with its bytes). The backend
now reports all twelve pairs, so a frame's, a completed group's and the total's over-copies split
by cause. This is what the planner asked for to split the 48,710 small over-copies across the link.

Validation only; the runtime is unchanged. The replay stage test now also checks that two of the
keys are there.
2026-11-20 20:10:00 -08:00
Anees Iqbal 9027bd2aa3 rt: count scheduled-to-start under earlier GPU spans, GPU-end-to-handler steps and calibrations
The clean 5080 re-play's print needs three things the stage sums alone cannot give.

First, how much of each command buffer's span from scheduling to GPU start lies under other
command buffers' GPU spans, the runtime's own uploads and copy-ins included, against the part
under none of them. This is Metrics::scheduled_to_gpu_start_behind_nanos.

Second, its span from GPU end to handlers split at the completion thread's own steps. This is
Metrics::gpu_end_to_handler_steps_nanos, six steps:
- seen: GPU end to the thread seeing the completion;
- told: telling the submit thread;
- stamp read: reading the round's timestamps;
- calibration: a calibration, where the round runs one;
- earlier: the round's earlier retirements, their handlers included;
- own: its own retirement until its handlers begin.
The same steps are kept for the command buffers of 1,024 us or more (gpu_end_to_handler_tail
and its steps), so a 1-8 ms tail can be placed in a step.

Third, the calibrations and their calls' time. The counter that only the tests had becomes
Metrics::calibrations, beside calibration_nanos.

The replay backend reports all of these as executed counters.

Counting only; nothing changes form. There are no new waits, locks or allocations. What each
count costs:
- Completion thread, per round: two clock reads (the stamp read's start and end), and a third
  where it calibrates. The period check reuses the stamp read's end, so it no longer reads the
  clock itself.
- Per command buffer retired: one clock read where its retirement begins, then for one that
  counts stages:
  - one pass over a fixed ring of the latest 128 GPU spans, a stack array in the completion
    thread;
  - a sort, on the stack, of those that meet its span;
  - one relaxed atomic add for the behind part;
  - six for the steps, and seven more for one in the tail.
- Per upload or copy-in retired: the timestamps it already read go into that ring. There is no
  second query read.
- Per calibration: two clock reads and two relaxed atomic adds.

Retirement returns an upload's and a copy-in's two timestamps (times::retire_own). The
completion thread places them on the host clock by the calibration as it stands
(Calibration::at, which moves nothing), and the program's command buffers' spans as placed.

Tests:
- host tests for the ring's merged, clipped union and its oldest-first replacement;
- a host test for the round's steps adding up to the span;
- the device stage test now checks that the six steps add up to gpu_end_to_handler_nanos, that
  the behind part is at most scheduled_to_gpu_start_nanos, and that the device start
  calibrated;
- the replay stage test checks the same through the report's keys.
2026-11-20 20:09:37 -08:00
Anees Iqbal 83049f641a rt: the pixel interlock orders a raster order group on the memory the function reads and writes
Device creation enables VK_EXT_fragment_shader_interlock where the device lists it, and its
fragmentShaderPixelInterlock where the device reports it (floor's PIXEL_INTERLOCK, one of the
optional extensions; the sample interlock and the shading-rate interlock stay off). The
translator's profile then has the feature, and a fragment function's raster order group on a
buffer, a texture or an argument buffer's member it reads and writes compiles to its one form,
the body inside PixelInterlockOrderedEXT. A device without the feature keeps the typed refusal
(RasterOrderGroups, naming FragmentShaderPixelInterlock). Of the venues probed, KosmicKrisp on the
M3 Max and RADV on the RX 550 list neither the extension nor the feature (vulkaninfo, jobs
m3-max-61291 and m3-max-61296); every other venue reports it, the UHD 630's Windows driver
included (m3-max-61292).

Under the identity domains the interlock chooses no other form. The new
lower::fragment::interlock_forms(p) is pixel_interlock and not identity(p), and it now gates
every form the interlock chose beyond a raster order group's: the fetch's storage form
(interlock_orders), the blend, merge or logic operation computed over it (color::unordered),
the stencil output's storage form (stencil::device_form), the imageblock (imageblock::require),
the snapshot read (snapshot::finish) and the binding plan's snapshot (bind/graphics.rs). Each of
these is a storage image bound through a descriptor, which the identity domains hold none of,
so under them each keeps the form or the refusal it had before the enable, refusal text
included. rog::mode and the device report read the feature itself, as before.

A raster order group on a colour attachment: the lowering enters no critical section for it.
The interlock cannot order the attachment's own write, which happens after the function, so a
group on the colour input, or on a colour output of an attachment the function reads, keeps
the fetch's own ordering: the attachment's pushed texture read at its pixel, ordered after the
earlier draws of the pass and not within its own draw. That difference stands as the static
PrecisionNote::UnorderedFetchWithinDraw the read records, in the runtime README's Known gaps of
render encoders and in docs/API.md's catalogue; both now say the pixel interlock's devices are
included and why.

The storage-image forms of fetch, stencil, colour, imageblock and snapshot are unreached under
the identity domains after this. They are not deleted here; they go to cutxlate's queue.

Tests: the runtime's tests/pixel_interlock.rs draws rog_buffer (engine fragment_rog) four times
over a whole target in one draw on every device of the cfg's kind: the state is made only where
the profile has the feature, each pixel's float sums to 4 and its texel holds the fourth
fragment's sum; elsewhere the state is refused naming RasterOrderGroups. tests/floor.rs adds
the_pixel_interlock_is_enabled_where_reported (the sample interlock stays false) and chains the
structure as Device::open does. The translator's
tests/engine_identity_interlock.rs builds rog_buffer and fetch_ordered under the identity
domains on lavapipe's profile with and without the feature: rog_buffer interlocks and passes L3
with it and is refused without it; fetch_ordered has no interlock, no storage attachment, the
UnorderedFetchWithinDraw note and FetchedColor { color: 0 }, its modules word-identical either
way.

Docs: the runtime README's extension table, a Pixel interlock section under Floor with its
feature table, the raster-order-group gap of render pipeline states (now refused only on a
device without the feature) and the fetch gap; docs/API.md's UnorderedFetchWithinDraw entry;
rog.rs's and fetch.rs's module docs. docs/REFUSALS.md is unchanged (its check passes).
api_signatures.tsv re-blessed for floor::Features's new interlock field.

SEMANTICS_VERSION 2231 is a placeholder one above development's 2230: under the identity
domains a profile with the pixel interlock now takes, for a fetch, a stencil output, a blend,
an imageblock and a snapshot, the form a profile without it takes.

Verification: the lint, test, validation and states-only play jobs are named in the hand-off.
2026-11-20 20:01:45 -08:00
Anees Iqbal b1b5168fd6 Replay report: untimed waits, the runtime's stage sums and its stage histograms by frame
The 5080 play of a 3090 compute recording waited 42.5 s of 95.1 s wall with 23.1 s of gpu_busy;
before a fix is ruled on, the report must say where the other 19.4 s went. Three reads were
missing from it:

- A waited command buffer with no GPU interval (start 0, or end not past start) adds nothing to
  gpu_busy while its wait counts in full. Each frame's end line now has untimed_waits and
  untimed_wait (the wait spent on them), and the report sums them in an `untimed waits` line.
- The runtime already histograms every command buffer's commit to scheduled, scheduled to GPU
  start, GPU run and GPU end to handler, but only in power-of-two buckets, which give no seconds.
  Metrics now keeps each stage's sum beside its histogram (commit_to_scheduled_nanos and the
  three like it), counted in the same call as the bucket.
- The player printed none of it. The backend's executed counters, so every frame line and the
  total, now carry the four sums, held_starts and held_start_gap_nanos, runtime_command_buffers
  and runtime_command_buffer_gpu_nanos (the uploads and copy-ins that run outside every Metal
  command buffer's GPU interval), and untimed_command_buffers. The four histograms print at the
  play's end as `stages F ...` lines, cumulative as each frame ended, and `stages end ...`.
  They are not per-frame counters, so the 69k `completed` lines of a long play do not grow by
  92 keys each.

Tests: the runtime's stage histogram test also checks each sum against the three command
buffers' own times (exact for the first three stages, bounded by the host time after each
finished for the fourth); a player test on the synthetic backend counts a frame's untimed
waits (none and zero-length intervals) and the report's sum; a lavapipe replay test reads the
new counters and the stages lines across two frames.
2026-11-20 19:44:55 -08:00
Anees Iqbal 0aa20c8bbf Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 19:33:55 -08:00
Anees Iqbal bb9a63810b rt: a draw fills its functions' bicubic word, as a dispatch does
A render state whose vertex or fragment function samples a 2D texture slot
through a bicubic constexpr sampler was refused at creation
(Gap::RenderPipeline, DrawInput): render::draws had no arm for the
translator's PushField::BicubicTexels, and fill_push wrote nothing for it.
A dispatch fills the same field for a kernel's slot.

Now a draw means by the field what a dispatch does. render::draws places the
field (FieldValue::BicubicTexels of the slot, in the stage's table) and lists
the slot in the content's own Draws::bicubic. The draw's checks
(Facts::find), which run only when the pipeline state or a binding changes,
refuse a bound texture with no bicubic word with the dispatch's typed gap,
Gap::BicubicTexels naming the slot and the format (an 8-bit sRGB format,
whose taps Metal filters decoded, a compressed, YUV, stencil, integer or
extended-range one). fill_push writes the word from the bound texture's format
and swizzle (bicubic_texels_word), or BICUBIC_TEXELS_UNBOUND for a slot that
holds no texture. A bicubic sample at pixel coordinates or of a 1D texture
stays the translator's refusal under the identity domains, as for a kernel.

Nothing new runs on the draw path of any other pipeline. The check loops over
the content's own list, Draws::bicubic, which render::draws fills only from a
BicubicTexels push field: empty for every other content, so its check is a
loop over nothing, once per change, never a per-draw scan. The fill is the
match arm of that field, which no other content has. The device test asserts
the list is empty for a state without a bicubic sampler (colored_fragment).

Both stages are covered. The fragment half uses the fixture bcu_fragment. The
vertex half uses a new owned fixture, bcu_vertex: a vertex function samples at
p[vid] through a clamp-to-edge bicubic sampler at normalized coordinates in
the implicit form, and bcu_vertex_color writes the sample. Its companions come
from scripts/regen-air-fixtures on the M3 (m3-max-61235, Metal 32023.922, SDK
27.2), with its TOOLCHAIN line. It has no corpus case.

Gap::BicubicTexels's docs and text now name a dispatch or a draw and "a
function" in place of "a kernel". docs/REFUSALS.md is regenerated, and the
ledger row of bicubic-texel-classes' sRGB dispatch carries the new text.

RUNTIME_VERSION 2547 -> 2548 (placeholder): a run of an unchanged render
artifact with a bicubic slot now draws where it was refused.

Basis: this is NOT documented Metal. The MSL spec lists only nearest and
linear filters, and 'bicubic' appears nowhere in the spec or the feature-set
tables. It is built because a guest already uses the bicubic constexpr
sampler in kernels, which is why the kernel half exists. Filling the field for
a draw completes that one form and adds none.

Test: tests::bicubic_draw's every_device_draws_a_bicubic_sample_in_each_stage,
for each stage:
- the content lists its one slot, and the field is in the push range;
- each of six formats pushes its bicubic_texels_word, and an empty slot pushes
  the unbound word;
- an RGBA8Unorm_sRGB texture is refused with Gap::BicubicTexels naming slot 0
  and the format;
- an RGBA8Unorm texture whose texels are all one value renders that value at
  every pixel.
2026-11-20 19:33:15 -08:00
Anees Iqbal 846f7c1428 Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 19:31:57 -08:00
Anees Iqbal d3d40dd31e Identity domains: an argument buffer's texture sampled through the argument buffer's own sampler
Under the identity domains, an argument buffer's sampler was refused. Its cubic test pushed the
execution status address ("an encoder value the function reads as ExecutionStatusAddress"), and
behind that was the form's own refusal ("an argument buffer's sampler"). The sampler's resource ID
is now its handle, read from the member's 8 bytes with no sampler table (access::handle,
emit_identity_sampler):
- Its index selects the element of the set-1 sampler array of its use. That is the array an
  argument buffer's sampler already declares, at the same binding the slot samplers' identity
  arrays use.
- The word's fields (pixel coordinates, the nearest-pixel test) come from the ID's high word
  (sampler::emit::heap_sampler_field).
- The handle is a uvec2 wherever it is held (lowered_pointer, and word_repr for a member word).
  A select's null operand is the nil ID.

Bad-ID guard: compare-and-select, index < 4,000 ? index : 0, so an index past the arrays samples
through element 0, the default sampler. I chose it over 4,096-element arrays with a 12-bit mask
because it is two instructions with no layout or floor change. The mask would need every array at
4,096 elements and every unowned element holding the default sampler, which the floor does not
state. pipeline::link::IDENTITY_SAMPLERS becomes pub(crate) for it.

No cubic test under the identity domains (sampler::select::cubic_reach returns early). The runtime
makes no sampler state of a cubic filter (Gap::CubicSampler), so no live ID's word carries bit 30.
The runtime README says so beside the gap, and docs/RESOURCE-ID.md says how the shader reads the
ID.

The conformance ledger's 32 rows refused only by the cubic mark now run through the runtime. On
lavapipe:
- 3 match: pixel-samplers-rgba16f-nearest-{border,edge,zero}.
- 5 are refused at case/encoder, Unavailable argument_encoder or argument_encoder_with_arguments:
  the rt side has no argument encoder.
- 24 differ. In each, every source our side runs answers alike wherever Metal's do.
Their 32 rows become 192 rows scoped to llvmpipe, each naming its note and bound:
- pixel-downscales: pixel-sampler-scaling, 2/255.
- pixel-samplers linear: device-sampling.
- rgba8 nearest and subnormal: device-texel-conversion.
- the two nearest mirror norm sites: device-sampling, the device's mirror clamp to edge at
  normalized coordinates, which a device test shows a slot's sampler and an argument buffer's
  read alike.
docs/CONFORMANCE-COVERAGE.md is regenerated for the ledger (7,490 rows to 7,650).

pixel-samplers now declares the slot form's pixel-sampler-scaling on nearest states as well
(replay::pixel_sampler_scaling_notice): under the identity domains the slot's word is read at
dispatch, so the note is the operation's on any state.

SEMANTICS_VERSION 2231 (a placeholder for the landing to renumber).

Tests:
- engine_identity's
  an_argument_buffers_sampler_samples_through_the_identity_arrays_by_its_resource_id covers
  tail_argument_samplers' four kernels and tail_argument_cube_gradient on every profile: L3, set
  0 empty, set 1 the identity layout, the bindings used, no sampler slot ID, constexpr index or
  status address pushed, and no RuntimeFact::CubicArgumentSampler.
- metal2vulkan-runtime tests::argument_sampling (lavapipe, m2v_cpu_icd):
  - argument_sampler_edges through a linear state reads the edge averages; through an ID of that
    word with index 4,000 it reads element 0's nearest texels (the guard).
  - every_device_samples_alike_through_an_argument_buffers_sampler_and_a_slots: one texture at
    the pixel-samplers case's 800 normalized coordinates through one nearest state under clamp to
    edge, to zero, to an opaque white border and mirror clamp to edge, bound at a slot and held in
    an argument buffer; bit-equal.
- validation's an_argument_buffer_sampler_samples_its_member_texture compares the runtime's run
  with Metal's texels, where it held the refusal.

Verified (potluck jobs; this commit's tree equals WIP 16c70bf88a on acc706ca47):
- Gate m3-max-61241 (um870, at WIP 7df837b74d, the same tree but for the coverage document):
  focused tests (the (ii) translator, runtime device and validation tests, golden, argument
  sampler and cubic) pass on lavapipe; fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) and
  Rustdoc clean; the suites of metal2vulkan, metal2vulkan-runtime and metal2vulkan-conformance on
  lavapipe: 4,866 of 4,868 pass. The two red: the_old_render_descriptor_key_keeps_its_value (red
  between pins) and the coverage document test, for this ledger's rows; the document is
  regenerated here (python3 -I scripts/conformance-coverage/coverage.py) and its test passes
  at 16c70bf88a (m3-max-61285, um870).
- Mirror control, lavapipe (m3-max-61184, at WIP 01ba67160c on dc21cd66c7): both
  argument_sampling device tests pass; slot and argument-buffer samplers bit-equal under all four
  address modes.
- Conformance replay --cpu on lavapipe with the new ledger: m3-max-61194 (um790, WIP 8793aab9ce
  on dc21cd66c7) and m3-max-61223 (gem10, at 7df837b74d) rc=0: announced 3, divergent 24 (each
  held by its llvmpipe row), refused 5.
- Family C proofs at WIP 5277d7228 on dc21cd66c7 (translator source equal to this commit's but for
  SEMANTICS): SCOPE=public m3-max-61166, 14 cases, match 10 -> 14 (06b41c83, 0e720f8b, 2648a020,
  34f89406 flip from not_supported to match), slowest after 06b41c83 1.05 s, 207 MiB; SCOPE=private
  m3-max-61180, 6/6 match before and after, slowest after 1.92 s, 220 MiB.
- States-only play on lavapipe, 36 streams, player built at WIP 0ff352d28b on dc21cd66c7
  (translator source equal): render made 291,334, refused 0; compute made 51,029, refused 0;
  0 newly refused states (m3-max-61181 ms01, 61188 um870, 61196 um790, 61206 gem10, 61210 msi).
2026-11-20 19:31:25 -08:00
Anees Iqbal 34c25738ee Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 19:30:54 -08:00
Anees Iqbal 9b1026e61b Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 19:08:44 -08:00
Anees Iqbal 1687f8fc38 Validation: a 32-bit float depth texture is filled by a draw through the runtime, and a depth outside [0, 1] is the runtime's limit
The runtime takes no upload of a 32-bit float depth (Gap::FloatDepthUpload, which its own texture
and blit tests hold both ways). Kernel and render cases that bind a Depth32Float texture stayed
on the executor's own context. Now they run through the runtime: the run fills each such texture
by a draw, as a guest fills one.

The fill:
- The owned fixture depth_fill.metal is regenerated with scripts/regen-air-fixtures on the M3
  (m3-max-61107). It holds a fullscreen vertex function and a fragment function that writes
  depth(any) from a buffer of texels by pixel.
- platform::runtime_depth draws one pass per level and slice into the texture's depth
  attachment, under an always-passing depth test that writes. The texture is made with
  RenderTarget usage beside its declared usage.

DepthOutsideUnitRange becomes the runtime's limit (Limit::Runtime) and qualifies on Metal, as
ruled. A draw writes depths clamped to the viewport's [0, 1], so no runtime call puts a NaN, a
negative value or a value above 1 where Metal's texel holds it. The case checker now raises the
requirement from the case's literals on every device (executor_contract::case_requirements, via
depth_range::depth_range_requirement). The literals checked are each Depth32Float texture, each
texture-array element, each argument buffer's texture, and the depth attachment's initial depth.
The old executor's device-gated check (plan_resources::require_depth_range, which read
VK_EXT_depth_range_unrestricted) and its two call sites are deleted. The fill refuses such a depth
too, typed, so it never clamps one silently. No source fact carries the requirement, so the
source census is unchanged. Of the committed public cases, 7 kernel cases close as runtime-refused
(4ac0d4322d, 5d9f284f87, 70064cea52, f04e9b48c8, 59b3a9a43e, 6955da3062, b3d8e09b92). Their Metal
rows stay as committed.

ENGINE_EXECUTOR_ABI goes to v191.

Tests:
- Unit: the requirement from each literal kind, and its limit, stops and evidence gap.
- The Runtime and qualifies_on_metal lists.
- Routing: a Depth32Float texture now routes.
- Device: a_float_depth_texture_is_filled_by_a_draw_and_reads_back_as_authored. Both runs read
  eight depths of a 4x2 texture back exactly, and through the runtime a depth of 2.0 is refused
  as depth_outside_unit_range.
- The device test of the old gate is deleted with the gate.
2026-11-20 19:06:55 -08:00
Anees Iqbal acc706ca47 Identity domains: a sequentially consistent fence is refused naming the fence
The translator orders a seq_cst fence (atomic_thread_fence of memory_order_seq_cst beyond the
thread, or a seq_cst barrier whose memory scope is the device) through an increment of the
command buffer's ExecutionStatus word. The identity domains reach no such word. Their refusal was
the generic one at the plan's end, which named the push field the fence asked for: "an encoder
value the function reads as ExecutionStatusAddress". require_seq_cst now refuses the fence itself
under the identity domains, as Unsupported{IdentityDomains}, not implemented, naming its Metal
form, "a sequentially consistent fence" (barrier::SEQ_CST_FORM). It stays refused; the default
domains compile it as before.

Docs: the runtime README's known gap of the forms the identity domains do not lower gains the
fence and its test. Validation's executor_contract::seq_cst_fence and
ToolingRequirement::SeqCstFence docs name the new text. docs/REFUSALS.md is regenerated (the
IdentityDomains row gains the barrier.rs site).

Tests: engine_identity's new
a_seq_cst_fence_is_refused_naming_its_form_under_the_identity_domains (a4_device_fence on
lavapipe and moltenvk-m3: under the default domains it compiles and states ExecutionStatus; under
the identity domains it is refused IdentityDomains, NotImplemented, symbol "a sequentially
consistent fence"). Validation's
a_seq_cst_fence_is_refused_through_the_runtime_as_its_requirement_says now looks for the fence's
name in the runtime's error.

SEMANTICS_VERSION 2230 (placeholder; main renumbers): a refusal's text changes.

Consumer check: no public item is added or removed.

Verified: m3-max-61154 (msi) at this commit's tree: fmt, clippy (plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan, -conformance, -validation and
-runtime, 5880 of 5881 passed, the new identity test among them; the one failure is
the_old_render_descriptor_key_keeps_its_value, which moves with SEMANTICS_VERSION and waits for the
next named pin. Only the refusal's text changes, so no play.
2026-11-20 18:57:42 -08:00
Anees Iqbal 8528603a73 Validation: a vertex or fragment case of one sample draws through the runtime
A render case of one sample now draws through metal2vulkan-runtime's public API on Linux, in the
stated leg and with no profile restriction, as a consumer draws it. That covers its own stage's
buffers, bound textures and samplers, function constants and linked functions, and its generated
companion. It also covers vertex buffers at static strides, Shared 2D color targets loaded and
stored by the pass, the oracle's depth-stencil state, cull mode and winding, and one direct or
indexed draw of primitives. The case observes a buffer, a texture, a color target or nothing. A
rasterization-disabled vertex case renders into the oracle's 1x1 R8Unorm attachment, which its
pipeline declares at index 0, as the oracle's does.

engine::runs_render_through_runtime decides the route from the case's structure alone, naming
every RenderCase and StageResources field. These keep a case on the executor's own context:
- a depth/stencil attachment;
- more samples;
- layered rendering;
- a dynamic vertex stride;
- an argument-buffer member, object or command buffer;
- a function table;
- tessellation;
- an imageblock;
- a rate map;
- an out-of-bounds target;
- a fragment pass with no color target (the runtime makes no pass without an attachment,
  Gap::RenderPass).

The kernel route's attempt, validation log, device, ceilings, sampler numbering, buffers,
submission and row are now shared helpers in platform::runtime. runtime_textures makes one
function's textures and samplers at the run's next indices, so both stages of a draw take
disjoint ones. ENGINE_EXECUTOR_ABI goes to v190: render rows of the routed shape now record the
runtime's answer.

Tests:
- a unit test pins the routing both ways;
- three device tests (the passthrough fragment, the observed vertex at its varying and its
  position, and the rasterization-disabled vertex store) run the runtime arm on Linux against
  the same expected bytes.
2026-11-20 18:29:45 -08:00
Anees Iqbal dc21cd66c7 Colour groups go: no render variant draws a group of a pipeline's color attachments
A device draws to at most the lesser of its maxColorAttachments and maxFragmentOutputAttachments
color attachments at once. A pipeline with more (or one at an index at or past that count) was
compiled as color groups: a variant per group (VariantKey::color_group) whose fragment function
wrote the group's colors at locations 0.., with the group's attachments alone in its graphics
state, and the runtime drew each group in a pass of its own. The runtime's floor requires 8 of both
limits (floor.rs), Metal's count, so no device it runs on takes a group, and it asks for every
render variant with VariantKey::new(); nothing in it reads GraphicsState::color_group. The groups,
their inputs and their note are deleted. Such a pipeline is now refused where it was already
refused without a group: InterfaceComponents at MaxColorAttachments (link) or at
MaxFragmentOutputAttachments (the fragment's outputs).

Removed:
- pipeline/compile/color_group.rs (group, descriptor, entry, refusal) and the compile layer's use
  of it: FragmentPass::color_group, InputsFrom::color_group, grouped_entry, and the grouped
  descriptor in compile_render_pipeline_keys and render_pipeline;
- the inputs and keys: ColorGroup (with of, width_on, colors, groups, location),
  VariantKey::color_group, LoweringInputs::color_group and its key bytes, the pipeline key's
  " color_group N" field (variant_fields);
- link: RenderLinkInputs::color_group, LinkInputs::render_variant's group parameter, and link's
  group check (a fragment stage of another group, and the per-group refusals);
- the state: GraphicsState::color_group and StageIo::color_group;
- the invariance: the stage plan's invariant_fragment_outputs and its Invariant decorations of
  FragDepth, SampleMask and FragStencilRefEXT; the module builder now decorates Position and
  ClipDistance alone, the outputs nothing else made invariant;
- PrecisionNote::ColorAttachmentGroups, its conformance Degradation, its comparison allowance and
  its catalogue entry in docs/API.md;
- validation: the census's color_groups and color_limit, which translated a fragment function of
  more colors than the profile draws as one module a group, and with them PendingL3::groups,
  PendingModule and the L3 stage's later modules: an attempt is one module again.
  ENGINE_CENSUS_VERSION 8;
- the runtime's translator_fields row for color_group.

Tests:
- engine_color_groups goes, and engine_primitive_ids' color_groups_share_the_vertex_function_s_id.
- validation's a_fragment_function_of_more_colors_than_the_floor_translates_in_color_groups becomes
  a_fragment_function_of_more_colors_than_the_device_draws_is_refused: on a four-color profile
  cg_five, cg_seven, cg_sparse and cg_counts keep their limit refusal; on lavapipe each translates.
- the builder's invariance test: FragDepth is refused like PointSize.
- api_tests, api_surface and the variant key's debug text lose their rows.
The color_groups and color_groups_fetch fixtures stay (engine_dead_reads, pass_attachment_pairs
and the fixture tables read them).

docs/API.md's paragraph on groups now states the two limit refusals; docs/VALIDATION.md's census
row loses its sentence. api_signatures is blessed; docs/REFUSALS.md is regenerated.

SEMANTICS_VERSION 2228, ARTIFACT_FORMAT_VERSION 573 (placeholders; main renumbers). SEMANTICS: a
pipeline that took groups is refused, and the note goes. ARTIFACT: the codec loses ColorGroup,
StageIo's and GraphicsState's fields and a PrecisionNote variant. RUNTIME_VERSION stays: the
binder never read a group, and the runtime pin does not move.

Consumer check (consumer-uses.sh, consumer development 0140a12682, 60 refs): 0 hits (code) for
ColorGroup, color_group, width_on, render_variant and color_groups. ColorAttachmentGroups: 0 on
development; used in crates/reims-vgpu-vulkan/src/answer.rs on 37 of the consumer's steelbrain/*
branches, a crate its development no longer has.

Verified: m3-max-61080 (msi) at the tree before the import fix: nextest of metal2vulkan,
-conformance, -validation and -runtime, 5878 of 5879 passed; the one failure is
the_old_render_descriptor_key_keeps_its_value, which moves with SEMANTICS_VERSION (main pins it at
a named pin). Its clippy step found validation's InternalError import unused; m3-max-61112 (um790)
at this commit's tree: fmt, clippy and Rustdoc green. States-only plays on lavapipe of the probe
player built at the change (steelbrain/cutxlate-cgplay, m3-max-61082): m3-max-61087 to 61091, 61
runs over the 36 streams, render 502920 states made and 0 refused, compute 108189 made and 0
refused, the counts of the plays before the change.
2026-11-20 18:21:24 -08:00
Anees Iqbal a8d448f4ce Depth stand-ins go: no variant runs its draw's depth or stencil test in the shader
The runtime asks for every render variant with VariantKey::new() (render.rs) and never states
FragmentTests, so VariantKey::shader_tests, shader_stencil and window_depth_varying are false on
its path. No variant it makes tests a fragment's depth or stencil against a stand-in of the pass's
attachment. That variant, its stand-ins and their consumer contract are deleted. The consumer
names none of them on its development branch (consumer check below).

The binder: for a fragment function that stores before Vulkan's tests (TestedStorageWrites), a
draw whose depth test writes (FragmentTests::Depth { writes: true }) or whose stencil test acts
(Stencil, or Drop for a function without the early-tests variant) ran the in-shader variant. It is
now refused NotImplemented at the tested attachment, of the feature that stores first
(FramebufferFetch, or Imageblocks for an imageblock alone):
- a function with the early-tests variant: at the depth attachment for Depth, at the stencil
  attachment for Stencil;
- a function without it: at the depth attachment, or the stencil one where the pass has no depth,
  as Any already was.
A draw whose tests drop but write and count nothing keeps the early-tests variant, and one whose
tests drop nothing runs the pipeline as compiled, as before.

Removed:
- the inputs and keys: VariantKey and LoweringInputs::{shader_tests, shader_stencil,
  window_depth_varying}, and their key bytes;
- the lowering: lower/fragment/depth_test.rs (DepthTest, StencilTest, depth_test_form,
  stencil_test_form, depth_test_word, stencil_test_word, STAND_IN_FORMAT) and its calls from
  fetch's and the imageblock's tests, and the stencil output stage_io stored nowhere under it;
- the window depth varying: IoRole::WindowDepth, VaryingKey::window_depth, the vertex function's
  store (stage_io's WindowDepth) and the fragment's input, and its link checks;
- the facts and state: RuntimeFact::ShaderTests and ShaderStencilTest, GraphicsState::shader_tests,
  ShaderTestsUse, StandInUse, StandInView, link/shader_tests.rs, and compile::api's stand-in
  requirements;
- the bindings: SyntheticBinding::DepthStandIn and StencilStandIn, WriteSource::DepthStandIn and
  StencilStandIn, PushField::ShaderTestsState and ShaderStencilState, the binder's push words and
  ShaderTestsTemplate, and BindState::{depth_range, depth_clip_mode_clamp, stencil_references},
  which only those words read;
- the copies: DepthStencilCopy::DepthFromStandIn, DepthStandInForm, DepthSplitModule and
  depth_split_module;
- the notes and kinds: PrecisionNote::ComputedSampleDepth (and its conformance Degradation, C3
  deferral and comparison rows, and its catalogue entry in docs/API.md),
  Feature::MultisampledShaderDepthTest (and its reach row), DriverDeviation and VkProperty
  CenterFragCoordDepth and SampleFragCoordDepth, which nothing else reads;
- DrawReplayRule::ShaderTests, and the mechanism rows of the two facts;
- the runtime's translator_fields row for shader_tests.

Tests:
- engine_fragment: the discarding fetch beside depth expects a depth test that writes refused at
  the depth attachment and a stencil test that acts at the stencil attachment. The per-sample
  depth test, the memory-writing fetch's Drop draw, a returned depth
  (a_fetch_that_returns_its_depth_refuses_a_draw_whose_depth_test_writes, which keeps the compiled
  pipeline's checks) and a returned stencil or mask
  (a_returned_stencil_or_sample_mask_refuses_a_draw_whose_tests_act) expect the refusal. The
  stencil test in the shader goes.
- engine_fragment_imageblock: a tested imageblock writer's depth draw is refused
  NotImplemented(Imageblocks) at the depth attachment.
- engine_moved_writers: the writers' wanted tests are the early-tests variant alone; a draw that
  ran the function's own tests is refused.
- depth_stencil_copy, owned_divisions, the mechanism table, api_tests, the binder's templates, the
  variant key's debug text: their stand-in rows go. The binder's stencil words test goes.

api_surface loses its rows; api_signatures is blessed; docs/REFUSALS.md is regenerated.

SEMANTICS_VERSION 2227, ARTIFACT_FORMAT_VERSION 572, RUNTIME_VERSION 2547 (placeholders; main
renumbers). SEMANTICS: the binder's plans of such draws change, and the key bytes go. ARTIFACT: the
codec loses SyntheticBinding, PushField, RuntimeFact, IoRole, VkProperty and PrecisionNote variants,
GraphicsState's field and three structs. RUNTIME: plans and BindState change. The runtime pin
moves.

Consumer check (consumer-uses.sh, consumer development 0140a12682, 61 refs): 0 hits (code) for
ShaderTestsUse, StandInUse, StandInView, shader_tests, shader_stencil, window_depth_varying,
DepthStandInForm, DepthSplitModule, depth_split_module, DepthFromStandIn,
MultisampledShaderDepthTest, CenterFragCoordDepth, SampleFragCoordDepth, ShaderTestsState,
ShaderStencilState, DepthStandIn, StencilStandIn, WindowDepth, window_depth, stencil_references,
depth_clip_mode_clamp, ShaderStencilTest, DepthTest and ShaderTests; depth_range in link-order
lists only. ComputedSampleDepth: 0 on development; used in crates/reims-vgpu-vulkan/src/answer.rs
on 38 of the consumer's steelbrain/* branches, a crate its development no longer has.

Verified: m3-max-61056 (msi) at this commit's tree: fmt, clippy, Rustdoc, and nextest of
metal2vulkan, -conformance, -validation and -runtime, 5885 of 5886 passed; the one failure is
the_old_render_descriptor_key_keeps_its_value, which moves with SEMANTICS_VERSION (main pins it).
States-only plays on lavapipe of the probe player built at the change on 999b82bfe2
(steelbrain/cutxlate-siplay, m3-max-61016): m3-max-61022 to 61026, 61 runs over the 36 streams,
render 502920 states made and 0 refused, compute 108189 made and 0 refused, the counts of the play
before the change: no state a stream makes meets the new refusal.
2026-11-20 18:07:17 -08:00
Anees Iqbal 5b653bc1d4 Validation: a kernel case's argument buffers of buffers, textures and samplers run through the runtime
What: runs_through_runtime now routes a kernel case whose argument buffers hold buffers, textures
the runtime makes (`runtime_texture`) or samplers, observing a buffer, a texture, an
argument-buffer buffer or texture, or nothing. A pipeline state, a command buffer or a
rasterization-rate map in an argument buffer still keeps the case on the executor's own context.

How, as the Metal oracle does (metal::platform::argument_buffers):
- Each argument-buffer buffer is a Shared buffer of its bytes.
- Each argument-buffer texture is made as a bound one, with the usage its AIR member declares
  (runtime_member_usages), at an index of the run's texture grant after the bound textures.
- Each argument-buffer sampler is its argument_sampler_descriptor at an index of the sampler
  grant below the bound samplers.
- The owner's bytes hold each member's gpu_address or gpu_resource_id().to_bits() at its field
  (engine::argument_buffers::owner_bytes), written before the owner is made, as a program writes
  them.
- The encoder uses each member buffer and texture for reading and writing (use_resource).
- An argument-buffer buffer output reads the member's final bytes; an argument-buffer texture
  output is read back as a bound texture's.

ENGINE_EXECUTOR_ABI is now vulkan-engine-v189. docs/VALIDATION.md's "Through the runtime" names
argument buffers.

Tests:
- The routing test routes a case of all three member kinds under both member outputs, and keeps
  a texture-buffer member off the runtime.
- Three device tests run on the executor's own context and, on Linux, through the runtime:
  - selected_member_texture: two argument-buffer textures chosen per thread;
  - argument_sampler_sample: an argument-buffer sampler sampling its member texture;
  - ob2_loaded_pointer, in bounds: an argument-buffer buffer loaded into `out` and stored
    through, observed in the member.

Verified: in the lane's report (the compile gate and the family's proof, its 20 committed cases
on lavapipe against committed Metal, before and after).
2026-11-20 17:44:53 -08:00
Anees Iqbal 999b82bfe2 player: a pipeline state's making counts what it made, lowered, loaded and VkPipelines, and a load makes its content new
What: each group and each slow making carries "L lowered, D loaded, P VkPipelines"
(translations, translations_loaded, pipelines_created). A making is of "new" content where it
made any of them, and "held" where it made none.

Why: the warm pass of m3-max-60954 showed the first form calling a load-only compute state
"held", and using the word "cold" in a second pass.

Verified: the same test, which now also checks the counts and the held state's zero driver time,
green in m3-max-60980.
2026-11-20 17:38:00 -08:00
Anees Iqbal 10d00d44b4 player: each pipeline state's making split into the translator's, the driver's and the rest
What: the replay report gains a `pipeline makes N states: ...` summary line and up to ten
`pipeline make slowest K #ID KINDS ...` lines, documented in docs/REPLAY-STREAM.md. KINDS is
kernel, vertex or post-tessellation vertex, plus +fragment.

How: each render and compute state's making is read from metal2vulkan-runtime's own Metrics on
the player's thread before and after it, with the wall time on rt::host_time (the counters' own
clock): translation_nanos against pipeline_creation_nanos, and the rest as "other". No runtime
counter is added. rt makes every state on the calling thread, and the only other thread that can
run beside a making is the player's own pre-pass. So the pre-pass pool now tallies its
prepare_dispatch calls begun and ended. A making that ran while one of them ran is counted
("beside a pre-pass call") and marked, since its figures include that call's work. The compute
states' `pipeline I wall_nanos=` lines take their wall time from the same clock.

Why: the next cold number needs its cause beside it: per pipeline, the translator's work against
the driver's vkCreate*Pipelines.

Verified: replay::rt_replay::each_pipeline_state_s_making_is_split_into_the_translator_s_and_the_driver_s_time
on lavapipe (m3-max-60980, with fmt, clippy plain, m2v_gpu and m2v_cpu_icd, and workspace
Rustdoc green). Without the line it fails at the summary-line find. On a real card: the cold and
warm states-only plays of one recorded stream on an RTX 3090 (m3-max-60954).
2026-11-20 17:38:00 -08:00
Anees Iqbal 47d782f3a5 Fix forward of 14dca89bf9: lint, a float depth stays on the executor's context, a format the device lacks is not_enabled
What: the compile gate m3-max-60907 at 14dca89bf9 failed clippy twice and Rustdoc twice:
- `usage = usage | ...` becomes `usage |= ...`;
- `dispatched` takes its dispatch and threadgroup size as one argument;
- the public docs of `runs_through_runtime` and `RuntimeKernel` named private items as links.

The family's public proof (m3-max-60908, 218 cases on lavapipe against committed Metal, before
and after) showed 17 rows failing through the runtime:
- 15 bind a Depth32Float texture, whose bytes the runtime takes no upload of
  (Gap::FloatDepthUpload). The executor cannot fill one, and a guest fills one by drawing.
  `runtime_texture` now keeps such a texture on the executor's own context, where these rows
  ran before.
- 2 bind R8Unorm_sRGB, which lavapipe's format query lacks. The runtime refuses it as
  Gap::TextureFormat; before, the executor's own context recorded not_supported{not_enabled}.
  `runtime_error` now maps that gap to NotSupported::NotEnabled with the gap's text. Every
  other runtime gap still fails the row.

ENGINE_EXECUTOR_ABI is now vulkan-engine-v188. docs/VALIDATION.md's "Through the runtime" now
names textures and samplers, what keeps a case off the runtime, and the not_enabled mapping.

Tests: the routing test adds a Depth32Float texture, which is not routed. A new unit test
covers runtime_error's two mappings.

Verified: in the lane's report (compile gate and the focused rerun of the 17 rows).
2026-11-20 17:33:49 -08:00
Anees Iqbal 81ced9a1cb Extended-range fetch and blend refused: what needs Metal's tile half is NotImplemented(Format)
Metal's tile memory holds an attachment of Apple's extended-range formats (BGR10_XR, BGRA10_XR,
RGB10A8_2P_XR10 and their _sRGB twins) as half through a render pass and rounds it to the codes
only at the store. A fetch of such an attachment, or a blend onto it after an earlier draw of the
pass wrote it, sees that draw's half. The attachment holds the codes. With the half shadow gone
(the commit before), such a read or blend would take the stored codes, which is wrong but valid
output. Both are now a typed refusal, NotImplemented(Format) at Attachment::Color(n), on every
device and in either fetch form. This is the same boundary as the runtime's own refusal of every
extended-range texture: Gap::TextureFormat (crates/metal2vulkan-runtime/src/error.rs:1011),
raised in texture.rs's form() (texture.rs:2416, `if !viewed(mapping.emulation)`), so rt never
makes such an attachment.

Where (lower::fragment::fetch::codes_round_the_tile names the forms: an extended-range form that
is neither padded nor bfloat):
- A fetch: color::select_param, beside the bfloat fetch's refusal. It runs for the storage form
  and the input attachment alike. An integer read stays Metal's pipeline error
  (InvalidDescriptor(ColorAttachment)).
- A blend into one the function writes, under any write mask:
  - fetch::blended_extended_range, which both ordered devices' plans call (the interlocked storage
    form, and input_blend over rasterization-order input attachments);
  - stage_io::extended_color::plan, on a device that orders fetch in neither form. It is checked
    before the orderings' refusal, since no device would make the blend.
- The public door metal::format::extended_range_blend answers NotImplemented(Format) for those
  forms on every device.

Unchanged: an unblended write and a masked merge (a kept code is the encode of the half the tile
keeps there). Padded forms (R10Unorm_X6, RG10Unorm_X12, their _sRGB twins, RGB10A2Unorm_sRGB):
their fetches and blends are built as before. Bfloat: its fetch is refused as before, and its
blend is Metal's error.

Dead with it: the source-range clamp only those blends took. Every caller of
extended_range::blend::native now passes a padded form's None. Removed: blend::extended_ranges,
clamped_lanes and native's ranges parameter, extended_range::source_range, and blend_color.rs
(SOURCE_RANGE, SRGB_SOURCE_RANGE). The validation build script's runtime inputs list
blend_color.rs no more, and the runtime pin moves. In the CPU-model tests: the XR forms' blend
cases and EVERY_FORM; the padded blends keep their model.

Docs: fetch's module docs (the extended-range paragraph, plus one on Apple's forms in place of the
"across draws" one), color's and stage_io::extended_color's, input_blend's, ExtendedRangeColor's,
PrecisionNote::ExtendedRangeBlendSource and ExtendedRangeFloatBlendSource (now padded only), the
door's, and docs/API.md (section 4's framebuffer fetch, and the two notes' catalogue entries).
docs/REFUSALS.md regenerated, api_signatures blessed.

Conformance (crates/metal2vulkan-conformance/known-gaps-rt.tsv), by expectation: the next round's
conformance replay on every card confirms them. 260 rows change their answer from "unsupported:
FramebufferFetch; needs AnyOf([[Feature(FragmentShaderPixelInterlock)],
[Feature(RasterizationOrderColorAttachmentAccess)]])" to "unsupported: Format; needs
NotImplemented", at the same metadata and color attachment. Their explanation now names the
refusal:
- xr-blend-* (108);
- xr-gamut-* (108);
- xr-gradient-*-blended (24);
- xr-masked-*-over (20).
The unblended masked rows (xr-masked-bgr10xr-red, -blue-green and their sRGB twins) keep the
orderings' refusal. The runtime's floor orders fetch in neither form, so its stage_io refusal is
what these rows record. docs/CONFORMANCE-COVERAGE.md is regenerated.

Tests:
- fetch::tests: the door's case splits Apple's forms (NotImplemented) from the padded blended
  ones; on runtime-floor, R10Unorm_X6 keeps the orderings' refusal and BGRA10_XR is
  NotImplemented; the moltenvk-m3 FragmentStoresAndAtomics case takes R10Unorm_X6.
- engine_extended_range::blended_pipelines: a `refused` helper (Format, NotImplemented,
  Color(0)); the wide-gamut client pipelines are refused on every venue and runtime-floor; the
  unwritten and masked test expects the refusal for every written blended shape.
- engine_extended_range::targets: a blended attachment, and lavapipe's fetch, expect the refusal.
- engine_fragment: a_fetched_extended_range_attachment_is_refused (every Apple form on every
  committed profile, exf_fetch_three, and the whole pipeline on moltenvk-m3) replaces the made
  fetch; the fast source-alpha-over sRGB XR blend and the input-attachment XR blend go, as they
  covered refused forms only; the premultiplied blend test and the blend note's test move to
  padded forms (RG10Unorm_X12 and its sRGB twin). con_fetch_coverage, the second-source blend and
  tsw_fetch_discard keep their storage-form and coverage mechanics on RGB10A2Unorm_sRGB, the
  four-channel padded form, where the guests' pipelines had RGB10A8_2P_XR10; their docs say so.
- lower::arith::extended_range::tests: the padded forms' blend model alone.

SEMANTICS_VERSION 2225 (after guestgaps' 2224, on development 81bd82fdaa): the refused inputs'
cached artifacts must not be served. Every made pipeline lowers to the same words: native's clamp
ran for XR forms alone. The old render key test is re-pinned by the commit after this one, from
the check job's printed key. ARTIFACT (569, the shadows' deletion) and RUNTIME stay; the runtime
pin moves with the sources.

Consumer check (consumer-uses.sh, consumer development b955213d27, 64 refs): extended_ranges,
SOURCE_RANGE, SRGB_SOURCE_RANGE, blend_color, clamped_lanes and codes_round_the_tile have 0 hits.
source_range's hits are the consumer's own field (CopyIndirectCommandBuffer::source_range,
unrelated); ours was a private fn.

Verified, at the earlier base 453eec0373 with this change: check 60853 (4406 tests, 10 failed:
the render key, the tests above and the coverage doc, all changed here since; 60899 then showed a
closure type in the new engine_fragment test, fixed here). A states-only play of that tree over
the recordings (60871, 60872, 60873, 60893, 60900) refused 0 render and 0 compute states. The
check and the play at this tree are named in the next commit and the report.
2026-11-20 17:26:22 -08:00