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

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

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 29 Mar 2026 02:13AM UTC
Jobs 1
Files 630
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

29 Mar 2026 01:43AM UTC coverage: 84.362% (+0.04%) from 84.326%
23698846356

push

github

web-flow
feat(ucalc): stochastic rounding simulation command (#663)

* feat(ucalc): stochastic rounding simulation command (#635)

Add `stochastic <expr> N` that simulates stochastic rounding by
randomly choosing between the two nearest representable values,
proportional to proximity. Reports distribution, mean, exact value,
and bias over N trials.

Algorithm:
1. Evaluate expression in qd for the high-precision exact value
2. Find floor and ceil representable values in the active type
3. For each trial, pick floor with probability (ceil-exact)/(ceil-floor)
   and ceil with probability (exact-floor)/(ceil-floor)
4. Report distribution, mean, and bias

Uses fixed seed (42) for reproducibility. Up to 10M trials.

Example:
  bfloat16> stochastic 0.1 + 0.2 10000
  unique results: 2
  0.2988                  4024 (40.2%)
  0.3008                  5976 (59.8%)
  mean:  0.2999953125
  bias:  -4.6875e-06

All output formats: plain, --json, --csv, --quiet.

Resolves #635

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

* fix(ucalc): resolve CodeRabbit review items for stochastic command

Three fixes:

1. Strict trial count parser: rejects trailing junk like "1000foo"
   using std::stoi consumed-position check. Also handles tab separator.

2. Online incremental mean: replaces running sum to prevent overflow
   with 10M trials. Uses mean += (x - mean) / n formula.

3. Comment documenting double interchange limitation for exact_val
   (qd reference truncated to double for neighbor finding).

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

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

44592 of 52858 relevant lines covered (84.36%)

6100405.47 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
80.58
-0.22% include/sw/universal/number/posit1/specialized/posit_16_1.hpp
Jobs
ID Job ID Ran Files Coverage
1 23698846356.1 29 Mar 2026 02:13AM UTC 630
84.36
GitHub Action Run
Source Files on build 23698846356
  • Tree
  • List 630
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23698846356
  • 5dbacb26 on github
  • Prev Build on main (#23696561882)
  • Next Build on main (#23699570506)
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