Commit Graph
878 Commits
Author SHA1 Message Date
Anees Iqbal 895b3f845a PrecisionNote::NativeHalfQuantize: a zero may round to the other zero
What: the note's text (its doc comment and the docs/API.md catalogue)
says what may differ: where a half rounding's input is a zero or too
small for a normal half, the result may be either zero, so a negative
zero may come out positive; and what a program sees of it: a
reciprocal's or atan2's sign, the bits written to a half target or
buffer. The catalogue names the form not taken (copying the input's
sign bit into the result by integer operations, about 4 instructions
per half rounding on every device without shaderFloat16) and its cost.
No code changes; the planner ruled the note (11-21).

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Tests: tests/stage.rs: the directory past capacity on both bounds, oldest use out first, a hit
outliving older entries, a breach under the same bounds; cut, foreign-key, other-header and
unknown-breach entries a miss and removed; the wire's version and cut frames; the request's
joinable bounds; and on a device (m2v_gpu, m2v_cpu_icd), with the bound lowered for the test, the
refusal with no directory, lavapipe's NoPipelineCache, and elsewhere refused unfilled, filled by
serve_stage over two pipes, made from the entry alone with the shared cache's data unchanged,
then refused by a recorded breach.
2026-11-21 05:55:29 -08:00
Anees Iqbal 20ae73f152 Translator: the resident-table domains' encoder-operation lowering goes; object words stay
What: lower/access/encode.rs goes. It lowered a function's indirect-command encoder operations
under the resident-table domains, writing the binder's records and their written flags. What it
held that is still used moves to lower/access/object.rs:
- an argument buffer's command-buffer or pipeline-state member read as its word (ObjectWord);
- the plan that admits such a load only as an encoder operand.

Every encoder operation is now refused, `Unsupported{GpuEncodedIndirectCommands,
NotImplemented}`, except those the identity domains' icb.rs lowers: a render command's buffer
setters, its indexed triangle draw and a reset. icb.rs is selected first, as before. The other
deletions follow from that:
- indirect_commands.rs drops CommandEncoderOperation's per-operation policy table;
- lower/access/dynamic.rs drops the resident-set search and address helpers only encode.rs
  called (plan_search, plan_address, search_start, plain_base);
- the error doc of the depth-stencil argument names the setters' refusal;
- engine_indirect_commands.rs keeps two tests: every encoder operation refused under the
  resident-table domains on every committed profile and Profile F, and a depth-stencil member
  compiled unread and refused read. engine_handles.rs expects the refusal where a pipeline-state
  member is a command's operand;
- the command-writes interface test now takes icbcut's indexed kernel (icb_indexed_16) under the
  identity domains, plus the template that takes no command buffer;
- the authored census integration test expects the encoding case's refusal on both forms;
- docs/API.md's indirect-command section says which domain refuses what;
- docs/REFUSALS.md is regenerated.

Why: rule 4 (small) and rule 2 (one form). The runtime compiles under the identity domains, where
this lowering never ran. Under the resident-table domains, the validation executor's alone, it was
a second form of GPU-encoded commands that no consumer path takes.

No public item changes (indirect_commands is pub(crate); api_signatures.tsv is unchanged).
Versions: SEMANTICS_VERSION 2255 -> 2256 (a placeholder; the landing sets the number), because the
resident-table domains refuse what they lowered. Under the identity domains no output changes.

