Commit Graph
10558 Commits
Author SHA1 Message Date
Anees Iqbal 60e30f5196 Runtime: a mesh state keeps nothing of its descriptor, and the group counts fill by fixed chunks
Clippy in job m3-max-85712 (c6bd918103, plain, m2v_gpu and m2v_cpu_icd alike) stopped the
runtime's lib on two errors:

- dead_code: Made::Mesh held the MeshPipelineDescriptor, which only a test helper read. A vertex
  state keeps its descriptor because a pass makes its content again from it (for_pass); no pass
  does that for a mesh state. Made::Mesh is now a unit variant, and the test helper says a mesh
  state keeps no vertex or fragment function (rule 4: nothing unused is kept).
- clippy::chunks_exact_to_as_chunks in mesh_draw::count_bytes: the three counts now go through
  as_chunks_mut::<4>(), the same bytes.

Verified by the error text of 85712 only; the next job runs the three clippy configurations.
2026-12-03 17:05:46 -08:00
Anees Iqbal 45e0a733bd Runtime tests: a mesh draw of 3 by 1 threads rounds both axes down, and the two thread maxima are applied
Job m3-max-85712 (the lane's check at c6bd918103, built on msi) failed two runtime tests:

- tests::mesh_draw::a_mesh_draw_gives_metal_s_counts_and_regions, row 2: a drawMeshThreads of
  (3, 1, 1) threads with mesh threadgroups of (4, 2, 1) and no object function gives counts
  (0, 0, 1), each axis rounded down (3/4 and 1/2), as the code does and as Metal drew nothing
  for grid-threads-3x1-by-4 in the recording mesh-grid-draws. The row expected (0, 1, 1), as if
  the threadgroup were one thread tall. The expectation is fixed; the draw was already empty.
- tests::translator_fields: GraphicsState::max_total_threads_per_object_threadgroup and
  max_total_threads_per_mesh_threadgroup, added by the translator's mesh maxima, had no
  verdict. Both are Applied: render.rs reads them to make each stage's capped maximum.

Verified by the failure text of 85712 only; the next job runs both tests.
2026-12-03 17:05:46 -08:00
Anees Iqbal 127c824380 Conformance probe: a mesh descriptor that states 1024 threads for each stage
The planner asked, before READY, what a Mac's mesh state answers for
maxTotalThreadsPerObjectThreadgroup and maxTotalThreadsPerMeshThreadgroup when the descriptor
states nothing and when it states 1024, so the runtime's default maximum matches what a guest
reads. The probe had `plain` (nothing stated) and no 1024 case; it gains `max-1024-1024`.

Measured on the M3 Max under macOS 27.0.1 (26A434), job m3-max-85757, each case a first
compile (a new salt), the same salt again, and for `plain` and `max-1024-1024` unsalted:
`plain` answers 1024 and 1024, `max-1024-1024` 1024 and 1024, `max-64-32` 64 and 32, and
`no-object` 3 and 1024, every run alike. The runtime's default, 1024 capped by the stage's
Vulkan limit, is Metal's answer for both.

The conformance recording mesh-limits-plain holds 128 and 128 because the suite records each
thread maximum as the least of the answer and THREAD_FLOOR (128) on both sides
(pipeline_limits.rs, "The thread maxima are compared up to Vulkan's floor"): Metal's 1024 is
stored as 128, and the runtime's answer is floored alike. It stays as recorded.
2026-12-03 17:05:46 -08:00
Anees Iqbal dd6c0baabc Docs: five doc comments of the mesh work wrapped at 100 columns
The mesh floor's extension list, the object stage's thread maximum, the mesh draw module, the
conformance descriptor reads and the replay's form counters each carried a doc line past the
tree's 100 columns, written in this lane's earlier commits. Rewrapped; no word changes.

Verified: the diff is whitespace and line breaks in comments only.
2026-12-03 17:05:46 -08:00
Anees Iqbal 47d3946998 Runtime docs: what starts the build of an object or mesh function's threadgroup memory
An object or mesh function with a [[threadgroup(n)]] argument stays refused at the creation
(Gap::RenderPipeline): setObjectThreadgroupMemoryLength:atIndex: and its mesh form are not built.
The known gap now says what starts that build: the first replay stream, consumer walk or guest
that makes a mesh state whose object or mesh function declares such an argument. The stream
greps of this lane found no stream making a mesh state (jobs 84938 and 85231: 25 kept streams,
0 naming newRenderPipelineStateWithMeshDescriptor, a mesh draw or setObjectThreadgroupMemoryLength).

Docs only; the paragraph's tail is reflowed to 100 columns. Verified: the README diff alone.
2026-12-03 17:05:46 -08:00
Anees Iqbal f8d8f4a51a Runtime tests: the mesh form's costs, printed per card
Before READY the planner asked for the launcher's cost and the cost of a stage's
workgroup at the state's maximum M, one card per vendor, as known-gap rows.
mesh_costs_print_per_card (m2v_gpu, ignored; run under
METAL2VULKAN_TEST_UNVALIDATED=1 with --run-ignored only, once per card) times,
as the median GPU time of nine command buffers after two unmeasured:

- a mesh-only draw of 1 group (the launcher's task workgroup and one mesh
  workgroup) against a 1-triangle draw of a vertex state on the same kind of
  pass: the launcher's fixed cost;
- 65,535 groups of 4 threads on a state at its default M (capped by the
  device) and on one at M 4: the idle invocations' cost, as a ratio;
- the time per group between 1 and 65,535 groups at the default M.

It prints one "mesh_costs:" row per device and asserts nothing about time
(main: no test-only link, the cheap launcher row, lavapipe left out).

Verified: JOBLINE
2026-12-03 17:05:46 -08:00
Anees Iqbal a5a7142fba Runtime: each recorded mesh draw is counted by its form
Condition 7 asks for the path's counter on each venue the mesh cases run on.
Three new metrics count each recorded mesh draw by the form it took:

- Metrics::mesh_draws_launched: a state without an object function, one task
  workgroup of its launcher (direct and indirect draws);
- Metrics::mesh_object_grids_whole: an object grid within the task limits, one
  vkCmdDrawMeshTasksEXT of its counts;
- Metrics::mesh_object_grids_in_pieces: an object grid past them, one
  vkCmdDrawMeshTasksIndirectEXT of its pieces.

A grid the host knows is empty records nothing and is not counted. The
conformance replay prints, for each case that drew any, "mesh forms: CASE on
DEVICE: a launched, b object grids whole, c in pieces", beside its other form
lines; no verdict reads it. The lavapipe device test a_mesh_draw_draws_metal_s_grids
asserts the count of each draw's form. The README's mesh line and
draw_mesh_threadgroups' doc name the three; signatures blessed.

Verified: JOBLINE
2026-12-03 17:05:46 -08:00
Anees Iqbal 4964047ba2 Runtime docs: the venues without mesh stages, and each card's mesh limits
The runtime README's Mesh stages section names the four venues that list no
VK_EXT_mesh_shader, where a mesh render pipeline state is refused
(Unsupported{MeshShading}): the Radeon RX 550 (RADV, Mesa 26.2.6), the Iris Xe
(ANV, Mesa 26.2.6), and the M3 Max under KosmicKrisp (Mesa 26.3.1) and MoltenVK
(1.4.2). A table gives the others' limits that decide a mesh draw: the task
grid (count and total), the task and mesh invocations and width, and
maxTaskPayloadAndSharedMemorySize:

- RTX 3090, RTX 2080 (NVIDIA 620.70.06); RTX 5080 Laptop (NVIDIA 615.71.09):
  task (4194304, 65535, 65535), total 4194304; 128 task, 128 mesh; 32768.
- RX 7900 XTX, Radeon 780M (RADV, Mesa 26.2.6): task (65535, 65535, 65535),
  total 4194304; 1024 task, 256 mesh; 65536.
- lavapipe (Mesa 26.2.4 and 26.2.6): task 65536 per axis, total 4194304;
  1024 and 1024; 32768.

It then says what the caps mean: the NVIDIA cards answer at most 128 for each
stage where Metal answers up to 1,024, a larger threadgroup's draw is
Limit::MeshThreadgroupThreads, and the AMD cards cap the mesh stage at 256.
These are the CAP ruling's known-gap rows.

Verified: docs only; each number read from vulkaninfo on that card.
2026-12-03 17:05:45 -08:00
Anees Iqbal 07d9577c20 Translator and runtime: the mesh stages no longer require drawIndirectCount
Since the step-4 ruling no mesh draw reads a GPU-written draw count: an
indirect draw of an object function is the runtime's refusal at the draw
(DrawKind::IndirectObjectGrid), a mesh-only indirect draw is the launcher's one
task workgroup (vkCmdDrawMeshTasksEXT(1, 1, 1)), and an object grid's pieces past
the task limits take a host-written count through multiDrawIndirect. Rule 4
(anything unused is deleted) drops it, as the planner ruled through main:

- lower::mesh::FEATURES and floor::MESH_STAGES hold taskShader, meshShader and
  multiDrawIndirect; device creation enables VK_EXT_mesh_shader with those
  three where the device reports all three.
- The cond-1 tests iterate the three; the floor test also shows a device
  without drawIndirectCount given the mesh stages, and the device test no
  longer reads it.
- The README's Mesh stages section and its extension row, docs/API.md, the
  compile_mesh_pipeline and new_mesh_render_pipeline_state docs, and the
  requirement's own doc say three.
- SEMANTICS_VERSION 2370 (placeholder; main renumbers): the MeshShading
  refusal's needs change on a profile without drawIndirectCount (the M3 Max
  under MoltenVK reports it false).

No lab device changes: every card that lists VK_EXT_mesh_shader reports
drawIndirectCount (vulkaninfo on the RTX 3090, RTX 2080, RTX 5080 Laptop,
RX 7900 XTX, Radeon 780M and lavapipe). REFUSALS.md and the signatures were
regenerated and did not move; the runtime sources pin was rewritten.

Verified: JOBLINE
2026-12-03 17:05:45 -08:00
Anees Iqbal ab493847c9 Translator tests: a device without drawIndirectCount takes the mesh stages (red)
Since the step-4 ruling no mesh draw reads a GPU-written draw count: an
indirect draw of an object function is the runtime's refusal at the draw, a
mesh-only one is the launcher's one task workgroup, and an object grid's pieces
take a host count through multiDrawIndirect. The new test compiles every object
and mesh function of mesh_order and mesh_outputs, and mesh_draws' pipeline with
and without its object function, on each committed profile that lists
VK_EXT_mesh_shader, with drawIndirectCount removed from the device. It fails
until lower::mesh::FEATURES stops requiring the feature.

