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

dimchansky / wwruns-go / 45873383214
91%

Build:
DEFAULT BRANCH: main
Ran 26 Nov 2026 06:09PM UTC
Jobs 1
Files 5
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

11 Nov 2025 05:56PM UTC coverage: 91.392%. First build
45873383214

push

github

dimchansky
Wald–Wolfowitz runs test library: exact at every size, counts-based API, validated

wwruns tests whether a sequence of two kinds of value, in its real order,
clusters or alternates more than a random shuffle would.

API
  type Counts struct{ N1, N2, Runs int }
  func Test(c Counts, opts ...Option) (Result, error)
  type Counter struct{ ... }   // Add(v bool), Counts(); one pass, O(1) memory
  func CountLabels[T comparable](xs []T, positive, negative T) (Counts, error)
  func CountAboveBelow(xs []float64, threshold float64) (Counts, error)
  func CountAboveBelowMedian(xs []float64) (Counts, float64, error)
  Options: WithAlpha, WithMidP, WithContinuityCorrection, WithMethod.
  Result: decision (Reject, Why), PValue, critical bounds, Interpretation,
  CanDetect, Summary, one-line String. Errors start with "wwruns:";
  ErrInvalidCounts and ErrTooExpensive are matched with errors.Is.

The test needs only the sufficient statistics N1, N2 and Runs, so no array
is required: counts can come from memory, a file read line by line, an
iterator, SQL, or by hand, up to N = 2^53 (validated).

Methods
- Exact by default. Integer arithmetic (all run counts streamed over
  C(N, n1), O(1) live big.Ints) when N <= 10 000 or min(n1, n2) <= 2000;
  otherwise a double-double (~106-bit) walk over the relevant terms in
  three passes and O(1) memory, whose decisions always equal the integer
  computation (every decisive comparison clears a rigorous rounding-error
  bound, ~1e-22, or integers decide) and whose p-values are correctly
  rounded in practice.
- Normal approximation (continuity-corrected by default, or uncorrected as
  in the NIST e-Handbook) only for sigma = sqrt(Var[R]) > 1e5, where it is
  accurate to ~1e-5, or when selected.
- Exact computations beyond a cost budget return ErrTooExpensive instead
  of running for hours.

Fixes relative to the initial code
- The continuity correction no longer flips the sign of Z when
  |R - E| <= 0.5; alpha is validated; norma... (continued)

722 of 790 new or added lines in 5 files covered. (91.39%)

722 of 790 relevant lines covered (91.39%)

1490570.65 hits per line

Uncovered Changes

Lines Coverage ∆ File
48
89.07
runs.go
16
93.01
exactfloat.go
4
92.86
interpret.go
Jobs
ID Job ID Ran Files Coverage
1 45873383214.1 26 Nov 2026 06:09PM UTC 5
91.39
GitHub Action Run
Source Files on build 45873383214
  • Tree
  • List 5
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #45873383214
  • d3e2fe89 on github
  • Next Build on main (#45873948688)
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