upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/host_cpu.cpp
diff options
context:
space:
mode:
authorYaBulochka <157796093+YaBulochka@users.noreply.github.com>2026-11-23 06:19:54 +0300
committerYaBulochka <157796093+YaBulochka@users.noreply.github.com>2026-11-23 06:19:54 +0300
commit79dfd24a30f78e725427cc57962a873d2904919b (patch)
treedf9b2e2ae776d0eb5a0c239982221843faf64453 /runtime/src/host_cpu.cpp
parent03b09a086592a197db64d91655c6e65c30764d96 (diff)
Typed buffer loads keep a half NaN's payload, measured on gfx1036
mem_diff found one class of mismatch: a 16_FLOAT/16_16_FLOAT/16_16_16_16_FLOAT typed buffer load of a half NaN. Measured natively on RDNA2 (gfx1036) with the new tools/f16_widen_probe.py, wave32 and wave64, MUBUF and MTBUF, formats 13, 29 and 71: the hardware widens a half NaN to f32 as sign | 0x7F800000 | (payload << 13), keeping the sign and the quiet bit exactly as the half has them (0x7ddb -> 0x7fbb6000, 0x7fe6 -> 0x7ffcc000, 0xffb2 -> 0xfff64000). Gen.decode_format decoded every half with UnpackHalf2x16, whose NaN result is undefined and which the interpreter canonicalises to 0x7fc00000, so the payload was lost. It now uses UnpackHalf2x16 for the non-NaN halves (an exact widening) and builds the NaN word from the bits with integer ops. v_cvt_f32_f16 was measured too: it quiets an sNaN with the payload kept (0x7ffb6000), which the typed load does not. mem_diff's reference used struct's '<e', which keeps the payload only from Python 3.14; f16_to_f32 pins the measured rule so the fuzzer is version independent. tests/semantic/test_buffer_f16_widen_hw.py pins the ten measured words for MUBUF and MTBUF and formats 13/29/71; tests/test_f16_widen_probe.py covers the probe (models, fake oracle, CLI); mem_diff --self-test now pins the rule too.
Diffstat (limited to 'runtime/src/host_cpu.cpp')
0 files changed, 0 insertions, 0 deletions