Verified: JOBLINE
2026-12-03 17:05:45 -08:00
Anees Iqbal 3ab8bcd357 Conformance: the runtime's side answers the mesh pipeline calls
The rt side answered every mesh call with Unavailable. It now answers them
through the runtime's mesh render pipeline states (new module rt_side/mesh.rs):

- mesh_pipeline and mesh_pipeline_for_commands: new_mesh_render_pipeline_state
  of the case's object, mesh and fragment functions over RGBA32Uint colour
  attachments, the second with support_indirect_command_buffers set.
- mesh_pass: one pass over the targets, each cleared to zero and stored, every
  step encoded whatever an earlier one answered (the set_object_*,
  set_mesh_*, set_fragment_buffer, draw_mesh_threadgroups, draw_mesh_threads
  and draw_mesh_threadgroups_indirect calls; both barrier forms are the
  runtime's memory_barrier, whose doc names both), committed and waited for
  within WAIT; the states it set announce their notes.
- mesh_pipeline_limits: the descriptor's limits with rasterization disabled,
  the state's answers floored as the Metal side floors them, or Metal's
  refusal where the runtime's error is one (refuses_as_metal, now shared).
- mesh_descriptor_facts: the translator's MeshPipelineDescriptor stated and
  read through descriptor_reads (new state_mesh and read_mesh; the colour
  attachments' stating and reading are now one helper each, shared with the
  render walk).
- mesh_pipeline_bindings: the consumer's own (reflection_is_the_consumers).
- mesh_command_buffer: the runtime's indirect command buffer of both mesh draw
  types, which it refuses as CommandTypes (the planner's ruling: not built).

Three getters the runtime has no counterpart of become fields a side refuses
alone, the other getters still compared, as the render facts already do: a mesh
descriptor's label and binaryArchives, and a mesh state's
maxTotalThreadsPerThreadgroup (a tile threadgroup's). The Metal side answers
each as Ok, so the recordings' sites are unchanged.

The answered-calls test gains the five mesh calls with a case that reaches each.

Verified: JOBLINE
2026-12-03 17:05:45 -08:00
Anees Iqbal c2a7d6f0fe Runtime docs: mesh draw commands in an indirect command buffer stay CommandTypes
The runtime README's known gaps of indirect command buffers gain a line for
MTLIndirectCommandTypeDrawMeshThreadgroups and MTLIndirectCommandTypeDrawMeshThreads:
refused as IndirectCommandsKind::CommandTypes, and what lifts them. Two general
gaps come first, because the conformance suite's three mesh command cases
(mesh-commands-own-state, mesh-commands-unordered-draws and
indirect-mesh-commands-object-threadgroup-lengths) each set their own pipeline
state (CommandPipelines) and are encoded by the CPU, which is not built. With
both built, the mesh types take a command layout of their own
(VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_EXT) carrying the draw's group
counts and threadgroup sizes. CommandTypes' doc comment names the two mesh types
and the same order.

This is the planner's ruling on the mesh indirect command buffers: they stay a
typed refusal, not built in the mesh lane.

Verified: docs only. docs/REFUSALS.md regenerated with refusal_surface.py and
unchanged (its row is Gap::IndirectCommandBuffers, not the kind); the runtime
sources pin is EQUAL; cargo fmt --all.
2026-12-03 17:05:45 -08:00
Anees Iqbal 28c2803429 Runtime: an indirect mesh draw of an object function is refused at the draw
What: a new DrawKind::IndirectObjectGrid. MeshCall::of refuses an indirect draw (MeshGrid::Indirect)
of a state with an object function with Gap::Draw of it, after the threadgroup checks and before
anything is recorded; draw_mesh_threadgroups_indirect's doc says so. Launch::Arguments, the
object grid's indirect command the previous commit drew, is deleted with its recording. An
indirect draw of a state without an object function is drawn through the launcher, as before.
The runtime README's mesh known gap records the refusal, where Metal draws, and that no guest has
met it (no replay stream or live session has used a mesh state).

Why: the planner's step-4 ruling. An object grid the GPU reads may lie past the device's task
limits (maxTaskWorkGroupCount, maxTaskWorkGroupTotalCount), where it runs in pieces whose number
only the counts decide; the runtime reads no GPU word on the host (condition 6) and no command
inside the pass can write the pieces' records (condition 5), and Vulkan leaves a task grid past
the limits undefined (VUID-VkDrawMeshTasksIndirectCommandEXT-TaskEXT-07322).

Tests: the parent's red tests pass here, narrowed to the kind: the no-device
tests::mesh_draw::an_indirect_draw_of_an_object_function_is_refused_at_the_draw and the lavapipe
draw test's indirect draw of mesh_draws' object state. docs/REFUSALS.md, error/basis.rs and
api_signatures.tsv are regenerated.

Verified: JOBLINE
2026-12-03 17:05:44 -08:00
Anees Iqbal a838dfb8db Runtime tests: red, an indirect mesh draw of an object function is refused at the draw
What: tests::mesh_draw::an_indirect_draw_of_an_object_function_is_refused_at_the_draw asks
MeshCall::of for an indirect draw of a state with an object function and expects a
Gap::Draw; the lavapipe draw test asks the encoder's draw_mesh_threadgroups_indirect of
mesh_draws' object state and expects the same, before anything is recorded. Both fail at this
commit: the draw records the object grid's indirect command from the GPU's counts, which is right
only within the device's task limits.

Why: the planner's step-4 ruling, red first: an indirect draw of an object pipeline is a typed
refusal at the draw. The next commit makes it.

Verified: JOBLINE (expected to fail here)
2026-12-03 17:05:44 -08:00
Anees Iqbal a5624a650f Runtime: a mesh render pipeline state draws drawMeshThreadgroupsWithIndirectBuffer
What: RenderCommandEncoder::draw_mesh_threadgroups_indirect, Metal's
drawMeshThreadgroupsWithIndirectBuffer:indirectBufferOffset:threadsPerObjectThreadgroup:
threadsPerMeshThreadgroup:. The arguments (Metal's MTLDispatchThreadgroupsIndirectArguments,
three u32s) are checked as a vertex draw's are (OtherDevice, IndirectOffset,
IndirectArgumentsPastEnd at 12 bytes, ArgumentPlace; the checks are now one helper,
arguments_checked, for both). The draw pushes the arguments' address as the group counts'
address, so nothing is written to the ring and nothing read back:

- without an object function the state's launcher reads the GPU's counts there and emits the mesh
  grid where Metal draws it, one task workgroup, vkCmdDrawMeshTasksEXT(1, 1, 1);
- with one, the arguments are the object grid's own indirect command, one
  vkCmdDrawMeshTasksIndirectEXT record (Vulkan's command is Metal's layout).

The buffer counts as the draw's read (its hazards, a Managed buffer's copy, kept until the command
buffer retires), as a vertex draw's arguments. Call::Mesh carries the arguments; mesh_draw gains
MeshGrid::Indirect and Launch::Arguments. README and docs/API.md say the indirect form is drawn.

Why: R3 of the mesh build. The object pipeline's indirect form is drawn here as the task grid's
indirect command, which is right only within the device's task limits; the planner's step-4
ruling refuses it at the draw, which the next two commits do red-first.

Tests: tests::mesh_draw adds the indirect calls' counts, regions and launches; the lavapipe draw
test adds three indirect draws through the launcher: 3 groups by 8 at offset 8 (the M3's
grid-indirect-3x1-by-8 pixels and words), and an axis of 65,536 and 1024 by 1024, which draw
nothing, as on the M3. api_signatures.tsv and docs/REFUSALS.md are regenerated.

Verified: JOBLINE
2026-12-03 17:05:44 -08:00
Anees Iqbal 14a935e73d Docs: a mesh stage's default thread maximum of 1024 is as an M3 recorded it
What: GraphicsState::max_total_threads_per_object_threadgroup's doc, docs/API.md's mesh
pipelines section and RenderPipelineState::max_total_threads_per_object_threadgroup's doc now
say the rule's last step, 1024 where neither the descriptor nor the function states a maximum,
is as an M3 recorded it (an M3 Max, macOS 27.0.1, a first compile, the conformance probe
mesh_pipeline_limits.m), and that Metal's headers state no default.

Why: the planner's wording ruling on T9: the value is measured, and the doc says where from.

Verified: comment and doc text only; cargo fmt; runtime-sources.sha256 unchanged (the pinned
set holds none of these files).
2026-12-03 17:05:44 -08:00
Anees Iqbal a08a4fd1da Runtime: mesh render pipeline states draw drawMeshThreadgroups and drawMeshThreads
What: the render encoder binds the object and mesh functions' tables (set_object_* and
set_mesh_*: buffer, buffer offset, bytes, texture, sampler state with and without LOD clamps) and
draws a mesh state directly: draw_mesh_threadgroups and draw_mesh_threads. The device loads
VK_EXT_mesh_shader's commands where it enabled the extension (Core::mesh). A new module,
mesh_draw, holds the draw's grid:

- each threadgroup is checked against Metal's maximum for its stage (Refusal::ThreadgroupSize for
  no threads or past it) and then against the state's capped maximum, a new
  Limit::MeshThreadgroupThreads naming the stage, the size, the state's maximum, the Vulkan limit
  that holds it (a new public WorkGroupLimit, maxTaskWorkGroupInvocations, maxTaskWorkGroupSize[0]
  or their mesh siblings) and that limit's value, counted in a new
  Metrics::mesh_threadgroups_past_device. The object size is read only where the state has an
  object function.
