Commit Graph
10580 Commits
Author SHA1 Message Date
Anees Iqbal 4e7f66642e Runtime README: the Mac host's unrecorded conformance rows are the 12 half-texel-nans rows alone
The XR families' 62 KosmicKrisp rows are recorded in known-gaps-rt.tsv by the commit before this
one (extended-swizzles 44, xr-blend, xr-gamut, xr-gradient and xr-masked 18), so the known-gaps
bullet that listed 74 rows seen and not explained now names the 12 half-texel-nans rows that stay
unrecorded for that venue.

Verified: the M3's KosmicKrisp replay with those rows (m3-max-86387, an Apple M3 Max) printed 12
unexpected lines, every one half-texel-nans. The runtime-sources pin is unchanged (README only).
2026-12-03 18:04:49 -08:00
Anees Iqbal 35ca0e4606 Conformance ledger: the XR families' rows on KosmicKrisp
What: 62 rows of venue Apple M3 Max for what KosmicKrisp (Mesa 26.3.1) answers in the XR
families, the same gaps the other venues' rows record:
- 18 rows of the device's blend of the codes (PrecisionNote::ExtendedRangeBlend and
  ExtendedRangeBlendWindow) and its resolve (DeviceRoundedResolve): xr-blend (4), xr-gamut (9),
  xr-gradient (3), xr-masked (2). The two premul blends differ from the other venues past the
  window (the largest difference 53,463 against 24,637), unexamined against Vulkan's clamp of a
  fixed-point source, as their rows say.
- 44 rows of extended-swizzles-bgra10xr and -bgr10xr, with the llvmpipe rows' cause: a sample
  past the edge through a border address mode reads the device's border in code space, and a
  BGRA10_XR linear sample filters in the fields' low 6 bits (the runtime's known gaps, not built).
docs/CONFORMANCE-COVERAGE.md is regenerated.

Why: the replay of KosmicKrisp at development (m3-max-86361) listed them as unlisted; the planner
ruled both families rows, the extended-swizzles fix a bug row of its own.

Verified: the answers are KosmicKrisp's own, from that replay. The replay of the whole ledger on
KosmicKrisp with these rows (m3-max-86387, an Apple M3 Max): 12 unexpected, every one
half-texel-nans (not these families), 0 of the 62.
2026-12-03 18:03:36 -08:00
Anees Iqbal d15b9922ad Multisample bytes test: a 16-bit depth cleared to 0.25 may hold either code nearest it; the KosmicKrisp gap line goes
The red on KosmicKrisp (Mesa 26.3.1) on the Apple M3 Max was the test's, not the driver's. The word
its region row read outside the region, 1048575232, is 0x3E7FFD00: code 16383 read as 16383/65535,
not 0x3E7FFFC0 as the gap line said. The split test's new row, the 4-sample Depth16Unorm cleared to
0.25 and read with no copy, reads it too (M3 leg job m3-max-86335 at 9e6ec32898, build
m3-max-86328):

  cleared, no copy, 8 x 8: 256 of 256 samples are not Metal's ... the words read: 0x3E7FFD00 x 256
  4 x 3 at (2, 1) of 8 x 8: 208 of 256 ... the words read: 0x3E7FFD00 x 208

So the device's clear converts 0.25 (16383.75 in codes) to 16383, and the copy's load and store keep
it exactly. Vulkan's "Conversion From Floating-Point to Normalized Fixed-Point" (3.10.2) returns
"one of the two unsigned binary integer values ... closest" (it should round to nearest), and the
test took only 16384. A sample the clear leaves now holds either code nearest 0.25 * 65535, each
still read within 1e-7 of its code; inside units stay exact. Metal's own code for this clear is not
recorded.

The runtime README's KosmicKrisp bullet in the known gaps of blit encoders (353bf003e8) described a
driver fault that is not one, and goes. The module docs' list items no longer open with a link
followed by a colon, which clippy under --cfg m2v_gpu and m2v_cpu_icd read as a link reference
definition (doc_nested_refdefs; job m3-max-86330 at 9e6ec32898).

