Commit Graph
312 Commits
Author SHA1 Message Date
Anees Iqbal a4cb24f20e Conformance: read-write-srgb-unorm-views' Metal timing, and llvmpipe's two rows
The case's recording now carries native Metal's timing on the M3 Max, macOS 27.0.1 (job
m3-max-70889, conformance times --write; 23 calls), which every case keeps
(times::every_case_is_timed::every_case_carries_its_timing).

The lavapipe replay (job m3-max-70875, llvmpipe LLVM 23.1.1) matches Metal at every site but the
view's read-back on both backings: 438 of the 1024 words one f32 ulp apart (0x33 reads
0x3e4cccce, Metal 0x3e4ccccd). That is the device's own conversion of an 8-bit code
(device-texel-conversion), the same one read-write-tier-held's llvmpipe rows hold, so the ledger
holds the two sites for llvmpipe with that row's words. The swizzle's bytes, by getBytes: and in
the buffer, match Metal exactly there.
2026-11-23 04:33:03 -08:00
Anees Iqbal 684ce1ab7b Conformance: Metal's recording of read-write-srgb-unorm-views
Recorded on the M3 Max, macOS 27.0.1 (build 26A434), job m3-max-70866 on 29dbc6290a: three runs
folded into one outcome, and the API validation layer's run ran. Metal writes the RGBA8Unorm_sRGB
texture through its RGBA8Unorm view on both backings: the swizzle's bytes are the fill's codes in
yxwz order exactly, by getBytes: of the texture and, over the buffer, in the buffer's own bytes
(rows at the texels' pitch of 64 bytes), and the view's read gives each code over 255. Plain and
over a buffer answer alike.

docs/CONFORMANCE-COVERAGE.md regenerated (one more recording and metal_run case; an SDK item
moves from loosened to not loosened).
2026-11-23 04:27:58 -08:00
Anees Iqbal 1080a17fc1 Docs: CONFORMANCE-COVERAGE.md counts MTLDevice.maxThreadgroupMemoryLength
Device::max_threadgroup_memory_length (5a03a60b6c) made maxThreadgroupMemoryLength an
implemented Metal item, and the generated coverage document was not regenerated with it:
implemented items 636 -> 637, reachable 635 -> 636, of the reachable not exercised 77 -> 78
(no conformance case compares the answer against Metal yet).

Verified: coverage.py --check reads "as derived" after the regeneration; it failed at
904700de35 in development's suites (m3-max-70632, conformance 1,028 of 1,029).
2026-11-23 02:41:37 -08:00
Anees Iqbal 0eb982e471 Runtime floor profile, conformance notices and ledger rows for the LOD-clamp variants
The committed runtime-floor profile (and its generator's RUNTIME_FLOOR block) states the
floor's raised sampler limits: 24,000 maxPerStage and maxDescriptorSet
UpdateAfterBindSamplers, 286,144 maxUpdateAfterBindDescriptorsInAllPools.
tests::floor::the_floor_profile_states_exactly_the_floor failed without it on lavapipe
(job m3-max-70138) and on the 780M, Iris Xe and RTX 3090 (m3-max-70152, -70153, -70151).

The two sampler-bind-lod-clamps cases declare pixel-sampler-scaling, the static note of a
sample through a runtime sampler slot, which fired on every venue (same jobs). The kernel
case takes the ledger's dispatch_type row every compute-pass case of the rt side takes.
compute-plural-texture-and-sampler-binding now compares its four-bindings site on
lavapipe, which reads lavapipe's one-ulp 8-bit conversion, as compute-inline-bytes does
over the same texture and kernel: a llvmpipe row. The cards compared it exact.
2026-11-23 00:11:46 -08:00
Anees Iqbal 29e54794ca Runtime: a sampler state bound with LOD clamps of its own samples with them
A bind's LOD clamps (setSamplerState:lodMinClamp:lodMaxClamp:atIndex:, its
vertex and fragment forms and the range forms) that read otherwise than the
state's own were Gap::LodClamps. Metal takes the call; on the M3 Max
(conformance cases sampler-bind-lod-clamps-kernel and -fragment) the pair
replaces the state's clamps, a lower bound above the upper reads at the upper's
level, and a plain bind afterwards reads the state's own clamps again.

How: such a bind takes the state's variant of the pair, the state's descriptor
with the pair as its clamps, its device samplers from the shared sampler table,
placed at a variant element of set 1's sampler arrays. The three sampler arrays
grow from 4,000 to 8,000 elements in the runtime's layout; elements 4,000 to
7,999 are the variants'. Shaders declare the heap arrays unsized, so the
translator is unchanged: a slot's sampler index is the runtime's push, and an
argument buffer's sampler index of 4,000 or more still reads element 0, so no
program-written ID reaches a variant. A state keeps its 16 most recently bound
variants; a new one past them takes the place of the least recently bound one
no command buffer holds, and where work holds all 16 the new one is held by its
command buffer alone. Past 4,000 live variants a bind is
Limit::LodClampVariants { max: 4000 }. The lod_clamp_variants gauge counts the
live variants. A NaN bound, which Metal documents no answer for, binds the
state as it is.

The floor's sampler limits rise to 24,000 (maxPerStage and maxDescriptorSet
UpdateAfterBindSamplers) and 286,144 (maxUpdateAfterBindDescriptorsInAllPools);
the lab's least are 500,000 (MoltenVK on the M3 Max) and 1,048,576 (Intel UHD
Graphics 630 on Windows), and Vulkan requires 500,000 of each with
descriptorIndexing.

Gap::LodClamps goes; REFUSALS.md, basis.rs, the signature table, the Metal and
conformance coverage pages regenerate. The validation replay plays clamped
binds (no skipped_clamped_samplers). The ledger drops three rows the clamped
binds now answer (compute-plural-texture-and-sampler-binding steps 11 and 14,
render-state-unread-slots). The compute single clamp form's coverage row named
set_sampler_state; it names set_sampler_state_with_lod_clamps.

Tests: a kernel samples through the binds as Metal reads them; a state's 16
kept variants filled past that; the 4,000 variant elements filled past their
capacity; the gauge flat across a bind and retire loop and zero at device
drop. Verified: see the lane's report (jobs named there).
2026-11-23 00:11:19 -08:00
Anees Iqbal 3c5485a207 Conformance: compute-imageblock-sizes declares the SIMD-group access note and its dispatchType row
The runtime's pipeline of a4_imageblock_extent records the static simdgroup-access-order
note on every device, which the card replays announced at the notices site (RTX 3090,
Radeon 780M, Iris Xe: m3-max-70084, 70085, 70086); the case declares it, as
compute-threadgroup-memory-reads-zero does for its kernel, and every value still compares
exactly. The encoder's dispatchType is the consumer's own on every venue, the same ledger
row the other compute-pass cases carry. Every byte of the output compared equal to
Metal's on the three cards.
2026-11-23 00:09:51 -08:00
Anees Iqbal 809f791396 Conformance: compute-imageblock-sizes' Metal recording, and the coverage it adds
Recorded on an Apple M3 Max, macOS 27.0.1 (26A434), job m3-max-70065: three runs, one
outcome, the validated leg ran with nothing announced, and the timing kept. Metal's 832
bytes equal the fixture's answer at each extent: the dispatch before the encoder set a
size read 1 by 1 (its cell and the extent 1, 1), then 4 by 2 and 4 by 4, every byte past
each dispatch's words still its guard.

