Files
mandy/tools
BetterJdue 9fa652f7a2 d16 typed buffer loads round the exact UNORM/SNORM quotient once, as RDNA2 does (BUILD-161)
docs/design.md narrowed the f16 of a typed d16 buffer load from the f32 decode with round to nearest even, and
called that rounding inferred, not measured. tools/d16_format_probe.py measures it through tools/hw_oracle: every
UNORM8, SNORM8, UNORM10, UNORM16 and SNORM16 value through buffer_load_format_d16_x, tbuffer_load_format_d16_x
and buffer_load_format_x, in wave32 and wave64, against several candidate rules, with a 16_FLOAT load, the kept
high half of d16_x and the staged inputs as controls.

On an RX 6700 (gfx1031) the hardware rounds the exact quotient once, straight to f16. Rounding to f32 first is
1 ulp high on exactly four values (UNORM16 0xffaf and 0xffef, SNORM16 0x7ff7 and 0x8009); over every width up to
16 bits only two f32 quotients land on an f16 halfway point (0x3f7ff000, 0x3f7fb000). Gen.d16_norm_f16 takes the
f16 below for those two, for normalized formats only. The f32 (non-d16) result was already right.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:50:45 +01:00
..
…
2026-11-22 07:38:09 -05:00