- the draw writes three group counts into the ring and pushes their address
  (GroupCountsAddress), and writes each stage's DispatchRegion: the mesh stage's L, and the object
  stage's L with Metal's threads per grid and the partial flag for a draw of threads (no grid for
  a draw of threadgroups, so the object function's is counts times L).
- without an object function the counts are the mesh grid (a draw of threads rounds it down, as
  the M3 recorded in mesh-grid-draws), and the draw is the launcher's one task workgroup,
  vkCmdDrawMeshTasksEXT(1, 1, 1).
- with one, an object grid within the task limits is one vkCmdDrawMeshTasksEXT of its counts;
  past them it runs in pieces of the most workgroups the limits allow, one piece directly and more
  as one vkCmdDrawMeshTasksIndirectEXT whose records lie in the ring (stride 12), the folded object
  function numbering them by DrawIndex. More pieces than one ring chunk holds (5,461) is a new
  Limit::ObjectThreadgroups.
- an empty grid records nothing; a mesh draw with a vertex function's state is Refusal::MeshDraw,
  whose doc now covers both directions.

Each mesh draw fills its push bytes and blocks (its counts and regions are its own); it records
no topology (a mesh pipeline holds no input assembly, which leaves the recorded topology as it
was) and biases as triangles. No draw ends the pass and nothing reads a GPU word back
(conditions 5 and 6 for direct draws). The indirect mesh draw is not built yet: the README's known
gap says so, and the consumer refuses it itself.

Why: R2 of the mesh build, direct draws, in the ruled order after the state (R1b).

Tests: tests::mesh_draw (no device) checks the size refusals and the limit with its Vulkan names,
each call's counts, regions and launch against the region helpers, and the pieces on the 780M's
and the RTX 50's task grids (cover, minimality, the chunk limit). tests::mesh_state's new device
test draws mesh_draws' states into two RGBA32Uint targets and compares every pixel with the
fixture's words, which match the M3's recordings (mesh-grid-draws, mesh-object-draws): through the
launcher (3x2 groups by 4, 7x5 threads by 2x2), through the object function (2 groups of 2, 3
threads of 2 with a partial threadgroup), empty grids, and the refusals. It also prints each
device's task and mesh limits for the known gaps' per-card table. docs/REFUSALS.md, error/basis.rs
and api_signatures.tsv are regenerated; README and docs/API.md state the direct draws.

Verified: JOBLINE
2026-12-03 17:05:44 -08:00
Anees Iqbal b92932f1eb Runtime: MeshDraw's message, and the tests' tables at four
What: Refusal's Display names MeshDraw. The indirect test's Draws and the render offsets tests
take four tables (crate::render::TABLES) where they wrote two.

Why: m3-max-85433 at ce095262a1 failed clippy (plain): Refusal's Display match did not cover
MeshDraw, and three test literals still had two tables after 06c4155ad9 made four. The device
cfg's render_offsets assertion on dirty_offsets is the fourth such literal.

Verified: the four places clippy named, and the one device-cfg literal of the same kind found by
grep. The next job's clippy steps read them.
2026-12-03 17:05:43 -08:00
Anees Iqbal 3d55fb8511 Runtime: the floor's public mesh docs name the four features, not the private MESH_STAGES
What: the docs of MESH_EXTENSIONS, the floor's mesh feature field and its extension list name
taskShader, meshShader, multiDrawIndirect and drawIndirectCount in place of a link to the
crate-private MESH_STAGES.

Why: RUSTDOCFLAGS='-D warnings' cargo doc refused three public docs that linked a private item
(m3-max-85346, rustdoc EXIT=101, at bf42fe0b82); public docs never link to private items.

Verified: the three lines rustdoc named are the three changed. The next job's rustdoc step reads
them.
2026-12-03 17:05:43 -08:00
Anees Iqbal 36a93dc7ec Runtime: a mesh render pipeline state is made, with its VkPipeline and Metal's thread and grid answers
What: Device::new_mesh_render_pipeline_state(&MeshPipelineDescriptor, sampler_ids) makes a
RenderPipelineState of a mesh descriptor.
- The content is compiled with compile_mesh_pipeline at each creation. The translator gives no
  key of a mesh descriptor before its compile, so neither the map of contents nor the cache
  directory holds one.
- The draw tables become four: VERTEX, FRAGMENT, OBJECT and MESH, in Draws, OffsetLayout and the
  render encoder's tables, blocks and dirty offsets.
- draws() maps the object stage (or the launcher) and the mesh stage to their tables, takes their
  threadgroup facts, and maps DispatchRegion, GroupCountsAddress (new FieldValue::GroupCounts) and
  the mesh stage's layer and viewport counts.
- MeshThreads holds each stage's answer: the translator's stated maximum capped by
  maxTask/MeshWorkGroupInvocations and maxTask/MeshWorkGroupSize[0]. Its workgroup is that answer
  in one row, rounded up to the stages' LocalSizeConstraint multiple.
- stage_module specializes ObjectLocalSize/ObjectFlatLocalSize, with ObjectMultiRegion 1, and
  LocalSize/FlatLocalSize, with MultiRegion 0, to the two workgroups. A threadgroup memory length
  stays refused.
- make() gives a mesh pipeline no vertex input or input assembly, and drops PRIMITIVE_TOPOLOGY and
  PRIMITIVE_RESTART_ENABLE from its dynamic states (VUID-VkGraphicsPipelineCreateInfo-
  pDynamicStates-07065 and -07066).
- The state answers maxTotalThreadsPerObjectThreadgroup, maxTotalThreadsPerMeshThreadgroup,
  objectThreadExecutionWidth and meshThreadExecutionWidth (32), maxTotalThreadgroupsPerMeshGrid
  (the descriptor's, else 1,048,576) and both required sizes. A state without an object function
  answers 0 for its object stage, as docs/API.md's accepted differences say.
- New Refusal::MeshDraw (basis: ours) refuses a draw of primitives or patches, or an execution of
  an indirect command buffer, with a mesh state (VUID-vkCmdDraw-stage-06481). The encoder records
  no mesh draw yet; that is the next step.
- The runtime re-exports MeshPipelineDescriptor.

Why: step 2 of the ruled order (floor, state, direct, indirect, ICB, adapter), under the planner's
cap ruling: a made state answers the capped maxima.

Docs: the README's known gap now says mesh states are made and not drawn, each creation compiles,
threadgroup memory arguments are refused, and the maxima are capped. The stale identity-domains
bullet for object and mesh functions is deleted: 2761e27594 removed that refusal. docs/API.md is
updated. docs/REFUSALS.md and error/basis.rs are regenerated. api_signatures.tsv is blessed: new
runtime methods, the refusal and the re-export, with nothing removed.

Tests: tests::mesh_state, under a device cfg, on every device of the cfg's kind. Where the device
has the mesh set:
- mesh_pipeline_limits' four states (nothing stated; 64, 32 and grid 8; without an object
  function, with and without grid 8) are made with their VkPipeline and answer the capped maxima;
- a draw of primitives with one is Refusal::MeshDraw;
- mesh_draws' rasterizing states into two RGBA32Uint colours, with and without the object
  function, make their VkPipeline.
Elsewhere each state is refused naming MeshShading.
2026-12-03 17:05:43 -08:00
Anees Iqbal 7fa5ab461e Translator: a mesh stage's stated maximum is its required size's threads first, as Metal answers it
What: stated_threads takes the descriptor's required threadgroup size for the stage first: its
threads, then the descriptor's maximum, then the function's attribute, then 1024. mesh_fields
keys both required sizes, since the stated maxima now depend on them. The doc comments say where
each part of the rule was measured.

Why: the conformance probe mesh_pipeline_limits.m, measured on an M3 Max under macOS 27.0.1 with
each case a first compile, records the rule:
- `plain`, with nothing stated, answers 1024 for both stages. That is the source of "else 1024".
- A required size answers its threads, even below a function's own maximum:
  required-object-32x2 answers 64, required-mesh-16x2 answers 32, and
  required-object-32-attribute-64 answers 32.
- A maximum or an attribute answers itself.
The parent commit left the required size out. The descriptor's doc said no limit depended on it,
which those rows contradict.

Tests: a_mesh_pipeline_states_its_thread_maxima_by_metal_s_rule adds three rows:
- (32,2,1) required for the object stage gives (64, 1024);
- (16,2,1) required for the mesh stage gives (1024, 32);
- mesh_outputs with (32,1,1) required for the object stage, whose function states 64, gives
  (32, 32).
The ARTIFACT_FORMAT_VERSION bump of the parent covers this, and every mesh pipeline's key moves.
api_signatures.tsv is re-blessed and unchanged.
2026-12-03 17:05:43 -08:00
Anees Iqbal ed873cf04b Tests: the floor's mesh-stage test iterates the four features, not their indices
What: mesh_stages_are_enabled_where_listed_with_all_four_features loops over MESH_STAGES' entries
in place of an index range.

Why: clippy's needless_range_loop refused the index loop under -D warnings (the runtime's lib
test target), so the clippy step of m3-max-85346 at bf42fe0b82 exited 101 on it alone.

Verified: the line clippy named; the loop's assertions are the same four. The next job's three
clippy steps read it.
2026-12-03 17:05:43 -08:00
Anees Iqbal 2ffddf5a56 Translator: a mesh render pipeline states each stage's thread maximum by Metal's rule
What: GraphicsState gains max_total_threads_per_object_threadgroup and
max_total_threads_per_mesh_threadgroup, both Option<u32>. compile_mesh_pipeline sets them by
Metal's rule, before any device limit: the descriptor's maximum where it states one, else the
function's [[max_total_threads_per_threadgroup(n)]], else 1024. The object one is None without an
object function; every vertex pipeline states neither. The cache codec encodes both.

Why: a mesh render pipeline state answers maxTotalThreadsPerObjectThreadgroup and
maxTotalThreadsPerMeshThreadgroup, and the runtime specializes each stage's workgroup to that
many threads (capped by the stage's device limits, per the planner's cap ruling). The function's
attribute lives only in its compile, so the runtime cannot read it from the descriptor; the
pipeline now states it, as a compute pipeline's metal_info states its kernel's.

ARTIFACT_FORMAT_VERSION 609 (a placeholder; the number is set at landing): GraphicsState's
encoding has two more fields. A digest omits a field at its default, so no vertex pipeline's
content digest moves; a mesh pipeline's does.

