Commit Graph
8489 Commits
Author SHA1 Message Date
Anees Iqbal 9027bd2aa3 rt: count scheduled-to-start under earlier GPU spans, GPU-end-to-handler steps and calibrations
The clean 5080 re-play's print needs three things the stage sums alone cannot give.

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

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

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

The replay backend reports all of these as executed counters.

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

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

Tests:
- host tests for the ring's merged, clipped union and its oldest-first replacement;
- a host test for the round's steps adding up to the span;
- the device stage test now checks that the six steps add up to gpu_end_to_handler_nanos, that
  the behind part is at most scheduled_to_gpu_start_nanos, and that the device start
  calibrated;
- the replay stage test checks the same through the report's keys.
2026-11-20 20:09:37 -08:00
Anees Iqbal c8bd7123b7 Fix forward of 83049f641a: the runtime's sources and version, and SEMANTICS one above development
83049f641a changed two of the validation crate's runtime inputs (lower/fragment/stencil.rs and
bind/graphics.rs), and a run's behaviour with them: the runtime executor now builds a raster
order group on memory the function reads and writes on lavapipe, where it refused it. So
RUNTIME_VERSION moves to 2549, one above development's 2548, and runtime-sources.sha256 takes
the value the_runtime_sources_are_the_committed_ones says to write (the assertion's right side)
for this tree, on development b1b5168fd6. cache/mod.rs is not among those inputs. SEMANTICS_VERSION
moves from 2231 to 2232, one above development's.

Verified: m3-max-61428 ran the_runtime_sources_are_the_committed_ones at this tree with the
pre-rebase hash and printed 651bab6492bb... as the value to write. The change's own evidence
(lint m3-max-61307, tests 61309, device tests on lavapipe, conformance on lavapipe with 0 ledger
mismatches, Metal comparison 61313, states-only play 61315 at 0 refused over 36 streams) is at
its pre-rebase base 5990e29e22.
2026-11-20 20:06:06 -08:00
Anees Iqbal 83049f641a rt: the pixel interlock orders a raster order group on the memory the function reads and writes
Device creation enables VK_EXT_fragment_shader_interlock where the device lists it, and its
fragmentShaderPixelInterlock where the device reports it (floor's PIXEL_INTERLOCK, one of the
optional extensions; the sample interlock and the shading-rate interlock stay off). The
translator's profile then has the feature, and a fragment function's raster order group on a
buffer, a texture or an argument buffer's member it reads and writes compiles to its one form,
the body inside PixelInterlockOrderedEXT. A device without the feature keeps the typed refusal
(RasterOrderGroups, naming FragmentShaderPixelInterlock). Of the venues probed, KosmicKrisp on the
M3 Max and RADV on the RX 550 list neither the extension nor the feature (vulkaninfo, jobs
m3-max-61291 and m3-max-61296); every other venue reports it, the UHD 630's Windows driver
included (m3-max-61292).

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

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

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

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

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

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

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

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

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

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 19:33:55 -08:00
Anees Iqbal 43038e5d06 fixtures: coverage_natural's header names the one form it is translated in
The header's first seven lines still described the per-device form the
translator no longer has: a function compiled as written on a driver that
runs a memory writer once per covered sample (MoltenVK on Apple's GPU), and
a loop over the covered samples elsewhere. Today a memory-writing function
runs as the device runs it, on every device, and its module records
PrecisionNote::DeviceFragmentRuns, because documented Metal names no count of
runs for it (lower/fragment/coverage.rs). The header now says that.

A comment alone: the companions stay as committed. A regen of the fixture on
the M3 (scripts/regen-air-fixtures, m3-max-61246) gives the same module with
only the toolchain stamps moved: the "SDK Version" flag 27.0 -> 27.2 and the
compiler identity 32023.921 -> 32023.922, the host's newer Metal. Taking those
would move the fixture's AIR identity, which its corpus case (shard_058) and
the golden and inventory rows are keyed on, for no change of the program. So
no hash or inventory row follows.
2026-11-20 19:33:15 -08:00
Anees Iqbal bb9a63810b rt: a draw fills its functions' bicubic word, as a dispatch does
A render state whose vertex or fragment function samples a 2D texture slot
through a bicubic constexpr sampler was refused at creation
(Gap::RenderPipeline, DrawInput): render::draws had no arm for the
translator's PushField::BicubicTexels, and fill_push wrote nothing for it.
A dispatch fills the same field for a kernel's slot.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 19:30:54 -08:00
Anees Iqbal c5e472fffe Fix forward of 81ced9a1cb: the RX 550's rows of the extended-range refusals
81ced9a1cb made a fetch or blend that needs Metal's tile half of an extended-range attachment a
typed refusal on every device, and gave known-gaps-rt.tsv its rows for six venues, but not for
the RX 550. Round 999b82bfe2's RX 550 conformance replay (m3-max-61027, RADV POLARIS12) found
44 refusals the ledger does not list: 18 xr-blend, 18 xr-gamut, 4 xr-gradient and 4 xr-masked
cases, each NotImplemented(Format) at a colour attachment, the same refusal the other venues'
rows hold.

Each new row copies the replay's own case, outcome, site and answer, with venue RX 550, and
takes the "waiting on" text of the other venues' rows of the same case, site and answer.

Verified: the RX 550 conformance replay at 4ac20efa41 (m3-max-61269, gem10, RADV POLARIS12):
rc=0, 0 refusals the ledger does not list, the 4780 rows exactly what known-gaps-rt.tsv expects on
that venue.
2026-11-20 19:30:21 -08:00
Anees Iqbal f46749a784 Bless the golden table, the compile census and the render key at 9b1026e61b (SEMANTICS 2230)
The named pin's bless.

- Golden: the rows of the new public fixture depth_fill (golden_hashes.tsv, the engine
  expectations and its air_input printout). No other cell changed since the last bless,
  2d7a498cef at SEMANTICS 2226, so no output moved under an unchanged key.
- Compile census: 8 rows. The product hash and the executor (vulkan-engine-v191), and the 7
  cases whose depth lies outside [0, 1], now not_supported depth_outside_unit_range, the
  runtime's limit (1687f8fc38).
- The render descriptor key test moves with SEMANTICS 2230: its hex is
  9d25b09f1093abd5ad14571ccbbc90344d519c9408f90e4e03155f540eeb9ba2.

Verified at 9b1026e61b:
- M3 bless m3-max-61262;
- census m3-max-61263;
- quick check m3-max-61260: clippy plain, m2v_gpu and m2v_cpu_icd, Rustdoc, rt on lavapipe
  505/505;
- suites m3-max-61261: validation 1372/1372, conformance 1014/1014, doctests; the product
  suite's 5 failures are the five this commit clears;
- the key's value m3-max-61306.
2026-11-20 19:28:49 -08:00
Anees Iqbal 9b1026e61b Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 19:08:44 -08:00
Anees Iqbal 642d9b0fae rt: quad control is enabled where the device reports it
A fragment function whose group operations read, combine or count other lanes
has one form in the translator: its quads run whole under RequireFullQuadsKHR,
helpers included, as Metal runs them. rt enabled shaderQuadControl on no
device, so every such function was refused at creation (SubgroupOperations).

floor: VK_KHR_shader_quad_control joins OPTIONAL_EXTENSIONS (enabled where
listed), its feature structure joins Features (read and chained only where
listed), and a new list QUAD_CONTROL holds shaderQuadControl, copied from what
the device reports, as the step rates are, and handed to the translator's
profile through shader_enables. No answer chooses a second form: a device
without the feature keeps the translator's typed refusal. Device creation
(and the floor test's copy of it) chains the structure where the extension is
enabled.

The pixel interlock is not enabled here: raster order groups stay refused on
every device (the runtime README, known gaps of render pipeline states).

Conformance: discard-quad-sum-placement now runs where the feature is. It
declares the pixel-sampler-scaling notice, which every sample through a
runtime sampler slot records under the identity domains, and its refusal row
is scoped to the two venues whose device lacks the feature: KosmicKrisp on the
Apple M3 Max (vulkaninfo, m3-max-61179) and the UHD Graphics 630's Windows
driver 101.2145 (m3-max-61190). The other venues list the extension and
report the feature (RADV on the 780M, RX 550 and RX 7900 XTX, ANV on the Iris
Xe, NVIDIA on the RTX 2080 and both 3090s, lavapipe: m3-max-61172..61175; the
RTX 5080 from its committed profile).

Tests: floor's host test quad_control_is_enabled_where_reported (listed alone
gives the extension and no feature; listed and reported gives both, in the
capabilities and in the translator's enables), the README table of the
quad-control feature, and the device test quad_control.rs: gsm2_quad_ops's
fragment_quad_bitwise drawn by a triangle whose edge cuts the diagonal quads,
each covered pixel reading its quad's AND, OR and XOR of all four words,
helpers included, or the state refused naming SubgroupOperations where the
feature is not enabled.

Verified: the quad test on lavapipe at the earlier tree of this change with
the interlock (m3-max-61149: "36 pixels read their quads whole, helpers
included"); this tree's lint m3-max-61203 (fmt, clippy plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd, Rustdoc: all 0) and tests m3-max-61204 (rt host 150/150 with validation's
chain and signature tests; rt on lavapipe 506/506, printing "quad_control: llvmpipe: shaderQuadControl
enabled; 36 pixels read their quads whole, helpers included"; the conformance replay on lavapipe, 0
ledger mismatches).
2026-11-20 19:08:12 -08:00
Anees Iqbal 39504ce00c Fix forward of e63c0e6e3d: the depth fill's depth-stencil descriptor is set field by field
Gate m3-max-61124 (at the pre-rebase 6fc1a6c89a) failed to compile metal2vulkan-validation: E0639
at runtime_depth.rs, a struct expression of the translator's DepthStencilDescriptor, which is
non-exhaustive. The fill now takes the default descriptor and sets its compare function to
Always and its depth write on.
2026-11-20 19:06:55 -08:00
Anees Iqbal 1687f8fc38 Validation: a 32-bit float depth texture is filled by a draw through the runtime, and a depth outside [0, 1] is the runtime's limit
The runtime takes no upload of a 32-bit float depth (Gap::FloatDepthUpload, which its own texture
and blit tests hold both ways). Kernel and render cases that bind a Depth32Float texture stayed
on the executor's own context. Now they run through the runtime: the run fills each such texture
by a draw, as a guest fills one.

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

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

ENGINE_EXECUTOR_ABI goes to v191.

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

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

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

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

Consumer check: no public item is added or removed.

Verified: m3-max-61154 (msi) at this commit's tree: fmt, clippy (plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan, -conformance, -validation and
-runtime, 5880 of 5881 passed, the new identity test among them; the one failure is
the_old_render_descriptor_key_keeps_its_value, which moves with SEMANTICS_VERSION and waits for the
next named pin. Only the refusal's text changes, so no play.
2026-11-20 18:57:42 -08:00
Anees Iqbal 8bafe7240d Absent reads mark nothing: the absent-read mark, its fact, status bit and report field go
Since 0b94d919d9 an absent read (an argument its pipeline's function constants removed) yields
zero and writes no status on every profile: absent::require answered false everywhere, so no
AbsentRead or texture AbsentArgument marked, nothing inserted RuntimeFact::AbsentArgumentRead, and
no shader set StatusBits::ABSENT_ARGUMENT_READ. The dead mark code goes.

Removed:
- AbsentRead::marks and its words() branch (an absent read emits no words), absent::require and
  absent::mark;
- texture::AbsentArgument::marks, its words arm and its emit arm; AbsentArgument::select no
  longer takes the decoded texture call, which only the mark read;
- RuntimeFact::AbsentArgumentRead (its codec row, its name and its mechanism row);
- StatusBits::ABSENT_ARGUMENT_READ and StatusReport::absent_argument_read. Bit 2 of the status
  word is left unused; the other bits keep their values;
- validation's report_verdict check of the field and absent_argument_refusal, which only it
  called.
absent.rs's module doc now says what the module's status code serves: a sequentially consistent
fence and an argument buffer's cubic sampler's mark. Error's doc of the absent read and
StatusBinding::Required's doc lose the mark.

Tests: the mechanism table drops the fact (UnitAxes takes its slot 57; range 0..101). The status
decode test uses the cubic bit where it used the absent one; status_bits_are_distinct no longer
asserts that the bits fill the low ones. The absent-read engine tests (engine_absent_handles,
engine_absent_threadgroup, engine_function_constant_interface, engine_gated_texture_slots) keep
their ExecutionStatus, status-reach and validation checks and drop the fact's; the validation
candidate's status test drops the absent-bit case.

ARTIFACT_FORMAT_VERSION 574 (placeholder; main renumbers): the codec loses the RuntimeFact
variant. No SEMANTICS bump: no module, refusal or fact any compile produced changes. No RUNTIME
bump: the decode drops a bit nothing sets; the runtime pin moves for bind/status.rs alone.
api_signatures is blessed; docs/REFUSALS.md is unchanged.

Consumer check (consumer-uses.sh, consumer development 415d453172, 58 refs): 0 hits (code) for
ABSENT_ARGUMENT_READ and absent_argument_read. AbsentArgumentRead: 0 on development; used in
crates/reims-vgpu-vulkan/src/answer.rs on 36 of the consumer's steelbrain/* branches, a crate its
development no longer has.

Verified: m3-max-61153 (um790) at this commit's tree: fmt, clippy (plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd) and Rustdoc green. m3-max-61154 (msi) at the seq_cst commit above it, whose
tree holds this one's: nextest of metal2vulkan, -conformance, -validation and -runtime, 5880 of
5881 passed; the one failure is the_old_render_descriptor_key_keeps_its_value, which moves with
SEMANTICS_VERSION and waits for the next named pin. No state needs anything new, so no play.
2026-11-20 18:57:28 -08:00
Anees Iqbal 5e53367e46 Texture family: the heap plan's never-set plain class goes
HeapPlan::compares_plain lost its only setter in 78ed264c90, together with the shader-side
comparison emulation, so HeapPlan::plain has been None ever since, under both domains. Four things
read it, and all four go:
- the finish step's assignment (lower/texture/slot.rs);
- texture::declare's loop over the plain classes (lower/texture/mod.rs);
- heap_element's plain flag (lower/texture/emit.rs) and its five callers' tuple argument;
- identity_refusal's "an argument buffer's depth texture both compared and sampled without
  comparison", which could never fire (lower/select.rs).

A plain sample of a compared heap depth texture reads the group's own depth-comparison class, as it
already did. The previous commit's test doc gives the SPIR-V and Vulkan text that allows it.

No behaviour change and no SEMANTICS bump: every removed read saw None or false.

Verified, at tree-equal WIP f11f7f3a21: compile gate m3-max-61159 (homelab-um870-1). The focused
tests passed 5/5; fmt, clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, and workspace Rustdoc
were clean. The lavapipe suites of metal2vulkan and metal2vulkan-runtime: 3848 passed, 1 failed.
The failure is the_old_render_descriptor_key_keeps_its_value, which follows SEMANTICS (2229, set
in the previous commit). golden_hashes_match_the_table passed, so the default domains' output is
unchanged.
2026-11-20 18:54:11 -08:00
Anees Iqbal 71a88c47a9 Identity domains: an argument buffer's texture sampled through a slot or constexpr sampler
Under the identity domains, a sample, gather or comparison of a texture that an argument buffer
holds was refused as "a sample, gather or comparison of an argument buffer's texture". It now reads
the texture as the element of its class's set-1 array at the index its resource ID holds, masked to
16 bits as a read's is. It reads the sampler as the element of the set-1 sampler array of its use
(plain, compare or integer), at one of two indices:
- for a runtime sampler slot, the index its pushed resource ID holds;
- for a constexpr sampler, the index the consumer pushes for it (PushField::ConstexprSampler).
These are the same arrays a texture slot's sampling reads. No heap sampler binding is declared and
nothing goes in set 0. sampler::finish records each heap sampler use in SamplerPlan::heap_identity
instead of a binding, and the slot path's array read moves into emit::identity_sampler.

A depth texture both compared and sampled without comparison reads both through its
depth-comparison class (OpTypeImage Depth 1), as under the default domains:
- SPIR-V's OpTypeImage leaves the comparison to the opcode.
- Vulkan's "Instruction/Format/Sampler/Image View Validation" makes an instruction that is not
  OpImage*Dref* poison only through a sampler whose compareEnable is set.
The admitted test's doc quotes both. The unreachable refusal of that form goes in the next commit.

Still refused under the identity domains:
- constexpr samplers a lane chooses among, where they are one array of samplers;
- an argument buffer's own sampler;
- a half-result sample of an argument buffer's colour texture on a device that samples through
  Metal's own sampler (VkProperty::MetalSampler). No device's derivation states that property, so
  the form stays refused.

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

Tests:
- engine_identity's an_argument_buffer_textures_sample_takes_its_sampler_from_the_identity_arrays
  replaces the refused-form test. It covers 8 kernels: engine/handles' five heap samplings,
  examples/heap_samples' hs_sample, and a generated depth comparison, alone and beside a plain
  sample. On every profile it checks L3, the pushed sampler fields, set 0 empty, set 1 the identity
  layout, and the set-1 bindings each kernel uses.
- engine_identity's an_argument_buffer_textures_sample_in_a_form_not_lowered_is_refused_naming_it
  keeps the array-of-samplers refusal.
- metal2vulkan-runtime tests::argument_sampling (lavapipe, m2v_cpu_icd): hs_sample samples an
  RGBA16Float and an RGBA32Float member through a constexpr sampler and a slot sampler, and every
  texel is checked.

Docs: the runtime README's floor and known gaps. docs/REFUSALS.md regenerated, no change.

Verified, at tree-equal WIP 6865cebfe6 on dc21cd66c7:
- compile gate m3-max-61140 (msi-laptop): the focused tests 5/5; fmt; clippy plain, --cfg m2v_gpu
  and --cfg m2v_cpu_icd clean; workspace Rustdoc clean. The lavapipe suites of metal2vulkan and
  metal2vulkan-runtime: 3848 passed, 1 failed. The failure is
  the_old_render_descriptor_key_keeps_its_value, which follows SEMANTICS and is re-pinned only at
  a named pin.
- family C public proof m3-max-61141 (lavapipe, release, base dc21cd66c7, 14 cases): 7 match
  before and 10 after, 0 mismatch. 905e99d0, a07a906e and b22f795b go from not_supported to match;
  nothing that matched before is lost.
- family C private proof m3-max-61150 (6 cases): 6/6 match before and after.
- states-only play on lavapipe over 36 distinct streams on five nodes (m3-max-61102, 61104,
  61105, 61106, 61138): 291,334 render and 51,029 compute states made, 0 refused. The player was
  built from the same translator change on 8529ecbd09.
2026-11-20 18:54:11 -08:00
Anees Iqbal 1b8011afa7 Fix forward of 8f09074c1d: a draw's color attachments take granted texture indices
The gate failed three of the commit's own tests, m3-max-61063 on lavapipe:
- a_fragment_case_draws_through_its_generated_passthrough_vertex
- an_observed_vertex_case_draws_into_its_generated_observer
- a_rasterization_disabled_vertex_draw_stores_through_its_buffer

Each failed in its runtime arm. The runtime refused every color attachment's make: "a colour
render target takes an index, and none was given". The E/F proof's after arm failed 42 public
and 172 private cases the same way (m3-max-61072, m3-max-61073).

Each attachment, the rasterization-disabled draw's sink included, is now made at an index of a
texture grant the run holds, after the stages' textures. runtime_textures::texture_indices grants
the next indices for both. A rasterization-disabled draw's only attachment is the sink: a case of
that draw authors no color target (RasterizationDisabledRenderTarget).
2026-11-20 18:29:46 -08:00
Anees Iqbal 8528603a73 Validation: a vertex or fragment case of one sample draws through the runtime
A render case of one sample now draws through metal2vulkan-runtime's public API on Linux, in the
stated leg and with no profile restriction, as a consumer draws it. That covers its own stage's
buffers, bound textures and samplers, function constants and linked functions, and its generated
companion. It also covers vertex buffers at static strides, Shared 2D color targets loaded and
stored by the pass, the oracle's depth-stencil state, cull mode and winding, and one direct or
indexed draw of primitives. The case observes a buffer, a texture, a color target or nothing. A
rasterization-disabled vertex case renders into the oracle's 1x1 R8Unorm attachment, which its
pipeline declares at index 0, as the oracle's does.

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

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

Tests:
- a unit test pins the routing both ways;
- three device tests (the passthrough fragment, the observed vertex at its varying and its
  position, and the rasterization-disabled vertex store) run the runtime arm on Linux against
  the same expected bytes.
2026-11-20 18:29:45 -08:00
Anees Iqbal 9700d21d26 Validation: the runtime probe's fragment-depth step goes
corpus-vulkan --probe-runtime's depth_source step measured whether a fragment shader's
FragCoord.z, clamped to the viewport's range, is the depth the device's own test stores, per case
of bias, clamp and depth range, at one sample and per sample. That was evidence for the variant
that ran a draw's depth test in the fragment shader against a stand-in of the depth attachment,
and for its DriverDeviation rows CenterFragCoordDepth and SampleFragCoordDepth. Both went with the
depth stand-ins (a8d448f4ce). Nothing else reads the step: no test reads its report key, and no
profile or fact is derived from it. The step goes with its report field and doc bullet.
input_fetch, the only other user of the module's helpers, now holds them: `enabled`, the Owned
methods it calls (bound_image, view, render_pass, framebuffer, module, plain_layout, sets,
graphics_pipeline) and the device_type and range functions those read.

Verified: m3-max-61133 (um790) at this commit's tree: fmt, clippy (plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd) and Rustdoc of metal2vulkan-validation green, and its runtime_probe tests, 10
of 10 passed. No translator, planner or runtime source changes, so no version bump and no play.
2026-11-20 18:26:06 -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 3b1f2a3744 rt: the dispatch key's builder is Compiled::dispatch_key
Fix forward of 740c4fe626: Compiled already has a variant(which) that
answers a lowered variant, so the key builder the stamp added under the
same name clashed (E0592) and no build compiled. It is
Compiled::dispatch_key now; its callers in pipeline.rs and encoder.rs
follow. No behaviour change.
2026-11-20 18:18:11 -08:00
Anees Iqbal 95df5bed16 rt: dispatch_variant answers whether the key's pipeline is made
A consumer's pre-pass hands at most a fixed number of new shapes per
command buffer to its compile pool, and counts every shape new to its
memo against that cap, made or not. A pipeline the state's make already
made (a tile, a square workgroup, a required size, now a declared
bound's row) took a cap slot from a shape that needed a make.

ComputePipelineState::dispatch_variant now answers
Option<(DispatchVariant, bool)>: the key, and whether its VkPipeline is
made, from the one call, so the dispatch's decision runs once.
- The answer is read from the kernel's first eight variant cells with no
  lock, and past them under the kernel list's short lock, which no make
  holds while the driver compiles (Kernel::is_made).
- It may answer false for a key whose make ends after the read. It never
  answers true for one not made.
- It allocates nothing.

Consumer search, consumer-uses.sh dispatch_variant (consumer development
415d453172): USED, so the consumer adapts at the pin:
- crates/reims-vgpu-vulkan/src/core/platform.rs:135
- crates/reims-vgpu-vulkan/src/core/platform/resource.rs:564, 581
- crates/reims-vgpu-vulkan/src/core/testkit/impls/resource.rs:720, 727
- crates/reims-vgpu-vulkan/src/core/testkit/objects.rs:987, 992, 1002,
  1126
- crates/reims-vgpu-vulkan/src/rt_platform/pipeline.rs:46, 565, 569, 577,
  893, 917
- crates/reims-vgpu/src/graphics/decode/prepass.rs:23, 421

Test (device cfg): every_device_answers_whether_a_dispatch_s_pipeline_is_made.
Ten threadgroup sizes of one kernel each answer false before
prepare_dispatch and true after, with the same key, past the eight
cells too. All ten answer true once made, for a second state of the
content as well. The callers in rt's tests take the key alone.

The runtime README's dispatch_variant paragraph and the rustdoc say it.
api_signatures.tsv is blessed.
2026-11-20 18:17:39 -08:00
Anees Iqbal d4f171aa99 rt: a state that declares a bound of threads makes its [N, 1, 1] grids' pipelines
An observing kernel's VkPipelines at a size only a dispatch gives were
made at the first dispatch, a first-use wait. A state that declares a
bound of threads names a size of its own: its maxTotalThreadsPerThreadgroup
as one row. In a states-only count of a recorded stream, 20 of the 56
compute states with pipelines left to the dispatch ran only that size,
as a whole and a ragged dispatchThreads grid: 38 of the 108 pipelines
not made at the make.

The state's make now makes, with the lines that do it for
requiredThreadsPerThreadgroup, the whole and ragged grids' pipelines at
[N, 1, 1], where:
- the descriptor sets no requiredThreadsPerThreadgroup;
- the state declares a bound, through the descriptor's
  maxTotalThreadsPerThreadgroup or the kernel's
  [[max_total_threads_per_threadgroup(n)]]. Only a declared bound brings
  Metal's answer (metal_max_total_threads_per_threadgroup) below its
  1024, so the device's own limit is never taken for one;
- N is the state's own maxTotalThreadsPerThreadgroup answer;
- the module takes no threadgroup memory length from the encoder (the
  same skip as before).
One rule, one shape. A kernel whose bound is Metal's own 1024 is not
told apart from none; the runtime README says so.

What a dispatch records and submits is unchanged (the same pipelines,
made earlier), and this is metal2vulkan-runtime alone, outside the
translator's runtime guard: no RUNTIME_VERSION bump.

Tests (device cfg), each failing without the change:
- every_device_makes_a_declared_bound_s_grids_with_the_state: the
  attribute's kernel makes 2 pipelines with its state, its first 128 x 1
  and 100 x 1 grids in 64 x 1 count 0 pipelines and 0 first-use waits,
  and the same kernel without the attribute makes none with its state;
- the row-barrier test gains a descriptor-declared bound of 64, with the
  same checks.

pipeline.rs's module doc, new_compute_pipeline_state's doc and the
runtime README's sentence on what a make makes say it.
2026-11-20 18:16:04 -08:00
Anees Iqbal 740c4fe626 rt: each variant make is kept with its key and who started it
A walk could not name a first-use wait: Metrics counts the waits and the
makes ahead, but a make of a kernel's VkPipeline carried no key and no
starter, so a trace could not tell which state's dispatch waited, or
whether its make was already in flight.

Counters::variant_makes(from) now answers the last 256 makes to end on
the device (a fixed bound, the oldest leaving first), each a VariantMake:
- the DispatchVariant its dispatches answer, the key a consumer's
  pre-pass memo holds;
- who started it (VariantStart): the state's creation, a
  prepare_dispatch call, or a dispatch's first use;
- when it began and ended, in host_time;
- whether it made the pipeline;
- the first-use waits that waited for it, and when the earliest began.
  A wait on a make another thread started found that make in flight.

How: a pending make's entry in the kernel's list is now a Making, which
holds its key and its waits. A dispatch that finds the entry pending
counts its wait there, under the lock it already holds. The Pending
guard keeps the record when the make ends, before it wakes the waiters.
Every make goes through make_pending, and the state's tile or square
pipeline now does too. Kernel::pipeline and make_ahead take the
DispatchVariant (Compiled::variant builds it, and dispatch_variant
answers through it), so one key names a make everywhere.

Tests:
- the_counters_keep_the_last_variant_makes_past_their_bound fills the
  record 44 past its bound;
- every_device_keeps_each_variant_make_with_its_key_and_who_started_it
  (device cfg) checks the state's, prepare_dispatch's and a first use's
  records against dispatch_variant's keys and the first-use wait counts.

The runtime README and pipeline.rs's module doc state it, and
api_signatures.tsv is blessed.
2026-11-20 18:12:11 -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 8529ecbd09 Fix forward of d1e52ab533: the old render key at SEMANTICS 2226
The index passes' deletion bumped SEMANTICS_VERSION to 2226, which the render descriptor key
hashes through each stage's function compile key. The pinned value moves from 45541a82c360366c...
(2225) to f87e49bf8df8c601... (2226), as m3-max-61014 printed at 2d7a498cef. cutxlate's check
m3-max-60971 printed the same value at its pre-rebase base.

Verified: the left value of the_old_render_descriptor_key_keeps_its_value in m3-max-61014;
golden_hashes_match_the_table passed in the same job.
2026-11-20 17:49:02 -08:00
Anees Iqbal 317780f9cb Fix forward of 34e0516ed3: a needless borrow, and the argument-buffer sampler's runtime refusal
The compile gate m3-max-60978 at 34e0516ed3 failed:
- clippy: needless_borrow at owner_bytes(&kernel.buffers, ..), since kernel.buffers is already a
  reference.
- One test: an_argument_buffer_sampler_samples_its_member_texture panicked in its runtime run.
  The runtime's make refuses argument_sampler_sample as Unsupported{IdentityDomains}: "an encoder
  value the function reads as ExecutionStatusAddress". The family's public proof (m3-max-60982)
  shows the same refusal for the four argument_sampler_* kernels.
  The test now holds the executor's own context to Metal's texels and the runtime's run to that
  typed refusal. It flips when the translator supplies the value under identity domains.

Verified: in the lane's report (the compile gate of the rebased stack).
2026-11-20 17:44:53 -08:00
Anees Iqbal 5b653bc1d4 Validation: a kernel case's argument buffers of buffers, textures and samplers run through the runtime
What: runs_through_runtime now routes a kernel case whose argument buffers hold buffers, textures
the runtime makes (`runtime_texture`) or samplers, observing a buffer, a texture, an
argument-buffer buffer or texture, or nothing. A pipeline state, a command buffer or a
rasterization-rate map in an argument buffer still keeps the case on the executor's own context.

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

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

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

Verified: in the lane's report (the compile gate and the family's proof, its 20 committed cases
on lavapipe against committed Metal, before and after).
2026-11-20 17:44:53 -08:00
Anees Iqbal 2d7a498cef Bless the golden table and the compile census at 999b82bfe2 (SEMANTICS 2226)
The index passes' deletion (d1e52ab533) moves the status bits above bit 2 down one, which
changes emitted words. 46 golden hash cells move. The engine inventory and the printouts are
unchanged. The authored compile census is re-blessed at SEMANTICS 2226: 10 rows in, 9 out.

Verified: M3 bless job m3-max-61002 (inventory=0 golden=0 printouts=0) and census job
m3-max-61003 (census-exit=0), both at 999b82bfe2.
2026-11-20 17:44:03 -08:00
Anees Iqbal 999b82bfe2 player: a pipeline state's making counts what it made, lowered, loaded and VkPipelines, and a load makes its content new
What: each group and each slow making carries "L lowered, D loaded, P VkPipelines"
(translations, translations_loaded, pipelines_created). A making is of "new" content where it
made any of them, and "held" where it made none.

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

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

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

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

Verified: replay::rt_replay::each_pipeline_state_s_making_is_split_into_the_translator_s_and_the_driver_s_time
on lavapipe (m3-max-60980, with fmt, clippy plain, m2v_gpu and m2v_cpu_icd, and workspace
Rustdoc green). Without the line it fails at the summary-line find. On a real card: the cold and
warm states-only plays of one recorded stream on an RTX 3090 (m3-max-60954).
2026-11-20 17:38:00 -08:00
Anees Iqbal d1e52ab533 Index passes go: no runtime path records the GPU index bounds pass or the index rewrite pass
The runtime records neither pass. It names no item of bind::index_bounds or bind::index_rewrite,
and it reads neither DrawCommands nor ExecutionStatus's bits. The consumer names none of them
either (consumer check below). Both passes, their modules and their runs are deleted with what
only they used.

Removed:
- bind/index_bounds.rs with index_bounds/{run.rs, tests.rs, run/tests.rs}: IndexBoundsPass,
  IndexBoundsPlanModule, IndexBoundsFillModule, IndexBoundsRun, BoundsRunDraw,
  index_bounds_plan_module, index_bounds_fill_module, index_bounds_plan_run_module,
  index_bounds_fill_run_module.
- bind/index_rewrite.rs with index_rewrite/{run.rs, tests.rs, run/tests.rs}: IndexRewritePass,
  IndexRewriteModule, IndexRewriteRun, RewriteRunDraw, RewriteOrder, RewriteOutput, RewritePhase,
  RewriteProgram, RewriteSource, index_rewrite_module, index_rewrite_run_module.
- DrawCommands::index_bounds_pass: it only said the bounds pass may stand in for the CPU read
  of an indexed indirect draw's arguments. indirect_needs_arguments is unchanged and still asks
  for that read.
- DrawReplayRule::IndexBounds: its condition implied ArgumentsOnCpu's, which comes first in the
  rule list, so it never decided a refusal.
- StatusBits::INDEX_POOL_OVERFLOW and StatusReport::index_pool_overflow: only the bounds pass's
  plan set the bit. The bits stay the low ones with no gap: ABSENT_ARGUMENT_READ 3 -> 2,
  CUBIC_ARGUMENT_SAMPLER 4 -> 3, MESH_GRID_PAST_LIMITS 5 -> 4, MESH_GRID_DISCARDED 6 -> 5.
- The bind module doc's paragraph on both passes, graphics.rs's sentence on the bounds pass,
  BindState::quad_primitive_ids' reference to RewriteProgram, and a conformance comment
  (primitive_type_crossings) that named the bounds pass.

Tests: the passes' own tests go with them, and owned_divisions no longer builds their modules.
graphics::tests keeps its checks of indirect_needs_arguments. status's decode test checks
ABSENT_ARGUMENT_READ where it used the removed bit. api_surface loses the 20 rows, and
api_signatures is regenerated. docs/REFUSALS.md regenerates unchanged.

SEMANTICS_VERSION 2226 (placeholder; main renumbers): the absent-argument and cubic-sampler marks,
and mesh_arguments' grid bits, set new bit values, so modules' words change. RUNTIME_VERSION 2546
(placeholder): status decoding reads the new bits. ARTIFACT_FORMAT_VERSION stays: no encoded type
changes. The runtime pin moves. The old render key test moves with SEMANTICS and is re-pinned
from the check's printed key in the commit after this one.

Consumer check (consumer-uses.sh, consumer development b955213d27, 66 refs): 0 hits (code) for
index_bounds_fill_module, index_bounds_fill_run_module, index_bounds_plan_module,
index_bounds_plan_run_module, BoundsRunDraw, IndexBoundsFillModule, IndexBoundsPass,
IndexBoundsPlanModule, IndexBoundsRun, index_rewrite_module, index_rewrite_run_module,
IndexRewriteModule, IndexRewritePass, IndexRewriteRun, RewriteOrder, RewriteOutput, RewritePhase,
RewriteProgram, RewriteRunDraw, RewriteSource, index_bounds_pass, INDEX_POOL_OVERFLOW,
index_pool_overflow, DrawReplayRule. DrawCommands: 0 hits (code), in link-order lists only.

Verified: nothing yet (a check job is owed).
2026-11-20 17:36:03 -08:00
Anees Iqbal 9e18568c14 Validation: the memory-writer coverage cases at 2 and 4 samples compare no run count
What: the authored cases over nat_coverage (2x, 4x) and nat_coverage_at_pixel (4x) compared
their whole 32-word buffer. That buffer includes the run count (word 1) and the runs per
coverage read (words 2 to 17). Since 3ba18a4b19, a memory-writing fragment runs as the device
runs it, noted PrecisionNote::DeviceFragmentRuns. So a Linux device counts fewer runs than
Metal, a standing mismatch that only a note explains.

Each case now selects only the words that do not depend on the run count:
- nat_coverage at 2x and 4x: word 0, the OR of the coverages read.
- nat_coverage_at_pixel at 4x: word 18, the position each run reads, in its own case. Word 0,
  the coverage OR, becomes a new case (coverage-beside-the-pixel-center-ored-over-its-runs-at-4x),
  since a case selects one range.
No 1-sample rows of these entries exist.

The new cases were installed with corpus-case-check, which removed the old cases' rows. Each was
qualified on Metal in apple-m3-max-macos27.0.1 (m3-max-60951): 0x3 at 2x, 0xf at 4x, 0x202 for
the pixel center and 0xf for the coverage beside it. c3-reviewed.json's clipped-primitive-split
answer gaps name the new case ids, since the cases still meet the gap's structure; the test
the_cases_that_meet_the_clipped_primitive_split_are_listed holds the list equal to them. The
authored compile census rows are re-blessed on development.

Verified: the Metal qualification above; the validation suite in the lane's gate.
2026-11-20 17:33:49 -08:00
Anees Iqbal 47d782f3a5 Fix forward of 14dca89bf9: lint, a float depth stays on the executor's context, a format the device lacks is not_enabled
What: the compile gate m3-max-60907 at 14dca89bf9 failed clippy twice and Rustdoc twice:
- `usage = usage | ...` becomes `usage |= ...`;
- `dispatched` takes its dispatch and threadgroup size as one argument;
- the public docs of `runs_through_runtime` and `RuntimeKernel` named private items as links.

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

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

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

Verified: in the lane's report (compile gate and the focused rerun of the 17 rows).
2026-11-20 17:33:49 -08:00
Anees Iqbal 0054bddacb Validation: a kernel case's bound textures and samplers run through the runtime
Family B of the executor's move onto metal2vulkan-runtime. A kernel case
whose bound textures the runtime makes, and whose bound samplers it makes,
now runs through the runtime's public API (engine::runs_through_runtime),
as family A's buffers do. A texture output is observed the same way.

Stays on the executor's own context: a texture the runtime does not make.
That is a multisampled or sparse texture, a texture buffer
(Gap::TextureBuffer) or a cube array (Gap::CubeArrayTexture). An argument
buffer's textures and samplers stay too: they are family C.

How the runtime run makes them (platform::runtime_textures), as the Metal
oracle does (metal::platform::textures):
- Each texture has its type, pixel format, extent, array length and
  levels, in Shared storage. Its usage is its role's, narrowed by what the
  function declares of the slot, with ShaderAtomic where the function's
  texture there is atomic. An array element takes its array's declaration
  (engine::runtime_texture_usages, passed in RuntimeKernel). Its index is
  from the run's texture grant. Every level's slices are written before
  the work (replace_region).
- Each sampler is the oracle's descriptor (resources::sampler_descriptor),
  at an index counted down from the top of the run's sampler grant. The
  constexpr samplers the pipeline numbers count up from the bottom.
- Both are bound at their Metal slots in the dispatch's encoder.
- A texture output is read back as the oracle reads one: the selected
  region of level 0, slice by slice (get_bytes).

TextureLayout::metal_array_length is now the one rule the oracle and the
runtime run use.

Tests: the routing unit test takes a sampled 2D texture with a texture
output into the runtime, and keeps the four exclusions out. Three texture
device tests (a texture array's element at its slot, a read_write texture's
fenced write, a sampler's sample) now also run through the runtime on
Linux, against the same expectations.

ENGINE_EXECUTOR_ABI is now vulkan-engine-v187: rows of these cases are
recorded from the runtime's run.

Verified: the compile gate and the family's proof (public and private
cases on lavapipe against committed Metal, before and after), both named
in the lane's report.
2026-11-20 17:33:49 -08:00
Anees Iqbal 38b9c491e4 Bless the golden tables and the compile census at 2f5cf2374e (SEMANTICS 2225)
The engine fixture rlm_runtime_limits, added by fd924dd9c8, had no rows: its engine inventory
block (6 rows), its golden hash rows (6) and its air_input printout were missing. That made four
reds in suites m3-max-60931 at 4a4a9ddff8: inventory_lists_every_fixture_in_order,
llvm_as::part_6_of_8, engine_fixtures_match_their_golden_printout and
golden_hashes_match_the_table. Nothing else in the three tables moved at 2f5cf2374e.

The authored compile census is re-blessed at SEMANTICS 2225, ARTIFACT 571. The product
fingerprint moves, and 130 compiled-artifact rows change hash. The executor stays v186.

Verified: M3 bless job m3-max-60975 (inventory=0 golden=0 printouts=0), census job
m3-max-60976 (census-exit=0), both at 2f5cf2374e.
2026-11-20 17:33:12 -08:00
Anees Iqbal 2f5cf2374e Fix forward of 60926: the old render key at SEMANTICS 2225, and the second source's XR blends refused
- pipeline::compile::tests::the_old_render_descriptor_key_keeps_its_value: the key 60926 printed
  (left) at SEMANTICS 2225, 45541a82c360366c...; it was f65d353b285b1571... at 2224.
- engine_fragment::a_second_source_blend_without_fast_math_reads_the_second_output: its last loop
  blended each of the six extended-range formats (raw 550 to 555) premultiplied over and expected
  the pipeline made. A blend into one of Apple's extended-range forms is refused now (the refusal
  commit before), so the blended half expects NotImplemented(Format); the unblended half is made as
  before, with no dual-source output. The test's doc says so.

Test only; the runtime pin stays.

Verified: m3-max-60926 (msi, at d69740f5ce) showed both failures and nothing else: fmt, clippy
and Rustdoc green; tests 4401 run, 4399 passed, these 2 failed, 20 skipped. The next check is
named in the report.
2026-11-20 17:26:22 -08:00
Anees Iqbal d7de71c58d Fix forward of 60922: the refused fetch test borrows the artifact it prints
a_fetched_extended_range_attachment_is_refused printed a made artifact's facts by moving them
out of the Arc that compile_with returns (E0507). It borrows them now. Test only; the runtime
pin stays.

Verified: m3-max-60922 showed the error (clippy and test, metal2vulkan lib test); the next check
is named in the report.
2026-11-20 17:26:22 -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 2028eb6356 Fix forward of 60749: the requirements test's loop over one kind
Job 60749 (clippy and tests of metal2vulkan at 85ef8a373d) failed clippy alone: with
ResourceKind::ExtendedShadow gone, the requirements test that a color's storage form writes
are not the function's looped over one kind (clippy's single_element_loop). It now checks
TileAttachment directly, and its name and doc lose the shadow. Its tests passed (557 of 557).

No version or pin changes.

Verified: nothing yet for this commit (a check job is owed).
2026-11-20 17:26:22 -08:00
Anees Iqbal c4b56b0b38 Fix forward of 60740: the shadow's tile read, and the moved writers' count
Job 60740 (clippy and tests of metal2vulkan at 2c728b7b79) failed on two things the shadow's
removal left. extended_range::tile_read, Metal's read of a tile holding a `half`, read the
shadow's texel alone, so nothing calls it now; it goes with its test (Op::TileRead and
a_read_of_the_tile_clamps_as_metals_does) and blend::clamped's mention of it.
engine_moved_writers' second test still named the move it no longer loops over; its set of
planned states is now keyed by writer and tests, and it expects one move per writer.

No version or pin changes: tile_read was never emitted for an unshadowed input, and the runtime
pin is unchanged (0260cefd).

Verified: nothing yet (a check job is owed).
2026-11-20 17:26:22 -08:00
Anees Iqbal a950689934 Extended shadows go: no variant reads and writes an extended-range attachment's half shadow
Metal's tile memory holds an extended-range color attachment (BGR10_XR, BGRA10_XR,
RGB10A8_2P_XR10 and their sRGB twins) as half through a render pass and rounds it to the codes
only at the store. The binder offered a variant for a draw whose render pass instance held a
half shadow of such an attachment (BindState/BindShape::extended_shadows,
VariantKey::extended_shadows, LoweringInputs::extended_shadows). Its fragment function read and
wrote an Rgba16f storage image beside the codes (ResourceKind::ExtendedShadow), either in the
interlocked storage form or, on a device that fetches through rasterization-order input
attachments, beside the input attachment (lower::fragment's input_shadow). metal2vulkan-runtime
never asks for the variant and makes no extended-range texture (Gap::TextureFormat), so nothing
reached it.

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

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

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

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

Verified: nothing yet; the two fix-forward commits after this one make it build (60740, 60749),
and the check job of the series is named with the refusal commit.
2026-11-20 17:26:22 -08:00
Anees Iqbal 4a4a9ddff8 Fix forward of 3a5c6bcfd4: the texture-buffer member's refusal as lavapipe answers it, a granted index, the mesh census test
Gate m3-max-60884 at 3a5c6bcfd4 failed three of its own tests:

- a_texture_buffer_member_is_refused_at_the_make_where_a_2d_member_is_made.
  lavapipe under the runtime answers the member's make with the
  translator's capability refusal, DeviceCapabilityMissing of
  Feature::ArgumentBufferTextures (the texel-buffer-array features). It is
  not Unsupported{IdentityDomains}: the capability query comes first. The
  test now matches the runtime's own typed error (make_kernel returns
  rt::Error) on either feature. The 2D member is still made.
  TextureBufferMember's doc names both forms.
