Files
metal2vulkan/docs
Anees Iqbal 6e63f015b5 Count a texel's half rounding as the measured conversion on MetalHalfConversion profiles
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 no longer records PrecisionNote::NativeHalfConversion. That covers a texel the module
decodes itself (extended_range::decode) and a merge of texels (a heap read's phi of its fetched
texel and its decode routine's), as well as an image instruction's. The module requires
VkProperty::MetalHalfConversion instead. 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. The SPIR-V is unchanged too:
round_measured emits the same pair.

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). Every heap half read
carries the decode routine of the seven extended-range/padded/bfloat forms, and its merge, so it
recorded the note even for a BGRA8Unorm texture. The note states that the device's conversion may
differ from Metal's half(float), and MetalHalfConversion measured that 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).

Verified:
- New core tests heap_half_texels_round_by_the_measured_conversion (heap half read, nearest sample
  and gather on moltenvk-m3: no note and the property with the deviation, the note without it,
  HalfTexelConversion kept; a linear sample's filter sum keeps the note on both) and
  decoded_half_texels_round_by_the_measured_conversion (a slot's half read of each extended-range
  form: the same, DevicePackConversion kept). Both fail with round_texel's old rounding and pass
  with the change; half_conversions_are_metals_where_measured still passes.
- Notes of every public fixture subject on moltenvk-m3, lavapipe and nvidia-rtx5080-laptop before
  and after (a temporary dump over the golden-hash subjects, 2,915 per profile): 7 change, all on
  moltenvk-m3, each losing NativeHalfConversion alone and keeping HalfTexelConversion
  (a8r_buffer_read_half, hlf_half_buffer, selected_member_texture and
  kernel_texture_variant_leftovers, the .ll and .air.ll forms).
- reims's ycbcr_probe read_held on moltenvk-m3 through the CLI: [DeviceNanEncoding,
  HalfTexelConversion, NativeHalfConversion] before.
- Pending: the M3 lane heap_half_reads_of_every_code_round_their_float (new) and the lanes that
  read the note (alpha_in_red now requires a8r_buffer_read_half to be Metal's there).

Docs: the PrecisionNote, DriverDeviation and VkProperty rustdoc, API.md's native-half-conversion
exemption, the driver-facts record, narrow's docs.

(cherry picked from commit 384734851de7b2f1a3106355a6c941080f097be4)
2026-11-05 02:08:27 -08:00
..