Commit Graph
2015 Commits
Author SHA1 Message Date
Anees Iqbal c44e588007 Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-21 02:56:16 -08:00
Anees Iqbal 2a054f7785 Translator: the emitted words are the only words check; the size estimate goes
Selection summed a word cost per strategy and per interface part into a `SizeEstimate` and refused
the function `LimitExceeded(SpirvWords)` before emission when the sum passed the cap. The sum was a
forecast, not a bound, and it overshot: a guest kernel (function hash 4cc9c0bb, Iris profile, on
the command-line path) estimated 30,197,397 words against the 16,777,216 cap and emits 8,589,684
(job 62553), so it was
refused for a size it does not have. The cap already held exactly on the serialized module; that
check is now the only one (`pipeline::compile::lower_bounded`). That kernel is now refused by what
it holds, `LedgerBytes` at 450 MiB; a function the estimate overshot that fits the ledger can now
translate (none in this library does).

Removed with the estimate, as nothing else read them:
- `lower::estimate` (`SizeEstimate` and its frame costs), `Plan::estimate`, the check in
  `stage_bound::emit` (which no longer takes the cap) and the selection's block count;
- the word sums that fed only the estimate: the stage interface's (`StageIoPlan::words`, its
  parameter, object, store and rounding costs, and the fragment family's input attachments,
  discards, interlock, sample loop, snapshots, imageblock, storage form, shader stencil, logic
  operation, blends and word merges), the tessellation and mesh interfaces', the dispatch forms',
  a module blob's, the tile staging's, and the emulated tier's and the predicated walk's extra
  words, with `Predication::reloads`;
- the predicated walk's second structurization before emission, which only measured its
  constructs for the estimate (`structurize::emit::construct_words`).
The per-strategy costs and shared-routine costs the `StrategyCensus` reports stay.

Public: `EntryPlan::estimated_words` goes. The consumer's checkout (reims-vgpu at 44d738908a) has 0
hits for `estimated_words` and for `EntryPlan`. `tests/api_signatures.tsv` loses that one row;
`tests/api_surface.rs`'s pinned names do not move (`EntryPlan` stays).

Tests: the checks that the estimate bounds the emitted words go from the tests that also check
something else; the tests that checked only that go (every stage, simd, leaf, tail, coordinate,
bicubic, snapshot, pulled-fetch and shared-switch entry's estimate, the large predicated body under
a multiple of its words, and the skeleton's estimate bound). The word cap's test keeps both sides
on the emitted words: a module compiles at a cap of its own words and is refused one word below.

SEMANTICS 2253: a function the estimate refused can now translate, and the refusal of one that
does not fit names the ledger. docs/REFUSALS.md regenerated: `SpirvWords` has the one site.

Verified:
- The gate on this change over f3f661dd14 (job 62796): fmt, the API signatures, clippy plain,
  --cfg m2v_gpu and --cfg m2v_cpu_icd, workspace Rustdoc and doctests green; nextest of
  metal2vulkan and metal2vulkan-runtime 3464 of 3468, the four reds development's own suites show
  at f3f661dd14 (m3-max-62774): the old render descriptor key, which hashes SEMANTICS_VERSION,
  and the new icb_indexed_extras fixture's golden cells, AIR printout and inventory part, all
  blessed on development.
- Every kernel of the guest library (63, by hash), on the command-line path: intel-irisxe-anv's
  runtime-policy device file, the release command line before (fe1e8780a2) and with this change
  over it, alternately per kernel on one node (job 62742). 62 keep their outcome and their
  output's hash; the one difference is 4cc9c0bb, refused SpirvWords before and LedgerBytes after.
  It is the slowest row and the largest peak on both sides: 2.55 s and 309 MiB before, 2.86 s and
  470 MiB after (it now runs into emission before the ledger refuses it). Total wall 12.0 s
  before, 12.3 s after.
2026-11-21 02:53:10 -08:00
Anees Iqbal 2bbf157668 DevicePolicy::default() is the identity domains; the resident-table domains become RESIDENT_TABLES
What: DevicePolicy::default() now returns the identity pointer and handle domains, the policy
metal2vulkan-runtime compiles under. DevicePolicy::UNTRUSTED is renamed RESIDENT_TABLES. It stays
for the validation executor's own context (candidate/platform/compute.rs and the engine tests
that build a resident root and a handle table themselves) and for the translator's tests of that
lowering, which name it where they took default() before. The runtime takes default() instead of
setting the two fields itself.

Every tool that took default() now compiles under the runtime's policy:
- the command line's --profile;
- the compile worker;
- the authored compile census, the corpus translation audit and corpus-pipeline;
- acceptance, the tier table and specialization attempts;
- the golden table, whose devices take default() (its policy field goes).

Why: the planner's ruling (b), one policy constructor, so a tool and the runtime agree on the
policy. The description can still differ: --profile takes the profile's description, while the
runtime takes the device's, restricted to the features it enables. repro.rs and README say so.

Docs:
- README's --profile paragraph and the command's help text.
- API.md section 1: the identity domains are listed first, as the default; the resident-table
  domains are the validation executor's.
- device/mod.rs, policy.rs and profile.rs.
- api_signatures.tsv renames the const.
- api_preview's buffer carries a device address equal to its gpuAddress, as the runtime makes it.

No SEMANTICS bump. For a given description and policy, the translator's output is unchanged. The
profile fingerprint covers the policy, so every cached artifact and golden cell whose output moves
does so under a changed key; the golden check reads those cells as re-keyed, a bless due. No bless
here.

Consumer search (consumer-uses.sh) at the consumer's development e76e2ffeb4 and 46 lane refs
younger than a day:
- UNTRUSTED, RESIDENT_TABLES, PointerDomain, HandleDomain and from_queries: 0 hits.
- DevicePolicy: 13 lane refs only, all in the deleted runtime's policy struct (fields this tree no
  longer has); none on development.

Expected census at this commit, not yet rerun: m3-max-62608's identity column, taken at
58bea6ca1c through a scratch policy switch.
- Translation audit, of 17,206 rows: 15,176 translated on runtime-floor, 15,266 on lavapipe,
  15,476 on amd-rdna3-radv and 15,459 on nvidia-rtx50-linux.
- Authored compile census: 6,266 of 7,128 cells.

Verified:
- cargo fmt --all;
- scripts/refusal-surface/refusal_surface.py leaves docs/REFUSALS.md as it was.
2026-11-21 02:36:53 -08:00
Anees Iqbal f3f661dd14 Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-21 02:32:53 -08:00
Anees Iqbal 22ae7df766 rt: indirect command buffers of indexed draws on VK_EXT_device_generated_commands
What: the first cut of Metal indirect command buffers, the runtime's half, in one commit: the
device's extension, the buffer object, the executions, the reset and the pool depend on each
other, and any part alone would be dead code.

- The device enables VK_EXT_device_generated_commands with VK_KHR_maintenance5 together where
  both are reported (floor::INDIRECT_COMMANDS), and nothing else chooses a form. maintenance5 has
  one form here: rt takes nothing of it but the BufferUsageFlags2 a preprocess buffer needs, and
  its A8 format stays untaken. dgc.rs declares the extension's structures by hand, each size and
  offset checked at compile time against the spec's layout; it goes once ash binds the extension.
- IndirectCommandBuffer, IndirectCommandBufferDescriptor and IndirectCommandType
  (Device::new_indirect_command_buffer): indexed draws that inherit the pipeline state and bind
  their own buffers, at most 31 a stage; records in a Private block, reset from the device's
  template at the next commit. gpuResourceID is the records' device address.
- RenderCommandEncoder::execute_commands_in_buffer (a CPU range) and
  execute_commands_in_buffer_with_range (a range read from a buffer, executed at full capacity
  with the SEQUENCE_INDEX token): one PUSH_CONSTANT token a run of slot words, the index buffer
  token and the indexed draw, through the inherited pipeline; the push constants and the index
  buffer are pushed again after an execution. Every execution runs as one
  vkCmdExecuteGeneratedCommandsEXT a part of CHUNK = 64 commands, in order, on every device (the
  planner's ruling: one execution of more drew wrong on the XTX past ~4 MiB of generated commands
  and out of order on the 2080 past 64 sequences); each later part pushes its first command
  (PushField::IndirectBase) and takes its own preprocess offset in the execution's one region. A slot a command binds is pushed the widest bounds,
  unchecked, as a loaded pointer's access is (README, SlotBounds).
- BlitCommandEncoder::reset_commands_in_buffer (copies from the template in regions) and
  optimize_indirect_command_buffer (no work); useResource of an indirect command buffer in the
  compute and render encoders, and RenderCommandEncoder::use_heap.