Test and docs only: no version bump; the runtime-sources pin is unchanged (3b7da9e9...). Verified by
the jobs named on landing.
2026-12-03 17:53:47 -08:00
Anees Iqbal 2bc14c3443 Multisample bytes test: the 4-sample Depth16Unorm region row in a test of its own, beside the clear read with no copy
On KosmicKrisp (Mesa 26.3.1) on the Apple M3 Max the 4 x 3 Depth16Unorm region row fails (the
runtime README's known gaps of blit encoders), and since the M3 leg reads known gaps by exact test
name, that one row darkened the whole test there: its stencil rows, its whole-texture rows and the
128 x 128 all-codes row, which never ran on that device because the test stopped at the region row.

The row moves to every_device_reads_the_clear_of_a_multisample_16_bit_depth_alone_and_outside_a_region_copied_in,
beside a new row that clears the same 4-sample texture to 0.25 and reads every sample with no copy.
One run on the device tells which driver step leaves the outside samples' value: the clear (or the
fetch of a cleared image) if that row reads it too, the region's load and store if it reads a code.
Each device's rows now all run and print what the kernel read (M2V-READ: the count, the first, and
each distinct word read with its count) before any read is checked, so a failing row no longer hides
the rows after it.

Not widened: the clear's expectation stays code 16384, though Vulkan 3.10.2 also lets a device
convert 0.25 to 16383. Allowing it only outside the region needs the inside test bound apart
(several lines); the one-line form would also accept 16383 for an inside unit of value 16384, which
FragDepth's (c + 1/4) / 65535 does not allow.

Test only: no version bump; the runtime-sources pin is unchanged (3b7da9e9...). Verified by the jobs
named on landing: clippy plain and --cfg m2v_gpu, the rt suite on lavapipe, and one M3 leg.
2026-12-03 17:53:47 -08:00
Anees Iqbal bf519653bf Runtime README: the Mac host's conformance replay families not yet recorded, and a depth clear's conversion with no note
The M3's KosmicKrisp conformance replay at development c4bcc45c28 (job m3-max-86361) differs from
Metal's answers in 74 rows that known-gaps-rt.tsv does not list for that venue; it differed in none
at pin W (round 865592b96b). Three families: extended-swizzles of BGRA10_XR and BGR10_XR (44 rows),
the xr-blend, xr-gamut, xr-gradient and xr-masked cases (18), and half-texel-nans (12). The planner
ruled that pin X does not wait for them: the line says what is seen, not why, and the next pin
carries a fix or a recorded row with its cause per family.

A clear's depth conversion: KosmicKrisp clears a Depth16Unorm texture to 0.25 as code 16383 (M3
leg m3-max-86335: 0x3E7FFD00 = 16383/65535 on all 256 samples of a clear with no copy), which
Vulkan's fixed-point conversion allows; rounding to nearest gives 16384. No static note covers a
clear's conversion, so the README says so; none is built for this pin (planner). Docs only: no
version moves, and the runtime-sources pin is unchanged.
2026-12-03 17:50:35 -08:00
Anees Iqbal c4bcc45c28 Pin X bless: golden hashes, engine inventory, the mesh_simd printout, opened chains and the authored compile census
Blessed at 970e710e4c on the M3 (bless m3-max-86311: inventory, golden, printouts, link half and
opened chains each exit 0; census m3-max-86312, census-exit 0); development's tip 353bf003e8 adds
a README line alone, which moves none of these tables.

- golden_hashes.tsv and public_fixture_expectations_engine.tsv: the cells W..X moved (the
  attribution commit names each moving commit).
- air_input/mesh_simd.txt: the printout of the mesh branch's new fixture.
- opened_chains.txt: 28 contexts enable VK_EXT_mesh_shader with taskShader, meshShader and
  multiDrawIndirect (members +3, extensions +1); the two without the extension are unchanged.
- authored-compile.tsv: 322 rows (AUTHORED_COMPILE_CENSUS_VERSION 11), among them the two bicubic
  cases' 18 cells, compiled to not_supported{bicubic_texels}, and the mesh functions that now
  compile.
2026-12-03 17:37:45 -08:00
Anees Iqbal 353bf003e8 Runtime README: on KosmicKrisp the samples outside a region copied into a multisample Depth16Unorm texture do not keep their code
The Mac host's device leg (KosmicKrisp, Mesa 26.3.1, on the M3 Max) fails
tests::multisample_bytes' 4-sample Depth16Unorm part row since pin V (rounds at 133c992dad and
865592b96b, job m3-max-86090): 208 of 256 samples, exactly those outside the 4 x 3 region at
(2, 1), read 0x3E7FFFC0 (262143 / 2^20), which no 16-bit code gives (Vulkan 3.10.1: c / 65535;
16384 is 0x3E800080, 16383 0x3E7FFD00). Inside the region every code reads right, and the
whole-texture and stencil rows pass there.

