Files
metal2vulkan/docs
Anees Iqbal 4c07cde4d2 Announce set-past-layout-support at every bind of a variant past its driver's support
One work packet, landed as 9 commits (332aebcc0c..c0ffb238b1 on archive/development-linear-2026-10-28), in order:

* Announce set-past-layout-support at every bind of a variant past its driver's support

What. A variant's kinds (`Kinds::of`), which a bind tests before it
announces anything at every occurrence, now hold `SetPastLayoutSupport`
where a set of the pipeline's layout is past the least
`maxPerSetDescriptors` (1024) on a driver that understates its layout
support (`RuntimeDriverDefect::SetLayoutSupportUnderstated`, MoltenVK):
`pipeline::objects::may_pass_support`, the same test `set_support` makes
before it asks the driver.

Why. The kinds held the stages' notes and the vertex-simdgroup property
alone, though `Device::degrade_pipeline` announces the layout notice too.
So a device announcing it at every occurrence (`announce_each`, which the
conformance suite's device sets) announced it only for a variant that
also recorded a precision note: the heap set of a kernel reaching a
texture through an argument buffer (65536 descriptors per array on the M3
Max, which MoltenVK's `getDescriptorSetLayoutSupport` refuses at a sum of
1212 or more) went unannounced until the native-arithmetic round gave 36
conformance cases' kernels a note (device-nan-encoding,
pixel-sampler-scaling), and then it surfaced in exactly those. The notice
is true of the driver: the layer reports VUID-09582 for each such layout.
Without announce_each nothing changes: the making announces it once.

RUNTIME_VERSION 1820 (placeholder, to be renumbered at landing): a bind
can announce what it did not.

Verified: tests::driver_defects::a_set_past_the_drivers_support_is_among_its_variants_kinds
(hsw_held compiled for the committed MoltenVK profile: sets of 4 and
65536 descriptors; the kind held where the driver understates, not where
it does not; the kinds' test agrees with set_support's Understated) passes,
and fails with the kind's addition disabled ("sets of [4, 65536]
descriptors, the driver understating its support: true"). A full MoltenVK
replay (M3 Max, 1.4.2) with the change reads the same 152 unlisted lines
as without it: the 36 cases that announce it already did.

* Declare set-past-layout-support where a case's kernel reads an argument buffer's texture

What. replay::set_past_layout_notice(), a declaration like
shared_memory_notice, and its use by the cases whose kernels reach a
texture or a sampler through an argument buffer: every pixel-samplers and
pixel-downscales case (the arg source), every norm-storage case (the held
route), the three half-storage-writes held rows, read-write-tier-held, and
the two argument-encoder cases that dispatch.

Why. Such a kernel takes the handle heap, set 1, of 65536 descriptors an
array on the M3 Max. MoltenVK 1.4.2 answers vkGetDescriptorSetLayoutSupport
by the sum of the counts against maxPerSetDescriptors (1212), so it refuses
the set though it makes and runs it; the runtime makes it and announces
set-past-layout-support, and the layer reports VUID-09582 for it. That is
a notice of what the driver lacks, which NATIVE_NOTES leaves to each case
to declare. The query is a true one, asked of the create info the layout
is made from, so the runtime keeps announcing it. The 36 cases' MoltenVK
replay read it as undeclared (42 sites, the argument-encoder cases' four
each, since their shared-memory declaration loosened the notices site with
nothing announced to justify it).

Verified: the MoltenVK replay of the 36 cases on the M3 Max (1.4.2) exits
0, 27 announced and the 9 divergent at their ledger rows, nothing
unlisted.

* Ledger the M3 Max's own NaN bits at 37 half-NaN sites

What. Apple M3 Max rows for the sites where this venue answers the
canonical quiet NaN 0x7E00 for a `half` NaN Metal keeps the bits of:
attribute-format-fetches' 29 attribute3 sites (a Half or Half2 attribute
fetched through stage_in into a half2 and reinterpreted), the three
half-write-nans 16-bit float stores, the three half-texel-nans `read`
sites, and math-frexp-ilogb-half's two frexp mantissa sites.

Why. Read off every element of each site (both sides' bytes dumped from
the replay): every differing element is a NaN on Metal's side -- 0x7E01
and 0xFE01 for the attributes, the stored halves' own codes, the texels'
own codes, frexp's 0x7E01, 0xFE55 and 0x7C01 -- and 0x7E00 on ours; no
other code differs. This M3 widens a half NaN to the canonical one, so
the bits are gone at the device's widening (the attribute's and texel's
reads, the store's widened conversion) or at the device's NaN result
(frexp). Each is announced and recorded: native-nan-encoding (a module
reading a half from its bits; an operand's bits where Metal answers
them) and device-nan-encoding (a half texel's write; a half texel's
read), both native notes whose bound is the device's sign and payload,
validation deriving no tolerance from them. The `read` rows carry the
words of the M3 rows at the family's two other sites, now that the read
also goes through the device's decode. So the 32769 the attribute rows
show is the negative NaN's sign and payload, not wrong data.

