Commit Graph
272 Commits
Author SHA1 Message Date
Anees Iqbal a5fac6fa9b rt: the depth clip mode Clamp and the triangle fill mode Lines, as pipelines of the draw's class made at first use
setDepthClipMode: and setTriangleFillMode: refused every value but Metal's defaults
(DrawKind::DepthClamp, DrawKind::FillMode). Vulkan 1.3 bakes both in
VkPipelineRasterizationStateCreateInfo, and only VK_EXT_extended_dynamic_state3 makes them
dynamic. The floor cannot require that extension: the UHD 630's Windows driver lists no EDS3, and
KosmicKrisp reports extendedDynamicState3PolygonMode false. So both are now first-use pipeline
variants, the accepted form. The encoder keeps a Raster (clamp, lines) and each draw takes
RenderCompiled::pipeline(topology, raster). The content keeps its primary VkPipeline (the triangle
or patch class at the default state) and a bounded list of the others, by class list topology and
raster state: at most 7 (three more states of the triangle or patch class, two of each other
class). The line and point classes take the clip mode alone, since Metal and Vulkan apply the fill
mode to triangles only. A triangle's edges under Lines chain Bresenham's rule, as the line class
does ("the effective rasterization input topology is in the line topology class"). The first draw
under a state makes its pipeline and waits for it: a first-use wait of a new site,
FirstUse::Raster (Metrics::first_use_raster_waits, _nanos, _max_nanos). The line and point
classes' first draws at the default state count where they did.

Floor:
- depthClamp joins REQUIRED, and the translator is told (=> DepthClamp), so the encoder maps the
  mode through metal::state::depth_clamp_enable. Vulkan 1.4 and Roadmap 2022 require it. The venue
  dumps report it true on every venue: m3-max-48727, 48728, 48729, 48730, 48731, 48736, 48737 and
  61508. tests/floor.rs, the README floor table, RUNTIME_FLOOR and profiles/runtime-floor.json
  add it.
- fillModeNonSolid is enabled where reported (FILL_MODES, told to the translator), and the setter
  maps Lines through metal::state::polygon_mode. KosmicKrisp on the M3 Max reports it false
  (m3-max-48737); every other dumped venue reports it true. There Lines stays DrawKind::FillMode,
  and so does the raw value 2, which no SDK header declares.

DrawKind::DepthClamp is deleted. The consumer's checkout names it nowhere (git grep in
reims-vgpu: 0 hits). Its only call sites are set_triangle_fill_mode and set_depth_clip_mode at
crates/reims-vgpu-vulkan/src/rt_platform/render.rs:371 and :374, whose signatures are unchanged.

The translator's raster-state test reads runtime-floor, which now states depthClamp. Clamp maps
there, and the refusal is asserted on runtime-floor without it, as ab8277a560 did for
depthBiasClamp. Other translator tests that read runtime-floor were grepped for DepthClamp and
FillModeNonSolid, and none reads the floor as lacking them.

Known gaps (README): a content's first draw under Clamp or Lines makes a VkPipeline, which Metal
does not. Under Clamp the depth a fragment function writes is the device's clamp's: Metal stores a
negative NaN as 0 below a range above 0, and the translator's depth_clamp_range variant is not
drawn.

Conformance: render-state-depth-clip and render-state-facing leave known-gaps-rt.tsv;
CONFORMANCE-COVERAGE.md regenerated. Docs: README (encoder, first-use waits, floor and fill-mode
tables, known gaps), REFUSALS.md, the api_signatures table (3 Metrics fields, 1 variant gone).

Tests:
- tests/raster.rs: a triangle in front of the near plane draws nothing under Clip and every
  texel under Clamp (twice: one pipeline made). Under Lines, through a viewport half a pixel
  right of and above the corner, the triangle draws its two edges inside the target, column 0
  and row 7, and nothing inside. Without fillModeNonSolid it is FillMode and fills. Pipelines
  made, raster first-use waits and first-use waits are each 1 + fillModeNonSolid.
- draw.rs: setting both modes makes no pipeline when no draw follows.
- floor.rs: depthClamp's missing case, and the fill-mode feature enabled where reported.
- first_use_sites.rs: the raster site.
2026-11-21 00:14:34 -08:00
Anees Iqbal fa70528de2 validation: the opened chains blessed for drawIndirectFirstInstance on the rebased base; conformance coverage regenerated
The rebase of the indirect draws onto 4cf936ed4d met conflicts in two generated files, which
took the base's side in ec5841552f (whose subject still names the bless it carried before the
rebase). They are regenerated here on the rebased tree:

- opened_chains.txt: the runtime floor's device and restricted chains gain one member each
  (drawIndirectFirstInstance), now 44 and 52 members (bless_opened_chains, job m3-max-62279,
  homelab-gem10-1, at ec5841552f: 1 passed).
- docs/CONFORMANCE-COVERAGE.md: scripts/conformance-coverage/coverage.py on this tree, which
  counts the indirect draw cases that left the ledger.