The copy renders the region alone (rt blit/samples.rs: render area and scissor the region, the
depth loaded and stored); Vulkan's load and store operations update only values within the render
area (8.5 "Render Pass Load Operations", 8.6 "Render Pass Store Operations"), so the outside
samples keep the clear's code, as the RTX 3090, RX 7900 XTX, Iris Xe and lavapipe read them. A
files-only read (lane kkd16) found no path of ours that reads the outside samples in another
form: one OpImageFetch through one view reads inside and outside alike, and the copy-out reads
the region alone. Recorded as a known gap with no second form; which driver step leaves the
value (the clear, or the copy's load and store) is not isolated. Docs only: no version moves,
and the runtime-sources pin is unchanged.
2026-12-03 17:29:56 -08:00
Anees Iqbal 970e710e4c Runtime README: the XR branch's price says which cards measured before NoContraction
The line read as if the RTX 3090 and the RX 7900 XTX kept the map's operations uncontracted, a
per-card form. NoContraction is on every device (58988c6b83); those two cards' timings (85290,
85291) were taken before it, and all three cards' before the gather's nearest code. Docs only.
2026-12-03 17:22:50 -08:00
Anees Iqbal b01d5e529d Versions: ARTIFACT_FORMAT_VERSION 614 and RUNTIME_VERSION 2578 for the mesh pipeline
The mesh branch (devpolicy) bumped both past an older base; its rebase onto main/s3 and
then onto main/s4 collapsed them into the stack's own numbers (ARTIFACT 613 is the interface
deletions' 27a6c1ebd3, RUNTIME 2577 is s3's). Mesh changes the artifact encoding (its stage
facts and pipeline fields) and the runtime's behaviour (mesh states draw, the floor's mesh
features, a mesh draw under a past depth range refused as Viewport), so each takes the next
number. SEMANTICS 2383 is already past the stack's 2378. Stack staging only; no code moves.
2026-12-03 17:07:18 -08:00
Anees Iqbal 24dadff1ad Runtime README: on the RX 7900 XTX a mesh draw's cost is any task stage's, not the launcher's
The XTX's one-group launcher draw took 8 times a one-triangle vertex draw,
and the row could not say whether the launcher's shape or any task stage
costs it. The cost test's new row answers on the card: a one-group draw of
a state with an object function, whose task stage is the guest's
function, took 74,560 ns where the launcher's took 64,720 ns and the
triangle 7,920 ns. The known gap says so, and its XTX figures are now that
one run's: 8.2 times, and 1.39 times at M 256 against M 4 (221,120 and
159,280 ns; 2.39 ns a group).

Verified: RX 7900 XTX (RADV, Mesa 26.2.6), job 86149 at 50a3d29e17, carry
8840414fd2, mesh_costs_print_per_card unvalidated, medians of nine
command buffers.
2026-12-03 17:05:48 -08:00
Anees Iqbal e667052521 Runtime tests: the mesh cost test's doc comment wrapped at 100 columns
Comment only; no behaviour changes. Verified: cargo fmt --all.
2026-12-03 17:05:48 -08:00
Anees Iqbal df4d351048 Runtime tests: the mesh cost rows time a one-group draw of an object state too
On the RX 7900 XTX (RADV, Mesa 26.2.6, job 86024) a one-group mesh draw
through the launcher took 63,560 ns against a one-triangle vertex draw's
7,920 ns, 8.0 times; on the RTX 3090 it took 0.84 times. The row cannot
tell whether that cost is the launcher's shape or any task stage on that
driver. mesh_costs_print_per_card now also times a one-group draw of a
state with an object function (mesh_draws_object, 1 object thread), whose
task stage is the guest's function, not the launcher: printed as
"object 1 group N ns" beside the launcher's row. Nothing asserts on time.

Verified: see the job named in the handover.
2026-12-03 17:05:48 -08:00
Anees Iqbal 6b0f0ab72d Runtime: a mesh draw under a viewport depth range past [0, 1] is refused as Viewport
The handover from pr2627-c: the second of it and devpolicy to land carries
the mesh rule, the fold where the mesh function writes no per-primitive
viewport index and a typed refusal where it does, and until that fold
exists a mesh draw under a past range is refused as Viewport, under the
same row. pr2627-c landed first (1d6054b189), and its twin (d2a12e948c, in
the stack this branch now sits on) folds the range into a vertex function
alone, so a mesh draw has nothing to fold.

