From c418a1f55bd4e42ac44f3abfbf8ac15ec130d2ed Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sat, 7 Nov 2026 09:06:46 -0800 Subject: [PATCH] device-texel-conversion: state RADV's nearest-sample flush of a denormal float texel PrecisionNote::DeviceTexelConversion's recorded bound named NVIDIA's gathers, which flush a 32-bit float texel's denormal to a zero of its sign, and answered Metal's value for every other class. On RADV (Mesa 26.2.6, both the RX 7900 XTX and the Radeon 780M on 2026-11-07), denormal-word-fetches differed at its four nearest-sample sites alone: each differing word is a denormal against the zero of its sign (largest difference 0x7FFFFF, a whole mantissa), and none of its gather sites differs. So the device's samples flush and its gathers keep. That is the device's native answer (rule 1), announced for the case as device-texel-conversion, and the note's documentation now says so, in artifact.rs and in docs/API.md's catalogue entry. The case's module doc records the RADV reading beside its runtime_lane one. Doc comments only: no product path changes. artifact.rs is outside the runtime sources pin, and degradation.rs is not touched. Verified: the replays m3-max-4102 and 4108 (the four lines, identical on both GPUs), and the driver version read with vulkaninfo (m3-max-4201). (cherry picked from commit 7fc262b99f7ab4b080e9efb506021908fa9121e4) --- .../src/cases/denormal_word_fetches.rs | 5 ++++- crates/metal2vulkan/src/pipeline/artifact.rs | 3 +++ docs/API.md | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan-conformance/src/cases/denormal_word_fetches.rs b/crates/metal2vulkan-conformance/src/cases/denormal_word_fetches.rs index 4cb4af046..794d85031 100644 --- a/crates/metal2vulkan-conformance/src/cases/denormal_word_fetches.rs +++ b/crates/metal2vulkan-conformance/src/cases/denormal_word_fetches.rs @@ -5,7 +5,10 @@ //! its samplers, while RADV's gathers and nearest samples, NVIDIA's gathers and ANV's nearest //! samples hand back **the zero of the texel's sign** — and every one of those devices' plain //! fetches keeps it. A denormal flushed to zero is a value a comparison in floats would call -//! almost right, so every site here records unsigned words and compares them exactly. +//! almost right, so every site here records unsigned words and compares them exactly. This case's +//! replay on RADV (Mesa 26.2.6, the RX 7900 XTX and the Radeon 780M, 2026-11-07) differed at the +//! four nearest-sample sites alone: its gathers kept the word there. The device's flush is its +//! native answer, `device-texel-conversion`. //! //! The owned fixture `denormal_texels` is the one written for this question. Lane `i` reads the //! coordinate `in[i].xy` and writes eight `float4`s, each a site of its own because each is its own diff --git a/crates/metal2vulkan/src/pipeline/artifact.rs b/crates/metal2vulkan/src/pipeline/artifact.rs index 8274d785a..9b77745c1 100644 --- a/crates/metal2vulkan/src/pipeline/artifact.rs +++ b/crates/metal2vulkan/src/pipeline/artifact.rs @@ -1757,6 +1757,9 @@ pub enum PrecisionNote { /// denormal flushed to a zero of its sign, where Metal hands back the texel's own bits /// (NVIDIA's 615.71.09 on the RTX 5080 Laptop GPU gathers every NaN as `0x7fffffff` and /// every denormal as a zero, and reads and samples both as stored); + /// - a 32-bit float texel's denormal in a nearest sample: a zero of its sign on a device that + /// flushes it there, where Metal hands back the texel's own bits (RADV's Mesa 26.2.6 on the + /// RX 7900 XTX and the Radeon 780M samples a denormal as a zero, and gathers it as stored); /// - every other class: the device's value, which Metal's matches. /// /// A filtered sample's value is the filter's. Validation derives no tolerance from it. diff --git a/docs/API.md b/docs/API.md index 16a2a5647..1f530dec0 100644 --- a/docs/API.md +++ b/docs/API.md @@ -3684,7 +3684,9 @@ bound. Metal answers `0x7fc00000`; a 32-bit float texel's NaN in a gather in the device's encoding, and its denormal in a gather a zero of its sign, where Metal hands back the texel's bits (NVIDIA's 615.71.09 on the RTX 5080 Laptop GPU gathers every NaN as `0x7fffffff` and every - denormal as a zero); every other class Metal's value. + denormal as a zero); a 32-bit float texel's denormal in a nearest sample a zero of its sign on a + device that flushes it there (RADV's Mesa 26.2.6 on the RX 7900 XTX and the Radeon 780M, which + gathers it as stored); every other class Metal's value. - `metal2vulkan-degrade-device-vertex-conversion` (precision). `PrecisionNote::DeviceVertexConversion`: Native vertex input (a conversion): a render pipeline's vertex descriptor gives a normalized format (`UCharNormalized` through `Short4Normalized` of