- a_texture_buffer_is_refused_where_a_2d_texture_is_made. The 2D texture
  was refused as Refused(TextureIndex { index: None }): a shader-read
  texture takes an index of a live grant. The test grants one and makes
  both textures at it. The texture buffer was already refused as
  Gap::TextureBuffer.
- census::tests::object_and_mesh_rows_are_indexed_and_classified. Under
  Limit::Runtime the object row closes and the two mesh rows stay unresolved
  on mesh_companion (a tooling gap): unresolved 2, runtime_refused 3.

The gate's fourth failure,
enables::tests::every_committed_profiles_context_enables_its_pinned_chain,
is not this branch's: opened_chains.txt pins chains that four contexts no
longer enable. This branch touches neither the enables nor the profiles.

Verified: the compile gate named in the lane's report.
2026-11-20 17:11:50 -08:00
Anees Iqbal fd924dd9c8 Census: a requirement the runtime refuses is the runtime's limit, closed without a candidate run
The authoring-capability census stayed open on 66 rows, every one a
requirement whose shape metal2vulkan-runtime refuses: seq_cst_fence (14),
texture_buffer_member (6) and mesh_render_pipeline (46). Each was a tooling
gap (Limit::Tooling), which keeps a row unresolved, though no tooling the
executor could build would run them: the product refuses them.

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

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

