Commit Graph
1970 Commits
Author SHA1 Message Date
Anees Iqbal bcc417bc08 Translator: SparseResidency's text names a footprint of the border alone
PrecisionNote::SparseResidency said the device's OpImageSparse* residency may count a texel of
zero weight Metal does not. Public case fd292944c2 (a 256x128 r32_float sparse texture with x
128-255 mapped) found a second way the device's word differs: lavapipe answers not resident for
a clamp_to_border access whose footprint is the border alone (nearest at u -0.5 and 1.5, linear
at u -0.5, -1/256 and -1/512, gather at u -0.5 and 1.5), where Metal answers resident, beside a
mapped edge too. Every value word was equal; 7 of 200 residency words differ (valexec2's proof
m3-max-61595, decoded against the committed Metal rows). Vulkan states only "whether any texels
accessed by the instruction are sparse unbound texels" (vkspec 20.2.6), so the word is the
device's, which the note's first clause already says; its text now names this case beside the
zero-weight texel, in the doc comment and in docs/API.md's catalogue.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ENGINE_EXECUTOR_ABI to vulkan-engine-v195.

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

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

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

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

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

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

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

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

ENGINE_EXECUTOR_ABI to vulkan-engine-v194.

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

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

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

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

ENGINE_EXECUTOR_ABI to vulkan-engine-v193.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The replay backend reports all of these as executed counters.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ENGINE_EXECUTOR_ABI goes to v191.

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

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

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

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

Consumer check: no public item is added or removed.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Verified, at the earlier base 453eec0373 with this change: check 60853 (4406 tests, 10 failed:
the render key, the tests above and the coverage doc, all changed here since; 60899 then showed a
closure type in the new engine_fragment test, fixed here). A states-only play of that tree over
the recordings (60871, 60872, 60873, 60893, 60900) refused 0 render and 0 compute states. The
check and the play at this tree are named in the next commit and the report.
2026-11-20 17:26:22 -08:00
Anees Iqbal a950689934 Extended shadows go: no variant reads and writes an extended-range attachment's half shadow
Metal's tile memory holds an extended-range color attachment (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. The binder offered a variant for a draw whose render pass instance held a
half shadow of such an attachment (BindState/BindShape::extended_shadows,
VariantKey::extended_shadows, LoweringInputs::extended_shadows). Its fragment function read and
wrote an Rgba16f storage image beside the codes (ResourceKind::ExtendedShadow), either in the
interlocked storage form or, on a device that fetches through rasterization-order input
attachments, beside the input attachment (lower::fragment's input_shadow). metal2vulkan-runtime
never asks for the variant and makes no extended-range texture (Gap::TextureFormat), so nothing
reached it.

Now no such variant exists. A function compiled with no shadow (every function, as before for
every rt draw) is unchanged: a blend or fetch onto an earlier draw's write reads the codes that
draw stored (extended_range::tile_value). Those differ from Metal's half where it is not a code's
value, and fetch's module docs say so.

Removed:
- lowering: lower/fragment/input_shadow.rs (InputShadow and its plan, read, store and words),
  FragmentPlan::input_shadows, Declared::extended_shadows, the storage form's shadow
  (StorageColor::shadowed, declare_shadow, shadow_and_texel, shadow_read, the shadowed branches of
  texel, value, the write and its blended and merged forms, and their word estimates), and the
  input-attachment blend's, color read's and stage_io write's shadow branches. The loop over
  covered samples no longer has a shadow refusal. The blend's doc, which sat above
  merged_extended, now sits on blended.
- pipeline: LoweringInputs::extended_shadows and its key bytes, VariantKey::extended_shadows,
  ResourceKind::ExtendedShadow, BindingSource::ExtendedShadow and its link arm, the fetch inputs'
  shadowed reads and writes and their tests and coverage (the input-attachment form passes no
  depth, stencil or coverage state, as before for an unshadowed draw), and the requirements
  trace's ExtendedShadow arm. MovableStorageWrites' doc loses the shadow.
- binder: BindState::extended_shadows, BindShape::extended_shadows, WriteSource::ExtendedShadow,
  and the graphics binder's choice of the shadowed variant (its refusals of a mesh, layered,
  amplified or multisampled plain writer's shadow included).
- tests: engine_fragment's four shadow tests and their helpers (image_accesses,
  shadow_image_types, execution_modes, interlocked); engine_moved_writers' shadow move (its Move
  enum goes, and the writers are checked with the interlocked move alone); the shape round-trip,
  the variant round-trip fixtures, the compile-key test's shadow arm, and the requirements test's
  ExtendedShadow kind.

