reims-vgpu treats precision notes as fatal on Apple GPUs. A kernel's write of halves into a
32-bit float or RG11B10Float texture died with DeviceNanEncoding, and through NativeNanEncoding,
on the M3 Max where the stored bytes are Metal's; a write of a constant texel with no NaN died
the same way on every device.
What:
- A new DriverDeviation::MetalSmallFloatNans (VkProperty::MetalSmallFloatNans), taken by the
APPLE9 MoltenVK row alone: the device stores a float's or a half's NaN written to a
B10G11R11_UFLOAT_PACK32 storage image as Metal does.
- half_write_nans (a half texel's write) classifies the slot's storage choice: a 16-bit float
format takes MetalHalfTexelWrites as before, a 32-bit float one MetalNanMoves (the widened
half's bits are Metal's 0x7fc00000), the packed small float one MetalSmallFloatNans; a taken
deviation drops the note and requires its property. A slot declared without a format (every
float storage choice on MoltenVK and lavapipe) records the note under the bound format's class
(a SpecializedNote of BoundTexelFormat), one clause per class the profile does not cover, so
the runtime announces it only when such a texture is bound.
- half_storage_facts (a float texel's write) drops the small-float note the same way.
- A texture write of a constant texel none of whose lanes is a NaN records neither note.
- A new module side table, stored_texels, records each texture-family write's texel (kept
through edit.rs's retain and the roll pass's check). narrow::moves_unfolded no longer counts a
widened half's store as such a texel as an escape: the write's own DeviceNanEncoding accounts
for its stored NaN under the format it stores.
Verified on this M3 Max, byte for byte against plain Metal (an MSL probe): a float4 write of
33,792 words (16,446 NaNs) and a half4 write of all 65,536 halves (2,046 NaNs) into RG11B10Float,
RGBA32Float, RG32Float and R32Float store Metal's bytes; into R16Float and RGBA16Float a half
NaN's payload differs (the device stores 0x7e00), so those keep the note.
- runtime_lane::half_write_nans on MoltenVK: half writes into rgba32f, r32f and rg11b10f announce
nothing and 0 texels differ; rgba16f announces device-nan-encoding (2,045 NaNs differ). Without
note_stored_texel the lane fails ("write r32f: ... native-nan-encoding true").
- New core tests: a_half_texel_write_s_nan_into_wide_and_small_float_images_is_metal_s_where_
measured (declared and formatless choices on moltenvk-m3 with and without each deviation, and
lavapipe; the bound-class clauses evaluated per format) and a_constant_texel_without_a_nan_
records_no_nan_encoding (zero and 0x7e00 constants, every committed profile); the existing
device-nan-encoding and half-storage-notes tests follow the deviations. Each fails with its
change disabled (the NaN test forced true; the stored-texel exemption removed).
- Notes of every public fixture on moltenvk-m3, lavapipe and nvidia-rtx5080-laptop before and
after: DeviceNanEncoding leaves 65 moltenvk-m3 rows and 6 rows on each other profile (constant
texels), 17 formatless rows per profile go from unconditional to specialized by bound format,
58 moltenvk-m3 rows lose their small-float clause, NativeNanEncoding leaves 11 moltenvk-m3 rows,
and no row gains a note. Consumer AIR on moltenvk-m3: DeviceNanEncoding 33 entries to 21,
NativeNanEncoding 9 to 5.
Docs: API.md (device-nan-encoding and native-nan-encoding exemptions), HOWTO.md, the
PrecisionNote, VkProperty and deviation rustdoc, the driver-facts measurement record.
api_signatures gains the two variants. The versions bumped in the previous commit cover this one.
(cherry picked from commit 05d96c61107989813c186961087ee70d573cf876)