- Preprocess memory: sized from vkGetGeneratedCommandsMemoryRequirementsEXT with the inherited
  pipeline per (content, raster state, record layout) at a part's 64 commands in a cache of
  SHAPES = 256; layouts LAYOUTS = 64;
  templates TEMPLATES = 16, each at most 64 KiB. Each a fill-past-capacity test. A new pool of
  regions (its own VkBuffer and VkDeviceMemory each, usage2 PREPROCESS | SHADER_DEVICE_ADDRESS, a
  memory type from the requirements' bits, device-local first, rounded to 64 KiB): one taken at
  record time per execution (an idle one at most twice its need, else one made), given back when
  its command buffer retires, the oldest idle ones freed past IDLE_BYTES = 128 MiB. At rest it
  holds idle regions up to 128 MiB, freed at device drop. No execution waits or is refused for
  the pool's sake. Not the block mechanism: blocks are made with the floor's one usage on every
  device, and adding the preprocess bit on DGC devices alone would be a second form; the memory
  types come from the driver's per-layout requirements. Gauges of the used and idle bytes: flat
  between iterations 100 and 200, zero at device drop (tested).
- Typed refusals by name (Gap::IndirectCommandBuffers with IndirectCommandsKind): no extension,
  other command types, per-command pipelines (everywhere), inherited buffers, bind counts past
  31, capacity, an unflagged state, a draw input the commands cannot carry, more tokens than the
  device takes; Refusal::CommandRange for ranges past the commands.
- README: indirect command buffers and their known gaps (b1's two costs, the preprocess cost,
  lavapipe's preprocess size defect verbatim, the Iris, UHD 630 and Mac host lines, the parts
  and their measured cost), the
  extension rows; METAL-COVERAGE and REFUSALS regenerated; api_signatures blessed.

GetDeviceProcAddr audit (verified by grep of the runtime's loads): every device function rt
loads belongs to an extension enabled at the load. calibrated_timestamps is a floor extension;
feedback_loop_dynamic_state loads only under the feedback loop; device_fault loads only where
device creation enabled it; external_memory_fd,
external_memory_win32 and external_memory_host load only where enabled(); Dgc::load runs only
where INDIRECT_COMMANDS is enabled.

Verified: see the lane's report (compile gate, lavapipe and GPU device tests).
2026-11-21 01:53:50 -08:00
Anees Iqbal d9ba8d0e72 Translator: GPU-encoded indexed triangle draws into indirect command buffers under the identity domains
What: the first cut of Metal indirect command buffers, the translator's half.

- pipeline::IndirectDrawLayout (public): the record contract the runtime and the lowering share.
  A 24-byte header (capacity, vertex and fragment slot counts and stride as u32, then the reset
  index address as u64 at 16), then command i at 24 + i * stride, stride = 8 (Nv + Nf) + 40:
  the slot words (the buffer's address less 2^31, the word an execution pushes as the slot's
  SlotGuestBase), the index token's data, the sequence index and VkDrawIndexedIndirectCommand.
- lower/access/icb.rs: under the identity domains, a function's render_command
  set_vertex_buffer, set_fragment_buffer, draw_indexed_primitives of triangles and reset write
  the records through the gpuResourceID an argument buffer's command_buffer member holds, each
  only where the command's index is below the capacity (and a slot below its stage's count).
  Every other indirect-command operation stays Unsupported{GpuEncodedIndirectCommands,
  NotImplemented}; a vertex or fragment function without its stage's store feature and a device
  without device addresses refuse by name.
- LoweringInputs::indirect_range with PushField::IndirectRange, PushField::IndirectSequence and
  PushField::IndirectBase: a vertex function of a state made with supportIndirectCommandBuffers
  reads the execution's range and its command (the sequence index plus its part's first command)
  in its first block and draws nothing for a command outside the range, so an execution over a
  range a buffer holds runs at full capacity (one SEQUENCE_INDEX token), in parts. Such a state's
  vertex function pulls every attribute it reads.
- Fixture engine/icb_indexed_extras (MSL we wrote, regenerated by scripts/regen-air-fixtures):
  a reset kernel, a vertex function that reads before its buffer's address, and one of fourteen
  vertex buffers (a state of more tokens than lavapipe's 16). Inventory rows added by hand (the
  fourteen-buffer vertex function's thirteen constant buffers pass the runtime floor's twelve);
  the golden hash rows, the air_input printout and the old render descriptor key come with
  development's bless.
- SEMANTICS_VERSION 2252 and ARTIFACT_FORMAT_VERSION 586 are placeholders one above
  development's (2251 and 585); the lowering's emission and the encoded lowering inputs change.
- docs/API.md states the forms; docs/REFUSALS.md regenerated; api_surface and api_signatures
  carry IndirectDrawLayout.

Why: the cutover's guests encode indexed draws into indirect command buffers from kernels, which
the identity domains refused.

Verified: see the lane's report (compile gate and test jobs, the states-only play).
2026-11-21 01:50:00 -08:00
Anees Iqbal 52ee4de509 rt: a commit takes the Managed ranges named since the last, with commands or none
Before this change, a commit captured the Managed buffers' named ranges only if its command buffer
had commands. A command buffer with nothing for the GPU (no commands, or only dispatches the
runtime elides: a kernel that writes no memory, or a grid with no thread) took no submission. So
its copy-in waited for the next command buffer that did submit, and a program's "upload now"
commit uploaded nothing: the upload slid into its next, timed commit, and the wait on the
upload commit covered no copy.

Now every commit captures. In the submit thread, a command buffer with nothing for the GPU that a
copy-in waits for (Captured::waits_for: the oldest captured at or before its commit number, the
taker rule) leads a group as one with commands does. The copy-in becomes its submission, and it
completes after it. Elided dispatches stay elided. One with nothing named still takes no
submission.

Its other answers keep Metal's empty shape:
- It is scheduled as it joins, with its scheduled handlers run before the submission.
- It retires in flight order, with its completed handlers, Completed status and the wait.
- It writes no timestamp, so its GPU start and end are one time (command::retire's empty branch).
- The copy-in counts in runtime_command_buffers with its own timestamps.

This is within documented Metal: a named range may be taken at any commit after the naming. On an
AMD Radeon Pro 5300M, Metal takes it at the first commit whose encoder binds the buffer. The
runtime takes it at the same commit where that commit binds the buffer, an earlier one where it
binds nothing, and never a later one.

Docs: did_modify_range, the runtime README (the Managed section, the empty command buffer, GPU
times) and docs/API.md's accepted difference. The internal docs in capture.rs and submit.rs are
updated too.

Tests: the two device tests of the previous commit, and a host check of waits_for.
2026-11-21 01:49:57 -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 1208372eb9 Architecture: canon's unrolling also decides a filter nest's texel offsets 2026-11-21 01:22:31 -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 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 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 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 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 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 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 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 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 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 d54a1a5568 Validation: the MoltenVK backend, its C3 venue and the old engine's baseline are deleted
The validation executor's Vulkan side runs on Linux through native ICDs
and the runtime. No lane records MoltenVK rows any more, and no MoltenVK
venue is wanted. This commit deletes the MoltenVK backend from the
store up.

Before the deletion, git grep at e35d9098c0 showed these readers of
Backend::Moltenvk rows outside tests:
- C3's input (c3.rs: C3Input::moltenvk, the baseline, the old-mismatch
  ledger), its venue kind (venues.rs), the evidence census
  (index.rs: the index's candidate table and evidence_status);
- the store's own layout check, shard rewrite and rekey;
- the batch's worker store, which linked the other backend's rows;
- the corpus-moltenvk binary, the host and driver checks
  (candidate.rs, platform/compute.rs) and candidate_batch's CPU refusal.
Every one goes or loses its MoltenVK arm here. No reader is left.

What goes:
- The corpus-moltenvk binary (Cargo.toml entry included), and
  Backend::Moltenvk and BatchBackend::Moltenvk. Backend keeps one
  variant, Vulkan. Collapsing it is a follow-up commit.
- corpus/observations/moltenvk: 64 shards, 4,809 rows. 4,802 of them
  are old-engine rows in about 60 slots: apple-m3-max-moltenvk 1,137,
  the byte-exact-* and local-* runs, and probe slots. The other 7 are
  engine rows of apple-m3-max-moltenvk@engine.
  corpus/observations/refusals/moltenvk: 16 shards, 6 refusals.
- The store's MoltenVK shards: its layout check, the aligned rewrite,
  the refusal follow and the rekey now read the Vulkan backend alone.
  The batch's worker store links only the Metal rows. The index stores
  the Vulkan candidates alone, and evidence_status's rows have no
  moltenvk column (corpus-status's evidence line loses it too).
- C3's MoltenVK venue (VenueKind::Moltenvk, c3-venues.json's
  apple-m3-max-moltenvk entry) and with it the old engine's baseline:
  - Population::OldEngineMatched, the baseline closure and the "new
    mismatch" count (SlotReport::new_mismatches);
  - the old-mismatch ledger (LedgerRow, C3Report::ledger, stale_causes,
    unexplained);
  - the reviewed list's old_mismatches part (OldMismatch,
    ListPart, EntryRow::part), and Venues::baseline and by_environment.
  The venue list's MoltenVK-driver check goes too. VenueDevice's
  metal_environment_id, which only an Apple GPU's venue device set,
  goes with Venue::identities_compared_with: a venue run is held to
  all of its devices' identities.
- c3-reviewed.json: the 12 old_mismatches entries (all signed off),
  and the 10 fast_math_regrouping readings whose only observation was
  the apple-m3-max-moltenvk@engine slot. These are the linked-single
  radix 5/7/11/13/15 zero-write cases, two each, all signed off. A
  reading must list an observation, and theirs named a slot that no
  longer exists. A regrouping mismatch of those cases on another venue
  now reads unreviewed until a reading lists that venue's row. The 12
  apple_reading entries are untouched; none named a MoltenVK slot.
- corpus/authored-compile.tsv: the moltenvk-m3 column keeps its cells
  but drops their artifact digests (2,255 cells). Only a C3 venue's
  profile keeps a digest, and moltenvk-m3 is no venue's now. This is
  what a bless writes; the profile itself stays, since the translator's
  tests read it.
- scripts/rerecord-venue's moltenvk kind (and its Homebrew validation
  layer path), and scripts/rerecord-commit's MoltenVK build, install
  and shard paths. docs/VALIDATION.md loses corpus-moltenvk, and its
  venue list names what each venue covers.
- In the docs, the robustness leg's "profile-leg" (validation README,
  corpus README) is now "profile", which 79d95a2887 missed.

What C3 still decides: per venue of c3-venues.json, lavapipe on arm64
and x86 (the public cases) and the 780M, the Iris Xe RPL-P and the RTX
5080 Laptop (every Metal-qualified case), each case's verdict in the
venue's engine slot by the same rules as before (match, reviewed,
device_gap, out_of_scope, reference_gap, mismatch, refused, stale,
missing). It holds when every slot holds, every reviewed observation
holds, every listed reference gap is recorded, every entry and recorded
reference gap is signed off, and no sign-off is refused. It no longer
holds anything to an old-engine population, counts new mismatches
against one, or keeps a ledger of old-engine mismatch causes.

