Files
metal2vulkan/docs
Anees Iqbal 553a7dfeb3 half_read_nans: a sampled 32-bit float NaN or denormal is the device's under device-texel-conversion
What the device does: ANV on the Iris Xe (Mesa 26.2.6) hands back every NaN
of an R32Float, RG32Float or RGBA32Float texel as 0xffc00000 in a nearest
sample, through a constexpr sampler or a runtime one, and every denormal as a
zero of its sign. Metal hands back the stored bits. Reads, texture-buffer
reads, argument-held reads and gathers on ANV hand back the stored words.
Iris run m3-max-10431: 224 sampled lanes, every one a NaN as 0xffc00000 or a
denormal as a zero of its sign, and no other difference.

Why the old expectation was wrong: on a device whose texture unit is not
Metal's (no VkProperty::MetalSampler), a float-result access hands back the
device's own conversion of the texel, recorded as
PrecisionNote::DeviceTexelConversion. That is rule 1's native sampling. The
note's recorded bound and the lane covered a 32-bit float texel's NaN and
denormal only in a gather (NVIDIA), plus a denormal in a nearest sample
(RADV). ANV's samples are the same native behaviour, measured.

So:
- PrecisionNote::DeviceTexelConversion's recorded bound (artifact.rs) and its
  docs/API.md entry now name a 32-bit float texel's NaN in a nearest sample
  as the device's encoding, with ANV's measurement beside RADV's denormals.
- The lane takes a NaN of the device's encoding and a denormal flushed to a
  zero of its sign in a sample, as it did in a gather. It now also asserts the
  notice: where the texture unit is not Metal's, each sample dispatch's
  executed stage (CommandBuffer::executions) records DeviceTexelConversion,
  and the device announces device-texel-conversion.

Verified: the Iris run follows.
(cherry picked from commit d759e0fb4b264508f32ee069b9945e9c7f39fa34)
2026-11-08 20:16:04 -08:00
..