Tests: engine_mesh's a_mesh_pipeline_states_its_thread_maxima_by_metal_s_rule, on the first
committed profile with the mesh stages: mesh_pipeline_limits with nothing stated (1024, 1024),
with 64 and 32 stated (64, 32), its mesh function alone (none, 1024), and mesh_outputs, whose
object and mesh functions state 64 and 32 (64, 32). The codec round trip carries both fields.
docs/API.md's mesh pipelines section states the rule and what a consumer does with it.
api_signatures.tsv is blessed: two public fields added, nothing removed.
2026-12-03 17:05:43 -08:00
Anees Iqbal ecdce9a3b5 Translator: a mesh pipeline without an object function draws through a launcher task stage
What: link::mesh::Launcher. Link plans it for a mesh render pipeline without an object function.
Its push range is 8 bytes at the first offset no stage's range covers (tessellation's
push_offset; Unsupported{MeshShading} needing maxPushConstantsSize where none is free), and it
places its one field, PushField::GroupCountsAddress, as an object-stage placement, first in the
interface. compile_mesh_pipeline builds its module and puts it first among the stages, joining
its requirements:
- a TaskEXT entry of LocalSize 1 1 1 loads the three counts at the pushed address (4-aligned,
  Metal's MTLDispatchThreadgroupsIndirectArguments layout);
- it emits that grid where each axis is within Metal's measured 65,535 and the device's
  maxMeshWorkGroupCount, and the product within Metal's 1,048,575 and the device's
  maxMeshWorkGroupTotalCount, tested as an object function's wrapper tests its grid; past them
  it emits 0, 0, 0, so nothing is drawn, as Metal draws nothing;
- where the mesh function reads a payload, it declares an arena of that size
  (memory::arena::declare_payload) and emits it unwritten, as VUID-RuntimeSpirv-MeshEXT-12380
  requires.

Why: the planner's ruling on the mesh build, step 4, mesh-only pipelines. Every draw of such a
pipeline, direct or indirect, is then vkCmdDrawMeshTasksEXT(1, 1, 1) in its pass and in order:
for an indirect draw the address is the guest's buffer, so nothing is written before the pass,
and Metal's limits are held on the GPU. Direct draws take the same stage, with their counts
written to the ring, so the state has one form.

SEMANTICS_VERSION 2369 (a placeholder; the number is set at landing): a mesh-only pipeline gains a
stage. No function's own module moves.

Tests: the parent's red test passes. The identity-domains test checks each stage, the launcher
included, with spirv-val and the profile's requirements. docs/API.md's mesh pipelines section,
compile_mesh_pipeline's doc and the pipeline module docs describe the launcher.
runtime-sources.sha256 is unchanged.

Verified: see the job named below.
2026-12-03 17:05:43 -08:00
Anees Iqbal 52fb3de2c3 Tests: a mesh pipeline without an object function draws through a launcher task stage (red)
What: engine_mesh's a_mesh_pipeline_without_an_object_function_draws_through_a_launcher. On every
committed profile with the mesh stages, mesh_draws' pipeline without its object function has
three stages, TASK_EXT, MESH_EXT and FRAGMENT in that order, and places one push field for the
object stage, GroupCountsAddress (matched by name).

Why: the planner's ruling on the mesh build, step 4: a mesh-only pipeline draws through a task
stage of one invocation that reads the draw's group counts by address (the guest's buffer for an
indirect draw, the ring for a direct one) and launches that grid, and nothing past Metal's
measured limits; the draw is vkCmdDrawMeshTasksEXT(1, 1, 1), in the pass, in order.

Red: fails on every profile with the mesh stages: the pipeline has the mesh and fragment stages
alone.
2026-12-03 17:05:42 -08:00
Anees Iqbal 8a80dd27df Translator: an object function reads its draw's group counts at an address, the rest of its region pushed
What: a new push field, PushField::GroupCountsAddress: the device address of a draw's three
threadgroup counts in Metal's MTLDispatchThreadgroupsIndirectArguments layout (three u32s at a
multiple of 4). A folded object function, its one grid form, places it with its own
DispatchRegion, in place of the 32-byte record at ReplayRegionAddress:
- access::object_region builds the region the folded walk reads: the pushed DispatchRegion, its
  first xyz replaced by the counts read at the address (three 4-aligned loads);
  EmitCx::push_field routes a folded object function's DispatchRegion there
  (held_push_field loads a field as its block holds it);
- its threadgroups per grid are the counts, and its threads per grid the counts times L,
  wrapping as Metal's builtins do, or the region's grid where the draw states one (a draw of
  threads, whose partial flag the region carries as before);
- plan_replay places the two fields for a folded object function; a folded kernel, a flat
  variant and a replay variant keep their record;
- under the identity domains GroupCountsAddress is an admitted field, and ReplayRegionAddress
  is refused for every stage (its object exception is gone).

Why: the planner's ruling on the mesh build, point 5: the counts need nothing beside them, so a
draw can point the field at counts as an indirect buffer holds them, and the threads per grid
come from the pushed L.

SEMANTICS_VERSION 2368 (a placeholder; the number is set at landing): every object function's
module moves. The engine golden table's object cells on the profiles with the mesh stages move
with it; they wait for the bless at the next named pin.

Tests: the parent's red test passes. The push field ordering test places GroupCountsAddress
after DispatchRegion. The field's encoding (cache codec) and its shape (u64) are added;
tests/api_signatures.tsv gains the variant; docs/API.md's mesh pipelines section, the dispatch
module docs, LoweringInputs::folded_groups and RuntimeFact::FoldedGroups say what the object
function reads. runtime-sources.sha256 is re-pinned.

Verified: see the job named below.
2026-12-03 17:05:42 -08:00
Anees Iqbal e537cfb7f5 API signatures: the subgroup model's object and mesh stages and the runtime's mesh extension list
What: tests/api_signatures.tsv gains the five public items two earlier commits of this branch
added without the table: SubgroupModel's object and mesh fields (the stages' own subgroup facts)
and the runtime floor's MESH_EXTENSIONS with Features.mesh.

Why: signatures.py --check fails on a public item the table does not hold; the commits that made
them did not bless it.

Verified: python3 scripts/api-signatures/signatures.py --bless wrote exactly these five lines here
(and the next commit's push field, left to it).
2026-12-03 17:05:42 -08:00
Anees Iqbal ca90151363 Tests: an object function reads its draw's group counts at an address, its size from its region (red)
What: engine_mesh's an_object_function_reads_its_group_counts_at_an_address. On every committed
profile with the mesh stages, mesh_draws' pipeline with its object function places, for the
object stage, PushField::GroupCountsAddress and PushField::DispatchRegion, and no
PushField::ReplayRegionAddress. The fields are matched by name, since GroupCountsAddress does
not exist yet. The identity-domains test and the new one share mesh_draws_pipelines, which makes
the pipelines once per profile.

Why: the planner's ruling on the mesh build, point 5: an object function reads Metal's three
group counts (MTLDispatchThreadgroupsIndirectArguments) by address and computes its threads per
grid from the pushed threadgroup size, so the counts need nothing beside them. Today it reads a
32-byte record at ReplayRegionAddress holding the counts with L, the threads and the flags.

Red: fails on every profile with the mesh stages, since the object stage places
ReplayRegionAddress alone.
2026-12-03 17:05:42 -08:00
Anees Iqbal 3fba14db84 Validation tests: the census compiles the committed mesh and object cases' pipelines
The identity domains lower object and mesh functions since the identity
arm for them was deleted, so the authored compile census's one compile of
each committed mesh or object case's pipeline (lavapipe) now compiles
instead of being refused as not implemented under the identity domains.
The test that held the refusal now holds the compile; its name and doc
say so. A run's preparation still refuses those cases by
MeshRenderPipeline alone: no candidate draws a mesh pipeline yet.

Verified: the old assertion failed with outcome Ok(Compiled) for
a-mesh-grid-of-threadgroups-draws-through-its-fragment in m3-max-85222
(validation, lavapipe). The new form runs in the next job.
2026-12-03 17:05:42 -08:00
Anees Iqbal 17bd402d0c Runtime: device creation enables VK_EXT_mesh_shader with taskShader, meshShader, multiDrawIndirect and drawIndirectCount, all together or none
What: floor::MESH_EXTENSIONS (VK_EXT_mesh_shader) and floor::MESH_STAGES (taskShader, meshShader,
multiDrawIndirect, drawIndirectCount). The floor reads VkPhysicalDeviceMeshShaderFeaturesEXT from
a device that lists the extension. decide() enables the extension and all four features where
the device lists it and reports all four, and none of them otherwise. Device creation chains the
mesh structure where the extension is enabled. shader_enables states the four features and
ExtMeshShader to the translator. The README's Floor states the extension row and a Mesh stages
section with its table.

Why: condition 1 of the planner's ruling on the mesh build. The runtime enabled none of it, so
the translator's profile of every runtime device refused object and mesh functions. With this
commit, a device that offers the four gets them, and the translator's MeshShading query and
refusal (the translator commit before) decide the rest from what creation enabled. The four go
together because a mesh draw runs its grid as pieces of one multi-draw and an indirect one reads
its count of pieces from a buffer. No answer chooses a second form.

Tests: floor's mesh_stages_are_enabled_where_listed_with_all_four_features checks:
- at the floor, nothing is enabled;
- reported but not listed, nothing;
- listed and reported, the extension and all four, and the translator is told each;
- listed with any one of the four missing, none.
the_readme_states_the_floor holds the new rows to the code. Under a device cfg,
every_device_the_loader_lists_is_above_the_floor creates each device with the mesh structure
chained, and the device test expects the extension where the device reports all four.

Verified: see the job named below.
2026-12-03 17:05:41 -08:00
Anees Iqbal 763caf0270 Translator: object and mesh functions take their SIMD groups from the task and mesh stages' own subgroup facts
What: the profile's subgroup model now records the task and mesh stages (SubgroupModel::object
and ::mesh), read like the other stages from subgroupSupportedStages, the device's operation
classes, requiredSubgroupSizeStages under subgroupSizeControl, and the size range.
computeFullSubgroups gives full subgroups to the compute, task and mesh stages, as Vulkan says
("requiring full subgroups in compute, mesh, or task shaders"). STAGE_BITS names the two stages,
so a module's SubgroupStage and RequiredSubgroupSizeStage properties for them are in the enabled
capabilities. The stand-in that answered "no subgroups" for both stages (UNMODELED_STAGE) is
deleted.

subgroup::tier, width_needs, requirement and quad_free treat object and mesh functions as they
treat kernels (Stage::has_workgroup):
- full subgroups and a pinned 32 (Direct), or 64 or 128 split into 32-lane clusters;
- a local size multiple of that size, which dispatch::plan_kernel already states as
  RuntimeFact::LocalSizeConstraint for the flattened form;