Tests:
- c3/tests.rs: the synthetic MoltenVK venue becomes a native GPU venue
  (GPU, Metal-qualified, still described by the moltenvk-m3 capture).
  Deleted: the baseline test (moltenvk_must_cover_every_case...), the
  ledger test, and the Apple-GPU Metal-environment test.
  Rewritten: the population tests (two populations now) and the
  reference-gap test (on lavapipe's public population). The schema test
  checks its review fields on a reading. The venue checks lose the
  baseline and driver cases.
- index.rs and store.rs tests run their toy rows as Vulkan's. The
  cross-backend checks have no second backend and go.
- vulkan_batch/tests.rs: the MoltenVK batch test goes. The install test
  refuses a Metal batch's record in place of a MoltenVK one.
- tests/integration: the store-layout and worker tests drop
  corpus-moltenvk. fast_trig_within_apples_bound reads the Vulkan store
  and wants one row per venue (5). It wanted 10, which the robustness-off
  and MoltenVK rows made up.

Device-level MoltenVK accommodations stay for the follow-up commit with
the MSL helper, once a grep shows no Vulkan run on macOS: the loader
word, MoltenVK's withheld diagnostics, coverage's robust-buffer host
class and the pipeline flag.

Verified: cargo fmt; no committed observation path, C3 list entry, venue
or script names the MoltenVK backend (git grep). The compile gate of the
Q3 commits follows as a potluck job.
2026-11-20 22:15:53 -08:00
Anees Iqbal 79d95a2887 Validation: the robustness-off leg and its slots are deleted
The ruling Q3: the validation executor runs each case in one context,
which enables every robustness feature its device states. Its second
leg (every robustness feature off, the ID@engine+robustness-off slots)
measured an encoding that metal2vulkan-runtime never runs, since the
runtime's floor fixes the robustness it enables. The tier table keeps
both of its compiles: they are translator coverage of what the runtime
ships, so coverage::Leg stays as the tier table's type alone.

Deleted:
- the executor's leg: corpus-vulkan's and corpus-moltenvk's
  --robustness-off, the device worker's leg, engine_slot's leg (an engine
  slot is ID@engine or ID@engine@P; an ID@engine+robustness-off is no
  engine slot), the enable lists' leg (engine_list enables what the
  description states), and the leg in a row's environment and census
  (ExecutedCensus.leg, environment.robustness.leg) with its validation;
- the batch's legs: corpus-vulkan-batch takes no --leg. Its passes are
  Pass::Engine and Pass::Metal, so a done-list line names "engine" where
  it named "stated", and a log is CASE.engine.txt. Its report lines carry
  no leg= field, and batch-slowest names pass=engine;
- the authored compile census's robustness-off profiles: a profile is
  its committed stem (ProfileStem, which was ProfileLeg); a label with a
  "+" names no profile. corpus/authored-compile.tsv loses its 9
  +robustness-off columns mechanically. Every other cell stays, and the
  reader takes the new layout in this commit. The rows are re-blessed
  at the next named pin. the_committed_expectations_parse holds the file
  to what a bless renders. No test is expected to read red until the
  bless, since no kept cell changed (unaudited until development's census
  runs);
- C3's legs: a venue lists no legs and has one slot (c3-venues.json
  drops its legs fields). c3-reviewed.json drops the 12 observations
  recorded in robustness-off slots;
- the committed rows of the +robustness-off slots: 193 rows and
  refusals out of corpus/observations, which empties and removes 44
  shards. "leg":"stated" is stripped from the remaining rows' census and
  environment;
- scripts/qualify-public-cases' second run per case, and
  scripts/rerecord-venue's --leg; docs/VALIDATION.md's robustness legs.

corpus-triage's usage, corpus-status' --c3 help and the census's file
comment say "profile" where they said "profile-leg".

Verified: cargo fmt. The compile gate follows as a potluck job.
2026-11-20 22:15:02 -08:00
Anees Iqbal c034220175 Private memory past the 16 KiB floor lives in the runtime's arena, one slot an invocation; a dispatch past its budget splits
A kernel whose private arrays (indexed at run time) passed the translator's 16 KiB floor was
refused as Unsupported{PrivateMemory}. The app's 780M library holds 7 such kernels (19,792 to
34,736 bytes a thread), and the Iris walk refused one at 28,704. Metal holds that memory itself.
The runtime now holds it in device memory it owns.

Translator, under the identity domains only (the default domains' binder supplies no such
memory, so they refuse as before):
- memory::plan::private_memory: a kernel with no call stack whose private bytes pass the floor
  places every alloca it indexes at run time in its private arena, and marks the arena
  ArenaLayout::device. The arena then leaves the private bytes. The kernel's own bytes decide;
  no device fact does.
- Such an arena has no Private variable. Its words are PhysicalStorageBuffer words (Aligned 4)
  at the invocation's slot. The slot is PushField::PrivateArenaAddress (a u64) plus
  i * slot_bytes, with i = ((wz*ny + wy)*nx + wx)*n + LocalInvocationIndex in 32 bits. It is
  computed once in the entry block (dispatch::KernelDecl::arena_slot, Invariant::ArenaSlot).
  RuntimeFact::PrivateArena { slot_bytes } states the slot: the arena's bytes rounded up to 16.
- A tile kernel's arena past the floor stays refused (PrivateMemory). A slot past u32 is
  LimitExceeded(PrivateArenaBytes).

Runtime (crate::arena):
- The arena is one Private pool block, never zeroed: Metal's private memory is undefined until
  the thread writes it. The device keeps a Weak to the last block. Each command buffer that
  dispatches into a block keeps it (keep_block), and a dispatch that needs no more than a block
  still kept takes it again.
- A dispatch's slots take at most 1/16 of the largest DEVICE_LOCAL heap, capped at the longest
  block, or one threadgroup's slots where those are more. A dispatch past that budget runs in
  pieces of whole threadgroups through the existing split loop, each piece's DispatchRegion
  carrying its first threadgroup. There is one split form; vkCmdDispatchBase is not used.
- A barrier (the encoder's owed barrier, so it merges with a hazard barrier) comes before each
  arena piece, except the first piece in a block the dispatch took new. Dispatches of kernels
  without an arena take no new barrier.
- An indirect dispatch of an arena kernel is Gap::IndirectPrivateArena: its counts are the
  GPU's, so the runtime can neither size the arena nor split it.
- Metrics::private_arena_dispatches, private_arena_pieces and private_arena_blocks count the
  path, and private_arena_allocations counts the block takes.
- The budget a device test splits with is Core::arena_budget's test override (cfg(test) with
  m2v_gpu or m2v_cpu_icd), never a DeviceOptions field.

Docs: docs/API.md (the field, the fact, the slot formula), the runtime README (Compute
encoders: the arena, its budget, its order, the indirect gap), docs/REFUSALS.md (regenerated),
api_signatures.tsv (blessed).
SEMANTICS_VERSION 2244 -> 2245, ARTIFACT_FORMAT_VERSION 581 -> 582, RUNTIME_VERSION 2549 -> 2550.

Tests:
- engine_private_memory's
  a_kernel_past_the_floor_keeps_its_private_memory_in_the_runtimes_memory_under_identity:
  7176, 9216 and 51,200 words on the 780M's, the Iris Xe's and an RTX 50's profiles. Each compiles,
  passes L3, pushes the address, states the fact, holds 0 private bytes and records no note.
  The default domains refuse as before.
- rt private_arena's
  every_device_holds_private_memory_past_the_floor_in_its_arena_split_or_whole: 28,704, 36,864
  and 204,800 bytes a thread, 8 groups of 64, under the device's budget (1 piece) and a test
  budget (4 and 8 pieces). Every answer matches a CPU reference. It counts 2 arena dispatches,
  their pieces, and exactly 2*pieces - (blocks taken) barriers beyond a plain command buffer's.
  Four plain dispatches take the barriers one does.

The kernel interface declares the arena's slot (Interface::private_arena, the slot bytes of
RuntimeFact::PrivateArena); the compute test's interface sets it to None.
2026-11-20 22:37:06 -08:00
Anees Iqbal df0ed4188e rt: the blit options test compares aspect bits; the ledger follows the plane copies
7ba1cdbf30's suite (m3-max-61836, msi) did not compile the host test: ash's
ImageAspectFlags has no Debug, so assert_eq! of a (flags, bytes) pair fails. The test
compares the flags' bits.

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

The same run also lists 10 argb8-targets-* rows divergent at case/notices
(metal2vulkan-degrade-rotated-blend-rounding) on llvmpipe. They come from development's
own rotated-blend notes, not from this change.
2026-11-20 22:20:00 -08:00
Anees Iqbal 7ba1cdbf30 rt: a blit copy between a buffer and a texture takes MTLBlitOption's plane options
copyFromBuffer:...:options: and copyFromTexture:...:toBuffer:...:options: are
BlitCommandEncoder::copy_from_buffer_with_options and
copy_from_texture_to_buffer_with_options, with a public BlitOption (None,
DepthFromDepthStencil, StencilFromDepthStencil). A plane option copies the aspect it
names, one vkCmdCopyBufferToImage or vkCmdCopyImageToBuffer region of that aspect, where
the pixel format has it: the depth or the stencil of a combined format, and the depth of
Depth16Unorm or the stencil of Stencil8 too, which Metal takes (the conformance crate's
buffer-depth-samples rows put the option to Metal on those formats). The forms without
an option are those of None. The unit is texture.rs's copy_unit of the named aspect, so a
copy into a 32-bit float depth is Gap::FloatDepthUpload as Depth32Float's is, and a
multisample texture stays Gap::TextureBytes; a plane option of a format without its
aspect is Gap::TextureBytes. MTLBlitOptionRowLinearPVRTC is not offered: the runtime
makes no PVRTC texture, and the conformance side keeps it unavailable.

The private buffer_copy takes the direction and the option as one Way, which keeps it
under clippy's argument count without an expect.

Docs: the rt README's blit lines, Gap::TextureBytes's doc, REFUSALS.md (regenerated),
the metal-coverage map (the two options selectors now name the options methods) and
METAL-COVERAGE.md, the public signature table (6 records added, none moved).

Tests: tests/blit_options.rs. On the host, each option's aspect and unit bytes in both
directions, and each refusal. Under a device cfg, a pass clears a Depth32Float_Stencil8
texture to depth 0.25 and stencil 0x5a, a stencil region goes in from a buffer, and both
planes come back out (the region with 0x5a around it, 0.25 at every texel);
Depth16Unorm's depth and Stencil8's stencil go in and come back out bit for bit.
2026-11-20 22:11:29 -08:00
Anees Iqbal 83bde8268f docs: under the identity domains, constexpr samplers a lane chooses among are a switch, not a refusal
API.md still listed "an array of samplers" among the forms the identity domains refuse, which
the previous commit made a switch over the candidates. The refusal list drops it, and the sampler
array paragraph says the identity domains always take the switch, each candidate sampled
through the constexpr sampler the consumer pushes (their stages bind no set-0 sampler).

Docs only.
2026-11-20 22:35:58 -08:00
Anees Iqbal afd9686408 rt: a fragment function's stencil output is the device's own where it lists the export
A fragment function's `[[stencil]]` output is the fragment's stencil reference, which Metal's
stencil test and its Replace operations take (Metal's feature set tables give stencil feedback to
the Apple5 family and later and to Metal 3 and Metal 4). rt enabled VK_EXT_shader_stencil_export
on no device, so the translator refused every such function (`StencilExport`): under the
identity domains its pixel-interlock form is never chosen (lower::fragment::fetch::interlock_forms).

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

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

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

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

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

