Commit Graph
8618 Commits
Author SHA1 Message Date
Anees Iqbal 492ac7b946 rt tests: a commit with nothing for the GPU takes the Managed ranges named before it
Two device tests over one helper. In each, a Managed buffer is written and named, then a command
buffer with nothing for the GPU is committed and waited for. Test (i) encodes no commands. Test
(ii) encodes one dispatch over the buffer of a kernel that writes no memory, which records nothing
(it asserts dispatches_without_effects rose by 1).

Each test asserts, on a device that keeps two copies:
- At the commit, captured == 256, submissions == 1 and runtime_command_buffers == 1: the copy-in
  is its one submission.
- The command buffer reads Completed with no error, and its GPU start == end > 0.
- The next commit captures nothing, and it reads the bytes from the device copy.

On a unified device the same tests expect nothing captured or submitted.

quiet_step (the step kernel under has_effects false) moves into the compute tests' helpers. The
existing no-effects test uses it.

This commit holds the tests alone, ahead of the fix, so that a run of this commit shows them
failing on a two-copy device without the fix.
2026-11-21 01:49:33 -08:00
Anees Iqbal 39b0efc6e7 rt: a release waits for the command buffers committed before it, one commit-order mark for textures, samplers, idle allocations and imports
What: one mark (memory::Wait) for everything a command buffer may reach with no handle of it.
A release notes the last commit's place in the commit order. It goes once every command buffer
committed up to there is submitted (Work::settled) and that submission completed. With none in
flight (a count kept from commit to retire) it goes at once, as before.
- What waits:
  - a texture's index (its set-1 elements), views and image, and its shadow view;
  - a texture view's views;
  - a sampler state's index and its device samplers;
  - an idle allocation's free;
  - an imported or exported block's free, and with it the import's release.
- How the objects and indices go: the block-maker thread holds them in one FIFO (Pool::release)
  and hands each to the reaper once its wait is over; teardown frees what is left. With nothing
  in flight, an index is vacated on the releasing thread, so its grant may be returned at once.
- What is unchanged: a displaced index; attachment views, pipelines and modules, which their
  command buffers keep. The loose memory (texture allocations, surface plane imports, copies'
  staging) takes no second wait: it comes from the reaper's frees, or from copies.
- New: Gauges::releases_waiting counts what waits. Every device test's teardown reads it zero, and
  the harness compares it at runs 100 and 200.
- Consumer-visible: Gauges gains a field (non_exhaustive, so nothing breaks). release_indices
  refuses IndicesInUse for an index whose texture or sampler state was released under work in
  flight, until that work retires (docs/REFUSALS.md regenerated). A command buffer parked at an
  event wait holds every such release after its commit until it retires (README, in the memory
  and the set-1 paragraphs).
- Docs: new_texture's doc and the README take the new contract and Metal's own answers (the
  consumer's game tool on two Macs, from main), and api_signatures.tsv is blessed for the field.
- Test: one ordinary test, argument_tier's held release. A command buffer at an event wait holds
  a 17 MiB allocation's free and a released texture's index past twice the idle age; once it
  retires, both go. The two hazard tests of the commit before run on a CPU device always, and
  pass only with this.

Why: the consumer's game step loses the device on RTX 3090s (Xid 13, MMU faults). The game tool
remakes heap textures every frame and drops the old ones at once, while the frame in flight still
samples them through set 1 by resource ID, naming only the heap. Before this, rt nulled the
elements and destroyed the views and image at once, under that pass.

Product lines (comments left out): +171 -23 in crates/metal2vulkan-runtime/src.

Verified at this commit: cargo fmt; scripts/api-signatures --check after its bless (the one new
line is Gauges.releases_waiting); docs/REFUSALS.md regenerated (IndicesInUse's row). Before-run on
ms01's RTX 3090 at 2d0c57661d (job m3-max-62569): the address test (argument_tier) hung the GPU
(Xid 109 CTX SWITCH TIMEOUT, no loss rt saw, Xid 31 at teardown). The texture test showed no Xid,
and its lines were lost (the leg's buffered pipe). Its gate and its after-fix hazard run follow
this commit; main's landing names them.
2026-11-21 01:59:43 -08:00
Anees Iqbal 33e402b518 rt tests: the heap-texture hazard drops its textures while a pass samples them too
What: argument_sampling's hazard test gains a third form. A pass of 40,000 hs_sample dispatches
(about 200 ms on an RTX 3090) has its textures dropped 20 ms after its commit, while it samples
them: the consumer's frame f-1. The test now prints the heap block's address range, and for each
form the drop's host time beside the pass's GPU span and rt's DeviceLoss, so a fault's address
and time can be placed. The texture grant takes 6 indices for the three forms.

Why: the one hazard run at 2d0c57661d (job m3-max-62569, ms01's RTX 3090) showed no Xid while
this test ran, but its lines were lost: the leg piped nextest through buffered `cut | head`, and
the job was killed later. In the two forms before this one, the release nulls the set-1 elements
before the pass starts, so the pass most likely never reaches the destroyed image. In the same
run, the address test (argument_tier) gave Xid 109 CTX SWITCH TIMEOUT and hung for 10 minutes
with no loss rt saw, then Xid 31 at its teardown; the card came back on its own.

Verified: cargo fmt. This commit is the base of one replay of this test on ms01's 3090 (main's GO,
because the first run's output was lost); the fix's report names its jobs.
2026-11-21 01:58:42 -08:00
Anees Iqbal 2d0c57661d rt tests: two GPU hazards, memory read by address and heap textures read by index, released under the work that reads them
What: two device tests under the GPU-hazard cfg (docs/VALIDATION.md: compiled on a GPU only
under --cfg m2v_gpu_hazards, run always under m2v_cpu_icd), and the runtime's check-cfg list
gains m2v_gpu_hazards.

- argument_sampling: hs_sample's two textures placed in one Private heap at indices of their
  own, sampled through set 1 by the resource IDs its argument buffer holds, by a pass that names
  only the heap (use_heap). Their last handles drop right after the commit, in two forms: while
  the command buffer waits on an event (committed, not submitted), and while about 200 ms of work
  committed ahead of it on its queue runs. Each form records the device's loss, the command
  buffer's error and whether the pass read the textures as they were, then the test asserts all
  three. hs_sample's state and texel bytes move into helpers the first test shares; gpu_span's
  long-work helpers become crate-visible for it.
- argument_tier: a 17 MiB Shared block, an allocation of its own, read only by address through a
  constant buffer (ab_address) by a command buffer that waits on an event first and names nothing
  of the block; the block's last handle drops right after the commit and the event is set past
  twice the idle age.

Why: today a texture's release nulls its set-1 elements and destroys its views and image at once,
and an idle allocation is freed after the idle age, whatever committed work still reads them. The
tests show what that does on a device; the fix (one commit-order mark for every release) follows
in the next commit, and the tests land with it, since a CPU device runs them always.

Verified: cargo fmt at this commit. It is the base of one hazard archive build and one run of
both tests on ms01's RTX 3090; the fix's commit names those jobs and what they showed.
2026-11-21 01:31:41 -08:00
Anees Iqbal 58bea6ca1c Bless at the pin tip ff940dec22: golden tables, compile census and the render key
The pin after 7d106c865a: indirect draws, depth clip Clamp and fill Lines, cube arrays, passes with
no attachment, several viewports, the geometry-stage and dropped-Layer deletions, the loss error's
driver report, the replay player's use* and fault placement, and the texel-offset unroll
(4e3bf2438b..ff940dec22). Development's checks at ff940dec22: quick m3-max-62519 green (signatures,
clippy plain, --cfg m2v_gpu, --cfg m2v_cpu_icd, doc, rt on lavapipe, conformance replay on
lavapipe with no ledger drift); suites m3-max-62520: product with 11 reds, all bless-owned (the
render key, the golden printout, golden_hashes, llvm_as parts 1-8). GOLDEN read "bless due (output
changed under an unchanged key, but SEMANTICS moved 2245 at the bless 7d106c865a -> 2251 here)".

- golden_hashes.tsv, public_fixture_expectations_engine.tsv and air_input/vertex_amplification.txt:
  the M3 bless at ff940dec22, m3-max-62529 (bless-job.sh, rc 0, patch 173,182 bytes).
- authored-compile.tsv: the census at ff940dec22, m3-max-62530 (rc 0; executor vulkan-engine-v197
  unchanged; result blob a8d08a7919, applied from the job's own diff because its workspace was
  reused). 45 cells move, each by a landed change:
  36 compiled cells and 4 refusals become not_supported{unsupported:not_implemented
  LayeredRendering}: a vertex function whose layer or viewport index is not shown the same across
  a primitive is refused (3ecf606aa8); 5 compiled cells become not_supported{Barycentrics needs
  Feature(FragmentShaderBarycentric)} on profiles without that feature, the synthesized geometry
  stage's weights form being deleted (57855c6097). The rest are artifacts moved with SEMANTICS.
- the_old_render_descriptor_key_keeps_its_value: the key m3-max-62531 computed at ff940dec22
  (c2e3aa7731...), the value the test says to write; it moved with SEMANTICS 2245-2251.

Verified: the three M3 jobs above, each rc 0 at ff940dec22 (the key job reports the one expected
failure with its new value); the census table's blob equals the job's.
2026-11-21 01:39:32 -08:00
Anees Iqbal ff940dec22 SEMANTICS 2251 for the texel-offset unroll
Development was at 2250. The canon change earlier in this series changes the translator's output for a
loop nest whose counters decide a texel offset, so every cached artifact keyed on 2250 misses once.
2026-11-21 01:22:36 -08:00
Anees Iqbal cec332eb7a Canon docs: the texel-offset unroll before the branch unroll 2026-11-21 01:22:31 -08:00
Anees Iqbal 1208372eb9 Architecture: canon's unrolling also decides a filter nest's texel offsets 2026-11-21 01:22:31 -08:00
Anees Iqbal 37ff76effa rt test: a filter nest samples alike unrolled and switched
A kernel samples an 8x8 RGBA8Unorm texture through a nearest clamped constexpr sampler at each
texel centre in a 3x3 nest whose counters make the texel offset. With the constants deciding
the counters the translator unrolls the nest (constant offsets); with the inner loop's end
loaded (2 at run time) the offset stays dynamic, a switch over its values on every device (the
runtime never enables maintenance8). Both kernels must write the same 64 sums, bit for bit, and
both the nearest filter's. Unrun yet.
2026-11-21 01:22:31 -08:00
Anees Iqbal 7f070dd3c1 Offset arms test: a decided 3x3 filter nest has constant offsets; a loaded end or 27 runs keeps 256 arms
The filter nest's counters start at -1, step by 1 and leave at 2: 9 samples, 8 with
ConstOffset (the zero offset takes none), no switch, on the armed profiles and on RADV with the
Offset operand's features. With the inner loop's end loaded, or the outer loop running 9 times
(27 runs together), the offset stays dynamic: one switch of 256 arms. Fails without the unroll
form (the decided nest takes the switch).
2026-11-21 01:22:31 -08:00
Anees Iqbal 4e3bf2438b Canon: a loop whose counters decide a texel offset is unrolled, in nests of at most 25 runs
A device without the Offset operand on a sample (no maintenance8, which the runtime never
enables) takes a dynamic texel offset as a switch over all 256 of its values. A 3x3 filter loop
whose counters make the offset (start -1, step 1, leave at 2) gave the rendering sample's
fragment two such switches, and NVIDIA 620.70.06 took 216 s (RTX 3090) and over 300 s (RTX
2080) to create its pipeline. Canon's unroll pass already unrolls a loop whose trip count the
constants decide where a counter decides a branch. It now also unrolls one where a counter
decides the texel offset of a texture operation of its body, where the loop and every loop
nested in it run at most 25 times together, within the pass's existing ceilings, in rounds
before the branch rounds, kept whatever their size: each offset is then a constant on every
device. A loop past those bounds, or whose runs are not decided, keeps its armed offset.

SEMANTICS moves to 2251 in this series' last commit.
2026-11-21 01:22:30 -08:00
Anees Iqbal 35b16445e4 api_signatures: FaultAddress's Debug is its own impl (fix forward of 6b1367b6c5)
6b1367b6c5 replaced FaultAddress's derived Debug with an impl of its own (ash builds without its
debug feature, so vk::DeviceFaultAddressTypeEXT has no Debug), but left the signatures table at
the derive. The table now records the struct without Debug in its derive list and the
impl fmt::Debug for FaultAddress. Nothing breaks for a consumer: FaultAddress is Debug as before.

Verified: scripts/api-signatures/signatures.py --check passes at this tree; it failed at
54c7312a60 (suites m3-max-62458 at 53d429143a: the_public_signatures_are_the_committed_table).
2026-11-21 01:16:38 -08:00
Anees Iqbal 54c7312a60 rt tests: a command buffer's GPU span leaves out what goes ahead of it
Two device tests for the command buffer's GPU start stamp (TOP_OF_PIPE today):

- a short command buffer over a Managed buffer whose 256 MiB were named before its commit spans
  under a quarter of its copy-in's span (the delta of runtime_command_buffer_gpu_nanos), where the
  device keeps a device copy;
- of two command buffers committed back to back on one queue, the first about 60 ms of
  dispatches, the second's gpu_start_time is not before the first's gpu_end_time.

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

The same job at d6c110338d: fmt, clippy (plain, m2v_gpu, m2v_cpu_icd), Rustdoc, the runtime's
lavapipe device tests and the lavapipe conformance replay (rc 0, the ledger exact) passed. Its
other test failures are development's own at 43f7439dc9 (m3-max-62312): the old render
descriptor key, the engine golden printout, golden_hashes and the llvm_as parts.
2026-11-21 01:00:18 -08:00
Anees Iqbal d6c110338d rt: a translator's viewport and scissor dynamic states are the pipeline's with-count states
The viewports' piece made the pipeline's viewports and scissors dynamic with their count
(VIEWPORT_WITH_COUNT, SCISSOR_WITH_COUNT), but render.rs still compared the translator's dynamic
states (VIEWPORT, SCISSOR) with that list one for one, so every render pipeline state was
RenderPipelineKind::DynamicState (m3-max-62168, at 99e5d42deb). The ash form of a translator
state now maps VIEWPORT and SCISSOR to their with-count states, which the pipeline holds in
their place (VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04132 and -04133 forbid both
forms).

The translator's tests of target indices (engine_target_indices) that read runtime-floor as a
device without multiViewport now take it below the floor, without multiViewport and
shaderOutputViewportIndex, which the floor now requires: the raw viewport index alone, and a
fragment function's read of a viewport no stage writes, which reads 0 only where the device
cannot declare ViewportIndex (with multiViewport it declares the input). The same fix was made
to engine_selected_indices before development deleted that file (3ecf606aa8).
2026-11-21 00:34:20 -08:00
Anees Iqbal d00c32ecf6 translator: the identity domains push the draw's viewport count to a vertex function that selects its viewport
Under the identity domains a vertex function that writes [[viewport_array_index]] was refused
as IdentityDomains (an encoder value the function reads as ViewportCount): the field was not
among the encoder values those domains push. The runtime fills it per draw (the encoder's
viewport count, 99e5d42deb), so the field joins the admitted pushed values beside
RenderTargetArrayLength; nothing else of the form changes. Found by 99e5d42deb's suite
(m3-max-62168), whose viewports device test the translator refused.

SEMANTICS_VERSION 2250, one above development's 2249: such a vertex function now
compiles where it was refused. lower/select.rs and cache/mod.rs are not among validation's
runtime inputs, so runtime-sources.sha256 and RUNTIME_VERSION stay. A test pins the form on
lavapipe's profile (engine_identity_render: rt6_viewports' rt6_select pushes ViewportCount in its
window, depends on RuntimeFact::ViewportCount and stores ViewportIndex under
shaderOutputViewportIndex; both modules L3), and docs/API.md names the pushed count.
2026-11-21 00:34:20 -08:00
Anees Iqbal 99e5d42deb rt: several viewports and scissor rectangles, and the viewport index, through the with-count dynamic states
setViewports:count: and setScissorRects:count: refused any count but 1 (DrawKind::Viewports). They
now take 1 to 16 each, and every draw records them with their count (vkCmdSetViewportWithCount,
vkCmdSetScissorWithCount, core in Vulkan 1.3). VIEWPORT_WITH_COUNT and SCISSOR_WITH_COUNT replace
VIEWPORT and SCISSOR in every pipeline's dynamic states, whose viewport state counts become 0, so
no pipeline is made for a count. Vulkan takes as many scissors as viewports. Each viewport's
scissor follows the deleted runtime's rule (render_state.rs's vk_scissors at 5d725aeec7^): the
rectangle of its index, the one rectangle where one is set, and none past the rectangles set where
several are, each cut to the pixels its viewport covers. A draw's attachment-read area is the
union of what it covers through the viewports it reaches: every viewport set for a vertex function
that writes [[viewport_array_index]] (GraphicsState::writes_viewport_index, now Draws::
selects_viewport), and viewport 0 for any other.

