Commit Graph
857 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 47f804e943 Translator: a kernel variant's lowering inputs come from LoweringInputs::kernel_variant; rt answers its translator
rt's kernel state lowered its partial-threadgroups and emulated-SIMD-group variants under inputs it
assembled by hand: a clone of the plain module's inputs with one flag set. Validation's executor is
to lower the same variants on the same device to read each module's containment of an
out-of-bounds target, so the assembly moves into the translator as the one constructor both call:
KernelVariant (Plain, PartialThreadgroups, EmulatedSimdgroups; ALL) and
LoweringInputs::kernel_variant, applied to the inputs kernel_inputs_read gives. rt's
Compiled::of and its translate tests' helpers call it.

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

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

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

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

SEMANTICS_VERSION 2235, one above development's 2234 (placeholder): such a vertex function now
compiles where it was refused. lower/select.rs and cache/mod.rs are not among validation's
runtime inputs, so runtime-sources.sha256 and RUNTIME_VERSION stay. A test pins the form on
lavapipe's profile (engine_identity_render), and docs/API.md names the pushed length.
2026-11-20 21:11:36 -08:00
Anees Iqbal 841c6872ac Identity domains: a read through a sampler takes its border texels from the resource ID's word
MSL 4.1's read(sampler, coord[, offset][, lod]) of a texture slot, through a constexpr sampler
with a clamp_to_zero or clamp_to_border axis or through a runtime [[sampler(n)]], reads Metal's
border texel at an index outside the level. The default domains take the border texels from the
slot's BorderTexels specialization (RuntimeFact::BorderTexels); under the identity domains that was
state of the bound texture they did not source, so such a kernel was
Unsupported{IdentityDomains}. The border texels are bits 0-11 of the texture word
(TextureWord::BORDER_TEXELS, docs/RESOURCE-ID.md), already in the slot's pushed resource ID
(PushField::SlotGuestBase). Under the identity domains select_through now sets neither the slot's
border_texels nor the fact, and border_bits reads the word through emit::identity_id and masks
it, as the format's missing alpha is read. SlotPlan::identity_lowered and identity_unsourced drop
the border texels, which the identity domains now source. An argument buffer's texture read so
(its handle-table entry's border texels) is still refused. The default domains are unchanged.

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

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

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

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

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

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

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

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

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

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

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

Verified (potluck; the jobs ran this diff on development 846f7c1428, and this commit is the same
diff on 62c563f564, whose eight commits since touch none of its lines but SEMANTICS_VERSION and
the API.md paragraph's neighbours):
- m3-max-61334 (msi, at the WIP tree e55576964b, this commit's code and test before its ledger row
  and docs): cargo fmt --check, clippy with all features, with --cfg m2v_gpu and with --cfg
  m2v_cpu_icd, and Rustdoc -D warnings pass; nextest of metal2vulkan and metal2vulkan-conformance
  4363 run, 4362 passed, the one failure the old render descriptor key above; the
  metal2vulkan-conformance suite under --cfg m2v_cpu_icd on lavapipe 1015 passed.
- m3-max-61335 (um790, at e55576964b): conformance replay --cpu swizzled-storage-atomics on
  lavapipe makes the pipeline and is refused at case/RRRR/dispatch (Gap::SwizzledReadWrite).
- m3-max-61438 (msi, llvmpipe LLVM 23.1.1, at the WIP tree ad62594111, this diff but the coverage
  document): conformance replay --cpu of swizzled-storage-atomics and the 13 read-through cases
  against the committed Metal answers: 14 refused, "exactly the open gaps known-gaps-rt.tsv
  expects", exit 0.
- scripts/conformance-coverage/coverage.py and scripts/refusal-surface/refusal_surface.py run at
  this tree (the coverage document's one changed row is in this commit).
- The next commit's states-only play over the 36 recorded streams runs this commit's code too.
2026-11-20 20:25:23 -08:00
Anees Iqbal 83049f641a rt: the pixel interlock orders a raster order group on the memory the function reads and writes
Device creation enables VK_EXT_fragment_shader_interlock where the device lists it, and its
fragmentShaderPixelInterlock where the device reports it (floor's PIXEL_INTERLOCK, one of the
optional extensions; the sample interlock and the shading-rate interlock stay off). The
translator's profile then has the feature, and a fragment function's raster order group on a
buffer, a texture or an argument buffer's member it reads and writes compiles to its one form,
the body inside PixelInterlockOrderedEXT. A device without the feature keeps the typed refusal
(RasterOrderGroups, naming FragmentShaderPixelInterlock). Of the venues probed, KosmicKrisp on the
M3 Max and RADV on the RX 550 list neither the extension nor the feature (vulkaninfo, jobs
m3-max-61291 and m3-max-61296); every other venue reports it, the UHD 630's Windows driver
included (m3-max-61292).

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

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

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

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

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

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

Verification: the lint, test, validation and states-only play jobs are named in the hand-off.
2026-11-20 20:01:45 -08:00
Anees Iqbal dc21cd66c7 Colour groups go: no render variant draws a group of a pipeline's color attachments
A device draws to at most the lesser of its maxColorAttachments and maxFragmentOutputAttachments
color attachments at once. A pipeline with more (or one at an index at or past that count) was
compiled as color groups: a variant per group (VariantKey::color_group) whose fragment function
wrote the group's colors at locations 0.., with the group's attachments alone in its graphics
state, and the runtime drew each group in a pass of its own. The runtime's floor requires 8 of both
limits (floor.rs), Metal's count, so no device it runs on takes a group, and it asks for every
render variant with VariantKey::new(); nothing in it reads GraphicsState::color_group. The groups,
their inputs and their note are deleted. Such a pipeline is now refused where it was already
refused without a group: InterfaceComponents at MaxColorAttachments (link) or at
MaxFragmentOutputAttachments (the fragment's outputs).

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

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

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

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

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

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

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

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

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

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

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

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

Verified: m3-max-61056 (msi) at this commit's tree: fmt, clippy, Rustdoc, and nextest of
metal2vulkan, -conformance, -validation and -runtime, 5885 of 5886 passed; the one failure is
the_old_render_descriptor_key_keeps_its_value, which moves with SEMANTICS_VERSION (main pins it).
States-only plays on lavapipe of the probe player built at the change on 999b82bfe2
(steelbrain/cutxlate-siplay, m3-max-61016): m3-max-61022 to 61026, 61 runs over the 36 streams,
render 502920 states made and 0 refused, compute 108189 made and 0 refused, the counts of the play
before the change: no state a stream makes meets the new refusal.
2026-11-20 18:07:17 -08:00
Anees Iqbal 81ced9a1cb Extended-range fetch and blend refused: what needs Metal's tile half is NotImplemented(Format)
Metal's tile memory holds an attachment of Apple's extended-range formats (BGR10_XR, BGRA10_XR,
RGB10A8_2P_XR10 and their _sRGB twins) as half through a render pass and rounds it to the codes
only at the store. A fetch of such an attachment, or a blend onto it after an earlier draw of the
pass wrote it, sees that draw's half. The attachment holds the codes. With the half shadow gone
(the commit before), such a read or blend would take the stored codes, which is wrong but valid
output. Both are now a typed refusal, NotImplemented(Format) at Attachment::Color(n), on every
device and in either fetch form. This is the same boundary as the runtime's own refusal of every
extended-range texture: Gap::TextureFormat (crates/metal2vulkan-runtime/src/error.rs:1011),
raised in texture.rs's form() (texture.rs:2416, `if !viewed(mapping.emulation)`), so rt never
makes such an attachment.

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

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

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

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

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

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

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

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

Verified, at the earlier base 453eec0373 with this change: check 60853 (4406 tests, 10 failed:
the render key, the tests above and the coverage doc, all changed here since; 60899 then showed a
closure type in the new engine_fragment test, fixed here). A states-only play of that tree over
the recordings (60871, 60872, 60873, 60893, 60900) refused 0 render and 0 compute states. The
check and the play at this tree are named in the next commit and the report.
2026-11-20 17:26:22 -08:00
Anees Iqbal 7bbc00287d DeviceFragmentRuns names what follows the run count; section 10's intro admits notes
The note's doc and docs/API.md's entries (section 9's note, section 10's Draws
entry) said only that a memory-writing fragment's writes repeat as the device's
runs. Whatever the function derives from its own writes across runs follows the
same count, its stored colours and its [[sample_mask]] output included: the
conformance fixture coverage_outputs' cvo_masked writes the mask 1 << run, so at
pixel rate on a device that runs once only sample 0 keeps its colour. Section
10's intro said its entries carry no degrade notice; the SIMD-group order entry
and this one each name their static note, so the intro now says most carry none
and an entry whose answer is the device's own names its note.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Verified: nothing yet; the gate follows.

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

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

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

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

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

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

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

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

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

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

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

REFUSALS.md and api_signatures.tsv regenerated.

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

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

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

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

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

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

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

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

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

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

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

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

Tests:
- engine_fragment's a_fragment_group_operation_records_the_clipping_split_on_every_device: on
  every committed from_queries profile, fragment_discard_msl22's discard_simd (simd_sum) records
  QuadsSplitByClipping and discard_terminate does not.
- engine_coverage_loop's a_multisampled_centroid_reader_at_the_pixel_announces_the_split:
  air_2_1_front_end's a21_blit_fs (a centroid uv) records ClippedCoverageSplit at 4 samples and
  not at 1; multisample_centroid_at_sample (per sample) records nothing at 4.
Validation's c3 and two conformance comments say the note is on every device.
2026-11-20 11:56:15 -08:00
Anees Iqbal 4bc57a20e3 WIP orphans: ResidentPart, the harness's simdgroups assert, and the docs that named deleted items 2026-11-20 11:54:24 -08:00
Anees Iqbal 7f8320758e rt README: a pointer the guest supplies is used as given, a known gap
A known gap beside the no-isolation and device-loss entries: a pointer
loaded from memory or made from an integer, null included, is a device
address used as given, with no binding bounding its accesses. One that
names no live buffer is undefined in Metal; here it reads or writes what
the device holds there, or faults, and a fault ends as the device ends
it, up to a device loss every guest process shares. What is bounded is a
buffer argument's access at a run-time offset (a load outside reads
zero, a store does nothing); a constant-offset access is not checked.

docs/API.md's identity-domain paragraph says the same of such a pointer,
so the default policy's "containment and isolation on" is not read as
holding under the runtime's domains.

Checked against the code: the runtime takes PointerDomain::Identity
(runtime device.rs translator()) with the default Contained containment
and isolation On; under identity a loaded pointer's accesses carry no
bounds (lower/access/mod.rs psb_contained, false under identity;
dynamic.rs base_with and wide_at, where only bounds select a sink) and
count no miss (dynamic.rs plan_misses); a slot access at a non-constant
offset is checked (mod.rs note_variable, identity_contained) and one at
a constant offset is not; outside, a load reads ZeroAddress and a store
or atomic runs nothing (emit.rs prepare).

Docs only.
2026-11-20 11:52:56 -08:00
Anees Iqbal 2e72020cb7 conformance: name the accepted differences section 10 now holds
The section 10 rewrite deleted three entries the conformance suite reads
at test time. Each comes back in what the runtime does now, and the cases
name them:

- "A barrier over the render targets orders what it names, as a Mac2
  GPU's does" keeps its lead-in (pass_start_reads' MAC2_BARRIER), split
  back out of the merged attachment-read bullet.
- "A draw that reads its own pass's color attachment with no barrier
  reads, at the pass's first such draw, what the load and the draws
  before it rendered" is the no-barrier entry; DRAWN_WITHOUT_BARRIER
  names its slug, and the module docs cite the runtime's README instead
  of the deleted fence.rs, snapshot and attached-read copy paths.
- "The runtime answers as a Mac that keeps no texture compressed"
  replaces the device-class entry; replay's WITHOUT_COMPRESSION names it,
  and the docs of it, Allowance and Venue::lossless_compression drop the
  deleted DeviceProperties::lossless_compression and WorkCounts names.

mesh_commands loosened its unordered-draws attachment by an entry for
the runtime's mesh emulation, which is gone: the runtime builds no mesh
pipeline (its README, known gaps of render pipeline states). The case
now loosens nothing, and its docs say so. The two document-reading tests
take kept entries: one lead-in that wraps and a one-line control.

Verified: a scratch check of every slug the conformance sources name
against section 10 finds only case and site names. The gate runs on the
range.
2026-11-20 11:52:56 -08:00
Anees Iqbal d678983c47 API.md section 10: the accepted differences the runtime has
Section 10 was mostly the deleted runtime's accepted differences. Each bullet was checked
against the code: 111 of its 150 blocks go, 2 are rewritten, and the rest are kept with their
stale names fixed.

Gone, because the runtime has no such feature or now refuses what the bullet described: indexed
draws past their buffer (refused), mesh and object grids, the pipeline pool and general forms,
binary archives and dynamic libraries, the old resource ID allocator and its placements and
counts, indirect command buffers, blit copies across formats and short rows (refused), commits as
failed, GPU hang and fault codes, the Mac class a device presented, Metal's own heap answer and
the old heap rules, sparse and tiled textures, texels past a buffer (refused), textures over
IOSurface planes of other shapes, the row-padding device check, the imageblock length, mesh
pipelines, process exit with a live device (supported on no device), and the converted formats
the runtime does not make (two-plane YCbCr, padded 10-bit, copies-only).

Rewritten: a nil, stale or forged resource ID reads the null element (zeros, the default
sampler); a draw that reads its own pass's attachment reads what the runtime ordered before it,
with the Macs' disagreeing answers kept (two bullets became one). Fixed in kept bullets: the
runtime does not refuse an unspecialized function's state (it makes it); the required
threadgroup size bullet loses tile states and a deleted refusal; the Managed copies follow the
device-copy rule; README section names and "new runtime" wording.

The translator-side bullets (function constants, linked functions, conversions, inline assembly,
kernels) are kept, each checked in the code it describes. Notes with file:line kept outside the
tree.
2026-11-20 11:52:56 -08:00
Anees Iqbal 8f96185b17 API.md section 9: each note as every device now records it
Every device profile comes from Device::from_queries (DeviceProfile::of is crate-private), which
takes no measured driver deviation, no measured Metal property and only two workarounds,
ClippedCoverageNotMetals and TessellatorNotMetals, on every device. Section 9 still described the
measured routes: "not on a driver whose ... (DriverFact::...)", "but on a profile that takes
DriverDeviation::...", "**Exempt:** ...", and MoltenVK's own sampler, functions and NaNs.

- DriverFact, MacClass, HalfChainPolicy, YCbCrInPlacePolicy and WorkCounts mentions go: none
  exists.
- A note whose only exception was a measured deviation is now stated as recorded on every device:
  the resolve, snorm and shared-exponent tile stores, depth denormals, device transcendentals and
  denormals, interpolation, fragment simdgroups, alpha coverage, looped sample outputs, device
  sampling, texel and vertex conversion, the native maths notes, half and NaN conversion, pack
  conversion, colour conversion, sRGB decode, cube gradients and half texels.
- A note whose condition is only a workaround, deviation or property no profile takes now says
  it is recorded by no device: QuadsSplitByClipping, VertexSimdgroupGrouping, ComputedSampleDepth
  (the multisampled in-shader depth test is not implemented there),
  DiscardDropsSimdgroupStores, HelperBranchDropsSimdgroupStores, NotMipmappedAnisotropicFilter.
- CappedLodBias names SamplerUse::lod_bias, which a consumer sets; the runtime sets it nowhere.
- Measured device bounds and behaviour (MoltenVK, RADV, ANV, NVIDIA, lavapipe figures) stay.

Each gate checked in the code it names; notes with file:line kept outside the tree. Edited
bullets rewrapped to 100 columns. No test reads docs/API.md. Verified by: git grep of every
backticked Rust path left in section 9 against the code (only Metal's own names remain unmatched).
2026-11-20 11:52:56 -08:00
Anees Iqbal 4f4c67b0af conformance: the rt ledger's point-viewport-coverage rows; a point's clipping is the device's own
With draws of points built (12c621779d), the case's 295 rows refused as "a draw with Points is
not built" no longer hold. The conformance replay on lavapipe (job m3-max-59624, um870, LLVM
23.1.4) reads 249 of them as Metal's and 46 as different:

- 44 rows (viewports 0, 2 and 3 along x, 4 and 5 along y, offsets 0.5 to 1.5): Metal covers one
  pixel whose centre lies on or past the viewport's edge, lavapipe covers none;
- 2 rows (viewport 0 at x -1.5000001, viewport 2 at x +1.5000001): Metal culls the point, its
  centre past 1.5 w; lavapipe culls no point at the clip volume and covers the pixel.

Metal states no clipping rule for a point (MTLPrimitiveType.point; the MSL specification's
[[point_size]]), so per rule 1 the guard band and the edge coverage Metal shows are not
emulated: a point near the viewport's edge or the clip volume is clipped or culled by the
device's own rule (pointClippingBehavior and the driver's handling of the viewport). That is an
accepted difference, in docs/API.md section 10 and the runtime README's point paragraph, and the
46 rows carry it, on llvmpipe. Other venues' rows come from the matrix.

Verified: the replay's own printed rows (conf.out of m3-max-59624) are the rows written, venue
narrowed to llvmpipe; the ledger drops 295 and adds 46.
2026-11-20 11:12:35 -08:00
Anees Iqbal b86c98460a Precision note: a perspective read at a sample or an offset records ExtrapolatedInterpolation on every device
The planner's ruling (the note YES). The note was recorded only on a driver with
DriverWorkaround::PerspectiveReadsExtrapolated, which nothing sets since the driver-fact tables
went: RADV answers such a read with the pixel center's value extrapolated along the quad's coarse
derivatives, and no device query says which devices do, so every module that reads a perspective
input at a sample or an offset (an interpolant's interpolate_at_sample or interpolate_at_offset,
or a coverage loop's sample-qualified varying) records it, on every device.

- lower/stage_io/plan.rs: note_extrapolated_read records the note unconditionally.
- device/profile.rs: DriverWorkaround::PerspectiveReadsExtrapolated deleted (nothing reads it).
- Docs: PrecisionNote::ExtrapolatedInterpolation, API.md's catalogue entry, the interpolate and
  coverage module docs.
- Tests: engine_pull_model, every function that reads its perspective interpolant at a sample or
  an offset records the note on every committed profile and no other does; engine_coverage_loop,
  every looping function's module records it.

SEMANTICS_VERSION is bumped once at the end of this follow-up batch; the runtime sources' pin
follows device/profile.rs in the commit after.
2026-11-20 10:35:57 -08:00
Anees Iqbal ae946adea7 Docs: the deleted switches, codes, fact rows and FAST-PATHS links go
With the old paths deleted, DevicePolicy holds the two domains,
containment and isolation, the translator reads no driver identity, and
docs/FAST-PATHS.md is gone. API.md sections 1 to 8 and 10 said
otherwise:

- The policy section's switch bullets (YCbCr in-place, half chains, batch
  order, render lowering, pipeline waits, wide lines, extended-range
  blits, queue sharing and turns, unstored DontCare loads) and
  exact_answers() are deleted.
- The measured-driver section said rows keyed on driver identity decide
  answers; Device::from_queries reads none, so it now says the device's
  own answer is taken and noted. The deleted runtime's host-page,
  Managed-copy, shadow and bit-20 prose that followed it is deleted.
- Section 10's heap-answer and DontCare-policy bullets are deleted, and
  its DriverFact clauses with them.
- The notice codes no live Degradation names (shader-resolve,
  word-resolve, zeroed-index-fetch, released-command-state,
  surface-texels-tail and the rest) are dropped from sections 1 to 8
  and 10.
- 'the new runtime' reads 'the runtime'.
- Every FAST-PATHS.md link outside AGENTS.md is dropped: API.md, the
  translator's bind, lower and metal docs, a validation mesh case, a
  conformance case and probe. AGENTS.md's three go to the owner as text.

Not built yet; the gate for the whole pass follows.
2026-11-20 10:27:18 -08:00
Anees Iqbal fce83ac2cf Docs: what the runtime does now, where a line named the deleted one
The rename gave metal2vulkan-runtime to the new runtime, so every line
written while the name meant the deleted runtime read as a claim about
the live one. Each was read against the new runtime's code:

- The precision notes no longer say the runtime announces a kind or a
  code of its own (it announces none; the conformance suite maps notes to
  codes), nor what a device Device::new made records (only
  Device::from_queries remains). The notes the runtime carries stay:
  DepthStencilState::precision_note, RenderCommandEncoder::DEPTH_BIAS_NOTE,
  BlitCommandEncoder::GENERATE_MIPMAPS_NOTE,
  RenderPassDescriptor::precision_note, Texture::precision_note.
- An inert kernel's dispatch: the runtime records it like any other.
- API.md: the runtime takes no unit-axes variant, and runs a
  partition-oblivious kernel's every direct dispatch in its tiles (from
  the runtime's pipeline module docs).
- The translator's profile docs: no runtime announces mesh draws, reads
  YCbCr in-place facts, keeps a bind-offset key or runs a view check.
- An aliased-import defect: the runtime has no use_host_ram.
- derive.rs: no runtime reads the allocation limits.
- texel_rows.metal names the test that runs it now (aliased_encoders).
- docs/RUNTIME-PORTING.md is deleted with its README row: 216 of its
  351 runtime items no longer exist, and each runtime item's rustdoc
  names its Metal counterpart.
- CHANGELOG 0.2.0: no fast-path switches, announced codes or
  queue-switch check.

Not built yet; the gate for the whole pass follows.
2026-11-20 10:27:17 -08:00
Anees Iqbal 23d6572c18 Push placement: a post-tessellation vertex function's window starts past the control stage's range
A tessellation render pipeline whose vertex and fragment functions' push fields filled the
floor's 256 bytes was refused at link ("unsupported: Tessellation; needs AnyOf: Limit
MaxPushConstantsSize, required 260, available 256"): link places the synthesized control stage's
push range (8 to 24 bytes) at the first free offset beside the two functions' ranges, and since
the tail placement (0cd2ad765d: each stage's push ends with its tail, 24 bytes above its other
fields) the pair's ranges can end within 8 bytes of 256. Metal makes the pipeline, and the device
lacks nothing.

The form, one on every device: a post-tessellation vertex function's window is [24, 248) instead
of [0, 248), so the control stage's range, at most control::PUSH_BYTES (24) in either form, is
placed at 0, and the fields the pair cannot push spill into their parameter blocks, the form a
function's fields past its window already take. The tail and its 24-byte hole are unchanged. A
fragment function behind such a vertex function that pushes nothing starts at 24 too.

- lower/push.rs: window(Vertex, base) starts at base; TESSELLATION_BASE (= control::PUSH_BYTES);
  base(cx), the start of a function's fields (24 for a post-tessellation vertex function, else
  LoweringInputs::push_base); fragment_base(), the vertex function's push end or its window's
  start, used by CompiledFunction::fragment_push_base, compile::vertex_push_end and link's
  check_push_base.