The encoder's route now answers DrawKind::Viewport for a mesh state where
the range shows, as it does under the Clamp mode, so a mesh draw reads its
refusal from the one field every draw reads and no twin is attempted. A
mesh state lowers none of its functions apart from its compile, so its
fragment function from AIR is taken to read [[position]]'s z or w
(Content::reads_position_depth, set when the content is made): its draws
under such a range are refused with or without a depth attachment, and a
fragment function the consumer compiled answers its own.

No red commit: rebased onto the twin, RenderPipelineState::folded already
answered Viewport for a state with no vertex descriptor (its let-else), so
a mesh draw was refused at bind_content before this change. The route
makes it the draw's one check and keeps the twin out of the mesh path.

Docs: set_viewport, DrawKind::Viewport, and the runtime README's twin
known gap and Gap::Draw list. docs/REFUSALS.md regenerated (no change
expected: the refusal's sites are the same). runtime-sources.sha256
re-pinned.

Test: tests::mesh_state::on_device::
a_mesh_draw_under_a_depth_range_past_0_1_is_refused draws a mesh state of
mesh_draws under [0, 2] (refused, Gap::Draw Viewport) and under [0, 1]
(drawn, one launch counted).

Verified: see the job named in the handover.
2026-12-03 17:05:48 -08:00
Anees Iqbal 1382f98b52 Runtime README: the mesh cases as compared on each GPU, and the form's costs
The mesh known gap said the lowering had never been compared with Metal
on a GPU. It now says what was: the conformance suite's 44 cases of mesh
pipelines, recorded on an M3 Max under macOS 27.0.1, replayed on lavapipe
(Mesa 26.2.4), the RTX 5080 Laptop (NVIDIA 615.71.09), the RTX 3090
(NVIDIA 620.70.06), the Radeon 780M and the RX 7900 XTX (RADV, Mesa
26.2.6), each answering 9 exact, 5 announced, 29 refused as the ledger
lists and 1 divergent: mesh-barrier-readers, whose fragment-stage
barriers the M3 answers outside its family's supported set (feature set
tables, note 3), so the header's order is kept. It names the device test
that draws an object grid past the task total in pieces, and the venues
it ran on, since no conformance case draws one.

The planner asked for the launcher's cost and the idle invocations' cost
at the state's maximum M as known-gap rows, on the RTX 3090 and the RX
7900 XTX, with the ratios: the 3090's one-group launcher draw is 0.84
times a one-triangle vertex draw and its 65,535 groups of 4 threads 1.01
times as long at M 128 as at M 4; the XTX's are 8.0 times and 1.39 times
(at M 256). The sentence that no replay stream or live session used one
is dropped: the bullet already says so.

Verified (jobs, carry b11f9ecd63 built at 19bf5ff006):
- lavapipe, mr6 85972: 9 exact, 5 announced, 1 divergent, 29 refused;
  ledger drift 0; the pieces test passed.
- RTX 5080 Laptop 85920, RTX 3090 85935, Radeon 780M 85955 (carry
  999b3e4cdf at 26d0420861): 9, 5, 1, 29 each; RX 7900 XTX 86024: the
  same.
- Pieces test (4,194,305 object threadgroups, one counted in pieces,
  nothing drawn whole) with the validation layer: RTX 3090 86010, Radeon
  780M 86017, RX 7900 XTX 86024.
- Costs, mesh_costs_print_per_card unvalidated, medians of nine command
  buffers: RTX 3090 85935, RX 7900 XTX 86024.
2026-12-03 17:05:48 -08:00
Anees Iqbal ff6e54b4ae Conformance ledger: the mesh rows on the RX 7900 XTX
The RX 7900 XTX (RADV, Mesa 26.2.6) replayed the 44 cases of mesh
pipelines at 19bf5ff006 (job 86024, carry b11f9ecd63) and answered as the
RTX 5080 Laptop, the RTX 3090 and the Radeon 780M did: 9 exact, 5
announced, 1 divergent, 29 refused. Its 25 lines of drift are exactly the
rows those venues carry, so the same rows are written for the venue
"RX 7900 XTX": the ThreadgroupMemoryLength and IndirectObjectGrid
refusals, the two CommandTypes cases, the eight divergent sites of
mesh-barrier-readers with the reason quoting the header and note 3 of
the feature set tables, and the twelve mesh-limits cases refused at
maxTotalThreadsPerThreadgroup.

docs/CONFORMANCE-COVERAGE.md regenerated (coverage.py).