A vertex function's [[viewport_array_index]] is the translator's one form at the floor: its
ViewportIndex output, written 0 at or past the encoder's count (RuntimeFact::ViewportCount), which
the draw now pushes (PushField::ViewportCount -> FieldValue::ViewportCount, refilled when the count
changes). Its fragment function reads the index as written. An index that is not one value across
a primitive stays the translator's refusal at creation, needing geometryShader, which device
creation does not enable. Out of range: none or more than 16 is DrawKind::Viewports.

Floor: multiViewport and shaderOutputViewportIndex join REQUIRED, and the translator is told.
The venue dumps report both true on every venue: m3-max-48727, 48728, 48729, 48730, 48731, 48736,
48737 and 61508. shaderOutputViewportIndex is also true in the probes 61359 to 61362 and 61366.
tests/floor.rs, the README floor table, RUNTIME_FLOOR and profiles/runtime-floor.json add them.

The translator's tests that read runtime-floor as a device without the viewport index now take it
below the floor: engine_selected_indices (the raw index alone without multiViewport; the zero
indices without shaderOutputLayer and shaderOutputViewportIndex) and engine_stage_io_tail (the
floor declares Layer and ViewportIndex; the zero index below it). runtime-floor joins the stems
whose fragment ViewportIndex needs MultiViewport.

Also, missed in a5fac6fa9b: the README's pipeline bullet names the depth clip and triangle fill
modes among what a VkPipeline bakes.

Conformance: render-state-boxes leaves known-gaps-rt.tsv; CONFORMANCE-COVERAGE.md regenerated.
Docs: README (encoder bullets, floor table, refusal list), REFUSALS.md (Viewports' doc), the
encoder's built list.

Tests: tests/viewports.rs. rt6_select draws through the viewport of its instance, two viewports
(the halves) and two scissors (the whole target and its top half). Instance 0 fills the left half,
instance 1 the right half's top, and instance 2, past the count, draws through viewport 0, its
fragment reading 2. No pipeline is made, and none or 17 viewports or rectangles are Viewports.
draw.rs drops its two-viewport refusal. floor.rs adds the two missing cases, and the translator
sees shaderOutputViewportIndex.
2026-11-21 00:34:20 -08:00
Anees Iqbal 53d429143a Replay: a lost device's fault addresses are placed among the stream's buffers and heaps
What: the runtime player's `loss` line places each access address of the driver's fault report
among the stream's buffers and heaps, as the play made them. An access's range is the address
rounded down to its precision, `precision` bytes long. The line names each live buffer or heap
the range meets, by address, with the address's offset in it. Then it names each of the last
65,536 released ones it meets, newest first, with the frame and call of the release. It shows
at most 8 of each, then "N more". Where none meets the range, it says the address is outside
every buffer and heap of the stream. The released spans are kept in a bounded queue, filled at
each release. Live spans are read from the object table only when the device was lost. A
texture is placed only through the heap or block it lies in, and the play's own buffers are not
placed. docs/REPLAY-STREAM.md documents the line.

Why: the runtime reports the driver's addresses as given (DeviceLoss::fault) and places none,
since only its caller knows what each range was. The player is that caller for a stream: a
replay that loses the device on a 3090 then says which of the stream's objects the fault hit,
whether it was live or freed (and when), or that it hit none.

Test: new_runtime::tests::a_fault_s_access_is_placed_among_the_stream_s_buffers_and_heaps:
- a live buffer and the live heap it lies in, by address with offsets;
- a page that meets a buffer starting past the address (negative offset);
- two released buffers, newest first, with their release positions;
- an address outside everything;
- the queue filled past its 65,536 entries, so the oldest is gone.

Verified: cargo fmt --all. Build, clippy and the tests run in the job named in the lane's report.
2026-11-21 00:59:14 -08:00
Anees Iqbal 5ea6b63f01 Replay: a render encoder's residency declarations play as nothing
What: the runtime player plays a render encoder's useResource:usage:, useResource:usage:stages:,
useResources:count:usage:, useResources:count:usage:stages:, useHeap:, useHeap:stages:,
useHeaps:count: and useHeaps:count:stages: with no runtime call. Until now each was refused
("not played on a render encoder"), which ended the play. What these calls name is still
noted before the call plays, as for any encoder call (tiled-texture takes, index reads,
covers, place users). docs/REPLAY-STREAM.md lists the eight among what render encoders play.

Why: a recorded consumer stream (run 62101 of the 3090 Xid 13 investigation) stopped at frame
239 on its first render encoder's useHeaps:count:stages:, before any heap-pass draw. The
consumer's runtime backend makes no rt call for these either (reims-vgpu 14c00263ef,
crates/reims-vgpu-vulkan/src/rt_platform/render.rs:310-312 puts UseHeaps and UseHeapsStages in
the arm that does nothing; :301-309 notes a useResources texture's tiled take and
own-index read, and makes no rt call). The runtime's render encoder has no residency call, and
every object of a play is resident.

