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

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

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 23 Apr 2026 11:24PM UTC
Jobs 1
Files 633
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

23 Apr 2026 10:57PM UTC coverage: 84.39% (+0.02%) from 84.374%
24863021025

push

github

web-flow
feat(posit): enable constexpr integer construction (Phase 1 of #713) (#714)

* feat(posit): enable constexpr integer construction (Phase 1 of #713)

Adds true constexpr integer-to-posit conversion via uint64_t shift/mask,
bypassing the previous double-cast route through convert_ieee754 (which is
not constexpr because std::frexp is not constexpr until C++26).

Changes:
- promote check_inward_projection_range to constexpr (pure integer fn)
- add convert_unsigned_integer / convert_signed_integer that build the
  posit encoding directly in a uint64_t accumulator with round-to-nearest-
  even on discarded fraction bits; saturate to maxpos/maxneg via the
  existing check_inward_projection_range
- reroute the integer operator= overloads (signed char ... unsigned long
  long) to the new functions; for nbits > 64 they fall back to the
  existing IEEE-754 path
- negation for signed inputs is performed as two's complement on a
  uint64_t (mask + ~x + 1), avoiding the non-constexpr blockbinary
  arithmetic chain
- add static_assert-style smoke tests in static/tapered/posit/api/api.cpp
  that verify constexpr-constructed posits match the runtime encoding
  across nbits in {8, 16, 32, 64} including saturation and INT_MIN

Side effect: integer-to-posit for wide inputs (e.g., int64 into
posit<64,3>) is now bit-exact rather than going through a lossy
double-cast intermediate. The existing regression suite is robust to
this because VerifyIntegerConversion only enumerates posit-representable
integers.

Phases 2 and 3 (constexpr float/double construction, blockbinary
constexpr promotion) are tracked separately.

Resolves #713

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

* fix(posit): char signedness dispatch, independent test reference (CodeRabbit)

Two issues from CodeRabbit on PR #714:

1. operator=(char) hardcoded an unsigned cast, so on signed-char platforms
   (the common case) char(-3) was reinterpreted as 253 and produced the
   wrong pos... (continued)

67 of 79 new or added lines in 1 file covered. (84.81%)

2 existing lines in 1 file now uncovered.

44908 of 53215 relevant lines covered (84.39%)

6512805.23 hits per line

Uncovered Changes

Lines Coverage ∆ File
12
93.17
-0.81% include/sw/universal/number/posit/posit_impl.hpp

Coverage Regressions

Lines Coverage ∆ File
2
89.8
-0.57% include/sw/universal/number/posito/posito_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 24863021025.1 23 Apr 2026 11:24PM UTC 633
84.39
GitHub Action Run
Source Files on build 24863021025
  • Tree
  • List 633
  • Changed 4
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24863021025
  • a9b924af on github
  • Prev Build on main (#24585301926)
  • Next Build on main (#24864610179)
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