diff options
| author | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-22 21:03:17 +0000 |
|---|---|---|
| committer | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-22 21:12:48 +0000 |
| commit | bbc3d9105d16c756ca2bec194e19d4e090af6e8d (patch) | |
| tree | f18444fe64234306c87247e3aa9de9196ac6a81f /runtime | |
| parent | f847748cc76bd3777f9c070c4034eb2fc1c04e64 (diff) | |
d16_format_probe: round in integers, the same bits about 4x faster
round_frac built Fractions for 2^e (twice), for the ulp and for the
quotient on every call, and models16/models32 call it five times per
value. The tool and tests/test_d16_format_probe.py sweep all 65,536
UNORM16 and SNORM16 values per instruction, so that file was among the
slowest in the check job.
The same exact rounding now runs on the numerator and denominator:
floor(log2) from the bit lengths and one comparison, then divmod and a
half-to-even check. The result is the same Fraction.
- models16 and models32 give identical results to origin/main for every
value of all five non-f16 formats (133,376 values).
- New test: round_frac against the Fraction form it replaced, for f16
and f32 in both modes. It covers 16-bit quotients, exact values, ties
and just-under-ties at the ends of a binade (including the carry into
the next one) and in the denormal range, powers of two down past the
smallest denormal, random fractions, and their negations. It fails
for ties away from zero, ties up, a missing exponent correction and a
missing denormal clamp.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime')
0 files changed, 0 insertions, 0 deletions