diff --git a/crates/metal2vulkan/src/pipeline/artifact.rs b/crates/metal2vulkan/src/pipeline/artifact.rs index 29c585ea4..5ecee5079 100644 --- a/crates/metal2vulkan/src/pipeline/artifact.rs +++ b/crates/metal2vulkan/src/pipeline/artifact.rs @@ -1445,7 +1445,13 @@ pub enum PrecisionNote { /// Metal's (the product of two `half` values is exact in `float`, so only the two roundings /// differ); a `float` one, and a 16-bit one, within half a unit in the last place of the /// product plus half a unit in the last place of the result, in its own format (Vulkan lets - /// `Fma` round the product and then the sum). Validation derives no tolerance from it. + /// `Fma` round the product and then the sum). The stated exception: an unfused product can + /// overflow where Metal's fused result is finite, and the overflow is the device's answer. A + /// 16-bit product of magnitude `65520` or more rounds to the infinity of its sign, so the + /// result is that infinity where Metal's is finite, or a NaN where the addend is the infinity + /// of the other sign and Metal's result is that infinity (lavapipe: + /// `fma(256.0h, 256.0h, -65504.0h)` answers `inf` where Metal answers 32). Validation derives + /// no tolerance from it. NativeFma, /// Native device sampling (a texel conversion): the module hands a read, sample or gather /// with a `float` result the device's own conversion of the texel's codes. Recorded for every diff --git a/docs/API.md b/docs/API.md index 01b4f20d7..c2225d3d4 100644 --- a/docs/API.md +++ b/docs/API.md @@ -2373,7 +2373,11 @@ category, and says what makes an operation carry the note and what may differ. E device that computes `half` in 16 bits under the 16-bit float controls, a `half` one is the device's 16-bit `Fma` on the `half` operands. Recorded bound: a `half` result held in `float` within one `half` ulp of Metal's; a `float` one, and a 16-bit one, within half an - ulp of the product plus half an ulp of the result, in its own format. + ulp of the product plus half an ulp of the result, in its own format, but where the unfused + product overflows: an unfused `half` product can overflow where Metal's fused result is finite, + and the overflow is the device's answer (a 16-bit product of magnitude `65520` or more is the + infinity of its sign, so `fma(256.0h, 256.0h, -65504.0h)` answers `inf` on lavapipe where Metal + answers 32). - `metal2vulkan-degrade-device-texel-conversion` (precision). `PrecisionNote::DeviceTexelConversion`: Native device sampling (a texel conversion): the module hands a read, sample or gather with a `float` result the device's own conversion of the texel's