docs/CONFORMANCE-COVERAGE.md regenerated: MTLComputeCommandEncoder's
setImageblockWidth:height: is now an implemented item the Metal leg exercises (29
implemented, 26 exercised).
2026-11-23 00:09:50 -08:00
Anees Iqbal 64be1d50ae Conformance coverage: regenerated for the float depth upload's ledger rows
The ledger has ten fewer rows (18 dropped, 8 added), and one more module (format_copies)
declares a notice. Generated by scripts/conformance-coverage/coverage.py at 72e5c3e571
(m3-max-69942).
2026-11-22 22:40:56 -08:00
Anees Iqbal d11697b000 Conformance: the twelve compute visible-table cases match Metal on the runtime
The replay on lavapipe (m3-max-69685, llvmpipe of Mesa 26.2.4) compares
every visible-tables-compute case exactly with the M3's recordings, so their
known-gaps rows, which recorded the runtime's Slot refusal, are dropped.
The six render-stage cases stay refused as recorded. CONFORMANCE-COVERAGE.md
is regenerated.
2026-11-22 22:11:30 -08:00
Anees Iqbal 28e2b0e6ca Validation: a kernel case's visible-function tables run through the runtime
The runtime candidate makes each table the case binds of the pipeline
state (newVisibleFunctionTableWithDescriptor: of its size, each authored
entry set to the handle of its linked function made with the case's
constants, as the Metal oracle sets it) and binds it at its buffer index.
ToolingRequirement::KernelFunctionTable, which held such cases to Metal
alone, is retired; a render stage's table stays the runtime's limit
(RenderFunctionTable). ENGINE_EXECUTOR_ABI does not move: no recorded row
ran a kernel table case (they were refused).

The runtime README states the device answer, the encoder's bind, the
state's handles and tables, and the known gaps (a table's 64 KiB block, a
consumer-compiled kernel's handles, an argument buffer's table). The
coverage table marks the compute items implemented; METAL-COVERAGE.md and
CONFORMANCE-COVERAGE.md are regenerated. Adds the owned linked module
visible_table_ops.metal, whose companions scripts/regen-air-fixtures
writes on the Mac.

Verified: the lane's jobs.
2026-11-22 22:11:29 -08:00
Anees Iqbal 75c3e49bd6 Conformance coverage: regenerated for the overlapping-copies row's new refusal
docs/CONFORMANCE-COVERAGE.md quotes each ledger row's reason; the row's words moved with its
refusal (python3 -I scripts/conformance-coverage/coverage.py).
2026-11-22 21:06:39 -08:00
Anees Iqbal da020e5d7b Runtime: a compute kernel that reaches an explicit imageblock gets its state; its dispatch is refused
A compute pipeline state whose kernel reaches an explicit imageblock was refused at its make as
Gap::KernelInput of KernelInputKind::RuntimeFact naming ImageblockSize, which every arm64 macOS
guest boot meets once. The state is now made, and what stays refused is the dispatch, where Metal
reads the extent setImageblockWidth:height: set, which the compute encoder does not have:

- interface() takes RuntimeFact::ImageblockSize, keeping its cell bytes as Interface::imageblock,
  and leaves SpecKey::ImageblockWidth and ImageblockHeight at the module's default (0 by 0)
  instead of refusing them as a specialization it does not set.
- encoder::decide, which the dispatch, prepare_dispatch, dispatch_variant and the main pipeline's
  key all go through, refuses a kernel with an imageblock first, as Gap::KernelInput of
  RuntimeFact naming the fact (RuntimeFact::name). So no VkPipeline of such a kernel is made:
  finish_pipeline has no main key, and a pre-pass gets no key. A dispatch of such a kernel that
  writes no memory records nothing and is not refused, as for any kernel without effects.
- imageblock_memory_length_for_dimensions keeps its typed answer, Gap::ImageblockLength, for a
  kernel that declares an imageblock: the one recording of Metal's answer for such a kernel
  (conformance pipeline-facts-compute-imageblock, M3 Max, 256 bytes at 8 by 4 by 3) settles no rule.

The translator is untouched. Gap and KernelInputKind keep their variants; the docs of
Gap::KernelInput, KernelInputKind::RuntimeFact and Specialization, Gap::ImageblockLength (and its
basis line), the dispatch and the state's make say where the refusal now is. docs/REFUSALS.md,
docs/METAL-COVERAGE.md (setImageblockWidth:height:'s note) and docs/CONFORMANCE-COVERAGE.md are
regenerated. The runtime README's state facts and its known gap are re-worded, with the counts and
jobs kept. The conformance ledger's pipeline-facts-compute-imageblock row moves from case/state to
the facts' label and device (the consumer's own, as for every state) and imageblock_memory_length
(Gap::ImageblockLength). Validation's KernelImageblock requirement doc and its acceptance test's doc
name the dispatch's refusal and the renamed device test.

Test: tests::kernel_input::an_explicit_imageblock_kernel_is_made_and_its_dispatch_refused_as_its_named_runtime_fact
(replacing an_explicit_imageblock_kernel_is_refused_as_its_named_runtime_fact) makes a4_imageblock_extent's
state, reads its imageblock length as Gap::ImageblockLength, gets no dispatch_variant key, and has
one 4 by 2 threadgroup's dispatch refused as Gap::KernelInput of RuntimeFact { fact: "ImageblockSize" }.
2026-11-22 20:15:34 -08:00
Anees Iqbal 6adfe028d8 Translator: a half vector joined from read lanes keeps their bits; 20 NaN ledger rows
The RTX 5080 Laptop's replay at 2953064a1c (NVIDIA 615.71.09, job m3-max-68835) read 34 sites of
attribute-format-fetches that known-gaps-rt.tsv does not list.

The 29 at attribute3 (`half2 h`, read as Half or Half2) were ours. The case's inputs there are half
NaNs: attribute_coding.rs's Half codes 0x7E01 and 0xFE01, at threads 9 and 10 in component 0 and 6
and 7 in component 1. Metal's recording returns every attribute3 input unchanged at all 29 leaves.
The 5080 differs at as many elements as there are NaNs (2 at Half, 4 at Half2), first at a NaN
(Metal 0x7e01, ours 0x7fff), and its largest difference, 32258, is 0xFE01 - 0x7FFF. That every
differing element is a NaN is read from the counts, the first element and the largest difference,
not from a full print. The kernel only reinterprets the fetched value (`bitcast <2 x half> to
<2 x i16>`), which the module's own contract keeps as the field's bits (PrecisionNote::
NativeNanEncoding: "a `half` stored back unchanged keeps its bits"), so no note covered it.

The cause: fetch::decode joins the lanes it widened with one OpCompositeConstruct. from_bits noted
each lane's bits, but narrow::known_bits looked through struct members and lane inserts only, so
the bitcast's to_bits found no bits for the vector and encoded it: the device's narrowing of the
device's widening. On NVIDIA a half NaN widens to 0x7fffffff (attribute0's answer on all three
NVIDIA cards) and narrows to 0x7fff. Mesa's widening keeps the payload and its narrowing gives it
back, so the Mesa cards showed nothing; the RTX 3090 and RTX 2080 (620.70.06) showed nothing either
(expected: that compiler folds the round trip; unverified).