REFUSALS.md regenerates unchanged; METAL-COVERAGE.md --check passes.
2026-11-21 00:09:33 -08:00
Anees Iqbal df0ed4188e rt: the blit options test compares aspect bits; the ledger follows the plane copies
7ba1cdbf30's suite (m3-max-61836, msi) did not compile the host test: ash's
ImageAspectFlags has no Debug, so assert_eq! of a (flags, bytes) pair fails. The test
compares the flags' bits.

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

The same run also lists 10 argb8-targets-* rows divergent at case/notices
(metal2vulkan-degrade-rotated-blend-rounding) on llvmpipe. They come from development's
own rotated-blend notes, not from this change.
2026-11-20 22:20:00 -08:00
Anees Iqbal afd9686408 rt: a fragment function's stencil output is the device's own where it lists the export
A fragment function's `[[stencil]]` output is the fragment's stencil reference, which Metal's
stencil test and its Replace operations take (Metal's feature set tables give stencil feedback to
the Apple5 family and later and to Metal 3 and Metal 4). rt enabled VK_EXT_shader_stencil_export
on no device, so the translator refused every such function (`StencilExport`): under the
identity domains its pixel-interlock form is never chosen (lower::fragment::fetch::interlock_forms).

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

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

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

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

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

Evidence, at 6e1004de4d and 149a5296e7 (earlier forms of this commit):
- The 16 public cases (valexec2's E/F/G proof m3-max-61598): before, at f3418eacb9 on lavapipe
  (m3-max-61725), not_supported naming StencilExport; after, at 6e1004de4d, 16/16 match on
  runtime-render (m3-max-61732).
- Conformance on lavapipe at 149a5296e7 (m3-max-61812, ms01): every stencil row as the ledger
  says; its one other line, blend-interaction-format-srgb8 divergent on LLVM 23.1.4, is that
  lavapipe's blend and no stencil case. At 6e1004de4d: RTX 3090 (m3-max-61739) exactly the
  ledger's NVIDIA rows; RX 7900 XTX (m3-max-61740) the three rows as this ledger states them.
- The device test at 149a5296e7: lavapipe passes (61812); RX 7900 XTX, 64 pixels stored their
  output (m3-max-61859); RTX 3090, refused naming StencilExport (m3-max-61860).
2026-11-20 22:41:02 -08:00
Anees Iqbal 62b3e5a250 rt: the render encoder's use_resource, and a draw after a declared write of a texture with no storage element is Gap::StorageElement
What: RenderCommandEncoder::use_resource is useResource:usage:stages:, its plural and their
deprecated forms without stages. The command buffer keeps the buffer or the texture until it
retires and nothing is recorded: every resource is resident to every function, and the pass's
barriers already order its draws. A usage that writes a texture (or a view of one) made for
shader writes with no storage element marks the encoder, and every later draw whose vertex or
fragment function may reach a texture through its storage image beyond its slots
(PipelineInterface::unbound_storage_textures: an argument buffer's write or read_write texture, a
resource ID) is Gap::StorageElement with no slot, as the compute encoder's dispatch already is.
Before this, such a draw ran and Vulkan dropped the writes Metal makes. The declaration
invalidates the encoder's held draw facts, so a draw of an unchanged state and bindings after it
is checked again.

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

Test: every_device_refuses_a_draw_after_a_declared_write_of_a_texture_with_no_storage_element
(storage_element.rs, device cfgs): an owned fragment function writes an argument buffer's
texture2d<float, write>; for RGBA8Unorm, RGBA8Unorm_sRGB, BGRA8Unorm_sRGB, A8Unorm and an sRGB
view of an RGBA8Unorm texture, a draw before the declaration draws, the same draw after
use_resource(WRITE) is Gap::StorageElement { slot: None, pixel_format } exactly where the texture
has no storage element, and a colored_fragment draw after the declaration draws; the fragment
function's write through its resource ID lands (1, 0, 1, 1). Without the Facts::find check the
refused cases draw and the test panics.
2026-11-20 22:08:11 -08:00
Anees Iqbal 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 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 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 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 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 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 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 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 f6b9aa2a3d docs: CONFORMANCE-COVERAGE.md re-derived for the line ties' ledger rows
python3 -I scripts/conformance-coverage/coverage.py at this branch: the ledger's count goes from 7478
to 7490, and the twelve primitive-type-restart-indices rows join its table.
2026-11-20 15:09:44 -08:00
Anees Iqbal 83ca8337dc Fix forward of 74080bbaed: the lockstep cases declare the access-order notice; the landing numbers
- The simdgroup_lockstep cases also loosen the notices site by simdgroup-access-order
  (replay::notice_allowance). The site holds the whole announced set, and the walk loosens it only
  where an allowance covers it, so the output's allowance alone left that site divergent. The stub
  test the_lockstep_cases_justify_their_words_by_the_access_order_note failed on exactly that
  (m3-max-60440).
- SEMANTICS_VERSION 2217 and ARTIFACT_FORMAT_VERSION 560, the numbers main gave for this landing.
- docs/CONFORMANCE-COVERAGE.md re-derived: the case's tolerance is now a Degradation.
2026-11-20 15:03:41 -08:00
Anees Iqbal ab6717c5b2 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 14:38:51 -08:00
Anees Iqbal 92ce7950fc Docs: "the runtime", not "the new runtime"
There is one runtime, so the prose of the harness, validation, devtools,
the translator's lockstep module, .config/nextest.toml and the refusal
surface and conformance coverage generators says "the runtime"
(scratch newrt.py: a word replacement, identifiers such as new_runtime
and NewRuntime untouched). docs/REFUSALS.md and
docs/CONFORMANCE-COVERAGE.md are regenerated from the edited scripts.

Four harness passages said the runtime makes no heap and no texture
over a buffer, and has no Managed mode. The runtime has all three
(Device::new_heap_buffer and heap textures, Buffer::new_texture,
Device::new_managed_buffer); the harness's own backend refuses the two
texture sources. They now say the harness makes neither on the runtime,
and the Managed note names Device::new_managed_buffer. The refusal
strings keep the words the harness's described test matches ("makes no
heap", "makes no texture over a buffer").

Left: three fixture comments (.metal under validation's public
fixtures, whose text keys the golden tables and the committed AIR) and
scripts/matrix, whose keys (harness-new) carry the same naming.

Verified locally: the refusal surface, Metal coverage, conformance
coverage and API signature checks pass.
2026-11-20 11:52:56 -08:00
Anees Iqbal 089072932f Re-derive docs/CONFORMANCE-COVERAGE.md: mesh_commands loosens nothing
The conformance coverage check of 8977049e3f (job m3-max-59750) found the
generated document stale: mesh_commands no longer loosens its unordered
attachment, so the counts of modules and tolerances fall by one and the
module's row reads "every field". Regenerated with
scripts/conformance-coverage/coverage.py; nothing else moved.
2026-11-20 11:52:56 -08:00
Anees Iqbal 52f8ecc80d 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 11:13:03 -08:00
Anees Iqbal a247f905e1 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 09:14:58 -08:00
Anees Iqbal 28b20187d4 CONFORMANCE-COVERAGE.md: regenerated over the declarations left
Regenerated with scripts/conformance-coverage/coverage.py after the shared-in-system-memory
declarations went: 43 modules declare a notice where 142 did.

Verified: the script wrote the file; its --check runs in the range's gate.
2026-11-20 09:14:20 -08:00
Anees Iqbal a7320ad3f9 Conformance: no case declares a notice the runtime never announces
The runtime's side announces only the codes of the precision notes its states, textures and
sampler states carry (Degradation::from_precision_note). 66 Degradation kinds had no precision
note behind them: they were the deleted runtime's notices. A case that named one declared a
notice nothing can announce, and a value it loosened by one stayed loosened on no run.

What goes:
- every declaration of those 66 kinds, in 70 case files and the native-note set (six of its
  members were among them: float-tininess-after-rounding, unorm-depth-rounding,
  signed-depth-test, ycbcr-filter-not-exact, device-line-ties, device-subpixel-snap);
- the value tolerances justified by one: astc's and etc's compact-twin bounds
  (decoded-texel-precision), visibility's Boolean words (device-boolean-visibility),
  rotated-planes' unreached rotation-4 bands (rotated-load-tiles), sample-fills' wide depth
  digest (drawn-depth-copy), texture-fills' 32-bit float depth digests and fresh-contents'
  Depth32Float fresh site (restricted-depth-upload, fresh-pattern-zeroed);
- the replay helpers staged_records_notice, interlocked_split_notice and
  set_past_layout_notice, and every call of them;
- the 66 variants, their ALL entries and their codes;
- what only they used: the mesh pass notice list, the sparse notice lists, the GPU-time list,
  the buffer-blits and sparse-mappings rows' notices fields, buffer-target-clears' kept_image,
  buffer-texture-blits' copies_shared_bytes and its two tests, render-draw-forms'
  bounds-pass helpers, rotated-planes' band_is_reached and surface::stored_at,
  rotated-targets' reads_destination_alpha_in_color, visibility's boolean_words, and the
  module prose that described those notices.

The one backed kind whose name was not its note's, ImplementationDefinedReconvergence, is now
DeviceReconvergence with the code metal2vulkan-degrade-device-reconvergence, the note's kebab
name, and docs/API.md section 9 gains its entry. shared-in-system-memory stays for the next
commit. The tests that used a deleted kind as a stand-in use a backed one. Every case keeps
its shared-in-system-memory declaration; tests that count a case's declarations count what is
left. pass_start_reads no longer cites the deleted cost::the_creation_prediction.
docs/CONFORMANCE-COVERAGE.md is regenerated.

A case whose values the deleted tolerances held is now compared exactly; whether the runtime
differs there shows on the venues' replays.

Verified: cargo fmt --all. The gate runs once over this and the following commits.
2026-11-20 09:13:39 -08:00
Anees Iqbal a4540b3913 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 09:10:37 -08:00
Anees Iqbal 9a1c8fe6dc metal2vulkan-rt takes the runtime's name: metal2vulkan-runtime, published
The cutover's last mechanical step. The old runtime is deleted, so its name is free: the crate
moves to crates/metal2vulkan-runtime, its package is metal2vulkan-runtime and its library
metal2vulkan_runtime, and every reference in the tree follows (sources, tests, scripts, CI,
generated tables and docs).

It is now a published crate, as AGENTS.md said it would be once it took the name: version 0.2.0
with the other two, the translator pinned exactly (=0.2.0, as the translator pins the AIR front
end), documentation, keywords and categories, and copies of the repository's four license files,
which the published-crates test now holds equal to the root's for three crates. CI packages it
with the others. Prose that said it was unpublished, or counted two published crates, says three.

AGENTS.md: facts only. The crate table row, the published-crates and version sentences, and the
paragraph on the old runtime, whose name the runtime now carries (listed for the owner).

Made by one script run on this tip. Verified by the job
named in the landing note.
2026-11-20 09:10:02 -08:00
Anees Iqbal b100185a2d 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 09:07:17 -08:00
Anees Iqbal 1b6a802908 Conformance: the rt ledger's bicubic rows on LLVM 23.1.4 lavapipe, the coverage document regenerated
The lane's compile job m3-max-59010 ran on um870, whose lavapipe is llvmpipe (LLVM 23.1.4,
256 bits). Its conformance replay --cpu failed on six unlisted bicubic-texel-classes sites:
mixed, r8unorm, rgba16float, rgba16unorm, rgba8snorm and rgba8unorm, each /sampled. The ledger
held those sites only for LLVM 23.1.1, the venue of msi's lavapipe. The 115 other rows for the
23.1.4 venue were all held.