- select and access place and census the fields from push::base.
- SEMANTICS_VERSION 2204 (a post-tessellation vertex function's and its fragment function's
  placements move).
- Tests: push.rs pins the vertex window from either start, and that the control stage's range in
  every form (bound and address, each factor step, scale on and off) fits below 24 and a
  fragment base behind an empty post-tessellation placement is 24. rt's
  every_device_draws_patches_whose_fragment_fills_the_push_range: a patch state behind fragment
  functions of 4, 8, 12 and 16 buffers is made, pushes the factors' address at 0, and draws its
  patches with every buffer's bits; the widest pair's fields end past 248.
- Docs: API.md section 5, the rt README's push range, PushPlacement::push_range,
  LoweringInputs::push_base, CompiledFunction::fragment_push_base, the tessellation link docs.

The line band's evaluation stage (16 bytes, WideLines) and the fan-out probe's geometry stage (4
bytes, RasterizationRateMap) are still placed by tessellation::push_offset beside the pair's
ranges and refused where those fill the floor: the same shape, not changed here.
2026-11-20 09:30:12 -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 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 51be813915 Translator cutover: the device checks' modules go (bind::view_check, bind::check_draw)
Only the old runtime's device checks ran them: its view check, which measured the two view cost
facts into the description's measured set, and its check of render targets in place over host
pages. The signature table and api_surface drop them; API.md drops the measured set.
2026-11-20 09:08:21 -08:00
Anees Iqbal 77a66a19bf Translator cutover: API.md and the workaround docs name the one profile; unused test items go 2026-11-20 09:08:20 -08:00
Anees Iqbal aaa3213887 Translator cutover: first trial-compile fixes (imports, the half pair, push tests, removed routes) 2026-11-20 09:08:20 -08:00
Anees Iqbal 4730af16e7 rt: a command buffer waiting for a shared event's value is Scheduled as it is submitted
What: the status hold for shared-event waits is deleted:
- hold(), Pending::held and QueueInner::held;
- the completion thread's held list and due();
- EventState::holds and its host-set wake, EventInner::shared;
- the hold_completions test seam, which only the deleted test used.
A command buffer whose wait's signal is submitted is now scheduled as its last segment joins a
submission, its scheduled handlers run then, as for a plain event's wait. A presenting one is
scheduled after vkQueueSubmit2, as for any other. Its queue's later command buffers are no
longer held behind it. Waits on a value that neither the host has set nor a submitted signal
promises stay host-held by the submit thread, as before: every queue submits to one VkQueue,
and a wait submitted ahead of its signal would hold the signal too (vkspec 8432; 6.6, 8985).
Metrics::event_holds counts those.

