Commit Graph
662 Commits
Author SHA1 Message Date
Anees Iqbal ff6d387aa7 Ledger: RADV's extended-swizzles family, 193 rule-1 rows
The whole RADV replay (RX 7900 XTX, RADV NAVI31, Mesa 26.2.6; potluck
job m3-max-4016 at 7470a49e6d) read 704 lines not in known-gaps.tsv;
193 of them are the extended-swizzles family (extended-range,
padded 10-bit, packed 16-bit, bfloat and sRGB-twin formats under
every swizzle and op). Each is a site the case's M3 Max, NVIDIA and
llvmpipe rows already hold, and each is the same answer:

- 124 sites read exactly the count and largest difference another
  venue's row holds, and 15 more (the sRGB twins' gathers and reads)
  differ from it only in the largest word difference (91309 here
  against 91311-91315), the same one-step code; their row texts state
  the module's own decode and encode arithmetic and the device's
  conversions, venue-neutral, under device-pack-conversion, which
  every one of these cases announced on RADV, so they are reused as
  they stand;
- 20 extended-range linear samples (sl) blend their taps by the
  device's FMix, under bicubic-filter-arithmetic, which these cases
  declare and which fired on RADV (none of them is among the cases
  whose declarations did not all fire); each row now names RADV's
  own first mismatch and how far apart it is in value;
- 14 bfloat NaN sites keep the NaN's sign and payload where Metal
  answers 0x7fc00000 (RADV's first: ours 0xFFEF0000), under
  device-pack-conversion;
- 20 packed 16-bit linear samples are the device's own filter and
  widening, under device-sampling and device-texel-conversion
  (announced); each row names RADV's first differing element and
  that device-sampling's RADV bound (0.548 of a code) is measured on
  unpacked formats only.

All are scoped to RADV. CONFORMANCE-COVERAGE.md re-derived.

(cherry picked from commit b255f138531068fea5f2d4edc2be7f2084d24c09)
2026-11-07 08:37:37 -08:00
Anees Iqbal fde4ef5bb3 Ledger: RADV's sRGB decode beyond the read-write tier, four rule-1 rows naming srgb-texel-decode
The whole RADV replay (AMD Radeon RX 7900 XTX, RADV NAVI31, Mesa
26.2.6; potluck job m3-max-4016 at 7470a49e6d) read four lines not in
known-gaps.tsv at the 8-bit sRGB `beyond` sites of
read-write-tier-round-trip-float (768 elements, largest 67649) and
read-write-tier-held (192 elements, largest 64922), for BGRA8 and
RGBA8 alike. They are the device's native sRGB decode, the same
answer the case's llvmpipe and NVIDIA rows hold at the same sites:

- both cases announce srgb-texel-decode on RADV;
- the U32 difference is between f32 bit patterns, not codes: the
  round trip's first element is Metal 0x3C840841 (66 / 4095) against
  our 0x3C830000; the held read's are Metal 0x3D080881 (136 / 4095)
  against our 0x3D0798DA, the transfer of code 51, and 0x3BB80B81
  (23 / 4095) against 0x3BB7AD6B, the transfer of code 17;
- RADV stores no sRGB format (its optimal tiling of B8G8R8A8_SRGB and
  R8G8B8A8_SRGB lists no STORAGE_IMAGE, read with vulkaninfo, job
  m3-max-4052), so the held texture is read through its UNORM alias
  and decoded through the device's Pow, as on the other two venues.

The rows are scoped to RADV: the decode is the driver's compiler's,
not one Mesa build's. CONFORMANCE-COVERAGE.md re-derived (2600 rows).

(cherry picked from commit 6efa9157436862f6e6d990f298f53fd84ab11b06)
2026-11-07 08:37:20 -08:00
Anees Iqbal b64908f468 Ledger: the RTX 5080's own YCbCr conversion and filter, twenty rule-1 rows for ycbcr-gathers and ycbcr-minify
The 5080 replay of the two-plane YCbCr cases (potluck b5080 entry
replay-replay-nv-ycbcr-072438 at 394b4db3f6) read twenty lines not in
known-gaps.tsv: ycbcr-gathers-{edge,zero,white,repeat} at
case/samples/{420v,x420}/{float,half} and ycbcr-minify-band-{x,y} at
case/samples and case/samples/ends, each a digest Metal's and ours
differ at. The digests are the ones the 5080 answered at 10012a618f.

They are the device's native answers. The 5080's memory is not the
host's, so the runtime binds the texture's image of converted texels
rather than reading the planes in place (lavapipe and MoltenVK read
them in place and match Metal at every one of these sites):

- the 8-bit 420v surface: the device converts the format itself
  (ycbcr_device.rs; NVIDIA 615.71.09 enables samplerYcbcrConversion
  and its optimal tiling of G8_B8R8_2PLANE_420_UNORM reports
  SAMPLED_IMAGE, TRANSFER_DST and MIDPOINT_CHROMA_SAMPLES, read with
  vulkaninfo, potluck job m3-max-3911), and samples are its own
  filter: announced as ycbcr-filter-not-exact and device-sampling;
- the 10-bit x420 surface and the minify bands: the device does not
  convert it (RuntimeDriverDefect::TenBitCodesReadAsWords names
  NVIDIA), so the texels are Metal's fixed-point conversion and only
  the filter is the device's: announced as device-sampling.

Both notes are suite native notes, which loosen no value
(replay::NATIVE_NOTES), so each site is a row naming its note. The
sites compare by digest, so which lanes moved is not separated, and
the rows say so. CONFORMANCE-COVERAGE.md re-derived.

(cherry picked from commit 05a4e4d3994ef83845ca55417f480aa0aab3606d)
2026-11-07 08:36:55 -08:00
Anees Iqbal c36bf38d91 Scheduler: wake after a committing thread's pass only where it submitted alone a batch that may group
The wake that ends a committing thread's pass (ff870f6403) came after every such pass. Before the
alone path (4d4e103471), a commit_and_submit's batch of a VkQueue whose batches may wait in a group
was left to the scheduler's thread, which the commit woke; every other batch it submitted itself,
waking nothing. So on a driver whose check finds no merge (lavapipe) the base never woke the thread
for a commit_and_submit, and the unconditional wake added one there: on lavapipe the "seen handler
alone" shape's commit to watch went to p50 14.7-15.0 us, p90 21.9-22.6, against the base's
13.7-13.9 and 16.0-17.3, while the same binary with the wake switched off was at the base
(m3-max-3884, gem10 exclusive).

Now `submit_plain_ready` counts the batches it submitted whose `VkQueue`'s batches may wait in a
group (`Plain::alone`: for a committing thread, those `plain` lets go alone where the group would go
at once, `goes_alone_at_commit`), and a committing pass that left nothing wakes the thread
(`Woken::Commit`) only where that count is above zero: the wake the batch's hand-off to the thread
would have made. Every driver keeps the base's cadence by construction: RADV its wake per such
commit, lavapipe and any driver whose check finds no merge none. Docs: the scheduler module,
`submit_at_commit`, `Plain`, `Woken::Commit`, `CommandBuffer::commit_and_submit`,
`WorkCounts::scheduler_wakes_commit`, the runtime README's item, FAST-PATHS row 37's figures. The
scheduler_wakes test is now
`a_commit_and_submit_wakes_the_sleeping_thread_only_for_a_batch_that_may_group`: once the
submission checks answered, ten commit wakings of ten where the batches may group, none elsewhere.

Verified (m3-max-3922, gem10 exclusive, one job, this diff on 7e57099fa3; base = the three
scheduler files before 4d4e103471; two alternating rounds of both lanes on each driver):
- lavapipe (Mesa 26.2.6): the thread's counts over the lane as the base's, sleeps 4000 and
  commit wakings 4000 at both, 2000 submitted at commit; "seen handler alone" commit to watch
  p50 13.8-14.1 us, p90 16.9-17.5, against this run's base 12.9-13.2 and 15.9-16.9 (3884's base
  13.7-13.9 and 16.0-17.3), the unconditional wake's p90 21.9-22.6 gone; a checked fill's commit to
  submission handler p50 12.5-13.4 us against 12.4-13.4.
- RADV (RX 7900 XTX): sleeps 6000 at both, the commit_and_submit batches' wakes counted as a
  commit's (commit 6000, host 0) where the base counted them as a host signal's (4000 and 2000);
  the plain shapes' commit to watch p50 32.1-47.3 us against 38.9-46.7, the thread's wake p50
  4.0-4.5 against 4.1; commit_and_submit's gain kept: a checked fill's commit to submission
  handler p50 30.4-32.8 us, p99 48.8-57.8, against 36.2-55.7 and 112.1-198.5, 520 of 520
  submitted at commit; another queue's head waiting, p50 24.7-25.0 against 32.7-39.2; the shape in
  turn with the plain ones, commit to watch p50 31.9-36.1 against 39.2-50.1.
- Tests alone (commit_and_submit, deferred_calls, scheduler_wakes, each --exact on one thread):
  31 of 31 on RADV (the new test: batches grouping, 10 commit wakings of 10) and on lavapipe (not
  grouping, 0 of 10). Negative controls: on RADV with 3e9230adf2's scheduler (no wake) the new test
  fails with 0 of 10; on lavapipe with 7e57099fa3's (the wake after every pass) it fails with 10.
- Clippy (plain, m2v_gpu, m2v_cpu_icd) and rustdoc with -D warnings pass (m3-max-3923, ms01).

(cherry picked from commit 9184d15a5707ff4e89c00f32af225b66ec40875e)
2026-11-07 08:17:57 -08:00
Anees Iqbal f118559e73 Binary archives: add mesh pipelines, and load a metallib as an empty archive
Two of the conformance ledger's every-venue rows, both of the runtime's
archive surface.

binary-archive-mesh-adder: BinaryArchive had three of Metal's four
pipeline adders. add_mesh_render_pipeline_functions
(addMeshRenderPipelineFunctionsWithDescriptor:error:) makes the state as
new_mesh_render_pipeline_state does with the default options, answering
its error, and keeps the descriptor's archive key (metal_key::mesh). A
mesh creation compiles its pipeline whole and looks in no archive, so
the add keeps no compiled artifact. Under FAIL_ON_BINARY_ARCHIVE_MISS a
mesh creation, which every listed archive missed before, now hits an
archive holding its key (binary_archive::mesh_missing). Which fields
Metal keys a mesh pipeline by is not measured, so the key holds every
field of the descriptor: a creation hits only an add of an equal
descriptor, where Metal's hits too, and one differing in a field Metal
does not key misses here where Metal's may hit, as the add's and
new_mesh_render_pipeline_state's docs say.

binary-archive-sources: Metal takes a metallib as an archive (the case's
M3 Max recording); container::read refused it as no archive of ours. A
file that parses as a metallib (Library::from_metallib, container tags
alone) now loads as an archive holding nothing: its lookups miss and it
serializes as one nothing was added to. What Metal's archive of a
metallib holds is not measured; new_binary_archive's doc says so.