Verified: the compile gate and the census, both named in the lane's report.
2026-11-20 17:11:50 -08:00
Anees Iqbal c46b81f67c runtime tests: every field of the translator's linked state has the runtime's verdict
tests/translator_fields.rs reads the public fields of GraphicsState, RenderPipeline,
StageModule, ComputePipeline and ComputePipelineMetalInfo from the translator's sources and holds
one verdict per field:
- Applied: the runtime builds what the field states;
- Refused: the runtime refuses it, typed, for the reason given;
- Fact: there is nothing for the runtime to apply, for the reason given.
It fails on any of these:
- a field that has no verdict, so a field the translator adds cannot be dropped in silence;
- a verdict for a field that is gone;
- an Applied field that no product source of the runtime reads as a field;
- a Refused or Fact verdict that names no reason.
The verdicts live in the test alone: product code holds no fact table, and no lowering is keyed
by a field's name. The five structs are #[non_exhaustive], so the runtime, being another crate,
cannot destructure them exhaustively; the test parses the source text instead, and a second test
pins the parser (a struct's public fields only, docs and line comments ignored).

The verdicts follow the field audit:
- the old runtime's sample_mask and the render stages' required_subgroup_size are Applied;
- sample_shading is gone (guestgaps), as are mesh_info and six GraphicsState facts nothing read,
  so no field is left stated, neither applied nor refused.
- color_group is a Fact. It cannot be stated above the floor: a colour group takes a device of
  fewer than 8 color attachments or fragment outputs, and floor::limits requires 8 of
  maxColorAttachments and maxFragmentOutputAttachments (floor.rs:1207).
The compute pipeline's requirements stay a Fact (the profile the translator compiles for is the
set device creation enables): expected, not audited by a check.