Why: the hold rested on an M3 recording (event-wait-behind-a-running-signal), not on documented
Metal. MTLCommandBuffer.h:47-48 describes Scheduled as "All dependencies have been resolved and
the command buffer has been scheduled for execution", and :405-406 describes
encodeWaitForEvent:value: as a command that "pauses execution of this command buffer until the
specified event reaches a given value". So execution pauses after scheduling. On the RTX 2080
walk, after the walk's clock correction, the hold lasted p50 5 ms and p90 9 ms per interval, in
command-buffer counts; the 33.6 ms read earlier as the hold was the submit stage, before that
correction.

What the deletion removes, in the walk's terms: a command buffer's kernel start is its commit,
raised to its queue's previous command buffer's scheduling where that is later, and its kernel
end is its scheduling. So a held command buffer's late scheduling also delayed the scheduling
of every later one on its queue. The deletion removes the held command buffers, and that chain
behind each one, from the span before staging. What is left there is the submit thread's own
pace: its passes over other groups, their calls and queue locks.

Scope of the claim:
- It changes nothing about GPU order or when a waiter completes: the wait still goes to the
  driver with its submission, as before.
- It changes when the guest's threads and handlers see Scheduled: a frame loop waiting on
  Scheduled no longer makes one GPU-to-host round trip per link.