Verified: job 86024 printed the 25 lines these rows answer, and the same
job's device tests passed 8 of 8 with the validation layer. A replay of
this commit on the card, to show no drift, follows.
2026-12-03 17:05:48 -08:00
Anees Iqbal 1d1a16aaf6 Conformance ledger: the mesh rows on the Radeon 780M
The mesh replay on the Radeon 780M (RADV, Mesa 26.2.6), job m3-max-85955 at 26d0420861 with the
carried binaries, held the same 25 sites as the RTX 5080 Laptop and the RTX 3090 (jobs 85920 and
85935), case for case, site for site and answer for answer, and nothing else: 9 exact, 5
announced, 1 divergent (mesh-barrier-readers, the ruled rows), 29 refused. Those 25 rows come in
for venue 780M. The runtime's 7 mesh device tests passed there under the validation layer.

The RX 550 (RADV, Mesa 26.2.6), which lists no VK_EXT_mesh_shader, replayed the same 44 cases in
job m3-max-85949 with exit 0: 25 lacking the feature, 7 exact (the creations Metal refuses), 12
refused at the `*` rows, so no per-venue row fires on a venue without mesh stages.

docs/CONFORMANCE-COVERAGE.md is regenerated in this commit (coverage.py --check passes locally).
2026-12-03 17:05:47 -08:00
Anees Iqbal a889f97a7a Runtime tests: an object grid past the task total is drawn in pieces on each device
The mesh replays of this lane (lavapipe, RTX 5080 Laptop, RTX 3090, Radeon 780M; jobs 85712,
85920, 85935, 85955) counted 0 object grids in pieces on every card: no conformance case and no
device test drew an object grid past a device's task limits, so the multi-draw of host-written
records and the folded numbering by DrawIndex had run on no device. A form taken by a device's
limits needs evidence that it ran.

an_object_grid_past_the_task_total_draws_in_pieces draws 4,194,305 object threadgroups, past
the maxTaskWorkGroupTotalCount of 4,194,304 every committed mesh device reports (vulkaninfo on
each), with a descriptor stating one object thread so lavapipe runs it quickly. It asserts the
draw is counted in pieces and not whole, the command buffer completes (under the validation
layer where the device tests take it), and nothing is drawn: each object threadgroup launches
ctl.x + x by ctl.y mesh threadgroups and ctl is zero.

Verified: the next jobs run it on lavapipe and on each card.
2026-12-03 17:05:47 -08:00
Anees Iqbal e5a9b6d7d0 Conformance ledger: the mesh rows on NVIDIA
The mesh replay on the RTX 5080 Laptop (NVIDIA 615.71.09), job m3-max-85920 at 26d0420861 with
the carried binaries, held exactly the rows lavapipe holds and nothing else: 25 sites "not listed"
on this venue, every one the same case, site and answer as its llvmpipe row (IndirectObjectGrid
at the two indirect object draws, ThreadgroupMemoryLength at the lengths case, CommandTypes at
the two command cases, the tile getter at the 12 made mesh-limits states, and mesh-barrier-
readers' 8 fragment-to-* sites). Those 25 rows come in for venue NVIDIA.

The same run: 9 exact, 5 announced (the draw cases, under the device's native NaN encoding
note), 1 divergent (mesh-barrier-readers, the ruled rows), 29 refused; mesh-partial-barrier-
uniform is exact (its PredicationVote refusal is fixed in 0d7bbee12c). The runtime's 7 mesh
device tests passed there under the validation layer 1.4.363.0.

docs/CONFORMANCE-COVERAGE.md is regenerated in this commit (coverage.py --check passes locally).
2026-12-03 17:05:47 -08:00
Anees Iqbal a39a600f08 Runtime: a render state keeps its vertex descriptor as an Option, None for a mesh state
Clippy in job m3-max-85855 (26d0420861, plain) stopped the runtime's lib on
clippy::large_enum_variant: once Made::Mesh held nothing (34fbfcf33f), the enum was a 952-byte
RenderPipelineDescriptor beside an empty variant. The field is now
Option<RenderPipelineDescriptor>: Some for a state of newRenderPipelineStateWithDescriptor:, None
for a mesh state, of which the state keeps nothing. A vertex state is the size it was before the
mesh work, and no Box is allocated per state. The four readers match Some and None as they matched
the two variants.

Verified by the error text of 85855 only; the next job runs the three clippy configurations.
2026-12-03 17:05:47 -08:00
Anees Iqbal 6639653a97 Conformance ledger: the mesh rows as the runtime now answers, on lavapipe
The mesh cases were 49 rows of `*` refusing a call the runtime's side lacked (mesh_pipeline,
mesh_pipeline_limits, mesh_pipeline_for_commands, mesh_pipeline_bindings,
mesh_descriptor_facts). The adapter answers all five, and the lavapipe replay of job
m3-max-85712 (c6bd918103) read each of those rows as no longer held. They go, and the rows the
replay holds come in (47):

