Count a texel's half rounding as the measured conversion on MetalHalfConversion profiles

Re-applies 384734851d (reverted in the stack by 5dbf6f3be3) on top of the previous commit, which
merges a heap half read's class arms as the texel's half bits.

What: narrow::round_texel rounds through round_measured, so in QuantizeForm::Converted the
conversion pair's narrowing is recorded as measured. On a profile that takes
DriverDeviation::MetalHalfConversion (MoltenVK on the Apple M3 Max's macOS 27 identity) a texel's
half rounding records no PrecisionNote::NativeHalfConversion, and the module requires
VkProperty::MetalHalfConversion instead: a texel the module decodes itself
(extended_range::decode), a merge of texels (a heap read's phi of its fetched texel and its decode
routine's) and an image instruction's. The note stays for roundings by narrow::round: half
operations and functions computed in float, filter sums, packs and the rest. Other profiles never
read the measured set, so they are unchanged by construction, and round_measured emits the same
pair, so the SPIR-V is unchanged. SEMANTICS_VERSION 1967: recorded notes change on moltenvk-m3.

Why: reims-vgpu's strict Mac tests die on native-half-conversion at a kernel that reads an
argument buffer's texture as half (their ycbcr_probe.metal read_held, over BGRA8Unorm). Every heap
half read carries the decode routine of the seven extended-range/padded/bfloat forms, and its
merge, so it recorded the note whatever the texture. MetalHalfConversion measured the device's
conversion as Metal's half(float) for loaded and computed floats; where Metal's half texel is not
the nearest even half of the texel's value, the access's own note states it: HalfTexelConversion
(outright for a heap element, by the bound class at a slot) or DevicePackConversion (a decoded
texel). The stack 28 gate's cross-class lane failure that reverted it came from the heap read's
merge of widened halves, not from a rounding: an integer texel's bits read as half go through no
rounding, and the previous commit merges them as integers, so they keep their bits without a note.

Kept from 384734851d: the core tests heap_half_texels_round_by_the_measured_conversion and
decoded_half_texels_round_by_the_measured_conversion, the M3 lane
heap_extended_reads::heap_half_reads_of_every_code_round_their_float (half_conversions::half_of
made pub(super) for it), and the docs: the PrecisionNote, DriverDeviation and VkProperty rustdoc,
API.md's native-half-conversion exemption, the driver-facts record (which now also says the
argument buffer's cross-class half read rounds nothing and names its lane), narrow's docs.
runtime-sources.sha256 moves for the doc edits in driver_facts.rs and requirements.rs, which change
no behaviour of a run.

Verified: pending in this commit; the next jobs run the core and M3 lane checks on it.
(cherry picked from commit 1757bd7866aa87c4e38ab83f0b4c4d83e68c75bb)
This commit is contained in:
Anees Iqbal committed 2026-11-05 04:28:29 -08:00
1 parent bfc5a95e03
commit f1def3dffe
11 files changed
+320 -24

No files matched your search

+9 -6
View File
@@ -3618,12 +3618,15 @@ bound.
zero of its sign. **Exempt:** on a profile that takes `DriverDeviation::MetalHalfConversion`,
MoltenVK on Apple's GPUs of the Apple M3 Max's macOS 27 identity, a module whose every `half`
rounded through the conversion converts a `float` the function holds (an AIR `fptrunc` or
`air.convert` from `float`) or an image instruction's texel records no note for that rounding and
requires `VkProperty::MetalHalfConversion`: measured word for word against plain Metal, with and
without fast math, over 1,173,760 `float`s loaded, summed, multiplied, divided and fused, an
integer's quotient, and every texel of ten formats read, sampled and gathered as `half`. A `half`
operation or function computed in `float` and rounded keeps the note (Metal's `half` `tanh`
answers 7 of the 65,536 `half`s otherwise).
`air.convert` from `float`) or a texel's value records no note for that rounding and requires
`VkProperty::MetalHalfConversion`: measured word for word against plain Metal, with and without
fast math, over 1,173,760 `float`s loaded, summed, multiplied, divided and fused, an integer's
quotient, and every texel of ten formats read, sampled and gathered as `half`. A texel's value
includes one the module decodes itself (an extended-range or bfloat code) and a heap read's merge
of its fetched texel and its decode routine's; where Metal's `half` texel is not that rounding of
the value the access records `half-texel-conversion` (outright for an argument buffer's texture)
or `device-pack-conversion` (a decoded texel). A `half` operation or function computed in `float`
and rounded keeps the note (Metal's `half` `tanh` answers 7 of the 65,536 `half`s otherwise).
- `metal2vulkan-degrade-native-half-quantize` (precision). `PrecisionNote::NativeHalfQuantize`:
Native half rounding (a quantize): 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