Test: rt_replay's a_render_encoder_s_residency_declarations_play_as_nothing (device tests,
--cfg m2v_gpu or m2v_cpu_icd). After a triangle, a stream makes a heap and declares all eight
forms on the render encoder, naming the heap and the vertex buffers, then draws again. The play
ends, nothing is skipped and the target checks green. Before this change the first declaration
was refused.

Verified: cargo fmt --all. Build, clippy and the lavapipe device tests run in the job named in
the lane's report.
2026-11-21 00:56:28 -08:00
Anees Iqbal 6b1367b6c5 Runtime: FaultAddress formats its kind by its Vulkan name
What: FaultAddress drops its derived Debug for its own, which prints the address type by its
Vulkan name (the seven VK_DEVICE_FAULT_ADDRESS_TYPE_* names, else "kind N"), then the address
and the precision in hex. The replay player's `loss` line prints each access and instruction
pointer through it.

Why: ash is built without its `debug` feature here, so vk::DeviceFaultAddressTypeEXT has no
Debug, and the derive failed to compile (E0277 at fault.rs:36; gate job m3-max-62271 failed in
every step on it).

Verified: cargo fmt --all. Compile, clippy, Rustdoc and the tests run in the re-run gate named in
the lane's report.
2026-11-21 00:45:34 -08:00
Anees Iqbal 0156925ec6 Runtime: a lost device's loss carries the driver's fault report (VK_EXT_device_fault)
What: device creation enables VK_EXT_device_fault and its deviceFault feature where the device
lists the extension (one of the floor's optional extensions; Vulkan requires the feature of a
device that lists it). At the device's first loss of the runtime's own whose result is
ERROR_DEVICE_LOST (a failed vkQueueSubmit2, or the completion thread's semaphore read or wait),
the runtime reads vkGetDeviceFaultInfoEXT once, counts then records, into the new
DeviceLoss::fault: the driver's description, its memory accesses and its instruction pointers
apart (each a FaultAddress of kind, address and precision, as reported), and its vendor records.
A loss the consumer reports (Device::report_loss) is never read: it may name a device that is not
lost, and the query is valid only on a lost one (VUID-vkGetDeviceFaultInfoEXT-device-07336). The
runtime places no address; the consumer, told of every allocation's map and unmap, places them
among its own blocks and buffers. The replay player prints the loss and its report as a `loss`
line of its report (docs/REPLAY-STREAM.md).

Why: two RTX 3090s lost the device with Xid 13 (Graphics SM Warp Exception: MMU Fault) in a
consumer step, and neither the runtime nor the consumer could say which address faulted.

Public API (breaking): DeviceLoss gains `fault` and is no longer Copy; new DeviceFault and
FaultAddress; floor::Features gains `fault`; OPTIONAL_EXTENSIONS gains VK_EXT_device_fault.
api_signatures.tsv blessed; docs/REFUSALS.md regenerated (unchanged).

Verified: the 11-19 minimal repro (a dispatch reading through a freed buffer's address) with
deviceFault enabled, on um870's RTX 3090 (NVIDIA 620.70.06), job m3-max-62203: the device was lost
at the first empty submission after Xid 109 (11.5 s after Xid 13), and the report gave
READ_INVALID 0xdef63a3000 precision 0x1000, inside the freed buffer's range, and
INSTRUCTION_POINTER_FAULT 0xdefdfeb950 precision 0x10; no description, no vendor records.
2026-11-21 00:45:34 -08:00
Anees Iqbal 3e1069db45 Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

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

docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py).
2026-11-21 00:22:30 -08:00
Anees Iqbal 3860bf04fc conformance: the cases a pass with no attachment opens, read as Metal's or named
What: with a pass with no attachment built (de58250086, 0906aad6e5), the 377 cases the
NoAttachment refusal hid now run on lavapipe (m3-max-62179). Most compare. The 87 lines that do
not fall in four classes, none of them the pass's:
- Notices: the 7 tessellation-partition-* cases (partition-modes-quad and -triangle, -factors,
  -degenerates, -insides-quad and -triangle, -steps; and -scales, which crosses the same modes)
  draw the two fractional modes. Their pipelines announce tessellation-fractional-spacing, which
  the cases did not declare. A new tessellation_sweeps::partition_notices declares it for every
  case that crosses the four modes, as tessellation-rendered-patches does. Only their notices
  site differed, so they get no row.
- Rule 1, 30 rows: the device's fixed-function conversion of a normalized UChar attribute, 1 ulp
  from Metal's correctly rounded value (Metal 0x3efefeff, lavapipe 0x3efeff00 for 127/255; note
  device-vertex-conversion). Also the payload of a Half or RG11B10 attribute's NaN, which the
  fetch keeps where Metal reads 0x7fc00000 (0x7fc02000, 0x7ffe0000; note device-nan-encoding).
  These are rows in the ledger's form for a rule-1 value difference: a note declares its
  notice and loosens no value (replay.rs, NATIVE_NOTES).
- Open bug, 47 rows (vertex-format-half4, and integer-vertex-attributes int_attribute_to_half4):
  a vertex function's half-typed attribute reads unrounded to half where Metal rounds it (Metal
  32767 as 32768, 0x47000000; ours 0x46fffe00). The pipeline announces native-half-conversion;
  whether the module's rounding is missing or the device folds its round trip is open, and the
  bug is in the bug list.
- Unbuilt, 3 rows: setTessellationFactorScale: under a state that does not enable the scale
  (tessellation-factor-scales, 2: no runtime method, already among the README's not-built
  methods), and DrawKind::DividedBaseInstance on a device without supportsNonZeroFirstInstance
  (vertex-step-rate-instances on lavapipe, already a README known gap).
The other 10 lines are development's argb8-targets lines.