The suite's runtime side answers the mesh add through the new call. The
ledger's two rows go; api_signatures.tsv gains the method, and
METAL-COVERAGE (coverage.tsv) marks the call implemented. Tests: unit
tests the_mesh_key_holds_every_field_and_a_lookup_names_the_mesh_function
and a_metallib_loads_as_an_archive_holding_nothing; lane test
a_mesh_add_is_found_by_its_own_descriptor_and_a_metallib_loads_as_an_
empty_archive (hit, miss before the add and for another color format,
the add's error, serialize and reload, the metallib's miss and nothing
to serialize). Verified by those tests and a whole lavapipe conformance
replay (see the tip report).

(cherry picked from commit adadb73f7c2063341e1dbe54fe887a5ceddf86b7)
2026-11-07 08:02:57 -08:00
Anees Iqbal 0d368fbfe7 Draw a split depth/stencil resolve's drawn aspect into its own texture
Metal resolves separate Depth32Float and Stencil8 textures with the
depth filter Min or Max beside the stencil filter Sample0, each into its
own resolve texture. On a device with no MIN or MAX depth resolve mode
(lavapipe) the runtime draws the picked depth after the pass, but a
split resolve (aspects resolving into different textures) refused any
drawn aspect NotImplemented(DepthStencilResolve): the draws wrote the
first step's scratch image, whose copy takes that step's aspect alone.

Now a split resolve draws its drawn aspect into that aspect's own
resolve texture (or a scratch image copied there, Destination::attach),
held as the resolve's drawn_into, which drawn_target prefers; the other
aspect resolves in its subpass step as before. Both aspects drawn, each
into its own texture, stays refused. The image separate textures render
through is made sampled where such a resolve may be drawn
(resolve::may_draw, which shares the filter-to-mode choice with
depth_stencil through aspect_modes), since the draws read its samples.

The ledger's two llvmpipe rows of resolve-stencil-under-depth-filters
(Sample0 under Min and Max) go. The lane test
split_depth_and_stencil_resolves_are_metals now expects every case but
both-aspects-drawn to be built and to hold Metal's answers; before this
change sep_min, sep_max, two_min, two_max and slices_max were refused
on lavapipe. Verified on lavapipe: the lane test and the conformance
replay (see the tip report).

(cherry picked from commit c2b4cbc80bf7f8f209d02ecbd5e5aec186b04d96)
2026-11-07 07:28:20 -08:00
Anees Iqbal 9b1a531a25 Re-derive the conformance coverage document for attribute-stride-vertex-buffer
python3 -I scripts/conformance-coverage/coverage.py: one more case module
and recording, and setVertexBuffer:offset:attributeStride:atIndex: on the
render encoder now exercised by the Metal leg (812 of the reachable).

(cherry picked from commit dce4bd753c2e298f3b1cbb84b5c808d2cabb85b1)
2026-11-07 07:21:49 -08:00
Anees Iqbal e39a0cab5c Conformance: a tile state's thread limit follows its dispatch's device-gap ruling
tile-simd-blur-columns and -rows on llvmpipe compared the tile state's
maxTotalThreadsPerThreadgroup, Metal's 1024 against the runtime's 960,
as a divergence of ours, while the same case's 32x32 dispatch, refused
typed with Feature::LocalSize and a Capability::Limit, already read as
the device's gap (a_dispatch_the_device_cannot_take_is_the_devices_gap).
960 is lavapipe's: its emulated 32-lane simdgroups hold 960 threads of
the blur's pipeline, and the runtime reports the device's lower limit
by contract (pipeline/tile.rs).

