• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stillwater-sc / universal / 30352786874
85%
master: 84%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 28 Jul 2026 11:35AM UTC
Jobs 1
Files 640
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Jul 2026 10:56AM UTC coverage: 85.459% (+0.02%) from 85.438%
30352786874

push

github

web-flow
feat(bfloat16): add fused fma(a,b,c) with RNE rounding (#1232)

* feat(bfloat16): add fused fma(a,b,c) with RNE rounding

bfloat16 had no fma. Add a free sw::universal::fma(a,b,c) that widens the operands
to float, forms a*b + c with std::fma (one rounding to float), and rounds once into
bfloat16 via the RNE bfloat16(float) constructor (magic-bias round-to-nearest-even,
NaN preserved, out-of-range -> +/-inf).

This is correctly rounded to bfloat16: a bfloat16 product is EXACT in float (16 <= 24
significand bits), so std::fma yields the correctly-rounded-to-float a*b + c, and
because float's 24 bits satisfy 24 >= 2*8 + 2 for the bfloat16 target (8 significand
bits) the float -> bfloat16 double rounding is innocuous -- the result equals a single
round-to-nearest-even of the exact a*b + c. std::fma supplies the IEEE special cases
(inf*0 -> NaN, inf/NaN propagation) for free.

Test (static/float/bfloat16/math/fma.cpp) validates against an INDEPENDENT oracle
that widens to double instead of float; both equal RNE(exact a*b + c) so they must
agree bit-for-bit. Coverage: randomized vs oracle, exhaustive over every bfloat16
first operand (all 65536 patterns incl. subnormals/inf/NaN), single-rounding
superiority (the naive two-rounding bfloat16 a*b + c disagreed with the exact result
in 216/20000 finite cases; fma matched the oracle in all), and IEEE special values.
Green on gcc + clang.

Resolves #1193
Relates to #1189

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(bfloat16): add deterministic round-to-nearest-even tie cases to fma suite

CodeRabbit: the special-values block claimed tie-to-even coverage but only checked
exact results; random sampling does not deterministically exercise a halfway case.
Add two ties, one in each direction (ulp at 1.0 is 2^-7):
  fma(1,1,2^-8)   -> 1.0      (midpoint of 1.0 and 1+2^-7, rounds to even down)
  fma(1,1,3*2^-8) -> 1+2^-6   (midpoint of 1+2^-7 and 1+2^-6, rounds to even up)

Note: the se... (continued)

2 of 2 new or added lines in 1 file covered. (100.0%)

2 existing lines in 1 file now uncovered.

46857 of 54830 relevant lines covered (85.46%)

6784717.15 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
89.78
0.0% include/sw/universal/number/posito/posito_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 30352786874.1 28 Jul 2026 11:35AM UTC 640
85.46
GitHub Action Run
Source Files on build 30352786874
  • Tree
  • List 640
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30352786874
  • 030e2ed3 on github
  • Prev Build on main (#30333181328)
  • Next Build on main (#30361765360)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc