Commit Graph
175 Commits
Author SHA1 Message Date
Anees Iqbal 0fcb724d2c CONFORMANCE-COVERAGE.md with the read_through family
Regenerated by scripts/conformance-coverage/coverage.py: 13 more recordings,
162 case modules, three ledger rows, and read_through among the families that
compare MTLSamplerState and the texture and buffer items it calls.

Verified: coverage.py --check reported the doc stale before and is the
generator's output now.

(cherry picked from commit b2b166a2d4b03ed957824bc8290b214d4c78c66b)
2026-11-10 01:30:11 -08:00
Anees Iqbal 733108b25d fresh_contents: the Depth32Float rows' zeroed-pattern declarations are held by the row test
The family's declaration test held every allowance to the notices site or
the fresh value declaration, so the two Depth32Float rows' unchecked fresh
site under fresh-pattern-zeroed (55df5fa64b) failed it. The test now names
that declaration, counts the texture row's three extra allowances and the
pattern row's two, and checks no other row carries it.
docs/CONFORMANCE-COVERAGE.md is regenerated
(python3 -I scripts/conformance-coverage/coverage.py): fresh_contents now
loosens one measured value.

Verified: both failed in the conformance suite on gem10 (job 10312); the
rerun follows.

(cherry picked from commit 184d622fa578658947c19dd19df29ff160a91b9b)
2026-11-08 18:15:24 -08:00
Anees Iqbal ee5d3cfab9 Regenerate the conformance coverage for lavapipe's linear texture alignment rows
d62b50b90e added 16 known-gaps rows for device-linear-texture-alignments (lavapipe's own
answer) without regenerating docs/CONFORMANCE-COVERAGE.md: ledger rows 3295 -> 3311 and the
case's rows listed. scripts/conformance-coverage/coverage.py, nothing else changed.
2026-11-07 21:10:16 -08:00
Anees Iqbal 803648acd8 Make a texture buffer over a buffer whose texels run past its length, those texels in a tail
What. Buffer::new_texture of a texture buffer whose texels run past
the buffer's length (inside Metal's allocation rule) is made instead
of returning NotImplemented(TexelsPastBufferLength), as a 2D texture
or array already is. Its texels inside the length are the buffer's
bytes; those past it lie in a tail of its own, a zeroed Shared buffer
the runtime owns, laid out from the functions' first byte (the offset
rounded down to 16, as Metal's kernels read a texture buffer).
- GPU: the texture buffer takes the staged form (StagedTextureBuffer,
  announced): its bindings view the tail as their staging buffer. The
  copy in takes the bytes inside the length from the buffer (none
  where the texels lie wholly past it), the copy back gives only those
  bytes back, and a Shared buffer's merge copies the current part from
  and to the buffer and the tail apart (staged_bytes, which now names
  a texture buffer's staging buffer as well as an image's, and
  record_out, which copies the staging buffer's every byte).
- CPU and blits: as for 2D, each row split at the length
  (Texels::past, whose rebase is now the tail's base, tail_base).
Only an IOSurface plane past its surface stays
NotImplemented(TexelsPastBufferLength); the gap's doc, its reach in
scripts/refusal-surface/reach.tsv, the StagedTextureBuffer catalogue
entry and docs/API.md's accepted difference say so.

Why. Plain Metal makes these: reims-vgpu's tbprobe on both x86 oracle
Macs (jobs m3-max-4019, 4046, 4152) and the M3 Max probe
(probes/texture_buffer_past_length.m, job m3-max-4617), whose paths
read and write the bytes past the length as one memory, as a 2D
texture's. The tail gives the 20000-byte buffer's answer for every
shape, as the 2D tail does.

Tests.
- tests/buffer_tail_device.rs: a texture buffer of 64 R32Uint texels
  from 3968 of a 4096-byte buffer (32 past) and from 4096 (all past):
  as made, after a kernel's write across the length (ob1_texel_buffer)
  and after replace_region past it, a kernel, get_bytes and a blit
  read alike; the buffer's words inside the length are written, every
  other word and 16 buffers around it keep theirs.
- linear_plan unit rows: texture buffers past the length made.
- runtime_lane::buffer_textures: the texture buffer at 3968 is made.
- Conformance: buffer-tails-texture-buffer, 1024 R32Uint texels from
  16384 of a 20000-byte buffer (904 inside): ob1_texel_buffer reads
  and writes, getBytes, replaceRegion, blits from and into it, the
  buffer's bytes; recorded on the M3 Max (3 runs, one outcome, every
  site the model's answer).

Verified:
- M3 Max, macOS 27.0.1: the probe (m3-max-4617) and the recording
  (m3-max-4640): buffer-tails-texture-buffer is made, announcing only
  the staged-texture-buffer notice, and the 2D tail cases still are.
- gem10 (m3-max-4635): clippy of the runtime (all targets, all
  features) and of runtime and validation under --cfg m2v_cpu_icd;
  the runtime's unit tests (70 of 70); the runtime lane on lavapipe
  (172 of 172, the new texture-buffer test among them); the
  buffer_textures, texel_swizzles and degrade_notices validation lanes
  (27 of 27).
- gem10 (m3-max-4662): rustdoc of runtime and conformance; the
  conformance unit tests over the tails, refusal, catalogue and
  accepted-difference rows (20 of 20); a lavapipe replay of the six
  buffer-texture cases, all six announced as the ledger expects.
  Clippy there named the shape test's two constant assertions, now
  const blocks; clippy of runtime and conformance and those unit
  tests again on this tree: m3-max-4688.
- Negative control (m3-max-4662): the runtime's sources at 5020e74ebb
  with these tests and cases fail the new device test with
  NotImplemented(TexelsPastBufferLength), and the replay refuses
  buffer-tails-texture-buffer at case/texture.

(cherry picked from commit f0a3390160064eabb820fbdc4f83822e0492fb5f)
2026-11-07 11:19:37 -08:00
Anees Iqbal 9ee7323e76 Make a 2D texture over a buffer whose texels run past its length, those texels in a tail
What. Buffer::new_texture and new_linear_texture of a 2D texture or a
2D array whose texels run past the buffer's length (inside Metal's
allocation rule, past which Metal answers nil and so does the plan)
are made instead of returning NotImplemented(TexelsPastBufferLength).
The texels inside the length are the buffer's bytes, exactly as
before; those past it lie in a tail of the texture's own: a zeroed
Shared buffer the runtime owns (Texels::tail), laid out from the
texels' first byte, and no other allocation's memory.
- GPU: such a texture is kept as a shadow image (ShadowedTexture is
  announced). The tail is the shadow's staging buffer; its copy in
  takes the bytes inside the length from the buffer, its copy back
  (staging rows clipped by inside_rows) writes only those bytes back
  to the buffer, and a Shared buffer's merge copies the current part
  from and to the buffer and the tail apart (shadow_merge.rs).
- CPU: getBytes and replaceRegion split each row at the length
  (past_runs, write_past).
- Blits: copies that name the texture's bytes split their rows at
  each side's length (RowsCopy::split) and copy the part past it
  from or to the tail; a copy with an ordinary texture goes through a
  scratch buffer of the encoder; synchronizeResource covers the bytes
  inside the length; the extended-range rewrite announces its note
  rather than binding the buffer's words past the length.
Texture buffers and IOSurface planes past the length stay
NotImplemented(TexelsPastBufferLength), whose doc now says so.

Why. Plain Metal makes these textures: reims-vgpu's oracle on the
AMD 5300M and the UHD 630 (4096-byte buffer, 64x16 and 64x17 at rows
of 256, offsets 0, 256 and 2048) and the M3 Max probe
(probes/texels_past_buffer_length.m, job m3-max-4337) for the same
shapes. Under Policy::Dies the refusal ended the consumer's host. The
M3 Max's paths agree that the bytes past the length are one memory:
the next allocation's over a 4096-byte buffer, the allocation's own
zeros over a 20000-byte one, read and written alike by every path.
The tail is the second answer for every shape; docs/API.md's accepted
differences records that the runtime never reads or writes another
allocation there.

Tests.
- tests/buffer_tail_device.rs (m2v_gpu / m2v_cpu_icd): 64x17 over
  4096 bytes, 64x16 at 2048, 64x80 over 20000 bytes (row 78 across
  the length), 64x1 wholly past, a Private buffer's, and a 2D array
  whose second slice is past the length; each path (kernel, blit,
  CPU) reads what each other path wrote, the buffer keeps its bytes,
  and 16 buffers around it keep theirs.
- Unit tests: linear_plan expectations (2D and array past the length
  made, texture buffers refused), RowsCopy::split, inside_rows.
- Conformance: buffer-tails-kernels (scout_read_u / scout_write_u,
  getBytes, replaceRegion, the buffer's bytes) and buffer-tails-blits
  (blits from a buffer across the length and from a texture past it,
  a copy out into a texture, blit and getBytes reads), RGBA8Uint
  16x256 at offset 4096 over 20000 bytes, recorded on the M3 Max
  (3 runs, one outcome, every value the model's).
- The runtime_lane assertion that a 2D array past the length is
  refused now asserts it is made.
REFUSALS.md and CONFORMANCE-COVERAGE.md regenerated.

Verified:
- M3 Max, macOS 27.0.1: probe m3-max-4337 (the shapes above); record
  m3-max-4492 (both cases, 3 runs, one outcome each, every site the
  model's answer); replay on MoltenVK m3-max-4508: buffer-tails-* and
  the four buffer-texture(s)-* cases announced (every value exact).
- gem10, lavapipe (LLVM 23.1.4, 256 bits), m3-max-4509: unit 71/71
  (linear_plan, buffer_texture, blit_plan, tail); device tests under
  m2v_cpu_icd 139/139 (the four buffer_tail_device tests and every
  buffer_texture, shadow and blit test); runtime_lane::buffer_textures
  7/7; conformance replay of the same six cases: all announced.
- Negative control, same job: the runtime's sources at 0e2c70f08f with
  these tests: the four device tests fail at Buffer::new_texture with
  NotImplemented(TexelsPastBufferLength), and both conformance cases
  are refused with it (case/texture, case/work).
- m3-max-4565: clippy -D warnings (runtime and conformance; runtime
  and validation under m2v_cpu_icd), rustdoc -D warnings, unit
  rows_split, buffer_tails, refusal and api_surface tests.

(cherry picked from commit e483e17c6c4d087a50a95cda297cf291934bee54)
2026-11-07 10:44:25 -08:00
Anees Iqbal 96482aadbf Re-derive the conformance coverage document for argb8-targets-destination-alpha's rows
6d7223a048 replaced the case's refused row with a lavapipe texel row and did
not re-derive the document. Verified: scripts/conformance-coverage/coverage.py
writes this; the ledger holds 3295 rows.
2026-11-07 10:41:21 -08:00
Anees Iqbal b5fa3a8067 Bless the API signatures and re-derive the coverage doc on the rebased tree
On development c0d0511d68 plus this branch, the signature bless rewrites one
record, metal2vulkan-runtime::commands! (macro-template), whose committed text
no longer matched the macro. The coverage doc is regenerated from the merged
case set and ledger.

Verified: m3-max-4172 on homelab-ms01-1 at f7a9747f90 ran
`scripts/api-signatures/signatures.py --bless` (one signature changed),
`scripts/conformance-coverage/coverage.py`, and
`scripts/refusal-surface/refusal_surface.py` (REFUSALS.md unchanged), then
clippy in all three configurations and rustdoc, all clean.

(cherry picked from commit 7644dfd59580037247e8236f5ed4a8f84bbcf282)
2026-11-07 09:37:29 -08:00
Anees Iqbal 4df5d48abe Ledger: drop the 8 RADV rows that rows3's two fixes settled
rows3 (e1ff50ac33) made two product fixes:
- GPU writes into read-only no-copy memory are now dropped off macOS.
- pass-sequence-color-actions' DontCare attachments are kept under the
  exact policy the replay runs.
The RADV rows for both families recorded the old answers, and the whole
RADV replays at development c418a1f55b read every one of the 8 as stale
("no longer diverges ... and the known-gaps ledger still lists it"), on
the Radeon 780M (m3-max-4236) and on the RX 7900 XTX (m3-max-4237) alike:
- host-page-writes-kernel-store-read-only and
  host-page-writes-visibility-read-only, each at
  case/bytes-in-a-later-command-buffer-bytes and
  case/bytes-the-cpu-reads-bytes;
- pass-sequence-color-actions at its four MTLStoreActionDontCare cells.
No venue's row is left for either family. docs/CONFORMANCE-COVERAGE.md
re-derived. Besides these, each replay held one unlisted line,
pass-bytes-srgb-decode-all-bytes, which amdperf owns.

(cherry picked from commit 0017a2c76ddad7a214127e4b700e5740fe3b6917)
2026-11-07 09:32:23 -08:00
Anees Iqbal 9ab152f477 Ledger: RADV's remaining families, 295 rule-1 rows (275 RADV, 20 NAVI31)
The rest of the RADV ledger round: every line the whole RADV replays
read as unlisted, on the RX 7900 XTX (m3-max-4102, 306 lines) and the
Radeon 780M (m3-max-4108, 281 lines, each identical to an XTX line),
except the 10 lines the case declarations of b5c45c23cf settle and
pass-bytes-srgb-decode-all-bytes' one line, which amdperf owns.

Each row names the native note the RADV run announced for its case at
that site (the case block's "the device's native notes this case
announced" line, or a case-declared notice that fired), and states the
device's own answer with RADV's first differing element and largest
difference:
- 275 rows read "RADV": the 780M holds each of them with the same
  answer, so a RADV row holds on both of the consumer's AMD GPUs.
- 20 rows read "NAVI31": ycbcr-gathers-* and ycbcr-minify-band-*,
  where the XTX's memory is not the host's and the slot binds a
  converted image. The 780M, which reads the planes in place, does not
  diverge there.

Families with a text of their own:
- sampler-r-address-modes and sampler-border-colours: one lane, r the
  negative smallest subnormal, which Metal reads as layer 0 and the
  device reads below it.
- sampler-axis-mode-triples: the device's weight in whole 1/256 steps.
- denormal-word-fetches: the device's nearest samples flush a denormal
  and its gathers keep it.
- BC1 to BC3 sRGB: the sRGB decode moves, since the 780M's block decode
  is measured to be Metal's. BC4 and BC5: the device's decode.
- a2c-*: the device's coverage at alpha 0.5 is samples 0 and 2, and its
  resolve rounds a tie down, as device-rounded-resolve records for RADV.
- texture-fills, nearest-sample-positions, sample-positions-default-*,
  math-frexp-ilogb-half, the pass-bytes tanh and encode sites, and
  blend-interaction-format-*.
The other rows take another venue's venue-neutral text, after the first
differing element and the largest difference were substituted and the
text was read against RADV's answer.

docs/CONFORMANCE-COVERAGE.md re-derived (scripts/conformance-coverage).
Proof: the whole RADV replay on both GPUs at this branch's tip.

(cherry picked from commit 2e0f7f2baf5f72200580b2092005e49645eca4be)
2026-11-07 09:14:32 -08:00
Anees Iqbal 231a7d86f7 Put a DontCare colour's kept texels behind DontCareColorPolicy::Kept
The owner's rule 1 keeps the fast form of every speed-for-accuracy choice the
default. A colour attachment of a texture's own image stored DontCare now
stores as the driver stores it by default (DONT_CARE where the driver is
measured to keep one of Metal's answers or to store as Metal's own, else
STORE), announced dont-care-store, and renders through the pooled backing
that keeps its earlier texels only under the new opt-in switch
DevicePolicy::dont_care_colors = DontCareColorPolicy::Kept, which
DevicePolicy::exact_answers() selects.

- metal2vulkan: the new public field DevicePolicy::dont_care_colors and enum
  DontCareColorPolicy { Driver (default), Kept }. Its docs give each form,
  its cost and Metal's documentation ("You need to assume that GPU discarded
  the texture's contents"). The runtime alone reads it, so no profile carries
  it (tests::fast_paths checks that no fingerprint moves).
- runtime: kept_bytes::settle takes the backing only under Kept. The docs of
  kept_bytes, render_target, attachment_stand_in, degradation and
  WorkCounts::kept_texels_passes, which counts only the Kept form's passes,
  now say which policy they describe.
- docs/FAST-PATHS.md: the choice moves from "Costs of matching Metal" into the
  table, as a row with its default, its switch, its bound and its measured
  cost. docs/API.md's dont-care-store entry and the Render passes accepted
  difference name the policy.
- Tests of both settings. dont_care_stores' default-policy tests are back to
  their earlier form (each texel one of Metal's two answers, announced where
  the driver does not store as Metal's own) and assert that no pass took a
  backing. The new exact_answers_keep_a_dont_care_color_s_earlier_texels_on_
  every_driver runs under Kept: the single-sample cases, both barriers and the
  two 4x colours keep their texels exactly and are counted.
  deferred_calls's refused-end test is back to its DontCare form.
  clear_reach gains lane_with.
- conformance: the Policy::Exact doc lists queue_sharing and dont_care_colors.
  The colour case's dont-care-store comment says what each policy gives.
- The known-gaps ledger keeps the eight pass-sequence-color-actions rows
  removed. It is held against `conformance replay`, which takes the exact
  policy, as the BGRA10_XR compressed-blit rows already are.
- The API signatures are blessed and docs/CONFORMANCE-COVERAGE.md is
  re-derived (its ledger table had kept the rows that both families removed).
  REFUSALS.md does not change.

Verified: cargo fmt only. The Linux clippy, rustdoc, suites and lavapipe
replays under both policies follow as potluck jobs.

(cherry picked from commit ec3479464c0f72ab5443223a28e23e84ec23e78d)
2026-11-07 09:05:59 -08:00
Anees Iqbal c0d0511d68 Ledger: RADV's half-output-blends, pixel-downscales, half NaN, pixel-samplers and vertex-format families, 201 rule-1 rows
From the same whole RADV replay (m3-max-4016 at 7470a49e6d). Each
family's notes are announced for its cases on RADV (the case's own
native-note line, or every declaration fired: none of these cases is
among those whose declarations did not all fire, save the MoltenVK-only
set-past-layout one), and each row states RADV's own answer:

- half-output-blends (63): the device's fixed-function blend where
  Metal's compiler folds blend and conversion under fast math, under
  half-output-fast-math-blend; the rows say whether a site is within
  that note's bound is not established, as llvmpipe's do.
- pixel-downscales (42): a normalized downscale differs by 0.031 of a
  code at most, inside device-sampling's RADV bound (0.548); a pixel
  sampler's by up to 0.876, inside pixel-sampler-scaling's 2/255; the
  digest sites point at the head and tail rows.
- half-texel-nans, half-read-nans, half-write-nans (38): each a NaN
  whose sign and payload are the device's, under native-nan-encoding
  and the case's announced conversion note, with RADV's first
  differing element.
- pixel-samplers (38): digests of the device's own sampler and
  conversion; the subnormal arg and slot sites hold the digest
  MoltenVK and lavapipe answer, the device's floor of a negative
  subnormal, under device-denormals.
- vertex-format (20): a narrow float attribute's NaN widened with its
  payload, under device-nan-encoding; a float read as half keeps the
  NaN's sign, under native-nan-encoding.

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

(cherry picked from commit 8e309cbacd31cdf61ecc74bbad8876225ae7a299)
2026-11-07 08:37:49 -08:00
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 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 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 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 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 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 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 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 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 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 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 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 570df3cc95 Answer maxArgumentBufferSamplerCount from the set-1 sampler array and the sampler limit
What: `DeviceProperties::max_argument_buffer_sampler_count`, Metal's
`maxArgumentBufferSamplerCount`: one fewer than the smaller of a set-1
sampler array's elements and the device's maxSamplerAllocationCount
(element 0 of the array, and one of the device's samplers, are the
neutral sampler's; each state the array holds takes an element and a
sampler of its own). The array's elements are a new public translator
function, `pipeline::heap_sampler_capacity`: link's heap capacity for a
heap of one sampler array with set 0 counting no sampler, the least of
the handle table's 65536 entries (TABLE_CAPACITY) and the two
update-after-bind sampler limits, 0 where a function cannot read a set-1
sampler array (the layout's features or the module's non-uniform
sampled-image indexing). Link's heap_capacity now reads the same limit
table (`heap_limits`) and arithmetic (`room`), and heap_set the same
layout-feature check (`heap_layout_lacks`), so the sizing and the answer
cannot drift. The runtime's `Device::sampler_array` (each state's
creation-time check) now calls it too: it was the two update-after-bind
limits without the handle table's reach, 500000 on MoltenVK where link
makes 65536 elements, so a state past 65535 was not announced as it was
made. The device's SamplerCount and the answer read one value, the
identity's maxSamplerAllocationCount.

Why: the consumer computed it as the least of the two update-after-bind
sampler limits and maxSamplerAllocationCount; that misses the handle
table's reach (500000 against our 65535 on the M3) and the neutral's
element (32768 against 32767 on lavapipe, 4000 against 3999 on NVIDIA).

Metal on the M3 Max (macOS 27.0.1) answers 500000 (a Swift query of
MTLCreateSystemDefaultDevice, potluck job m3-max-2496), recorded in the
field's docs and docs/API.md's accepted differences.

Tests: engine_handles::an_argument_sampler_array_has_the_heap_sampler_capacity
(link's array equals the function on every committed profile, follows
lowered limits, 0 without the features); capabilities::
argument_buffer_samplers_are_one_fewer_than_the_array_and_the_sampler_limit
(every committed profile, pinned venue values); the device test
argument_sampler_count (the kernel's array, the device's count, the
driver's limit and the answer agree; elements-1 states unannounced, the
next announced). Verification follows in the branch's report.

(cherry picked from commit 7a2b84f15a1dde81e35cbc0b9367962e54d8332f)
2026-11-05 18:59:21 -08:00
Anees Iqbal 7d813def6f Regenerate the derived tables at stack 35's picks
The private-doc-link mend shortened the degradations! macro's note link and a refusal's doc link
to in-scope paths, which moves the macro's template in api_signatures.tsv and one row of
docs/REFUSALS.md; no item's signature changed for a consumer. The mesh change runs a partial object
threadgroup, so the two mesh-object-draws-partial-threadgroup cases leave the conformance ledger
(1378 rows to 1376) in docs/CONFORMANCE-COVERAGE.md, whose conflict the pick resolved to the
earlier text.

Verified: signatures.py --check, refusal_surface.py --check and conformance-coverage --check pass
on this tree; metal-coverage is current.
2026-11-05 17:14:20 -08:00
Anees Iqbal c305c66a7f Give mesh pipelines Metal's descriptor limits, state queries and refusals
The mesh descriptor gains Metal's fields, with Metal's defaults:
max_total_threads_per_{object,mesh}_threadgroup, max_total_threadgroups_per_mesh_grid,
the two threadgroup-size-is-multiple-of-width flags, payload_memory_length,
max_vertex_amplification_count (1) and required_threads_per_{object,mesh}_threadgroup. The
descriptor key reads every one.

A compiled mesh pipeline carries MeshPipelineMetalInfo (RenderPipeline::mesh_info), and the
runtime's RenderPipelineState answers Metal's five mesh queries from it, plus the two required
sizes. Each thread limit is the descriptor's maximum, else the function's
[[max_total_threads_per_threadgroup(n)]], else 1024, held to the device's own limit where that is
lower: the task and mesh stages' invocations with VK_EXT_mesh_shader, the compute stage's where
both stages run as compute work. The widths are 32. The grid limit is the descriptor's, else the
object function's [[max_total_threadgroups_per_mesh_grid(n)]], else 2^20, held to
maxMeshWorkGroupTotalCount where mesh functions run natively. Without an object function the
object stage answers 0 and 0, where the M3 Max answers 3 and 32 (an accepted difference).
DeviceProfile::emulates_mesh_shading says how a device runs the stages, so a consumer no longer
copies the compile layer's rule; with the getters, no separate per-stage query is needed.

What Metal refuses is refused as Metal's rule, DescriptorError::MeshPipeline with a
MeshPipelineProblem, measured on the M3 Max (mesh_pipeline_limits.m, plain and under
MTL_DEBUG_LAYER): a required size with an axis of 0, past 1024 threads or past its stage's
maximum, or for an object stage without an object function (process ends); a maximum past 1024,
a function maximum other than the descriptor's, a mesh stage's required size of other threads
than its maximum, and a payload past 16384 bytes (creation errors, codes 3 and 2). An
amplification count of 0 is VertexAmplificationCount, as a render pipeline's; one above 1, which
Metal makes, is NotImplemented(VertexAmplification), recorded in FAST-PATHS' known gaps.

payloadMemoryLength widens the object and mesh functions' payload arena past the declared type
(LoweringInputs::object_payload now reaches the object stage too); an object stage compiled on
its own without it is NeedsInput(ObjectPayload). SEMANTICS_VERSION 1971 and
ARTIFACT_FORMAT_VERSION 488 for that and the new artifact field; the runtime's warm record
format 4 for the descriptor's fields.

Docs: the new_mesh_render_pipeline_state doc now says how each device runs mesh stages, and
what it refuses; API.md's accepted differences gain the mesh pipeline rows. api_signatures
blessed (it also records RuntimeFact::PartialObjectThreadgroups from the partial-threadgroup
commit), api_surface lists MeshPipelineMetalInfo and MeshPipelineProblem, REFUSALS.md,
METAL-COVERAGE.md and CONFORMANCE-COVERAGE.md regenerated.

Tests: engine_mesh's a_mesh_pipeline_answers_metals_mesh_queries_within_the_device and
a_mesh_descriptor_metal_refuses_is_refused_as_its_rule over every committed mesh and
emulating profile; the validation lane's
a_mesh_state_answers_metals_queries_and_refuses_what_metal_refuses on a device. Not yet built:
the next steps are the M3, lavapipe and RTX 5080 runs.

(cherry picked from commit d6934967fad363ca2185c49935204141f253b416)
2026-11-05 17:12:37 -08:00
Anees Iqbal 81d45b6d40 Conformance: ledger rows for the wide-gamut cases on the RTX 5080
The RTX 5080 Laptop replay of the 32 cases (NVIDIA, b5080 batch m3-max-1762, binary at
aa91079622) made every pipeline and ran every case. The linear unwritten and masked cases match
Metal code for code; the rest differ at their texels in the families the MoltenVK rows name, in
the same shapes (the blend over the half shadow in the pixel interlock at one sample, the blends
over stored codes and the runtime's resolve at four, the sRGB twin's encode through the device's
Pow): a code from Metal's for the linear form, up to three for the sRGB twin at four samples.
26 rows, venue NVIDIA GeForce RTX 5080 Laptop GPU, in the MoltenVK rows' words.

The run's other gap, dont-care-store announced by the depth-only unwritten pipeline, is the one
46ff85e725 already declares (that binary predates it).

docs/CONFORMANCE-COVERAGE.md regenerated.

(cherry picked from commit 0f5ffdf4b634171cfcbecc386a58942f9002dd34)
2026-11-05 13:14:42 -08:00
Anees Iqbal 38210e8938 Conformance: the wide-gamut cases on lavapipe, declarations and ledger rows
The lavapipe replay of the 32 cases (llvmpipe, LLVM 23.1.1, job m3-max-1679) made every
pipeline, the four-sample ones included, and announced two notices the cases did not declare:
extended-range-blends-stored-codes at one sample too (lavapipe blends over the input attachment,
and the half shadow is built only for passes fetching in the pixel interlock), and
dont-care-store for the depth-only unwritten pipeline (its pass stores depth DontCare). The
blended draws and the blended masked write now declare the first, the depth-only unwritten
cases the second; each loosens the notices site alone.

26 llvmpipe rows for the texel sites: the linear blends a code from Metal's, the sRGB twin up
to three (four under the color mask), each saying which notes record it and what is open (the
half shadow over an input attachment and at four samples; the stored-codes note's stated code
does not cover an sRGB twin). The linear unwritten and masked cases match Metal on lavapipe.

The translator test's note on lavapipe at four samples now says what it is: the committed
profile states framebufferIntegerColorSampleCounts of one and no per-format count, so the
profile refuses; the device itself renders them (this replay).

docs/CONFORMANCE-COVERAGE.md regenerated.

(cherry picked from commit 46ff85e7254d5626292ad8e906c484b7c94d4bcf)
2026-11-05 13:14:42 -08:00
Anees Iqbal 0f04983d25 Conformance: ledger rows for the wide-gamut cases' MoltenVK texel differences
26 rows, venue Apple M3 Max, one per texel site the MoltenVK replay of the new cases left
unlisted (job m3-max-1657). Each says whose answer moves the codes:

- linear BGRA10_XR at one sample: the shader's blend over the half shadow in the device's
  float arithmetic (extended-range-blend-source / -float-blend-source), one code;
- linear at four samples: the same, plus the blends over stored codes and the runtime's resolve
  (extended-range-blends-stored-codes, extended-range-resolve, both announced), one code; open:
  the half shadow is single-sampled;
- the sRGB twin: the same plus the encode through the device's Pow (device-pack-conversion),
  one code at one sample and up to three at four, which extended-range-resolve's measured
  bound covers; the unblended sRGB rows take the existing sRGB-twin family's words.

The linear unwritten and masked cases need no row: they match Metal code for code.
docs/CONFORMANCE-COVERAGE.md regenerated (`scripts/conformance-coverage/coverage.py`).

(cherry picked from commit aa9107962298198722825148379784d1f5b546cc)
2026-11-05 13:14:41 -08:00
Anees Iqbal 4f32162f99 Regenerate the conformance coverage document for stack 28's cases and recordings
The coverage document is generated from the suite's sources and recordings; the stack's picks
each regenerated it on their own base, so it is derived again here once over all of them.
Verified: python3 -I scripts/conformance-coverage/coverage.py --check reports it as derived.
2026-11-05 02:09:58 -08:00
Anees Iqbal 95859dac16 Regenerate the conformance coverage document for the composited row
python3 scripts/conformance-coverage/coverage.py over the tree with
pass-start-barrier-private-composited's recording: one more recording, case and Metal-run answer,
and the Metal items the row reaches counted once more.

(cherry picked from commit 0147b3a386081175dfaffa7c72513efac6def034)
2026-11-05 02:08:34 -08:00
Anees Iqbal 215a9f7583 Time the pass-start barrier family on the M3 Max, and count it in the conformance coverage
What: `conformance times --runs 8 --write` over the 13 pass-start-barrier cases keeps both
legs' figures in their recordings, and docs/CONFORMANCE-COVERAGE.md is regenerated
(scripts/conformance-coverage/coverage.py): 1141 recordings in 153 case modules, and
`MTLBarrierScopeRenderTargets` now compared.

Why: `times::every_case_carries_its_timing` holds every case to a timing record, and the
coverage doc is derived from the recordings and the suite's sources.

How verified: potluck job m3-max-37 on the Apple M3 Max, debug build, exit 0: 13 cases carry
their timing; 4 within 10x, 9 unmeasured because our leg announces render-pass-split (and the
display row two more), so its work is not Metal's. The host's load was 188 while Metal's leg
ran, so the margin is reported, not judged. coverage.py --check passes.

(cherry picked from commit 8ce6ed8262789fb7887794bb7073eb63dbed249e)
2026-11-04 21:54:22 -08:00
Anees Iqbal 9e698176bc Record what Metal does with a wait whose signal is already running
What: a conformance case, event-wait-behind-a-running-signal, in the event_orders family, with
two rows, one for MTLEvent and one for MTLSharedEvent. Queue A's command buffer runs 192 fills
of 256 MiB into a private buffer, then signals a companion shared event at 1, then the event
under test at 1. Queue B's command buffer waits for the event at 1, then fills 256 shared bytes.
A is committed, then B. RUNNING_WINDOW (20 ms) later the case reads B's status and handlers,
the shared event's value, A's status, and last the companion. A companion still at 0 proves the
signal had not landed by any of those reads, since one command buffer's signals land in order.
A run whose companion reads 1 records only that fact, so it differs from an answer rather than
passing as one. B's Scheduled status is the proxy for "submitted, and so checked"; the case's
docs say so.

Why: reims's platform sets a submission check on every command buffer, and the runtime holds a
checked head until each value it waits for has landed. checks.rs justified that with "Metal
submits the submission, and checks it, once the signal happened", which nothing had measured.
event-cross-queue-wait reads a waiter only while its signaller is not yet committed, and
event-held-command-buffer only while only the host can raise the event.

Metal's answer, recorded on the M3 Max (macOS 27.0.1): 5 of 5 runs identical, and the
validated leg ran.
- MTLEvent: B reads Scheduled with its scheduled handler run while A still reads Scheduled and
  the companion reads 0. Metal submits it at once, with the wait on the GPU.
- MTLSharedEvent: B reads Committed with no handler run, signaledValue 0, A Scheduled. Metal
  holds it until the signal lands.

The fills measured 156 to 163 ms of GPU time on the M3 Max (a throwaway Metal probe,
GPUEndTime less GPUStartTime, three runs), so the read falls about eight windows before the
signal.

Our side replays divergent on the M3 (MoltenVK) on the plain row: B still reads Committed at
20 ms. A's vkQueueSubmit takes 10 to 27 ms there, in MoltenVK's encoding of our fills by
transfers. A later commit reduces that.

(cherry picked from commit 2efae5489b87b0c37603d1c5e7b51a5222a49414)
2026-11-03 16:16:40 -08:00
Anees Iqbal 61a9508e92 Build visibilityResultType: Accumulate takes a pass's results into the buffer's words
RenderPassDescriptor gains visibility_result_type (MTLVisibilityResultType: Reset, the default
and today's behaviour, and Accumulate). Under Accumulate no query result is copied over its
offset's word: every query of an offset, the first one too, is copied into the upload region the
continuations already use, and the crate-owned combine takes them into the word as the buffer
holds it. The combine already loaded the destination word as its accumulator, so Accumulate is
the first query becoming one more source. A `Boolean` word ORs the device's results in; a
`Counting` word is summed in through a new table mode of the combine, into the word's low 32 bits
alone, wrapping there, its high 32 bits kept (ContinuedResult::low_half / in_low_half). That last
part is what the M3 Max answered when recorded: 0xffff_fff8 plus 16 samples writes 8, and
0xffff_ffff_ffff_fff8 plus 16 writes 0xffff_ffff_0000_0008. A plain 64-bit sum was divergent there.
An offset set with no draw after it keeps its word, because a query with no draw adds 0. Where a
no-copy buffer's bytes start off a multiple of 8, so the results land in an upload region, the
words are now copied into that region before the combine (Landing::inward). Reset records exactly
what it did before.

Conformance: RenderPass gains visibility_type (typed()), and words() appends it only where it is
not Reset, so existing fingerprints read as before. Both sides set it. There are four new
visibility cases, recorded on the M3 Max (macOS 27.0.1): visibility-counting-accumulate (two
command buffers; words 100/5/7/0xffff_fff8/u64::MAX-7), visibility-counting-accumulate-one-command-buffer
(two passes in one command buffer, read once), visibility-counting-accumulate-revisit, and
visibility-boolean-accumulate (words 0/2/3 under covering and non-covering draws, an offset set
with no draw, then a second command buffer). The family's acts key states the type, and a joined
shape adds a command-buffer input. Cost and timing records for the new cases are not written here.

Lane tests (runtime_lane): accumulated_counts_add_to_the_words,
accumulated_booleans_or_into_the_words, and
host_bytes::accumulated_visibility_results_land_where_their_bytes_lie. Unit tests: the combine's
accumulated_counts_are_summed_into_the_low_half, its plan's table mode, and the type's raw values.

Coverage: coverage.tsv marks MTLRenderPassDescriptor.visibilityResultType implemented (its unused
"visibility" group is removed), and METAL-COVERAGE.md is regenerated. MTLVisibilityResultType joins
the enum table, so metal_enumerators.tsv and CONFORMANCE-COVERAGE.md are regenerated. The API
signatures are re-blessed. REFUSALS.md is regenerated: VisibilityResultType::from_raw is one more
UndefinedValue site. The regeneration also picks up two bind/graphics.rs sites the committed file
was missing. The degrade docs (landed results, Boolean) state Accumulate.

Verified on the M3 Max under MoltenVK 1.4.2:
- The 52 visibility-touching lane tests pass: visibility, host_bytes, depth_never, amplified_draws,
  degrade_notices and the framebuffer_fetch split pass.
- The visibility family's replay is all announced (no divergence), after the low-half change.
- Negative control with Accumulate forced to Reset: all three Accumulate lane tests fail, and all
  four new cases replay divergent.
- Negative control with no inward copy: the landing test fails at 4 bytes past a page (2 read 0,
  100 read 16).
- Before the low-half change, visibility-counting-accumulate replayed divergent at words 3 and 4.
- The combine's low-half test fails on the interpreter without the high-half select ([8, 1] for
  [8, 0]).
clippy (plain and --cfg m2v_gpu), rustdoc and scripts/api-docs are clean.

SEMANTICS_VERSION: no translated shader changes, but the owned combine module's words do
(main's call). RUNTIME_VERSION and the runtime-sources pin are not touched here.

(cherry picked from commit 1c172968ad6492cebcae2a568fc99e90565d4d11)
(cherry picked from commit 9f47ebcf006920f7561a16a77f77e422de7201c1)
2026-11-03 11:08:01 -08:00
Anees Iqbal d806c0a792 Write Boolean visibility results as the device's nonzero query result, without the resolve
Metal's Boolean visibility result is nonzero where any sample passed and 0 otherwise. The
Apple M3 Max writes 1; Metal on the AMD Radeon Pro 5300M and the Intel UHD Graphics 630
(macOS 26.7.1, the reims-vgpu team's probes) writes the samples that passed. The runtime
had a crate-owned dispatch (bind::visibility_resolve_module) after every pass with a
Boolean offset whose only job was to rewrite that word to exactly 1. Under AGENTS.md rule
1 the device's native answer is the only form: a Boolean result is now the imprecise
occlusion query's own result, which Vulkan states as "When any samples are passed,
boolean queries will return a non-zero result value, otherwise a result value of zero is
returned" (occlusionQueryPrecise). Across a split pass's render pass instances the
combine still ORs the continuations, so zero stays zero exactly where no instance passed
a sample. Counting queries stay precise.

- Runtime: the resolve's plan, uploads, sets and dispatch are gone from visibility.rs, and
  OwnedModule::VisibilityResolve from owned_kernel.rs. A pass with no continuation now
  records only vkCmdCopyQueryPoolResults. The combine's in-place words are declared as
  shader reads and writes for every combined offset (they were declared only for Boolean
  ones). A new precision degradation, DeviceBooleanVisibility
  (device-boolean-visibility), is announced where a pass's Boolean results record; its
  catalogue entry is in docs/API.md section 9 and a device-gaps row in docs/FAST-PATHS.md,
  as for the other native-answer kinds.
- Translator: bind/visibility_resolve.rs and its tests are deleted (VisibilityResolve,
  VisibilityResolveModule, visibility_resolve_module leave the public surface). Its
  shared helpers (windows, words_buffer, u32_value) move into visibility_combine.rs; the
  combine's plan tests take the two refusal cases only the resolve's tests held. No
  translation output changes.
- Conformance: a new Loosening::Nonzero, and an allowance may name one element of a byte
  region as <site>/<byte offset>. The visibility family loosens each Boolean result's word,
  and only that word, by Nonzero, justified by device-boolean-visibility, which its Boolean
  cases also declare at the notices site. Every other word still compares exactly. No
  recording changes. README and docs/CONFORMANCE-COVERAGE.md (regenerated) say so.
- Validation lane: every Boolean expectation reads the word by its contract
  (visibility::by_contract: nonzero and not the buffer's starting word reads as 1), in
  visibility, framebuffer_fetch, host_bytes, depth_never and amplified_draws; the notice
  is a new lane site (visibility::BOOLEANS) taken by
  boolean_results_announce_the_device_s_value and expected where other tests' notice sets
  are exact. boolean_results_are_copied_with_no_dispatch counts one query result copy and
  no vkCmdDispatch for a pass of two Boolean offsets.

Verified: cargo clippy --workspace --all-targets --all-features -D warnings with
--cfg m2v_gpu; the runtime's degradation catalogue and site tests, the translator's
combine, owned-division, resolve-helper users', api_surface and api_signatures tests;
the conformance suite's 1024 device-free tests. The device lane tests run on the M3 with
the next step.

(cherry picked from commit a4976cdc3734c21c1b9ed4cf603bbf6bab2523f0)
(cherry picked from commit 34e44e3a12a46e6ff4b651cc4689002690d680fc)
2026-11-03 11:08:01 -08:00
Anees Iqbal 53e2a6be78 Complete a command buffer that needs no GPU work without submitting it
What: a command buffer whose encoders recorded nothing and whose one batch waits for and signals
no event and no binary semaphore (so presents no drawable) is taken by the scheduler with no
vkQueueSubmit (State::needs_no_gpu, decided from what it recorded), once it leads its logical
queue's line, no group is held and no first work of the device's waits (that still rides in it,
as before). Everything else its last batch's taking does is kept: kernel times, scheduling (by a
hang's thread where one makes it), submission handlers, heap tickets, own textures, holds. Its
batch is watched at its VkQueue's last submitted value (Completion::watch_unsubmitted), so it
completes in its queue's order, after the work submitted before it, from the turn that finishes
that work. Where its queue reached that value already and no turn is under way, no waiter is
woken: the thread that took it (the scheduler's after its round's submission handlers, or a
thread about to block, after its pass) makes the turn once it holds no lock
(Completion::turn_owed), running only the transitions a thread there may run. A turn no longer
wakes a parked waiter whose queue it emptied (it has nothing to arm for; the next watch or a stop
wakes it). New WorkCounts: command_buffers_unsubmitted, completion_turns_where_taken. GPU-time
placement is unchanged (NoWork: a point at the later of its kernel end and its queue's latest
end), which the new conformance case shows matches Metal's booleans.

Why: the consumer commits empty command buffers as sync points; each was a vkQueueSubmit, a
waiter wake and a turn. Metal completes them without its GPU (M3 Max, macOS 27.0.1: idle, commit
and wait 15 us p50, GPU interval 0 to 0.3 us, 1 to 9 us after kernelEndTime; behind a fill,
after the fill, 65 to 135 us after its GPUEndTime).

Conformance: new case empty-command-buffers (statuses in handlers and after the wait, the four
timers' signs and orders, GPU interval one point, behind a 64 MiB fill: completed-handler order,
the fill's status in the empty one's handler, kernel and GPU times against the fill's), recorded
on the M3 Max (5 of 5 runs identical), cost and contrast and times written; replayed on the M3
Max over MoltenVK: announced (only gpu-times-from-host, declared). completion_turns_where_taken
is reported, not gated (which thread made the turn is a race with the GPU); the M2 handler
counters are classified with the submission region. Coverage doc regenerated.

The lane test empty_command_buffers_submit_no_command_buffer becomes
empty_command_buffers_make_no_submission (0 submissions, 8 unsubmitted).

Verified on the M3 Max (MoltenVK 1.4.2), --cfg m2v_gpu: tests::unsubmitted (3 tests; idle: 81
unsubmitted, 0 queue submissions, 40 of 40 waited ones finished by the taker, 0 waiter wakes);
negative control with the path disabled: 0 unsubmitted, 81 submissions, 40 waiter wakes, both
empty tests fail. The whole runtime GPU suite: 1506 of 1507, the one failure
video_interop::a_raw_submission_is_ordered_by_a_shared_event_s_semaphore read its event's
signal already Reached under the full suite's load, and passed 6 of 6 alone (its command buffers
wait and signal, so never take this path). The conformance crate's tests 1010 of 1010; clippy
(workspace, all targets and features; and runtime + validation under --cfg m2v_gpu) clean.
Not run here: the validation lane tests (commit_work, first_use, gpu_times) and lavapipe.
Owed on development: conformance cost bounds of cases with empty command buffers now read fewer
queue_submissions and a nonzero command_buffers_unsubmitted (a re-bless).

(cherry picked from commit 304bdd2a24e31f7aeb3045e33b9d21209ca7df97)
2026-11-02 22:30:22 -08:00
Anees Iqbal 4b194d24af Write Metal's encoding through compressed BGRA10_XR blits under an exact-answers switch
What: a new DevicePolicy switch, `extended_range_blits` (ExtendedRangeBlitPolicy::Kept, the
default, and ::Canonical, which `exact_answers()` selects). Under Canonical a blit or fill through a
BGRA10_XR or BGRA10_XR_sRGB texture Metal keeps losslessly compressed writes Metal's canonical
encoding: each 16-bit field's low six bits cleared and, for a blit, the alpha code clamped to
[384, 894].
- bind::extended_canonical_module, a compute kernel that rewrites a texel range's words in place
  (bind/extended_canonical.rs, with extended_range_canonical as its reference and interpreter
  tests); the runtime owns it as OwnedModule::ExtendedCanonical.
- The runtime (extended_canonical.rs): after a blit into such a texture, or out of one into another
  texture of the format, the written regions go out to a scratch buffer, one dispatch per region
  rewrites them, and they go back; after a blit out of one into a buffer, or into a texture over a
  buffer's bytes, one dispatch rewrites the words in place at the layout's rows. A fill's texel is
  encoded before it is written (fills clear the low bits alone: Metal's fill keeps alpha codes 4
  and 1023 on the M3 Max under 27.0.1). A buffer the device cannot bind (offset or pitch off 4,
  past maxStorageBufferRange) or a texture over a buffer whose rows share bytes keeps the bytes and
  announces extended-range-bits-kept, as under Kept. Under Canonical the note is not announced for
  the blits it makes exact.
- copy_from_buffer_to_texture's body moved into buffer_into_texture, which a fill's row copies call
  with Writer::Fill (so a fill announces its own wording and is never rewritten as a blit).

Why: Metal's GPU blits through the compression rewrite these bits (measured on the M3 Max under
macOS 27.0.1, plain Metal, xr_matrix: compression iff allowGPUOptimizedContents, shorter side >= 16,
neither ShaderWrite nor PixelFormatView usage; every storage mode alike; CPU copies keep the bytes;
fills clear the low six bits only). The device's copy keeps the bytes. It is the runtime's choice,
not a native answer (no device arithmetic is involved: a copy's bytes), so per rule 1 the fast form
stays the default and the exact form is the switch.

Ledger: FAST-PATHS row (fast defaults), API.md section 1 bullet and the extended-range-bits-kept
catalogue entry, the Degradation doc, the conformance Policy doc. Known gaps: the 28 rows of
compressed-blits-bgra10xr and -srgb (7 sites x 2 formats x Apple M3 Max and llvmpipe) dropped:
under the suite's exact policy those sites now hold Metal's bytes.
RUNTIME_VERSION 1728 -> 1731 (a run under the exact policy writes other bytes).

Also fixes forward a clippy needless borrow in engine_arith's pack test (7a99b93af2).

Verified (M3 Max, macOS 27.0.1, MoltenVK 1.4.2; and lavapipe in scripts/linux-gate, arm64,
LLVM 21.1.8 128 bits):
- runtime_lane::compressed_blits on MoltenVK: both tests pass; the new
  extended_range_blits_write_metal_s_encoding_under_the_canonical_policy checks every direction,
  level 3 into padded rows, Shared CPU/blit mixes, texture to texture both ways, a fill of a
  compressed and a plain texture, and a copy into a texture over a buffer with padded rows, under
  both values (Canonical: Metal's bytes and no notice; Kept: the bytes and the notice once).
- conformance replay of the four compressed-blits cases on MoltenVK: exit 0, the ledger as
  edited (bgra10xr and -srgb `announced` only for staged-texture-copy/shadowed-texture).
- the full `conformance replay --cpu` on lavapipe at 68074019a3 and at this change: the only
  difference is the 14 llvmpipe sites of the two XR cases, which no longer diverge (divergent
  244 -> 242, exact 458 -> 460); the 265 other ledger mismatches of that arm64 venue are the same
  at both (it is not CI's amd64 lavapipe).
- 154 touched validation lanes on MoltenVK (blits, fills, extended-range, NaN, pack, padded,
  rotated, no-copy, two-plane heap): 143 passed, 10 failed, 1 ignored; the same 10 fail with the
  same messages and the same differing texels at 68074019a3 (pre-existing).

(cherry picked from commit 612ff50b86bc29515b158d9b2596b14a45431467)
2026-11-02 13:13:17 -08:00
Anees Iqbal 575ac2b103 Read a pixel-coordinate sample's texel as Metal's sampler does
A `coord::pixel` sampler handed the device the coordinate divided by the texture's size. At a
texel edge whose quotient is inexact the device's normalized sampler read the texel before it:
on the consumer's 258x258 matrix 28 of 1042 nearest clamp-to-zero and clamp-to-border cells on
MoltenVK and up to 500 on an RTX 5080. Metal reads `floor(x)` for nearest and quantizes `x - 0.5`
to its 1/256 grid for linear filters and gathers.

Now, decided from the sampler's state and the access's structure:

- A constexpr pixel sampler that Vulkan's unnormalized sampler can state (one filter, no mip
  filter or anisotropy, clamp to edge, zero or border; a 1D or 2D non-array image, no comparison,
  no status read) samples and gathers through the device's own unnormalized sampler at the
  coordinate itself, on a view of level 0 (`CombinedSampler::unnormalized`,
  `SamplerDesc::unnormalized`). A linear sample's or gather's constant offset folds into the
  coordinate; a nearest sample's offset is applied to its texel's centre (`floor(x) + 0.5 + k`).
- A constexpr nearest pixel sampler the unnormalized form cannot take (an array, a mirror mode)
  samples at its texel's centre over the size, `(floor(x) + 0.5) / N`, which the device's
  normalized sampler reads as that texel exactly.
- A runtime slot's sampler takes the centre where a new pipeline constant,
  `SpecKey::NearestPixelSampler`, says the bound state is a nearest pixel sampler (1 only for
  those, so normalized states make no new pipeline); an argument buffer's sampler tests its word
  (`SamplerWord::nearest_pixel`, which replaces `exact_fetch`).
- Linear samples and gathers through runtime or argument-buffer samplers, arrays and 3D,
  comparisons, level queries and status reads keep the scaled coordinate and its note: their
  state is unknown where the shader is made, or Vulkan's unnormalized sampler forbids them.

`PixelSamplerScaling` is now recorded only where a scaled form remains; `DeviceDenormals` where
a centre's `floor` may read a subnormal coordinate as the device does. The pixel_samplers lane
also asserts Metal's answer for every constexpr and nearest configuration on MetalSampler devices.
The conformance case declares `pixel-sampler-scaling` for its linear cases alone, and the
llvmpipe ledger rows follow the run: two `rgba16f-nearest-mirror` rows are gone (Metal's answer
now), seven take the new digests. `SEMANTICS_VERSION` 1945, `ARTIFACT_FORMAT_VERSION` 482. No
`RUNTIME_VERSION` bump: an unchanged artifact (no unnormalized sampler, no new constant) binds and
runs as before.

The new fixture `px_edges` (own MSL, through regen-air-fixtures) samples every form at texel and
block edges, quarter offsets and each border colour on three NPOT sizes, and the new
`runtime_lane::pixel_edges` holds each nearest cell to the CPU's `floor` rule on every device and
every probe to Metal's digests on MetalSampler devices. Fixture comments in `sampling` and
`sampling_completion` no longer say the coordinate is scaled (their AIR bodies are unchanged).

Verified on the M3 Max under MoltenVK 1.4.2: the consumer's matrix compared with Metal's
results, 0 differing cells on every kernel and size (28 of 1042 before on three kernels);
lavapipe 0 before and after; `runtime_lane::pixel_edges`, `pixel_samplers` and `pixel_downscales`
pass; conformance replay of the 23 pixel cases holds the ledger on MoltenVK; on arm64 lavapipe
the whole set's replay departs from the parent's ledger, beyond what the parent's own replay
does, at exactly the nine rows edited here (the answers are the report's own). Core suite 4988
passed; validation suite under `--cfg m2v_gpu` passes the new and pixel tests, its other failures
fail the same on the parent commit; conformance 1007 passed; goldens, hashes and inventory
blessed. Release translation of every px_edges and px_samplers kernel on four profiles: slowest
0.08 s, largest peak 6 MB.

(cherry picked from commit 888ad9bae9f0aaaf769360740e1dd16817245ca4)
2026-11-02 10:03:17 -08:00
Anees Iqbal ddccbfac5a Bump RUNTIME_VERSION to 1722 for ASTC passes, storage slots and 4x2 and 8x4 footprints
What: RUNTIME_VERSION 1721 -> 1722; the runtime-sources pin recomputed on this tree
(3314ddbb...); api_signatures.tsv blessed (Degradation::AstcStorageNeutral and
PlanDiagnostic::AstcStorageNeutral added); docs/CONFORMANCE-COVERAGE.md regenerated (one ledger
row fewer, one more module declaring a notice); `cargo fmt` of the footprint case's allowance.

Why: a run of an unchanged artifact and plan now does something else: a pass over an ASTC
attachment drops it instead of refusing, a storage slot over an ASTC texture binds a neutral and
announces `astc-storage-neutral`, and the 4x2 and 8x4 footprints make textures. docs/REFUSALS.md
and docs/METAL-COVERAGE.md regenerate unchanged.

Verified: `signatures.py --bless`, `refusal_surface.py`, `metal-coverage/coverage.py --check`,
`conformance-coverage/coverage.py` on this tree (rebased onto fbc086020f).

(cherry picked from commit a37ab781870cf9d3c1e9672026f9773f3f6dfdf2)
2026-11-02 02:17:10 -08:00