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

stillwater-sc / universal / 24956707653
84%
master: 84%

Build:
Build:
LAST BUILD BRANCH: fix/issue-ci-ereal-regression-runtime
DEFAULT BRANCH: master
Ran 26 Apr 2026 12:59PM UTC
Jobs 1
Files 644
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

26 Apr 2026 12:32PM UTC coverage: 84.274% (-0.04%) from 84.313%
24956707653

push

github

web-flow
test(math): harden pow signed-zero and special-value test checks (CodeRabbit) (#773)

Two findings on PR #770 (already merged) that warrant a follow-up
test-hardening PR:

1. Signed-zero static_asserts cannot detect sign regressions.
   `+0.0 == -0.0` is true in IEEE-754, so `static_assert(value == -0.0)`
   passes whether value is +0 or -0. The implementation in pow.hpp
   correctly handles signed zero (it uses bit_cast to detect sign), but
   a future regression to the wrong-sign result would not have been
   caught by these tests.

   Fix: add constexpr-friendly sign_bit / is_pos_zero / is_neg_zero
   helpers in the test (using std::bit_cast since std::signbit isn't
   constexpr until C++23 and Universal targets C++20). Use these in
   the static_asserts that pin signed-zero contracts: pow(-inf, -3)
   == -0, pow(-inf, -4) == +0, pow(-0, 3) == -0, pow(-0, 4) == +0,
   pow(-0, 2.5) == +0, pow(+0, 3) == +0.

   ==-inf vs +inf comparisons remain via == because +inf != -inf in
   IEEE-754; only ==0.0 has the signed-zero-equality issue.

2. Runtime check lambda silently passed certain failure modes.
   For ref == +/-inf, computing (our - ref) / ref produces NaN (when
   our is also inf), and NaN > tol is false, so the check passed even
   when our had wrong sign or was finite. For ref finite and our NaN,
   the same arithmetic produced NaN > tol = false, masking the failure.

   Fix: add explicit special-case handling at the top of the lambda:
     - std::isnan(ref) -> require std::isnan(our) (existing behavior,
       restated using std::isnan for clarity)
     - std::isinf(ref) -> require std::isinf(our) AND matching std::signbit
     - !std::isfinite(our) when ref is finite -> count as failure
     - both finite -> the existing (our-ref)/ref relative-error check

Verified cm_pow PASSes on gcc and clang with the hardened checks (which
shows the implementation has always been correct -- only the tests were
under-strict).

Relates to #765, #770

Co-auth... (continued)

3 of 15 new or added lines in 1 file covered. (20.0%)

18 existing lines in 4 files now uncovered.

45429 of 53906 relevant lines covered (84.27%)

6353118.92 hits per line

Uncovered Changes

Lines Coverage ∆ File
12
48.98
-12.13% internal/constexpr_math/api/pow.cpp

Coverage Regressions

Lines Coverage ∆ File
8
93.48
-0.48% include/sw/universal/number/cfloat/cfloat_impl.hpp
5
50.45
-4.5% include/sw/universal/verification/posit_test_suite_randoms.hpp
4
89.24
-0.57% include/sw/universal/number/posito/posito_impl.hpp
1
81.47
0.67% include/sw/universal/number/posit1/specialized/posit_16_1.hpp
Jobs
ID Job ID Ran Files Coverage
1 24956707653.1 26 Apr 2026 12:59PM UTC 644
84.27
GitHub Action Run
Source Files on build 24956707653
  • Tree
  • List 644
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24956707653
  • dafbd5ce on github
  • Prev Build on main (#24956675961)
  • Next Build on main (#24957906871)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc