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

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

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 30 Jul 2026 03:30AM UTC
Jobs 1
Files 597
Run time 1min
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

30 Jul 2026 02:53AM UTC coverage: 85.244% (-0.02%) from 85.263%
30509691191

push

github

web-flow
fix(posit): to_native narrows once on return, fixing float subnormal flush (#1259)

* fix(posit): to_native narrows once on return, fixing float subnormal flush

posit::to_native<Real>() assigned each decoded factor to Real before forming the
product:

    Real s = (_sign ? -1.0l : 1.0l);
    Real r = _regime.value();           // long double -> Real, early
    Real e = _exponent.value();         // long double -> Real, early
    Real f = (1.0l + _fraction.value());
    return s * r * e * f;

positRegime/positExponent/positFraction::value() all return long double, so those
are four implicit narrowing conversions. MSVC reports each as a C4244 at every
instantiation site, which is how this surfaced -- downstream builds are flooded
with them (observed in stillwater-sc/mp-blas CI).

But the conversions are lossy in RANGE, not merely in precision, and that is an
actual correctness bug. For a large es the regime factor alone can under/overflow
Real even when the full product is perfectly representable. posit<32,5> and
posit<64,5> converted to float hit exactly that: the regime underflowed float to
0, the product came out 0, and representable float subnormals were silently
flushed to zero.

    posit<32,5> encoding 72   exact 2.22757e-40
                              correct float 0x00026cf5 (subnormal)
                              was          0x00000000  <-- wrong
    posit<64,5> encoding ...  exact 1.62963e-44 -> was 0

Fix: keep the whole product in long double, the width the components already
return, and narrow ONCE, explicitly, on return.

Verified no other behavior change by dumping every posit->double and
posit->float conversion for 14 configurations (299,136 conversions: exhaustive
for nbits<=16 at es=0..3, sampled for 32/64 bits) before and after. The double
column is bit-identical everywhere. Exactly 448 float results changed, all in
posit<32,5> and posit<64,5>; checking each against the (exact) double conversion
as ground truth, the old code ma... (continued)

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

10 existing lines in 1 file now uncovered.

41606 of 48808 relevant lines covered (85.24%)

7181316.44 hits per line

Coverage Regressions

Lines Coverage ∆ File
10
93.73
-0.59% include/sw/universal/number/cfloat/cfloat_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 30509691191.1 30 Jul 2026 03:30AM UTC 597
85.24
GitHub Action Run
Source Files on build 30509691191
  • Tree
  • List 597
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30509691191
  • 1bc86130 on github
  • Prev Build on main (#30487228087)
  • Next Build on main (#30536515033)
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