Evidence, at 6e1004de4d and 149a5296e7 (earlier forms of this commit):
- The 16 public cases (valexec2's E/F/G proof m3-max-61598): before, at f3418eacb9 on lavapipe
  (m3-max-61725), not_supported naming StencilExport; after, at 6e1004de4d, 16/16 match on
  runtime-render (m3-max-61732).
- Conformance on lavapipe at 149a5296e7 (m3-max-61812, ms01): every stencil row as the ledger
  says; its one other line, blend-interaction-format-srgb8 divergent on LLVM 23.1.4, is that
  lavapipe's blend and no stencil case. At 6e1004de4d: RTX 3090 (m3-max-61739) exactly the
  ledger's NVIDIA rows; RX 7900 XTX (m3-max-61740) the three rows as this ledger states them.
- The device test at 149a5296e7: lavapipe passes (61812); RX 7900 XTX, 64 pixels stored their
  output (m3-max-61859); RTX 3090, refused naming StencilExport (m3-max-61860).
2026-11-20 22:41:02 -08:00
Anees Iqbal 2c5573d598 rt: a refused pipeline state's Error::Translation names its functions
What: Error::Translation is now Error::Translation { error, functions }. new_compute_pipeline_state
and new_render_pipeline_state fill `functions` at their public entry with each Function stage's own
name in its library (FunctionInfo::name), in stage order (the vertex function before the fragment
function), and the Display prints them: "the translator made no pipeline of a, b: ...". A compiled
stage has no name; a sampler state, a device and a dispatch's late kernel variant name none, and
then the text is as before. It is a diagnostic for the program's log, documented as the text of
the NSError Metal's failed creation gives; no lowering or decision reads it.

Why: the consumer logged only the first refusal of each kind, which hid 6 of one 3D modelling
app's 8 refused kernels; with the names it logs every refused create.

How: the existing creation bodies moved to private compute_pipeline_state and
render_pipeline_state, whose translator errors name no function (Error::translation, for map_err),
and the public entries map them through Error::of_stages. The one-token map_err edits are in
pipeline.rs, render.rs, sampler.rs:371 and device.rs:1290 and 1294.

Same commit: 10 rt test patterns; validation's candidate/platform/runtime.rs (2),
candidate/tests/engine_compute.rs, replay/new_runtime/mod.rs and replay/new_runtime/tests.rs (3);
conformance's rt_side.rs, rt_side/states.rs and case.rs. Conformance's Failure::of_rt records the
error's text without the names (they are the case's own functions), so the 484 answers in
known-gaps-rt.tsv stay as they are. The rt README's compute and render state entries say what
`functions` holds; REFUSALS.md and api_signatures.tsv are regenerated (one changed signature).

Consumer break to follow: reims-vgpu builds or matches rt::Error::Translation(..) at 17 sites,
all in crates/reims-vgpu-vulkan/src/rt_platform/: unbuilt.rs (7), diag.rs (5), library.rs (3),
pipeline.rs (1), argument.rs (1). Each becomes Translation { error, .. } in a match, or
Translation { error, functions: Vec::new() } where it builds one.

Tests (device cfgs): every_device_names_the_function_of_a_refused_compute_state (translate.rs):
a compute state of the vertex function colored_vertex is Error::Translation with functions
["colored_vertex"], and its text starts "the translator made no pipeline of colored_vertex: ".
every_device_refuses_the_patch_draws_it_does_not_build (patch.rs) now also holds the
control-point index type's Tessellation refusal to functions ["tess_triangle_points",
"tess_fragment"] and to the text that names them in that order. Without the entry mapping both
fail on an empty `functions`.
2026-11-20 22:25:11 -08:00
Anees Iqbal 62b3e5a250 rt: the render encoder's use_resource, and a draw after a declared write of a texture with no storage element is Gap::StorageElement
What: RenderCommandEncoder::use_resource is useResource:usage:stages:, its plural and their
deprecated forms without stages. The command buffer keeps the buffer or the texture until it
retires and nothing is recorded: every resource is resident to every function, and the pass's
barriers already order its draws. A usage that writes a texture (or a view of one) made for
shader writes with no storage element marks the encoder, and every later draw whose vertex or
fragment function may reach a texture through its storage image beyond its slots
(PipelineInterface::unbound_storage_textures: an argument buffer's write or read_write texture, a
resource ID) is Gap::StorageElement with no slot, as the compute encoder's dispatch already is.
Before this, such a draw ran and Vulkan dropped the writes Metal makes. The declaration
invalidates the encoder's held draw facts, so a draw of an unchanged state and bindings after it
is checked again.

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

Test: every_device_refuses_a_draw_after_a_declared_write_of_a_texture_with_no_storage_element
(storage_element.rs, device cfgs): an owned fragment function writes an argument buffer's
texture2d<float, write>; for RGBA8Unorm, RGBA8Unorm_sRGB, BGRA8Unorm_sRGB, A8Unorm and an sRGB
view of an RGBA8Unorm texture, a draw before the declaration draws, the same draw after
use_resource(WRITE) is Gap::StorageElement { slot: None, pixel_format } exactly where the texture
has no storage element, and a colored_fragment draw after the declaration draws; the fragment
function's write through its resource ID lands (1, 0, 1, 1). Without the Facts::find check the
refused cases draw and the test panics.
2026-11-20 22:08:11 -08:00
Anees Iqbal a134775713 Simd: Metal's own lockstep, fragment and vertex simdgroups, and full quads go
DriverDeviation::SimdgroupLockstep, MetalFragmentSimdgroups, MetalVertexSimdgroups and
MetalFullQuads were never taken, and neither were their VkProperty twins and codec tags.
Device::from_queries enables no Metal* property, and no committed profile carries one. The forms
that only they reached go with them:
- Lockstep. Kernel ordering no longer leaves out a barrier that only emulated simdgroups make
  exact on a device that runs a simdgroup in lockstep. This removes OrderKey's device bit and the
  Decision's count, air::Lockstep::device in metal2vulkan-air, SimdPlan::device_lockstep, the
  census name barrier.lockstep.device (simd::DEVICE_LOCKSTEP) and the module's
  VkProperty::SimdgroupLockstep requirement. Every such place takes its barrier and tier as on
  every real device.
- Fragment simdgroups. SimdPlan::metal_lane and its requirement go. A fragment's
  [[thread_index_in_simdgroup]] is the device's grouping's lane on every profile, and the SimdWidth
  refusal no longer offers VkProperty::MetalFragmentSimdgroups as an alternative: it needs the
  32-lane width alone, as subgroup::tier's own width refusal does. docs/REFUSALS.md's row and the
  fixture inventory's 24 refusal cells on the eight gsm2_fragment_lanes rows change with it.
- Vertex simdgroups. The prefix lane goes: SimdPlan::prefix_lane, its Private word and entry hook
  (simd::emit_entry), and SubgroupRequirement::metal_vertex_simdgroups with its swap of
  SubgroupStage(Vertex). A vertex function's simdgroup operations need the stage listed, as on
  every real device.
- Full quads. SimdPlan::metal_full_quads and its requirement go. A fragment whose group operations
  count the helpers needs shaderQuadControl, as on every real device.

Rule 1: no note stops being raised. FragmentSimdgroupGrouping was withheld only on a
MetalFragmentSimdgroups profile, so on no real device, and it is now raised wherever the
function's answer reads the simdgroup's members, on every profile. Its catalogue entry already
said "on every device", and its doc in artifact.rs now says so too. The other three forms carried
no note. Their inputs now take a barrier, a refusal or the device's grouping, as on every real
device. The catalogue loses no entry.

Validation: c3.rs's FragmentSubgroupUnderTwoQuads doc clause becomes "every device takes that
note, so the gap's answer is always announced". That is the one validation file that named one of
these deviations. It used the deviation only to explain why the gap's answer is always announced,
because the allowance code never reads the deviation. Nothing else in c3.rs changes. The fixture
README's gsm2_fragment_lanes row drops the Metal lane and the gone driver_deviations lane, and its
gsm2_simd_products and gsm2_vertex_votes_shifts rows drop MoltenVK's measured vertex classes.

Tests: the asserts that no module requires one of these properties, or counts
barrier.lockstep.device, go with them. This covers engine_simd_lockstep's two emulated-tier
tests, its no-barrier lists and LOCKSTEP_NAMES, engine_simd's fragment-lane test (whose narrow
refusal now needs the width alone), and engine_matmul2d's tier assert, which held on every profile
once no profile had the property. Also going: device/tests/subgroup.rs'
a_measured_vertex_stage_states_its_fact_in_place_of_the_stage and the requirement literals' field.
engine_fragment's simd_after_discard takes quad control alone.

SEMANTICS_VERSION 2241 and ARTIFACT_FORMAT_VERSION 579 are placeholders that main renumbers.
SEMANTICS: the profile's fingerprint, the SimdWidth refusal's needs and the census of the same
input change form. ARTIFACT: the codec loses four VkProperty tags and the requirement's field.
RUNTIME_VERSION stays, because the pinned sources' edits remove forms and fields no profile
reached. runtime-sources.sha256 takes the new hash, and api_signatures is blessed.