No SEMANTICS_VERSION bump: an input without shadows (every input a consumer can now state)
lowers to the same words. Removing the shadowed branches leaves the instruction order of the
unshadowed paths as it was, and the key appended shadow bytes only when the set was non-empty.
ARTIFACT_FORMAT_VERSION 569 (after guestgaps' 568 on 81bd82fdaa): the codec loses
ResourceKind::ExtendedShadow and BindingSource::ExtendedShadow. RUNTIME_VERSION stays: no run of
an unchanged artifact and plan does anything else, since no consumer set the field, so this
commit updates the runtime pin alone. api_signatures is regenerated, and so is docs/REFUSALS.md
(FramebufferFetch: 18 sites to 15).

Consumer check (consumer-uses.sh, consumer development b955213d27, 64 refs; on development 81bd82fdaa): extended_shadows,
ExtendedShadow, InputShadow, input_shadow: 0 hits (code).

Verified: nothing yet; the two fix-forward commits after this one make it build (60740, 60749),
and the check job of the series is named with the refusal commit.
2026-11-20 17:26:22 -08:00
Anees Iqbal fd924dd9c8 Census: a requirement the runtime refuses is the runtime's limit, closed without a candidate run
The authoring-capability census stayed open on 66 rows, every one a
requirement whose shape metal2vulkan-runtime refuses: seq_cst_fence (14),
texture_buffer_member (6) and mesh_render_pipeline (46). Each was a tooling
gap (Limit::Tooling), which keeps a row unresolved, though no tooling the
executor could build would run them: the product refuses them.

The ruling is a third limit beside Limit::Metal. Limit::Runtime is the limit
of a requirement whose shape the runtime answers with a typed refusal, or for
which it has no call and the consumer refuses it itself. Its rows are closed
without a candidate run and counted apart: runtime_refused beside
metal_refused, in the summary line and in each executor's stops line. They
stay unresolved only where a tooling gap of their own keeps them open. What
the runtime runs and the executor cannot drive stays Limit::Tooling. This
replaces the first lane's "no new Limit" ruling.

- seq_cst_fence: the runtime refuses the pipeline at its make as
  Unsupported{IdentityDomains}. Both ways on lavapipe: the existing
  a_seq_cst_fence_is_refused_through_the_runtime_as_its_requirement_says,
  and the new a_fence_of_another_order_is_made_through_the_runtime (the same
  two stores around an acq_rel fence, made and run, its words checked).
  One-off over the census's 14 rows (m3-max-60840, a probe that never
  lands): each row's own make through the runtime on lavapipe, with no
  input, is the named refusal, not_implemented IdentityDomains, 14 of 14.
- texture_buffer_member: two device tests, each both ways.
  a_texture_buffer_is_refused_where_a_2d_texture_is_made: new_texture
  refuses a texture buffer as Gap::TextureBuffer and makes a 2D texture of
  the same format.
  a_texture_buffer_member_is_refused_at_the_make_where_a_2d_member_is_made:
  the make of a kernel reading an argument buffer's texture buffer is
  refused as Unsupported{IdentityDomains}, and the same read of a 2D member
  is made.