Verified in the job named in the landing message: the test passes as committed, and its built
binary fails on two controls. In one, a `pub zz_unclassified: bool` is added to GraphicsState's
source and the test names it ("has no verdict"); in the other, GraphicsState's sample_mask is
renamed and the test names it ("has a verdict and no field"). The test reads the sources when it
runs, so neither control needs a rebuild.
2026-11-20 17:11:06 -08:00
Anees Iqbal d1a4d71834 pipeline: six GraphicsState facts nothing reads go
early_fragment_tests, writes_sample_mask, flat_fragment_inputs, clip_distances,
reads_position_depth and interpolates_at_sample were stated by link for every render pipeline
and read by no product code: not by the translator past link, not by metal2vulkan-runtime, not
by validation or conformance. Each served a consumer form the runtime does not have:
- early_fragment_tests and writes_sample_mask: a visibility count under early tests, and the
  runtime refuses visibility results;
- flat_fragment_inputs: drawing a primitive's vertices in another order, and the runtime draws
  them in the guest's;
- clip_distances: the module writes its own clip distances;
- reads_position_depth: a viewport depth range other than Metal's, and the runtime refuses depth
  clamp;
- interpolates_at_sample: custom sample locations, and the runtime draws at the device's
  standard ones.
The stage interface keeps what they were computed from (StageIo::early_fragment_tests,
position_depth, the builtins and the varyings' interpolation), which other code reads.

Deleted with them: link/graphics.rs's reads_flat_inputs and interpolates_at_sample (their only
callers), the two link tests that tested only these states
(the_graphics_state_states_whether_the_fragment_function_reads_its_position_s_depth and
..._reads_a_flat_input), one assertion each in engine_primitive_ids and engine_multisample, and
their lines in api_tests' round-trip literal. reads_barycentric_coord's and StageIo's docs no
longer link to them.

ARTIFACT_FORMAT_VERSION 568 -> 570 (569 is cutxlate's): GraphicsState's encoding loses six
fields. No module words move, so SEMANTICS_VERSION stays.

Consumer search (~/.cache/m2v-orch/consumer-uses.sh, the consumer's development b955213d27 plus
its 63 steelbrain/* refs younger than a day):
- writes_sample_mask, flat_fragment_inputs, clip_distances, reads_position_depth,
  interpolates_at_sample: 0 hits (code)
- early_fragment_tests: 0 on development. On older lane branches, one doc comment
  (reims-vgpu-vulkan/src/answer.rs:911/916) names the MSL attribute `[[early_fragment_tests]]`
  in a list of gap kinds; nothing reads this field.

api_signatures blessed (scripts/api-signatures/signatures.py --bless): 6 field records removed.
docs/REFUSALS.md regenerated, unchanged.
2026-11-20 17:11:06 -08:00