Also: the device test draws at 1 and 4 samples, the counts Vulkan requires of
framebufferNoAttachmentsSampleCounts. lavapipe lacks 2, so its state was the translator's
RasterSampleCount refusal (m3-max-62179). CONFORMANCE-COVERAGE.md is regenerated.
2026-11-21 00:22:11 -08:00
Anees Iqbal 0906aad6e5 rt: a pass with no attachment is refused at 0 samples alone, as plain Metal refuses it, measured
What: Refusal::NoAttachmentPass refused a side of 0, and any defaultRasterSampleCount that is not
a power of two up to 64. The first form's basis was ours, and that is not enough: only what Metal
refuses may fail. A new probe, crates/metal2vulkan-conformance/probes/no_attachment_passes.m,
measured plain Metal (the API validation layer off) on an Apple M3 Max, macOS 27.0.1, in job
m3-max-62174:
- a new descriptor's defaultRasterSampleCount is 0;
- a side of 0 makes no encoder (nil), and 64 by 64 at 1 sample makes one;
- a count of 0 ends the process at the encoder (SIGABRT), with or without a draw;
- 4 by 4 at 1 sample runs the counting fragment 16 times, and at 4 samples 64 times.
So the refusal keeps a side of 0 and a count of 0, now with the basis metal-measured. A count
that is no Vulkan sample count now makes the encoder, as Metal makes one at 260 (the low 8 bits,
4; ead49055ec's probe). No pipeline state has such a count, so every draw in it is
DrawKind::AttachmentFormats.

Docs: the variant's doc and basis, the descriptor field's doc, the README bullet, REFUSALS.md. The
probe's header carries what it measured. Test: no_attachment.rs drops the 3-sample refusal case.
2026-11-21 00:22:08 -08:00
Anees Iqbal de58250086 rt: a render pass with no attachment, renderTargetWidth by renderTargetHeight at defaultRasterSampleCount
Until now a pass with no attachment was refused as Gap::RenderPass of RenderPassKind::NoAttachment.
Pass::check now builds it. Its area is renderTargetWidth by renderTargetHeight, and its samples
are the new RenderPassDescriptor::default_raster_sample_count (Metal's defaultRasterSampleCount,
0 by default as in Metal), which a draw's pipeline state must match through the existing
renders_into check (DrawKind::AttachmentFormats otherwise). Vulkan's dynamic rendering of no
attachment takes the bound pipeline's rasterizationSamples alone. The translator already asks
framebufferNoAttachmentsSampleCounts for such a state. Its area is the Vulkan render area
unrounded: there is no load, store or resolve to reach the 32-pixel band.

Refusals:
- Refusal::NoAttachmentPass { width, height, samples } (new) covers a side of 0, or a count
  that is no sample count (a power of two up to 64), Metal's default 0 included. Basis: ours
  (VUID-VkRenderingInfo-None-08994 and -08995).
- RenderPassKind::NoAttachment stays, now for a side past the device's maxFramebufferWidth or
  maxFramebufferHeight (VUID-VkRenderingInfo-pNext-07815 and -07816; EncoderLimits::max_framebuffer).
  Every venue dumped reports 16384 or 32768, so 16384 (Metal's largest side) or more: jobs
  m3-max-48727 to 48731, 48736, 48737 and 61508.

Consumer: reims-vgpu builds rt::RenderPassDescriptor from Default and its fields
(crates/reims-vgpu-vulkan/src/rt_platform/descriptor.rs:412), so it still compiles. Its ops
already keep default_raster_sample_count (reims-vgpu-graphics ops.rs:480), but rt_pass does not
yet pass it on. Until it does, its passes with no attachment are NoAttachmentPass at 0 samples.

Conformance: the rt side sets default_raster_sample_count to 1 wherever its pass has a size, as
the Metal side sets it (metal_side.rs:8940). All 377 ledger rows refused with "a render pass with
NoAttachment is not built" leave known-gaps-rt.tsv: integer-vertex-attributes, the tessellation-*
cases, vertex-format-*, vertex-constant-step-instances, vertex-step-rate-instances.
CONFORMANCE-COVERAGE.md is regenerated. Docs: README (the descriptor, the new pass bullet, the
render pass gaps), REFUSALS.md, and api_signatures (1 field, 1 variant).

Tests:
- tests/no_attachment.rs: engine rt6_attachmentless (the functions a Metal probe drew in such a
  pass) in a 2 by 2 pass at 1, 2 and 4 samples. rt6_mark_sample, which reads [[sample_id]], marks
  every sample of every pixel and runs 4 times the samples. rt6_mark_coverage marks every sample
  and runs at least once a pixel. Also checked: a 4-sample state in a 1-sample pass is
  AttachmentFormats; no width, no height, 0 and 3 samples are NoAttachmentPass; a width past
  the device's is NoAttachment.
- tests/pass.rs: the default descriptor is now NoAttachmentPass at 0 by 0 and 0 samples.
2026-11-21 00:22:07 -08:00
Anees Iqbal 876268aa36 docs: conformance coverage counts rotated_targets among the modules declaring a notice
Regenerated (scripts/conformance-coverage/coverage.py) after bc7d76530f, whose cases declare
rotated-blend-rounding: modules declaring a notice, loosening no value, 43 -> 44.
2026-11-21 00:24:53 -08:00
Anees Iqbal bc7d76530f conformance: the argb8-targets cases whose blend rounds declare rotated-blend-rounding
5db3215260 ("Rotated blends: every blend not exact by construction announces its rounding")
made the translator raise PrecisionNote::RotatedBlendRounding for every blend on an attachment
held with its channels rotated (ARGB8Unorm) but a minimum or a maximum and one whose four
factors are all ZERO or ONE. The argb8-targets cases declared no such notice, so on lavapipe
the ten whose blend rounds (multiply, source-color, blend-alpha, straight, straight-alpha-one,
straight-red-green-alpha, premultiplied, additive-alpha, reverse-subtract-alpha and
subtract-one-minus-alpha) were divergent at case/notices with the notice undeclared, which the
ledger does not list (conf rc=1 in m3-max-62286 and earlier).

Each RotatedTarget now declares crate::replay::notice_allowance of the note's code where its
state rounds by the translator's rule (RotatedTarget::rounds: a blend whose colour operation is
not Min or Max and whose four factors are not all Zero or One), as the tessellation cases
declare their notices: the notices site alone, every texel still compared exactly, and the
unblended, red-alpha and max states declare nothing. Their texel sites keep their ledger rows.
2026-11-21 00:24:27 -08:00
Anees Iqbal 1cad2faaf4 validation: the opened chains blessed for imageCubeArray in the floor, beside depthClamp and drawIndirectFirstInstance
The rebase of the cube arrays onto b71567aca4 took the base's opened_chains.txt in 758b601cbd,
whose own bless was made on a base without depthClamp and drawIndirectFirstInstance. Blessed
again on the rebased tree: the runtime floor's device and restricted chains gain
imageCubeArray, now 46 and 54 members (bless_opened_chains, job m3-max-62335, msi-laptop, at
758b601cbd: 1 passed; clippy of metal2vulkan-runtime and metal2vulkan-conformance passed in
the same job).
2026-11-21 00:23:03 -08:00
Anees Iqbal 758b601cbd rt: cube arrays' opened chains and conformance ledger
The follow-ups of 7cd1103a44, from its suite at 216038a939 (an earlier form of it), m3-max-61809
on gem10:

- opened_chains.txt: the four runtime-floor contexts gain imageCubeArray (members 44, 42, 52 and
  49), from the suite's bless_opened_chains run. Neither runtime-floor.json nor the chains changed
  on development between the two bases.
- known-gaps-rt.tsv: the 87 rows of `cube array textures are not built` (every venue) are gone;
  lavapipe's conformance run held none of them. Where a case's cube-array site now reaches the
  next gap, its row is that gap's: 44 rows, each with the venue and the waiting text of the
  case's same answer at its other texture types. heap-sizes-formats-without-textures (16),
  heap-sizes-unspecialized (12) and heap-sizes-two-plane-cubes (4) name formats no device makes;
  texture-pairs-plain-contents (6) names the consumer's descriptor fields;
  format-footprints-plain-stragglers (1) reaches its texture-buffer step; read-write-tier-
  descriptors' ASTC_4x4_sRGB cube array is made on no venue its other ASTC rows name (780M,
  NVIDIA, RX 550, RX 7900 XTX, llvmpipe; verified on llvmpipe, expected elsewhere). Its
  promised-and-refused row lists the tier's texture buffers alone.
  CONFORMANCE-COVERAGE.md regenerated (7644 ledger rows).
- The validation executor's runtime_texture doc: a cube array stays on the executor's own
  context, no longer a refusal of the runtime's.
2026-11-21 00:19:40 -08:00
Anees Iqbal 7cd1103a44 rt: cube array textures and views, with imageCubeArray in the floor
A cube array texture (`MTLTextureTypeCubeArray`) is built: an image cube-compatible with six of
its layers a cube (`arrayLength` times six layers), whose shader view is
`VK_IMAGE_VIEW_TYPE_CUBE_ARRAY`. Metal's casts with a cube array
(`makeTextureView(pixelFormat:textureType:levels:slices:)`) are built in the same form: a cube
array's subrange of whole cubes, its faces as a 2D texture (one face) or a 2D array (any faces),
six of its faces as a cube, a cube as a cube array of one cube, and a multiple of six slices of a
square 2D array as a cube array where its image is cube-compatible. A pass resolves into a
one-sample colour cube array as into a cube (`Plan::resolves`), and a layered pass renders a cube
array's faces across its cubes (the attachment view of its layers, as for a cube).

`imageCubeArray` joins the floor's required features. Every probed device reports it (vulkaninfo
dumps m3-max-48727 to 48731, 48736, 48737 and 61508: the RX 7900 XTX, every 780M, the RTX 2080,
the RTX 3090, the RTX 5080 Laptop, the Iris Xe, lavapipe, the UHD 630's Windows driver,
KosmicKrisp and the RX 550), and Vulkan 1.4 and Roadmap 2022 require it of every device. A device
without it gets the floor's refusal. The runtime-floor profile and its generator state it
(check_device_profiles: 0 findings), and the floor's missing-feature test has its case.