On 23.1.4 five of the sites give the RTX 3090's answer and rgba8unorm gives 23.1.1's. Each goes
in as a "llvmpipe (LLVM 23.1.4, 256 bits)" row after its twin, with the twin's note, which names
no device.

docs/CONFORMANCE-COVERAGE.md counts and lists the ledger's rows. It is regenerated
(scripts/conformance-coverage/coverage.py) for this commit's rows and the 164 rows of the three
before it, 7457 rows to 7627. The same job's conformance suite failed
the_conformance_coverage_document_is_what_the_sources_derive on those three commits.

Verified: m3-max-59010 listed these six gaps and no row as no longer held. Each gap's answer
equals its twin's.
2026-11-20 08:12:19 -08:00
Anees Iqbal 6dda5a4617 Conformance coverage: regenerated for the ledger's reasons and the folded justifications
docs/CONFORMANCE-COVERAGE.md quotes known-gaps-rt.tsv's reasons and names each family's
justification kinds. 8fd1a5f35f changed the reasons and 57af29bde9 folded NewRuntimeNotice and
NewRuntimeAccepted into Degradation and AcceptedDifference, so the document is regenerated
(python3 -I scripts/conformance-coverage/coverage.py). Job m3-max-58840 found it stale
(conformance_coverage and the coverage check); every other step of that job was green.
2026-11-20 07:59:12 -08:00
Anees Iqbal 5d725aeec7 Delete metal2vulkan-runtime, with every test and script that read it
The cutover deletes the old runtime: crates/metal2vulkan-runtime and its workspace member go.
Nothing in the workspace depends on it any more: the harness and conformance lost their old arms,
and validation dropped its dependency in its own commit.