Verified: MoltenVK replay of the 8 cases on the M3 Max (1.4.2) exits 0
with nothing unlisted.

* Ledger the M3 Max's sRGB pack and unpack at the device-pack-conversion bound

What. Apple M3 Max rows for pass-bytes-srgb-decode-all-bytes and
pass-bytes-srgb-encode-sweep, at their one site each.

Why. The module decodes and encodes sRGB by the MSL transfer function
through the device's Pow (device-pack-conversion, a native note, recorded
on every device for the sRGB forms), where Metal goes through its
twelve-bit table. Read element by element off the replay's bytes against
the committed recordings: every decoded float is within 1.2205e-4 of
Metal's step (under half a twelve-bit step, 1/8190), every decoded half
within that and one half ulp (at most 0.97 of the sum), the alpha lanes
exact; every encoded colour channel that differs (1,821 of them) is one
code from Metal's, no alpha. That is the note's recorded bound. The
largest raw differences (0x00F90001, 0x00010101) are a small half 249
ulps off beside a one-ulp half, and one code in each colour byte.

Verified on the M3 Max (MoltenVK 1.4.2) by the replay of the two cases,
after the rows' rebuild (see the next commit's run).

* Ledger the M3 Max's own half-output blend at the fast-math-blend bound

What. The 18 Apple M3 Max half-output-blends rows go and 52 come: every
site the three 16-bit float formats now differ at, none for the 32-bit
float formats. The family's module docs say what each side does now.

Why. The exact shader blend of a half output is gone (the
native-arithmetic ruling), so the device blends. Read word by word off
the replay's bytes against the committed recordings and the case's own
source sweep and destination generator: this M3 blends the half widened
to float in float and converts into a 16-bit float format toward zero
(every word of the 43 divergent sites whose sum adds no blend-colour
product, 97 to 99.6 per cent of the other nine's), where Metal's compiler
folds the blend into the function (round(round(Sf*S) + Df*D) at the sites
the case's tests measure). Every differing word, 52 sites of 6 to 559
words, is within 2 half ulps of Metal's at the operands' magnitude (the
largest of the source, the destination, a factor and the two products'
magnitudes summed; the worst exactly 2), which is
half-output-fast-math-blend's recorded bound; the case declares that
note and it fired. Raw-code distances up to 1,582 are results near zero.
The 32-bit float formats now store Metal's codes at every word, so their
8 rows are stale, and the 10 old 16-bit rows' counts no longer hold.

Verified: MoltenVK replay of the six blend cases and the two sRGB cases
on the M3 Max (1.4.2) exits 0, nothing unlisted and nothing stale; the
32-bit float cases read announced.

* Ledger the M3 Max's same-command-buffer read of a dropped kernel store

What. One Apple M3 Max row for host-page-writes-kernel-store-read-only
at case/bytes-in-the-same-command-buffer-bytes, an open bug of ours.

Why. Metal drops a kernel's stores into read-only backing, and a later
command of the same command buffer reads them back from the GPU's caches
(every one of the 8 recorded runs); ours reads the pages' own bytes.
Measured cause: the shader drops its own stores through a slot bound to
such a buffer (StageTable::dropped_store_buffers, SpecKey::DroppedStoreSlots),
so the store never reaches the caches, though on macOS the read-only view
the pages are imported through already drops the write. With that word
forced to zero (a local probe, not committed) the case is exact on this
M3, 3 runs of 3, its later-command-buffer and CPU sites still the dropped
write. The gap predates the native-arithmetic round: the same divergence
replays at f6a96b7da8. The mask is set only for memory imported through a
view, which only macOS makes, so leaving it clear there makes it inert
everywhere today; that is the owner's call, so the row waits on it.

Verified: MoltenVK replay of the case on the M3 Max (1.4.2) exits 0.

* Regenerate the conformance coverage after the M3 Max ledger rows

What. docs/CONFORMANCE-COVERAGE.md from scripts/conformance-coverage/coverage.py.

Why. The ledger gained 37 NaN, 2 sRGB, 52 half-output-blend and 1
read-only rows on the M3 Max and lost its 18 stale blend rows (1056 to
1130 rows), which the generated table lists.

Verified: the generator wrote the file from this tree's ledger.

* Number RUNTIME_VERSION 1680, past development's

The set-past-layout-support announcement fix took the placeholder 1820;
development is at 1679.

* Re-pin the runtime sources at the landing tip

The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-10-28 17:24:23 +02:00
..