Now the tile_threadgroups family, where the device refused a dispatch
Metal ran of the state as its gap and the state's descriptor states no
limit, states the state's maxTotalThreadsPerThreadgroup site as that
gap (Sites::device_gap), and the comparison reads a value site our side
stated so as a DeviceGap instead of a divergence (compare.rs, before
any allowance, as a refused site's gap). A state whose answer matches
Metal's records nothing; an unstated difference still diverges.
Metal's side never states one: its failures carry no lacks.

The two llvmpipe ledger rows go; the cases now read lacks-feature
there. Test: a_getter_our_side_states_is_the_devices_limit_is_the_
venues_gap holds both directions (stated reads lacks-feature, the same
answer unstated reads divergent, a stated site matching Metal exact).
Verified by the conformance unit tests and a whole lavapipe replay
(see the tip report).

(cherry picked from commit ffa0411fb87a3dc61ca14a5418b16a60e06c3fa2)
2026-11-07 07:20:06 -08:00
Anees Iqbal ff870f6403 Scheduler: a committing thread's pass ends by waking the scheduler's thread, as a commit does
Since a committing thread's batch went alone on a grouping driver (4d4e103471), a
`commit_and_submit` that submitted its batch itself no longer woke the scheduler's thread;
before it, on such a driver, that batch was left to the thread, whose wake came with it. The
thread so slept across those commits, and the plain `commit`s made beside them often fell into
a slow mode: in the completion-latency lane (three shapes committed in turn 2 ms apart), the
plain shapes' p50 was slow in 4 of 6 rounds (three jobs) without the wake and in none of 10 with
it, before the alone path or after this change.

Mechanism (gem10, RX 7900 XTX, RADV, Mesa 26.2.6, exclusive; m3-max-3816, a probe build):
the thread's own counts over the lane show the wake source: before the alone path, sleeps 6000,
woken by a commit 4000 and by the host 2000 (the committed batch left to it), batches submitted
at commit 0; at 3e9230adf2, sleeps 4000, commit 4000, host 0, at commit 2000; with a wake after
the committing thread's submissions, sleeps 6000, commit 4000, host 2000, at commit 2000. The
latency followed: in 3e9230adf2's slow round, the plain shapes' thread wake p50 4.5-10.6 us
(p90 51-104) and commit to watch p50 56-104 us, `vkQueueSubmit` itself 27-62 us at the median,
on every thread, the committing one's included; with the wake, both rounds at the old figures. The system-wide
cpuidle counts (entries and residency of each state, the menu governor, amd-pstate-epp) did not
separate the legs, so the idle-depth part of the account is not shown by them.

Fix: `Scheduler::submit_at_commit` wakes the thread after its pass, for what it left
(`Woken::Host`, as before) or else for the commit itself (`Woken::Commit`), once a sleep as any
waker. The wake comes after the submissions and their submission handlers, so nothing on a
command buffer's way to its `VkQueue` waits for it. Docs: the scheduler module, `submit_at_commit`,
`Woken::Commit`, `CommandBuffer::commit_and_submit`, `WorkCounts::scheduler_wakes_commit` and
`scheduler_wakes_host`, the runtime README's item, and FAST-PATHS row 37's figures for the alone
path. New test: `tests::scheduler_wakes::a_commit_and_submit_wakes_the_sleeping_thread_as_a_commit_does`
(ten `commit_and_submit`s after idle gaps, each submitted at commit, each a commit's waking).

Verified (m3-max-3823, gem10 exclusive, release, base = the three scheduler files before
4d4e103471, dev = development's scheduler, fix = this; two alternating rounds of both lanes):
- the plain shapes back at base: commit to watch p50 31.3-37.0 us against base 29.9-39.4 (dev
  33.4-169.9), the thread's wake p50 4.1-4.5 us against 4.0-4.2 (dev 4.3-51.0);
- commit_and_submit keeps its gain: a checked fill's commit to submission handler p50 30.7-32.2
  us against base 34.2-70.0, 520 of 520 submitted at commit; the call returns at 32.0-33.5 us
  against dev's 31.8-33.8; the shape in turn with the plain ones, commit to watch p50 31.3-31.6 us
  against base 31.3-39.5 (dev 29.6-102.4).
Tests alone on RADV (each `--exact`, one thread): commit_and_submit, deferred_calls and
scheduler_wakes, 31 of 31 pass at the fix; with development's scheduler 30 of 31, the new test
failing with 0 commit wakings of 10. Clippy (plain, m2v_gpu, m2v_cpu_icd) and rustdoc with -D
warnings pass (m3-max-3824, um870).

(cherry picked from commit b80e092759fb412a0154365bfb378ee38e096f56)
2026-11-07 07:16:37 -08:00
Anees Iqbal 027bb2e682 A compute state's static threadgroup length is the kernel's own, as Metal reports it
ComputePipelineMetalInfo::static_threadgroup_memory_length answered, on
a device that emulates simdgroups, the declared arena plus the scratch
of the most threads (32768 on lavapipe for compute-threadgroup-simd-
scratch, whose kernel declares 24 KiB), and elsewhere the kernel's
static part plus a predicated walk's vote word. Both additions are
ours: Metal's staticThreadgroupMemoryLength is the static part of the
kernel's own layout (KernelFacts::static_threadgroup_bytes), and the
getter now answers exactly that.

The planner keeps counting the scratch and the vote word in each
dispatch's total (bind::plan::compute: the arena from
RuntimeFact::SimdgroupEmulation, the vote beside it, the scratch rule
per region), so a dispatch whose threadgroup lengths fit beside the
reported length but not beside the scratch is refused
ThreadgroupMemorySize, the device's gap, where before the inflated
getter kept a well-behaved client from asking. The emulated tests
check both: region_k reports 0, a Metal client's remainder beside it is
refused at the most threads, and a region that fits beside the arena
and the scratch runs; barrier_k reports its own 31 KiB.

The compute-threadgroup-simd-scratch llvmpipe row goes. The runtime
getter's doc names the refusal. SEMANTICS_VERSION 1980 -> 1982 (1981 is
rows2's).

Verified: runs next (targeted translator tests, lavapipe replay).
(cherry picked from commit dd3d0a893bf900fbf11cb885f5fb9a7b7cfd9055)
2026-11-07 06:57:11 -08:00
Anees Iqbal 6126e8a237 FAST-PATHS: the Grouped row's figures for a batch a committing thread submits alone
Measured in job m3-max-3640 (homelab-gem10-1, exclusive, release test
binaries of the fix's tip and of the form before it, alternating, two
rounds each): tests::completion_latency::runtime_commit_to_submission
and runtime_completion_latency on RADV (RX 7900 XTX, Mesa 26.2.6,
whose submission check finds merges: 520 batches submitted at commit
at the tip, 1 before) and on lavapipe (whose check finds none: the two
forms alike). The plain commits interleaved with commit_and_submit ones
saw the scheduler thread wake later at the tip, in three of four rows;
the row states it.

(cherry picked from commit d94a28e714c46ca24fe764700ee5017c2041c297)
2026-11-07 06:47:43 -08:00
Anees Iqbal 4d4e103471 commit_and_submit: on a grouping driver, submit a batch alone where the group would go at once
On lavapipe (and on every Mesa driver, whose queues merge a submission that
signals nothing into the next), commit_and_submit's committing thread never
submitted anything: tests::commit_and_submit printed "0 of 40 handlers on the
caller; passes at commit 40, batches 0", and six of its tests failed (lines
126, 217, 284, 427, 535, 624), with deferred_calls.rs:1106 (the check and
handler ran on the scheduler's thread, not the lowering thread). Under the
default CompletionPolicy::Grouped there, every batch "may wait in a group"
(group::groups), and scheduler::plain refused any such batch to a thread
other than the scheduler's, so each commit went to the scheduler's thread, a
wake and a pass away: the extension did nothing on the drivers it was made
for (the runtime README states it submits the ready command buffers needing
no host step and no storage-form switch; only the method's doc said "no
group").

A pass that holds a batch in the group sends the group at its end unless two
or more earlier submissions of its VkQueue are not seen complete
(Group::keeps). So where at most one runs, a committing thread now submits
such a batch alone (CommandBufferShared::goes_alone_at_commit, read from the
queue's timeline without its lock, as keeps reads it): it reaches the GPU no
later than through the scheduler, and the wake and pass are saved. Where two
or more run, it is left to the scheduler's thread, which holds it in the
group with the commits that join it, as before. submit_batch takes `alone`,
which a thread other than the scheduler's passes, so such a batch never joins
the group. A thread about to block keeps leaving groupable batches to the
scheduler.

Docs: commit_and_submit's doc, the scheduler module doc, the runtime README
and the Grouped row of docs/FAST-PATHS.md (its switch and forms unchanged).

Verified on lavapipe (layer 1.4.363) by the commit_and_submit and
deferred_calls tests and the grouped-submission lane at this commit and with
plain()'s change reverted, in one job (see the report for the job id).

(cherry picked from commit 25a43729192f80d5fc2ca3af42ef4c14596ae1f0)
2026-11-07 06:47:43 -08:00
Anees Iqbal def2c7f1d7 Re-derive the conformance coverage document after the ledger removals
python3 -I scripts/conformance-coverage/coverage.py: the ledger count
falls from 2619 to 2605 (the four attribute-stride rows, the three
slice-past used-size rows and the seven move rows), the slice-past row's
note follows the ledger, and the sparse families count the
allowGPUOptimizedContents call the move rows now make.

Found by tests::the_conformance_coverage_document_is_what_the_sources_derive
failing at fcfdf2bcb1 (job m3-max-3620, the only failure of 1,019).

(cherry picked from commit cc6e6740161cc876cfdf2f8ccc008088de24970b)
2026-11-07 06:26:54 -08:00
Anees Iqbal d158a960dd Read the sparse move rows through uncompressed textures
The move family's rows (inside-the-level, past-the-destination's-row,
clipped-source) read a tile a move rebound as 0 in 3,968 of its 4,096
words on Metal and whole on ours. probes/sparse_move_compression.m (job
m3-max-3570, an M3 Max under macOS 27.0.1, five descriptors, two runs
each, one outcome) shows that is lossless compression's: under the
case's own descriptor (ShaderRead, allowGPUOptimizedContents YES) a
moved tile kept its word in 128 texels, the first 4 by 2 of each 16 by
16 block, and with allowGPUOptimizedContents off, ShaderWrite or
PixelFormatView usage both moved tiles read whole. Controls: untouched
tiles whole, moved-from tiles zero, every command buffer completed,
usedSize unchanged.

A move is documented to move the tile's mapping, and the rows read
which tiles it moved, so they now make both textures with
allowGPUOptimizedContents off:

- SparseTextureSpec gains gpu_optimized (Metal's default, true) and
  unoptimized(); both sides forward it to their descriptor. An
  unoptimized texture adds a byte to its fingerprint and a site suffix
  where the default adds none, so every other sparse case's recording
  keeps its fingerprint.
- moved() builds its two textures unoptimized; the four move rows'
  recordings are re-taken on the M3 in the next commit.
- docs/API.md's accepted differences gain the compressed case: Metal's
  moved tile may read only part of its texels, ours reads all of them
  under every descriptor; the runtime does not reproduce the loss.
- The probe's header records its results.

(cherry picked from commit b3f8f28dbf18ce6756587702dd012ebd282c4f3a)
2026-11-07 06:26:30 -08:00
Anees Iqbal 08ca74da22 Charge a sparse heap for a mapping update of a slice past the texture's
Plain Metal takes a sparse mapping update whose slice is past the
texture's own (its API validation refuses it) and charges its heap's
usedSize exactly what the same region on an in-bounds slice costs: one
page a tile of the region clipped to the level's tiles, idempotent per
tile, given back on an unmap of that tile, never below where it stood
(probes/sparse_indirect_usedsize.m and sparse_mapping_past_the_bounds.m
on the M3 Max, macOS 27.0.1, both selectors). Ours counted nothing, so
sparse-mapping-a-slice-past-the-textures read 65,536 where Metal read
81,920 at used-size/2, /3 and /4.

UnitGrid::clipped_region now names such a region's units at the slice
(past_slices tells them apart); sparse/bind.rs's apply takes and gives
back their heap room into SparseState::charged and binds nothing for
them, and undo reverts them with the rest. The move keeps the slice
bound (clipped_size), as measured.

The texels plain Metal's page reaches (read/4: a 16 by 16 block of slice
0's tile (0, 0) reads its unwritten pattern) are not mirrored, on the
owner's call via the orchestrator: an accepted difference in docs/API.md
section 10 (Vulkan binds nothing past an image's layers,
VUID-VkSparseImageMemoryBindInfo-subresource-01723, and the address is
not derivable), which the remaining ledger row now names.

Removes the three used-size rows of known-gaps.tsv. tests::sparse holds
the counts against Metal's readings row by row (every row now equal).

(cherry picked from commit 636522137c717715521cdda950fbb7213e00089f)
2026-11-07 06:26:30 -08:00
Anees Iqbal 1edd55cb98 Read a stage-in layout bound with MTLAttributeStrideStatic as Metal does
Plain Metal on the M3 Max (macOS 27.0.1) answers each of the compute
encoder's four stride forms bound with MTLAttributeStrideStatic, under a
[[stage_in]] layout of MTLBufferLayoutStrideDynamic, with the element at
the bind offset for the first element and zero for every element past it
(the attribute-stride-* recordings). That is a fetch at the constant's
low 32 bits, 2^32 - 1, by the same truncation every other stride takes:
element 1 lies 2^32 - 1 bytes on, past the buffer (an ICB command read
the real byte there in a buffer that holds it). Ours mapped the constant
to "no stride" and read every element at stride 0 (three divergent
rows), and refused the inline-bytes form (one refused row).

- Runtime: a compute table's stride forms hold the argument's low 32
  bits, the constant included (argument_table::per_bind_stride); the
  plain setters still set none (stride 0), and a render stage's table is
  unchanged. fetch_reach then sees the constant's real reach.
- Bind layer: PushField::StageInStride pushes inline bytes' stride as a
  buffer's; the NotImplemented(KernelStageIn) refusal for bytes at
  u32::MAX is gone (REFUSALS.md regenerated).
- Translator: a kernel stage-in read that steps by thread position
  decides exactly whether its bytes lie in the first 2^32 bytes from the
  bind offset (e * stride + offset + size <= 2^32, without the u32 wrap;
  fetch::within_reach), and in a view whether the bind residual plus the
  displacement still fits; past it the read takes the bind offset and
  yields zero bytes on every device (access::pulled::prepare_within).
  Before, the wrapped displacement landed back inside the buffer (element
  1 at 2^32 - 1 + 4 read byte 3).

Removes the four attribute-stride-* rows of known-gaps.tsv.
SEMANTICS_VERSION 1981 (the orchestrator's number).

Tests: engine_kernel_stage_in::an_element_past_four_gigabytes_reads_zero
(every profile, with and without robustness: the constant on both
layouts, beside a stride of its own, and a stride of 2^32 - 8 whose
element 2 wraps to 2^32 - 16); tests::argument_table::
the_static_constant_is_a_compute_tables_widest_stride.

(cherry picked from commit f4d8011ccd1fe723c5192dd58e6b2eef7553fb37)
2026-11-07 06:26:29 -08:00
Anees Iqbal 2e8e0353b2 Regenerate REFUSALS.md for the input-form shadow's refusals
lower/fragment/input_shadow.rs refuses FramebufferFetch where the device
lacks the interlock, fragment stores, multisampled storage or the
shadow's storage format, and NotImplemented for the shapes it cannot
keep Metal's answer in (python3 scripts/refusal-surface/refusal_surface.py).

(cherry picked from commit 8a9d1405ec2dc326f1d78fd8831065ac75276e70)
2026-11-07 06:19:16 -08:00
Anees Iqbal 9175e22891 Degrade catalogue: lavapipe's passes hold the extended-range shadow beside the input attachment
docs/API.md's entry for extended-range-blends-stored-codes said every
pass over input attachments keeps the codes; on a device with the pixel
interlock, fragment stores and Rgba16f storage images the pass holds the
shadow, and the notice fires there only where the shadow cannot follow
(a multisampled load, a refused shadowed variant) and, for a masked
word write, only where the pass holds no shadow. The four
xr-masked-bgr10xr notice rows that went in 9b264b29fe are that last
case. Degradation::ExtendedRangeBlendsStoredCodes' doc says the same.

Verified: doc text; the runtime suite's catalogue test runs with the
suites.

(cherry picked from commit 536615e3c3460673f6defce426dfa72fc51f8f3f)
2026-11-07 06:19:16 -08:00
Anees Iqbal 91a95766bb Conformance ledger: lavapipe's extended-range blends read the half shadow beside the input attachment
With the shadow held over input attachments (and the input-form draws
kept for recording again), the lavapipe xr replay on msi (m3-max-3561,
at 43b2d2dd54; 109 xr-* cases) answers the 26 group-1 texel sites
exactly as the RTX 5080 does, and 22 of them as the M3 Max does (the
four xr-gradient-*blended* rows differ from the M3's by the device's
arithmetic, as the 5080's do):

- xr-gamut-bgra10xr-{over,straight}-{half,float}-{x1,x4}, the sRGB twins
  and the x4-stencil pair, xr-masked-bgra10xr{,-srgb}-rgb-over,
  xr-masked-bgr10xr{,-srgb}-red-over and
  xr-gradient-bgra10xr{,-srgb}-blended-{x1,x4}: each row's answer is the
  measured one, and its text the 5080's (the device's blend arithmetic,
  encode and resolve, in replay::NATIVE_NOTES or announced and
  declared), saying the function blends over the input attachment and
  reads and writes the shadow beside it in the interlock. None is our
  gap any more.
- The four notice rows of xr-masked-bgr10xr{,-srgb}-{red,blue-green} go:
  extended-range-blends-stored-codes is no longer announced, as the pass
  holds the shadow.

The gamut and masked cases' allowance docs no longer say lavapipe holds
no shadow. CONFORMANCE-COVERAGE.md regenerated.

Verified: the msi replay above (lavapipe, LLVM 23.1.1). The whole
replay on the homelab lavapipe (LLVM 23.1.4) runs next.

(cherry picked from commit cd910afb74e5faf67a0e6affdea77ced18205747)
2026-11-07 06:19:16 -08:00
Anees Iqbal 14e55e0c6c A reset compute pipeline descriptor is a fresh one: an accepted difference
MTLComputePipeline.h documents -[MTLComputePipelineDescriptor reset] as
"Restore all compute pipeline descriptor properties to their default
values", and maxTotalThreadsPerThreadgroup as "If it is not set,
returns zero". The runtime's reset is ComputePipelineDescriptor::new,
every field at its default. Metal's reset on the M3 Max (macOS 27.0.1)
keeps threadGroupSizeIsMultipleOfThreadExecutionWidth,
maxTotalThreadsPerThreadgroup and requiredThreadsPerThreadgroup as the
program set them (true, 96 and 8 by 6 by 2 in compute-descriptor-reset),
while the tile and mesh descriptors' resets restore every field on the
same machine. The owner's decision: the header's contract is Metal's,
and the compute descriptor's kept fields read as one release's defect.

docs/API.md section 10 (Kernels) states it. compute-descriptor-reset
loosens its five thread-shape sites to the runtime's default alone
(AnyOf the default, so Metal's kept value is still a divergence),
justified by that entry, and its five known-gaps rows go. A module test
holds the entry, the five paths and the defaults; the other two shapes
loosen nothing. CONFORMANCE-COVERAGE.md regenerated.

Verified: the conformance suite and clippy run on this branch next.
(cherry picked from commit 3dbd14b8fa45f6fcb836603b32aace527d009c0e)
2026-11-07 05:47:31 -08:00
Anees Iqbal 924f46aac7 use_host_ram and HOWTO: the no-source case and the dma-buf route in one statement
flakes's landing (bc13149480) documented a RAM of shared memory on a
device that refuses shared pointers (RADV) as imported nowhere with no
dma-buf source; this branch documented the dma-buf route. The doc of
use_host_ram now says both together: with a source such a RAM's chunks
go as dma-bufs, with none it is taken but imports no chunk and each
object over it is refused. HOWTO's chunk bullet says the same.

flakes's test a_ram_of_shared_memory_a_device_refuses_imports_no_chunk_
and_refuses_its_objects now also reads this branch's counters: the
chunk's pointer import refused (host_ram_pointer_imports_failed >= 1)
and no dma-buf import (host_ram_dma_buf_imports == 0), printed as a
HOST-RAM line. Its insertion had left the doc comment of
an_object_made_while_its_imported_chunk_is_looked_at_is_bound_in_the_
chunk above it; that doc goes back to its test.

Verified: cargo fmt; the RADV run follows as a potluck job.
(cherry picked from commit 1534099c85ec27c7c2d8f2e1b48047c1026d568d)
2026-11-07 05:45:54 -08:00
Anees Iqbal ba7ed4d150 Bless the API signatures and regenerate the refusal surface for the submission checks and HostRam's dma-bufs
Removed: DriverFact::PointerImportsFollowTheirAddress and
DriverFact::SubmissionsWithoutSignalsMerge (in metal2vulkan::device and the runtime's
re-export). New: HostRam::with_dma_buf, Device::pointer_imports_follow_their_address, the
doc(hidden) Device::submissions_merge, fresh_pages_pay, settle_submit_checks and
submit_check_report, and WorkCounts submit_checks_run, submit_checks_recalled,
submit_check_calls, host_ram_dma_buf_imports and host_ram_pointer_imports_failed.
REFUSALS.md: Problem::DmaBuf gains its site in ram_span_as_dma_buf.

Verified: scripts/api-signatures/signatures.py --bless and
scripts/refusal-surface/refusal_surface.py (both read source only).

(cherry picked from commit 027b38e988e93373d58a26b388d0989a98809b33)
2026-11-07 05:45:53 -08:00
Anees Iqbal 718f6543b4 HostRam: chunks imported as dma-bufs where held pointer imports tax every submission
reims measured raw Vulkan on the Radeon 780M: each live host-pointer import adds about
0.75 us plus 0.33 us per MiB to every vkQueueSubmit (amdgpu gets every page of a userptr
again in each CS), each dma-buf about 0.44 us with no per-page cost. A guest RAM imported
in 64 MiB pointer chunks would cost RADV about 24 us per chunk per submission, and RADV
refuses the pointer of any shared mapping (a memfd's) anyway, so the consumer imports
13-135 region blocks and its IOSurfaces one dma-buf each there.

- `HostRam::with_dma_buf(source)` (new public method) gives the RAM a DmaBufSource. Each
  import of the RAM, a chunk or an object's run imported alone, is then one dma-buf of its
  pages where the device's submission checks found a held pointer import taxing every
  submission (the ImportTax verdict; the pointer where that import fails), and elsewhere
  the pointer first, the dma-buf where the pointer is refused. The decision reads the
  device's measured verdict or the driver's refusal, never its identity: NVIDIA, ANV and
  MoltenVK (untaxed) keep the pointer path unchanged. `use_host_ram` waits (at most 10 s)
  for the checks first when the RAM has a source.
- A buffer bound in a dma-buf chunk is made for DMA_BUF_EXT memory
  (VUID-vkBindBufferMemory-memory-02985; `host_buffer` takes the handle type). Its
  placement lends the chunk's imports, so textures over it take the dma-buf image route
  (an image over a dma-buf of their own pages from the RAM's source), asked at the RAM's
  addresses (`Placement::dma_buf_address`: the caller's view may differ from the RAM's).
  A rebind into such a chunk makes the heap's and in-place images again as a rebind onto
  the caller's dma-bufs does. `host_backing` reports such a buffer InHostRam; its
  deallocator goes at once (it frees no memory of its own); the chunk's RAM keep-alive
  goes after the chunk's dma-buf import is freed.
- Counted: WorkCounts::host_ram_dma_buf_imports (new field).

Also in this commit, for the submission checks of 363fa41176: the docs that named the
removed DriverFact rows (PointerImportsFollowTheirAddress, SubmissionsWithoutSignalsMerge)
name the device checks (FAST-PATHS grouping row and known gaps, HOWTO, fresh_pages.rs,
buffer.rs, buffer_descriptor.rs, host_memory.rs, work_counts.rs); fresh_pages.rs and
FAST-PATHS give the measured reason for the tax gate (one 64 MiB fresh-page buffer: a
commit's p50 10.7 -> 36.6 us on the 780M, 14.7 -> 164.7 us on the RX 550,
submit_per_fresh_page_buffer at 27b9b13bcd); the checks' 10 s answer wait is one constant
(submit_check::ANSWER_WAIT) shared with the in-place check; and the recall test's
failure names the record, where it lies, the cache's rejected/failed reads and both
identities (it failed on lavapipe, msi-laptop, m3-max-3160: no device recalled the record
in 60 s; the cause is not known yet).

Verified: cargo fmt only; compiled and tested in the following jobs.
(cherry picked from commit fa8c27f1549fe09d769847ef63f8e34d51f2c6af)
2026-11-07 05:45:53 -08:00
Anees Iqbal f8ca661520 Conformance ledger: the RTX 5080's held sRGB reads, and its BGR10A2 held write runs
The 5080 replay at 3e5ef48250 (b5080 entry replay-r4-nv-043226, whole
suite, 1228 verdicts) reported three ledger mismatches beyond the 20
known ycbcr gather and minify sites:

- read-write-tier-held diverges at BGRA8Unorm_sRGB and RGBA8Unorm_sRGB
  (192 elements, largest 64919). The 5080 stores neither sRGB format,
  so the heap views a held texture through its UNORM alias and the
  function decodes by the MSL transfer through the device's Pow, as on
  lavapipe; srgb-texel-decode is announced for the case. Two rows, in
  the sRGB decode section, whose header now names both venues and the
  held alias read.
- norm-storage-fields-bgr10a2unorm no longer refuses hsw_held/dispatch
  on the 5080 (the heap's storage aliases, f4c1fbd170): its row goes.

The held BGR10A2Unorm texels match Metal on the 5080 (no row), and so
do the RGB9E5 attribute reads: the one RGB9E5 site left,
attribute-format-fetches' attribute3/Half2, is the listed half NaN
quieting of another attribute.

Verified: the replay output above; coverage regenerated with
scripts/conformance-coverage/coverage.py. Not verified: a 5080 replay
at this commit.

(cherry picked from commit e127ed348db352da2a4a4fa97fecd8f836ea867f)
2026-11-07 05:40:03 -08:00
Anees Iqbal 25b6686318 Regenerate CONFORMANCE-COVERAGE.md for the host-scoped lavapipe rows
bc3e17852b split five ledger rows by host (2619 to 2625 rows), which
conformance_coverage::the_conformance_coverage_document_is_what_the_sources_derive
caught (potluck job m3-max-3361). Regenerated with
scripts/conformance-coverage/coverage.py.

(cherry picked from commit a348cf1f29cacd026d796a2ecadae48fc70c8384)
2026-11-07 05:40:03 -08:00
Anees Iqbal 85685b7941 Link a visible-function reference to a definition of another type by position
A pipeline refused a linked function whose definition's type differed from
the reference's (InvalidDescriptor(LinkedFunction { problem: Signature })).
Metal makes those pipelines and passes the arguments by position: MPS's
reduce_stitched declares float reductionStitched::write_fn([8 x i8], float,
float), and the stitcher defines write_fn as float([8 x i8], float), which is
how Geekbench's Background Blur and Face Tracking failed on the consumer.

What Metal does was measured with the probe linked_function_signatures.m
(m3-max-3238, M3 Max, macOS 27.0.1) and the consumer's probes (m3-max-3228,
Radeon Pro 5300M and UHD 630, macOS 26.7.1): every pipeline is made; an
extra trailing argument is dropped (5 on all three); a missing trailing
parameter reads 0 (all three); a same-width plain value is reinterpreted
bit for bit, arguments and results alike (all three); another width is
undefined on the M3 and the 630 and the low bits on the 5300M; a pointer for
a value, a value for a pointer, another address space and an aggregate of
another type are undefined on the M3.

Now a stub whose type differs from its definition's resolves to an adapter
(canon/adapt.rs): an internal function of the stub's type that calls the
definition with the arguments by position, which inlining takes. Dropped
trailing arguments, zero for missing parameters, bitcast at one width, low
bits or zero-filled bits at another (scalars and vectors of int and float, a
bool as one bit, widths up to 64 bits), the result likewise, zero from a void
definition, dropped by a void reference. Anything else (pointer/value,
address space, aggregate of another type, vararg, isomorphic structs of other
identity) is Unsupported(Linking, not implemented) at a surviving call, where
it was an InvalidRequest that claimed Metal refuses it. Stub::Resolved keeps
the definition (the linked function, for the call-stack model) apart from the
function its calls call. The import pairs the definition's type with the
reference's by position, so a definition of another arity still takes the
reference's identified structs.

LinkProblem::Signature had no producer left and is removed (a public
variant of metal2vulkan-air, re-exported by metal2vulkan; api_signatures.tsv
re-blessed). SEMANTICS_VERSION 1976 -> 1977: refused inputs now translate.
docs/API.md section 3 states the contract and section 10 the choices where
Metal's answer is undefined and the refused shapes; REFUSALS.md regenerated
(unchanged).

Tests: link_tests (extra arguments, missing parameters, one-width bits,
other widths, void results, the refused shapes), engine_linking's renamed
linked_scale now links and computes, error/tests maps another LinkProblem.

(cherry picked from commit 493bc2dabe979e2280aea2d3fcbf5d17e2446f28)
2026-11-07 05:19:22 -08:00
Anees Iqbal bc13149480 HostRam tests: fresh RAM a device imports; shared RAM a device refuses imports no chunk
On RADV (a Radeon 780M, Mesa 26.2.6) 8 of the 19 host_ram_device tests failed every run: every
test over fresh_ram, a memfd mapped shared as QEMU's memory-backend-memfd,share=on RAM is. RADV
imports a pointer through amdgpu's userptr, which takes private anonymous pages alone, so it
refuses those pages (Device::imports_shared_host_pointers answers false there): the device's
thread imported no chunk ("one chunk from the RAM's start", left 0), and a no-copy buffer over
the RAM was refused, Unsupported(HostMemory, NotRepresentable) (diagnosed on homelab-um870-1,
potluck jobs m3-max-2986, 3083 and 3119). The runtime's answer is the right one with no dma-buf
source; the tests asked RADV for RAM it cannot import.

fresh_ram now takes the device and maps the memory it imports: the memfd mapped shared where
imports_shared_host_pointers answers true (NVIDIA, lavapipe, MoltenVK), else private anonymous
memory, as QEMU's memory-backend-ram RAM is, both never touched and advised for huge pages.
ahead_device asks the probe once up front, so no test's counts or allocation limit meet its
one-page import. A new test pins the no-source case where the device refuses shared pointers:
a_ram_of_shared_memory_a_device_refuses_imports_no_chunk_and_refuses_its_objects makes the
memfd RAM, uses it, and expects the buffer over it refused (Unsupported, HostMemory), no chunk
imported or live, and the RAM's keep-alive dropped after the use; elsewhere it says so and
passes. use_host_ram's docs and HOWTO state that no-source case.

(cherry picked from commit 48202da5ba0c0cb7f49d0a630e59efd11c5918f7)
2026-11-07 05:09:36 -08:00
Anees Iqbal 99c195f869 Conformance ledger: lavapipe's held read-write rows follow the heap's alias views
f4c1fbd170 lets the heap view a held RGBA8Unorm_sRGB, BGRA8Unorm_sRGB or
BGR10A2Unorm read-write texture through its storage alias. On lavapipe
(CachyOS, LLVM 23.1.4, 256 bits, job m3-max-3206 on homelab-gem10-1)
read-write-tier-held's three `beyond` rows now dispatch, and their
read-back, status, stored and stored-bytes sites are exact; only texels
differ, by the device's own answers:

- BGR10A2Unorm: 10 elements one f32 ulp low (Metal 0x3E48320D, ours
  0x3E48320C), the device's reciprocal product, device-texel-conversion,
  as the slot path's row of read-write-tier-round-trip-float says;
- the two sRGB formats: 219 elements, the largest difference 64921 bits,
  the MSL transfer through the device's Pow where Metal takes its
  twelve-bit table (Metal 0x3BB80B81 = 23/4095, ours 0x3BB7AD6D, the
  transfer of code 17), srgb-texel-decode, which the runtime announced for
  the case in that run, as did device-pack-conversion.

So the 18 refused and only-Metal llvmpipe rows go and three native-answer
rows take their place, and norm-storage-fields-bgr10a2unorm's llvmpipe
refusal at case/hsw_held/dispatch (the same heap write, refused the same
way) goes: that site now dispatches. The NVIDIA rows wait for a 5080 run.

The engine_heap_binder table test now allows FLAG_RED_BLUE and checks it
is set on the BGRA8Unorm member alone (it failed at f4c1fbd170: "other
flags are reserved", left 4). read-write-tier-held's allowance comment
says when unnamed-texture-unviewable fires now. CONFORMANCE-COVERAGE.md
regenerated.

Verified at f4c1fbd170 (the binary of this commit differs only in the
ledger and that test): 317 of 318 selected metal2vulkan tests passed, the
one failure the table test fixed here; the replay's unlisted and stale
sites for these rows are the ones this commit lists and removes.

(cherry picked from commit 3e5ef48250375a08ec2f9eadccae7a83481add6b)
2026-11-07 04:56:07 -08:00
Anees Iqbal 3d5bb02ba0 Hold sRGB and blue-first read-write textures in an argument buffer
Metal reads and writes an RGBA8Unorm_sRGB, BGRA8Unorm_sRGB or
BGR10A2Unorm texture through access::read_write, and through an argument
buffer too (read-write-tier-held's `beyond` rows). The heap binder
refused such a member's storage element, NotImplemented
(ArgumentBufferTextures), wherever its storage choice was an alias:
lavapipe and NVIDIA store no 8-bit sRGB format and no A2R10G10B10, so
the dispatch's bind state was refused there, where a slot of the same
texture converts in the shader through the alias.

The heap now does what the slot does, keyed by what the handle carries:

- bind::heap::storage_conversions(profile) lists, per texel class index
  and red-blue order, the formats whose heap storage choice is an alias a
  function converts by (SwizzleBgra, SrgbEncode, SrgbEncodeBgra), one
  class per key; a key whose formats choose otherwise converts nothing.
  The binder views a member of such a choice through its alias (which its
  image lists among its view formats) instead of refusing it; another
  alias (RGB9E5Float's word, ARGB8's rotation, an RGBX format) and a
  swizzle that loses the class are still refused.
- A blue-first format shares its texel class with its red-first kin
  (BGR10A2Unorm with RGB10A2Unorm), so the handle-table entry gains
  FLAG_RED_BLUE (bit 2, metal::format::red_blue_exchanged: BGRA8Unorm,
  BGRA8Unorm_sRGB, BGR10A2Unorm), carried in handle bit 30 by a new
  Lookup::Flagged field where a module converts.
- lower::texture::heap_storage_conversions gives a heap storage read or
  write of a float or half texel the same list; emit::heap_converted
  exchanges red and blue and decodes or encodes the sRGB codes where the
  handle's key is listed, as from_image and to_image do for the slot
  classes. A read's decode notes SrgbTexelDecode and a write's encode
  DevicePackConversion, the slot's notes (rule 1: the device's own
  transfer), recorded outright as other heap accesses' are. On the M3
  Max's MoltenVK, which stores each of these formats itself, the list is
  empty: no conversion, no new note.

Tests: the binder's storage-member test now expects the aliased view
(lavapipe's three formats) and a refusal for the rest; a new test pins
lavapipe's and the M3's conversion lists; metal::format's new test ties
red_blue_exchanged to every committed profile's red-blue choices; the
search's host model and masks cover the new carried bit; an engine test
checks the notes and the carried bit on lavapipe and their absence on the
M3. SEMANTICS_VERSION 1978. docs/API.md's two note entries name the
argument-buffer form.

Verification: Linux unit tests and lavapipe and 5080 replays of
read-write-tier-held follow this commit (sent with the tip).

(cherry picked from commit f4c1fbd1702877f44060593d006dc3372838a112)
2026-11-07 04:56:07 -08:00
Anees Iqbal e9b236a978 Pull a FloatRGB9E5 vertex attribute on every device
Lavapipe reports VERTEX_BUFFER for E5B9G9R9_UFLOAT_PACK32, so a
FloatRGB9E5 attribute went to fixed-function input there, and lavapipe
answered 0 in the fourth component (Metal and Vulkan both say 1) and
other values in the first three: vertex-format-float4 and -half4
differed in 32 (LLVM 21.1.8) or 38 (LLVM 23.1) elements by up to 65409,
and vertex-format-instance-step in its 12 fourth components.

The decision is now structural, made from the format, not the driver:
fetch_as pulls the shared-exponent format on every profile
(fixed_function_format). Vulkan requires no device to fetch it as vertex
input (Table 95, "Mandatory Format Support: 64-bit/uneven Components",
lists only sampled-image features for it), and its decode has no rounding
to leave to the device: each component m * 2^(e - 24) is an f32 and the
fourth is 1. So the module's own decode (lower::stage_io::fetch) gives
the answer a conformant fixed-function fetch gives, and lavapipe gives it
too. FloatRG11B10, the other packed float, stays fixed function: its NaN
widening is the device's.

The vertex-format sweeps now compile two modules where they compiled one
(the pulled format's), and the engine tests say so. SEMANTICS_VERSION
1977: a FloatRGB9E5 attribute's projection and module change. The three
RGB9E5 rows of known-gaps.tsv go (vertex-format-float4 and -half4 on
LLVM 21.1.8, -instance-step on llvmpipe); the LLVM 23.1 pair went in
613a98e22d. docs/API.md's vertex_input entry says it.

Verification: in the commit after this (Linux unit tests, lavapipe
replays on CachyOS LLVM 23.1.4, LLVM 23.1.1 and Ubuntu LLVM 21.1.8, the
5080 and the M3 Max).

(cherry picked from commit 6f2a6f3572b130db513bf457a9daf365ea241951)
2026-11-07 04:56:07 -08:00
Anees Iqbal 8623866704 Conformance ledger: unlist two product bugs this stream's rows recorded
A ledger row is right only where the divergence is the device's native answer (owner, 11-07:
"If its a failure, fix it. Dont sweep it under the rug"). Two sets of rows this stream wrote
record product bugs instead, so they go, and the bugs go back to the orchestrator:

- read-write-tier-held on the RTX 5080 (18 rows): we refuse the dispatch's bind state,
  `Unsupported(ArgumentBufferTextures, NotImplemented)`, for a read-write texture of a `beyond`
  format (`RGBA8Unorm_sRGB`, `BGRA8Unorm_sRGB`, `BGR10A2Unorm`) held in an argument buffer, which
  Metal round-trips. Runtime and translator work (a held read-write texture whose format the heap
  array cannot view).
- vertex-format-float4 and -half4's `FloatRGB9E5` attribute on lavapipe LLVM 23.1 (2 rows): the
  format reaches fixed-function vertex input as `E5B9G9R9_UFLOAT_PACK32`, and lavapipe answers 0
  for the missing fourth component (Metal 1.0) and decodes other elements wrongly; translator work
  (pull the fetch, or fill the component after the load).

The sites read as unlisted on those venues until the bugs are fixed. The same bugs' older rows
(lavapipe's read-write-tier-held, the "llvmpipe" and "LLVM 21.1.8" RGB9E5 rows) were not this
stream's and are handed back with them rather than removed here.

Verified: only those 20 rows are removed; docs/CONFORMANCE-COVERAGE.md regenerated.
(cherry picked from commit 613a98e22de81f35fb926228fc4534ddcd7e848b)
2026-11-07 04:56:07 -08:00
Anees Iqbal 25a0afe356 Conformance: rgb10a2-srgb's sample cases declare the decoded-tap filter's note
rgb10a2-srgb-samples-{nearest,linear}-{f,h} sample `RGB10A2Unorm_sRGB`, which no Vulkan format
holds, through a runtime sampler. The module does not know the slot's state, so it holds the
linear filter of the decoded taps whatever the slot's filter, and records that filter's sum as
the device's arithmetic (`lower::sampler::select`: a filtered access of a decoded form records
`PrecisionNote::BicubicFilterArithmetic` unless its sampler is a constant nearest one). Every
venue run announces `bicubic-filter-arithmetic` for the four cases (the M3 Max's ledger rows, the
RTX 5080 and both 256-bit lavapipe replays), and the cases declared it nowhere, so each read as an
undeclared notice: a test artifact. two_plane_samples declares the same note for the same reason.

The cases now declare it (a notice declaration: it loosens the notices site alone, so every
sample still compares exactly), and the M3 Max's four case/notices rows, which only restated it,
are removed. The module doc no longer says the cases carry no allowance.

docs/CONFORMANCE-COVERAGE.md regenerated: the ledger-row count goes from 2662 to 2658 and nothing
else moves, so the count development carries is the one its sources derive.

Verified by the replays that follow on the M3 Max (MoltenVK), lavapipe and the RTX 3090.

(cherry picked from commit ac79ff3f6a158bdb86a51b291c992436208005e5)
2026-11-07 04:56:06 -08:00
Anees Iqbal e1c3821e23 Announce DevicePointSize only at a draw that rasterizes points
What: `PrecisionNote::DevicePointSize` (a vertex function's `[[point_size]]`, or a mesh
function's `set_point_size`, on a device whose `pointSizeRange` ends below Metal's 511
pixels: ANV 255, lavapipe 256) was announced by `Device::degrade_stages` at the variant's
making and at every bind, whatever the draw's primitive. A point size sizes points alone:
Metal has no point fill mode, and Vulkan reads `PointSize` only where it rasterizes points,
so a triangle or line draw of such a state is Metal's exactly. reims's
`gpu::encode_render` many_passes tests on ANV (Iris Xe) draw only triangles through a
vertex function writing `psize [[point_size]] = 1.0`, and died in strict mode at
drawPrimitives on this false notice.

How: `degrade_stages` skips the note, as it skips `ArgumentPixelSamplerScaling`, and
`Device::degrade_point_size` announces it from a draw's settings
(`ShapeInputs::settings`, the place `UnsizedPoints` is announced, so an execution's
command announces it where the runtime records it) where the draw rasterizes points: a
`POINT_LIST` draw, or a mesh draw whose mesh function outputs points
(`GraphicsState::mesh_corners == Some(1)`), without rasterizer discard. The draw shape
memo keeps it as it keeps every settings notice (announced once, or at every draw on a
device that announces the kind at each occurrence, through `EachWatch`).

The conformance allowances that hid it are narrowed to the cases that draw points:
render-draw-forms declares `device-point-size` from its rows (points and empty draw
points; triangles and lines do not), with a module test that the declaration follows the
rows; sample-positions (triangles only) drops it; topology-class declares it for the
point-size function's point draws; primitive-type-crossings keeps it for its `Point`
cells, its comment saying so. The validation lane's `making_kinds` mirrors the runtime.
docs/API.md's catalogue entry says where it is announced.

Test: `tests::point_size_notices` draws a point-size state as triangles, lines, strips
and points on a device that announces the kind at every occurrence, and asserts the
creation and every non-point draw announce nothing and each point draw announces it once
where the device's largest point is below 511 (none where it is not).

(cherry picked from commit db5a2306aceeb4f9994002e68ff6b2ac3fea0813)
2026-11-07 04:26:25 -08:00
Anees Iqbal 0fe90ba3d4 Leave rgb10a2-srgb-samples' unclassified notice site unlisted off the M3 Max
rgb10a2-srgb-samples-{nearest,linear}-{f,h} announce `bicubic-filter-arithmetic`, which the
cases declare nowhere, on the RTX 5080 and both 256-bit lavapipe venues. The rows the two
earlier commits gave that site reused the M3 Max's text, which describes the format's value
conversions and says nothing of the notice; whether the cases should declare it or the note is
recorded wider than their accesses is not established, so the site stays unlisted there.

Verified: the 8 rows removed are the only rows of those cases' case/notices site outside the M3
Max; docs/CONFORMANCE-COVERAGE.md regenerated.

(cherry picked from commit e28a9842627a2b1c0291c488ec0e317cb17659ba)
2026-11-07 02:59:46 -08:00
Anees Iqbal 231972d92e Cite only the notes each venue's run announced in the new ledger rows
The fix2 replays print, for each failing row, the native notes its own run announced. Read
against them, 36 of the new rows cited a note the case did not announce on that venue:

- fetch-ordered-*-srgb on the RTX 5080 holds the attachment in the interlocked storage form, so
  its conversions are the module's (`device-pack-conversion`), not `srgb-texel-decode` and
  `device-color-conversion`; the row says so and leaves the per-write bound open;
- half-write-nans-*16f on the 5080 announces `native-nan-encoding`, not `device-nan-encoding`;
- integer-vertex-attributes cited `device-vertex-conversion`, which covers normalized fields only;
- vertex-format-half4's narrow-float NaN rows on the 5080 are `native-half-conversion` and
  `native-nan-encoding`;
- half-texel-nans-rg11b10f's rows on the 5080 and both 256-bit lavapipe venues cited
  `device-texel-conversion`, which none announced.

Verified: every note a 5080, LLVM 23.1.1 or LLVM 21.1.8 row cites that is one of
`replay::NATIVE_NOTES` is in that case's announced list in the venue's fix2 replay, but the
xr-gamut and xr-masked rows, which name each of the two blend-source notes for its own fill kind.

(cherry picked from commit 1f14597553913a62fbbce2c462577b25b0fd2a03)
2026-11-07 02:59:40 -08:00
Anees Iqbal a988acb096 Hand a mipmapped sampler a minLod past every last level, not FLT_MAX
Metal's lodMinClamp of FLT_MAX reads a texture's last level. The translator handed it to the
device as minLod itself, and lavapipe on x86-64 (CI's Ubuntu 26.04 Mesa 26.0.8 and msi's 26.2.4,
both 256 bits) reads that sampler at level 0: sampler-mip-nearest and sampler-mip-linear's
clamp-float-max sites answer 1.0 (level 0) where Metal answers 2001 (level 2), 16 elements each.

Vulkan clamps the level into [minLod, maxLod] and then to the view's last level, so every bound at
or past LAST_WORD_LEVEL (15, past every Metal texture's last level, 14) reads the same level. A
mipmapped sampler's minLod is now its lodMinClamp clamped into [0, 15] (`mipmapped_min_lod`); a
bound up to 15 is handed as before, and maxLod stays the descriptor's (never below minLod).
Nothing keys on a device: the bound is exact on every one.

SEMANTICS_VERSION 1973 -> 1974: a sampler descriptor's minLod changes for lodMinClamp above 15.
docs/API.md's device-sampling entry says the bound is handed as 15.

metal/sampler.rs is one of the runtime-sources pin's inputs, so the pin moves with this commit
(RUNTIME_VERSION and the pin are left to the landing).

Verified: `a_mipmapped_samplers_min_lod_is_held_past_every_last_level` fails without the change
(minLod f32::MAX, not 15) and checks every view of 1 to 15 levels reads Metal's clamped level under
the handed bounds; the venue replay is the lavapipe evidence.

Landed with SEMANTICS_VERSION 1976: the branch took 1974, which stack 37 and the heap YCbCr notes
(1975) had already taken.

(cherry picked from commit bdb7efa414f579579e73c33d8f82fd7b312a61c6)
2026-11-07 02:59:40 -08:00
Anees Iqbal b739f0a49a Scope the lavapipe ledger rows by LLVM and vector width
The generic "llvmpipe" rows were measured on the arm64 container's lavapipe (LLVM 21.1.8, 128
bits). CI's Ubuntu 26.04 lavapipe (amd64, LLVM 21.1.8, 256 bits) and msi's (LLVM 23.1.1, 256 bits)
answer otherwise at 79 of their sites, and 253 sites no lavapipe row named:

- a row a 256-bit venue no longer holds is re-scoped to the venues it does hold ("128 bits",
  "LLVM 21.1.8"), and each 256-bit answer gets its own row ("256 bits" where both 256-bit venues
  answer alike, else per LLVM). A row whose text states no number the new answer moves keeps its
  text; the rest get texts from that venue's first differing element: the half NaN families (the
  quiet bit set and the payload kept at 256 bits, a sign and payload, LLVM 23.1.1 dropping the
  half round trip), norm-storage-codes (the 128-bit text plus the case's NaN of each sign, which
  the two sides store at opposite ends of the format; Vulkan leaves a NaN's conversion
  unspecified), 3D samples on LLVM 23.1.1, and the RGB9E5 attribute row's counts;
- the extended-range, padded 10-bit, sRGB 10-bit, xr blend and two-plane families reuse the M3
  Max's venue-neutral texts (mechanism only, no site numbers); xr-planes alpha gets a lavapipe
  ties-to-even text; pixel-samplers-subnormal a digest-only text;
- the 14 compressed-blits-rg11b10f and -rgb9e5f rows are removed: the accepted difference
  `a-device-answers-as-the-class-of-mac-it-presents` now justifies those sites on every venue
  without lossless compression (313abb4b47).

The two sampler-mip clamp-float-max sites get no row: the next commit fixes them.

Verified: every new row is generated from the fix2 census's own paste rows at 2776dd8f06 on each
256-bit venue (site, expects and answer verbatim); a prediction against those censuses leaves 2
sites unlisted (the sampler-mip ones) and no stale row on either venue. A replay at this tree on
both venues is what proves it. docs/CONFORMANCE-COVERAGE.md regenerated.

(cherry picked from commit a1dd53b33b5676b46fdc7654de060ccc8ab0d239)
2026-11-07 02:59:24 -08:00
Anees Iqbal f98735bbdb List the RTX 5080's native-arithmetic divergences in the conformance ledger
886 rows for "NVIDIA GeForce RTX 5080 Laptop GPU", each a site the whole-suite replay on the
5080 (NVIDIA 615.71.09, exact policy, at b982d02d53) reported as divergent or refused and the
ledger did not list, each with the class it was triaged into and the note that records it:

- device NaN encodings (half NaN 0x7FFF, float 0x7FFFFFFF, small-float all ones; gathers of NaNs
  and denormals) under device-nan-encoding, native-nan-encoding, native-half-conversion and
  device-texel-conversion, whose documentation already names this device's encodings;
- BC decode against compressed-texel-decode's NVIDIA bound (covered, or past the colour bound and
  named as open, or not established for an sRGB form's decoded value);
- packed 16-bit texels widened by bit replication (device-texel-conversion's 0.18-code bound);
- 8-bit unorm stores a code apart near a tie (fragment outputs, storage writes, fills, a2c
  targets) under device-color-conversion, which states the 5080 stores 0.5 as 0x7f; each
  norm-storage-codes texel holds one value in four channels, so the largest word difference
  bounds every channel at one code;
- attributes read as half keeping the float, NVIDIA folding the conversion pair
  (native-half-conversion, DriverWorkaround::HalfConversionPairFolded);
- the nearest mip level at a halfway clamp (device-sampling states the shape);
- filters, 3D samples, pixel samplers, downscales and resolves through the device's own units,
  whose bounds are measured on lavapipe and MoltenVK and not on this device: those rows say so
  and name the bound as open;
- read-write-tier-held's refusal, the same open runtime work lavapipe's rows name.

The 80 xr rows and 191 rows reusing venue-neutral texts of the M3 Max's rows are among them.
Sites that the accepted-difference slug fix and the two shared-memory declarations remove
(fresh-*, compressed-blits-*, xr-clear-routes-*, buffer-textures-stride-below-the-row,
format-footprints-plain-stragglers) get no row. ycbcr-gathers-* and ycbcr-minify-band-* (20
digest-only sites) stay unlisted: their class is not established, and the YCbCr notes are
another stream's work.

Verified: the rows are generated from the 5080 census's own paste rows (site, expects and answer
copied verbatim), each text from the site's first differing element in that run; a replay at
this commit on the 5080 is what proves they hold. docs/CONFORMANCE-COVERAGE.md regenerated.

(cherry picked from commit 0bf9ec15eac473fa19002a218ec2978f2e7a1f0f)
2026-11-07 02:59:12 -08:00
Anees Iqbal b37276fa4c Note a heap texture's YCbCr filter where its handles and sampler can reach one that filters
What. A filtered `half` or `float` sample of a texture an argument buffer holds (a heap's) now
records `PrecisionNote::HalfSampleFilter` / `FloatSampleFilter` on a device that samples through
Metal's own sampler (MoltenVK), as a slot's sample does, under clauses the plan answers at each
draw or dispatch:
- `SpecKey::HeapYCbCrTextures(stage)`: a heap member of the command reaching the stage (a texture
  it makes resident, or binds at a texture slot of the stage) is of a two-plane YCbCr class
  (`TexelFormat::two_plane_ycbcr`);
- through an argument buffer's sampler, `SpecKey::FilteringArgumentSampler`: a listed argument
  sampler (`BindShape::argument_samplers`, every live state) has a linear min, mag or mip filter,
  anisotropy or a cubic filter; through a runtime slot, the bound word (`filtering_word`); a
  constexpr sampler that reads one texel of one level records nothing.
Only a 2D, one-layer, color, single-sample heap sample can reach a two-plane texture, so 3D, array,
depth and multisample heap samples record nothing. The plan computes both keys in `record_noted`
(which now takes the heap's stage reach), so they are a function of the bind shape: the runtime's
bound-value memo, keyed by (variant, plan, specialization), stays valid. The runtime announces a
holding heap clause as `ycbcr-filter-not-exact` (`degrade_clauses`), naming the stage.

Why. A probe on the M3 Max (MoltenVK) showed a 4:4:4 two-plane texture (identity address-mode map:
`YCBCR8_444_2P`, `YCBCR10_444_2P`, their sRGB twins, the packed 10-bit one) held by an argument
buffer and sampled linearly through a constexpr, runtime-slot or argument-buffer sampler ran and
announced nothing, where Metal's own sampler filters the kept image's float texels, not Metal's
exact filter: an under-announcement. (4:2:0, 4:2:2 and the code-reading 4:4:4 textures reached
through handles are refused, `MappedTextureSampling { through: Handles }`; a slot texture sampled
through an argument buffer's sampler is refused at translation, `ArgumentBufferTextures`.) Which
sampler state an argument buffer holds is in its memory, which no plan reads (the binder's rule:
argument samplers come from object lifetimes), so the argument-sampler test is "a live state
filters": a program whose live states are all nearest announces nothing.

SEMANTICS_VERSION 1973 -> 1974 (precision notes change for heap samples on metal-sampler
profiles); ARTIFACT_FORMAT_VERSION 489 -> 490 (two `SpecKey` variants in the codec). The golden
table does not move (no SPIR-V changes). `api_signatures.tsv` gains the two variants.
heap_linear_samples_are_the_device_s now expects the specialized note on MoltenVK 2D samples.

Verified (potluck):
- M3 Max, MoltenVK, GPU (job m3-max-2786): 64/64 lane tests (ycbcr_textures, ycbcr_in_place,
  degrade_notices, pixel_samplers, ycbcr_device_reads, argument_linear_samples), the new
  a_ycbcr_texture_through_an_argument_buffer_announces_its_filter_only_where_it_can_filter
  printing, for YCBCR8_444_2P and YCBCR10_444_2P_sRGB: constexpr linear 1, runtime nearest 0,
  runtime linear 1, argument nearest 0, argument linear 1, argument nearest with a linear state
  alive 1; RGBA16Float 0 in every case.
- lavapipe (msi, llvmpipe LLVM 23.1.1; job m3-max-2775): the same 64/64; announced only where
  the device converted the 8-bit 4:4:4 texture itself.
- M3 unit tests (jobs m3-max-2767, m3-max-2774): the new
  tests::engine_heap_binder::a_heap_texture_s_ycbcr_filter_note_holds_where_its_sampler_can_filter
  and 134 more (engine_heap_binder, engine_ycbcr_in_place, engine_handles, golden_hashes, cache),
  api_signatures/api_surface/refusal_surface 19/19, runtime tests::degradation 17/17; clippy
  plain, --cfg m2v_gpu, --cfg m2v_cpu_icd and rustdoc -D warnings clean.
- Negative controls, both failing: no heap note (the unit test, and the lane's constexpr linear
  case announcing nothing on the M3); a plan answering 1 for both keys (the unit test at
  "YCBCR84442P beside none", the lane's argument nearest case announcing on the M3).
- Release CLI on moltenvk-m3, tip against 80d2dc465f, 3 runs: tail_argument_samplers
  argument_sampler_sample 0.02 s / 25.1 MB both; handles argument_buffer_runtime_sampler 0.02 s /
  25.6 MB both; grd_half_many_samples 0.05 s / 25.9 MB both.

(cherry picked from commit 8403d3746182d6c1acf7795666fc46fea811e660)
2026-11-07 02:57:47 -08:00
Anees Iqbal ffbfb8631d Bump SEMANTICS_VERSION to 1974 and regenerate the conformance coverage at stack 37's picks
Three picked branches each moved SEMANTICS_VERSION from 1972 to 1973 on their own: runtime sampler
slots' filter notes now carry a test of the bound sampler word; an object function's barriers
are predicated so a partial object threadgroup runs as Metal's; and extended-range partial masks
and unwritten padded or bfloat attachments link. Together their outputs differ from any one
branch's at 1973, so the version moves once more. docs/CONFORMANCE-COVERAGE.md is regenerated
from the merged sources and recordings (the picks' conflicts kept the earlier text).

Verified: conformance-coverage --check, signatures.py --check and refusal_surface.py --check pass
on this tree; metal-coverage is current.
2026-11-05 21:15:23 -08:00
Anees Iqbal c3cbf1e76b Conformance: the RTX 5080's XR rows at the multisampled shadow; lavapipe's BGR10_XR masks merge
The RTX 5080 (b5080 entry xr2-replay-xr, every xr-* case at b026d47db4) now matches the M3's
four-sample gamut counts (226/295 elements, one code; sRGB 547/548, up to four codes), where the
ledger had 542/543 and 610/622 from before the per-sample shadow: those ten rows take the M3's
counts and text. New rows for the 5080: the eight gradient cases (blended 134/142/109/145
elements, one code; unblended 39/44 and sRGB 56/86, the same counts as lavapipe's, the device's
float arithmetic of the gradient), the BGR10_XR masks (the M3's counts: 37, 41, 9, 14) and the
padded sRGB fill (92). The 5080's other unlisted xr-* divergences (blend, clears, clear-routes,
draw, planes, two-plane samples, two-planes) are in cases this branch does not touch; they are
left out here.

lavapipe at 36239bb3ab (msi's LLVM 23.1.1 and Ubuntu 26.04's Mesa with LLVM 21.1.8, the CI
image's): the four BGR10_XR partial-mask cases no longer refuse. Their texels match Metal's
(linear) or sit one code off (sRGB: 14 and 9 elements, the M3's counts), but the runtime announces
extended-range-blends-stored-codes at the merging draw: it reads the color over an input attachment,
where no half shadow is held, and the pipeline's state does not tell a read that only keeps codes
from the function's own fetch. The ledger records that as our gap (case/notices rows), and the
notice's documentation (degradation.rs, API.md) says it fires there. A base build (cbc30cb2c5) on
msi's lavapipe shows the same 99 older unlisted xr-* divergences as the tip, none new.

Also: `BGR10_XR_sRGB` spelled whole in the masked rows, and the llvmpipe four-sample rows' open
gap narrowed to the shadow over an input attachment. CONFORMANCE-COVERAGE regenerated.

(cherry picked from commit b982d02d53bf879382f09638a7c8c780fce89af9)
2026-11-05 21:13:40 -08:00
Anees Iqbal c559ed6f84 Docs: the half shadow holds at more than one sample; REFUSALS for the merge's refusals
The extended-range-blends-stored-codes notice (its declaration and the
docs/API.md catalogue entry) now says where it is not announced: a color
whose half shadow the runtime holds, in a pass of one layer on a device that
orders fetch through the pixel interlock alone, at one sample or more, from
the pass's clear or (at one sample) its load; and where the codes stay:
over lavapipe's input attachments, in a multisampled pass that loads the
color, and after a draw the shadow cannot follow. docs/FAST-PATHS.md's word
attachment row no longer says an extended-range color keeps its codes at
more than one sample. docs/REFUSALS.md regenerated
(scripts/refusal-surface/refusal_surface.py): link's second
extended_write_mask site and fetch::unordered_extended_fetch.

How verified: refusal_surface.py wrote the table with 0 variants without a
reach mark or a basis; the catalogue test runs with the runtime suite next.

(cherry picked from commit 70691da1d131573dac3a3c4ae4e6436ad48283f3)
2026-11-05 21:13:17 -08:00
Anees Iqbal e10552b553 Re-record the mesh limits cases on the M3 Max, time every new case, regenerate the coverage document
What: the 17 mesh-limits cases' Metal answers and M3 cost bounds over the
trimmed fixture, the timings of all 34 new and re-recorded cases (times
--write, both legs; the host's load was above the gate's 26, so the
verdict is to be re-read on a quieter host), docs/CONFORMANCE-COVERAGE.md
(MTLMeshRenderPipelineDescriptor 27 of 27 items compared, the
MTLRenderPipelineState getters 18 of 22), and the golden and inventory
rows of the trimmed fixture.
Why: the fixture's AIR changed; the suite's own tests ask each case for
its cost and timing records.
Verified: M3 jobs m3-max-2732 (bless, 155 touched translator tests pass)
and m3-max-2737: replay on MoltenVK of the 34 cases, 29 exact, 4
announced (the partial-barrier draws' emulation notices), 1 refused as
known-gaps.tsv expects (mesh-limits-amplification-2), exit 0; the
conformance crate's 1023 tests pass.

(cherry picked from commit d8031c15692c56abc40b3c6fc80579091bbfb680)
2026-11-05 21:13:16 -08:00
Anees Iqbal 7c6b61b76d Leave the mesh limits whose Metal answers follow compiler history out of the cases; ledger the amplification refusal
What: the mesh-limits family drops its 16 rows of a required threadgroup
size or a function's own thread maximum, the fixture its two functions of
one, and MeshLimitsSpec its required sizes. mesh_pipeline_limits.m and
docs/API.md (accepted differences) record why: on the M3 Max each such
answer changes with what the compiler compiled before (a first compile
refuses a required size of 32 under a maximum of 64 in either stage and
makes it after a compile under 64; a first compile of a function of
max_total_threads_per_threadgroup(64) answered 32), so the recorded
mesh-limits-required-mesh-32-max-64 made where the probe and a first
compile refuse. known-gaps.tsv lists mesh-limits-amplification-2's
refusal on every venue.
Why: a recording of those rows holds the compiler's history, not an
answer; the amplification refusal is an open gap.
Verified: fresh-source creations on the M3 Max (jobs m3-max-2717 and
m3-max-2725); the family re-records in the next job.

(cherry picked from commit 187f1b12c0b8282a0dcf1e43ab530123ccf1d2fa)
2026-11-05 21:13:15 -08:00
Anees Iqbal 0f289cdac4 Commit the regenerated fixture companions, and record how Metal runs an amplified mesh draw
What: the .ll and .air.ll companions of mesh_partial_barrier,
compute_thread_limit and mesh_pipeline_limits, and their TOOLCHAIN lines
(regen-air-fixtures on the M3 Max, job m3-max-2677). probes/
mesh_amplification.m records its answers: under an amplification count of
2 the object function runs once (8 threads) and the mesh threadgroups it
launches run once per amplification (16 threads, ids 0 and 1, a count of
2), each into its view mapping's slice. FAST-PATHS.md's known gap for a
mesh pipeline's amplification says what an exact form must do and why
neither built draw form is one.
Why: the tests and cases read the fixtures; the gap stays open with the
measured semantics written down.
Verified: the probe ran on the M3 Max (job m3-max-2677).

(cherry picked from commit bb5a45dd26d89d5af72e755ad4ac976975007d8b)
2026-11-05 21:13:15 -08:00
Anees Iqbal b43ba48ee2 Regenerate the signature table and REFUSALS.md
What: api_signatures.tsv gains ComputePipelineProblem, its two variants and
DescriptorError::ComputePipeline; REFUSALS.md's RequiredThreads row says
only what creation refuses.
Why: the new public refusal and the corrected problem doc.
Verified: signatures.py --bless and refusal_surface.py on msi (job
m3-max-2689).

(cherry picked from commit 301047b4dc4f5f4f3a4d1725c9966e152f5b4fb0)
2026-11-05 21:13:15 -08:00
Anees Iqbal 9609083aa2 Walk object and mesh functions predicated at their barriers, and partial object threadgroups from their threads
What: the divergent-barrier pass (lower::simd::divergent::barriers) now covers
object and mesh functions as it covers kernels: a workgroup barrier in a block
Uniformity does not prove uniform makes the body walk predicated, so every
invocation reaches it. Every object function now runs a drawMeshThreads
partial object threadgroup (lower::mesh::plan_partial_groups no longer
excludes a body with a barrier; RuntimeFact::PartialObjectThreadgroups). One
whose body holds any workgroup barrier is walked predicated
(Predication::partial_groups) from live = KernelDecl::live, the invocation
being one of its threadgroup's threads (dispatch::emit_entry computes it in
the entry block and hands it to the walk through
CodeEmitter::entry_live/EmitCx::entry_live), so the invocations past a
partial threadgroup's threads reach every barrier, and loop vote, as
invocations that returned at entry, and run no other instruction of the body:
no load, store or atomic of theirs is made. A body without a barrier keeps its
early return. The vote word an object function's walk takes counts in its
ObjectThreadgroupArena fact, which the binder checks with the encoder's
lengths; where the word does not fit and the barriers are uniform, the
function runs no partial threadgroup (the binder refuses such a draw as
before).

Why: an object function with a threadgroup barrier on a partial object
threadgroup was refused (NotImplemented(MeshShading), a FAST-PATHS known gap),
which kept the Metal3 mesh shading row false on every device; and an object
or mesh function's barrier after a divergent early return or under a
thread-dependent condition stood in non-uniform control flow, which Vulkan
leaves undefined (an Intel GPU hangs on it).

Docs: FAST-PATHS' known gap is gone; render/mesh.rs, bind/graphics.rs and the
fact's docs say what runs. The Metal3 mesh feature rows
(families/features.rs) lose their not_implemented(MeshShading), and the
families test now expects the mesh shading row exact where the device runs
the stages natively or as compute work.

Tests: engine_mesh_barriers (new, over the owned fixture
mesh_partial_barrier): every object function and the divergent mesh function
predicated on every committed profile, their bodies' barriers all uniform by
spirv::testing::barriers::workgroup_barriers_of (new: the check of a called
body); partial draws instantiate; and the interpreter runs each emulated
object function's partial and whole draws under BarrierRule::Vulkan giving
the predicated reading. The old
a_partial_object_threadgroup_of_a_body_with_a_barrier_is_not_implemented is
replaced by a_partial_object_threadgroup_of_a_body_with_a_barrier_draws.
SEMANTICS_VERSION 1973. Verification in the following commits' potluck runs.

(cherry picked from commit 65660d13d001484e444c0f89b268f92b847976b1)
2026-11-05 21:13:13 -08:00
Anees Iqbal 8f2f973478 Announce a runtime sampler slot's YCbCr filter note only where the bound sampler filters
What: a filtered sample's note of a two-plane YCbCr format through Metal's own sampler
(`PrecisionNote::HalfSampleFilter`, `FloatSampleFilter`, announced `ycbcr-filter-not-exact`)
through a runtime sampler slot now holds only where the word of the sampler bound there filters.
`lower::sampler::linear::filter_note` crosses the bound-format clauses with two tests of the bound
word (`NoteOn::BoundSampler`, `SpecKey::BoundSamplerWord`, which the plan already records for
noted keys): a linear min or mag filter, anisotropy or a cubic filter (any of those bits), or a
linear mip filter, the constexpr rule `linear::unfiltered` read from the word. A constexpr
sampler keeps its rule; an argument buffer's sampler, whose word no slot test reads, keeps the
format-only clauses.

Runtime: such a clause tests a bound value, so `Device::degrade_bound_values` reads it at each
draw or dispatch. It now also answers `SpecKey::BoundTexelFormat` from the command's formats (the
class `bound_texel_format` gives; a slot bound to nothing fails the clause, as
`degrade_bound_formats` reads it; unknown formats hold), checks a filter note's kind as
`ycbcr-filter-not-exact` (one atomic load once announced), and `degrade_clauses` announces a
filter note's slot of unknown format (an execution of GPU-written commands) as that kind, naming
"a format the GPU's commands bind", as `degrade_bound_formats` does. Which clauses hold stays a
function of the plan (the shape it is planned for holds each bound format and sampler word), so
render.rs's `QuietBoundValues` holds.

Why: a runtime sampler slot announced the note whatever its sampler state, so a nearest runtime
sampler on a texture that keeps its image (a 4:2:2 or 4:4:4 one on the M3) announced it though
a nearest sample reads the one texel the view holds, Metal's read; the consumer runs notes fatal
on Apple GPUs.

Validation: `run_kinds` (degrade_notices) evaluates the bound formats through the same closure,
and `bound_value_kinds` maps a filter note to `ycbcr-filter-not-exact`.

Tests: `tests::engine_ycbcr_in_place::a_runtime_sampler_s_filter_note_holds_only_where_the_bound_word_filters`
(clauses on moltenvk-m3 hold for linear min, mag, mip and anisotropic words over YCbCr formats,
not for nearest words or other formats; lavapipe records none) and the lane test
`runtime_lane::ycbcr_textures::a_runtime_sampler_announces_the_ycbcr_filter_only_where_it_filters`.

Docs: the notes' rustdoc, `YCbCrFilterNotExact`, docs/API.md's two entries.
SEMANTICS_VERSION 1973: the artifact's specialized notes change (no SPIR-V changes).

Verified: cargo fmt; builds and runs follow.
(cherry picked from commit d464b1d36f998cd8c69a9f2c9252288df64d13d9)
2026-11-05 21:13:11 -08:00
Anees Iqbal efe9581bcf Map maxArgumentBufferSamplerCount in the porting guide
What: docs/RUNTIME-PORTING.md gets a table for the consumer's IdentityCaps
(MTLDevice identity and size answers) with one row:
sizes.max_argument_buffer_sampler_count, Metal's
maxArgumentBufferSamplerCount, maps to
DeviceProperties::max_argument_buffer_sampler_count. The row gives the
derivation (one fewer than the smaller of a set-1 sampler array's elements,
pipeline::heap_sampler_capacity, and maxSamplerAllocationCount) and marks
it partial: 65535 on MoltenVK on an M3 Max, where Metal answers 500000.

Why: the samplercount work added the property without a row here, so a port
had no entry for the selector. The Item name is the consumer seam's field
(reims-vgpu-core platform/caps.rs, IdentitySizes, on its current branches).

Docs only. Checked against capabilities.rs (the field's rustdoc) and
docs/API.md's accepted differences, which give the same derivation and
values.

(cherry picked from commit 866e5ab81bfee7ebcc521975a7c277d00ac20378)
2026-11-05 21:13:10 -08:00
Anees Iqbal ee4a6c5b52 Bound texture ID placement by the handle table's reach
What: the runtime's set-1 image array capacity (resource_ids.rs
`texture_arrays`, which texture placements and texture reservations are
checked against) is now the least of the handle table's 65536 entries
(bind::HANDLE_TABLE_CAPACITY, within which link sizes every heap array) and
the update-after-bind image limits. Before, it was the limits alone. Each
array carries what bounds it (`ArrayBound`): a device limit, named in the
refusal as before, or the table. An ID past the table is refused
Unsupported(ArgumentBufferTextures, NotImplemented), since no heap array on
any device reaches it. `texture_arrays` and `check_capacity` are now free
functions over the compile profile, so a test reaches them without a device.

Why: this is the same gap `sampler_array` had before the samplercount work.
MoltenVK reports 1,000,000 update-after-bind sampled and storage images,
lavapipe 1,015,808, RADV 8388606, and ANV and NVIDIA more, so a texture
reservation between 65536 and those limits was accepted. Yet no set-1 array
holds such an ID: a texture placed there reads the neutral through its ID.
Placements are unaffected in practice, since Metal's placement limit (16381)
lies below the table's reach. Reservations of 65536 and more are now
refused where they were taken.

Tests: resource_ids::texture_arrays_reach_no_further_than_the_handle_table
checks every committed profile: each array is at most the reach, the ID
below its count is taken, and the ID at its count is refused naming its
bound. It pins MoltenVK, lavapipe, RADV, ANV and NVIDIA to the table and the
desktop baseline to its 128 sampled and 8 storage images a stage. Without
the fix, the pins fail (moltenvk-m3: 1000000). A new device test,
runtime_lane::resource_ids::a_texture_reservation_at_the_handle_table_s_reach_is_refused,
reserves texture ID 65536 (refused, not implemented, where the device's
limits reach past it) and 65535 (taken), printing a TEXTURE_RESERVATION
line. REFUSALS.md is regenerated (check_capacity, 2 sites). Verification
runs follow in the branch report.

(cherry picked from commit 9629f473e25790aa573b03d6c4419d99127f33ce)
2026-11-05 21:13:10 -08:00