- Its effect on presents per second is not known until the walk at the pin.

Docs: CommandBufferStatus::Scheduled, add_scheduled_handler, Device::new_shared_event, the
runtime README's submission and handler paragraphs (quoting both header lines so the hold is not
brought back from a recording), and docs/API.md's accepted differences. The conformance case
event-wait-behind-a-running-signal declares the shared-event row's status and handlers loosened
on the runtime by that entry, and its test checks that a status other than Committed or
Scheduled is still a row.

How verified: the lane's lavapipe gate on this series' tip tree, and the negative job for the
two tests of the commit before (FAIL there, PASS at the tip).
2026-11-20 09:06:48 -08:00
Anees Iqbal 3cdca62567 identity domains: a loaded or converted pointer is the device address it holds, no root table
rt answers MTLArgumentBuffersTier2 and refused the tier's basic buffer member: a kernel reading
two buffers through an argument buffer's pointer members, and one reading a buffer through a
gpuAddress the CPU wrote into a constant buffer, were both "Unsupported{IdentityDomains} (an
encoder value the function reads as RootTableAddress)". A pointer loaded from memory or made
from an integer is a wide pointer, which the resident-table domain resolves by searching the
root table's resident set; the identity domains push no root table, so the gate refused it.

Under the identity domains a pointer is the device address of the byte it names, so a wide
pointer there is (0, a, 0, 0) for address a, the form of a miss of an empty table: a loaded word
or an inttoptr operand is the pointer itself, with no search, a wide buffer parameter is its
slot's address (SlotGuestBase with the bias added back), its Metal address is `at`, and its
accesses are at host + at = a, unchecked and uncounted (a stored address is used as it is; there
is no resident set to miss). Nothing pushes RootTableAddress or ExecutionStatusAddress for it.
An escaping slot root stays static there, as on Profile F, which has no root entries either: a
slot pointer converted to an integer or stored through a static destination is SlotGuestBase
plus its displacement, and the slot's run-time accesses keep their SlotBounds check.