Consumer check (consumer-uses.sh, consumer development a414607f95, 62 refs): SimdgroupLockstep,
MetalFragmentSimdgroups, MetalFullQuads, metal_vertex_simdgroups and DEVICE_LOCKSTEP have 0 hits
in code. MetalVertexSimdgroups has 0 hits on development. It is used in
crates/reims-vgpu-vulkan/src/gpu/encode_render/tests/metal_tests.rs on 36 of the consumer's
steelbrain/* branches younger than a day, a file its development does not have.
air::Lockstep::device: the consumer's development names no `lockstep` at all.

Verified: m3-max-61467 (homelab-gem10-1): fmt, clippy (all features, --cfg m2v_gpu, --cfg
m2v_cpu_icd) and Rustdoc green at the old base (m3-max-61463 before it failed on four unused test
imports, removed).

Rebased onto development d10a14d5af: the SEMANTICS placeholder is one above its 2235 in stack order
(ARTIFACT_FORMAT_VERSION is already above its 574). The checks above ran at the old base acc706ca47;
the rebased stack's tip is checked by m3-max-61756 (msi-laptop), at the stack rebased on d6d56b8a7c
(tip 5c74fad38d, whose diff from its base is this stack's diff from d10a14d5af): fmt, clippy (all
features, --cfg m2v_gpu, --cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan,
metal2vulkan-validation, metal2vulkan-conformance and metal2vulkan-runtime ran 5877 tests, 5870
passed. Of the 7 failures, the old render descriptor key's test is unpinned; golden_hashes and
engine inventory parts 4, 5, 7 and 8 are bless due (the profiles' fingerprints changed); and
metal::state's encoder_raster_state_needs_its_features fails the same way at development d10a14d5af
itself (m3-max-61802, where runtime-floor gained depthBiasClamp in a529fb658e), as inventory parts
3, 4, 5 and 8 do there. The stack as rebased on 72e1754218 (tip 090d544208: the same product
changes, without the test-only push sweep fix) played 36 distinct streams over 61 runs on five nodes
with 0 refused (player m3-max-61537; plays m3-max-61548, 61549, 61550, 61559 and 61569).
2026-11-20 22:07:19 -08:00
Anees Iqbal 305d85a2a2 Sampler: Metal's own sampler and the cube-gradient routes go
DriverDeviation::MetalSampler, CubeGradientRoute and GraphicsCubeGradientTangents, with
VkProperty::MetalSampler and its codec tag, were never taken: Device::from_queries enables no
Metal* property and always inserts VkProperty::DeviceSampling, and no committed profile carries
a Metal* property. ProfileFields::cube_gradients, with CubeGradients and CubeGradientRoute, had
one reachable value (Vulkan's rule for both stages), so it goes too. The forms only they reached
go with them:
- Cube gradients: CubeFootprint::Metal and ::Projected (MoltenVK's gradientcube and its
  graphics fixup); a cube's explicit gradients take Length, Face or Word by the sampler's
  anisotropy alone, and CubeGradientFootprint is raised wherever the shader does not take
  Metal's level and taps itself.
- The sampler requirement: SamplerFamily::metal_sampler merges into device_sampling. Every
  sample, gather and LOD query, the hoisted no-bias samples and BiasReach::Metal's included,
  requires VkProperty::DeviceSampling and records DeviceSampling, as on every real device.
- The half-texel routine (lower/texture/half.rs) and everything only it read: HalfClass,
  half_class and heap_half_class, TexelLanes and TexelOrigin, the texel argument of texel_value
  and held_value, sample_lanes and word_reads_one, Sampling::one_texel's word forms (one_texel
  now answers whether an access may read one texel, which float_texel_notes reads) and
  half_texel, SamplerSlot::texels, SlotPlan::half_format and unmeasured, TexturePlan::heap_half,
  the declarations half_format, half_routine and plain_half, the module's table of heap texel
  classes (AccessPlan::heap_class, declare_heap_classes, heap_texel_class, HEAP_CLASS_WORDS, and
  texel_format::heap_classes, whose tests now read the layout itself),
  texel_round::f32_to_half_from_even, NoteOn::Unmeasured, SpecKey::UnmeasuredTexels and
  PlainHalfTexels with their plan answers, TexelFormat::YCBCR_8192, MEASURED_ON_METAL_SAMPLER,
  unmeasured_on_metal_sampler and plain_on_metal_sampler, and the identity-domain refusal of a
  heap half sample that only a Metal-sampler profile met.
- The Metal sampler's YCbCr filter note (linear::filter_note and metal_filtered_ycbcr), with
  NoteOn::HeapYCbCr and ArgumentSamplers, SpecKey::HeapYCbCrTextures and
  FilteringArgumentSampler, their plan answers and TexelFormat::two_plane_ycbcr.
- The anisotropic not-mipmapped clamp [0, 0] (vk_sampler's own_anisotropic) and its note's
  source (anisotropic::own_not_mipmapped); PrecisionNote::NotMipmappedAnisotropicFilter, its
  codec tag, conformance Degradation and validation allowance go with its only source.
- The rest: device_texels, device_decode's and fragment/color.rs's Metal decode,
  bind::plan::resources' swizzled_packed profile test, and border_read's metal_sampler (and
  device_opaque_black's format argument, which nothing then read).

Rule 1, per note the commits stop raising: every one is case (b), no difference goes silent.
- filter_note's HalfSampleFilter and FloatSampleFilter (slot clauses on a bound two-plane YCbCr
  format and the bound sampler word, heap clauses on HeapYCbCrTextures and
  FilteringArgumentSampler): raised only on a profile with VkProperty::MetalSampler, so on no
  real device. Such a filtered sample goes to the device's own sampler, and every sample,
  gather and LOD query sets device_sampling, so the stage records DeviceSampling, whose entry
  covers the device's filter of a two-plane texture. The in-place Y'CbCr model's
  HalfSampleFilter and FloatSampleFilter stay as they were.
- NotMipmappedAnisotropicFilter: raised only under own_not_mipmapped, which needed
  MetalSampler. An anisotropic sample on a device with samplerAnisotropy goes to the device's
  sampler (DeviceSampling, its not-mipmapped clamp [0, 0.25] the device's footprint), and one
  without it keeps AnisotropicFilter or DeviceAnisotropicFilter, as on every real device.
- The rest only widen: HalfTexelConversion (now outright at every half read, sample and gather,
  where the Metal-sampler profile tested the bound class), DeviceTexelConversion, SrgbTexelDecode
  and CubeGradientFootprint, each withheld only on a Metal-sampler or Metal-route profile.
The precision-note catalogue loses NotMipmappedAnisotropicFilter alone; the docs of
GradFromBias, HalfTexelConversion, HalfSampleFilter, SrgbTexelDecode, FloatSampleFilter,
DeviceSampling and DeviceTexelConversion lose their Metal-sampler clauses (docs/API.md's entries
already stated the one rule).

Validation: comparison.rs's allowance list loses NotMipmappedAnisotropicFilter (unbounded),
which no device raised; its HalfSampleFilter and FloatSampleFilter reasons now name the in-place
model, their class unchanged (unbounded). No validation file names a deleted DriverDeviation.

Also, from the planner: the citation of VUID-RuntimeSpirv-NonUniform-06274, which spec 1.4.366
no longer has, becomes VUID-RuntimeSpirv-None-10148 and VUID-RuntimeSpirv-subgroupSize-10149 in
spirv/builder/ops/memory.rs, spirv/ir/module.rs (twice), spirv/serialize/mod.rs and the doc of
non_uniform_elements_are_decorated_through_what_carries_them. Comments only.

Tests: each deleted form's tests go with it: lower/arith/tests/half_texel.rs (the routine, its
plain arm, and the steps that bounded the Metal-sampler note) with arith/tests.rs'
quantize_flush_of, which only it read,
f32_to_half_from_even_is_exact_on_every_tie, the projected-footprint test and the swizzle
helper of face/tests/anisotropic.rs, texel_format's ycbcr_8192, wide16 and
metal_sampler_s_read_bits tests, the format version 326 round trip, and the routes' asserts in
engine_handles, engine_heap_binder and engine_sampler_unk. The rest assert the device's sampler
on every profile: half_reads_round_their_texel_to_nearest_even (was
half_reads_convert_by_the_bound_format), heap_half_texels_round_the_device_s_texel (was
heap_half_texels_convert_by_the_handle_s_class), heap_linear_samples_are_the_device_s (no
FloatSampleFilter, outright or specialized), engine_sample_coordinates' requires_the_sampler,
engine_bias_reach, engine_graphics_binder's border test, engine_srgb_decode, engine_sampler,
the routines test, the merged-members round trip, and metal/sampler.rs' and
format/tests.rs' opaque-black calls.

SEMANTICS_VERSION 2239, ARTIFACT_FORMAT_VERSION 577 (placeholders; main renumbers). SEMANTICS:
the profile's fingerprint and the notes of the same input change form. ARTIFACT: the codec loses
the VkProperty, the PrecisionNote and four SpecKey tags. RUNTIME_VERSION stays: the pinned
sources' edits (device/, bind/plan/resources.rs and slots.rs, metal/sampler.rs, cache/codec.rs)
remove forms and keys no profile reached, so no run changes; runtime-sources.sha256 takes the new
hash. api_signatures is blessed; docs/REFUSALS.md and the coverage are unchanged.

Consumer check (consumer-uses.sh, consumer development 2040502291, 62 refs): CubeGradientRoute,
GraphicsCubeGradientTangents, CubeGradients, cube_gradients, FilteringArgumentSampler,
HeapYCbCrTextures, PlainHalfTexels and UnmeasuredTexels 0 hits (code). MetalSampler and
NotMipmappedAnisotropicFilter: 0 hits on development (its answer.rs names neither, and it has no
gpu/rgbx.rs); named in crates/reims-vgpu-vulkan/src/answer.rs and gpu/rgbx.rs on 36 of the
consumer's steelbrain/* branches younger than a day.

Verified: m3-max-61441 (msi-laptop, this tree): fmt, clippy (all features, --cfg m2v_gpu,
--cfg m2v_cpu_icd), Rustdoc green; tests 5861 of 5863 passed. The two failures:
golden_hashes_match_the_table, every one of its 29536 cells under a changed profile fingerprint
(re-blessed on development at a named pin), and the_old_render_descriptor_key_keeps_its_value,
left unpinned until the next named pin.

Rebased onto development d10a14d5af: the SEMANTICS placeholder is one above its 2235 in stack order
(ARTIFACT_FORMAT_VERSION is already above its 574). The checks above ran at the old base acc706ca47;
the rebased stack's tip is checked by m3-max-61756 (msi-laptop), at the stack rebased on d6d56b8a7c
(tip 5c74fad38d, whose diff from its base is this stack's diff from d10a14d5af): fmt, clippy (all
features, --cfg m2v_gpu, --cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan,
metal2vulkan-validation, metal2vulkan-conformance and metal2vulkan-runtime ran 5877 tests, 5870
passed. Of the 7 failures, the old render descriptor key's test is unpinned; golden_hashes and
engine inventory parts 4, 5, 7 and 8 are bless due (the profiles' fingerprints changed); and
metal::state's encoder_raster_state_needs_its_features fails the same way at development d10a14d5af
itself (m3-max-61802, where runtime-floor gained depthBiasClamp in a529fb658e), as inventory parts
3, 4, 5 and 8 do there. The stack as rebased on 72e1754218 (tip 090d544208: the same product
changes, without the test-only push sweep fix) played 36 distinct streams over 61 runs on five nodes
with 0 refused (player m3-max-61537; plays m3-max-61548, 61549, 61550, 61559 and 61569).
2026-11-20 22:07:19 -08:00
Anees Iqbal efa911bc00 Arith: the Metal arithmetic deviations and the profile's float-function and NaN-encoding fields go
DriverDeviation::MetalFloatFunctions, MetalCanonicalNans, MetalFloatDenormals,
MetalUnaryDenormals, MetalMinMax, MetalHalfFma, MetalPackConversions, MetalHalfArithmetic,
MetalNanMoves and MetalHalfConversion, with their VkProperty values and codec tags, were never
taken: Device::from_queries enables no Metal* property, and no committed profile carries one.
Their forms go, and so do the two profile fields each left with one reachable value:
- ProfileFields::float_functions and FloatFunctions (only Native was reachable): the device's
  functions are never Metal's own. Gone with it: pipeline::EntryMath (public), the entry-math
  argument of PrecisionNote::of_float_operator and of_math_call, libm's Mode and its
  device_answers and device_near_equivalent, spirv's ProductForm (a product is an OpFMul, its
  negative-zero Fma form gone), and arith's OpNotes, MetalOwn and metal_functions_in (a call's
  notes are a BTreeSet<PrecisionNote>).
- ProfileFields::nan_encoding and NanEncoding (only Native was reachable): NanAnswer's
  device_answers and nan::encoding go; every NaN Metal answers is noted NativeNanEncoding.
- Denormals: denormal.rs keeps covered() alone (Covered, device_flushes, unary_kept and
  moves_sign go); every f32 denormal left to the device is noted DeviceDenormals.
- MinMax: Metal's minimum and maximum family is the device's NMin, NMax and NClamp, noted
  NativeMinMax (device_min_max goes).
- MetalHalfFma: its arm and test go.
- Pack conversions: every air.pack and air.unpack is noted DevicePackConversion
  (pack::measured and ArithPlan::metal_packs go).
- Half arithmetic: the device's 16-bit half + - * is taken only under the 16-bit float controls;
  F16Basis goes (f16_arithmetic answers a bool), and so do ArithPlan::f16_arith and the
  FastMathRewrites note of the measured form left to the device's compiler.
- NaN moves: a widening's, a negation's and a magnitude's NaN is the device's, noted (moved_nan,
  moves_nan, nan::moves_answered, FloatFacts::nan_moves and ArithPlan's nan_moves and
  held_nan_moves go). A half texel's write to a 32-bit float format notes DeviceNanEncoding on
  every device (texture::half_write_nans' Wide class goes; HeapNanFamilies' NAN_WIDE family
  now holds no deviation).
- Half conversion: every half the module rounds through the device's conversion is noted
  NativeHalfConversion; texture::half_texels (a sample of a 32-bit float texel) and
  half_texel_nans (a 32-bit float or packed small float class) lose their MetalHalfConversion
  exceptions, so both note those classes on every profile. Gone with it, the analyses only the
  measured facts read: narrow::round_measured (round serves) with the
  measured roundings the builder and the IR carried, narrow::rounds_unmeasured,
  narrow::moves_unfolded with the merges module, and the stored texels the texture writes
  recorded for it.
compile.rs's half-rounding block keeps converts, widens, the controlled and fused roundings and
their three notes; the MetalNanMoves, MetalHalfConversion, MetalPackConversions and
MetalHalfArithmetic requirements go.

Notes: the precision-note catalogue loses no entry. Every note the deleted forms withheld is
still raised, now on every device (NativeNanEncoding, DeviceDenormals, NativeMinMax,
DevicePackConversion, NativeHalfConversion, HalfTexelConversion, DeviceNanEncoding, NativeDot,
NativeMix); their docs and docs/HOWTO.md lose the measured exceptions, and the docs of a device
whose functions are Metal's own go from math.rs, arith and artifact.rs.

Validation: c3/bound.rs asks the product's notes of an operation (AirOp::product_notes), part of
how C3 decides a near-equivalent; it passed an EntryMath the product read only for the
unreachable form, so it drops the argument and its answers are unchanged.
fast_trig_within_apples_bound's doc loses the MoltenVK clause.

Tests: each deleted form's tests go with it (the_maths_functions_are_the_device_s, the member
format version 486 round trip, a_measured_half_sum_requires_the_arithmetic_fact_alone,
a_merge_of_a_select_is_followed_through_struct_members, the device_answers asserts), with the
hand-set profile fields only they used (FloatFacts' nans, device_denormals, unary_denormals,
native_min_max, nan_moves). The rest assert the note on every profile: engine_arith,
engine_float_call_notes (its note class is the fma route alone), engine_native_half,
engine_metal_denormals, engine_tiny_products, engine_rate_map, engine_opencl_mode,
engine_texture, engine_extended_range's heap test, from_queries, arith's and narrow's tests.

SEMANTICS_VERSION 2238, ARTIFACT_FORMAT_VERSION 576 (placeholders; main renumbers). SEMANTICS:
the notes and keys of the same input change form. ARTIFACT: the codec loses ten DriverDeviation
and eight VkProperty tags and EntryMath. RUNTIME_VERSION stays: the pinned sources' edits
(device/profile.rs, device/derive.rs, device/requirements.rs, lower/arith/pack.rs and a doc in
bind/heap.rs) remove forms no profile reached, so no run changes; runtime-sources.sha256 takes
the new hash. api_signatures is blessed; docs/REFUSALS.md and the coverage are unchanged.

Consumer check (consumer-uses.sh, consumer development c8407fb6fc, 58 refs): EntryMath,
of_float_operator, of_math_call, MetalCanonicalNans, MetalFloatDenormals, MetalFloatFunctions,
MetalHalfArithmetic, MetalHalfFma, MetalMinMax, MetalNanMoves, MetalPackConversions,
MetalUnaryDenormals, FloatFunctions and NanEncoding 0 hits (code). MetalHalfConversion: 0 on
development; used in crates/reims-vgpu-vulkan/src/gpu/rgbx.rs on three of the consumer's
steelbrain/* branches (gaugetick, recnil-r4, refdump), a crate its development no longer has.

Verified: m3-max-61298 at this tree (WIP arith 10, msi-laptop): fmt, clippy (all features,
--cfg m2v_gpu and --cfg m2v_cpu_icd) and Rustdoc rc 0 (61293, on the tree before, failed clippy
on three unused imports, which this tree removes); nextest over metal2vulkan,
metal2vulkan-conformance, metal2vulkan-validation and metal2vulkan-runtime, 5876 run, 5874
passed, 25 skipped, 2 failed: the render key test
(the_old_render_descriptor_key_keeps_its_value), left unpinned until the next named pin, and
golden_hashes_match_the_table, whose 29536 stale cells are all under a changed profile
fingerprint (0 new, 0 gone, 0 under a changed fixture source): the profile lost two fields, so
every key changed and the table is re-blessed on development.

Rebased onto development d10a14d5af: the SEMANTICS placeholder is one above its 2235 in stack order
(ARTIFACT_FORMAT_VERSION is already above its 574). The checks above ran at the old base acc706ca47;
the rebased stack's tip is checked by m3-max-61756 (msi-laptop), at the stack rebased on d6d56b8a7c
(tip 5c74fad38d, whose diff from its base is this stack's diff from d10a14d5af): fmt, clippy (all
features, --cfg m2v_gpu, --cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan,
metal2vulkan-validation, metal2vulkan-conformance and metal2vulkan-runtime ran 5877 tests, 5870
passed. Of the 7 failures, the old render descriptor key's test is unpinned; golden_hashes and
engine inventory parts 4, 5, 7 and 8 are bless due (the profiles' fingerprints changed); and
metal::state's encoder_raster_state_needs_its_features fails the same way at development d10a14d5af
itself (m3-max-61802, where runtime-floor gained depthBiasClamp in a529fb658e), as inventory parts
3, 4, 5 and 8 do there. The stack as rebased on 72e1754218 (tip 090d544208: the same product
changes, without the test-only push sweep fix) played 36 distinct streams over 61 runs on five nodes
with 0 refused (player m3-max-61537; plays m3-max-61548, 61549, 61550, 61559 and 61569).
2026-11-20 22:07:19 -08:00
Anees Iqbal 5db3215260 Rotated blends: every blend not exact by construction announces its rounding
The planner's ruling on the rotated blend: the note no longer follows a measured table. A blend
on an attachment held with its channels rotated (ARGB8Unorm) raises
PrecisionNote::RotatedBlendRounding unless it is exact by construction: a minimum or a maximum,
which takes no factor, or a blend whose chosen Vulkan factors are all ZERO or ONE, whose result
is the source, the destination, zero, or their sum or difference, a whole code half a code from
any tie. rotated_blend's MEASURED table and measured() go; unmeasured() becomes inexact(), which
reads the state rotated_blend() chooses: a Synthesized state (SRC1 factors) is inexact, and a
Direct one is inexact unless its four factors are ZERO or ONE.

Newly announced, the nine states of the old table that are not exact by construction, each
Metal's color pair and alpha pair under the one operation:
- DestinationColor over Zero, DestinationAlpha over Zero, Add;
- SourceColor over OneMinusSourceColor, SourceAlpha over OneMinusSourceAlpha, Add;
- BlendAlpha over OneMinusBlendAlpha for both, Add;
- the two straight-alpha pairs: SourceAlpha over OneMinusSourceAlpha with the alpha the same,
  and with the alpha One over OneMinusSourceAlpha, Add;
- One over OneMinusSourceAlpha for both, Add and Subtract;
- SourceAlpha over One with the alpha Zero over One, Add;
- SourceAlpha over One for both, ReverseSubtract.
One over Zero and One over One (Add) stay unannounced, now as exact by construction. Newly
unannounced: blends outside the old table whose Vulkan factors are all ZERO or ONE, which Metal
gives with one Zero or One factor for both its color and alpha sources and one for both its
destinations, under Add, Subtract or ReverseSubtract (One over One under ReverseSubtract, Zero
over One, and the like). Minimum and maximum stay unannounced.

StageIo::rotated_blends and LoweringInputs::rotated_blends stay: they are now the attachments
whose blend is not exact by construction. The stage raises the note from the latter, and
color_writes::check reads the former to refuse a fragment compiled for another set than the
pipeline's (NeedsInput(ColorWrites)), so the set still has a reader; its docs lose "measured".

The docs/API.md catalogue entry, PrecisionNote::RotatedBlendRounding's doc, LoweringInputs' and
StageIo's docs, rotated_blend's module doc, and validation's c3 deferral doc, its bound string and
comparison.rs's allowance doc state the one rule. The validation files use the note to defer a
row in C3 (c3.rs) and give it an unbounded allowance (comparison.rs); both follow the note, so
more rows on rotated attachments are deferred, by the note alone.

Tests: rotated_blend's measured-forms test becomes the_lane_s_blends_store_metal_s_rotated, over
the old table kept as test data (LANE): every state stores Metal's blend rotated alike on MoltenVK
and lavapipe, and all but one over zero and one over one are inexact.
inexact_blends_are_announced adds a difference by ones and a held destination, exact.
engine_rotated_colors expects the note on its product and its two second-output blends, and not
on its minimum or its reverse subtraction of ones.

SEMANTICS_VERSION 2237 (placeholder; main renumbers): the rotated blends' set, which the key
carries, and the stage's notes change for the same descriptor. ARTIFACT_FORMAT_VERSION and
RUNTIME_VERSION stay. api_signatures, docs/REFUSALS.md and the coverage are unchanged.

Consumer check: unmeasured and MEASURED were pub(crate); no public name changes.

Verified: m3-max-61259 at this tree (a5396ea291 before the colour commit's message was filled,
msi-laptop): fmt, clippy (all features, --cfg m2v_gpu and --cfg m2v_cpu_icd) and Rustdoc rc 0;
nextest over metal2vulkan and metal2vulkan-validation, 4719 run, 4718 passed, 23 skipped, 1
failed: the render key test (the_old_render_descriptor_key_keeps_its_value), left unpinned until
the next named pin.

Rebased onto development d10a14d5af: the SEMANTICS placeholder is one above its 2235 in stack order
(ARTIFACT_FORMAT_VERSION is already above its 574). The checks above ran at the old base acc706ca47;
the rebased stack's tip is checked by m3-max-61756 (msi-laptop), at the stack rebased on d6d56b8a7c
(tip 5c74fad38d, whose diff from its base is this stack's diff from d10a14d5af): fmt, clippy (all
features, --cfg m2v_gpu, --cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan,
metal2vulkan-validation, metal2vulkan-conformance and metal2vulkan-runtime ran 5877 tests, 5870
passed. Of the 7 failures, the old render descriptor key's test is unpinned; golden_hashes and
engine inventory parts 4, 5, 7 and 8 are bless due (the profiles' fingerprints changed); and
metal::state's encoder_raster_state_needs_its_features fails the same way at development d10a14d5af
itself (m3-max-61802, where runtime-floor gained depthBiasClamp in a529fb658e), as inventory parts
3, 4, 5 and 8 do there. The stack as rebased on 72e1754218 (tip 090d544208: the same product
changes, without the test-only push sweep fix) played 36 distinct streams over 61 runs on five nodes
with 0 refused (player m3-max-61537; plays m3-max-61548, 61549, 61550, 61559 and 61569).
2026-11-20 22:07:18 -08:00
Anees Iqbal 4d17e4593b Colour writes: the Metal colour-write deviations and the premultiplied rotated blend go
DriverDeviation::MetalColorWrites, MetalFloatColorNans, MetalSmallFloatColorWrites and
MetalNorm16ColorWrites, with their VkProperty values, were never taken. Device::from_queries
enables no Metal* property, and no committed profile carries one. Their forms go:
- lower/stage_io/color_write.rs: the Metal conversion (Conversion, conversion()), the skip of a
  half-float channel on a Metal device, and nan_kept's profile read;
- pipeline/color_writes.rs: lowered()'s small-float and 16-bit norm arms, metal_color_writes and
  metal_stored;
- the rotated blend's premultiplied form, which only MetalColorWrites reached:
  rotated_blend::premultiplied, the measured table's premultiplied factors,
  RotatedBlendForm::Premultiplied, PlannedOutput::premultiplied and stage_io's
  premultiplied_blue.
RotatedBlendForm kept one variant, Unmeasured, so it goes too. LoweringInputs::rotated_blends and
StageIo::rotated_blends become a BTreeSet<u32>: the rotated attachments blended in none of the
measured forms. rotated_blend::rotated_form becomes unmeasured().

Notes: RotatedBlendRounding stays, since the unmeasured form raises it; its doc and its docs/API.md
catalogue entry lose the premultiplied clause. DeviceColorConversion and DeviceNanEncoding stay,
since the device's forms raise them. On Apple's own blend the two straight-alpha pairs may round one
code apart in the search's form, unannounced; rotated_blend's module doc says so.

Tests: color_writes' tests lose their Metal branches; api_surface's with_color_writes loses its
device argument; engine_rotated_colors loses the Apple-blend expectations and premultiplies();
rotated_blend's tests read unmeasured(); engine_fragment's profile filter and api_tests follow.

SEMANTICS_VERSION 2236, ARTIFACT_FORMAT_VERSION 575 (placeholders; main renumbers). SEMANTICS: the
rotated blends' key bytes change form. ARTIFACT: the codec loses RotatedBlendForm and four
VkProperty values, and StageIo's field changes type. RUNTIME_VERSION stays; no binder source
changes. api_signatures is blessed; docs/REFUSALS.md is regenerated (DualSourceBlending loses
rotated_blend's premultiplied site).

Consumer check (consumer-uses.sh, consumer development 415d453172, 58 refs):
MetalFloatColorNans, MetalSmallFloatColorWrites, MetalNorm16ColorWrites, RotatedBlendForm and
rotated_blends 0 hits (code). MetalColorWrites: 0 on development; used in
crates/reims-vgpu-vulkan/src/gpu/encode_render.rs (ties_as_metals) on 36 of the consumer's
steelbrain/* branches, a crate its development no longer has. Premultiplied and Unmeasured: the
consumer's hits are its own (a comment in display.rs, its RefusedWait::Unmeasured), not these
items.

Verified: m3-max-61229 at this commit (homelab-um790-xtx-1): fmt, clippy (all features, --cfg
m2v_gpu and --cfg m2v_cpu_icd) and Rustdoc rc 0. m3-max-61208 on the same change before its rebase
onto acc706ca47 (f4ecfa8c4, msi-laptop): nextest over metal2vulkan, -conformance, -validation and
-runtime, 5881 run, 5880 passed, 25 skipped, 1 failed: the render key test
(the_old_render_descriptor_key_keeps_its_value), left unpinned until the next named pin.

Rebased onto development d10a14d5af: the SEMANTICS placeholder is one above its 2235 in stack order
(ARTIFACT_FORMAT_VERSION is already above its 574). The checks above ran at the old base acc706ca47;
the rebased stack's tip is checked by m3-max-61756 (msi-laptop), at the stack rebased on d6d56b8a7c
(tip 5c74fad38d, whose diff from its base is this stack's diff from d10a14d5af): fmt, clippy (all
features, --cfg m2v_gpu, --cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan,
metal2vulkan-validation, metal2vulkan-conformance and metal2vulkan-runtime ran 5877 tests, 5870
passed. Of the 7 failures, the old render descriptor key's test is unpinned; golden_hashes and
engine inventory parts 4, 5, 7 and 8 are bless due (the profiles' fingerprints changed); and
metal::state's encoder_raster_state_needs_its_features fails the same way at development d10a14d5af
itself (m3-max-61802, where runtime-floor gained depthBiasClamp in a529fb658e), as inventory parts
3, 4, 5 and 8 do there. The stack as rebased on 72e1754218 (tip 090d544208: the same product
changes, without the test-only push sweep fix) played 36 distinct streams over 61 runs on five nodes
with 0 refused (player m3-max-61537; plays m3-max-61548, 61549, 61550, 61559 and 61569).
2026-11-20 22:07:18 -08:00
Anees Iqbal b0e351ffbc Validation: multisampled passes and textures run through the runtime
Family H of the executor's move onto metal2vulkan-runtime: a render
case of more samples (raster_sample_count), and any case binding a
multisampled texture, now runs on the runtime's public API, filled and
read back as executor_contract::multisample states for both executors.

Metal uploads and copies no multisampled texture, and neither does the
runtime. So runtime_multisample fills each slice with one draw of the
owned sample_fill fixture (fixtures/public/engine/sample_fill.metal,
compiled by scripts/regen-air-fixtures), whose fragment runs once per
sample (sample_id) and writes that sample's texel from a buffer: a
color texel through an unsigned-integer view of its texel size (the
texture made with PixelFormatView usage), so its bits cross
unconverted, a Depth32Float one as depth(any) under an always-passing
depth test that writes (a depth outside [0, 1] refused as
depth_outside_unit_range, as runtime_depth refuses it). A multisampled
stencil aspect holds one value in every sample (uniform_stencil), which
the case's pass clears it to. After the draw a dispatch of the
fixture's sample_read kernels reads every sample, one threadgroup each,
as whole words in the attachment layout (unpack_words), unresolved,
as the oracle's sample_readback does.

runtime_textures makes a multisampled texture Private (Metal keeps none
Shared), for rendering and, if color, for views of another format, and
fills it by those draws. runtime_render makes each attachment of a
multisampled pass a Private Type2DMultisample texture of the pass's
samples, with a texture index for its read's view, and reads every
sample back for the comparison. engine::runtime_texture no longer keeps
a multisampled texture off the runtime, and
runs_render_through_runtime takes any sample count. An attachment of
both aspects still carries separate_depth_stencil.

What moves: of the committed cases, 49 multisampled passes (all
public; 2 with both aspects keep the requirement) and 8 cases with a
multisampled input texture (7 public kernel cases, 1 private fragment
case).

ENGINE_EXECUTOR_ABI to vulkan-engine-v197. The new owned fixture adds
rows to the golden tables, re-blessed on development.

Tests: engine/tests.rs routes a multisampled pass, multisampled depth
and stencil attachments and a kernel's multisampled texture through
the runtime; engine_render.rs's
each_sample_of_a_multisampled_target_holds_its_own_invocation draws
sample_rate_mask_in into 4 samples and checks each sample's index, on
Linux through the runtime too, bytes equal to the executor's own;
engine_textures.rs's depth_and_multisampled_textures_read_their_authored_texels
runs through the runtime on Linux. Built and run in the lane's compile
job (ids sent with the sha); not yet built when committed.
2026-11-20 21:59:48 -08:00
Anees Iqbal 6593e998d1 Validation: tessellation cases draw their patches through the runtime
Family I of the executor's move onto metal2vulkan-runtime. A
post-tessellation vertex case's patch draw, which the Metal oracle
encodes as setTessellationFactorBuffer: at executor_contract::
tessellation's offset and instance stride and drawPatches: with no patch
index buffer, now draws through the runtime's public API the same way:
the factors a Shared buffer bound by set_tessellation_factor_buffer at
FACTOR_OFFSET and FACTOR_INSTANCE_STRIDE, then draw_patches with the
case's control points, patch start, patch count, instance count and
base instance and no index buffer.

engine::runs_render_through_runtime takes an Assembly::Patches case
whose draw is DrawCall::Patches with neither a patch index buffer nor a
control-point index buffer (the runtime's patch index buffer is
Gap::Draw of PatchIndexBuffer); the authored TessellationDraw spells
neither, so every committed tessellation case meets the structure.
runtime_render's drawn() encodes the patch draw; a patch draw that
reached it with an index buffer fails the run, never draws other
patches.

What moves: the 25 committed tessellation cases (23 public, 2
private), one of them with attribute-buffer out-of-bounds targets of
control-point form, whose facts runtime_bounds::drawn reads as before.

ENGINE_EXECUTOR_ABI to vulkan-engine-v196: these rows' executor
changes.

Tests: engine/tests.rs a_plain_draw_and_only_one_runs_through_the_runtime
routes a patch draw without an index buffer and keeps one through a
patch index buffer, and a patch draw of a primitive assembly, on the
executor's own context; engine_render.rs's
a_back_culled_patch_and_its_mirror_leave_exactly_one_drawn draws each
of its patch draws through the runtime on Linux and compares the
executor's own bytes. Built and run in the lane's compile job (ids sent
with the sha); not yet built when committed.
2026-11-20 21:59:48 -08:00
Anees Iqbal bcc417bc08 Translator: SparseResidency's text names a footprint of the border alone
PrecisionNote::SparseResidency said the device's OpImageSparse* residency may count a texel of
zero weight Metal does not. Public case fd292944c2 (a 256x128 r32_float sparse texture with x
128-255 mapped) found a second way the device's word differs: lavapipe answers not resident for
a clamp_to_border access whose footprint is the border alone (nearest at u -0.5 and 1.5, linear
at u -0.5, -1/256 and -1/512, gather at u -0.5 and 1.5), where Metal answers resident, beside a
mapped edge too. Every value word was equal; 7 of 200 residency words differ (valexec2's proof
m3-max-61595, decoded against the committed Metal rows). Vulkan states only "whether any texels
accessed by the instruction are sparse unbound texels" (vkspec 20.2.6), so the word is the
device's, which the note's first clause already says; its text now names this case beside the
zero-weight texel, in the doc comment and in docs/API.md's catalogue.

Doc only: no emission, key or version change.
2026-11-20 21:37:51 -08:00
Anees Iqbal a529fb658e rt: the floor's depthBiasClamp has its missing-feature case, and the runtime-floor profile states it
The floor requires depthBiasClamp (the first commit of this change). The runtime's
each_missing_feature_is_named gains its case, as its count of cases is held to REQUIRED's. The
regeneration's RUNTIME_FLOOR and runtime-floor.json's m2v_runtime_floor block state it, in the
generator's order (the block the runtime's the_floor_profile_states_exactly_the_floor holds equal
to floor.rs; check_device_profiles: 0 findings over 17 profiles; the JSON line is written as the
regeneration writes it, without refetching its pinned sources). CONFORMANCE-COVERAGE is
regenerated for the ledger row render-state-depth-bias left (7688 rows to 7687).

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

Verified: suite m3-max-61635 at 406f39dc90 (msi; the workspace suite and the lavapipe device
tests) failed exactly these three, each_missing_feature_is_named (52 cases against 53),
the_floor_profile_states_exactly_the_floor (depthBiasClamp) and the coverage document; the rerun
follows.
2026-11-20 21:33:04 -08:00
Anees Iqbal 6ef64ae3ee rt: a depth bias's clamp is the device's own
setDepthBias:slopeScale:clamp: bounds the bias by its clamp: "Pass a positive or negative value to
limit the largest magnitude of a positive or negative bias, respectively. You can disable the bias
clamping functionality by passing 0.0" (Apple's page for the method, as fetched). Vulkan's
depthBiasClamp is the same bound (dbclamp: x for 0, min(x, clamp) above 0, max(x, clamp) below).
rt refused every clamp but 0 (DrawKind::DepthBiasClamp), where the deleted runtime passed it.

floor: depthBiasClamp joins REQUIRED. Every dumped venue reports it (vulkaninfo m3-max-48727 to
48731, 48736, 48737 and 61508 for the RX 550: RX 7900 XTX, the three 780Ms, RTX 2080, RTX 3090,
Iris Xe, RTX 5080 Laptop, llvmpipe, the UHD 630's Windows driver, KosmicKrisp on the M3 Max, RX
550), and Vulkan 1.4 and Roadmap 2022 require it.

render encoder: set_depth_bias keeps the clamp beside the bias and slope scale and records it in
vkCmdSetDepthBias, as dynamic state (no pipeline). It returns nothing now, as Metal's call does:
its only error was the clamp. DrawKind::DepthBiasClamp is deleted. The consumer's checkout names
both: rt_platform/render.rs:380 (`e.set_depth_bias(...)?`) and rt_platform/unbuilt.rs:873 (a test's
sample refusal of DepthBiasClamp); each needs a one-line change at its next pin.

AGENTS.md: the Scope sentence on features no guest has used is replaced with the planner's
wording: a feature a program can ask about is answered from the Vulkan query; one Metal gives every
Mac device with no way to ask is built, a typed refusal in the known gaps until it is.

Docs: the README's floor table, its depth bias paragraph and its render encoder known gaps;
docs/REFUSALS.md regenerated (Draw's basis and sites); api_signatures.tsv blessed (the setter's
signature, the variant gone). The conformance ledger drops render-state-depth-bias's refusal row.

Tests: every_device_tests_writes_and_biases_a_depth_attachment's first draw is biased by 2^23
(0.25 or 0.125 in the device's unit at depth 0.25) clamped to 0.0625, and the depth read back is
0.3125 on every device; the later draws' answers are unchanged in kind. The conformance case
render-state-depth-bias (a slope-scaled bias under the clamp -0.0125) now compares against Metal's
recording.
2026-11-20 21:33:03 -08:00
Anees Iqbal 6af76cf309 Validation: separate depth and stencil attachments are the runtime's limit
A fragment case whose depth/stencil attachment holds both aspects is
drawn by the Metal oracle into Metal's separate Depth32Float and
Stencil8 textures, attached to one pass: plain Metal on every Mac. The
runtime does not build that form yet. It renders into no separate depth
and stencil textures in one pass (Gap::RenderPass of DepthStencilViews,
and its pipeline state Gap::RenderPipeline of DepthStencilFormats), both
among the known gaps its README states. The planner's ruling: record
these rows as the runtime's limit with that typed gap, by the
function-table mechanism; the doc comment states the gap as unbuilt in
the runtime, not as Metal's.

ToolingRequirement::SeparateDepthStencil ("separate_depth_stencil"):
Limit::Runtime, it stops the engine's candidate and keeps its cases
Metal-qualified (qualifies_on_metal). The case checker raises it from
the case's literals (executor_contract::case_requirements: a vertex or
fragment case's depth/stencil attachment with both initial aspects),
never from a source's structure, so no census row carries it.
executor_contract.rs is a classifier input, so every cached triage
recomputes. If the runtime builds the form, the requirement goes in the
same commit.

What lost execution: of the committed cases, 5 fragment cases hold
both aspects: the 3 of family G (one sample, observing stencil) and 2
multisampled ones (family H), all of which ran on the old executor
until now.

Tests: requirement.rs's
a_separate_depth_stencil_attachment_stops_only_the_candidate and both
requirement lists; executor_contract's case test (a fragment case's
attachment of one aspect raises nothing, of both raises it alone).

Verified: cargo fmt; the compile gate follows as a potluck job.
2026-11-20 21:27:21 -08:00
Anees Iqbal cca476549f Validation: a draw's depth/stencil attachment of one aspect runs through the runtime
Family G. A render case with a depth/stencil attachment stayed on the
executor's own context. A vertex or fragment case whose attachment has
one sample and one aspect now draws through the runtime
(engine::runs_render_through_runtime), observing a buffer, a texture, a
color target, the attachment's aspect or nothing; a fragment case with
the attachment and no color target renders, as the attachment is the
pass's.

The attachment is made as the oracle makes it (Metal's separate
Depth32Float and Stencil8, Shared, of RenderTarget usage):
- a Depth32Float is filled by a draw of its depths (runtime_depth), as a
  32-bit float depth texture is, since the runtime takes no upload of one
  (Gap::FloatDepthUpload); a depth outside [0, 1] stays
  DepthOutsideUnitRange;
- a Stencil8 is written from its bytes with replace_region.
The pass loads and stores it; the draw's depth-stencil state, stencil
references and pipeline depth and stencil formats were already the
oracle's. The final aspect is read back with get_bytes into the run's
RenderFinals, from which the depth or stencil output is selected.

An attachment of both aspects is the oracle's two textures, which the
runtime renders into in no one pass (Gap::RenderPass of
DepthStencilViews; its pipeline Gap::RenderPipeline of
DepthStencilFormats): such a case, and one of more samples (family H),
stays on the executor's own context.

Rows: of the committed cases, 21 fragment cases are family G's (one
sample, the rest of E/F's structure): 16 stencil-only observing stencil,
2 depth-only (one observing depth, one, private, a color target), and 3
of both aspects observing stencil, which stay where they were. Expected:
the 18 one-aspect cases run through the runtime; the family G proof reads
them.

ENGINE_EXECUTOR_ABI to vulkan-engine-v195.

Tests: a_plain_draw_and_only_one_runs_through_the_runtime (a depth or a
stencil attachment, observed or not, routes; one of both aspects or of 4
samples does not); the device test
a_fragment_case_writes_its_depth_and_stencil_attachment draws each
aspect alone through the runtime on Linux (depth 0.5 over 1.0, stencil 7
over 0xab).

Verified: cargo fmt; the compile gate and the family G proof follow as
potluck jobs.
2026-11-20 21:27:21 -08:00