reims-vgpu treats precision notes as fatal on Apple GPUs; NativeHalfConversion was its largest
group of Mac-only failures (37 tests). The note says a half rounded through the device's
conversion to 16 bits and back may differ from Metal's. On the M3 Max (MoltenVK 1.4.2, macOS
27.0.1), MoltenVK writes OpFConvert to 16 bits as MSL half(x), which is Metal's half(float), and
Metal's compiler folds the conversion of an image instruction's float texel into the access.
What: a new DriverDeviation::MetalHalfConversion (VkProperty::MetalHalfConversion), taken by the
APPLE9 MoltenVK row alone. Where the profile takes it:
- narrow::round_measured rounds a float the function holds (an AIR fptrunc or air.convert from
float, through resize) by the conversion pair and records the pair's narrowing in a new module
side table, measured_roundings (kept through edit.rs's retain and the roll pass's check);
- narrow::rounds_unmeasured finds any other conversion pair: one neither recorded nor of a texel
an image read, fetch, sample or gather hands back (directly, through a composite extract, or
through a parameter every call passes such a texel);
- the compile records NativeHalfConversion only where such an unmeasured pair exists, and
otherwise requires the property.
A half operation or function computed in float and rounded keeps the note: Metal's half tanh
answers 7 of the 65,536 halves otherwise than the conversion of its float tanh. exp, sqrt and a
reciprocal on half matched, but they are functions, not the conversion, so they stay noted.
Verified on this M3 Max, word for word against plain Metal (an MSL probe, fast and safe math):
- the conversion of a float loaded (425,216 words), of a sum, product and quotient (144,896
pairs each), of an fma (123,648) and of an integer's quotient (190,208): 0 words differ;
- the half result of read, nearest sample at the centre, linear sample a quarter texel off and
gather of every texel of ten formats (RGBA32Float, RGBA16Float, RGBA8Unorm and its sRGB twin,
RGBA8Snorm, RGBA16Unorm, RGBA16Snorm, RGB10A2Unorm, RG11B10Float, RGB9E5Float): 0 differ.
- New lane runtime_lane::half_conversions on MoltenVK: load, sum, product and fma kernels carry
no note and 0 of 253,958 lanes per kernel differ from the half model; the half tanh kernel
keeps the note. With measured_conversion forced false the lane fails.
- New core test half_conversions_are_metals_where_measured: the four forms lose the note and
require the property on moltenvk-m3 with the deviation, keep it without the deviation, and the
half tanh keeps it on both; it fails with the carve disabled.
- Notes of every public fixture on moltenvk-m3, lavapipe and nvidia-rtx5080-laptop before and
after: NativeHalfConversion leaves 58 moltenvk-m3 rows, and no row gains a note. Consumer AIR on
moltenvk-m3: 23 entries noted before, 2 after (a heap texture's held half read).
Docs: API.md (native-half-conversion exemption), HOWTO.md, the PrecisionNote, VkProperty and
deviation rustdoc, the driver-facts measurement record. SEMANTICS_VERSION 1949 and
ARTIFACT_FORMAT_VERSION 484 (new VkProperty variants in the codec); these bumps cover the rest of
this branch. api_signatures gains the two variants.
(cherry picked from commit 266f7cd26327e408d9cd1f0d6ea5ba33e49e10b3)