ed08da17f6's pixel-sampler fix recorded PrecisionNote::DeviceDenormals
unconditionally for every texel-centre position, TexelBySpec and
TexelByWord included. Those two are the runtime slot's and the argument
buffer's samples, whose centre `floor(x) + 0.5` sits behind the
NearestPixelSampler specialization or the table word's test: code that
no normalized state reaches. So every stage that samples through a
runtime or argument-buffer sampler, normalized ones included, gained an
unconditional DeviceDenormals at making, which a host that refuses any
precision note on an Apple GPU dies of (cubic stages died of it before
reaching their own BicubicFilterArithmetic, which is unchanged).
The note is real where the centre runs. Measured on the M3 Max with a
21x13 texture and clamp-to-zero and white-border states, at x = -2^-149,
-2^-140 and -2^-127: Metal's nearest pixel sampler reads texel -1 (the
border), MoltenVK's `floor` flushes the subnormal to -0 and reads texel
0. It shows through every centre form: a constexpr nearest sample with
an offset (UnnormalizedTexel), a constexpr edge fetch with an offset, a
constexpr nearest array sample (Texel), a runtime slot under a nearest
pixel state (TexelBySpec) and an argument buffer under one
(TexelByWord). The shader keeps the device's floor (owner's rule 1).
centre_denormals now gives the note per form:
- a constexpr sampler's Texel or UnnormalizedTexel centre, and a fetch
under an offset: unconditional, as before;
- a runtime slot's TexelBySpec: only under NearestPixelSampler == 1,
which is 0 for every normalized state; a runtime slot's Texel (an
integer texture): only where its word has the pixel bit;
- an argument buffer's TexelByWord: none of its own;
ArgumentPixelSamplerScaling, which the runtime announces only while a
pixel state lives, records it (its doc now says so).
Tests:
- tests::engine_sampler::normalized_and_cubic_stages_record_no_note_
their_states_cannot_run (moltenvk-m3) holds the unconditional notes of
the sampling, handle, argument-buffer, pixel-argument and cubic
fixtures (plain and the cubic variant under normalized and pixel
words) to 9f5776bf31's, and checks every specialized DeviceDenormals
clause tests the nearest-pixel constant or the pixel bit. It fails on
ed08da17f6's select.rs (DeviceDenormals among the unconditional notes).
- runtime_pixel_accesses_hand_the_device_the_scaled_coordinate now
checks the nearest kernels' one specialized DeviceDenormals entry and
that the gather has none.
- runtime_lane::pixel_edges::normalized_states_announce_no_pixel_note
dispatches the slot and argument-buffer kernels under normalized
nearest and linear states and asserts no DeviceDenormals or pixel
note, then a nearest pixel state and asserts DeviceDenormals (slot)
and ArgumentPixelSamplerScaling (argument buffer). On ed08da17f6 it
fails on the Apple M3 Max with DeviceDenormals under normalized states.
docs/API.md (device-denormals, argument-pixel-sampler-scaling) and the
DeviceDenormals row of docs/FAST-PATHS.md state the per-form rule and
the measurement. SEMANTICS_VERSION 1947: an artifact's notes changed.
Verified before this commit on MoltenVK (M3 Max, under maclock and
memcap): runtime_lane::pixel_samplers, pixel_edges (the new test
included) and pixel_downscales, 8 of 8; sampler translator tests 121.
The full checks follow on this tree.
(cherry picked from commit 382e940c470becee8cfdf560f2f1284ce2844599)