The class, at the base: three product sites join half lanes whose bits are noted with a vector
construct and lose them there: the pulled fetch (fetch::decode, for a kernel's [[stage_in]], a
pulled vertex attribute and a post-tessellation attribute), math::unpack_float (air.unpack of the
11/11/10 float formats into half lanes) and chunk::from_words (a chunked bitcast's half lanes), and
one test-only one, the arith tests' own load of a narrow vector. Texture reads, ops::of_lanes_bits
and narrow::unpacked_from_bits widen the whole vector at once and note it; lane inserts were
already followed. So the fix is in known_bits, for the whole class at once:

- spirv::builder records the parts of every OpCompositeConstruct of an f32 vector
  (ModuleBuilder::vector_parts, FunctionBuilder::vector_parts), counted in the builder's
  footprint.
- narrow::constructed_bits: a vector constructed of parts whose bits are each known (noted, a
  constant's, or a lane of a vector's noted bits) has the construct of those bits. Nothing is
  emitted when a part's bits are unknown. known_bits tries it before the lane inserts.
- SEMANTICS_VERSION 2275 -> 2276: the modules of every such vector's store or reinterpretation
  change (the encode becomes the construct of the known bits). The golden table is re-blessed on
  development.
- docs/API.md's native-nan-encoding entry and NativeNanEncoding's doc name the vector join among
  the paths that keep a half's bits.

The other 5 sites (attribute0, the `float4` widening of Half, Half2, Half3, Half4 and FloatRG11B10)
are the device's own answer under device-nan-encoding, as the 3090's rows. The ledger takes each
card's rows from the replays of the round at 2953064a1c, named no wider than the card that ran,
each row's detail equal to what the replay printed and its text the template card's whose answer
it shares:
- RTX 5080 Laptop GPU (job m3-max-68835): every payload bit set (0x7fffffff), as the RTX 3090.
- RTX 2080 (NVIDIA 620.70.06, job m3-max-68939): the same 5 answers as the RTX 3090.
- "AMD Radeon 780M Graphics (RADV PHOENIX)" (Mesa 26.2.6): the PHOENIX run (job m3-max-68941) and
  the HawkPoint run (job m3-max-68942) print that one venue and answer as the RX 7900 XTX:
  0x7fc02000 for the halves, 0x7ffe0000 at 9 RG11B10 elements.
- "AMD Radeon RX 550 / 550 Series (RADV POLARIS12)" (Mesa 26.2.6, job m3-max-68993): the same
  answers as the RX 7900 XTX.
The 2080, 780M and RX 550 runs show no attribute3 site. docs/CONFORMANCE-COVERAGE.md regenerated
(ledger rows 7968 -> 7988).

Tests, each failing at the base's product code and passing with the fix:
- lower::arith::tests::narrow::a_constructed_narrow_vector_keeps_its_lanes_bits (interpreter):
  four decoded lanes, two beside the constants 0 and 1.0, and the harness's loaded vector keep
  0x7E01, 0xFE01, 0x7C01, 0xFDFF and the rest bit for bit, where the encode answers 0x7E00.
- tests::engine_kernel_stage_in::a_half_attribute_reinterpreted_unchanged_encodes_no_half:
  stage_in_fetch with Half2 and Half at attribute 3 holds no OpFConvert to a 16-bit float and no
  PackHalf2x16 on any committed profile, with each half form among them (Controlled, Converted,
  and Device, the profiles without shaderFloat16).

Verified:
- This change on 5f93a64342 (probe 73dead9f70, tree 56642f49), compile job m3-max-69015:
  the two tests against 5f93a64342's product code FAIL, with the fix PASS; fmt,
  signatures, clippy --workspace --all-targets --all-features -D warnings plain, under
  --cfg m2v_gpu and under --cfg m2v_cpu_icd, and workspace Rustdoc -D warnings exit 0; the
  metal2vulkan and metal2vulkan-air suites: 3348 tests passed, 22 skipped, peak 11.3 GiB.
- The tree at 8134bb4201 (on c38852d665; its crates/metal2vulkan/src and
  metal2vulkan-air equal 73dead9f70's), recheck m3-max-68965: against the base's product
  code the engine test reads "30 of 30 modules encode a half": every committed profile with Half2
  and with Half, one OpFConvert to 16 bits each, two PackHalf2x16 each on nvidia-pascal-linux and
  runtime-floor (no shaderFloat16). Compile job m3-max-68956 at 9f921a841c (the same translator
  code): the metal2vulkan and metal2vulkan-air suites 3348 passed, 22 skipped, peak 11.9 GiB.
  golden_hashes_match_the_table passed at SEMANTICS 2276 in both suite runs: 0 cells of those it
  compares on Linux moved, so no "bless due"; the cells that need metal-as are compared at
  development's bless.
- RTX 5080 Laptop GPU (NVIDIA 615.71.09), the conformance replay on rt: at 8134bb4201, job
  m3-max-68961, and at 73dead9f70, job m3-max-69047: exit 0, no unlisted site;
  attribute-format-fetches differs only at its listed rows (the 8-bit unsigned normalized
  formats' 1-ulp rows and the 5 new attribute0 rows), none of the 29 attribute3 sites differs,
  and "the 4607 row(s) above are exactly the open gaps known-gaps-rt.tsv expects on this venue".
- States-only play on lavapipe, 9 streams, every MODE line states-only: 8134bb4201 (job
  m3-max-69001) against c38852d665 (job m3-max-68979). In each stream both made the same render
  and compute states and pipelines (gb-3090-r2: 10643 render, 15299 compute, 568 pipelines;
  glbench-780m-r4-recnil: 3756, 484, 498), refused 0 and left 0 unattempted. 8134bb4201's
  translator code equals 73dead9f70's.
- Not run: the RTX 2080's, the 780M's and the RX 550's rows are as those cards' replays printed at
  2953064a1c; their replays with this change are the next round's. "The RTX 3090 shows nothing at
  attribute3" stays unverified.

The branch is rebased onto development after the jobs; the commits between 5f93a64342 and its
base change runtime files alone (crates/metal2vulkan-runtime), none of this change's.
2026-11-22 15:51:40 -08:00
Anees Iqbal 58e9267b6c Conformance coverage: the ledger rows the three cards' NaN answers added
docs/CONFORMANCE-COVERAGE.md regenerated by scripts/conformance-coverage/coverage.py after
edb361410a added fifteen ledger rows: the ledger count reads 7968 and the gaps table lists the
fifteen. Job m3-max-68716 at edb361410a failed only its coverage check on this document (the
conformance crate ran 1024 tests, and 1023 passed); its replay on lavapipe read 0 ledger drift.
2026-11-22 13:33:00 -08:00
Anees Iqbal f21db0934c Conformance: the stage-in cases' lavapipe answers, and StageInKind's doc no longer opens a list
The first replay of the stage-in cases through the runtime on lavapipe (llvmpipe, Mesa 26.2.4, job
m3-max-68623) compared every row the old refusal had hidden. stage-in-region-clamps was refused at
its one indirect row alone (its 27 other rows Metal's), attribute-format-class-crossings exact, and
twelve sites differed, each now a ledger row or a declaration:

- The three cases over stage_in_fetch_wide declare simdgroup-access-order, as the other cases whose
  kernels store at an index of the grid's width do: the runtime's pipelines note the store's
  SIMD-group access pairs on every device. It loosens the notices site alone.
- attribute-format-fetches, five normalized 8-bit formats, on every venue: the pulled fetch's own
  product of the code and its maximum's reciprocal, which DeviceVertexConversion's recorded bound
  computes one f32 ulp high of Metal's quotient at 126 of the 256 unsigned codes (127 reads
  0x3efeff00 where Metal reads 0x3efefeff).
- attribute-format-fetches, the half and RG11B10 formats, on llvmpipe: the device's widening keeps
  a NaN's payload (0x7fc02000, 0x7ffe0000) where Metal reads 0x7fc00000, under DeviceNanEncoding.
  Each GPU's rows follow from its own replay.

clippy refused StageInKind::IndexedStepRate's doc, whose second line began "1. ", a list item
(doc_lazy_continuation, the same job); it is reworded.
2026-11-22 13:07:16 -08:00
Anees Iqbal a916e61185 Runtime: a kernel's [[stage_in]] is fetched; the three forms not built are Gap::StageIn by kind
A compute pipeline state whose kernel reads [[stage_in]] attributes was refused at its creation as
Gap::KernelInput of KernelInputKind::StageIn, which a guest met (a descriptor-form compute state, the
app's context closed right after). The translator already fetches every attribute in the shader from
the buffer slot at its layout's bufferIndex, through that slot's pushed address, by the stage-in and
dispatch regions the encoder already pushes. Two things stood in the way, both in the runtime:

- interface() refused any kernel whose PipelineInterface::stage_in is non-empty. The line goes.
- The thread-position fetch's reach check reads SpecKey::StageInReach, which the runtime's constant
  loop refused as a specialization it does not set. The runtime now leaves it at the module's default
  (true): one pipeline, the check kept for every dispatch.

What stays refused is a typed refusal naming its own form, Gap::StageIn of a new StageInKind:
- IndirectRegion: setStageInRegionWithIndirectBuffer:indirectBufferOffset:, now the method
  ComputeCommandEncoder::set_stage_in_region_with_indirect_buffer, which always refuses (the
  conformance rt side calls it in place of its own Unavailable);
- DynamicStride: an attribute the kernel reads through a thread-position layout of
  MTLBufferLayoutStrideDynamic (the compute encoder has no attributeStride setter), at the state's
  creation, before the translator's IdentityDomains refusal of StageInStride;
- IndexedStepRate: an attribute it reads through an indexed step at a step rate past 1, at the
  state's creation.
Both creation checks read the descriptor narrowed to the attributes the kernel reads
(kernel_inputs_read), so an attribute it never reads, and a constant step of a dynamic layout,
refuse nothing.

KernelInputKind::StageIn is deleted. Consumer search: `git grep -n 'KernelInputKind'` in the
reims-vgpu checkout at c8201ec2ba: 0 hits (nor any for `StageIn` as a refusal kind).

Tests: the device test every_device_fetches_stage_in_by_each_step_function dispatches
engine/kernel_stage_in's stage_in_fetch under ThreadPositionInGridX at rates 1 and 2,
ThreadPositionInGridXIndexed and Constant, and checks every thread's four attributes (threads past
the region read its last element); without the change the state is Gap::KernelInput.
every_device_refuses_each_unbuilt_stage_in_form_by_its_kind holds the three kinds and the two
states that are made. kernel_input's refusal test of StageIn goes; lowered and the harness's gap
test take Slot. The conformance case stage-in-region-clamps carries on past a refused row (probe,
as attribute_formats does), so its 27 other rows compare where the indirect one is refused. The
ledger drops the 82 rows of the old refusal (stage-in-region-clamps 1, attribute-format-fetches 29,
attribute-format-class-crossings 16, stage-in-unread-attributes 36), takes the indirect row's new
refusal, and the four compute attribute-stride rows' DynamicStride refusal. The validation
requirement KernelStageInput stays: the engine's run through the runtime passes no stage-input
descriptor or region. README, REFUSALS.md, METAL-COVERAGE.md, CONFORMANCE-COVERAGE.md and the
signatures table regenerated.
2026-11-22 13:07:16 -08:00
Anees Iqbal c87452da05 Validation: the device tests the own-context executor ran assert what the runtime route does
The own-context executor's deletion pointed six device tests at the runtime route, and on
lavapipe (m3-max-67674) they failed: the route draws one library's stages with a generated
companion, and the runtime compiles under the identity domains. Each now asserts what the runtime
route does, or goes where the route cannot express it:

- a_loaded_pointers_buffer_written_past_its_end_is_refused_uncontained (was ..._is_guarded):
  under the identity domains a loaded pointer is used as given and no check bounds it
  (docs/API.md, section 1), so the run refuses the target, Uncontained naming LoadedPointer.
- cube_and_cube_array_face_reads_are_refused_under_the_identity_domains (was
  cube_and_cube_array_faces_read_the_authored_layers): the translator refuses texture_ops.ll's
  cube_faces under the identity domains (Unsupported{IdentityDomains}, NotImplemented, for the
  cube argument read by face).
- an_index_past_a_one_layer_pass_renders_the_pass_s_slice: the same slice, with no withheld
  validation message (the runtime route withholds none).
- a_constant_fragment_colors_the_quadrant_metal_draws, a_vertex_varying_reaches_the_fragment_stage
  and a_looping_fragment_draws_as_compiled go, with their helpers: each draws a vertex and a
  fragment function of two owned libraries with no companion, which only the deleted executor
  drew. Metal's y-up quadrant stays asserted by
  an_observed_vertex_case_draws_into_its_generated_observer (QUADRANT, top_right); a pipeline of
  two libraries' stages is compared with Metal by the conformance case shader_stencil. A varying
  across two libraries by its user key, and a looping fragment drawn as compiled, have no
  runtime-route test now.

docs/CONFORMANCE-COVERAGE.md is regenerated (python3 -I scripts/conformance-coverage/coverage.py):
the rate-map modules no longer declare the notice, 44 modules to 41.

Verified: the coverage script's output; the device tests are not yet rerun (the check job follows).
2026-11-22 07:37:15 -08:00
Anees Iqbal 3a59474e2c Docs: CONFORMANCE-COVERAGE.md derives the ordered fetch's 22 every-venue ledger rows
The ordered fetch's deletion (36cc1319c8) replaced 39 venue rows of the conformance ledger with 22
every-venue rows, but left the generated coverage document as it was. The suites job
m3-max-65974 (at 4861c9863d) failed the_conformance_coverage_document_is_what_the_sources_derive
on it. Regenerated with python3 -I scripts/conformance-coverage/coverage.py: the ledger row
count goes from 8041 to 8024, and the padded-blend, extended-range and rotated rows each list once.

Verified: the script's output only; the conformance suite runs on the branch.
2026-11-22 00:17:41 -08:00
Anees Iqbal 5d2c0bda2e Conformance: signed remainders of every width and sign, recorded on the M3
The case signed-remainders runs the owned fixture kernel_signed_remainders: each of 238 threads
reads a 64-bit dividend and divisor (17 dividends by 14 divisors: both signs, the most negative
long and int, low words that are the most negative short and char, values past 32 bits) and
writes eight words: the remainder of the low words as int, short and char, the 64-bit remainder's
two words, the exclusive-or of an int2 remainder's lanes, and the low word's remainders by 3 and
-8. Apple's compiler writes srem i32, i16, i64 and <2 x i32> by run-time divisors and srem i32 by
the constants 3 and 8 (x % -8 is x % 8). A remainder MSL leaves undefined (by zero, or of the
most negative value by -1) is never taken: the fixture writes 0xdeadbeef there. Every column
compares exactly.

It holds every device to Metal's answer where the translator's signed remainder (the commit
before last) replaced OpSRem, which Vulkan makes poison for a negative operand without
maintenance8.

Recorded on the M3 Max, macOS 27.0.1 (job m3-max-64656, which also compiled the fixture's
companions with scripts/regen-air-fixtures under Apple metal 32023.922 and LLVM 21; TOOLCHAIN
records the fixture's line). Metal's 1,904 recorded words equal C's truncating remainder for
every operand pair (checked from the recording against a reference written apart from the
fixture). docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py).
2026-11-21 12:46:21 -08:00
Anees Iqbal eed9ab3b52 Conformance ledger: the Iris Xe's fractional-viewport-coverage row, a driver bug and the accepted difference split by pixel
What: one row of known-gaps-rt.tsv, fractional-viewport-coverage on the Iris Xe at case/drawn/texels
(480 elements differ (F32), the largest difference 12), and docs/CONFORMANCE-COVERAGE.md re-derived
(the ledger's row count and the case's gap list).

Why: the case postdates the last round's replays, so no GPU venue had replayed it, and the next round
holds every GPU venue to the ledger. The Iris site mixes two causes, so the one row splits them by pixel:
- 240 elements, 60 pixels (the far column and row of the arms ending 0.7 into a pixel): each centre lies
  inside the viewport and is undrawn, ANV's truncated scissor far edge (Mesa update_scissors), a driver
  bug, the runtime README's known gap of render encoders; not an accepted difference.
- 240 elements, 60 pixels (the far column and row of the arms ending 0.25 into a pixel and on a pixel
  centre): each centre lies outside the viewport or on its far edge, the accepted difference of
  docs/API.md section 10 (Draws).
The Iris draws every arm's near partial column and row, as Metal does.

How verified: both cases replayed through the runtime on each GPU venue the round replays, with a probe
(never landed) that printed every differing pixel against Metal's recording, built at 8dc5ebbe9f
(development 0b73ac76e5 plus the probe bin), m3-max-64275:
- Iris Xe (ms01) m3-max-64281: fractional divergent as above; lines-fill-past-the-viewport announced
  (equal to Metal under its notice).
- RX 7900 XTX m3-max-64279, 780M HawkPoint m3-max-64280, 780M Phoenix m3-max-64288, RX 550
  m3-max-64323, RTX 3090 m3-max-64286, RTX 2080 m3-max-64287, RTX 5080 m3-max-64282: both cases
  announced, 0 differing pixels; no row.
2026-11-21 10:38:34 -08:00
Anees Iqbal 6da9a2bca2 Fractional viewport coverage is an accepted difference beside a point's
The planner's ruling on Metal's recorded answer (fractional-viewport-coverage, m3-max-64012):
MTLRenderCommandEncoder.h's setViewport: states only that fragments outside the viewport are clipped,
not which a pixel the viewport's edge crosses is; the M3 covers every pixel the viewport overlaps, a
partly held pixel included, and a Vulkan device covers a pixel where its sample lies in the clipped
primitive. Rule 1 does not emulate what Metal leaves unstated, and a static note would be decided by a
viewport's value at the draw, so docs/API.md's Draws list gains the entry beside the point's and the
lavapipe row's reason becomes it. The GPU venues' rows come with the next round's replays.
2026-11-21 09:09:38 -08:00
Anees Iqbal 2470d0f5f4 Conformance ledger: fractional-viewport-coverage on lavapipe, open
Metal on the M3 covers every pixel a viewport overlaps for a draw that reaches past it, a pixel the
viewport holds only part of included; the runtime clips at the Vulkan viewport's own edges and
lavapipe covers only pixels whose centres the clipped primitive holds (344 F32 elements, largest
difference 11.25; replay m3-max-64022 at 44c96aa50c). The row names the open bug, which waits on a
ruling: an accepted difference beside a point's, or a clip band past the viewport with a scissor at
its pixel-rounded rectangle. The coverage document is regenerated.
2026-11-21 09:06:40 -08:00
Anees Iqbal 44c96aa50c conformance: Metal's recordings of fractional-viewport-coverage and lines-fill-past-the-viewport
Recorded on the M3 (macOS 27.0.1) by job m3-max-64012 at d55df02bcf: `conformance record` and
`conformance times --runs 8 --write` for the two cases (record-exit 0, times-exit 0, 2 cases carry
their timing). The coverage document is regenerated.
2026-11-21 09:04:17 -08:00
Anees Iqbal 3051b00b00 conformance: fractional-viewport-coverage and lines-fill-past-the-viewport (unrecorded)
What: one module, cases/viewport_cuts.rs, of two cases. Each is one pass into an RGBA32Float
target cleared to -7.5, every draw its own colour (tob_renders: tob_rect, tob_triangle,
tob_solid), the whole target read back.
- fractional-viewport-coverage: a filled draw over four viewports whose edges lie inside a
  pixel, each in a 12-pixel cell of a 48 by 24 target: far edges .7 into a pixel from an edge on
  a pixel boundary; .3 and .7; .75 and .25 (near and far pixel each a quarter inside, neither
  centre held); both edges on a pixel centre. Each viewport is drawn twice: a rectangle reaching
  to clip 1.25 (inside the 1.5 w band point-viewport-coverage found Metal keeping points in) and
  a triangle reaching to clip 6 (past it).
- lines-fill-past-the-viewport: setTriangleFillMode Lines, three triangles each through an
  integer 8 by 8 viewport in a 16-pixel cell of a 48 by 16 target: one corner inside and two past
  the right and bottom edges, inside the 1.5 w band; the same shape past the band; and a triangle
  the viewport lies wholly inside, every edge more than a pixel outside it.

Why: a fractional viewport's far row or column, whose pixel centre lies inside, is cut on one
Vulkan driver, and a triangle under the Lines fill mode larger than its viewport has no Metal
recording. Both need Metal's own answer before anything is ruled. The M3's next recording batch
records them; until then the replay reports each as "no recording" and nothing is ledgered.

Tests (no device): every viewport lies in its own cell with unreached pixels around it; each
arm's near and far pixel lies against its viewport as its docs say; the geometry reaches past the
viewport inside and past the band; every colour is its own; the line triangles cross or surround
their viewport; every line edge passes at least 1/16 pixel from every pixel centre and diamond
corner of the target. Once recorded, Metal's target is held to what every viewport rule gives
(a pixel held whole is drawn, a pixel not reached is the clear), never to one rule.

docs/CONFORMANCE-COVERAGE.md regenerated (case modules 181).
2026-11-21 08:56:40 -08:00
Anees Iqbal d274b0b474 Conformance ledger: the texture-buffer and held-texture routes of norm-storage-codes on the NVIDIA cards and the Iris Xe
What: 20 rows in known-gaps-rt.tsv, at case/hsw_buffer/texels and case/hsw_held/texels of
norm-storage-codes-{rgba8unorm, rgba8snorm, rgb10a2unorm, rgba16unorm, rgba16snorm}: ten on
NVIDIA, ten on the Iris Xe. Each carries its card's hsw_write row's reason, with one more
sentence:
- the route answers as `hsw_write` does: the same count, the same largest difference, the same
  first differing element;
- the case's pipeline records `device-color-conversion` and `device-nan-encoding` on that card.
docs/CONFORMANCE-COVERAGE.md is regenerated.

Why: texbuf (817463704e onward) builds texture buffers, and the case's `hsw_buffer` route reaches
the device. Its `hsw_held` route answers on the GPU cards too. Their lavapipe rows came with
b7e3247961; the GPU cards' rows did not.
- The bytes are the card's own normalized conversion at a tie (rule 1), the conversion the
  texture route already ledgers:
  - NVIDIA stores the lower code at a unorm tie: Metal 0x1010101, ours 0x0 (rgba8unorm).
  - At an snorm tie NVIDIA stores the code toward zero: Metal 0x81818181, ours 0x82828282.
  - ANV rounds ties to even.
- The RX 7900 XTX (m3-max-63842) and the 780M (63840) answer Metal's bytes on all four routes.
- The store lowering is the texture's own (lower/texture/mod.rs, `ImageDim::Buffer` included):
  it calls `norm_storage_facts`, which records `DeviceColorConversion` for a slot whose storage
  choice is a normalized format of the identity class, or that has none.

Verified: the compile job and the replays on the 3090 and the Iris Xe, named with the sha.
2026-11-21 08:19:35 -08:00
Anees Iqbal c1b0a6d5e2 Conformance ledger: the GPU cards' rows of the pixel-sampler, downscale and vertex-format cases, each with its reason
What: 696 rows in known-gaps-rt.tsv, one per surprise the tip's replays printed:
- NVIDIA: 227 rows (m3-max-63788, RTX 3090). The round at ce998742d7 printed the same rows on the
  2080 and the 5080.
- RX 7900 XTX and 780M: 102 rows each. The two replays (m3-max-63791, 63789) printed the same
  rows, and so did the round's HawkPoint, which the 780M venue also names.
- RX 550: 112 rows (m3-max-63806).
- Iris Xe: 153 rows (m3-max-63801).
These were replayed at 5cd74cc440, the red-3 tip before its rebase onto 583684ebeb. The rows
cover:
- pixel-downscales-* (all seven sizes), pixel-samplers-* and pixel-samplers-subnormal-*:
  - The device's sampler and filter (rule 1), under `device-sampling`, `pixel-sampler-scaling`
    and, for the subnormal coordinates, `device-denormals`.
  - Each row states how our sources' digests split against Metal's, and the measured bound at
    each coordinate set (NVIDIA's `frac` within 1.19/255; RADV's, the RX 550's and the Iris
    Xe's within 0.95/255).
- vertex-format-* and integer-vertex-attributes, each with its first differing element:
  - A NaN in the device's encoding: `device-nan-encoding`, on every card.
  - NVIDIA's compiler folding the `half` round trip: `native-half-conversion`.
  - On the RX 550, which has no `shaderFloat16` (RADV enables it on GFX8 only by drirc),
    `OpQuantizeToF16`: `native-half-quantize`.
    - Four rows (MTLVertexFormatFloat to Float4, the largest difference 0) differ only in a
      zero's sign. Their reasons cite the note's zero-sign sentence.
    - The other 13 rows flush a value below the smallest normal `half` to zero, the note's
      first clause.
- indirect-range-* on the Iris Xe (3 rows, cases from 2614118ccf): the device does not list
  `VK_EXT_device_generated_commands`, so the execution is refused typed
  (`IndirectCommandsKind::Extension`), a known gap in the runtime's README.

docs/CONFORMANCE-COVERAGE.md is regenerated (scripts/conformance-coverage/coverage.py; --check
passes).

Why: red 1 of the round at ce998742d7. Its GPU replays failed on rows no card had. Each row
here gives that card's true reason, which every row's evidence (digests, the first differing
element, the largest difference) supports. No row was copied from another venue's wording
without its own card's evidence.

Verified: the compile job and the replays on each affected card, named with the sha.
2026-11-21 08:08:15 -08:00
Anees Iqbal 1fbe4eacdb Conformance ledger: the GPU rows of the fetch and stencil-export cases go; those cards lack the feature
What: 91 refused rows leave known-gaps-rt.tsv: the NVIDIA, 780M, RX 7900 XTX and
Iris(R) Xe rows of the 17 padded-blend-* cases, xr-masked-bgr10xr-{red,blue-green,
srgb-red,srgb-blue-green} and argb8-targets-destination-alpha's refusal at
case/pipeline/argb8, and the NVIDIA rows of stencil-output, stencil-output-loaded and
pass-sequence-aspect-actions. The llvmpipe and UHD Graphics 630 rows stay. The fetch
block's comment says which devices read lacks-feature. docs/CONFORMANCE-COVERAGE.md
regenerated (scripts/conformance-coverage/coverage.py).

Why: round ce998742d7's eight GPU replays (m3-max-63423, 63431, 63464, 63447, 63444,
63446, 63468, 63453) read each of these 141 case-card-site triples as "no longer
refuses ... the ledger still lists it": every one of those cases reads lacks-feature
on those cards (NVIDIA 24 of 27 such cases, the others 21). Since 7e8b93d953 the
translator's refusal names RasterizationOrderColorAttachmentAccess alone for the
computed write over a fetch's read, and ExtShaderStencilExport alone for a stencil
output, and none of these devices reports either, so the case cannot run there. A
lacks-feature reading is never a ledger row. a0f86a2efc had reworded these GPU rows
after the lavapipe replay alone (where the feature is reported and the refusal
stands), so no GPU replay saw them since. These are not fixes: the cards still cannot
run the cases. The UHD 630 rows are left: no replay on it read them.
2026-11-21 08:02:12 -08:00
Anees Iqbal b7e3247961 Conformance: the known-gaps ledger's texture-buffer rows after the runtime makes texture buffers
From the lavapipe replay of d7f0a88fd9 (job m3-max-63634 on msi: 298
lines of ledger drift, 132 rows no longer held and 166 gaps unlisted):

- dropped the 132 rows of 'texture buffers are not built' and of the
  translator's IdentityDomains refusal of a texture buffer slot, which no
  longer hold on lavapipe: read-through-buffer,
  buffer-textures-cpu-access and norm-storage-fields-rgb10a2unorm now
  compare equal;
- 98 rows (every venue): Device::new_texture and the heap size of a
  texture buffer's descriptor are Refusal::TextureBufferNotOverBuffer,
  the consumer's contract;
- buffer-textures-made: the made texture buffers' cpuCacheMode,
  hazardTrackingMode and allowGPUOptimizedContents are the consumer's, as
  the 2D rows are (every venue, but offsets 4, 8 and 20, which are
  scoped to llvmpipe, NVIDIA, Intel and RADV, and are
  Refusal::TextureBufferAlignment of 16 bytes on Apple M3 Max, whose
  KosmicKrisp states no single-texel alignment); offset 33 is
  TextureBufferAlignment of 4 bytes (16 on Apple M3 Max); and a texture
  buffer over a Managed buffer states Shared where Metal answers Managed
  on a device of one copy (llvmpipe, 780M, Intel, Apple M3 Max), as a
  2D texture over one does;
- buffer-tails-texture-buffer: texels past the buffer are
  Refusal::BufferTextureLayout;
- norm-storage-codes-*: hsw_buffer and hsw_held diverge on llvmpipe as
  hsw_write does (the device's conversion);
- texel-swizzles-*: a swizzled texture buffer is Gap::TextureBufferSwizzle,
  a view of one Gap::TextureView, and llvmpipe's unorm8 read is one ulp
  high (the device's conversion);
- texture-buffer-fill-*: this side answers no fillTexture yet.

The llvmpipe rows are verified by that replay. The rows of other venues
are expected from each venue's texel-buffer offset alignments and device
type in its vulkaninfo, not run; the replay matrix holds them.

docs/CONFORMANCE-COVERAGE.md regenerated after the ledger
(scripts/conformance-coverage/coverage.py).

Verified: the lavapipe replay's drift lines, classified by
~/.cache scratch; the conformance suite and replay follow in the next
job.
2026-11-21 07:27:48 -08:00
Anees Iqbal 8f797a923d Conformance: the texture-buffer rows' comments name the runtime's refusals; the coverage document after the texture-buffer alignment query
The runtime makes texture buffers now (c2a8f4527c), so the comments that
named Gap::TextureBuffer say what it answers at those sites: the stride
row's texture buffer (bytesPerRow below its width's bytes) and the
tails case's (texels past its buffer) are Refusal::BufferTextureLayout,
as a 2D texture's are.

docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/
coverage.py): minimumTextureBufferAlignmentForPixelFormat: is implemented
and no case exercises it yet (reachable not exercised 76 -> 77), and
textureBufferDescriptorWithPixelFormat:...'s note is coverage.tsv's
generic one.

The known-gaps ledger's texture-buffer rows follow from the lavapipe
replay in a later commit.

Verified: rustfmt; the generator's output.
2026-11-21 07:45:35 -08:00
Anees Iqbal 2614118ccf conformance: the three GPU-range rows' Metal recordings; Watching forwards encoded_range; the coverage document
What: recordings/indirect-range-gpu-written-at-zero.json, -past-zero.json and
indirect-range-written-by-an-earlier-draw.json, recorded on the M3 Max (macOS 27.0.1, 26A434), three
runs each folding into one outcome, the validated leg run clean. Metal draws commands 0 to 2, 5 and
6, and 2 to 5: each execution reads the range the GPU wrote, the third after the earlier draw's
write behind the in-pass barrier. watch::Watching forwards encoded_range. docs/CONFORMANCE-COVERAGE.md
regenerated (python3 -I scripts/conformance-coverage/coverage.py): 180 case modules, 1322
recordings, executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: and the indirect command
buffer's gpuResourceID now exercised.

Why: job m3-max-63598 on f2d20e177e failed the conformance tests on the missing recordings, the
wrapper's forwarding (the_announcing_side_forwards_every_call) and the coverage document.

Verified: recording job m3-max-63599 on f2d20e177e. The timings and the lavapipe replay follow.
2026-11-21 07:14:27 -08:00
Anees Iqbal 02320ca135 rt: the visibility family's test allows a Boolean word's count; as_chunks in the word reader; the coverage document after the ledger's rows
What: the conformance visibility family's table test asserted that no case loosens a word, which
the accepted difference "a Boolean visibility result is the count of samples that passed" now
does for each Boolean offset. It is renamed every_case_is_tabled_and_loosens_only_a_boolean_word
and asserts that every allowance is Loosening::Nonzero under that accepted difference, at an
offset some pass of the case sets Boolean: a Counting word, or any other loosening, still fails
it. The runtime's visibility test reads its words with as_chunks::<8>, which the dated nightly's
clippy asks for in place of chunks_exact(8). docs/CONFORMANCE-COVERAGE.md is regenerated
(python3 -I scripts/conformance-coverage/coverage.py) after the ledger rows the last commit
rewrote: 19 old VisibilityResults rows out, 9 refusal rows in.

Why: check job m3-max-63470 on 3f5c41675b failed these three: clippy under --cfg m2v_gpu and
--cfg m2v_cpu_icd (clippy::chunks_exact_to_as_chunks at tests/visibility.rs:67), the conformance
coverage check, and the visibility table test.

Verified: by the next check job on this commit (named in the lane's report).
2026-11-21 06:37:13 -08:00
Anees Iqbal b5ac9fd07b rt: visibility results, one precise occlusion query per mode, copied into the buffer at the pass's end
What: `setVisibilityResultMode:offset:` builds `Boolean` and `Counting`. Each such mode set is one
segment counted by one precise occlusion query (`VK_QUERY_CONTROL_PRECISE_BIT`), begun in the
pass's rendering before the segment's first draw and ended there at the next mode set or the
encoder's end; a segment with no draw begins and ends its query as it ends, so its word is 0.
After `vkCmdEndRendering` the pass copies the counts (`vkCmdCopyQueryPoolResults`, 64-bit, WAIT)
straight into the visibility result buffer's `VkBuffer` at place+offset, one copy for each run of
consecutive offsets in one pool, before the pass's second barrier (recorded or owed), which orders
them before every later command; a Shared buffer's segment end barrier reaches the host, and a
Managed buffer's write and a texture over the buffer in an image of its own are kept as a blit's
write is. `Boolean` writes the count too, nonzero exactly where a sample passed (Metal documents a
nonzero word; the M3 Max writes 1): an accepted difference in docs/API.md section 10, and the
conformance cases compare a `Boolean` word as nonzero alone.

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

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

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

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

Verified: cargo fmt; scripts/api-signatures --bless/--check, refusal_surface (0 without reach or
basis), metal-coverage and conformance-coverage regenerated, check_device_profiles (0 findings).
The compile job (fmt, signatures, clippy plain / --cfg m2v_gpu / --cfg m2v_cpu_icd, workspace
Rustdoc -D warnings) and the lavapipe rt suite, with tests/visibility.rs (Boolean and Counting
against the CPU's counts, pool reuse and the 16-pool bound past 17, Metal's refusals, Accumulate,
the barrier and attachment-read interrupts), are named in the lane's report.
2026-11-21 06:16:57 -08:00
Anees Iqbal 7c1baad228 rt: overlapping regions of one texture copy in slabs, as from the source before the copy
copy_from_texture refused a copy whose regions overlap in one level and slice of one image (a
texture into itself, or a texture and its view) as Gap::TextureCopy, and the program's copy was
skipped. Metal does not refuse the call; it leaves the result undefined, and an Apple M3 Max gives
each destination texel what the source held before the copy (the conformance crate's
buffer_texture_blits case, which recorded it).

No vkCmdCopyImage may read a texel it writes (VUID-vkCmdCopyImage-pRegions-00124), so
texture_copy now cuts such a copy into slabs along one shifted axis, the one of fewest slabs. Each
slab is no thicker than the shift there, so its two regions lie apart, and the slab at the end the
shift points to goes first, so no slab reads a texel an earlier one wrote: the result is memmove's.
Each slab is one vkCmdCopyImage in the general layout, with an execution barrier (COPY to COPY)
between two slabs, every hazard between slabs being a write after a read. Each extra barrier is
counted. Regions apart remain one slab and one command, and the same region still records nothing.
A shift of 20 texels over a 21-texel row is 2 commands; the worst case, a shift of one texel, is one
command per texel of the region's extent on that axis. No scratch image, no cap.

Gap::TextureCopy keeps its other arms (a multisample texture, depth and stencil both, one pixel
format in two Vulkan formats, 1D with another type); its doc, the rt README's blit section and
docs/REFUSALS.md (regenerated) drop the overlapping arm. The conformance ledger's row for
buffer-texture-blits-overlapping goes, since the rt side now answers that case, and
docs/CONFORMANCE-COVERAGE.md is regenerated.

Tests: overlapping_regions_copy_in_slabs_the_far_end_of_the_shift_first checks the slabs' regions
and order (a 21x1 row shifted by 20, a shift toward lower y, a diagonal shift on the axis of fewer
slabs, regions apart as one slab); the 3D/array host test now expects slabs where it expected the
gap. On a device, every_device_copies_overlapping_regions_from_the_source_before_the_copy copies
toward higher and toward lower x and y, from a view into its texture, along a 3D texture's depth,
and by whole BC1 blocks where the device makes them. Each case expects the source's bytes from
before the copy, one submission, 2 + slabs barriers and no byte copied of the runtime's own.
2026-11-21 06:24:22 -08:00
Anees Iqbal c44e588007 Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

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

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-21 02:32:53 -08:00
Anees Iqbal 4961ea6f71 validation: the opened chains blessed for multiViewport and shaderOutputViewportIndex in the floor; conformance coverage regenerated
The viewports' piece (99e5d42deb) puts multiViewport and shaderOutputViewportIndex in the
runtime floor. Blessed on the rebased tree: the runtime floor's device and restricted chains
gain both, now 48 and 56 members (bless_opened_chains, job m3-max-62390, msi-laptop, at
d6c110338d: 1 passed). docs/CONFORMANCE-COVERAGE.md regenerated
(scripts/conformance-coverage/coverage.py; render-state-boxes leaves the ledger), which that
job's the_conformance_coverage_document_is_what_the_sources_derive asked for.

The same job at d6c110338d: fmt, clippy (plain, m2v_gpu, m2v_cpu_icd), Rustdoc, the runtime's
lavapipe device tests and the lavapipe conformance replay (rc 0, the ledger exact) passed. Its
other test failures are development's own at 43f7439dc9 (m3-max-62312): the old render
descriptor key, the engine golden printout, golden_hashes and the llvm_as parts.
2026-11-21 01:00:18 -08:00
Anees Iqbal 3e1069db45 Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-21 00:33:20 -08:00
Anees Iqbal 28f2560c9f conformance: the half attribute rows are lavapipe's own answer under native-half-conversion
3860bf04fc wrote 47 rows of integer-vertex-attributes (int_attribute_to_half4, 16 rows) and
vertex-format-half4 (31) as an open bug, because the value lavapipe hands a `half`-typed
attribute is unrounded where Metal rounds it to nearest even, and whether our module or the
device was at fault was unsettled. The module carries the rounding: job m3-max-62280 (msi, at
d42388b6c9) compiled int_attribute_to_half4 with the command line for the tree's lavapipe
profile (shaderFloat16, no shaderDenormPreserveFloat16, so QuantizeForm::Converted), attribute 0
a Short4. Per vertex the attribute's load is followed by `OpFConvert %v4half` and
`OpFConvert %v4float`; with Metal's constant step each pulled lane takes the same pair (8
OpFConvert), with no NoContraction and no float controls. lavapipe's compiler folds the pair, as
narrow::converted records for it and NVIDIA's, which is the stated bound of
`native-half-conversion`: a value not rounded at all. The rows now say so, in the existing
rule-1 form, each keeping its first differing bits.

docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py).
2026-11-21 00:22:30 -08:00
Anees Iqbal 876268aa36 docs: conformance coverage counts rotated_targets among the modules declaring a notice
Regenerated (scripts/conformance-coverage/coverage.py) after bc7d76530f, whose cases declare
rotated-blend-rounding: modules declaring a notice, loosening no value, 43 -> 44.
2026-11-21 00:24:53 -08:00
Anees Iqbal 758b601cbd rt: cube arrays' opened chains and conformance ledger
The follow-ups of 7cd1103a44, from its suite at 216038a939 (an earlier form of it), m3-max-61809
on gem10:

- opened_chains.txt: the four runtime-floor contexts gain imageCubeArray (members 44, 42, 52 and
  49), from the suite's bless_opened_chains run. Neither runtime-floor.json nor the chains changed
  on development between the two bases.
- known-gaps-rt.tsv: the 87 rows of `cube array textures are not built` (every venue) are gone;
  lavapipe's conformance run held none of them. Where a case's cube-array site now reaches the
  next gap, its row is that gap's: 44 rows, each with the venue and the waiting text of the
  case's same answer at its other texture types. heap-sizes-formats-without-textures (16),
  heap-sizes-unspecialized (12) and heap-sizes-two-plane-cubes (4) name formats no device makes;
  texture-pairs-plain-contents (6) names the consumer's descriptor fields;
  format-footprints-plain-stragglers (1) reaches its texture-buffer step; read-write-tier-
  descriptors' ASTC_4x4_sRGB cube array is made on no venue its other ASTC rows name (780M,
  NVIDIA, RX 550, RX 7900 XTX, llvmpipe; verified on llvmpipe, expected elsewhere). Its
  promised-and-refused row lists the tier's texture buffers alone.
  CONFORMANCE-COVERAGE.md regenerated (7644 ledger rows).
- The validation executor's runtime_texture doc: a cube array stays on the executor's own
  context, no longer a refusal of the runtime's.
2026-11-21 00:19:40 -08:00
Anees Iqbal a5fac6fa9b rt: the depth clip mode Clamp and the triangle fill mode Lines, as pipelines of the draw's class made at first use
setDepthClipMode: and setTriangleFillMode: refused every value but Metal's defaults
(DrawKind::DepthClamp, DrawKind::FillMode). Vulkan 1.3 bakes both in
VkPipelineRasterizationStateCreateInfo, and only VK_EXT_extended_dynamic_state3 makes them
dynamic. The floor cannot require that extension: the UHD 630's Windows driver lists no EDS3, and
KosmicKrisp reports extendedDynamicState3PolygonMode false. So both are now first-use pipeline
variants, the accepted form. The encoder keeps a Raster (clamp, lines) and each draw takes
RenderCompiled::pipeline(topology, raster). The content keeps its primary VkPipeline (the triangle
or patch class at the default state) and a bounded list of the others, by class list topology and
raster state: at most 7 (three more states of the triangle or patch class, two of each other
class). The line and point classes take the clip mode alone, since Metal and Vulkan apply the fill
mode to triangles only. A triangle's edges under Lines chain Bresenham's rule, as the line class
does ("the effective rasterization input topology is in the line topology class"). The first draw
under a state makes its pipeline and waits for it: a first-use wait of a new site,
FirstUse::Raster (Metrics::first_use_raster_waits, _nanos, _max_nanos). The line and point
classes' first draws at the default state count where they did.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Test: every_device_refuses_a_draw_after_a_declared_write_of_a_texture_with_no_storage_element
(storage_element.rs, device cfgs): an owned fragment function writes an argument buffer's
texture2d<float, write>; for RGBA8Unorm, RGBA8Unorm_sRGB, BGRA8Unorm_sRGB, A8Unorm and an sRGB
view of an RGBA8Unorm texture, a draw before the declaration draws, the same draw after
use_resource(WRITE) is Gap::StorageElement { slot: None, pixel_format } exactly where the texture
has no storage element, and a colored_fragment draw after the declaration draws; the fragment
function's write through its resource ID lands (1, 0, 1, 1). Without the Facts::find check the
refused cases draw and the test panics.
2026-11-20 22:08:11 -08:00
Anees Iqbal a529fb658e rt: the floor's depthBiasClamp has its missing-feature case, and the runtime-floor profile states it
The floor requires depthBiasClamp (the first commit of this change). The runtime's
each_missing_feature_is_named gains its case, as its count of cases is held to REQUIRED's. The
regeneration's RUNTIME_FLOOR and runtime-floor.json's m2v_runtime_floor block state it, in the
generator's order (the block the runtime's the_floor_profile_states_exactly_the_floor holds equal
to floor.rs; check_device_profiles: 0 findings over 17 profiles; the JSON line is written as the
regeneration writes it, without refetching its pinned sources). CONFORMANCE-COVERAGE is
regenerated for the ledger row render-state-depth-bias left (7688 rows to 7687).

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

