Take the device's answers for fast atan2, half fmod and precise pow's NaN; delete exact sRGB leftovers
- fast::atan2 without every fast-math flag divides by the device's own
reciprocal of x; past 2^126 the denormal it makes is the device's
(DeviceDenormals through MetalFloatDenormals; NativeDivision as before).
FastAtan2 { reciprocal_flushed } -> FastAtan2 { by_reciprocal }.
- A half fmod answers its float remainder rounded; the Metal zero-sign
select is gone and the call records NativeTranscendentals through
FloatFn::half_zero_of_float.
- Precise pow's NaN is classed BaseToExponentOne, so it records
NativeNanEncoding like fast pow and atan2 (the measured() exclusion
was left over from the removed pow(x,1) bit fix). Fast sin/cos keep
DeviceNanEncoding on purpose: Metal answers +0 there, no NaN to stand for.
- Delete the exact sRGB pack/unpack's dead code: ArithPlan::srgb,
Declared::srgb, SRGB_PACK/SRGB_UNPACK, srgb::TABLE_WORDS,
math::unpack's normalized and sRGB branches (UnpackRounding,
unpack_rounding, mul_exact, unpackable), word::srgb_code.
WordAttachment::output_word returns Option<u32> (None for Srgb8).
With the mipmap filter on the transfer (c9dd35e8a4), srgb's declare/
word/step and SRGB_ENCODE_FIRST lost their last users and go too, with
their texel_round test; SRGB_DECODE_STEPS stays for the ASTC and PVRTC
decoders.
- FAST-PATHS: row 58 names half fmod; known gaps lose the atan2 and
half-fmod lines. API.md: native-transcendentals, native-nan-encoding.
- SEMANTICS_VERSION + 1.
Verified: fmt, clippy (all features, m2v_gpu), rustdoc; metal2vulkan
arith/word/fast_paths 241/241, engine call notes + public fixture
expectations 20/20, api_signatures+api_surface 15/15, runtime 29/29,
validation c3 72/72; the atan2 tests FAIL on the old flushed reciprocal.
No conformance case reaches atan2, fmod or pow. Golden hashes: 21 rows x
19 profiles move (fast_atan2.f32 and fmod.f16 fixtures), re-blessed on
development.
One work packet, landed as 2 commits on archive/development-linear-2026-10-29: abb2b3db6e, then f76cdba457 (the re-pin).
This commit is contained in:
1 parent
a6c58e923f
commit
9bd91540f4
26 files changed
+355
-877
No files matched your search
+9
-6
@@ -3190,10 +3190,12 @@ bound.
|
||||
`FAbs`, `FSign` and `Fract`, their special operands the instruction's (Metal's `sign` of a NaN,
|
||||
a zero and an `f32` denormal is `+0`, its `fract` of an infinity `+0`); a `half` function's
|
||||
signed zeros and NaN signs its `float` instruction's (`half` `sin(-0)` is `-0`, where Metal
|
||||
answers `+0`); `pow`, `powr` and `atan2` C99's special values by the device's comparisons
|
||||
around its instruction (`pow(x, 1)` the device's `Pow`, where Metal answers `x`; an `f32`
|
||||
denormal operand as the device reads it); and `round` C99's from the device's `Trunc` on every
|
||||
device (`round(-0.3)` is `-0`, where Metal answers `+0`).
|
||||
answers `+0`), and on every device a `half` `fmod`'s zero remainder its `float` remainder's
|
||||
(`half` `fmod(-2, 0.5)` is `-0`, where Metal answers `+0`); `pow`, `powr` and `atan2` C99's
|
||||
special values by the device's comparisons around its instruction (`pow(x, 1)` the device's
|
||||
`Pow`, where Metal answers `x`; an `f32` denormal operand as the device reads it); and `round`
|
||||
C99's from the device's `Trunc` on every device (`round(-0.3)` is `-0`, where Metal answers
|
||||
`+0`).
|
||||
- `metal2vulkan-degrade-native-division` (precision). `PrecisionNote::NativeDivision`: Native device
|
||||
maths: a precise `float` or `half` division, or Metal's fast division or reciprocal, is the
|
||||
device's `OpFDiv` where the device's division is not Metal's own: within Vulkan's 2.5 ulp, where
|
||||
@@ -3259,8 +3261,9 @@ bound.
|
||||
device maths: a `float` or `half` operation's NaN result is the device's, its sign and payload
|
||||
unselected, where Metal answers a NaN the device is not measured to answer (every NaN but
|
||||
Metal's canonical one on a device measured to answer that, MoltenVK on an Apple GPU): a `float`
|
||||
`fneg` and `fabs`, which keep a NaN operand's payload on Metal, and a `half` `fract`, which
|
||||
returns it, among them. Also
|
||||
`fneg` and `fabs`, which keep a NaN operand's payload on Metal, a `half` `fract`, which returns
|
||||
it, and a precise `float` `pow` of a NaN base to the exponent one, which returns the base, among
|
||||
them. Also
|
||||
recorded wherever a `half` is read from its bits, on every device, since the read is the
|
||||
device's widening (its conversion with `shaderFloat16`, `UnpackHalf2x16` without): a NaN's bits
|
||||
the device's, where Metal widens every `half` NaN to `0x7fc00000` and moves one it does not
|
||||
|
||||
Reference in new issue
Block a user