The same gate lifts the texture behind an argument buffer's pointer member (ab_tier2's
ab_indexed) and a kernel that converts a slot pointer to an integer. A slot pointer stored
through a loaded pointer or into an open pointer cell stays refused, as on Profile F
(Unsupported{Lowering(Access)}). Every branch is under the identity domains: the default
domains' modules are unchanged. SEMANTICS_VERSION 2202: these refusals become modules.

Tests: engine_identity_pointers (ab_sum, ab_address, ab_slot_address and ab_indexed on every
committed profile Device::from_queries derives under the identity domains: no RootTableAddress,
no ExecutionStatusAddress and no descriptor, L3, and on the CPU interpreter with buffers above
4 GiB and offset addresses, the words the addresses name, the slot's Metal address and the
increment, and the slot checked against its bounds); rt's argument_tier device tests sum through
two pointer members, read through a CPU-written gpuAddress, answer a converted slot pointer as
its gpuAddress plus its offsets, and read the textures behind a pointer member, each exactly. The
two translator tests and the device test that asserted these refusals go. Run by the lane's
compile gate (fmt, clippy plain, m2v_gpu and m2v_cpu_icd, workspace Rustdoc, the translator's
and rt's suites on lavapipe); job ids in the landing note.

Docs: rt's README says the condition in one sentence (the stored word must be a buffer's
gpu_address plus an offset inside it, and a buffer not placed at the address its guest asked
for has another gpu_address) and drops the three refusal bullets; docs/API.md sections 1 and 5
and PointerDomain::Identity say what the identity domains lower now. docs/REFUSALS.md
regenerates unchanged.
2026-11-20 08:35:00 -08:00
Anees Iqbal 53f3e522e9 API.md: section 9 is the catalogue of the precision notes rt carries
Section 9 was the deleted runtime's notice catalogue: its message sink, announce_each,
lowering_refuses, DegradeNotice, exactness(), degraded_objects and the METAL2VULKAN_LOG_*, DUMP,
QUEUE_TIMES, PENDING_AUDIT and ENCODER_* diagnostics, none of which rt has.