Verified: suite m3-max-61635 at 406f39dc90 (msi; the workspace suite and the lavapipe device
tests) failed exactly these three, each_missing_feature_is_named (52 cases against 53),
the_floor_profile_states_exactly_the_floor (depthBiasClamp) and the coverage document; the rerun
follows.
2026-11-20 21:33:04 -08:00
Anees Iqbal 4e3a6a3555 rt: layered rendering in one form, the vertex function storing Layer in every pass
`RenderPassDescriptor::render_target_array_length` is Metal's `renderTargetArrayLength`. A pass
of length N of 2 or more is one rendering of `layerCount` N: every attachment and resolve texture
is a view of its level and N slices from its own `slice` (a 2D array view; a cube's faces are its
slices), and the rendering's load, store and resolve cover every layer, with no per-layer loop.
At 0 and 1 the pass renders the attachment's slice alone, as Metal's does.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Verified (potluck; the jobs ran this diff on development 846f7c1428, and this commit is the same
diff on 62c563f564, whose eight commits since touch none of its lines but SEMANTICS_VERSION and
the API.md paragraph's neighbours):
- m3-max-61334 (msi, at the WIP tree e55576964b, this commit's code and test before its ledger row
  and docs): cargo fmt --check, clippy with all features, with --cfg m2v_gpu and with --cfg
  m2v_cpu_icd, and Rustdoc -D warnings pass; nextest of metal2vulkan and metal2vulkan-conformance
  4363 run, 4362 passed, the one failure the old render descriptor key above; the
  metal2vulkan-conformance suite under --cfg m2v_cpu_icd on lavapipe 1015 passed.
- m3-max-61335 (um790, at e55576964b): conformance replay --cpu swizzled-storage-atomics on
  lavapipe makes the pipeline and is refused at case/RRRR/dispatch (Gap::SwizzledReadWrite).
- m3-max-61438 (msi, llvmpipe LLVM 23.1.1, at the WIP tree ad62594111, this diff but the coverage
  document): conformance replay --cpu of swizzled-storage-atomics and the 13 read-through cases
  against the committed Metal answers: 14 refused, "exactly the open gaps known-gaps-rt.tsv
  expects", exit 0.
- scripts/conformance-coverage/coverage.py and scripts/refusal-surface/refusal_surface.py run at
  this tree (the coverage document's one changed row is in this commit).
- The next commit's states-only play over the 36 recorded streams runs this commit's code too.
2026-11-20 20:25:23 -08:00
Anees Iqbal 0aa20c8bbf Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 19:33:55 -08:00