Commit Graph

2 Commits

Author SHA1 Message Date
741b5fe59b mode_diff: reject empty/unjudged runs, invalid counts, and malformed --ops; accept argv 2026-11-25 07:08:45 +01:00
c57774bf4b tools/mode_diff.py: differential fuzzer for MODE.FP_ROUND writes
The corpus switches f16/f64 rounding at run time (9,417 MODE writes), but no
fuzzer writes MODE, so the f16 fuzzers only run in nearest-even mode.
mode_diff.py mixes setreg 0/3 and s_round_mode 0x0/0xc with 19 mode-aware f16
ops and checks the exported words against an exact Fraction reference. It
also checks that the transcendentals, exact ops and f32 arithmetic give the
same words with and without their MODE writes.

Stacked on #5310: against main it reports v_ldexp_f16 overflowing to inf
under toward zero. Seeds 1-5: 2,532/2,532 judged programs match. Eight
planted translator bugs are each caught.

docs/design.md: v_fract_f16 is not exact for small negatives
(fract(-(2^-10 + 2^-20)) needs 20 bits); the translator already rounds it by
the mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 11:04:42 +00:00