Adapted in this commit, so no gate reads the deleted tree:
- CI and scripts/linux-gate-ci: the crate's per-feature clippy group, its `-p` in the Windows
  clippy and the test step, and its private-doc-links row go. Packaging needs no edit: the
  workspace's published crates are now metal2vulkan and metal2vulkan-air.
- The published-crates test lists those two; devtools' carried trees and the five nextest groups
  of the old crate's tests go.
- scripts/api-signatures: the crate leaves CRATES, FLOORS and the header, its self-test trees name
  rt (read by the same rules), and the table is re-blessed (the old crate's 4555 rows go);
  api_signatures.rs pins the three crates left.
- scripts/refusal-surface: the old crate's tree and its sections go (RuntimeGap, AppleOnly,
  Problem and the problem enums it forwards to), with their 87 reach rows, the `--delegations`
  verb and the test that counted the old Problem's delegations; docs/REFUSALS.md is regenerated.
  The basis check now holds rt's refusal enums alone, which it already required.
- scripts/api-cost-coverage goes: it measured only the old crate's surface.
- feature_vocabulary.rs: the old crate's two enable tables go; the Khronos and validation tables
  stay held to the vocabulary.
- The conformance coverage generator's by-hand roots read rt instead of the old crate, and
  docs/CONFORMANCE-COVERAGE.md is regenerated (MTLResourceOptions' row, which only the old crate
  modelled, gives way to rt's MTLCommandBufferError).
- scripts/matrix: the harness times the new runtime alone (`--runtime new`), so the rules that
  judged it against the old one go: the new-over-old budget with its floors (floors.tsv,
  gpu-floors.tsv), ceilings, card variance and status table (status.tsv), the frozen arm, the
  base spread and the timing once more it set off, the re-timed pairs, the five creation rounds
  and the old runtime's parked tests and records. A harness row's time is judged as a cross-GPU
  outlier, with its alone runs as before, and the frame and burst rows by their stored
  instruction counts; the creation rows run once, in their own process. docs/VALIDATION.md's
  matrix section says these rules.

Checked locally (python, no build): signatures.py --check and --selftest, refusal_surface.py
--check, --selftest and --missing-basis, coverage.py --check and --selftest, and scripts/matrix's
49 tests pass. The compile gate (fmt, clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, Windows
clippy for gnullvm and msvc, workspace Rustdoc, packaging, the touched crates' suites on the host
and on lavapipe) runs on this sha as potluck jobs that the landing note names.
2026-11-20 07:01:01 -08:00
Anees Iqbal ac90becd94 Conformance: the old runtime's side goes; rt's side is the only one, held to one ledger
The cutover deletes metal2vulkan-runtime, so the conformance suite stops depending on it.

What goes: the old runtime's side (runtime_side.rs, runtime_work.rs, states.rs) and its runs in
run.rs, report.rs and the command; the cost verb, the timing-coverage verb, `times`' leg of ours,
the `--rt`, `--default-policy`, `--leg`, `--call` and `--cold-shaders` flags; the four split
binaries that drove the old runtime directly; coverage.rs; and the old side's ledger,
known-gaps.tsv. The harness half of the cutover landed separately.

What stays: rt_side is the only runtime side, and `conformance replay` runs it (CI's
`replay --cpu` now replays rt on lavapipe). Its ledger, known-gaps-rt.tsv, is the one ledger, with
the rows it held; a call rt_side does not answer yet stays Failure::unavailable on it, as before.
The cases keep every allowance: the old runtime's Degradation kinds become the suite's own codes
(degradation.rs, the same `metal2vulkan-degrade-<kind>` codes), and the old runtime's Metal value
enums the cases state become the suite's own (values.rs). The old side's descriptor helpers that
rt_side and its tests used move to rt_side/fields.rs. Recordings keep their `costs` and our times
as data; `deny_unknown_fields` still reads them.

The coverage generator reads rt_side alone, and docs/CONFORMANCE-COVERAGE.md is regenerated.
The README describes the suite as it now is.

Checked: coverage.py --check and --selftest locally. The compile gate (fmt, clippy plain,
--cfg m2v_gpu, --cfg m2v_cpu_icd and for aarch64-apple-darwin, workspace Rustdoc, the suite on the
host and on lavapipe, and the lavapipe replay) runs on this sha as potluck jobs that the landing
note names.
2026-11-20 06:19:03 -08:00
Anees Iqbal a9acc24aa0 Coverage map: rows rt and the translator answer through their own calls, per-row sizes, refusals by rt's names
The fast switch to metal2vulkan-rt marked missing every runtime row whose old counterpart rt
does not hold under the same name. rt's and the translator's Rustdoc answer more of them:
- 28 runtime rows are implemented: the 9-argument texture and buffer-to-texture copies and the
  options form with no option, `enqueue`, `commandBufferWithUnretainedReferences` (the same call
  as `commandBuffer`), every `withRange:` setter of both encoders (a loop of the single setter),
  `useResources:count:usage:` and `useHeaps:count:`, both encoders' memory barriers,
  `newBufferWithBytesNoCopy` (Device::import_host_memory and a buffer in its block),
  `MTLCreateSystemDefaultDevice` (Device::new), `MTLCopyAllDevices`
  (Instance::physical_devices), a texture's `storageMode` through its descriptor, and
  `renderPassDescriptor` (RenderPassDescriptor's Default);
- 23 translator rows are implemented: MTLLibrary and MTLFunction by the translator's Library
  and Function (from_metallib, function, functions, library_type, install_name, properties,
  function_constants_dictionary, reflection), and MTLFunctionDescriptor by FunctionDescriptor;
- maxBufferLength and a texture descriptor's resourceOptions are the consumer's;
- 53 missing rows take their own size and note: encoder calls (S for loops of existing calls and
  store action options, M for stride binds and indirect draws, L for vertex amplification),
  render pass fields, a texture buffer's descriptor and alignment, function options;
- refusals are named by rt's types: Gap::IndirectCommandBuffers, Gap::KernelInput and
  Gap::DrawInput for function tables, RenderPipelineKind::VertexAmplification and Tessellation,
  RenderPassKind::TextureType and NoAttachment, Gap::TextureBuffer;
- 629 notes no longer name the old runtime's items (RuntimeGap's variants, FeatureRow's rows,
  its compiled_reflection, function_handle, allocated_size, new_library_with_source and
  BlitOption).
coverage.py's group names follow (buffers, encoder calls, command buffer options, function
options). docs/METAL-COVERAGE.md and docs/CONFORMANCE-COVERAGE.md regenerated: implemented
593, missing 1118, out of scope 424.

