Decode a pulled Int1010102Normalized 10-bit field as Metal's product

One work packet, landed as 2 commits (23c75d6d34..7b5cf8328d on archive/development-linear-2026-10-28), in order:

* Decode a pulled Int1010102Normalized 10-bit field as Metal's product

Metal's vertex fetch reads an Int1010102Normalized 10-bit field as its clamped
magnitude times float(1/511) in float, one rounding, not the correctly rounded
quotient c / 511: an ulp toward zero at 96 of the 1,024 codes (measured at every
code on the Apple M3 Max, macOS 27.0.1, by runtime_lane::normalized_vertex_fetch).
The shader's pulled decode (lower::stage_io::fetch::normalized) divided exactly, so
Metal's constant step on MoltenVK, a device without buffer robustness, the indexed
capture form and a kernel's stage input read those codes an ulp off, unannounced.
It now multiplies (an OpConvertUToF and an OpFMul in place of the exact division's
integer sequence); every other normalized field keeps the quotient. The FAST-PATHS
known gap goes. The device-vertex-conversion entries in docs/API.md and the
runtime's degradation.rs now state the 1/511 rule, the MoltenVK exemption and
lavapipe's unclamped per-instance signed minimum, as the note's doc and the ledger
row already do. SEMANTICS_VERSION 1890.

Verified: nextest of lower::stage_io::fetch, fast_paths and the vertex tests, 116
passed; every_ten_and_two_bit_code_decodes_as_metals fails with the multiply
disabled (negative control) and holds the 96-code count.

* 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.
This commit is contained in:
Anees Iqbal committed 2026-10-28 17:24:22 +02:00
1 parent 8acf6ae154
commit 3f3c972b8a
7 files changed
+60 -24

No files matched your search

+7 -3
View File
@@ -2946,9 +2946,13 @@ bound.
either sign, `UChar4Normalized_BGRA`, `Int1010102Normalized`, `UInt1010102Normalized`) to an
attribute that fixed-function vertex input fetches, so the attribute is the device's `UNORM` or
`SNORM` conversion of its codes, where Metal's fetch answers the code over its maximum correctly
rounded: within one `f32` ulp where measured (lavapipe reads some 8-bit unsigned codes one ulp
high). Recorded on the pipeline's vertex stage, on every device; one module serves every format
the device fetches.
rounded (an `Int1010102Normalized` 10-bit field times `float(1/511)`): within one `f32` ulp
where measured (lavapipe reads some 8-bit unsigned codes one ulp high), but lavapipe's
per-instance fetch, which reads the most negative code of an 8- or 16-bit signed format
unclamped (-128/127, -32768/32767) where Metal reads -1. Recorded on the pipeline's vertex stage
on every device but one whose profile takes `DriverDeviation::MetalNormalizedVertexFetch`
(MoltenVK on the Apple M3 Max's macOS 27 identity), where only a 16-bit format read as `half`
records it; one module serves every format the device fetches.
- `metal2vulkan-degrade-native-half-conversion` (precision). `PrecisionNote::NativeHalfConversion`:
Native half rounding (a conversion): the module rounds a `half` result it computes in `float` (a
`half` operation's, a function's, a conversion from `float`'s, a texel's) by the device's