`Gap::CubeArrayTexture` is deleted (the consumer's checkout at 9bb622a2c2: 0 hits); REFUSALS is
regenerated and the API table loses the variant. The runtime README's texture and view lines,
its resolve line and its floor table say what is built.

Tests, each on every device of the cfg's kind: `tests::texture` round-trips a cube array's last
face (its second cube's); `tests::view` casts a cube as a cube array of one cube, reporting
Metal's array length 1; `tests::cube_views` samples a two-cube `RGBA32Float` cube array at its
second cube and a cube view of its first six faces through the owned fixture
`unk_cube_grad_lod`, every lane reading its face's slice, with `imageCubeArray` enabled; and
`tests::layered` renders a cube array's slices 4 to 9, across both its cubes (the cube-array
layered case, as the layered change landed first).

The conformance ledger's cube array rows and the runtime-floor contexts' opened chains follow in
the next commits.
2026-11-21 00:19:34 -08:00
Anees Iqbal b71567aca4 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-21 00:18:35 -08:00
Anees Iqbal 47c7e3a30f validation: the opened chains blessed for depthClamp in the floor, beside drawIndirectFirstInstance
The rebase of the depth clip and fill mode piece onto fa70528de2 dropped its own bless
(a785e6e275), whose chains were blessed on a base without drawIndirectFirstInstance. Blessed
again on the rebased tree: the runtime floor's device and restricted chains gain depthClamp,
now 45 and 53 members (bless_opened_chains, job m3-max-62316, msi-laptop, at 2a36291a80: 1
passed; clippy of metal2vulkan-runtime and metal2vulkan-conformance passed in the same job).
2026-11-21 00:17:23 -08:00
Anees Iqbal 2a36291a80 rt test: the raster test's Lines viewport lies off the diamonds' ties
What: under Lines the test drew the triangle through a viewport 0.5 pixels right of and above
the target's corner, so the edges inside the target ran through texel centers: x 0.5 down column
0 and y 7.5 along row 7. On lavapipe the line along row 7 drew no pixel (m3-max-62049, lvp leg),
since a line through centers ties at every diamond's corners under Bresenham's diamond-exit rule.
The viewport is now 0.4 right and 0.3 above. The edges lie at x 0.4 and y 7.7, inside each
pixel's diamond away from its corners, and both start at (0.4, 7.7), strictly inside the corner
pixel's diamond. The pattern expected is unchanged: column 0 and row 7.

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

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

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

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

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

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

Tests:
- tests/raster.rs: a triangle in front of the near plane draws nothing under Clip and every
  texel under Clamp (twice: one pipeline made). Under Lines, through a viewport half a pixel
  right of and above the corner, the triangle draws its two edges inside the target, column 0
  and row 7, and nothing inside. Without fillModeNonSolid it is FillMode and fills. Pipelines
  made, raster first-use waits and first-use waits are each 1 + fillModeNonSolid.
- draw.rs: setting both modes makes no pipeline when no draw follows.
- floor.rs: depthClamp's missing case, and the fill-mode feature enabled where reported.
- first_use_sites.rs: the raster site.
2026-11-21 00:14:34 -08:00
Anees Iqbal 43f7439dc9 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-21 00:13:23 -08:00
Anees Iqbal 73ce142afc Bind: a vertex function that chooses its slice writes Layer in every pass; the dropped-Layer variant goes
A vertex function that writes [[render_target_array_index]] had two forms:
- in a pass of at most one layer (BindShape::render_target_array_length 0, Metal's default, or 1),
  the plan asked for VariantKey::dropped_vertex_layer, a variant compiled without the Layer
  output;
- in a longer pass it ran the pipeline that stores Layer as `index < length ? index : 0`, the
  length each draw pushes (PushField::RenderTargetArrayLength).

The second form already answers the short pass exactly. At a length of 0 or 1 it stores 0 for
every index, the slice Metal renders, so a one-layer framebuffer is never written an out-of-range
Layer. The dropped variant's one gain was a pipeline that needs no shaderOutputLayer. The floor
requires that feature, and every committed profile has it. The runtime never asked for the
variant: it compiles every render pipeline under VariantKey::new() and pushes the pass's layers,
at least 1.

After this change the one form draws every pass, and its plan states no variant at any length.
The binder pushes the pass's length as at least 1, as the runtime does; at 0 and 1 alike the
function stores 0 for every index.
Drawn one amplification at a time in a pass of one layer, a vertex function still writes no
Layer (LoweringInputs::amplification_draws, not layered). RuntimeFact::RenderTargetArrayLength's
layer_dropped now states that case alone.

Size: 24 files, +360/-381.

Removed:
- VariantKey::dropped_vertex_layer, with its is_empty term and its per-stage lowering bit;
- LoweringInputs::dropped_vertex_layer and the function key's "dropped-vertex-layer" bytes. A
  function compiled without the input keeps its key;
- the binder's choice of the variant, and its term in the check that answers
  BindError::NeedsVariant;
- the cache's round trip of the variant, and the variant's cases in the function key test.

Rule 1: no precision note changes.

The evidence gate (validation's candidate/platform/device.rs, fails_row) fails a row on every
ERROR the validation layer reports and on every WARNING of the validation type. Without the
variant the layer warns on each such draw into the render executor's one-layer framebuffer:
  WARNING (validation) Undefined-Value-Layer-Written (0x1fc55805): "vkCmdDraw(): Shader stage
  VK_SHADER_STAGE_VERTEX_BIT writes to Layer (gl_Layer) but the framebuffer was created with
  VkFramebufferCreateInfo::layer of 1, this write will have an undefined value set to it."
It warns of the write whatever its value: VK_LAYER_KHRONOS_validation 1.4.363 reports it for a
minimal draw that writes Layer = 0 (job m3-max-61934). The spec leaves the framebuffer undefined
only where "the Layer value is less than 0 or greater than or equal to the number of layers in
the framebuffer" (Layered Rendering, vkspec 1.4.366). This pipeline pushes the length 1 there and
stores 0. As the planner ruled, the gate now withholds that message, under five conditions:
- Exact: a WARNING of the validation type with that id name, number and whole text
  (CLAMPED_LAYER), for a row whose pipeline states RenderTargetArrayLength without layer_dropped,
  drawn in a pass of at most one layer. The render executor sets this per row on the sink
  (MessageSink::clamped_layer), so it is keyed on structure, never on a case.
- Counted: the row's environment records withheld_validation_messages
  {"Undefined-Value-Layer-Written": n}, and corpus-vulkan prints it.
- Proved by our own tests: candidate::tests::engine_render's
  an_index_past_a_one_layer_pass_renders_the_pass_s_slice draws rt6_layered_vertex writing index
  3 in a pass of length 0 and reads Metal's answer: the slice holds the fragment's word
  1 << 8 | 3 (the conformance case layered-render-target-array-length, recorded on an Apple M3
  Max). rt's tests::layered::on_device::every_device_renders_metal_s_layers checks the same for
  the runtime at lengths 0 and 1.
- One definition: rt's own device tests run under the layer and fail on any message, but they do
  not get this one, because rt renders through dynamic rendering:
  every_device_renders_metal_s_layers, index 3 in passes of length 0 and 1, passes under the layer
  on RADV's RX 550 (m3-max-61553).
  CLAMPED_LAYER is the only list.
- It cannot outlive its cause: the same device test asserts that the row withheld exactly one
  such message. When the layer stops reporting it, the test fails, and the exception goes with
  it. The sink's unit test the_clamped_layer_warning_fails_no_row_of_a_clamped_store_alone checks
  the match: the message for another row, another number, an error, or another draw's text still
  fails the row.
The executor version stays: a row the gate passed before draws and records as it did. The layer
bug's minimal repro and the issue text are staged for the owner to file.

Validation: two authored cases write [[render_target_array_index]] from a vertex function. Both
are vertex-stage cases into one 1x1 target, so both ran the dropped variant:
- 013406ac01b7 (public, vertex_amplification_id_layer) now runs the form that stores Layer;
- 434e73e03189's index is not shown the same across a primitive, so the commit below already
  refuses it on every leg.
Qualified on lavapipe at this tree's content (m3-max-61968, at dvl-5 1fa4aed963, which differs only
by a test's needless borrow): 013406ac01b7 matches Metal with robustness on and off (candidate
output e9eec98c138165bb), and each record states the gate's exception ran:
withheld_validation_messages {"Undefined-Value-Layer-Written": 1}.
The candidate engine's graphics tests now expect an empty variant for every case. The case that
chooses its slice in a one-layer pass declares Layer, with layer_dropped false.

Tests:
- engine_render_target_slice: every_pass_runs_the_vertex_function_that_writes_its_layer replaces
  the variant tests. On the 780M and lavapipe, each of three pipelines, at the lengths 0, 1 and 4:
  - states no variant;
  - declares Layer and reads the length, which the draw pushes as 1, 1 and 4;
  - draws.
  An amplified draw in a one-layer pass still draws one amplification at a time.
  the_dropped_variant_needs_no_output_layer goes.
- engine_target_indices loses its compile of the variant on the device without
  shaderOutputLayer.
- validation: an_index_past_a_one_layer_pass_renders_the_pass_s_slice (lavapipe, under the
  layer) and the_clamped_layer_warning_fails_no_row_of_a_clamped_store_alone, above.

Bless due: nothing new. Every golden compiles without a variant.

SEMANTICS_VERSION 2248 -> 2249 and ARTIFACT_FORMAT_VERSION 584 -> 585 are placeholders that main
renumbers.
SEMANTICS: a slice-choosing vertex function in a pass of at most one layer now compiles to the
module that stores Layer. ARTIFACT: VariantKey and LoweringInputs each lose a field.
RUNTIME_VERSION stays, and runtime-sources.sha256 keeps development's (land-pkt re-pins it). api_signatures drops the two
fields. API.md's layered-rendering bullet states the stored 0 in place of the variant.

Consumer check (consumer_check.sh, consumer development b76d6ac4a9): dropped_vertex_layer,
layer_dropped and NeedsVariant have 0 hits.

Verified (jobs read):
- m3-max-61968: the lavapipe device suite at dvl-5 (dvl-6 without the clippy fix), 1483 of 1483,
  qualify 013406ac01b7 Match, the withheld count {Undefined-Value-Layer-Written: 1} under both
  robustness settings.
- At the stack's tip over this change (dvl-5 1fa4aed963 and dvl-6 92fe40c38f): 61978 and 61987,
  fmt, clippy in every configuration, Rustdoc, each feature alone, the API docs and the Windows
  clippy, green; 61891, the suites at dvl-4: 13 failures, each a bless-due golden above or
  development's own (the raster state test, the inventory's sample_fill rows); 61968, the lavapipe
  device suite of metal2vulkan-validation, 1483 of 1483, and public case qualification Match;
  62042, the metal2vulkan-validation suite at dvl-5, 1378 of 1378 passed.
- States-only play of this change's player (p-dv.zst) over 35 distinct streams on ms01 (61971),
  gem10 (61980), um790 (61991) and um870 (62110): 456,384 render and 91,972 compute states made,
  0 refused, every stream exit 0; 62073 (um790) and 62105 (ms01) repeat those nodes' streams with
  the same counts. The msi stream (windrag-780m-b2) is not played: msi had no memory free.

Rebased onto the rebased geomdel over development 4cf936ed4d. The conflicts: the version lines;
runtime-sources.sha256, where development's is kept; and the validation context's device.rs, where
development's robustness record lost its leg and this change adds expect_clamped_layer and
take_withheld beside it. api_signatures.tsv checks against the sources (signatures.py --check) and
docs/REFUSALS.md regenerates unchanged. The jobs above ran at the old base; the rebased tip's are
in the report to main.
2026-11-21 00:04:06 -08:00
Anees Iqbal 57855c6097 Link: the synthesized geometry stage goes, both forms (the barycentric weights and the rate map's fan-out)
The translator built geometry stages in two forms that no Metal function asks for:
- the barycentric weights: a fragment function's [[barycentric_coord]] read as varyings, which a
  generated geometry stage of each topology class wrote, on a device without
  fragmentShaderBarycentric;
- the rate map's fan-out: a draw of a rasterization-rate-mapped pass's triangles once, a geometry
  stage emitting a copy of each per region, with its probe and its region-copy vertex variant.

Neither form reached a guest. The runtime enables no geometryShader, so it refused the weights
form already. It never sets BindShape::region_fan_out, and draws a rate-mapped pass region by
region (the regions route, RateMapRegions, and region_viewports, which stay). Validation never set
region_fan_out either.

After this change, one form is left for each:
- A fragment function that reads [[barycentric_coord]] reads the device's own
  BaryCoordKHR/BaryCoordNoPerspKHR. Without fragmentShaderBarycentric it is refused as
  Unsupported(Barycentrics) needing that feature alone; geometryShader is no longer offered.
- A rate-mapped pass draws through the regions route.

Rule 1: no precision note stops being raised. The fan-out's copies were a near-equivalent of the
regions route, which carries its own note (RateMapRegions::precision), and the weights form
raised none. The catalogue is unchanged.

Removed:
- pipeline::link::geometry (GeometryStages, the three classes' stages) and pipeline::link::fan_out,
  with their tests (link/tests/geometry.rs, link/tests/fan_out.rs) and tests/engine_region_fan_out;
- bind::fan_out (the region table, the probe's word layout and its constants);
- RegionFanOut and FanOutState;
- the region_fan_out fields of GraphicsState, BindState, BindShape, VariantKey and
  RenderLinkInputs, and LoweringInputs::region_copies;
- the region copy's lowering: StageIoPlan::region_copy, RegionCopy and the region table's
  declaration;
- PushField::RegionBox and RegionProbe;
- SyntheticBinding::RateMapRegions and RateMapFlags, and WriteSource::RateMapRegions and
  RateMapFlags;
- RuntimeFact::SynthesizedGeometry, RenderPipeline::runs_stage and Linked::geometry;
- IoRole::Barycentric with VaryingKey::barycentric and its key tag;
- VkProperty::SubgroupGeometryStage;
- the SPIR-V IR's geometry execution model, which only these stages produced: ExecModel::Geometry,
  OpEmitVertex and OpEndPrimitive, the InputPoints, InputLines, OutputLineStrip,
  OutputTriangleStrip and Invocations modes, ModelNeed::Geometry, EntryRule::GeometryModes and the
  builder's geometry ops;
- from scripts/regen-spirv-grammar/items.txt, the opcodes EmitVertex and EndPrimitive, the
  execution model Geometry and those five execution modes. spv.rs is regenerated: the opcodes and
  the model stay as test-only values, which the test parser reads, and the modes go;
- in validation, the census's geometry stage filter, the draw's runs_stage filter and the
  candidate's GEOMETRY stage arm. The census test that read three geometry stages from
  engine/bary_weights goes with them.

The SPIR-V builder now marks only Position Invariant; ClipDistance was the fan-out's.
band::plan loses its geometry flag, and takes the four SPIR-V helpers it shared with the
geometry module. The binder's stage map takes a geometry stage as no render stage.

Validation cases that executed either form: none.
- Fan-out: no validation code sets region_fan_out.
- Weights: two authored cases read [[barycentric_coord]], fa8b920d3cf3 and ae0a7e39b12f. Neither
  has a stored Vulkan observation on a profile without fragmentShaderBarycentric. fa8b920d3cf3 is
  observed on Metal and MoltenVK, and moltenvk-m3 has the feature. ae0a7e39b12f is observed on
  Metal only.

Fourth user of GeometryStages: none. It was used by link, the compile API's splice, the binder's
selection (through RuntimeFact::SynthesizedGeometry and GraphicsState::region_fan_out) and its
own tests.

Tests:
- engine_stage_io_tail's weights test is now without_the_feature_the_weights_are_refused: on
  lavapipe, ANV's Iris Xe, NVIDIA's Pascal (each with geometryShader) and runtime-floor (without
  it), both barycentric entries are refused needing fragmentShaderBarycentric.
- engine_target_indices checks each pipeline's stages valid where it counted geometry stages, and
  loses the_weights_stage_beside_a_vertex_layer_is_not_implemented: that combination is now the
  plain refusal above.
- engine_amplification no longer counts geometry stages.
- The binder's render stage test refuses a geometry stage.
- The builder's invariant test refuses ClipDistance.
- engine_rotated_weights' rotated draw runs on moltenvk-m3 and RDNA3's RADV, each with
  fragmentShaderBarycentric, where it ran on lavapipe through the weights form.
- The fact mechanism test numbers its 100 RuntimeFact variants densely again (PrivateArena,
  which development added, takes 99).

Bless due until the next named pin, where the M3 bless job takes them; nothing is blessed here:
- tests::public_fixtures_engine (the inventory): every [[barycentric_coord]] cell on a profile
  without fragmentShaderBarycentric becomes Unsupported(Barycentrics) needing it alone, where it
  compiled through the geometry stages (with geometryShader) or offered GeometryShader as the
  alternative;
- tests::golden_hashes, and pipeline::compile::tests::the_old_render_descriptor_key_keeps_its_value
  (the render key), as under the commit below: the profiles' fingerprints change;
- the authored compile census.

SEMANTICS_VERSION 2247 -> 2248 and ARTIFACT_FORMAT_VERSION 583 -> 584 are placeholders that main
renumbers.
SEMANTICS: a fragment function's weights and every rate-mapped variant change form. ARTIFACT: the
codec loses the RegionFanOut, FanOutState, GraphicsState::region_fan_out, IoRole::Barycentric,
RuntimeFact::SynthesizedGeometry, PushField, SyntheticBinding and VkProperty tags. RUNTIME_VERSION
stays: the runtime's render-pipeline kind no longer reads region_fan_out, which it never set, and
its SynthesizedStages doc names the bands alone. runtime-sources.sha256 keeps development's (land-pkt
re-pins it), api_signatures and api_surface drop the removed items, and docs/REFUSALS.md is regenerated.
API.md drops the geometry stages from RenderPipeline's stages, its barycentric bullet and its band
bullet. ARCHITECTURE.md's link line drops pipeline::link::geometry, and the runtime README's
Barycentrics gap names the feature alone.

Consumer check (consumer_check.sh, consumer development b76d6ac4a9): region_fan_out,
RegionFanOut, FanOutState, region_copies, region_copy, RateMapFlags, RegionBox, RegionProbe,
SynthesizedGeometry, FEW_COPIES, PROBE_DRAW_WORDS, RegionCopies and runs_stage have 0 hits.
GeometryStages appears in crates/reims-vgpu-c/link-order.txt only. fan_out's hits are the
consumer's own event fan-out in crates/reims-vgpu/src/graphics/decode/cmdbuf.rs, not this
module.

Verified (jobs read):
- m3-max-61801: the suites at this change's work in progress (4f1f934423); its real reds were the
  mechanism numbering and the rotated weights on amd-rdna3-radv, both fixed here; the render key
  reads bless-due.
- At the stack's tip over this change (dvl-5 1fa4aed963 and dvl-6 92fe40c38f): 61978 and 61987,
  fmt, clippy in every configuration, Rustdoc, each feature alone, the API docs and the Windows
  clippy, green; 61891, the suites at dvl-4: 13 failures, each a bless-due golden above or
  development's own (the raster state test, the inventory's sample_fill rows); 61968, the lavapipe
  device suite of metal2vulkan-validation, 1483 of 1483, and public case qualification Match;
  62042, the metal2vulkan-validation suite at dvl-5, 1378 of 1378 passed.
- States-only play of this change's player (p-gd.zst) over 35 distinct streams on gem10 (61919),
  um870 (61924), ms01 (61967) and um790 (62004): 456,384 render and 91,972 compute states made,
  0 refused, every stream exit 0. The msi stream (windrag-780m-b2) is not played: msi had no
  memory free.

Rebased onto development 4cf936ed4d (selidx landed as 3ecf606aa8). The conflicts: the version
lines; the mechanism test, where development added RuntimeFact::PrivateArena; runtime-sources.sha256,
where development's is kept; and api_signatures.tsv and docs/REFUSALS.md, both regenerated
(signatures.py --bless, refusal_surface.py) and differing from development by this change's items
alone. The jobs above ran at the old base; the rebased tip's are in the report to main.
2026-11-21 00:03:34 -08:00
Anees Iqbal fa70528de2 validation: the opened chains blessed for drawIndirectFirstInstance on the rebased base; conformance coverage regenerated
The rebase of the indirect draws onto 4cf936ed4d met conflicts in two generated files, which
took the base's side in ec5841552f (whose subject still names the bless it carried before the
rebase). They are regenerated here on the rebased tree:

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

REFUSALS.md regenerates unchanged; METAL-COVERAGE.md --check passes.
2026-11-21 00:09:33 -08:00
Anees Iqbal ec5841552f conformance: the indirect draw cases leave the ledger; the opened chains blessed for drawIndirectFirstInstance
What: the rt side now draws render-draw-forms-empty, -points and -triangles through the
runtime's indirect draws (f0198015f1), and each compares against Metal's recording as announced,
its notices justified (m3-max-62083, lavapipe). Their three rows, refused "render step
DrawIndirect", leave known-gaps-rt.tsv, and CONFORMANCE-COVERAGE.md is regenerated, which
the_conformance_coverage_document_is_what_the_sources_derive asked for in that job.
runtime-floor's four device chains each state one member more, drawIndirectFirstInstance
(aed460e0da), as bless_opened_chains wrote them in m3-max-62083 (rc 0).

Verified: m3-max-62083 at 53064d173d: fmt, clippy (all, gpu, cpu), doc, bless and lvp (draw,
patch, floor tests on lavapipe) rc 0. Its test step's reds are development's own at
62b3e5a250 (m3-max-61881) plus the coverage document this commit regenerates. Its conformance
lines beyond these three rows are development's 10 argb8-targets lines.
2026-11-21 00:02:51 -08:00
Anees Iqbal f0198015f1 conformance: the rt side draws the indirect steps through the runtime's indirect draws
RenderStep::DrawIndirect and DrawIndexedIndirect were Unavailable ("render step DrawIndirect")
on the rt side; they now call draw_primitives_indirect and draw_indexed_primitives_indirect
with the case's arguments buffer and offset, the indexed one's indices at its index offset.
2026-11-21 00:02:35 -08:00
Anees Iqbal aed460e0da rt: indirect draws, of primitives, indexed primitives and patches
The render encoder builds Metal's three indirect draws:
`drawPrimitives:indirectBuffer:indirectBufferOffset:` (`draw_primitives_indirect`),
`drawIndexedPrimitives:indexType:indexBuffer:indexBufferOffset:indirectBuffer:indirectBufferOffset:`
(`draw_indexed_primitives_indirect`) and
`drawPatches:patchIndexBuffer:patchIndexBufferOffset:indirectBuffer:indirectBufferOffset:`
(`draw_patches_indirect`). Each is one `vkCmdDrawIndirect` or `vkCmdDrawIndexedIndirect` on the
buffer at its offset: Metal's argument structs lie as Vulkan's commands do, so the GPU reads
them as they are and nothing is copied. Before, the encoder had no such methods and the README
listed indirect draws as not built.

drawPatches indirect is built: rt's patch draw is vkCmdDraw(patch_count, instances, patch_start,
base), each patch one vertex of the state's patch list, so Metal's patch count is the indirect
command's vertex count unchanged. A patch index buffer stays `DrawKind::PatchIndexBuffer`, as
the direct draw's.