Verified: every implemented row resolves by the test's own rules in its crate's sources (a
script run of them: runtime 237, translator 356, none missing); every `Type::name` a note names
is held by rt or the translator (14 checked; the same check over the table before this commit
finds 26 it does not hold). The compile job is named in the hand-off.
2026-11-20 06:02:37 -08:00
Anees Iqbal 220473aafd Coverage map: the runtime's counterparts are metal2vulkan-rt's, and the test reads rt's sources
The old runtime is being deleted, and the coverage map's 649 runtime rows named its items. Every
runtime row now names metal2vulkan-rt's counterpart or none:
- 180 rows whose counterpart rt holds under the same name keep it;
- 29 take rt's name for it: DeviceProperties fields that are Device methods, the heap placements
  that are Device::new_heap_buffer and Device::new_heap_texture, the lod-clamp and stencil
  setters, the dispatch type taken by CommandBuffer::compute_command_encoder, and a texture's
  getters through Texture::descriptor;
- 73 are out of scope as rt's README gives them to its consumer: labels, MTLHeap and its
  descriptor, MTLBinaryArchive and every descriptor's binaryArchives, a resource's options, a
  texture's parent and shareable getters, a library's and a function's device;
- 367 are missing, each with a group, a size and a note: indirect command buffers (71), function
  tables, handles and dynamic libraries (38), mesh (33) and tile (26) pipelines and their calls,
  encoder calls (59), argument encoders (24), libraries and functions as runtime objects (25),
  and smaller groups. Their sizes are the group's, to be refined.