- The intro now states rt's model as its code has it. Each note is fixed per operation (module,
  pixel format, descriptor or state) and given through six accessors: ComputePipelineState and
  RenderPipelineState::precision_notes, Texture, SamplerState, DepthStencilState and
  RenderPassDescriptor::precision_note. Two constants carry notes too:
  BlitCommandEncoder::GENERATE_MIPMAPS_NOTE and RenderCommandEncoder::DEPTH_BIAS_NOTE. A note
  is never fatal, and rt prints and sends none (its non-test sources hold no eprintln, log or
  sink); the consumer reads them.
- The 87 entries whose code a PrecisionNote variant backs stay. Their text no longer names the
  deleted runtime (compressed-texel-decode, bicubic-filter-arithmetic,
  swizzled-opaque-black-border). Their trigger is rt's where the deleted runtime's stood beside
  it (device-filtered-mipmaps, shared-exponent-kept, compressed-texel-decode). They no longer
  say when a deleted runtime announced the note, and they drop the blit, fill and clear parts
  that only that runtime noted (shared-exponent-kept, device-nan-encoding,
  device-color-conversion, device-pack-conversion). Their driver-fact text is left for the
  translator-switch commit.
- The 165 entries no note backs go: 59 performance, 104 precision and 2 validity kinds of the
  deleted runtime.