The arguments' buffer counts among the draw's reads as an index buffer does (draw_reaches,
Managed copies), and the command buffer keeps it until it retires. The pass's first barrier
(Reach::Commands, which has INDIRECT_COMMAND_READ) and the encoder's memory barrier make earlier
writes visible to the read. An offset not a multiple of 4 or without the arguments' 16 bytes (20
indexed) is Refusal::IndirectOffset; arguments at a block byte not a multiple of 4 are
Refusal::ArgumentPlace; an indexed draw's index offset must be a multiple of the index size and
inside the buffer. A device that takes firstInstance 0 alone under a divided step rate refuses
an indirect draw through such a state (DividedBaseInstance), since the GPU reads the base
instance.

Floor: drawIndirectFirstInstance joins REQUIRED (Vulkan 1.4 requires it), so Metal's base
instance is the device's own. The translator is not told. The venue dumps report it true on
every venue: m3-max-48727, 48728, 48729, 48730, 48731, 48736, 48737 and 61508. tests/floor.rs,
the README floor table, regen_device_profiles.py's RUNTIME_FLOOR and profiles/runtime-floor.json
add it. The translator's tests that read runtime-floor only see indirect_needs_arguments become
false more often, which none asserts the other way.

Known gap (README): an indexed indirect draw's index count is the GPU's, so a count past the
index buffer is not refused as a direct one is. Without robustBufferAccess2, which the floor does
not require, a count past the block's VkBuffer is outside valid usage
(VUID-vkCmdDrawIndexedIndirect-robustBufferAccess2-08798).