coverage.py names metal2vulkan-rt as the runtime and gains the new groups;
metal_coverage.rs reads crates/metal2vulkan-rt/src. docs/METAL-COVERAGE.md and
docs/CONFORMANCE-COVERAGE.md regenerated from the table (implemented 542, missing 1171, out of
scope 422).

Verified: every implemented runtime row resolves in rt's sources by the test's own rules (a
script run of them over the tree: 209 of 209); the compile job is named in the hand-off.
2026-11-20 05:28:07 -08:00
Anees Iqbal f7a833a939 conformance coverage: the ledger rows of bicubic-texel-classes; its sRGB rows name both notes
docs/CONFORMANCE-COVERAGE.md lists the ledger rows, so it is regenerated with the case's
35 old-runtime rows. The old runtime's sRGB rows say "the static notes ... and
srgb-texel-decode".

Verified: scripts/conformance-coverage/coverage.py --check reports the document as derived;
m3-max-57864 at 23dcb71cd6 failed only the coverage test this fixes, and its lavapipe
replays of both runtimes read the ledger rows clean (exit 0).
2026-11-20 02:55:02 -08:00
Anees Iqbal a816607226 conformance: Metal's recording of bicubic-texel-classes (the M3, macOS 27.0.1), its arms held by three tests; CONFORMANCE-COVERAGE.md regenerated 2026-11-20 02:55:02 -08:00
Anees Iqbal a48d634517 conformance: two ushort3 function constants read as half3, on Metal and on both runtimes
A case of our own MSL that reads its constants the way the consumer's two refused records do:
engine/fc_ushort3_half3 (our MSL, compiled by scripts/regen-air-fixtures on the M3) declares two
ushort3 function constants and reads each through as_type<half3>, which the compiler folds into
a <3 x half> load of the constant's <3 x i16> global (the regenerated .ll holds exactly that
load), so the translator holds both in the constant blob. Thread t stores, as floats, lane t % 3
of each, their half sum and t; the values (1.0, 2.5, -0.75 and 0.5, 4.0, 1.25) have exact sums.

The suite gains the call that makes such a pipeline: Side::compute_pipeline_with_constants
(newFunctionWithName:constantValues:error:, then newComputePipelineStateWithFunction:error:), on
the Metal side, the new runtime's side (FunctionDescriptor.constants), the old runtime's side and
the watching wrapper. The Metal side's constant setter pads each value's packed bytes with zeros,
so a setter that reads a vector type's aligned size reads zeros past the packed lanes.

Metal's recording (the M3, macOS 27.0.1 26A434, `conformance record` with three runs and the
validated leg, then `times --runs 8 --write`) stores the program's floats for every thread,
which metal_stores_the_programs_floats holds. The engine fixture inventory gains the fixture's two
rows, ok on every profile (blessed on the M3).

The case is named among those authored after the last whole-set cost --write, whose next
run pays its cost record, and docs/CONFORMANCE-COVERAGE.md is regenerated for it. The golden
table gains the fixture's cells on development, where the tables are blessed.