- Section 8's last paragraph names metal2vulkan_rt::Error, REFUSALS.md and rt's README. The
  guide's opening line and README's row say precision notes.

tests::fast_paths reads the catalogue only for the codes of its ledger notes, all PrecisionNote
codes, which stay. Section 10 still names some deleted codes; that is a follow-up.
2026-11-20 08:01:21 -08:00
Anees Iqbal 430fd25c60 Conformance: carried origins, probes, slugs and the rt ledger name no deleted crate
The old runtime is deleted, so the suite's text stops pointing at it:

- The carried cases' origins (compute_threadgroups, sample_fills, sample_positions,
  texture_buffer_fills, texture_fills, two_plane_copies, handler_waits) state the measurement
  itself, and the 81 recordings that store an origin carry the new strings.
- docs/API.md section 10's four entries that said "the new runtime" say "the runtime"; their
  slugs follow in the cases that name them (buffer_target_clears, pass_sequence_actions,
  event_orders, texture_query) and in the quotes of the lead-ins.
- The probes drop their runtime_lane and metal2vulkan-runtime citations; a probe whose results
  lived only in a deleted lane module names that module and the last commit that held it.
- known-gaps-rt.tsv's reasons drop the comparisons with the old runtime (226 rows) and say
  "a known gap of the runtime". The stage-in rows are as they were.

Prose that describes the suite's own run-kind branch (Unjustified::OldRuntime, the recording's
new_runtime flag) is left with that code.
2026-11-20 07:58:57 -08:00
Anees Iqbal ca5aa90e09 env_vars: the ten variables only the deleted runtime read go
With metal2vulkan-runtime deleted, ten accessors in crates/metal2vulkan/src/env_vars.rs have no
reader: lane_validation, log_pipelines, log_memory, log_shadows, dump_pipelines, log_passes,
pending_audit, queue_times, encoder_trail and encoder_times. A grep of the tree finds no call of
any of them and no other read of their METAL2VULKAN_* names, in metal2vulkan-rt or anywhere else.
They go with their registry rows, so `metal2vulkan --help` lists only the variables something
reads: METAL2VULKAN_REPRO_DIR and the METAL2VULKAN_<TOOL> family.

METAL2VULKAN_REPRO_DIR's row and accessor doc lose the deleted runtime's half (its bundles of
refused creations, and "unset is off (the runtime's)"); the binary's bundles are unchanged, and the
binary is the variable's one reader.

docs/API.md's paragraph describing the ten variables (section 9, under "How a notice reaches you")
goes; the heap-texture refusal line after it no longer begins "Whatever the variables". The rest of
section 9 still describes the deleted runtime and is the docs step's.

The env_vars module is hidden (not in tests/api_surface.rs or api_signatures.tsv);
scripts/api-signatures/signatures.py --check is 0 on this tree.