The encoder's doc no longer lists `useResource:` as not built (it is, since 62b3e5a250).

Docs: README, REFUSALS.md and METAL-COVERAGE.md (the three selectors now implemented), the
api_signatures table (three methods).

Tests: draw.rs's every_device_draws_from_indirect_arguments_a_blit_wrote: arguments written by a
blit earlier in the command buffer, at offset 16, draw the constant-step triangle as the direct
draw does (vertex 1, instances 1 and 2 at base instance 1), indexed through [7, 0, 1, 2] from
index 1 at base vertex 1 too; arguments of no instances draw nothing. patch.rs's
every_device_draws_patches_from_indirect_arguments: two patches from arguments 4 bytes in draw
as the direct patch test's, and a patch index buffer is PatchIndexBuffer.
2026-11-21 00:02:34 -08:00
Anees Iqbal 4cf936ed4d Identity domains test: the ulong test's written image drops a write outside it where robustImageAccess does
What: ulong_texture_slots_are_rg32_elements_their_resource_ids_name gave every image the
robustness of robustImageAccess2 alone. On the profile without robustImageAccess2
(moltenvk-m3 without it), lanes 16 and on write outside the written image, which the translator
leaves to the device under robustImageAccess at either level (contain::device_drops_texel_writes).
The interpreter trapped there (m3-max-62051: ImageOutOfBounds { image: 6 }, invocation 16). The
read images keep robustImageAccess2's robustness, since the shader checks every read without it.
The written image now drops an outside write where the profile has robustImageAccess, and still
traps where the shader must guard.

Why: the product is unchanged; the test modelled the device's write robustness from the wrong
feature. Verified by the item 11 test job that follows this commit.
2026-11-20 23:30:53 -08:00
Anees Iqbal 95cd368f99 Identity domains test: the ulong test binds its arrays' elements from 0
The interpreter binds a runtime image array's elements from element 0, as many consecutive ones
as are bound; the test bound the sampled array's elements 1 and 2 and the storage array's 3
alone, so both arrays had no element and the first read trapped (m3-max-61897: lavapipe,
ImageOutOfBounds of image 0 at invocation 0). The elements below the named ones now hold a
one-texel filler, which no thread reaches, as the texture-atomic test's do.
2026-11-20 22:28:52 -08:00
Anees Iqbal 4f6dc912f3 Identity domains: a plain ulong texture slot is the RG32 element its resource ID names
A `ulong` texture slot that no `ulong` atomic updates is an `RG32` unsigned image whose two words
the shader joins and splits (`TexelClass::Uint64`), declared `Rg32ui` where it is a storage image
(`ulong_format`, under the floor's `shaderStorageImageExtendedFormats`). Under the identity domains
identity_class refused every `ulong` declaration, so such a kernel was
`Unsupported{IdentityDomains}` ("a type the identity arrays hold no element of"). It now admits it:
its class is the unsigned integer class of its shape, as its declared image is, and a storage
declaration of `Rg32ui` is the class `StorageFormatClass::Format(R32G32_UINT)`, whose variable is
the storage-image array's (set 1, binding 1, which every storage class aliases), as Metal binds
only an `RG32Uint` texture there. A slot a `ulong` atomic updates (an `R64ui` image) and an
argument buffer's `ulong` texture stay refused. The default domains are unchanged.

Docs: RESOURCE-ID.md's arrays name the `RG32Uint` storage class of a `ulong` texture; API.md's
identity forms name a `ulong` slot's reads and writes.

Test: engine_identity's ulong_texture_slots_are_rg32_elements_their_resource_ids_name: the owned
fixture unk_ulong_access (a sample-access and a read-access `texture2d<ulong>`, a write-access
`texture3d<ulong>`) under the identity domains on lavapipe, moltenvk-m3 and moltenvk-m3 without
robustImageAccess2: each passes L3, its classes are the sampled array's unsigned 2D class and the
storage array's 3D `R32G32_UINT` class, and on the CPU interpreter each of 20 threads reads its
elements' two words joined as `(v, 0, 0, 1)`, `(0, 0, 0, 1)` outside the textures, and writes the
sum's two words inside the texture alone.

SEMANTICS_VERSION 2246 -> 2247: a refusal becomes a module.

Evidence:
- The 9 public conformance cases on the plain ulong slot (unk_ulong_rw x7, unk_ulong_access
  x2): before, at f3418eacb9 on lavapipe (m3-max-61725), the 2 access rows not_supported;
  after, at 2796fb6e14 (an earlier form of this commit), 9/9 match, the 2 access rows on
  runtime-compute (m3-max-61703).
- States-only play of all 36 streams at 3bb97361a8 (an earlier form of this commit plus probe
  commits that never land): every render and compute pipeline state made, 0 refused. msi
  m3-max-61733 (1 stream), um870 61734 (1), um790 61760 (5), ms01 61775 (7), gem10 61795 (22).
2026-11-20 22:10:44 -08:00
Anees Iqbal 27cbf8a7df Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-20 23:59:16 -08:00
Anees Iqbal 3ecf606aa8 Stage io: an index not shown the same across a primitive is refused; the selected index store goes
Metal's shading language leaves a primitive whose vertices write different indices undefined:
"You must return the same value of [[render_target_array_index]] for every vertex in a primitive.
If values differ, the behavior and value passed to the fragment function are undefined." The same
sentence covers [[viewport_array_index]]. The selected index store answered that case with the
first vertex's index, through the synthesized geometry stages, and MoltenVK's profile could take
DriverDeviation::MetalFirstVertexIndices to store it as written. Both reproduced undefined Metal.
The runtime never reached either: it enables no geometryShader, and no profile takes the
deviation.

After this change every profile has one form. An index that the function's structure shows to be
the same at every vertex of a primitive is stored to Layer or ViewportIndex where
shaderOutputLayer or shaderOutputViewportIndex is enabled. Without that feature it is refused as
Unsupported(LayeredRendering), or as Unsupported(VertexAmplification) for an index the
amplification's offset alone sets. The refusal needs the output feature only; geometryShader is
no longer offered. An index not shown the same is refused as NotImplemented(LayeredRendering) on
every device. index_store's comment cites the two spec sentences as the reason for that refusal.
It cites Vulkan's same-value rule (VUID-VkPipelineShaderStageCreateInfo-stage-02596 for Layer,
-02597 for ViewportIndex) as the reason the index is not stored as written. A device without
multiViewport still stores no viewport index.

Removed:
- IndexStore::Selected, indices_selected, selected_index;
- StageIoPlan::indices_selected and first_vertex_indices_by_device, and the compile layer's
  requirement;
- IoRole::SelectedLayer and SelectedViewport, with their codec tags;
- VaryingKey::selected_layer and selected_viewport, with their key tags;
- GeometryStages::layer and viewport, the stages' Layer and ViewportIndex stores, and the
  Reason's index half;
- RuntimeFact::SynthesizedGeometry's layer and viewport fields;
- DriverDeviation::MetalFirstVertexIndices, its last variant, and with it the DriverDeviation type
  and DeviceProfile::takes_driver_deviation;
- VkProperty::MetalFirstVertexIndices and its codec tag.

The geometry stages keep the barycentric weights and the fan-out. A fan-out stage past the
geometry limits is now refused as RasterizationRateMap needing the limit. Before, it was refused
as LayeredRendering with an empty alternative, because the stage's reason held neither weights
nor an index.

Rule 1: no note stops being raised. The first-vertex form raised none. The input it served is now
a typed refusal, so no difference goes silent. The catalogue is unchanged.

The command line: no code there names a removed item. Translating a vertex function whose index
is not shown the same now prints FALLBACK (NotImplemented LayeredRendering) on a geometryShader
profile, where before it compiled with the stages. Validation: four authored cases compiled on
every profile-leg but moltenvk-m3 through the stages: 07f125464dac, 434e73e03189, 7ce6dea0475e
and a013a2bcbe56. On moltenvk-m3 they were refused needing geometryShader. They are now refused
on every leg; the authored compile census takes them at the next named pin, not in this change.
The coverage census test that read three geometry stages from engine/rt6_first_vertex now reads
them from engine/bary_weights on the 780M profile without fragmentShaderBarycentric.

Fixture: engine/vertex_amplification's amp_vertex and amp_vertex_layer now take their viewport
and slice from the instance (iid & 1) instead of the vertex (vid & 1). The amplification and
render-target-slice tests then still compile them, and engine/rt6_first_vertex carries the
per-vertex case. The fixture was regenerated by scripts/regen-air-fixtures (Apple metal
32023.922, llvm-dis 21.1.8).

Tests:
- engine_selected_indices becomes engine_target_indices, covering:
  - a uniform slice or viewport takes the output or nothing else;
  - no multiViewport stores nothing;
  - per-vertex indices are refused on every device;
  - the floor's zero reads;
  - the weights' stage beside a vertex Layer is not implemented.
- link/tests/geometry.rs loses its two selected-index tests.
- engine_amplification, engine_render_target_slice and engine_stage_io now expect the builtin and
  the output-only refusal.
- runtime-floor now requires shaderOutputLayer, so the tests that need a device without it
  withhold the feature from the floor's description (engine_target_indices, engine_amplification,
  engine_stage_io).

Bless due until the next named pin, where the M3 bless job takes them; nothing is blessed here:
- tests::air_input::engine_fixtures_match_their_golden_printout: vertex_amplification's printout;
- tests::public_fixtures_engine (the inventory):
  - rt6_first_vertex and rt6_first_vertex_point become NotImplemented(LayeredRendering) on every
    profile;
  - amp_vertex and amp_vertex_layer become ok on moltenvk-m3;
  - each LayeredRendering cell that offered GeometryShader loses that alternative;