Verified: see the check job named in the landing.
2026-11-20 00:28:33 -08:00
Anees Iqbal 653014c278 conformance: the heap cases name their size allowance where the coverage document reads it
docs/CONFORMANCE-COVERAGE.md derives each case module's tolerances from the Allowance::new calls
in its own text, so the helper in texture_query.rs left the four heap modules reading 'every
field' while they loosen both numbers of every answer on the new runtime. Each module now names
the allowance itself (the same path, loosening and justification); texture_query keeps the entry's
slug, DEVICE_OWN_SIZES, with the rule in its doc. The document is regenerated: the four heap
modules, pass_sequence_actions and astc_textures each read one more tolerance, 26 in all.
2026-11-19 20:41:18 -08:00
Anees Iqbal 0c451c569e conformance: the two new fetch-ordered cases take fetch-ordered-bgra8unorm's ledger rows
A fetch from a target made for shader writes and from one of unknown usage answers as the fetch
from a target made for shader reads, on both runtimes: the same three texel sites a code apart,
with the same counts on each card. Each ledger takes the read case's rows for its venues, reason
text unchanged (the device's conversion into an 8-bit unorm attachment it also fetches). The
coverage document counts the twelve rows the old runtime's ledger gains.

Verified: see the check job named in the landing.
2026-11-19 20:36:18 -08:00
Anees Iqbal 7839fa0876 conformance: the coverage document counts the two new fetch-ordered cases
Regenerated by the coverage tool at the cases' commit with their recordings: two more committed
recordings, fetch_ordered's six cases, and the case lists of the items they drive.

Verified: m3-max-56114 (msi) regenerated it, then conformance-host 1090 of 1090 passed, the
coverage document test among them; clippy of the conformance crate 0.
2026-11-19 20:36:18 -08:00
Anees Iqbal 2c1ecbdd16 conformance: resolve-store-then-load, a resolving store's samples loaded by the next pass
pass_sequence_actions crosses a store with the next pass's load over a single-sampled attachment;
this case asks the crossing it leaves open: whether the samples
MTLStoreActionStoreAndMultisampleResolve keeps are the samples the next pass loads. Each cell
runs two passes over an 8 by 8 RGBA16Float attachment of four samples: pass A clears it and draws
into each 2 by 2 cell under a sample mask of the cell's index, then stores and resolves into
resolve A (or, in the control cell, only stores); pass B loads it, draws into cell 0 under a
mask of its own and stores and resolves into resolve B. A kernel reads every sample after pass
B, and blits read resolve A and resolve B. The sample mask, not the device's sample positions,
decides which samples a draw writes, and every value is exact in half. A side that resolved in
the pass and dropped the samples answers every resolve right and every later load wrong.

Recorded on the M3 Max, macOS 27.0.1 (26A434), by `conformance record` in job m3-max-55692,
eight runs alike, and timed there by `conformance times --runs 8 --write`. Named among the cases
after the last cost run. CONFORMANCE-COVERAGE.md regenerated (job m3-max-55697: the conformance
crate's clippy clean and its host suite 1090 of 1090).
2026-11-19 18:53:05 -08:00
Anees Iqbal bd2f82ee48 docs: CONFORMANCE-COVERAGE.md regenerated for nan-to-integer-conversions
python3 scripts/conformance-coverage/coverage.py at ddf7a8ccd2 (job
m3-max-55493 on msi, which then ran the conformance crate's suite on
lavapipe against this document: 1087 tests run, 1087 passed; clippy
-D warnings and rustdoc -D warnings of the crate clean). One more case
module and recording, one more module that loosens a measured value (the
long-of-infinity elements).
2026-11-19 18:14:15 -08:00
Anees Iqbal 4b7ff7e9bf conformance: Metal's recordings of the four NVIDIA-route surface cases
Recorded on the M3 Max, macOS 27.0.1 (26A434), by `conformance record` in job m3-max-54229, three
runs each. Metal's side makes the same surface for these cases as for the VA-API ones, and each
recording's outcomes equal its VA-API twin's. CONFORMANCE-COVERAGE.md regenerated.
2026-11-19 15:27:03 -08:00
Anees Iqbal c9b5997ef9 conformance: texture-view-casts-2d-array-as-cube recorded and timed on the M3
Recorded and timed on the M3 in job m3-max-54332 at 0cd13ee9f9 (record, then times --runs 8
--write, both legs, 8 rounds; Metal's validation ran the case). The coverage document is
regenerated.
2026-11-19 14:21:21 -08:00
Anees Iqbal d4241114cc conformance: compute-threadgroup-memory-reads-zero recorded on the M3
Metal on the M3 Max (macOS 27.0.1, job m3-max-53825, three runs, one
outcome) answers metal2vulkan_devtools::threadgroup_start::answer in each
of the six dispatches: no word of the declared array or of the
[[threadgroup(0)]] region read nonzero before the program wrote it, in
the later threadgroups of 2048 of 16 KiB and in the second dispatch;
every pattern read back (0xffa00000); its SIMD groups of 32 in thread
order. docs/API.md states that answer, the engine fixtures' README lists
tgz_reads, and CONFORMANCE-COVERAGE.md is regenerated.
2026-11-19 13:52:36 -08:00
Anees Iqbal 947cb2ebb1 conformance: the texture-view-casts cases recorded on the M3, with their timing
Recorded and timed on the M3 (53768 at 280632f1bd: record, then times --runs 8 --write; Metal's
validation ran every case). Each of the 1,200 recorded samples is the colour its way cleared at the
level and slice under it, which every_recorded_sample_is_the_colour_its_way_cleared now holds. The
coverage document is regenerated.

Verified: built and tested in the jobs the landing message names.
2026-11-19 12:51:51 -08:00
Anees Iqbal 97b6ce7d8f conformance: the resource getters rt keeps none of are the consumer's own, one row a site
The planner's ruling: one new object of the consumer's own, the eight MTLResource getters
metal2vulkan-rt keeps none of (label, device, cpuCacheMode, hazardTrackingMode, resourceOptions,
heap, heapOffset, isAliasable). Its text says who answers each and from what: an echo of what the
program gave at the make, each default resolved by the consumer, or the consumer's own object
(the device, the heap, its placement and its record of makeAliasable). It says nothing of what
Metal answers. rt's README names it in what the consumer implements. If rt ever answers one of the
eight, that getter is split out as storageMode is in the commit before.

The 17 sites of resource-aliasing, resource-labels and resource-own-getters where the rt side
answered resource_facts Unavailable take one row each, naming which of the getters the case reads
there and that storageMode compares at the storage-mode site beside it. The three cases are
re-recorded on the M3 (53582 at 40ff1a0a10): each recording gains its storage-mode sites and
nothing else changes. The coverage document is regenerated.

Verified: built and tested in the jobs the landing message names.
2026-11-19 11:35:33 -08:00
Anees Iqbal 716d2a6692 conformance: surface_textures recorded on the M3 Max
The six cases recorded by m3-max-53501 at e9205c330c (macOS 27.0.1, three runs each, Metal's API
validation layer on in the validated leg, which ran clean): every texel getBytes: and the blit read
back is the byte replaceRegion: wrote, over each surface's plane. A test holds the recordings to
that. The conformance coverage document regenerated for the new recordings.
2026-11-19 11:35:32 -08:00
Anees Iqbal 3972bd030f conformance: textures of ordinary formats over IOSurface planes, the consumer's surface form
A new family, surface_textures: BGRA8Unorm over a 'BGRA' surface, RGBA16Float over 'RGhA', and
R8Unorm and RG8Unorm over a '420v' surface's two planes, R16Unorm and RG16Unorm over an 'x420'
surface's. Each case makes the texture with newTextureWithDescriptor:iosurface:plane:, writes
every texel with replaceRegion:, and reads them back with getBytes: and with a blit into a Shared
buffer. The suite's existing surface cases are all Apple-private forms (framebuffer-only rotated
targets, and Metal's two-plane YCbCr formats); these are the form a consumer's surfaces take,
textures of ordinary formats over one plane. The x420 planes take the 16-bit formats, whose texel
is the plane's element.

The sides: Side::surface_texture. Metal's side lays the surface as the case states and reads it
back before a texture lies over it (metal_surface's single-plane surface may now state its
OSType). The old runtime's side takes a buffer standing for the surface, as the runtime takes an
IOSurface. The new runtime's side makes an exported surface of the planes
(Device::new_exported_surface), in the first of a dma-buf, an opaque fd and an NT handle the
device exports, at VA-API's 256-byte multiples; the case's texture is its plane's. The rt replay
prints each case's surfaces_in_place and surfaces_copied, the evidence of the form a venue took.

The rt side's other surface answers name what it lacks: a rotated target's setRotation: (or
setFramebufferOnly: at rotation 0), and a two-plane YCbCr texture over a surface's plane.

Verified: built and tested in the jobs the landing message names; the cases are recorded on the
M3 in a later commit.
2026-11-19 11:35:32 -08:00
Anees Iqbal 9d7dec8281 docs: the conformance coverage document counts buffer_target_clears' new-runtime tolerance
Check m3-max-53356 at 73b58c77fc (msi):
- clippy 0, and the attachment-note tests 0;
- the conformance crate's tests 1 failure of 1075: the_conformance_coverage_document_is_what_the_sources_derive.
The DontCare rows' texel declarations (73b58c77fc) are a new module that loosens a measured value:
the document's tally reads 16 modules and 18 tolerances where the sources derive 17 and 19. Its
buffer_target_clears row now names the NewRuntimeAccepted tolerance.

Regenerated with python3 -I scripts/conformance-coverage/coverage.py at c2deff73b7. Only those
three lines change.
2026-11-19 11:35:31 -08:00