Verified (jobs at this commit's tree less the runtime README edit below it, 4606692494, or at the
next commit's, the runtime-sources pin, 4e9e857f8c):
- m3-max-63058 at the pin: fmt, clippy, clippy --cfg m2v_gpu, clippy --cfg m2v_cpu_icd, Rustdoc
  -D warnings and scripts/api-docs, all rc 0 (peak 7.5 GiB);
- m3-max-63040, the validation suite at this commit: 1359 of 1360 passed, the one failure the
  runtime guard, which the next commit pins;
- m3-max-63057, the metal2vulkan and metal2vulkan-runtime suites and doctests at the pin: 3349 of
  3360 passed. The failures are the render key, the AIR printout and the golden table (bless due
  at development's next pin) and the engine inventory's 8 parts: 2,142 cells moved, 0 rows new or
  gone, of which 1,342 are the storage forms' removal below this commit (ilock, m3-max-63032) and
  800 are this commit's, the resident-table encoder operations now refused: m3-max-63151, the
  parts with every difference printed, names them as 50 entries on all 16 profiles, each
  ok -> Unsupported{GpuEncodedIndirectCommands; NotImplemented}, in 31 fixtures, every entry a
  kernel that encodes indirect commands (26 engine/icb_* and 3 kernel_icb_* fixtures,
  resident_draws.ll's rd_encode and mesh_commands.ll's six enc_* kernels); the other 1,342 are
  ilock's, class for class. The inventory compiles under RESIDENT_TABLES
  (spirv::testing::committed_profiles), and its bless runs on macOS only (bless_engine_inventory
  refuses without every assembler, m3-max-63084);
- docs/REFUSALS.md regenerated by scripts/refusal-surface/refusal_surface.py;
- no states-only play: the runtime compiles under the identity domains, whose output this commit is
  expected not to change. That is read from the code: icb.rs, the identity lowering, is untouched
  and still selected first. It is not measured, because the golden table's every cell is re-keyed
  until development's bless. ilock and this commit report the same staleness: 29,792 cells,
  m3-max-63032 and 63057.
2026-11-21 04:39:28 -08:00
Anees Iqbal 7e8b93d953 Fetch: the interlocked storage forms go; one input-attachment form, ordered by ROA where the device has it
What. The pixel interlock's storage forms of framebuffer fetch, of the fragment imageblock and of
the shadow stencil are deleted, with their snapshot reads, the sample planes' split and merge
modules, the stencil shadow's copies and the binder, pipeline and runtime items that served them.
A color input now has one form on every device: its input attachment, ordered by
rasterization-order attachment access where the device has it, and elsewhere ordered between
draws alone, noted `PrecisionNote::UnorderedFetchWithinDraw`. The pixel interlock serves raster
order groups only; on a device without rasterization-order access a group on a color input or a
read output does not interlock. What had no other form is refused, typed:
- a fragment function's imageblock use, `Unsupported{Imageblocks, NotImplemented}`;
- a `[[stencil]]` output on a device without `VK_EXT_shader_stencil_export`, naming
  `StencilExport`;
- a merge, a rotated blend or a logic operation that reads the attachment, on a device without
  rasterization-order access, naming `FramebufferFetch` and
  `RasterizationOrderColorAttachmentAccess`.

Why. Rule 2 (one form per Vulkan capability) and rule 4 (small): the storage forms were a second
form of fetch, imageblocks and stencil output chosen by the interlock feature, outside the eight
allowed second forms. The runtime never took them under the identity domains.

Versions: ARTIFACT_FORMAT_VERSION 586 -> 587 (a placeholder; the landing sets the number).
SEMANTICS_VERSION moves in this stack's fourth commit and the runtime-sources pin in its fifth.
RUNTIME_VERSION is not bumped.

Removed public items (crates/metal2vulkan/tests/api_signatures.tsv): pipeline::StorageAttachmentUse,
ShadowStencilUse, FragmentImageblock, ImageblockMechanism, SnapshotForm, SnapshotRefusal,
StorageAttachmentView; bind::PlanesSplitModule, PlanesMergeModules, StencilSplitModule,
planes_split_module, planes_merge_modules, stencil_split_module, CopySource, FragmentTests;
RuntimeFact::{FragmentImageblock, InterlockedFramebufferFetch, MovableStorageWrites,
ShadowStencil, TestedStorageWrites}; PushField::{ShadowStencilState, SnapshotPhase,
StorageKeptChannels}; ResourceKind::SnapshotTexels, BindingSource::SnapshotTexels,
WriteSource::{ShadowStencil, SnapshotTexels}, PushHole::SnapshotPhase,
DrawReplayRule::{FragmentImageblock, ShaderStencil}, PlanesCopy::Alpha8,
ExtendedRangeBlend::OneColorChannel, PrivateRenderField::SampleMask,
PrecisionNote::UnmeasuredFetchBlend (translator and runtime), runtime
RenderPipelineKind::{Imageblock, ShaderStencil}. Changed: FramebufferFetchInputs::of(read, colors),
DepthStencilCopy::{StencilExport, StencilPlane}, WriteSource::TileAttachment.

Runtime README, known gaps: a new bullet names a fragment function with imageblock data (an input
or output declared [[imageblock_data]]) as refused on every device, and the stencil output bullet
says the runtime has refused it on a device without the extension all along. Both say why: the
forms deleted here bound a storage image through a descriptor, which the identity domains the
runtime compiles under hold none of. The raster order group bullet already names its refusal.
docs/REFUSALS.md is unchanged (scripts/refusal-surface/refusal_surface.py leaves it as it is).

Consumer check (~/.cache/m2v-orch/consumer-uses.sh, consumer development e76e2ffeb4 plus its 49
steelbrain/* tips younger than a day): 0 code hits on development for every removed name above
(Imageblock appears there only in rt_platform/diag.rs comments); UnmeasuredFetchBlend and
OneColorChannel hit only crates/reims-vgpu-vulkan on unlanded lane branches, none on development.

This commit does not build crates/metal2vulkan-validation alone: its executor still names the
removed pipeline items until the next commit, which removes its storage-form arms.

Verified: in the stack's second commit, which states every job; this commit alone does not
build the validation crate.
2026-11-21 04:39:18 -08:00
Anees Iqbal 7503407108 Binder: the identity domains' texture, sampler and runtime-owned push fields are refused typed
What: the translator's binder (bind/plan/compute.rs, bind/graphics.rs) now answers
Unsupported{IdentityDomains; NotImplemented} for every push field that only the identity domains
emit and that no binding state holds:
- a texture's or sampler's resource ID, PushField::SlotGuestBase of a Texture or Sampler slot;
- PushField::ConstexprSampler;
- on the render side also PushField::FetchedColor, TessellationFactorAddress, IndirectRange,
  IndirectSequence and IndirectBase, and PrivateArenaAddress beside ZeroAddress and BicubicTexels.
Before this, a compute plan of an identity pipeline that samples a texture failed with the internal
invariant "a compute push field SlotGuestBase(SlotRef { stage: Kernel, class: Texture, index: 0 })".

Why: one of (b)'s reds, api_preview_example::the_api_preview_example_runs. The example planned
an identity-domain pipeline through the binder, which plans only the resident-table domains.

Can rt's make reach it: no. metal2vulkan-runtime never calls the binder: it has no
pipeline.plan, BindState or BindShape call; it pushes these fields itself. The refusal is reached
only by a consumer of the translator's binder who plans an identity-domain pipeline. That is why
the form is in docs/API.md, the binder's guide, and not in the runtime's known gaps.

The example and the guide:
- examples/api_preview.rs opens a runtime_device, the default policy, and prints its profile.
- Its tour device, committed_device, takes DevicePolicy::RESIDENT_TABLES, because its binding plans
  are the binder's.
- docs/API.md says so after the Device paragraph and lists the refused fields.

The golden storage pair: golden_hashes_match_the_table's check_storage_pair reads the observed
cells, so a bless alone does not satisfy it. Its rule changes to what the identity domains answer.
On the 7 profiles whose bgra8 is not storage-capable (amd-rdna2-apu-radv, intel-arl-anv,
intel-irisxe-anv, intel-irisxe-rplp-anv, intel-uhd770-rpls-anv, nvidia-pascal-linux,
runtime-floor):
- The bgra8 cell is Unsupported{IdentityDomains; NotImplemented} on all 7. Its choice is
  StorageImageClass::SwizzleBgra, state of the bound texture beyond its resource ID. This is not
  the formatless storage row.
- The rgba8 cell is that refusal on 4: intel-irisxe-anv, intel-irisxe-rplp-anv,
  intel-uhd770-rpls-anv and runtime-floor. These lack shaderStorageImageReadWithoutFormat, so the
  read-write choice there declares the format, a storage image the identity arrays hold no
  element of.
- On amd-rdna2-apu-radv, intel-arl-anv and nvidia-pascal-linux, which read and write storage
  without a format, the rgba8 choice declares none and compiles.
Both refusals have the symbol "texture argument S: a type the identity arrays hold no element of,
or state of the bound texture beyond its resource ID", a form the runtime's known gaps list. Each
cell arises only because the golden table supplies a storage_images input that names the bound
format. The runtime never gives one: its slot stays the write that the floor's
shaderStorageImageWriteWithoutFormat takes. So a guest meets neither refusal.

Tests (engine_identity.rs), each failing without the change:
- the_binder_refuses_a_texture_and_sampler_slots_resource_ids_typed: sample_level on moltenvk-m3
  under the identity domains, planned with a buffer, a texture and a sampler bound, answers
  BindError::Unsupported (IdentityDomains, NotImplemented), not an internal error.
- a_storage_choice_the_identity_arrays_hold_no_element_of_is_refused_naming_the_texture_argument:
  on every committed profile, for bgra8 and rgba8, the storage_texture_write compile under the
  identity domains, given the format's storage choice, compiles where the choice is the format's
  own image declared without a format. Elsewhere it is refused naming the texture argument and
  "beyond its resource ID". It asserts at least one compiled, one swizzled and one declared case.

Runtime sources re-pin: the binder is a runtime input of the validation crate's guard, so
runtime-sources.sha256 moves from 47fe413580a9... to 38223c0cc84f17c0bc78a52f216dba49f5bf27655911b528c9cde82d6dcff0b6. The value is
the one the guard test computed at this tree's inputs (m3-max-62914), and development's commits
since then touch none of them. No run's behaviour changes and RUNTIME_VERSION stays:
- the new arms answer only fields that identity-domain compiles push;
- the validation executor plans through the binder only on its own context, under
  RESIDENT_TABLES (candidate/platform/compute.rs), whose compiles hold none of them.

Verified, at the same change on f61383d22b (development's commits since then touch none of
these files):
- cargo fmt --all;
- m3-max-62965, the metal2vulkan suite and doctests at 34ec190bc1: api_preview_example,
  engine_identity's binder test and every other test passed except the four bless-owned reds:
  the render key, the AIR printout, the public-fixture inventory part 4 and golden_hashes;
- m3-max-62991 at 2f29bccef0, which adds this commit's check rule and the generalized storage test:
  fmt and clippy rc 0, and 5 of 6 targeted tests passed (the storage-choice test, the binder test,
  api_preview, engine_profile_f, engine_air_2_1). golden_hashes_match_the_table passes
  check_storage_pair on all 7 columns and stops at the table's staleness, the bless due
  (29,712 cells under a changed profile fingerprint, 80 new);
- m3-max-62914 computed the runtime-sources value above.
2026-11-21 03:42:29 -08:00
Anees Iqbal 2bbf157668 DevicePolicy::default() is the identity domains; the resident-table domains become RESIDENT_TABLES
What: DevicePolicy::default() now returns the identity pointer and handle domains, the policy
metal2vulkan-runtime compiles under. DevicePolicy::UNTRUSTED is renamed RESIDENT_TABLES. It stays
for the validation executor's own context (candidate/platform/compute.rs and the engine tests
that build a resident root and a handle table themselves) and for the translator's tests of that
lowering, which name it where they took default() before. The runtime takes default() instead of
setting the two fields itself.

Every tool that took default() now compiles under the runtime's policy:
- the command line's --profile;
- the compile worker;
- the authored compile census, the corpus translation audit and corpus-pipeline;
- acceptance, the tier table and specialization attempts;
- the golden table, whose devices take default() (its policy field goes).

Why: the planner's ruling (b), one policy constructor, so a tool and the runtime agree on the
policy. The description can still differ: --profile takes the profile's description, while the
runtime takes the device's, restricted to the features it enables. repro.rs and README say so.

Docs:
- README's --profile paragraph and the command's help text.
- API.md section 1: the identity domains are listed first, as the default; the resident-table
  domains are the validation executor's.
- device/mod.rs, policy.rs and profile.rs.
- api_signatures.tsv renames the const.
- api_preview's buffer carries a device address equal to its gpuAddress, as the runtime makes it.

No SEMANTICS bump. For a given description and policy, the translator's output is unchanged. The
profile fingerprint covers the policy, so every cached artifact and golden cell whose output moves
does so under a changed key; the golden check reads those cells as re-keyed, a bless due. No bless
here.

Consumer search (consumer-uses.sh) at the consumer's development e76e2ffeb4 and 46 lane refs
younger than a day:
- UNTRUSTED, RESIDENT_TABLES, PointerDomain, HandleDomain and from_queries: 0 hits.
- DevicePolicy: 13 lane refs only, all in the deleted runtime's policy struct (fields this tree no
  longer has); none on development.

Expected census at this commit, not yet rerun: m3-max-62608's identity column, taken at
58bea6ca1c through a scratch policy switch.
- Translation audit, of 17,206 rows: 15,176 translated on runtime-floor, 15,266 on lavapipe,
  15,476 on amd-rdna3-radv and 15,459 on nvidia-rtx50-linux.
- Authored compile census: 6,266 of 7,128 cells.

Verified:
- cargo fmt --all;
- scripts/refusal-surface/refusal_surface.py leaves docs/REFUSALS.md as it was.
2026-11-21 02:36:53 -08:00
Anees Iqbal d9ba8d0e72 Translator: GPU-encoded indexed triangle draws into indirect command buffers under the identity domains
What: the first cut of Metal indirect command buffers, the translator's half.

- pipeline::IndirectDrawLayout (public): the record contract the runtime and the lowering share.
  A 24-byte header (capacity, vertex and fragment slot counts and stride as u32, then the reset
  index address as u64 at 16), then command i at 24 + i * stride, stride = 8 (Nv + Nf) + 40:
  the slot words (the buffer's address less 2^31, the word an execution pushes as the slot's
  SlotGuestBase), the index token's data, the sequence index and VkDrawIndexedIndirectCommand.
- lower/access/icb.rs: under the identity domains, a function's render_command
  set_vertex_buffer, set_fragment_buffer, draw_indexed_primitives of triangles and reset write
  the records through the gpuResourceID an argument buffer's command_buffer member holds, each
  only where the command's index is below the capacity (and a slot below its stage's count).
  Every other indirect-command operation stays Unsupported{GpuEncodedIndirectCommands,
  NotImplemented}; a vertex or fragment function without its stage's store feature and a device
  without device addresses refuse by name.
- LoweringInputs::indirect_range with PushField::IndirectRange, PushField::IndirectSequence and
  PushField::IndirectBase: a vertex function of a state made with supportIndirectCommandBuffers
  reads the execution's range and its command (the sequence index plus its part's first command)
  in its first block and draws nothing for a command outside the range, so an execution over a
  range a buffer holds runs at full capacity (one SEQUENCE_INDEX token), in parts. Such a state's
  vertex function pulls every attribute it reads.
- Fixture engine/icb_indexed_extras (MSL we wrote, regenerated by scripts/regen-air-fixtures):
  a reset kernel, a vertex function that reads before its buffer's address, and one of fourteen
  vertex buffers (a state of more tokens than lavapipe's 16). Inventory rows added by hand (the
  fourteen-buffer vertex function's thirteen constant buffers pass the runtime floor's twelve);
  the golden hash rows, the air_input printout and the old render descriptor key come with
  development's bless.
- SEMANTICS_VERSION 2252 and ARTIFACT_FORMAT_VERSION 586 are placeholders one above
  development's (2251 and 585); the lowering's emission and the encoded lowering inputs change.
- docs/API.md states the forms; docs/REFUSALS.md regenerated; api_surface and api_signatures
  carry IndirectDrawLayout.

Why: the cutover's guests encode indexed draws into indirect command buffers from kernels, which
the identity domains refused.

Verified: see the lane's report (compile gate and test jobs, the states-only play).
2026-11-21 01:50:00 -08:00
Anees Iqbal 52ee4de509 rt: a commit takes the Managed ranges named since the last, with commands or none
Before this change, a commit captured the Managed buffers' named ranges only if its command buffer
had commands. A command buffer with nothing for the GPU (no commands, or only dispatches the
runtime elides: a kernel that writes no memory, or a grid with no thread) took no submission. So
its copy-in waited for the next command buffer that did submit, and a program's "upload now"
commit uploaded nothing: the upload slid into its next, timed commit, and the wait on the
upload commit covered no copy.

Now every commit captures. In the submit thread, a command buffer with nothing for the GPU that a
copy-in waits for (Captured::waits_for: the oldest captured at or before its commit number, the
taker rule) leads a group as one with commands does. The copy-in becomes its submission, and it
completes after it. Elided dispatches stay elided. One with nothing named still takes no
submission.

Its other answers keep Metal's empty shape:
- It is scheduled as it joins, with its scheduled handlers run before the submission.
- It retires in flight order, with its completed handlers, Completed status and the wait.
- It writes no timestamp, so its GPU start and end are one time (command::retire's empty branch).
- The copy-in counts in runtime_command_buffers with its own timestamps.

This is within documented Metal: a named range may be taken at any commit after the naming. On an
AMD Radeon Pro 5300M, Metal takes it at the first commit whose encoder binds the buffer. The
runtime takes it at the same commit where that commit binds the buffer, an earlier one where it
binds nothing, and never a later one.

Docs: did_modify_range, the runtime README (the Managed section, the empty command buffer, GPU
times) and docs/API.md's accepted difference. The internal docs in capture.rs and submit.rs are
updated too.

Tests: the two device tests of the previous commit, and a host check of waits_for.
2026-11-21 01:49:57 -08:00
Anees Iqbal d00c32ecf6 translator: the identity domains push the draw's viewport count to a vertex function that selects its viewport
Under the identity domains a vertex function that writes [[viewport_array_index]] was refused
as IdentityDomains (an encoder value the function reads as ViewportCount): the field was not
among the encoder values those domains push. The runtime fills it per draw (the encoder's
viewport count, 99e5d42deb), so the field joins the admitted pushed values beside
RenderTargetArrayLength; nothing else of the form changes. Found by 99e5d42deb's suite
(m3-max-62168), whose viewports device test the translator refused.

SEMANTICS_VERSION 2250, one above development's 2249: 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: rt6_viewports' rt6_select pushes ViewportCount in its
window, depends on RuntimeFact::ViewportCount and stores ViewportIndex under
shaderOutputViewportIndex; both modules L3), and docs/API.md names the pushed count.
2026-11-21 00:34:20 -08:00
Anees Iqbal 73ce142afc Bind: a vertex function that chooses its slice writes Layer in every pass; the dropped-Layer variant goes
A vertex function that writes [[render_target_array_index]] had two forms:
- in a pass of at most one layer (BindShape::render_target_array_length 0, Metal's default, or 1),
  the plan asked for VariantKey::dropped_vertex_layer, a variant compiled without the Layer
  output;
- in a longer pass it ran the pipeline that stores Layer as `index < length ? index : 0`, the
  length each draw pushes (PushField::RenderTargetArrayLength).

The second form already answers the short pass exactly. At a length of 0 or 1 it stores 0 for
every index, the slice Metal renders, so a one-layer framebuffer is never written an out-of-range
Layer. The dropped variant's one gain was a pipeline that needs no shaderOutputLayer. The floor
requires that feature, and every committed profile has it. The runtime never asked for the
variant: it compiles every render pipeline under VariantKey::new() and pushes the pass's layers,
at least 1.

After this change the one form draws every pass, and its plan states no variant at any length.
The binder pushes the pass's length as at least 1, as the runtime does; at 0 and 1 alike the
function stores 0 for every index.
Drawn one amplification at a time in a pass of one layer, a vertex function still writes no
Layer (LoweringInputs::amplification_draws, not layered). RuntimeFact::RenderTargetArrayLength's
layer_dropped now states that case alone.

Size: 24 files, +360/-381.

Removed:
- VariantKey::dropped_vertex_layer, with its is_empty term and its per-stage lowering bit;
- LoweringInputs::dropped_vertex_layer and the function key's "dropped-vertex-layer" bytes. A
  function compiled without the input keeps its key;
- the binder's choice of the variant, and its term in the check that answers
  BindError::NeedsVariant;
- the cache's round trip of the variant, and the variant's cases in the function key test.

Rule 1: no precision note changes.

The evidence gate (validation's candidate/platform/device.rs, fails_row) fails a row on every
ERROR the validation layer reports and on every WARNING of the validation type. Without the
variant the layer warns on each such draw into the render executor's one-layer framebuffer:
  WARNING (validation) Undefined-Value-Layer-Written (0x1fc55805): "vkCmdDraw(): Shader stage
  VK_SHADER_STAGE_VERTEX_BIT writes to Layer (gl_Layer) but the framebuffer was created with
  VkFramebufferCreateInfo::layer of 1, this write will have an undefined value set to it."
It warns of the write whatever its value: VK_LAYER_KHRONOS_validation 1.4.363 reports it for a
minimal draw that writes Layer = 0 (job m3-max-61934). The spec leaves the framebuffer undefined
only where "the Layer value is less than 0 or greater than or equal to the number of layers in
the framebuffer" (Layered Rendering, vkspec 1.4.366). This pipeline pushes the length 1 there and
stores 0. As the planner ruled, the gate now withholds that message, under five conditions:
- Exact: a WARNING of the validation type with that id name, number and whole text
  (CLAMPED_LAYER), for a row whose pipeline states RenderTargetArrayLength without layer_dropped,
  drawn in a pass of at most one layer. The render executor sets this per row on the sink
  (MessageSink::clamped_layer), so it is keyed on structure, never on a case.
- Counted: the row's environment records withheld_validation_messages
  {"Undefined-Value-Layer-Written": n}, and corpus-vulkan prints it.
- Proved by our own tests: candidate::tests::engine_render's
  an_index_past_a_one_layer_pass_renders_the_pass_s_slice draws rt6_layered_vertex writing index
  3 in a pass of length 0 and reads Metal's answer: the slice holds the fragment's word
  1 << 8 | 3 (the conformance case layered-render-target-array-length, recorded on an Apple M3
  Max). rt's tests::layered::on_device::every_device_renders_metal_s_layers checks the same for
  the runtime at lengths 0 and 1.
- One definition: rt's own device tests run under the layer and fail on any message, but they do
  not get this one, because rt renders through dynamic rendering:
  every_device_renders_metal_s_layers, index 3 in passes of length 0 and 1, passes under the layer
  on RADV's RX 550 (m3-max-61553).
  CLAMPED_LAYER is the only list.
- It cannot outlive its cause: the same device test asserts that the row withheld exactly one
  such message. When the layer stops reporting it, the test fails, and the exception goes with
  it. The sink's unit test the_clamped_layer_warning_fails_no_row_of_a_clamped_store_alone checks
  the match: the message for another row, another number, an error, or another draw's text still
  fails the row.
The executor version stays: a row the gate passed before draws and records as it did. The layer
bug's minimal repro and the issue text are staged for the owner to file.

Validation: two authored cases write [[render_target_array_index]] from a vertex function. Both
are vertex-stage cases into one 1x1 target, so both ran the dropped variant:
- 013406ac01b7 (public, vertex_amplification_id_layer) now runs the form that stores Layer;
- 434e73e03189's index is not shown the same across a primitive, so the commit below already
  refuses it on every leg.
Qualified on lavapipe at this tree's content (m3-max-61968, at dvl-5 1fa4aed963, which differs only
by a test's needless borrow): 013406ac01b7 matches Metal with robustness on and off (candidate
output e9eec98c138165bb), and each record states the gate's exception ran:
withheld_validation_messages {"Undefined-Value-Layer-Written": 1}.
The candidate engine's graphics tests now expect an empty variant for every case. The case that
chooses its slice in a one-layer pass declares Layer, with layer_dropped false.

Tests:
- engine_render_target_slice: every_pass_runs_the_vertex_function_that_writes_its_layer replaces
  the variant tests. On the 780M and lavapipe, each of three pipelines, at the lengths 0, 1 and 4:
  - states no variant;
  - declares Layer and reads the length, which the draw pushes as 1, 1 and 4;
  - draws.
  An amplified draw in a one-layer pass still draws one amplification at a time.
  the_dropped_variant_needs_no_output_layer goes.
- engine_target_indices loses its compile of the variant on the device without
  shaderOutputLayer.
- validation: an_index_past_a_one_layer_pass_renders_the_pass_s_slice (lavapipe, under the
  layer) and the_clamped_layer_warning_fails_no_row_of_a_clamped_store_alone, above.

Bless due: nothing new. Every golden compiles without a variant.

SEMANTICS_VERSION 2248 -> 2249 and ARTIFACT_FORMAT_VERSION 584 -> 585 are placeholders that main
renumbers.
SEMANTICS: a slice-choosing vertex function in a pass of at most one layer now compiles to the
module that stores Layer. ARTIFACT: VariantKey and LoweringInputs each lose a field.
RUNTIME_VERSION stays, and runtime-sources.sha256 keeps development's (land-pkt re-pins it). api_signatures drops the two
fields. API.md's layered-rendering bullet states the stored 0 in place of the variant.

Consumer check (consumer_check.sh, consumer development b76d6ac4a9): dropped_vertex_layer,
layer_dropped and NeedsVariant have 0 hits.

Verified (jobs read):
- m3-max-61968: the lavapipe device suite at dvl-5 (dvl-6 without the clippy fix), 1483 of 1483,
  qualify 013406ac01b7 Match, the withheld count {Undefined-Value-Layer-Written: 1} under both
  robustness settings.
- At the stack's tip over this change (dvl-5 1fa4aed963 and dvl-6 92fe40c38f): 61978 and 61987,
  fmt, clippy in every configuration, Rustdoc, each feature alone, the API docs and the Windows
  clippy, green; 61891, the suites at dvl-4: 13 failures, each a bless-due golden above or
  development's own (the raster state test, the inventory's sample_fill rows); 61968, the lavapipe
  device suite of metal2vulkan-validation, 1483 of 1483, and public case qualification Match;
  62042, the metal2vulkan-validation suite at dvl-5, 1378 of 1378 passed.
- States-only play of this change's player (p-dv.zst) over 35 distinct streams on ms01 (61971),
  gem10 (61980), um790 (61991) and um870 (62110): 456,384 render and 91,972 compute states made,
  0 refused, every stream exit 0; 62073 (um790) and 62105 (ms01) repeat those nodes' streams with
  the same counts. The msi stream (windrag-780m-b2) is not played: msi had no memory free.

Rebased onto the rebased geomdel over development 4cf936ed4d. The conflicts: the version lines;
runtime-sources.sha256, where development's is kept; and the validation context's device.rs, where
development's robustness record lost its leg and this change adds expect_clamped_layer and
take_withheld beside it. api_signatures.tsv checks against the sources (signatures.py --check) and
docs/REFUSALS.md regenerates unchanged. The jobs above ran at the old base; the rebased tip's are
in the report to main.
2026-11-21 00:04:06 -08:00
Anees Iqbal 57855c6097 Link: the synthesized geometry stage goes, both forms (the barycentric weights and the rate map's fan-out)
The translator built geometry stages in two forms that no Metal function asks for:
- the barycentric weights: a fragment function's [[barycentric_coord]] read as varyings, which a
  generated geometry stage of each topology class wrote, on a device without
  fragmentShaderBarycentric;
- the rate map's fan-out: a draw of a rasterization-rate-mapped pass's triangles once, a geometry
  stage emitting a copy of each per region, with its probe and its region-copy vertex variant.

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

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

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

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

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

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

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

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

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

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

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

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

Rebased onto development 4cf936ed4d (selidx landed as 3ecf606aa8). The conflicts: the version
lines; the mechanism test, where development added RuntimeFact::PrivateArena; runtime-sources.sha256,
where development's is kept; and api_signatures.tsv and docs/REFUSALS.md, both regenerated
(signatures.py --bless, refusal_surface.py) and differing from development by this change's items
alone. The jobs above ran at the old base; the rebased tip's are in the report to main.
2026-11-21 00:03:34 -08:00
Anees Iqbal 4f6dc912f3 Identity domains: a plain ulong texture slot is the RG32 element its resource ID names
A `ulong` texture slot that no `ulong` atomic updates is an `RG32` unsigned image whose two words
the shader joins and splits (`TexelClass::Uint64`), declared `Rg32ui` where it is a storage image
(`ulong_format`, under the floor's `shaderStorageImageExtendedFormats`). Under the identity domains
identity_class refused every `ulong` declaration, so such a kernel was
`Unsupported{IdentityDomains}` ("a type the identity arrays hold no element of"). It now admits it:
its class is the unsigned integer class of its shape, as its declared image is, and a storage
declaration of `Rg32ui` is the class `StorageFormatClass::Format(R32G32_UINT)`, whose variable is
the storage-image array's (set 1, binding 1, which every storage class aliases), as Metal binds
only an `RG32Uint` texture there. A slot a `ulong` atomic updates (an `R64ui` image) and an
argument buffer's `ulong` texture stay refused. The default domains are unchanged.

Docs: RESOURCE-ID.md's arrays name the `RG32Uint` storage class of a `ulong` texture; API.md's
identity forms name a `ulong` slot's reads and writes.

Test: engine_identity's ulong_texture_slots_are_rg32_elements_their_resource_ids_name: the owned
fixture unk_ulong_access (a sample-access and a read-access `texture2d<ulong>`, a write-access
`texture3d<ulong>`) under the identity domains on lavapipe, moltenvk-m3 and moltenvk-m3 without
robustImageAccess2: each passes L3, its classes are the sampled array's unsigned 2D class and the
storage array's 3D `R32G32_UINT` class, and on the CPU interpreter each of 20 threads reads its
elements' two words joined as `(v, 0, 0, 1)`, `(0, 0, 0, 1)` outside the textures, and writes the
sum's two words inside the texture alone.

SEMANTICS_VERSION 2246 -> 2247: a refusal becomes a module.

Evidence:
- The 9 public conformance cases on the plain ulong slot (unk_ulong_rw x7, unk_ulong_access
  x2): before, at f3418eacb9 on lavapipe (m3-max-61725), the 2 access rows not_supported;
  after, at 2796fb6e14 (an earlier form of this commit), 9/9 match, the 2 access rows on
  runtime-compute (m3-max-61703).
- States-only play of all 36 streams at 3bb97361a8 (an earlier form of this commit plus probe
  commits that never land): every render and compute pipeline state made, 0 refused. msi
  m3-max-61733 (1 stream), um870 61734 (1), um790 61760 (5), ms01 61775 (7), gem10 61795 (22).
2026-11-20 22:10:44 -08:00
Anees Iqbal 3ecf606aa8 Stage io: an index not shown the same across a primitive is refused; the selected index store goes
Metal's shading language leaves a primitive whose vertices write different indices undefined:
"You must return the same value of [[render_target_array_index]] for every vertex in a primitive.
If values differ, the behavior and value passed to the fragment function are undefined." The same
sentence covers [[viewport_array_index]]. The selected index store answered that case with the
first vertex's index, through the synthesized geometry stages, and MoltenVK's profile could take
DriverDeviation::MetalFirstVertexIndices to store it as written. Both reproduced undefined Metal.
The runtime never reached either: it enables no geometryShader, and no profile takes the
deviation.

After this change every profile has one form. An index that the function's structure shows to be
the same at every vertex of a primitive is stored to Layer or ViewportIndex where
shaderOutputLayer or shaderOutputViewportIndex is enabled. Without that feature it is refused as
Unsupported(LayeredRendering), or as Unsupported(VertexAmplification) for an index the
amplification's offset alone sets. The refusal needs the output feature only; geometryShader is
no longer offered. An index not shown the same is refused as NotImplemented(LayeredRendering) on
every device. index_store's comment cites the two spec sentences as the reason for that refusal.
It cites Vulkan's same-value rule (VUID-VkPipelineShaderStageCreateInfo-stage-02596 for Layer,
-02597 for ViewportIndex) as the reason the index is not stored as written. A device without
multiViewport still stores no viewport index.

Removed:
- IndexStore::Selected, indices_selected, selected_index;
- StageIoPlan::indices_selected and first_vertex_indices_by_device, and the compile layer's
  requirement;
- IoRole::SelectedLayer and SelectedViewport, with their codec tags;
- VaryingKey::selected_layer and selected_viewport, with their key tags;
- GeometryStages::layer and viewport, the stages' Layer and ViewportIndex stores, and the
  Reason's index half;
- RuntimeFact::SynthesizedGeometry's layer and viewport fields;
- DriverDeviation::MetalFirstVertexIndices, its last variant, and with it the DriverDeviation type
  and DeviceProfile::takes_driver_deviation;
- VkProperty::MetalFirstVertexIndices and its codec tag.

The geometry stages keep the barycentric weights and the fan-out. A fan-out stage past the
geometry limits is now refused as RasterizationRateMap needing the limit. Before, it was refused
as LayeredRendering with an empty alternative, because the stage's reason held neither weights
nor an index.

Rule 1: no note stops being raised. The first-vertex form raised none. The input it served is now
a typed refusal, so no difference goes silent. The catalogue is unchanged.

The command line: no code there names a removed item. Translating a vertex function whose index
is not shown the same now prints FALLBACK (NotImplemented LayeredRendering) on a geometryShader
profile, where before it compiled with the stages. Validation: four authored cases compiled on
every profile-leg but moltenvk-m3 through the stages: 07f125464dac, 434e73e03189, 7ce6dea0475e
and a013a2bcbe56. On moltenvk-m3 they were refused needing geometryShader. They are now refused
on every leg; the authored compile census takes them at the next named pin, not in this change.
The coverage census test that read three geometry stages from engine/rt6_first_vertex now reads
them from engine/bary_weights on the 780M profile without fragmentShaderBarycentric.

Fixture: engine/vertex_amplification's amp_vertex and amp_vertex_layer now take their viewport
and slice from the instance (iid & 1) instead of the vertex (vid & 1). The amplification and
render-target-slice tests then still compile them, and engine/rt6_first_vertex carries the
per-vertex case. The fixture was regenerated by scripts/regen-air-fixtures (Apple metal
32023.922, llvm-dis 21.1.8).

Tests:
- engine_selected_indices becomes engine_target_indices, covering:
  - a uniform slice or viewport takes the output or nothing else;
  - no multiViewport stores nothing;
  - per-vertex indices are refused on every device;
  - the floor's zero reads;
  - the weights' stage beside a vertex Layer is not implemented.
- link/tests/geometry.rs loses its two selected-index tests.
- engine_amplification, engine_render_target_slice and engine_stage_io now expect the builtin and
  the output-only refusal.
- runtime-floor now requires shaderOutputLayer, so the tests that need a device without it
  withhold the feature from the floor's description (engine_target_indices, engine_amplification,
  engine_stage_io).

Bless due until the next named pin, where the M3 bless job takes them; nothing is blessed here:
- tests::air_input::engine_fixtures_match_their_golden_printout: vertex_amplification's printout;
- tests::public_fixtures_engine (the inventory):
  - rt6_first_vertex and rt6_first_vertex_point become NotImplemented(LayeredRendering) on every
    profile;
  - amp_vertex and amp_vertex_layer become ok on moltenvk-m3;
  - each LayeredRendering cell that offered GeometryShader loses that alternative;
- tests::golden_hashes, and pipeline::compile::tests::the_old_render_descriptor_key_keeps_its_value
  (the render key): the profiles' fingerprints change with VkProperty's codec;
- the authored compile census.

SEMANTICS_VERSION 2245 -> 2246 and ARTIFACT_FORMAT_VERSION 582 -> 583.
SEMANTICS: an index store changes form. ARTIFACT: the codec loses two IoRole tags, a VkProperty tag
and two RuntimeFact fields. RUNTIME_VERSION stays; runtime-sources.sha256 takes the new hash, and
api_signatures is blessed. docs/REFUSALS.md is regenerated. The runtime README's known gap for a
differing index names the refusal as not implemented and drops the geometry stage form. API.md's
layered-rendering bullet, its RenderPipeline stage list and its profile accessors, and
ARCHITECTURE.md's link line drop the selected index.

Consumer check (consumer_check.sh, consumer development b76d6ac4a9):
- MetalFirstVertexIndices, SelectedLayer, SelectedViewport, selected_layer, selected_viewport,
  SynthesizedGeometry, driver_deviations and DriverDeviation: 0 hits.
- GeometryStages and takes_driver_deviation: in crates/reims-vgpu-c/link-order.txt only.
- DriverDeviation and takes_driver_deviation are named in crates/reims-vgpu-vulkan/src/gpu/rgbx.rs
  and encode_render/tests/metal_tests.rs on some of the consumer's steelbrain/* branches, for
  MetalSampler, MetalHalfConversion and MetalVertexSimdgroups, which the stack below already
  removed. development has neither file.

Verified (jobs read):
- m3-max-61766: lint in every configuration and the suites at this change on the earlier stack
  (eeef281428); its reds were the bless-due goldens above.
- At the stack's tip over this change (dvl-5 1fa4aed963 and dvl-6 92fe40c38f): 61978 and 61987,
  fmt, clippy in every configuration, Rustdoc, each feature alone, the API docs and the Windows
  clippy, green; 61891, the suites at dvl-4: 13 failures, each a bless-due golden above or
  development's own (the raster state test, the inventory's sample_fill rows); 61968, the lavapipe
  device suite of metal2vulkan-validation, 1483 of 1483.
- m3-max-62042: the metal2vulkan-validation suite at dvl-5, 1378 of 1378 passed.
- States-only play of this change's player (p-si.zst) over the 36 streams on um870 (61909),
  gem10 (61912), ms01 (61958), um790 (61990) and msi (62045): 502,920 render and 108,189 compute
  states made, 0 refused, every stream exit 0.
2026-11-20 23:23:51 -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 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 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 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 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 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 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 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 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 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
Anees Iqbal 7bbc00287d DeviceFragmentRuns names what follows the run count; section 10's intro admits notes
The note's doc and docs/API.md's entries (section 9's note, section 10's Draws
entry) said only that a memory-writing fragment's writes repeat as the device's
runs. Whatever the function derives from its own writes across runs follows the
same count, its stored colours and its [[sample_mask]] output included: the
conformance fixture coverage_outputs' cvo_masked writes the mask 1 << run, so at
pixel rate on a device that runs once only sample 0 keeps its colour. Section
10's intro said its entries carry no degrade notice; the SIMD-group order entry
and this one each name their static note, so the intro now says most carry none
and an entry whose answer is the device's own names its note.

Docs only: no emitted word or key changes.
2026-11-20 17:05:08 -08:00
Anees Iqbal 3ba18a4b19 A memory-writing fragment runs as the device runs it, noted DeviceFragmentRuns
What: a fragment function that writes memory no longer counts as per-sample under
multisampling. The coverage loop's memory-writes trigger goes: the loop stays for
`[[sample_id]]` and sample-qualified varyings beside `[[sample_mask]]`, and its refusals
(early fragment tests, attachments, the interpolation functions, discard, quad operations)
no longer reach a memory writer that reads neither. Such a function takes the plain form and
runs as many times per pixel as the device runs it. `GraphicsState::sample_shading`, the
`sampleRateShading` requirement in `multisample_features`, and validation's candidate read of
the field (graphics_pipeline.rs) go with it. consumer-uses.sh: `sample_shading` 0 hits (code)
over the consumer's development a48b3984af and 68 refs.

The new static note `PrecisionNote::DeviceFragmentRuns` goes on the fragment stage of a
pipeline of more than one sample whose function writes memory, recorded by the compile layer
beside `MultisamplePosition`. Its conformance code is
`metal2vulkan-degrade-device-fragment-runs`, and validation's table makes it `Unbounded`.
docs/API.md section 9 lists it, and section 10 adds the accepted difference: "Metal's GPUs
were measured to run a memory-writing fragment once per covered sample; documented Metal names
no count; here the count is the device's."

Why: documented Metal names no run count for a memory-writing fragment. MSL 5.5 makes a
function run per sample only for a sample-qualified input, `[[sample_id]]` or `[[color(m)]]`.
Vulkan without sample shading runs at least one invocation per fragment, and "Multiple
fragment shader invocations may be executed for the same fragment for any number of
implementation-dependent reasons" (vkspec 35.5). One form now covers both classes of guest:
the replay count of 36 streams found no multisampled memory-writing fragment. History: the old
runtime, deleted in 5d725aeec7, applied `sample_shading` (sampleShadingEnable with
minSampleShading 1.0). So at the cutover, memory writers without a coverage read went from once
per covered sample to once per pixel. This commit makes that the stated form, and the coverage
readers now match it.

Conformance: `alpha_coverage_pairs` pinned Metal's measured count, four runs. Its four-sample
report rows now declare `device-fragment-runs` and no longer `looped-sample-outputs`, because
the loop does not fire. They compare the report's runs word (`case/drawn/coverage/0`) as
`Nonzero`, justified by the notice. The coverage word and the texels stay exact.
docs/CONFORMANCE-COVERAGE.md is regenerated.

Tests:
- The lost_writes per-sample test now asserts what Vulkan promises. Every pixel `lw_half`
  covers ran at least once and no other pixel ran. Each pixel's ORed mask is its coverage at
  the standard 4-sample locations exactly. The state notes DeviceFragmentRuns. The test prints
  the (covered samples, runs) histogram.
- The translator's link, engine_multisample, engine_coverage_loop, engine_stencil, compile and
  spirv-cross form tests assert the plain form and the note where they asserted sample
  shading or the memory writer's loop. The looped-body form test reads cov_loop_record.

SEMANTICS_VERSION 2223 -> 2224 (emitted modules and stored notes change).
ARTIFACT_FORMAT_VERSION 566 -> 567 (a GraphicsState field removed, a PrecisionNote variant
added). api_signatures.tsv is blessed.

Verified: not yet. Jobs follow on this sha.
2026-11-20 17:02:15 -08:00
Anees Iqbal b90e0565da The floor: from_queries refuses a push window below 256 bytes, the runtime's floor requires 8 fragment outputs, and runtime-floor replaces the profiles below it
What: Device::from_queries refuses a description whose maxPushConstantsSize is below the 256
bytes every stage's push window is lowered for, with a typed Unsupported{PushWindow} naming the
MaxPushConstantsSize limit (crates/metal2vulkan/src/device/derive.rs, the floor checks of
from_queries). The runtime's floor (metal2vulkan-runtime's floor list) requires
maxFragmentOutputAttachments >= 8. All 15 committed device profiles report 8, and so does every
matrix card.

The committed profile set keeps only devices at or above the floor:
- roadmap-2022 and lunarg-desktop-baseline-2023 are deleted;
- vk12-floor and swiftshader move to profiles/below-floor/, inputs of the from_queries refusal
  test only;
- runtime-floor, derived from the runtime's floor by scripts/regen-device-profiles and held
  equal to it by a test, is the floor every test compiles on.

A test of a below-floor form now runs on runtime-floor without the feature that form stands in
for, labelled "below the runtime's floor" (pipeline::testing::profile_without, PROFILE_F,
device_f, FORMATLESS_FLOOR). The validation tests name runtime-floor, or derive the device they
need from it (no tessellation, no formatless writes, robustImageAccess alone, no device
addresses).

Why: the runtime refuses every device below its floor, so translating for those profiles tested
forms no device the runtime opens can ask for. A push window below 256 bytes cannot hold what
the lowering puts there.

Consumer check: no public item of a published crate is deleted. The one removed constant,
FORMATLESS_FLOOR's old value, is in the crate-private pipeline::testing.

Not in this change, re-blessed on development: the golden hashes table
(tests::golden_hashes) and the public fixture expectations (tests::public_fixtures_engine). The
runtime-sources pin (candidate::engine::artifact) follows from the test run at this tree.

Verified: cargo fmt. The suites, clippy and the CPU-ICD run are potluck jobs on this tree, named
when the branch is handed over.
2026-11-20 16:35:52 -08:00
Anees Iqbal f7279104ae Emulated meshes go: a device without VK_EXT_mesh_shader refuses mesh and object functions
The planner's ruling: a mesh render pipeline is native or refused. With VK_EXT_mesh_shader and
meshShader (taskShader for an object function), the stages are task and mesh shaders, as before.
The emulation was a second form for devices without them: the object and mesh functions ran as
compute entries, which wrote each threadgroup's vertices and primitives as records into a
per-draw buffer or the command buffer's records pool, and a synthesized vertex stage drew those
records. The runtime never takes that path. Now a mesh or object function on such a device is
refused at lowering (Unsupported{MeshShading}, needing VK_EXT_mesh_shader and the stage's feature
where the profile lacks them), and so is its pipeline. The command line compiles no mesh pipeline
and answers FALLBACK for a mesh or object function on every device, as before.

Removed:
- lowering: lower/mesh/work.rs (the work buffer layout), lower::mesh::emulates, the emulated
  compute entries and their wrappers, the record stores, Layout/layout/records/emulated_payload,
  the RECORDS/WORK/OBJECT_* slots; MeshPlan's emulated and payload_words. Also dispatch.rs's
  WrapperGroups and the wrapper_groups field, emit's GLCompute arm for meshes,
  stage_io::flat_primitive_inputs, and the requirement trace's record writes. The payload is
  always TaskPayloadWorkgroupEXT (memory::arena::declare_payload). lower::mesh::mesh_stages states
  the native test that folds_object_grids reads. The mesh builtins are a const.
- pipeline: MeshRecords, RecordField, RecordValue; GraphicsState::mesh_records and mesh_corners;
  StageInterface's mesh_records, mesh_corners and emulated_payload (vk_stage loses its COMPUTE
  arm); the synthesized vertex stage (link::mesh keeps the payload check) and link's record
  slots and push-range hull; SyntheticBinding::MeshRecords and MeshWork;
  RuntimeFact::MeshLastFirst; VariantKey::mesh_last_first. Varyings hold mesh outputs to
  maxMeshOutputComponents only. The link contract's compute-entry records check goes, and
  compile/api's mesh_info reads the task and mesh limits only.
- binder: bind/mesh_scan (mesh_scan_module, mesh_object_arguments_module, MeshScanModule; its
  div_ceil and for_range move to mesh_arguments, their one other reader), MeshDispatch,
  MeshGroups, MeshRecordsRegion, DrawCommands::mesh_dispatch, MeshTemplate::records and
  RecordsTemplate, GroupStage::Compute (GroupLimits.total is a plain u32), the emulated mesh
  stage flags, BindState and BindShape's mesh_last_first, WriteSource::MeshRecords and MeshWork,
  and DrawReplayRule::DispatchesFirst. Status: StatusBits::MESH_RECORDS_OVERFLOW,
  StatusReport::mesh_records_overflow, MeshRecordsFault, and the words MeshRecordsCursor and
  MeshFault{Draw,Objects,Groups}. The buffer keeps its 32 bytes, with SeqCstFences at word 7:
  words 3 to 6 are not written, and bit 5 is unreported.
- runtime: the synthesized-stage test no longer reads mesh_records; the SynthesizedStages doc
  loses "mesh records".
- tests: engine_mesh's emulated tests (the compute entries, the records pipeline and its object
  draws, the last-first variant) are replaced by two refusal tests, one per function and one per
  pipeline. The tests that also ran the emulating profiles run the profiles with the extension.
  engine_mesh_barriers loses its interpreter run of the emulated object entries; the
  round-trip, link and module-sweep fixtures and api_surface lose the rows.
- validation: build.rs's runtime inputs lose lower/mesh/work.rs; a companion test's comment.
  The 15 authored mesh and object cases stay untouched. The authored compile census is
  re-blessed on development.

Docs: API.md's mesh section states the refusal and loses the emulation's paragraphs, and two
lists lose "an emulated object or mesh function". Varyings docs lose a stale emulated
post-tessellation mention. docs/REFUSALS.md and api_signatures are regenerated. README and the
command's help name no mesh pipeline and need no change.

SEMANTICS_VERSION 2221 is in this commit (placeholder; main renumbers): what the translator emits
for a mesh or object function on a device without the extension changes (a refusal), and the
mesh draws' plans change. ARTIFACT_FORMAT_VERSION 565: the codec loses MeshRecords,
RecordField, RecordValue, StageInterface's three fields, GraphicsState's two, two
SyntheticBinding variants and RuntimeFact::MeshLastFirst. RUNTIME_VERSION stays at this series'
2543. The runtime pin is updated.

Consumer check (consumer-uses.sh, consumer development 12b87d3d6b, 70 refs):
MeshDispatch: 0 hits (code); link-order lists only.
MeshGroups, MeshRecordsRegion, mesh_scan_module, mesh_object_arguments_module, MeshScanModule,
MeshRecordsFault, mesh_dispatch, MESH_RECORDS_OVERFLOW, MeshRecordsCursor, MeshFaultDraw,
MeshFaultObjects, MeshFaultGroups, DispatchesFirst, mesh_last_first, MeshRecords, RecordValue,
mesh_records, mesh_corners, emulated_payload, MeshWork, MeshLastFirst, POOL_WORDS, DRAW_OFFSET,
DISPATCH_OFFSET: 0 hits (code).
mesh_records_overflow: 0 hits on development. It is used on consumer lane branches
(steelbrain/quiesce and others), but only as the name of a local function in
reims-vgpu-vulkan/src/gpu/command.rs, which answers the old runtime's
CommandBufferError::MeshRecordsOverflow. It does not read this field.

Verified: nothing yet (a check job is owed).
2026-11-20 15:28:31 -08:00
Anees Iqbal b14c6a7101 Emulated tessellation goes: a device without tessellationShader refuses the function
The runtime's floor requires tessellationShader, so on every device the runtime opens a
post-tessellation vertex function runs through the device's tessellation stages. The emulation
was a second form: it ran the function as a plain vertex stage that drew Metal's tessellator's
triangles itself, from the draw's records, which a compute scan wrote before each patch draw. Now a
device without tessellationShader refuses the function (Unsupported{Tessellation}, needing
VkFeature::TessellationShader), and the command line answers FALLBACK there.

Removed:
- lowering: lower/tessellation/{emulated,tessellator,work}.rs, wrap_entry, Emulation, emulates;
  EvalPlan's base_instance and emulated; Declared's emulated globals; the emulated
  [[base_instance]] source; PushField::TessellationChunk; stage_io::primitive_id_varying.
- pipeline: EmulatedTessellation, GraphicsState::emulated_tessellation, TessellationStage::emulated,
  LoweringInputs::tessellation (and InputsFrom::Vertex's tessellation field and its key bytes),
  link's emulated_state, RuntimeInput::TessellationDescriptor, SyntheticBinding::TessellationWork
  and TessellationRecords; primitive_id_carried_on is primitive_id_varying_on again.
- binder: bind/tessellation_scan (tessellation_scan_module, TessellationScanKernel,
  TessellationScanModule), TessellationDispatch, TessellationRecords,
  DrawCommands::tessellation_dispatch, WriteSource::TessellationWork and TessellationRecords,
  StatusBits::TESSELLATION_RECORDS_OVERFLOW and RECORDS_FAULTS, StatusReport's
  tessellation_records_overflow and TessellationRecordsFault. FactorTemplate keeps only the
  control stage: FactorSite goes, and its fields are push_offset and factor_binding, with the
  patch index binding always present. The mesh scan's first-fault test reads its own bit. Bit 8
  of the status word is unreported.
- tests: tests/tessellator (the emulated tessellator against its model), the emulated tests in
  engine_tessellation (now asserting the refusal on profiles without the feature), the emulated
  fixtures in api_tests and graphics tests, owned_divisions' scan sweep, and api_surface rows.
  The key test keeps its native half: a vertex function's key is the same for every
  tessellation state.
- validation: build.rs's runtime inputs lose tessellator.rs and work.rs (factors.rs stays: the
  binder sizes factor ranges by factor_bytes). The acceptance and coverage tests expect the typed
  refusal on roadmap-2022, vk12-floor and swiftshader.

Docs: README and the command's help say a post-tessellation function needs tessellationShader;
API.md's tessellation section states the refusal; the two tessellation precision notes no longer
mention the emulation; docs/REFUSALS.md and api_signatures regenerated (Tessellation now names
VkFeature::TessellationShader instead of MaxStorageBufferRange).

SEMANTICS_VERSION 2220 is in this commit (placeholder; main renumbers): what the translator emits
for a post-tessellation function on a device without tessellationShader changes (a refusal), and
the vertex key loses the tessellation state. ARTIFACT_FORMAT_VERSION 564: the codec loses
EmulatedTessellation, TessellationStage::emulated and three enum variants. RUNTIME_VERSION stays
at this series' 2543. The runtime pin is updated.

Consumer check (consumer-uses.sh):
consumer: development 7ea4edc2fb; 72 refs (development + steelbrain/* younger than a day)
TessellationDispatch: 0 hits (code); link-order lists only
TessellationRecords, TessellationRecordsFault, tessellation_scan_module, TessellationScanKernel,
TessellationScanModule, TESSELLATION_RECORDS_OVERFLOW, RECORDS_FAULTS, tessellation_dispatch,
TessellationWork, EmulatedTessellation, emulated_tessellation, TessellationChunk,
RuntimeInput::TessellationDescriptor, scan_kernel, max_patch_triangles, wrap_entry, FactorSite:
0 hits (code)
tessellation_records_overflow: 0 hits on development. It is USED on consumer lane branches
(steelbrain/quiesce and others), but only as the name of a local function in
reims-vgpu-vulkan/src/gpu/command.rs, which answers the old runtime's
CommandBufferError::TessellationRecordsOverflow. It does not read this field, and this tree's
runtime has no such error.

Verified: nothing yet (a compile job is owed).
2026-11-20 15:26:56 -08:00
Anees Iqbal 46cd581525 Builders, batch 1: thirteen bind files no code names go with their tests
dynamic_views, extended_canonical, extended_shadow, icb_reset, pages_copy, plane_bytes_copy,
plane_copy, plane_words, rotate_texels, rows_copy, tiled_texels, ycbcr_refresh and ycbcr_sample:
no non-test code outside each file names any of its public items (the runtime, the harness,
validation and conformance included), so each file goes whole, with its tests, its re-exports,
its api_surface rows and its owned_divisions builds. The docs that named them say what is true
now: bind's module map, the depth clamp's tiled-texel note, the written-flag docs (a consumer may
reset only the flagged records), the input shadow's runtime file, conformance's two-plane note.
The runtime-sources row of lower/arith/extended_range.rs names the color resolve, which still
reaches it, in place of the deleted half-shadow load.

No behaviour of a run or a translation changes (nothing called them), so neither
RUNTIME_VERSION nor SEMANTICS_VERSION moves; api_signatures, REFUSALS.md and the runtime pin are
regenerated.

Consumer check: ~/.cache/m2v-orch/consumer-uses.sh, consumer: development 62b3227c74; 67 refs
(development + steelbrain/* younger than a day), 0 hits for DynamicViewsModule
dynamic_views_module ExtendedShadowModule extended_shadow_module IcbResetModule icb_reset_module
PagesCopyModule PagesCopy pages_copy_module PlaneWordsModule plane_words_module
RotateTexelsModule rotate_texels_module RowsCopyModule rows_copy_module TiledTexelsModule
TiledLevelMove tiled_texels_module YCbCrRefreshModule ycbcr_refresh_module YCbCrSampleModule
ycbcr_sample_module; consumer: development 62b3227c74; 68 refs, 0 hits for
ExtendedCanonicalModule extended_canonical_module extended_range_canonical PlaneBytesCopyModule
plane_bytes_copy_module PlaneBytes PlaneSource PlaneCopyModule plane_copy_module. PlaneRows:
its hits are the consumer's own `struct PlaneRows` (reims-vgpu-video's vaapi/va/frame.rs:333,
re-exported from vaapi.rs), none of them ours.
2026-11-20 15:15:25 -08:00
Anees Iqbal 13dc7d47fc DriverWorkaround goes: its two every-device variants are the static notes they named
Every profile took both variants (Device::from_queries listed ClippedCoverageNotMetals and
TessellatorNotMetals for every device, since no query tells Apple's rasterizer or tessellator
apart), so the enum, ProfileFields::workarounds and DeviceProfile::workarounds() carried no
choice. The two notes are recorded unconditionally where the workarounds gated them:
PrecisionNote::ClippedCoverageSplit for a multisampled read of the coverage or a centroid
varying at the pixel (lower::fragment::coverage), and PrecisionNote::TessellationTriangleOrder
on every tessellation evaluation stage (link::tessellation::note_evaluation_stage, which no
longer takes the profile). The notes' docs, derive.rs's and API.md's say every device records
them because no query tells Apple's apart. The tests that asserted the list go; validation's
identity test compares the two drivers' profile fingerprints instead.

api_signatures.tsv is regenerated (four rows go); REFUSALS.md unchanged; the api_surface row
goes; the runtime sources' pin follows. Emitted code is unchanged; the profile's fingerprint
moves with its fields.

Consumer check: ~/.cache/m2v-orch/consumer-uses.sh at reims development 62b3227c74, 66 refs
(development + steelbrain/* younger than a day). DriverWorkaround: 0 hits (code).
ClippedCoverageNotMetals: 0 hits (code). TessellatorNotMetals: 0 hits (code).
note_evaluation_stage: 0 hits (code). A fixed-string grep for `.workarounds()` over the same 66
refs finds 0.

Verified: nothing yet; the gate follows.

SEMANTICS_VERSION 2218 is in this commit: the two variants become static precision notes and
the profile loses its workaround list, so notes and keys move (the planner's rule: an emitting
commit carries its own bump); main renumbers it at the landing.
2026-11-20 15:15:25 -08:00
Anees Iqbal 107dba0b33 runtime: lines by Bresenham's rule, bresenhamLines on the floor
Metal covers the pixels whose diamond a line exits. Vulkan's default line rule is the device's
own: on a device whose strictLines is set (lavapipe, NVIDIA's driver), the rectangle of the line's
width. The new runtime chained no line state, so primitive-type-restart-indices' four Line and
LineStrip cells differed from Metal on lavapipe (m3-max-60347) and on the RTX 2080, 3090 and 5080
(round 50b8fbb64f) by 7, 7, 5 and 13 texels. Those are exactly the counts the case's doc records
for lavapipe without Bresenham's mode. The old runtime chained the mode (73c4e3ab3c). Restart is
not involved: rt restarts strips alone, as Metal's recording does.

The floor takes VK_EXT_line_rasterization and its bresenhamLines (the planner's ruling, rung 1:
one form for every device). There is one extension name, the EXT, because every capture lists it:
- RX 7900 XTX, RX 550, RTX 3090 and RTX 2080: vulkaninfo, jobs m3-max-60382 to 60385. Each also
  lists the KHR, with bresenhamLines true.
- KosmicKrisp on the M3: m3-max-60379.
- The committed profiles of RADV (780M, RDNA2, RDNA3), ANV (Iris Xe RPL-P and TGL, ARL, UHD 770),
  lavapipe and NVIDIA (RTX 5080 and the laptop part, GTX 1060).
- The Windows UHD 630's capture, a Vulkan 1.3.215 device.
No venue lists the KHR name alone. Vulkan 1.4 requires bresenhamLines of every device.

The line class's VkPipeline chains VkPipelineRasterizationLineStateCreateInfoEXT with
VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT. A state that enables alpha to coverage or alpha to one
is the exception, since the mode takes neither (VUID-VkGraphicsPipelineCreateInfo-
lineRasterizationMode-02766); the runtime enables no sample shading, the third member the VUID
names. Such a state's lines are drawn by the device's default rule, and the state carries the new
static PrecisionNote::DeviceLineRasterization (metal2vulkan-degrade-device-line-rasterization),
decided by its descriptor alone and never fatal. The note is entered in docs/API.md's catalogue,
mapped in the conformance crate's Degradation and validation's allowance table, and added to the
cache codec's list (the translator never records it).

docs/API.md's accepted differences gain the one sentence on a line's tie-break: Vulkan's diamond
is open, so which pixel a line covers where it only touches a diamond's vertex is the device's
own. The case's doc measured Metal covering the lower pixel and the RTX 5080 the upper.

The README's floor lists gain VK_EXT_line_rasterization and bresenhamLines, and its render
pipeline section the line rule. The floor tests take the feature and the extension.

Test: draw's every_device_notes_the_device_line_rule_under_alpha_to_coverage_or_one
(`draw_line_rule`): a plain state carries no DeviceLineRasterization and draws its line across row
2 by Bresenham's rule; alpha-to-coverage and alpha-to-one states carry the note and draw the same
row by the device's rule.
2026-11-20 15:09:44 -08:00
Anees Iqbal fd7e029718 translator: a kernel whose lockstep pairs the identity domains leave unordered records SimdgroupAccessOrder
Under the identity domains (the runtime's) the translator puts no barrier between two accesses
that different threads of one SIMD-group make to the same bytes between barriers, which an Apple
GPU orders by running the group in lockstep. The Metal Shading Language calls such a pair a data
race, and docs/API.md lists the difference as accepted. Until now that difference was silent. Two
private validation kernels through the runtime on lavapipe (129666ac, 4b74b854) mismatched for
this reason alone. The same translation with the lockstep order put back (probe 61461f3a67, not
landed) matched Metal byte for byte in both (job m3-max-60389).

- PrecisionNote::SimdgroupAccessOrder, a static note that names the Metal behaviour. It is
  recorded for every kernel in which the translator finds such a pair, on every device under the
  identity domains. The resident-table domains order each pair with barriers and record none.
- lower/simd/lockstep.rs: OrderKey::of gives every profile a key. Under the identity domains the
  key orders nothing (unordered): order() runs the pair search alone, stops at the first space
  with a pair, inserts no barrier and sets Lockstep::unordered. select records the note from it.
  ordered_entry loses its None arms. The found entry is kept under its key in StageEntries, as an
  ordered one is.
- Announced as metal2vulkan-degrade-simdgroup-access-order (the conformance Degradation kind).
  docs/API.md's catalogue entry is placed beside the accepted difference, which now names the
  note. The conformance simdgroup_lockstep cases justify their output words by that notice, so
  the runtime's side does not announce it undeclared. Validation derives no tolerance from it
  (Allowance::Unbounded).
- SEMANTICS_VERSION 2212 -> 2213 and ARTIFACT_FORMAT_VERSION 557 -> 558 (the appended codec
  variant); renumbered at landing. api_signatures.tsv regenerated (the variant twice and
  Lockstep.unordered). docs/REFUSALS.md does not move.

Tests: the identity-domains lockstep test now asserts that each row-store kernel records the note
under the identity domains and not under the resident ones. A new pair-free kernel (each thread
its own word) records it under neither. A conformance stub test checks that a changed output
word, with the notice announced, reads announced.
2026-11-20 15:03:41 -08:00
Anees Iqbal e8bcb0c317 API.md: recommended_enables takes no policy since the policy arms went
Verified: docs only; the call matches enables.rs's signature.
2026-11-20 14:30:50 -08:00
Anees Iqbal ba63cf58ca Policy arms: the enables tests import DevicePolicy themselves (clippy 59962); docs name what is bounded
The enables module no longer names DevicePolicy, so its tests import it. API.md and
VALIDATION.md say the default domains' bounds, and an unbounded threadgroup access, instead of
containment and isolation. api_signatures.tsv is regenerated (signatures.py --bless); REFUSALS.md
is unchanged.

Verified: clippy follows as a potluck job.
2026-11-20 14:30:50 -08:00
Anees Iqbal 313c94e52c Policy arms, part 3: the API guide says what is bounded, not that a guest is contained or isolated
Verified: nothing yet; clippy and doc follow.
2026-11-20 14:30:50 -08:00
Anees Iqbal 569b32b49a RuntimeDriverDefect goes: an identity-keyed table no runtime code reads
The enum listed 33 defects of named drivers in commands a runtime records, keyed on the driver's
identity and release (rule 2). The runtime constructs none and reads none: no crate of ours, and
none of reims's, names a variant. With it go Needs::RuntimeDriverDefect,
Unsupported::runtime_driver_defect, validation's UnsupportedReason::DriverDefect ("driver_defect"
keys; the stale census rows that carry one go at the next re-bless), the conformance verdict's
device-gap arm, the error and engine key tests' entries, the API guide's Needs entry and the
refusal surface script's constructor.

Since nothing reads a variant, no ladder rung follows from one: no site becomes a precision note or
a typed gap. The four docs that cited a variant now state what Vulkan or the module does without
it: the depth/stencil copy modules (maintenance8's copies), the generated-commands replay (the
explicit preprocess form, which the runtime does not take), the validation executor's set-layout
query note (MoltenVK's understated answer), the pipeline-cache probe's comments (MoltenVK compiles
a seeded cache's shaders at load), and SeparateMultisampledDepthStencil's refusal (maintenance8
alone).

NativeHalfConversion's bound adds NVIDIA 620.70.06's measurement on the RTX 3090: the pair is
dropped under the 16-bit RTE, DenormPreserve and SignedZeroInfNanPreserve too, every float that is
no half coming back unchanged over all 2^32 inputs. The bound already covered no rounding at all.

REFUSALS.md and api_signatures.tsv regenerated.

Verified: nothing yet; the gate follows.
2026-11-20 13:39:49 -08:00
Anees Iqbal 7be3a0326b Restore ArgumentBufferLayout::from_descriptors: the consumer's newArgumentEncoderWithArguments: layout
The orphan pass (f5faf44098 and its WIP follow-ups) deleted
ArgumentBufferLayout::from_descriptors as unused in this workspace. It is the
published crate's answer for Metal's newArgumentEncoderWithArguments:, and the
consumer calls it for the guest's MTLArgumentDescriptors: its argument encoder
writes at those offsets. Function::argument_buffer_layout covers only
newArgumentEncoderWithBufferIndex:. A use outside this tree is still a use.

Restored as it was at f5faf44098^: the function, its two helpers (metal_align,
type_size_align), the module docs' descriptor rule, the bind root's line,
API.md's line, and its Metal-measured tests in src/tests/argument_buffers.rs
(the order given, arrays, MSL sizes, constant-block alignment, the refusals, an
index two descriptors claim). api_signatures.tsv regained its row.

from_buffer_binding (newArgumentEncoderWithBufferBinding:) stays deleted unless
the consumer's own compile shows a call.
2026-11-20 12:14:11 -08:00
Anees Iqbal 201fcfe1f0 The offset-0 class goes: no storage view declares RangeAtBindOffset since its workaround went
PushReadsLengthenThreadPayload was the only reason a storage view declared
SpecKey::RangeAtBindOffset, and lower::access now declares it for a uniform view alone. What told
offset 0 apart for such a view had no reader left: StageTable::zero_offset_views,
bind::ZERO_OFFSET_CLASS and ZERO_OFFSET_TOLD, PipelineInterface::storage_view_buffers, and the
storage arms of range_at_bind_offset. No crate of ours or the consumer's names them (the runtime
never set zero_offset_views). They go, with the test of the storage form, the offset class test's
offset-0 half, the validation executor's line that set every slot's bit, and the API guide's
paragraph. range_at_bind_offset answers false for a storage view: it reads at its residual.

Verified: nothing yet; the gate follows.
2026-11-20 11:58:28 -08:00
Anees Iqbal 3656f31676 DriverWorkaround keeps the two answers every device takes; the driver-defect refusal goes
DriverWorkaround held 26 variants; Device::from_queries takes only ClippedCoverageNotMetals and
TessellatorNotMetals, on every device, and the batch's earlier commits removed every reader of
the other 24. They go, and the enum's docs now say what it is: a device answer that no Vulkan
query tells apart, noted on every device.

Needs::DriverDefect and Unsupported::driver_defect named a DriverWorkaround measured on a
driver's identity. No site constructs it any more; they go, with their arms in the permanence
match, the validation engine's outcome map and its key test, the conformance verdict's device
gap, the error tests and the refusal surface script.

Docs that named deleted variants are rewritten to what the code does now: the f32 denormals in
an entry that declares the 16-bit float controls are the device's own on every device; the stage
bound is the one bound a kernel's plan is held under; the uniform view is a Uniform block (the
texel form went with ExternalUniformReadsSkipACache); the Intel venues' note no longer claims the
RPL-P's profile takes a workaround.

Verified: nothing yet; the gate follows.
2026-11-20 11:57:41 -08:00
Anees Iqbal fda94462c8 Fragment, mesh, memory: the dead driver variants' readers go
Since the fact tables went, Device::from_queries gives every device the same two workarounds
(ClippedCoverageNotMetals, TessellatorNotMetals), so every reader of another variant tested a
fact no profile carries. Deleted with their now unreachable forms, each changing what no device
emits:

- EarlyTestsDropMultisampledImageWrites (MoltenVK on Apple's GPU): the framebuffer fetch's
  per-sample refusal and its 'dropped' arm (fetch.rs), the imageblock's late-tests form and its
  two refusals (imageblock.rs, ImageblockPlan::late_tests), the input shadow's arm. The device
  test every_device_keeps_an_early_tests_fragments_texture_writes_at_four_samples (runtime,
  lost_writes) holds the defect's shape on every device.
- MemoryWritingFragmentsRunPerSample (MoltenVK): CoverageLoop::DriverRunsPerSample, the coverage
  plan's driver_runs and writes, its refusal, link's sample-shading exception, the codec tag and
  engine_coverage_loop's per_sample_defect. Held by
  every_device_runs_a_memory_writing_fragment_once_per_covered_sample.
- BothBarycentricFormsRejected: the stage interface's refusal of a second barycentric form.
- MeshIndexComponentStoresMisplaced (lavapipe before Mesa 26.2, below the floor): the staged
  index words, their declaration, stores, write-back and workgroup bytes
  (stage_workgroup_limit's staged argument).
- BufferAtomicsUncontained (SwiftShader, below the floor): contain::atomic_encoding and
  DeviceProfile::checks_atomics_in_shader, which validation's out-of-bounds contract read; an
  atomic is contained as every other access is.
- DiscardDropsSimdgroupStores (MoltenVK on Apple's GPU, SPIRV-Cross's optnone helpers): the
  deferred discards (discard.rs late_discards, Reach::FLOAT, the census name
  fragment.discard.deferred), spirv::helper_branches whole (its guard, fences and census
  entries), and the notes DiscardDropsSimdgroupStores and HelperBranchDropsSimdgroupStores with
  their codec tags, conformance degradations, validation allowances, API.md entries and the
  engine_fragment test of the uniform branch. The rch_helper_* fixtures stay, compiled as written
  everywhere, their README rows saying so. Held by
  every_device_keeps_the_texture_writes_beside_a_discard_after_a_texture_sample.

The three runtime device tests are in tests::lost_writes, passing on lavapipe (m3-max-59701).
2026-11-20 11:57:12 -08:00
Anees Iqbal 912bf785ce Simdgroups: the vertex grouping note goes, with its fact's reader
The planner's ruling: no VertexSimdgroupGrouping. lower/simd recorded it for a vertex function's
simdgroup or quad operation where the stage takes no required subgroup size and the profile
carried DriverWorkaround::VertexGroupingNotApples (ANV's 8-vertex interleaved subgroups); no
profile carries that variant since the fact tables went, so it was recorded nowhere. The note,
its reader (regroups_vertices), its codec tag, its conformance degradation and code, its
validation allowance, deferral and bound text, API.md's catalogue entry and the engine_simd and
c3 tests that named it go.

The public surface moves with this commit and the batch's earlier ones: the api_signatures table
(regenerated by signatures.py) drops PrecisionNote::VertexSimdgroupGrouping (the translator's
and the runtime's re-export), Feature::PixelCoverage and Feature::CentroidVarying (link's split
refusal), and DescriptorView::UniformTexel (the views' rung 1); REFUSALS.md (regenerated) drops
the two features, and the reach table their rows.
2026-11-20 11:56:55 -08:00
Anees Iqbal daa7287637 Fragment: the clipping notes on every device; link's split-pixel refusal goes
QuadsSplitByClipping is recorded on every device, by the function's structure alone: a fragment
function that runs a quad or simdgroup operation over its active lanes (counts_active_lanes)
records it, with no fact test. A device may shade a triangle it clips as several triangles, and no
Vulkan query tells such a device apart; the note's doc and API.md's catalogue say so and link no
workaround.

Link's split_pixel_fragments refused, in a pipeline of more than one sample, a pixel-rate
fragment function that reads [[sample_mask]] (Unsupported{PixelCoverage}) or a centroid varying
(Unsupported{CentroidVarying}) where the profile carried
DriverWorkaround::ClippedTrianglesSplitPixelFragments. Since the fact tables went, no profile
carries that variant (Device::from_queries gives only ClippedCoverageNotMetals and
TessellatorNotMetals), so the refusal never fired: deleting it changes what no device emits. The
function, its module doc and the two Feature variants only it named go.

ClippedCoverageSplit now also covers the centroid arm: a fragment function compiled for a
multisampled pipeline that reads a centroid float varying and runs once per pixel (no sample
index, sample-qualified varying or memory write) records it where ClippedCoverageNotMetals holds
(every from_queries device): its centroid is the whole coverage's where Metal's may be a piece's.
One that runs per sample reads the varying at its own sample, which no split moves.

Tests:
- engine_fragment's a_fragment_group_operation_records_the_clipping_split_on_every_device: on
  every committed from_queries profile, fragment_discard_msl22's discard_simd (simd_sum) records
  QuadsSplitByClipping and discard_terminate does not.
- engine_coverage_loop's a_multisampled_centroid_reader_at_the_pixel_announces_the_split:
  air_2_1_front_end's a21_blit_fs (a centroid uv) records ClippedCoverageSplit at 4 samples and
  not at 1; multisample_centroid_at_sample (per sample) records nothing at 4.
Validation's c3 and two conformance comments say the note is on every device.
2026-11-20 11:56:15 -08:00
Anees Iqbal 4bc57a20e3 WIP orphans: ResidentPart, the harness's simdgroups assert, and the docs that named deleted items 2026-11-20 11:54:24 -08:00