- quads tiered as cross-lane quad operations;
- a quad-only function at the size the stage gives.
The emulated tier stays the kernels' alone. An object or mesh stage that pins no size and runs
below 32 lanes (lavapipe) refuses a SIMD-group function as Unsupported{SimdWidth}, naming
subgroupSizeControl, the stage's RequiredSubgroupSizeStage and its maxSubgroupSize. Quad
instructions stay kernel-only (lower::simd), so an object or mesh quad is a shuffle, and the
requirement derivation still asks subgroupQuadOperationsInAllStages of a quad instruction in the
task and mesh stages.

Why: conditions 2 and 3 of the planner's ruling on the mesh build. An object or mesh function's
SIMD groups run on the native subgroup. Its workgroup is its pipeline's stated maximum (the
condition 4 commit), made a multiple of the subgroup size, and the invocations past a draw's
threadgroup are not live, so a partial SIMD group has Metal's inactive lanes; no threadgroup
size is refused for not being whole SIMD groups. The planner ruled (a) for lavapipe: the typed
device-lack refusal, decided by those queries alone, with no emulated tier. Main fires that
ruling's trigger: a real card's profile that lists the mesh extension but lacks size control
for the task or mesh stage.

The stage facts extend the existing subgroup queries to two more stages; no form is added.
Every profile's fingerprint changes with its subgroup model. SEMANTICS_VERSION 2367 (a
placeholder for the number at landing): object and mesh functions of SIMD-group operations
compile where they were refused.

Tests: the parent's red test passes. The tier golden table gains the object and mesh columns:
- Direct on the AMD, Arc and RTX 50 profiles;
- a width refusal on lavapipe;
- missing operations where the device lists neither stage (Iris Xe, UHD 770, Pascal, MoltenVK,
  the runtime floor).
The invariants hold for object and mesh as for kernels.
object_and_mesh_stages_read_their_own_subgroup_facts checks the three queries apart on the
780M's description:
- a mesh stage outside requiredSubgroupSizeStages takes two 32-lane clusters of its 64 lanes
  while the task stage pins 32;
- without computeFullSubgroups both are refused naming it;
- without the task stage listed, an object function is refused naming it while a mesh function
  keeps Direct.
The narrow-subgroup and quad-only tests cover the two stages.
docs/API.md's mesh pipelines section states the stages' SIMD groups, the refusal and the quads.
runtime-sources.sha256 is re-pinned.

Reuse: the shape of this change was read in PR 25's device/subgroup.rs and device/derive.rs
(the model's two stages, STAGE_BITS, has_workgroup in tier, width_needs, requirement and
quad_free). Not taken: its change to the quad-instruction requirement, which would have dropped
subgroupQuadOperationsInAllStages for the task and mesh stages against Vulkan's "restricted to
fragment and compute stages", and its fixture and refusal.

Verified: see the job named below.
2026-12-03 17:05:41 -08:00
Anees Iqbal 4cac67a58a Tests: object and mesh functions run their SIMD groups on their stages' own subgroups (red)
What: engine_mesh's object_and_mesh_simdgroups_run_on_their_stages_subgroups, and the owned
fixture engine/mesh_simd (MSL compiled by scripts/regen-air-fixtures; TOOLCHAIN names it): an
object function and a mesh function of SIMD-group operations (simd_sum, the exclusive prefix
sum, simd_ballot, simd_shuffle_xor) and a quad-only object function (quad_shuffle_xor,
quad_broadcast of a constant lane, quad_sum), each writing one record a thread.

On every committed profile whose device lists VK_EXT_mesh_shader, each must compile to a module
that passes L3, states full subgroups and RuntimeFact::LocalSizeConstraint (a multiple of at
least 32 for the SIMD-group functions), and holds no OpGroupNonUniformQuadBroadcast or
OpGroupNonUniformQuadSwap. The exception is a stage that pins no size and runs subgroups below
32 lanes, where the SIMD-group functions must be refused as Unsupported{SimdWidth} naming
subgroupSizeControl, the stage's RequiredSubgroupSizeStage and its maxSubgroupSize. Only
lavapipe profiles may refuse.

Why: condition 3 of the planner's ruling on the mesh build: an object or mesh function's SIMD
groups run on the native subgroup, at a local size made a multiple of it. Condition 2: quads stay
kernel-only instructions, so no object or mesh module needs subgroupQuadOperationsInAllStages.
The planner's ruling (a): lavapipe's task and mesh stages pin no size and run 8 lanes, so they
get the typed device-lack refusal, with no emulated tier.

Red: today every profile refuses SIMD-group operations in object and mesh functions, because
the profile models no task or mesh subgroup facts.

Verified: see the job named below.
2026-12-03 17:05:41 -08:00
Anees Iqbal e649629fde Translator: the identity domains lower object and mesh functions; IdentityCause::ObjectOrMeshStage deleted
What: identity_refusal no longer refuses a function for being an object or mesh function, and it
takes an object function's PushField::ReplayRegionAddress, the address of the region record its
folded grid's draw pieces read (bind::mesh_arguments); that field stays refused for every other
stage. IdentityCause::ObjectOrMeshStage, which nothing produces now, is deleted.

Why: the mesh build. Every profile refused object and mesh functions under the identity
domains, the one form, so no mesh render pipeline compiled anywhere.

Public item removed (api_signatures.tsv): metal2vulkan::error::IdentityCause::ObjectOrMeshStage.
Consumer search: reims-vgpu development 35cea45c0e plus its 210 steelbrain refs younger than a
day: 0 hits for ObjectOrMeshStage.

SEMANTICS_VERSION 2366 (a placeholder; the number is set at landing): object and mesh functions
compile where they were refused.

Tests: the parent's red test passes; the validation companion's mesh pipelines compile where they
were refused; the linked reflection test's mesh pipeline compiles with its unwritten fragment
input dropped, as the tessellated one does. docs/API.md's cause list no longer names the
deleted cause; runtime-sources.sha256 is re-pinned.

Verified: see the job named below.
2026-12-03 17:05:41 -08:00
Anees Iqbal fbf7edb539 Tests: a mesh render pipeline compiles under the identity domains (red)
What: engine_mesh.rs, on every committed profile whose device lists VK_EXT_mesh_shader with
taskShader, meshShader, multiDrawIndirect and drawIndirectCount: the owned fixture mesh_draws'
mesh render pipeline, with and without its object function and with its fragment function
writing two RGBA32Uint colors, must compile, and each of its stages must pass L3 (spirv-val and
requirements within the profile).

Why: the mesh build makes the identity domains lower object and mesh functions. Today every
profile refuses them as Unsupported{IdentityDomains} of cause ObjectOrMeshStage, so this test
fails at this commit.

Verified: see the job named below.
2026-12-03 17:05:40 -08:00
Anees Iqbal b662250e62 Translator: an object or mesh function runs each draw's threadgroup within a workgroup of its stated maximum
What: lower::dispatch's threadgroups at the stated maximum (DispatchPlan::at_max, for the object
and mesh stages). The stage's workgroup is its pipeline's stated maximum (sx, sy, sz), which a
runtime specializes once when it makes the pipeline, and Metal's threadgroup of each draw is
always the region's nominal size L within it:
- region() takes L from the region whatever MultiRegion says, and the folded object function's
  position in the grid, its threads per grid and its partial threads take that L where a kernel
  takes (sx, sy, sz);
- every threadgroup answers the threads it runs, L or a partial object threadgroup's, so
  threads_per_threadgroup, the simdgroup and quadgroup counts and the position in the threadgroup
  are Metal's, and an invocation at or past their product is not live: it returns from the body
  before it starts, or walks the body predicated where the body holds a workgroup barrier;
- plan_partial_groups now plans the mesh stage too (its region is DispatchRegion; Metal never
  makes a mesh threadgroup partial, so it records no PartialObjectThreadgroups), and
  simd::divergent walks a mesh body predicated as an object body;
- the entry wrapper strides its slots over the workgroup's invocations (running_threads), not
  Metal's threads, since every invocation runs it: its barriers, OpEmitMeshTasksEXT and
  OpSetMeshOutputsEXT stay in uniform control flow;
- an object or mesh function whose predication vote word does not fit beside its arena is now
  refused as the arena's limit refuses it; it no longer drops to running whole threadgroups only.

Why: condition 4 of the planner's ruling on the mesh build: one pipeline per state, made at
creation at the stated maximum, with each draw's sizes pushed and the extra invocations ending at
once. Apple's header holds every draw to the pipeline's maximum ("The maximum size of the product
of threadsPerMeshThreadgroup that can be used for draws with this pipeline", and the same for the
object stage), and drawMeshThreads rounds a mesh grid down to whole threadgroups. The
MeshPipelineDescriptor doc that said a draw is not held to the maximum is corrected.

Kernels are unchanged: their builtins take (sx, sy, sz) as before, so no kernel module word
moves. Every profile refuses object and mesh functions under the identity domains today, so no
output moves either, and SEMANTICS_VERSION stays.

Tests: dispatch's threadgroups_at_the_stated_maximum_match_metal runs one module of a 64-thread
workgroup on the CPU interpreter, in both local-size forms and both modelled subgroup widths:
draws of threadgroups of 1 to 64 threads with the region's grid stated or all 0, and an object
function's partial threadgroups flagged, each Metal thread once among the live invocations with
Metal's builtins and the rest not live. runtime-sources.sha256 is re-pinned.

Verified: see the job named below.
2026-12-03 17:05:40 -08:00
Anees Iqbal 3e2e65ee1a Translator: an object function has one grid form, folded; the unfolded object grid is deleted
What: given_inputs compiles every object function folded (LoweringInputs::folded_groups), alone or
in a mesh render pipeline, so its draws run any object grid in pieces within the task stage's
limits (bind::mesh_arguments). The unfolded form is deleted: DispatchPlan::object_grid and the
decl's object_grid (an unfolded object function's threadgroups per grid, wrapped at 2^32),
lower::mesh::folds_object_grids with lower::mesh::mesh_stages, which only it called, and
compile_mesh_pipeline's choice between the two. The single-region builtins test keeps its kernel cases and drops the object grid's.

Why: condition 1 of the planner's ruling on the mesh build: one grid form, no device-chosen
second one. folds_object_grids chose the folded form on a device that runs mesh stages and has
device addresses, 64-bit integers, multiDrawIndirect and drawIndirectCount. Device::from_queries
refuses a device without the first two, and object and mesh functions now need the last two
with the extension, so every device that compiles an object function took the folded form and
the unfolded one was reached only by an object function compiled alone.