- tests::golden_hashes, and pipeline::compile::tests::the_old_render_descriptor_key_keeps_its_value
  (the render key): the profiles' fingerprints change with VkProperty's codec;
- the authored compile census.

SEMANTICS_VERSION 2245 -> 2246 and ARTIFACT_FORMAT_VERSION 582 -> 583.
SEMANTICS: an index store changes form. ARTIFACT: the codec loses two IoRole tags, a VkProperty tag
and two RuntimeFact fields. RUNTIME_VERSION stays; runtime-sources.sha256 takes the new hash, and
api_signatures is blessed. docs/REFUSALS.md is regenerated. The runtime README's known gap for a
differing index names the refusal as not implemented and drops the geometry stage form. API.md's
layered-rendering bullet, its RenderPipeline stage list and its profile accessors, and
ARCHITECTURE.md's link line drop the selected index.

Consumer check (consumer_check.sh, consumer development b76d6ac4a9):
- MetalFirstVertexIndices, SelectedLayer, SelectedViewport, selected_layer, selected_viewport,
  SynthesizedGeometry, driver_deviations and DriverDeviation: 0 hits.
- GeometryStages and takes_driver_deviation: in crates/reims-vgpu-c/link-order.txt only.
- DriverDeviation and takes_driver_deviation are named in crates/reims-vgpu-vulkan/src/gpu/rgbx.rs
  and encode_render/tests/metal_tests.rs on some of the consumer's steelbrain/* branches, for
  MetalSampler, MetalHalfConversion and MetalVertexSimdgroups, which the stack below already
  removed. development has neither file.

Verified (jobs read):
- m3-max-61766: lint in every configuration and the suites at this change on the earlier stack
  (eeef281428); its reds were the bless-due goldens above.
- At the stack's tip over this change (dvl-5 1fa4aed963 and dvl-6 92fe40c38f): 61978 and 61987,
  fmt, clippy in every configuration, Rustdoc, each feature alone, the API docs and the Windows
  clippy, green; 61891, the suites at dvl-4: 13 failures, each a bless-due golden above or
  development's own (the raster state test, the inventory's sample_fill rows); 61968, the lavapipe
  device suite of metal2vulkan-validation, 1483 of 1483.
- m3-max-62042: the metal2vulkan-validation suite at dvl-5, 1378 of 1378 passed.
- States-only play of this change's player (p-si.zst) over the 36 streams on um870 (61909),
  gem10 (61912), ms01 (61958), um790 (61990) and msi (62045): 502,920 render and 108,189 compute
  states made, 0 refused, every stream exit 0.
2026-11-20 23:23:51 -08:00
Anees Iqbal 7d106c865a Bless at the pin tip 6c0b1a7f77: golden tables, compile census and the render key
The pin after the private-memory arena (c034220175..8e42292284) and the argument buffers'
constexpr-sampler switch (5cd5de678f). Development's checks at 8e42292284, the last product commit
under this tip (everything after it is validation, its doc and scripts): quick m3-max-62138 green
(clippy plain, --cfg m2v_gpu, --cfg m2v_cpu_icd, doc, rt on lavapipe 527/527); suites m3-max-62141:
validation 1378/1378, conformance 1014/1014, doctests, product 4108/4116 with 8 reds, all bless-due.
GOLDEN read "bless due (stale cells only, keys changed)".

- golden_hashes.tsv, public_fixture_expectations_engine.tsv and air_input/sample_fill.txt: the M3
  bless at 6c0b1a7f77, m3-max-62209 (bless-job.sh; inventory, golden and printouts rc 0). The
  engine/sample_fill fixture gets its inventory, printout and hash rows; the rest are cells keyed
  by the profile fingerprints and SEMANTICS 2245.
- authored-compile.tsv: the census at 6c0b1a7f77, m3-max-62210 (census rc 0). The executor moves
  from vulkan-engine-v191 to v197 and 40 rows move, each by a landed ruling that the case is the
  runtime's limit: 22 vertex cases that bind a visible function table become
  not_supported{render_function_table} (fc168d0173), 9 rows of 64-bit texture atomics move from a
  missing device capability to not_supported{ulong_texture_atomic} (1d16171943), 5 to
  separate_depth_stencil (6af76cf309) and 2 to index_buffer_past_end (9a28de4736); 2 compiled rows
  change only their artifacts.
- the_old_render_descriptor_key_keeps_its_value: the key m3-max-62237 computed at 6c0b1a7f77
  (4affc4d37cf7...), the value the test says to write; it moved with SEMANTICS 2243-2245.

Verified: the three M3 jobs above, each rc 0 at 6c0b1a7f77; privarena's reruns of the same 8 reds
with their full messages (m3-max-62093, 62137) read the same cells and the same key.
2026-11-20 23:57:02 -08:00
Anees Iqbal 6c0b1a7f77 Validation: candidate rows and refusals drop their "backend" field, and Backend goes
8d573e9cbc left observation::Backend as the literal type of one
serialized field, "backend":"vulkan", on every candidate row and refusal.
This commit drops that field from CandidateObservation and
RefusalObservation, deletes the enum, and rewrites the committed shards
without it.

The shards: 12 of the 41 committed shards hold records (24 under
observations/vulkan, 17 under observations/refusals/vulkan). Their 56
records were rewritten by the store's own writer, not by an edit. Job
m3-max-61965 (homelab-gem10-1) built scratch commit 73dd795b28, which
never lands: this commit's code plus a one-shot store method behind
`corpus-status --drop-backend-fields`. The method read every record,
removed its backend field, refused any record whose backend was not
vulkan or which the strict reader refused without the field, and wrote
each shard through stored_jsonl in one recoverable transaction. Then:
- "drop-backend-fields read=56 written=56 refused=0";
- rowdiff (each old record less "backend" against the new record, as
  JSON): rows files=24 records=42 equal=42 differ=0, refusals files=17
  records=14 equal=14 differ=0, rc 0 for both. Re-run here on the
  copied shards: the same counts. Every changed line is also the old
  line with `"backend":"vulkan",` removed, byte for byte (56 of 56);
- corpus-index at that build, cold and then warm on a fresh index of
  the public checkout: both synchronize, the warm pass with
  source_shards_scanned=0 source_bytes_scanned=0 rebuilt=false. In
  this public-only checkout the cold pass scanned none either. The index
  read every candidate row back (31 public, 11 private-AIR rows counted
  as not indexed), and corpus-status's evidence ran (rc 0).

No version moves. No cache keeps parsed rows across a shard change:
the index's candidate table is cleared and refilled from the shards on
every sync, and C3 and corpus-status read the shards themselves.
ENGINE_EXECUTOR_ABI would make every recorded row stale on every
venue, and nothing about what a row records changed. No private store
holds rows: corpus/local has sources, library modules and its index,
and every candidate row and refusal, private-sourced cases' included,
is in these committed shards.

Caveat: a batch out directory written by an earlier build (a venue
rerecord's rows.jsonl and refusals.jsonl) carries the field, so this
build's --batch-install refuses its records (deny_unknown_fields). Such
a directory is installed by the build that wrote it.

Tests: the backend fields go from every row and refusal the tests
build (observation, store, index, C3, batch, refusal, out-of-bounds and
profile tests).

Verified: the job above. This commit's own compile and suites are not
yet run; a gate covers them.
2026-11-20 23:14:49 -08:00
Anees Iqbal 8d573e9cbc Validation: the one-variant candidate Backend no longer threads through the executor
d54a1a5568 left observation::Backend with one variant, Vulkan, so every
parameter, key and check that carried it decided nothing. This commit
removes all of them. One use stays: the rows' and refusals' serialized
"backend":"vulkan" field. Every committed row carries it, and so do the
private store's rows on msi. Dropping the field means rewriting both
stores through the store's writer, and the private rewrite waits for
msi's hold to lift. So the field goes in its own commit, together with
that rewrite. Until then Backend is the field's literal type and nothing
else.

What goes:
- The store: read_candidates and read_refusals take no backend.
  refusal_directory(backend) is now the REFUSAL_DIRECTORY constant,
  beside CANDIDATE_DIRECTORY. The "wrong backend directory" checks and
  the backend in a candidate slot's key go too: a row's field can hold
  only vulkan, so no check could fail.
- CandidateDependencies::backend and its dependency check.
- The executor: engine::execute, execute_case, execute_prepared,
  run_on_context, platform::execute_engine and execute_engine_render
  take no backend. DeviceInput (the device worker's input) has no
  backend field. run_on_context's runtime routing loses its
  `backend == Vulkan` term. check_backend is deleted. It refused a
  context that opened MoltenVK, and validate_host (was
  validate_backend_host) already refuses every candidate run on macOS,
  the only host MoltenVK runs on.
- C3: VenueKind::backend, Venue::backend, VenueSlot::backend. VenueKeys'
  insert, expected, holds and artifact_is_current, and Venues::venue_of,
  take no backend.
- The index: candidate_staleness, candidate_slot_state,
  refusal_staleness, refusal_is_current and candidate_state take no
  backend. The candidate_observations table loses its backend column; its
  key is (case_id, environment_id). Every sync clears the table and
  refills it from the shards, so an older index's table (one with the
  column, or one without translator_fingerprint) is dropped and made
  again (ensure_candidate_columns, which replaces
  ensure_candidate_fingerprint_column). The evidence slots still name
  "metal" or "vulkan".
- The batch: BatchBackend::candidate and From<Backend> go.
  vulkan_batch::install takes no backend; it refuses an out directory
  whose record is not a Vulkan batch's, as before. find_row and
  find_refusal take no backend. BatchBackend keeps its two variants,
  Vulkan and Metal.
- corpus-vulkan: candidate_common::main and candidate_batch::serve take
  no backend; their messages name corpus-vulkan.
- corpus/README.md: a candidate slot is (case_id, environment_id).
  corpus-status's --rekey-venues help loses "of either backend".

No version moves. No row changes: each still records "backend":"vulkan",
and the executor enables, binds, submits, reads back and records what it
did. The index's table is rebuilt by its own migration.

Tests: the backend arguments go from the store, index, C3, batch,
admission and platform tests, and the BACKEND and HOST_BACKEND constants
go with them. The device worker's integration input drops "backend".

Verified: not yet compiled; a gate covers it.
2026-11-20 23:14:39 -08:00