- mesh_render_pipeline: the runtime has no mesh call, and the consumer
  refuses mesh itself (the runtime README's known gap). Without a call there
  is no device test; that README sentence is the guard. The requirement's doc
  says the limit flips when a guest's mesh pipeline is built.
- The new owned fixture rlm_runtime_limits (regenerated with
  scripts/regen-air-fixtures on the M3, m3-max-60866) holds the acq_rel
  fence and the two member reads. A triage test checks the classifier
  takes each shape and not its pair.
- The platform's runtime device opening is factored out (opened), so the
  device tests can make a texture or a pipeline alone under the validation
  layer (on_runtime_device, make_kernel; both test-only).
- The analyzer version is now structural-triage-v85. docs/VALIDATION.md
  states the closure. AGENTS.md's census bullet stays true as written.

Verified: the compile gate and the census, both named in the lane's report.
2026-11-20 17:11:50 -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 2628c03fb2 player: a Windows host's video surfaces through an NT handle (--video-handle opaque-win32)
The Windows plays of boot-idle-780m-1 stopped at frame 212, the stream's first video surface:
"error newTextureWithDescriptor:iosurface:plane:: the device exports no DmaBuf" (60780). The
video stand-in knew only the Unix routes, a dma-buf (the default) and an opaque fd, while the
runtime exports a surface on Windows through an NT handle (ExportHandle::OpaqueWin32), and
answers NoExport for a dma-buf there, correctly.

VideoHandle gains OpaqueWin32 (`--video-handle opaque-win32`): the surface is exported as an NT
handle at the opaque fd's layout, pitch multiple 4, start multiple 1, no rows below. The runtime
lays both opaque handles alike, each plane's LINEAR image at the driver's own pitch (its guide,
the surfaces' handles), and its own Windows surface tests make the surface at those multiples
(tests/surface.rs: the NVIDIA row and BUSY_ROWS on Windows). command-replay and
docs/REPLAY-STREAM.md name the route.

Test: new_runtime::tests::each_video_handle_names_its_export_and_layout.
2026-11-20 16:53:38 -08:00
Anees Iqbal f6da64ab5d Compare no raced lockstep word: the two lockstep cases keep their notices, two validation cases go
Under the identity domains the runtime gives the threads of a SIMD-group no
order between barriers, and the planner ruled form A: no order, the static note
SimdgroupAccessOrder announced, the order not rebuilt. The words the two
lockstep kernels race on are therefore no observation of Metal's that the
runtime owes.

- conformance simdgroup-lockstep-divergent-loop and -until record no output
  leaf any more, and the case/output allowance that left it unchecked is gone.
  Both keep their status and notices sites, with the access-order and the
  device-reconvergence notice declarations; the divergent loop keeps its
  counts-half site (what no thread writes, which no order changes), compared
  exactly. The two recordings lose their output leaf (the 26 lines of it, the
  rest byte for byte as recorded). The lockstep model and the tests over the
  recorded words go with the leaf; the two stub tests now prove the cases
  announce under either note, compare no raced word, and still read a moved
  counts-half byte as divergent.
- validation 129666ac and 4b74b854 (the two authored cases whose observation
  is a raced word) are deleted with their Metal and MoltenVK observations.
  authored-compile.tsv keeps their rows until development's re-bless.
- docs/CONFORMANCE-COVERAGE.md regenerated: simdgroup_lockstep compares every
  field.

Verified: the compile job named in the lane's report.
2026-11-20 16:43:03 -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 75c9d080a3 YCbCr writes go: a function's writes to a 4:4:4 two-plane YCbCr texture are refused
Metal stores a function's writes to an unpacked 4:4:4 two-plane YCbCr texture into both its
planes. The translator held such a slot through an R32G32B32A32_UINT write shadow
(StorageImageClass::YCbCrWrite), and a heap's float storage class held such a member through an
R32G32B32A32_SFLOAT view of its shadow, flagged in its handle-table entry (FLAG_YCBCR_WRITES).
The consumer then encoded the shadow into the planes with bind::ycbcr_write_module. The same
module's second mode stored a render pass's YCbCr attachment (FormatEmulation::YCbCrRendered) into
the planes. metal2vulkan-runtime refuses every YCbCr texture (Gap::TextureFormat), so neither mode
ever ran, but every heap write of a float or half texel through a 2D handle carried the flag's
test and select under its own specialization constant.

Now a slot that writes such a texture keeps the format's refusal (storage_choice,
NotImplemented(Format)), as the other 4:4:4 formats' writes did, and a heap member of one has no
storage choice, so the heap refuses it (ArgumentBufferTextures, NotImplemented). A heap write no
longer tests the flag, and its handle-table search no longer carries it. FormatEmulation::
YCbCrRendered stays as the pipeline's form: a pipeline into such an attachment is made as before,
so no new pipeline-state refusal appears. Its doc now says the pass's store into the planes is not
implemented and that the runtime refuses such textures.

Removed:
- lowering: StorageImageClass::YCbCrWrite (slot.rs's write-only check, emit's ycbcr_write_texel
  and YCBCR_WRITE_WORDS), the heap mark (heap_ycbcr_mark, HEAP_YCBCR_WRITE_WORDS,
  Write::heap_ycbcr, lower::texture::heap_ycbcr_writes), AccessPlan::heap_ycbcr_writes, and the
  YCbCr element mask in heap_element_index.
- memory::handles: FLAG_YCBCR_WRITES, HANDLE_YCBCR_WRITES, Lookup's ycbcr field in Flagged and
  Indexed, carries_ycbcr, ycbcr_writes_spec, ycbcr_flag_mask, ycbcr_element_mask,
  ycbcr_writes_set, k32_const, and Table's stage (only the YCbCr carry read it). carry takes the
  form alone. The search tests lose the YCbCr forms and
  a_search_carries_the_ycbcr_flag_only_under_its_constant. The test tables keep an unused bit 15.
- pipeline: SpecKey::HeapYCbCrWrites; HeapStorageReads' doc loses the write shadow.
- binder: plan/resources' write-shadow choice, bind::heap's shadow view, its entry flag and the
  reads_unmeasured case, plan::slots::heap_ycbcr_writes and its two specialization arms (compute
  and graphics). bind::ycbcr_write goes whole: ycbcr_write_module, YCbCrWriteModule, and the CPU
  models ycbcr_write and ycbcr_store, along with their tests. bind::ycbcr_convert loses
  words_buffer and scalar, which only the write module used.
- metal::format: ycbcr_writes_stored. The YCbCr, YCbCrRendered, writes_dropped, ycbcr_renders
  and held_storage_choice docs say what holds now.
- tests: engine_heap_ycbcr_writes, engine_extended_range's
  ycbcr_write_slots_store_each_texel_s_bits_and_mark, and engine_handles' word allowance for the
  mark (100 words). owned_divisions loses the write module; api_surface loses five rows.

SEMANTICS_VERSION 2223 is in this commit (placeholder; main renumbers): every heap write of a
float or half texel through a 2D handle loses the mark's code, and the plans of such slots
change (a refusal). ARTIFACT_FORMAT_VERSION 566: SpecKey loses HeapYCbCrWrites in the codec.
RUNTIME_VERSION 2545: bind::heap's handle-table entry flags lose bit 15. The runtime pin is
updated. api_signatures is regenerated, and so is docs/REFUSALS.md (one site fewer for
ArgumentBufferTextures and one for Format).

Consumer check (consumer-uses.sh, consumer development 12b87d3d6b, 64 refs): YCbCrWriteModule,
ycbcr_store, ycbcr_write, ycbcr_write_module, HeapYCbCrWrites, YCbCrWrite, FLAG_YCBCR_WRITES,
WRITTEN_BINDING: 0 hits (code). ycbcr_writes_stored: 0 hits on development. It is used on 39
consumer lane branches (steelbrain/quiesce and others, the newest 17 hours old), in
crates/reims-vgpu-vulkan/src/gpu/ycbcr/sampling.rs:2527, a test of the old runtime's YCbCr write
path. That directory is not on the consumer's development.

Verified: nothing yet (a check job is owed).
2026-11-20 16:11:26 -08:00
Anees Iqbal 1fc878dc12 player: count every creation it does not attempt, by selector, reason and root
A call that makes an object on a skipped receiver, or naming a skipped object, made its result
skipped without a line: such a pipeline state counted only in skipped_objects or skipped_calls,
so a stream's 494 render pipeline states against the play's 493 passed unseen.

Each such creation is now counted by its selector and reason (its receiver is skipped, or it
names a skipped object), the reason naming the selector that made the chain's first object
skipped; each skipped object keeps that root, inherited along the chain and removed at release.
The report prints a `not attempted SELECTOR N: WHY, the first #ID (its root #ROOT)` line for
each, the counter `not_attempted`, and a line that adds up the pipeline states: render states
made, refused and not attempted, and the compute states the same. The existing counts are
unchanged.

Test: new_runtime::tests::creations_not_attempted_are_counted_by_kind_and_root (a library from
source skipped, a function of it, two render states of that function, one refused state).
2026-11-20 15:52:07 -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 158d918e91 Flat dispatch goes: a flat or folded variant's indirect dispatch outside a device replay
flat_dispatch_module read an indirect Metal dispatch's arguments on the device and wrote the
record and VkDispatchIndirectCommand a flat (or folded) variant then ran at, for a dispatch
outside the device replay. The runtime never takes a binding plan, and no consumer records the
module. The plan now builds a flat variant's direct Threads dispatch alone (its record is
DispatchCommands::region_record, as before); its indirect dispatch, and any dispatch of a folded
variant, whose records only the device replay's preprocess writes, is
Unsupported{GpuEncodedIndirectCommands, NotImplemented}, already the answer for the variant's
other forms. The device replay keeps its flat and folded variants and flat_dispatch, the
derivation its preprocess shares.