- `*`, the calls that make no pipeline: the mesh descriptor's label and binaryArchives (3 cases,
  the consumer's own, as the render descriptor's) and the two reflection cases' 8 option sites
  each (the consumer's own reflection).
- llvmpipe, the calls that make one, so a venue without mesh stages reads them as lacking the
  feature and holds no row (a `*` row there fails as no longer held, now lacks the feature):
  - IndirectObjectGrid at the indirect draw of mesh-object-draws and of
    mesh-barrier-indirect-object-reader (the step-4 ruling: refused at the draw);
  - ThreadgroupMemoryLength at indirect-mesh-commands-object-threadgroup-lengths' pipeline (the
    object function's [[threadgroup(n)]] argument, refused at the creation, as ruled);
  - CommandTypes at both mesh-commands cases' command buffer (the ICB ruling; its row's count:
    0 of 22 kept streams, jobs 85614/85615);
  - maxTotalThreadsPerThreadgroup, a tile getter, at 12 mesh-limits cases whose state is made
    (an M3 Max answers 0 there; the runtime makes no tile state);
  - mesh-barrier-readers, divergent at the attachment and drawn count of its four rows whose
    barrier names the fragment stage in afterStages. main's ruling: the documented answer stands.
    MTLRenderCommandEncoder.h says the barrier makes stores at or before afterStages coherent
    with loads at or after beforeStages, which the runtime does; the M3 recorded the reader
    without the fragment's words, and the Metal Feature Set Tables (October 23, 2026, note 3)
    say Apple3 through Apple11 GPUs don't support barriers with the fragment stage in after.

The other mesh rows stay: function facts, the pipeline handler pair, the binary archive adder
and the visible-table stages answer as before. mesh-partial-barrier-uniform holds no row: its
PredicationVote refusal is fixed in 0d7bbee12c. The GPU venues' rows follow their runs.

docs/CONFORMANCE-COVERAGE.md is regenerated in this commit (coverage.py --check passes locally).
2026-12-03 17:05:47 -08:00
Anees Iqbal 822b869f23 Runtime: a mesh state whose walk votes in a workgroup word is made
The lavapipe conformance replay of job m3-max-85712 (c6bd918103) refused mesh-partial-barrier-
uniform at case/pipeline: "a render pipeline state with DrawInput { cause: RuntimeFact { fact:
\"PredicationVote\" } } is not built". Its object or mesh function holds a workgroup barrier in a
loop that part of the threadgroup skips, so its predicated walk votes in a workgroup word of its
own beside the arena (lower::simd::divergent). The translator counts that word against the
stage's workgroup memory at the creation and refuses a function whose word does not fit
(divergent.rs, mesh::workgroup_limit). A compute state supplies the fact by counting the word
against threadgroup lengths a dispatch sets; a mesh state answers no threadgroup memory length
and takes no length from a draw, so the render state's fact check now accepts it for a mesh
state, as it accepts the other facts of an object or mesh function.

The check is the conformance case itself: mesh-partial-barrier-uniform compares on the next
replay (lavapipe in CI, and the GPU runs of this lane).
2026-12-03 17:05:47 -08:00
Anees Iqbal 132e7a16c6 Conformance: a made mesh state's sites are its own method, so the coverage reads its Field
Job m3-max-85712 (c6bd918103) failed conformance_coverage's
the_conformance_coverage_document_is_what_the_sources_derive: MeshStateLimits'
max_total_threads_per_threadgroup became a Field in the adapter commit, and the coverage
generator finds a Field's leaf only as `Node::leaf("site", field(&self.x, ..))`. The node
recorded it through `state.` inside Creation<MeshStateLimits>::node.

The made state's leaves move to MeshStateLimits::with_sites (&self), in the same order and with
the same values; the creation's node adds them where the state was made. docs/CONFORMANCE-
COVERAGE.md is regenerated: MeshDescriptorFacts (label, binary_archives) and MeshStateLimits
(max_total_threads_per_threadgroup) join the table of refusable fields.

Verified: `python3 -I -B scripts/conformance-coverage/coverage.py --check` passes on this tree
(run locally, no cargo); the conformance suite runs in the next job.
2026-12-03 17:05:47 -08:00
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