Verified: the gate of this commit (fmt, clippy x3, workspace doc, the metal2vulkan crate's tests).
2026-11-20 07:24:20 -08:00
Anees Iqbal e639f89d25 rt README, API.md: the known gaps a user reads before the old runtime goes
What each line states, in the section that owns it:
- Known gaps of pipeline states: on RADV a stage's pushed values that the driver reads from its
  own upload can be read past that upload's end (a 12-word load widened to 16), which faults
  where the upload ends the driver's upload buffer and loses a Radeon 780M or RX 7900 XTX.
  Recorded as open: rt places pushed values with no regard to that widening.
- Known gaps of pipeline states: the pipeline cache's cold price per card (RTX 3090 5.8% and
  6.8% slower, Iris Xe 9.8% faster, Radeon 780M level) and its warm effect.
- Known gaps of pipeline states, the identity domains' list: in plain words, a buffer reached
  through a pointer member of an argument buffer or a stored gpuAddress, and a kernel that turns
  a buffer argument's pointer into an integer, each named; the texture behind a pointer member
  named as such.
- Known gaps of render pipeline states: each render content is one whole VkPipeline with no
  shared parts; the heaviest recorded content's cold driver time on two RTX 3090s (1,408 and
  1,335 ms), the dynamic states' share (under 1%), the warm figure, and the render records'
  warm saving on lavapipe.
- Known gaps of render pipeline states: mesh render pipelines have no call in rt and no mesh
  draw; a mesh or object function in a render descriptor's vertex place is the translator's
  refusal.
- Known gaps of queues: a texture or block not shared outside rt, released while an unsent
  upload holds it, keeps its memory until that upload is submitted, and with no later call until
  the device drops.
- Floor: Mesa's driver for Apple GPUs (KosmicKrisp, Mesa 26.3.1) meets the floor on macOS;
  MoltenVK is below it (no nullDescriptor, set 1 refused by its set-layout support query).
- docs/API.md section 5, at PushField::SlotBounds: the bounds check's measured cost (harness GPU
  rows on a 780M, an RTX 3090 and an Iris Xe; replay streams' GPU time a frame; cold pipeline
  makes on two RTX 3090s), and the rt README's check entry points to it.

Why: the old runtime is being deleted; these are the gaps of rt a user meets that the README did
not state, stated as what is true now with the jobs that measured each.

Verified: docs only; the numbers are read from the jobs each line names (the bounds check rows
recomputed from m3-max-56485, -56486, -56546 and -56641). Compile job named in the hand-off.
2026-11-20 05:20:15 -08:00
Anees Iqbal 0cd2ad765d Push placement: on the floor each stage's push ends with its tail, 24 bytes above its other fields
A driver that uploads a stage's push bytes up to the highest one the stage reads, and widens a
push load past its last byte by up to 28 bytes, read past the upload where a stage's last field
ended its push (RADV: 49 compute stages at tip). A read pinned past the fields (R7) cost the
stages a driver holds whole in registers those registers: the pin raised the used-word count past
the driver's limit (RADV keeps all 16 words of the harness's lcg_step in user SGPRs at tip, none
under R7). The tail adds no read where the stage has a field of a tail kind, and moves one.

- lower/push.rs: on PushWindow::Floor, place() lays the longest prefix of the kind order that
  fits with its tail: the highest field of a tail kind (SlotBounds or ZeroAddress, the two kinds
  whose value the consumer never pushes with every bit set) moves HOLE_BYTES (24) above the other
  pushed fields' end; where the pushed fields hold no tail kind, the zero tail word
  (PushField::TailWord at PushPlacement::tail_word) takes that place, with which push_range ends.
  One pushed field of one or two words has no tail. The guaranteed window is packed as before.
- tail(), check_floor(): the structural tail and the floor's bound, which select checks on every
  placement as an invariant error.
- emit: the stage reads its tail in its first block and returns where it holds the value the
  consumer never pushes there (emit_tail_guard): the word non-zero, bounds with both words all
  ones, the zero range's address all ones.
- PushPlacement::tail_word (public, serde default, codec), PushField::TailWord (codec, API
  table); SEMANTICS_VERSION 2201, ARTIFACT_FORMAT_VERSION 556; the old render descriptor key
  re-pinned at 2201.
- Tests: push.rs's floor placements at their tails, the bound's refusals; engine_identity's
  31-slot kernel spills 4 addresses to its block; engine_identity_render's vertex range ends at
  64. Docs: API.md section 5 (the tail and what the consumer pushes), rt README (24 addresses
  below the tail), the profile's window doc.

Verified at 855d973a38 (this change before development's c39f6e8350 and 1de18aa609, which
touch no translator file), m3-max-58299 on msi: the metal2vulkan and metal2vulkan-rt suites
3911 of 3911 passed; the old-path pins (golden hashes over Device::new and the old render key)
pass. Clippy failed there on four indexing lints in push.rs, fixed here with get().
RADV dump (m3-max-58310, Radeon 780M, Mesa 26.2.6): lcg_step keeps the same 16 push words in
user SGPRs with no push pointer, plus a 3-instruction scalar guard; the 18-word kernel keeps its
two loads (+0x20, 32 bytes; the second now at +0x58).
2026-11-20 05:17:29 -08:00