Removed: bind/replay/flat.rs (flat_dispatch_module, FlatDispatchModule, FlatIndirect,
FlatArguments), its tests, and the folded variant's read_records in instantiate_dispatch_into;
the dispatch test now asserts the flat variant's indirect dispatch is refused; the replay
modules' overflow test reads the preprocess alone (its want of 26 already counted the shared
derivation's 23). Records' docs say what they hold now (the Binder doc lost its clamp too).

RUNTIME_VERSION stays at this series' 2543 (the plan's answers change); runtime-sources
re-pinned, api_signatures and REFUSALS.md regenerated.

Consumer check (consumer-uses.sh):
consumer: development 7ea4edc2fb; 68 refs (development + steelbrain/* younger than a day)
flat_dispatch_module: 0 hits (code)
FlatIndirect: 0 hits (code)
FlatArguments: 0 hits (code)
FlatDispatchModule: 0 hits (code)

Verified: nothing yet (compile check owed).
2026-11-20 15:15:26 -08:00
Anees Iqbal 53e1535ee3 Indirect clamp goes: an indirect dispatch reads Metal's group counts from its buffer
The runtime reads an indirect dispatch's group counts where Metal wrote them (its README:
a count above maxComputeWorkGroupCount is the GPU's to read, which Vulkan leaves undefined),
and its path never takes a binding plan's clamp prepass. The plan now does the same: an
indirect region reads IndirectArgs::Buffer on every device, its use is the 12 argument bytes
vkCmdDispatchIndirect reads in DRAW_INDIRECT, and IndirectGroupCount's mechanism is None.

Removed: bind/indirect_clamp.rs and its tests (IndirectClamp, IndirectClampModule,
indirect_clamp_module), DispatchCommands::indirect_clamp, IndirectArgs::ClampScratch, the
template's storage_alignment, Mechanism::IndirectClamp, StatusBits::OVERFLOW (bit 0 stays
unused) and StatusReport::overflow. The validation executors lose their clamp checks
(compute.rs, replay.rs, device_replay.rs), which valexec confirmed only refused the clamp, and
the engine's overflow verdict. The engine_binder harness runs an indirect dispatch from its
buffer at counts within the test device's limit.

ARTIFACT_FORMAT_VERSION 563 (Mechanism's codec list loses a variant), RUNTIME_VERSION 2543
(the dispatch plan's indirect region and uses change), runtime-sources re-pinned,
api_signatures and REFUSALS.md regenerated.

Consumer check (consumer-uses.sh):
consumer: development e6414dd601; 70 refs (development + steelbrain/* younger than a day)
IndirectClamp: 0 hits (code)
IndirectClampModule: 0 hits (code)
indirect_clamp_module: 0 hits (code)
ClampScratch: 0 hits (code)
indirect_clamp: 0 hits (code)
OVERFLOW: 0 hits (code)
StatusReport: 0 hits (code)
StatusBits: 0 hits (code)

SEMANTICS_VERSION 2219 is in this commit too: the artifact records IndirectGroupCount's mechanism,
which moves from IndirectClamp to None (the planner's rule: an emitting commit carries its own
bump); main renumbers it at the landing.

Verified: nothing yet (compile check owed).
2026-11-20 15:15:25 -08:00
Anees Iqbal 193a9a6e95 Builders, batch 3: the resolve draws, the visibility combine and the texture shadow's modules go
color_resolve.rs (color_resolve_modules and its format, channel, rule and source types),
depth_stencil_resolve.rs (depth_stencil_resolve_modules, DepthPick, ResolveWrite and the draw
types), visibility_combine.rs (visibility_combine_module, VisibilityCombine, ContinuedResult) and
the texture shadow's four files (shadow_merge_module, shadow_merge_image_module,
shadow_merge_kept_image_module, shadow_copy_back_module, shadow_copy_in_module and their
types): no non-test code outside them names any of their items (the runtime, the harness,
validation and conformance included; test items stripped one by one, wherever they lie), and no
plan, variant key or lowering input asks a consumer to run them. They go with their tests,
re-exports, api_surface rows and owned_divisions builds.

Metal's sRGB resolve tables (SRGB_RESOLVE_LINEAR, SRGB_RESOLVE_THRESHOLDS) move into the tile
test, their one reader, as private constants with their measured docs. depth_stencil_copy's
binding map loses the resolve draws' arm. bind's module map, metal/format/word.rs and the
msaa_word_formats probe's note no longer name the resolve. The runtime-sources table drops
lower/arith/extended_range.rs, which only the color resolve reached, and its SPIR-V builder row no
longer names the visibility resolve.

No run or translation changes (nothing called them): the versions stay; api_signatures,
REFUSALS.md and the runtime pin are regenerated.

Consumer check: ~/.cache/m2v-orch/consumer-uses.sh, consumer: development b7929d6936; 73 refs
(development + steelbrain/* younger than a day), 0 hits for color_resolve_modules
ColorResolveFormat ColorResolveModules ResolveChannel ResolveRule ResolveSource
SRGB_RESOLVE_LINEAR SRGB_RESOLVE_THRESHOLDS depth_stencil_resolve_modules DepthPick
DepthStencilResolveDraw DepthStencilResolveModules ResolveWrite visibility_combine_module
ContinuedResult VisibilityCombine VisibilityCombineModule shadow_copy_back_module
ShadowCopyBackModule ShadowTexelView shadow_copy_in_module ShadowCopyInModule
shadow_merge_module ShadowMergeModule ShadowMergeStores shadow_merge_image_module
shadow_merge_kept_image_module ShadowMergeImageModule ShadowMergeRead (ColorResolveFormat,
ResolveSource and DepthPick appear in link-order lists only).
2026-11-20 15:15:25 -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