No SEMANTICS_VERSION bump: an object function's key holds folded_groups, so its key changes with
its module, and every profile refuses object functions under the identity domains today.
docs/API.md's mesh pipelines section and LoweringInputs::folded_groups say an object function
is always folded.

Verified: see the job named below.
2026-12-03 17:05:40 -08:00
Anees Iqbal 7948443887 Translator: object and mesh functions need the mesh extension's two stages and the two indirect draw features together
What: lower::mesh::FEATURES lists taskShader, meshShader, multiDrawIndirect and
drawIndirectCount. An object or a mesh function, and so every mesh render pipeline with or
without an object function, now needs VK_EXT_mesh_shader and all four enabled; a device without
any of them refuses it as Unsupported{MeshShading} naming each one it lacks (plan_entry's
missing_caps). mesh_stages is that same test, and folds_object_grids no longer repeats the two
draw features.

Why: one query decides whether a device runs mesh pipelines. Before this, an object function
asked only for taskShader and a mesh function only for meshShader, and neither for the two draw
features a mesh draw's pieces take (a direct draw's pieces through multiDrawIndirect, an
indirect draw's through drawIndirectCount), so a device with only part of the set compiled stages
the draws could not run.

SEMANTICS_VERSION 2365 (a placeholder; the number is set at landing): a refusal names more
missing features on a device without the extension (both stages' features for either stage),
and a device with part of the set now refuses where it compiled. No committed profile with the
extension lacks any of the four, so no such profile's cell moves. The six committed profiles
without the extension do move: each refusal of an object or mesh function now names every one of
the four features the profile lacks. That is 246 golden cells and the same 246 engine inventory
cells, 41 on each of intel-irisxe-anv, intel-irisxe-rplp-anv, intel-uhd770-rpls-anv,
moltenvk-m3, nvidia-pascal-linux and runtime-floor, over the 14 engine fixtures that hold object
or mesh functions. They wait for the bless at the next named pin.

Tests: the red test of the parent passes, and the refusal test of profiles without the
extension expects the extension and each of the four the profile lacks. docs/API.md's mesh
pipelines section and compile_mesh_pipeline's doc state the set; runtime-sources.sha256 is
re-pinned.

Verified: m3-max-85179 at this commit's first build (tree equal to this one but for the base):
the parent's red test failed and passes here; clippy (plain) 0; the golden and inventory lists
against the base moved exactly the 246 cells above, each to the new refusal.
2026-12-03 17:05:37 -08:00
Anees Iqbal aea7564c29 Tests: a device without any one of the four mesh features refuses mesh stages by name (red)
What: engine_mesh.rs, on every committed profile whose device lists VK_EXT_mesh_shader, with one
of taskShader, meshShader, multiDrawIndirect and drawIndirectCount removed from its description.
Every object function and mesh function of the owned fixtures mesh_order and mesh_outputs, and
mesh_draws' mesh render pipeline with and without its object function, must be refused as
Unsupported{MeshShading} needing exactly the removed feature.

Why: object and mesh functions run only where the device enables all four together with the
extension: an object function's draws need the mesh stage, a mesh function's pipeline may take
an object stage, and a mesh draw's pieces take multiDrawIndirect and drawIndirectCount. Today an
object function needs only taskShader and a mesh function only meshShader, and neither needs the
two draw features, so such a device reaches the identity domains' refusal of the stage instead.

Verified: see the job named below; the test fails at this commit.
2026-12-03 17:05:37 -08:00
Anees Iqbal f514d6f283 Validation: a bicubic sample of a format with no bicubic treatment is the runtime's limit
Two public cases of engine/bcx_rules failed on lavapipe:
bicubic-8-bit-normalized-and-srgb-sums-near-the-rounding-tie (63d0f152) and
bicubic-rounding-of-random-float-and-srgb-texels (cbf5dd18). Each binds
RGBA8Unorm_sRGB textures at slots 4-6 and 13, which the kernel samples
through its bicubic constexpr sampler. Until 94adea1c61 (with 0a3a4fe911,
SEMANTICS 2365) the translator refused the whole kernel for its 1D bicubic
samples (slots 12-15), so the cases read as the product's refusal. That
commit built the 1D sample, as meant; the kernel now compiles, and the
runtime refuses its dispatch at slot 4 as Gap::BicubicTexels, an old known
gap its README states (bicubic_texels_word is None for 8-bit sRGB codes).
The executor counted that Gap as a failure, since the case's structure
did not classify it as refused. The refusal moved from the translator to
the runtime; this makes the classification say so.

ToolingRequirement::BicubicTexels ("bicubic_texels"): Limit::Runtime, it
stops the engine's candidate and keeps its cases Metal-qualified. The
checker raises it in checked_requirements
(executor_contract::bicubic_texels) when the case binds, at a texture
slot its function samples through a bicubic constexpr sampler, a texture
whose format gets None from the public
metal2vulkan::metal::format::bicubic_texels_word, so the rule is the
runtime's own. "Samples through a bicubic sampler" is read from the AIR:
an air.sample_* call (with gradients or not, no comparison) of a 1D or
2D colour texture, as the product decodes it, whose sampler operand is a
constexpr sampler (!air.sampler_states) with a bicubic min or mag filter,
as the translator decides it, and whose texture operand is an entry
texture argument, followed through the arguments of direct calls. A
runtime sampler is never bicubic and the translator refuses an argument
buffer's texture, so neither is claimed; a texture reached another way
(a texture array's element, a loaded pointer) is no claim. No census row
carries it: it needs the bound format, a case literal.

The device test that holds the refusal both ways on lavapipe already
exists: metal2vulkan-runtime's
tests::bicubic::every_device_pushes_each_bicubic_slots_format_treatment
(six formats' words pushed, the RGBA8Unorm_sRGB texture refused), with
the conformance ledger's bicubic-texel-classes rgba8unorm-srgb/dispatch
refusal. The requirement's doc names both.

samplers.rs gives each constexpr sampler's state by its global's name
(constexpr_sampler_states); min_lod_clamp.rs's call parsing is shared
(direct_call, operand_list); neither changes what classification
computes. The new module is listed beside depth_range.rs as the
checker's rule over case literals, not classification.

AUTHORED_COMPILE_CENSUS_VERSION 11: the two cases' cells move from
compiled to not_supported{tooling_requirement:bicubic_texels}, which a
cached cell would hide; the census is due a bless on development.
ENGINE_EXECUTOR_ABI is not bumped: no recorded candidate row holds
these cases (corpus/observations holds only their Metal rows).
SEMANTICS_VERSION is untouched: no translation changes.

Tests: requirement.rs's
a_bicubic_sample_of_a_format_with_no_treatment_stops_only_the_candidate
and the Runtime list; bicubic_texels.rs's own: every bcx_rules slot is
found; an RGBA8Unorm_sRGB texture at a 2D or 1D slot (or a texture
array's element there) raises it and RGBA8Unorm does not; a linear
sampler or a gather raises nothing; operands followed through direct
calls; and checked_requirements keeps the case for Metal and stops the
candidate.

Verified at this tree (f8eb488b95's), on lavapipe:
- job m3-max-86229: both cases read not_supported{tooling_requirement:
  bicubic_texels} (refusal=1 failure=0 each), and the public batch
  (ci-lavapipe, device type cpu, validation layer 1.4.363.0) reads
  cases=1189 match=815 mismatch=15 noted_difference=164 refusal=195
  failure=0 held_open=15 new_mismatch=0;
- job m3-max-86238, the same batch at db7bedc60d (the base): match=815
  mismatch=15 noted_difference=164 refusal=193 failure=2, the two
  failures these cases (exit=1, the runtime's BicubicTexels). The change
  moves exactly them from failure to refusal;
- job m3-max-86228: fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd),
  Rustdoc -D warnings, and the validation suite, 1349 passed, 2 skipped.
2026-12-03 17:02:29 -08:00
Anees Iqbal f838b75e6c Docs: HOWTO and ARCHITECTURE name no device policy
The device policy went with the resident core's deletion (device/policy.rs):
Device::from_queries takes the description alone and derives the profile from its queries
(docs/API.md, section 1). Three sentences still named a policy: HOWTO's first step ("describe
the Vulkan device as created and choose a policy"), its isolation recipe ("the device
description and policy ... equal description and policy give the same profile fingerprint and
keys") and ARCHITECTURE's device profile ("from the description's Vulkan queries and the
policy"). Each now names the description alone.

Docs only. Neither file is an input of runtime-sources.sha256, and no test or script reads
either file's prose.

Verified: on the CPU with no device, at this commit, git grep -i -w policy over docs/HOWTO.md
and docs/ARCHITECTURE.md finds nothing; DeviceDescription derives serde's Serialize and
Deserialize under feature serde (device/description.rs), as the recipe says.
2026-12-03 16:58:33 -08:00
Anees Iqbal 1d30dac781 Runtime README: a texture buffer held as words made after a handle-reaching command is recorded
A draw or dispatch whose function reaches a texture buffer through an argument buffer decides
between its plain pipeline and its words twin when it is recorded, from the live texture buffers
held as words (Gauges::word_texture_buffers; pipeline.rs's and render.rs's twin choice). On a device
that holds some format as words, a texture buffer held as words made after such a command is
recorded and before it runs, and reached through an argument buffer made resident by use_heap or
by a residency set, is accessed by the plain pipeline, through its R32_UINT view taken as the
format's own: the values are not Metal's. A use_resource of the texture names it at recording,
when it already exists, so the window is the heap's and the residency set's alone.

The ruling: no form; the window is a known gap, recorded in the textures' known gaps beside the
words' other costs. Its trigger is a guest report of wrong texture-buffer values on such a device.

runtime-sources.sha256 does not move: the README is not among its inputs. No code changes.

Verified, on the CPU with no device:
- m3-max-86179, at this commit: scripts/api-docs's prose check (its job-id grep over the runtime
  README among others) passes, and the suites, whose tests read the README's Floor, Enabled, not
  stated and consumer sections, pass but for the golden table, which fails at the base too.
2026-12-03 16:57:32 -08:00
Anees Iqbal 8fb26059c7 Translator: the lowering's unnormalized-sampler and heap-flag paths nothing reaches are deleted
The second half of the cleanup after the resident core's deletion (0ce2f39b71): crate-private
lowering paths whose inputs nothing sets, and the docs that still describe deleted machinery.

Unnormalized constexpr samplers. No selection picks PixelPosition::Unnormalized or
UnnormalizedTexel (pixel_position answers Scaled, Texel, TexelBySpec or TexelByWord), so they go
with BindingKey::unnormalized, PixelPosition::unnormalized(), emit's two coordinate arms and two
offset matches, the sampler.pixel_unnormalized and sampler.pixel_unnormalized_gather census arms,
pixel_note's and centre_denormals' arms, finish()'s invariant for an unnormalized identity
sampling, and constexpr_desc's zero bias for a SamplerUse of unnormalized coordinates, which no
constexpr sampler's use is. The runtime's unnormalized twins of linear pixel samplers
(SamplerUse::unnormalized, vk_sampler's form, offset_texels) stay.

Heap handle flags. AccessPlan's heap_class_index, heap_red_blue and heap_unreadable had no setter;
only heap_alpha is set. They go with carries_class(), Lookup::Flagged's class, red_blue and
unreadable fields (Flagged is now the alpha-carrying form alone), the handle constants
FLAG_TEXEL_CLASS, FLAG_RED_BLUE, FLAG_STORAGE_UNREADABLE, HANDLE_TEXEL_CLASS, HANDLE_RED_BLUE and
HANDLE_STORAGE_UNREADABLE, the sampler.heap.texel_class census arm, heap_element_of's unreadable
branch (its one caller passed false), and identity_refusal's HeapResource refusal of a flagged
form other than the alpha's, which could not fire. The handle-table search, which only the
function-table directory calls, in its element and entry forms, keeps its generic carry of the
alpha flag: Lookup is shared with the identity handle's form, whose element mask the heap accesses
read.

Docs that named deleted items now say what the code does: the PixelSamplerScaling entry (a
constexpr pixel sampler's linear sample or gather records it on every device; the runtime slot's
nearest test is its word, SamplerWord::nearest_pixel, not a specialization), ViewBaseTexelOffset
(no heap_raw; a slot's footprint placed so is refused, IdentityCause::TextureState),
SimdgroupAccessOrder (no resident-table profile), constexpr.rs, memory::handles (heap handles are
the identity arrays' elements; the handle table is the function-table directory's search),
bind::heap, lower::texture (is_null, border texels, level views and the out-of-bounds alpha come
from the resource ID's word), heap_raw's mentions in the sampler modules, the resident-table
mentions in access::object, provenance::objects and validation's tier table, the OpenCL line
variant's docs (the runtime refuses such a binding, Gap::OpenClLineTexture), and PushField's
TextureLevels. SlotPlan::border_texels, never set, goes. Tests: engine_identity's expected lookup
is Lookup::Flagged; the search's host-model test runs the element, flagged and entry forms; the
census assertions of sampler.pixel_unnormalized, which no arm names now, go.

Consumer: in reims at 7d016acc9c, and at 8f3ca9df99, nothing names a crate-private item here
(lower and memory are pub(crate)), and the public-item search is the previous commit's.

Nothing compiled changes: no selection reached the deleted arms, no flag was set, and the census
words of every plan are the same, so SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION stay.
runtime-sources.sha256 moves without a RUNTIME_VERSION bump: memory/handles.rs loses constants
and fields nothing set, and metal/sampler.rs, metal/texel_format.rs, metal/format/mod.rs and
bind/heap.rs change in comments and a test. docs/REFUSALS.md regenerates unchanged; the
signature table is unchanged.

Verified, on the CPU with no device:
- m3-max-86179, at the series' tip (the two cleanup commits and the README line): fmt, the
  refusal surface's, the signatures', both coverage docs' and scripts/api-docs' checks, clippy
  (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), Rustdoc, private docs (metal2vulkan and
  metal2vulkan-runtime) and doctests pass. The metal2vulkan suites ran 3,492 tests: 3,491 passed,
  24 skipped, and the failure is golden_hashes_match_the_table, which fails at the base too (a
  bless due at the next pin). Validation ran 1,343 tests, all passed, 2 skipped; conformance ran
  1,061, all passed.
- m3-max-86194 and m3-max-86213, at the tip and at its base db7bedc60d: the golden table's changed
  lines are the same 5,114 at both, line for line, so no cell moves.
2026-12-03 16:57:32 -08:00
Anees Iqbal 27a6c1ebd3 Translator and runtime: the interface items no path makes since the resident core went are deleted
0ce2f39b71 deleted the resident core: every device compiles the identity domains, which read a
texture's presence, out-of-bounds alpha, swizzle, border texels and level count, and a sampler's
state, from the resource ID's words. The interface items the resident core stated for them stayed,
with nothing left that makes them:

- SpecKey's Presence, OutOfBoundsAlpha, TextureSwizzle, OffsetBaseAxes, NearestPixelSampler and
  BorderTexels: no lowering declares them.
- RuntimeFact's ResourcePresence, OutOfBoundsAlpha, StorageTextureLevels, StorageTextureLevelViews,
  OpenClLineTexture and BorderTexels: no plan states them.
- PushField::ControlPointIndexOffset: no plan places it. identity_pushes (lower/select.rs) named
  it on its false side; that arm goes, and lower/push.rs's shape arm with it.
- PrecisionNote::F16IntConvDoubleRounding (metal2vulkan-degrade-f16-int-conv-double-rounding): no
  lowering records it. Its catalogue entry in docs/API.md goes, with the conformance crate's
  Degradation and the validation comparison's allowance and reach arms.
- Feature's LocalSize, TexelBuffer and GroupCount: no site constructs them (docs/REFUSALS.md listed
  each with no site). Their reach.tsv rows go.
- CombinedSampler's unnormalized field, with_unnormalized, heap_index and from_heap_index: the field
  was set only from lower::sampler's BindingKey::unnormalized, which no selection sets (none picks
  PixelPosition::Unnormalized or UnnormalizedTexel) and finish() refuses as an invariant, and the
  two index methods had no caller. sampler_use() now makes the use from the comparison and the
  texel class alone. The runtime's DrawInputCause::UnnormalizedSampler and its two checks (a
  constexpr sampler of a draw or dispatch with the field set) go with it.

The device sampler of unnormalized coordinates stays: SamplerUse::unnormalized, vk_sampler's
unnormalized form and SamplerDesc::unnormalized are what the runtime's linear pixel samplers'
twins are made with.

Tests: device/tests/mechanism.rs covers the 56 facts left; the assertions that a plan states none
of the deleted facts, and the spec values set for deleted keys, go; engine_spec_bits labels its
constant SamplerMinLevel; cache/tests.rs's round trip of OffsetBaseAxes goes; api_tests.rs's
SpecializationLayout round trip names SamplerMinLevel.

The consumer names none of them: in reims at 7d016acc9c, and at 8f3ca9df99, git grep finds 0 hits
each for unnormalized, Unnormalized, heap_index, F16IntConvDoubleRounding,
f16-int-conv-double-rounding, LocalSize, GroupCount, SpecKey::, RuntimeFact::, PushField::,
ControlPointIndexOffset, NearestPixelSampler, OffsetBaseAxes, ResourcePresence,
StorageTextureLevel, OpenClLineTexture, BorderTexels and OutOfBoundsAlpha. TexelBuffer's 2 hits
are maxTexelBufferElements and the runtime's TexelBufferTooLarge, DrawInputCause's 1 is
DrawInputCause::Slot, Feature::'s 10 are other variants and another crate's Feature, and
TextureSwizzle's 66 are Metal's MTLTextureSwizzle.

ARTIFACT_FORMAT_VERSION 612 -> 613 (renumbered at landing): the codec's lists are positional, and
SpecKey, PushField, RuntimeFact, PrecisionNote and CombinedSampler lose members. SEMANTICS_VERSION
stays: nothing that compiles changes. runtime-sources.sha256 moves without a RUNTIME_VERSION bump:
device/mechanism.rs loses the arms of the deleted facts, which no run reached. docs/REFUSALS.md and
the signature table are regenerated; the metal and conformance coverage docs regenerate unchanged.

Verified, on the CPU with no device:
- m3-max-86143, at this commit: clippy (plain, all targets and features) passes; the mechanism,
  spec-bits, round-trip and texture-level tests ran 64 tests, all passed, 2,571 skipped.
- m3-max-86179, at the series' tip (the two cleanup commits and the README line): fmt, the
  refusal surface's, the signatures', both coverage docs' and scripts/api-docs' checks, clippy
  (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), Rustdoc, private docs (metal2vulkan and
  metal2vulkan-runtime) and doctests pass. The metal2vulkan suites ran 3,492 tests: 3,491 passed,
  24 skipped, and the failure is golden_hashes_match_the_table, which fails at the base too (a
  bless due at the next pin). Validation ran 1,343 tests, all passed, 2 skipped; conformance ran
  1,061, all passed.
- m3-max-86194 and m3-max-86213, at the tip and at its base db7bedc60d: the golden table's changed
  lines are the same 5,114 at both, line for line, so no cell moves.
2026-12-03 16:57:32 -08:00
Anees Iqbal db7bedc60d Runtime docs: the XR branch's measured price on textures of other formats
The runtime README's first known gap of textures said every float or half sample, gather and read
pays the BGR10_XR and BGRA10_XR word test and branch, with no number. It now gives the price the
compute harness measured, with and without the branch alternated in one job (GPU time, medians):

- Iris Xe (Mesa 26.2.6), m3-max-85317, 5 rounds: sampling +0.4%, sampling_distinct_512x512x16
  0.0%, texture_read -0.2%.
- RTX 3090 (NVIDIA 620.70.06), m3-max-85290, 3 rounds: 0.0%, 0.0%, +3.0% (texture_read's base
  rounds spread 3.2%, so that figure is within its noise; its mean is +2.0%).
- RX 7900 XTX (Mesa 26.2.6), m3-max-85291, 3 rounds: -0.2%, 0.0%, -0.4%.

These were measured on earlier forms of the branch: 85290 and 85291 before the map's operations
were kept uncontracted (NoContraction), and all three before a gather took its nearest code
(texel_nudge). Both changes add instructions inside the branch alone, which a texture of another
format does not run.
2026-12-03 16:18:20 -08:00
Anees Iqbal 3e3deb25b9 Translator and runtime: BGR10_XR and BGRA10_XR render targets take Metal's writes, clears, masks and covered blends
The red commit's test, and the conformance cases that render into either format, which the runtime
refused (Gap::TextureFormat on a RenderTarget texture).

Attachments. A BGR10_XR or BGRA10_XR color attachment is its texture's UNORM image
(FormatEmulation::ExtendedRangeUnorm, now admitted as a color attachment and, blended, as a blended
one): A2R10G10B10_UNORM_PACK32, and R16G16B16A16_UNORM with red and blue exchanged. The formats'
second, raw candidate and ExtendedRange::of_attachment are gone; the runtime makes a RenderTarget
texture of either, and a device whose format query lacks the usages is refused the pipeline,
naming them (the runtime's floor does not require R16G16B16A16_UNORM as a color attachment).

Writes (lower::stage_io::extended_unorm_color). A fragment function writes Metal's code of its
output (rounded to half, nearest even, then encoded as a kernel write encodes it) as the field's
value over its maximum, a little above the code (metal::format::extended_unorm_field: 10-bit
(c + 0.0005) / 1023, 16-bit (64 c + 0.25) / 65535), which a device's conversion stores as that code
whether it rounds to nearest, toward zero, by floor(x 1024) or, as lavapipe does for a 10-bit
target, through 16 bits (round(x 65535) >> 6; an offset of 0.25 stored code + 1 for the 251 codes
from 772). BGR10_XR's two alpha bits are written as ones, as Metal writes them. Clears store
Metal's clear codes (metal::format::extended_unorm_clear, the runtime's clear values). Masks are
Metal's on the image's channels (BGRA10_XR's red and blue exchanged; BGR10_XR's alpha bits written
with any color channel). A resolve is the device's AVERAGE of the codes, which average as the
values do; PrecisionNote::DeviceRoundedResolve now names a BGRA10_XR field's low bits. A fetch of
either attachment is refused NotImplemented(Format) at compile, and at link where the function
does not write it.

Blends (pipeline::extended_blend). Metal's blend into these formats, measured on an Apple M3 Max
(macOS 27.0.1) over the xr-blend recordings: the source clamped to the values of codes 0 and 1022
(a NaN to code 0) and alpha to [0, 1], a destination color code to 1022, half arithmetic, the
result rounded to a code. That model is every recorded channel's but 9 of 172,032 (premultiplied
source-over, one code each, listed in the ledger rows). The function clamps its output as Metal's
blend does; a blend that stores its source (one and zero, added) stores the clamped codes exactly.
Any other blends the codes in Vulkan with a source factor of one, the function writing the term
X that makes Vulkan's blend of the codes Metal's blend of the values; destination factors that read
the source read it from a second output (dualSrcBlend, in the floor), BGR10_XR's alpha too, so its
alpha bits stay ones. A factor pair the module does not cover (a BGRA10_XR destination alpha among
them) is refused NotImplemented(Format).

Notes, static per pipeline: PrecisionNote::ExtendedRangeBlend on every blend that does not store its
source (the device rounds each draw's result to the field, a BGRA10_XR field keeping the fraction of
a code in its six low bits); PrecisionNote::ExtendedRangeBlendWindow where the corrected term or a
second-output factor can leave [0, 1], which Vulkan clamps (pipeline::extended_blend::window_holds,
from the factors and operations at the corners of the source's range; a unit test classifies every
factor pair and operation at both formats). Both are in docs/API.md's catalogue with counts, and the
runtime's README records the window as a known gap with its trigger.

Ledger: 18 llvmpipe rows of the B cases that differ (the xr-blend addition and premultiplied
source-over, xr-gamut, the blended xr-gradient and xr-masked over draws, and xr-gradient's
unblended resolve), each citing its note, with counts from a model of our blend whose count of
differing elements is lavapipe's replay's to within 11; and the same cases' rows on the RTX 3090
(NVIDIA 620.70.06, m3-max-85796; there xr-gradient-bgra10xr-unblended-x1 too, 39 fields a code
off by the device's arithmetic of the gradient), the RX 7900 XTX (m3-max-85797) and the Iris Xe
(m3-max-85798), each pointing at the case's llvmpipe row, with that device's counts.

Cache key: LoweringInputs::extended_unorm_colors is hashed into the function key where it is set
(pipeline::compile::key), so a fragment function compiled for a BGR10_XR or BGRA10_XR attachment
never takes another's translation; the key test asserts that the attachment and the format each
change the key.

SEMANTICS_VERSION 2378 and ARTIFACT_FORMAT_VERSION 612. RUNTIME_VERSION 2577 (XR render targets
are made); runtime-sources.sha256 re-pinned. api_signatures blessed and
api_surface extended (ExtendedUnormBlend, ExtendedUnormColor, extended_unorm_clear);
docs/REFUSALS.md regenerated (the fetch's refusal site).
2026-12-03 16:18:20 -08:00
Anees Iqbal e9290d8138 Runtime tests: BGR10_XR and BGRA10_XR render targets store Metal's codes (red)
An arm64 guest walk met render pipelines and passes into MTLPixelFormatBGR10_XR (554) and
MTLPixelFormatBGRA10_XR (552); the runtime refuses a texture of either with RenderTarget usage
(Gap::TextureFormat), so no pass draws into one.

every_device_renders_extended_range_targets_as_metal_stores_them, on every device of the cfg's
kind, for both formats in Shared and Private storage (a Private target read back by a blit into a
buffer): a pass clears an 8 by 8 target to Metal's specials and code boundaries and the words come
back as Metal's clear stores them; rt6_samples' half4 fill over 64 values across and past the
codes' range (a NaN, the infinities, the ends) draws unblended, then blended with Metal's default
factors, one and zero, and each texel holds Metal's store (unblended: the half's code; blended: the
source clamped to codes 0 to 1022, a NaN to code 0, alpha to [0, 1]); over a Shared BGR10_XR target
whose words' two top bits are zero, a draw under straight alpha-over leaves those bits ones, as
Metal's store writes them.

The ledger's refused rows of the conformance cases that render into either format, which this
change's fix makes run, go: xr-draw, xr-clears, xr-clear-routes, xr-masked, xr-blend, xr-gamut,
xr-gradient and xr-unwritten, BGR10_XR and BGRA10_XR without sRGB (168 rows); the sRGB twins' and
the two-plane forms' stay. Coverage regenerated.
2026-12-03 16:18:20 -08:00
Anees Iqbal c226c542b2 Translator tests and runtime docs: the fold's round-trip fields and a private link
Job m3-max-85802, the twin's suites and lint at 52e98915ba on lavapipe, ran
two steps green: the runtime's device tests (red at 8672e74957, green at
52e98915ba) and the runtime suite (1003 passed, 4 skipped). Validation also
passed (1344 passed, 2 skipped). The translator's test build failed: api_tests'
round-trip literals of VariantKey and LoweringInputs name every field, and
lacked depth_range_fold (E0063). That failed the fold tests, tr_core and
clippy in all three configurations. The private rustdoc failed on one
unresolved link in RenderCompiled::content's doc
(Device::render_pipeline_state, a private method of crate::Device).

- api_tests: both literals set depth_range_fold: true, so the round trip
  covers the new field.
- render.rs: the link names crate::Device::render_pipeline_state.

No product code changes. The runtime-sources pin does not move
(pin-compute). Verified: the READY gives the rerun's job lines.
2026-12-03 16:18:20 -08:00
Anees Iqbal 1880ab5637 Runtime README: the depth range twin's first-draw stall, measured
The twin's known gap named its stall without a figure. Both figures come
from the twin's device test, which times its first draw through a twin. The
runs used release builds, three per card, with the drivers' disk shader
caches off (__GL_SHADER_DISK_CACHE=0, MESA_SHADER_CACHE_DISABLE=true), as a
first boot pays:

- lavapipe (Mesa 26.2.6, LLVM 23.1.4), job m3-max-85864: 1539, 1376 and
  1350 us. The longest make at encode, which is the twin's lowering, was
  1428, 1078 and 1275 us.
- RTX 3090 (NVIDIA 620.70.06), job m3-max-85826: 5054, 5067 and 5467 us.
  The lowering was 808, 841 and 1303 us; the rest is the driver's
  VkPipeline compile.

A debug build's first draw on the 3090 (job m3-max-85807) took 17.0 ms.
That figure is not used.

Docs only: no source, version or pin moves.
2026-12-03 16:18:20 -08:00
Anees Iqbal fc8809d849 Translator: the identity domains push the depth range fold's field
A render pipeline of a vertex function under the depth range fold was
refused under the identity domains: "unsupported: IdentityDomains (an
encoder value the function reads as DepthRangeFold)". That is the
runtime's every device: the first draw through a twin on an RTX 3090, job
m3-max-85794. identity_refusal (lower/select.rs) names each push field the
identity domains push, and PushField::DepthRangeFold was not in it. The
runtime does push it: draws() maps it to FieldValue::DepthRangeFold, and
fill_push writes the first viewport's [znear, zfar - znear].

The field joins the list, and identity_admits' doc names it beside
ViewportCount. No encoding changes: the fold's variant was refused before
and is made now. The versions stay at the fold's placeholders
(SEMANTICS_VERSION 2368, ARTIFACT_FORMAT_VERSION 609). The runtime-sources
pin does not move, because lower/select.rs is not one of its inputs
(pin-compute).

Verified: the READY gives the job lines (the commit before red, here
green).
2026-12-03 16:18:19 -08:00
Anees Iqbal 1167c88d4f Translator tests: a folded render pipeline is made under the identity domains
Red first. The runtime's first draw through a depth range twin on an RTX
3090 (job m3-max-85794) answered "the translator made no pipeline:
unsupported: IdentityDomains (an encoder value the function reads as
DepthRangeFold)". The identity domains' list of the encoder values they
push (lower/select.rs, identity_refusal) does not name the fold's push
field. The fold's own tests compile the function alone, which that check
does not reach.

This test compiles a render pipeline of a folded vertex function
(VariantKey::depth_range_fold) into a Depth32Float attachment through
compile_render_variant on Device::from_queries' moltenvk-m3 and lavapipe
profiles, and asserts the fold's fact. Expected red here; the next
commit names the field.
2026-12-03 16:18:19 -08:00