Skip to content

Add shared discrete distribution reference tests - #281

Open
jmh530 wants to merge 1 commit into
libmir:masterfrom
jmh530:codex/discrete-shared-cases
Open

jmh530 wants to merge 1 commit into
libmir:masterfrom
jmh530:codex/discrete-shared-cases

Conversation

@jmh530

@jmh530 jmh530 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Add shared numerical cases for binomial, negative-binomial, hypergeometric, and Poisson distributions, exercising float, double, real, and Fp!64 at the same inputs. This advances the discrete test-parity review for #157 without changing production behavior.

The tests cover PMFs, log-PMFs, scalar and checked tails, and inverse CDFs. Binomial and negative-binomial cases include exactly represented cumulative-boundary queries. Hypergeometric and Poisson checked tails use independently rounded Fp references, and checked results must report success before their values are inspected.

These small cases run in the ordinary test suite and complement existing precision-specific and slow-numerics coverage. They do not establish unrestricted checked ranges or full-precision accuracy for every type.

Validation:

  • Windows DMD 2.113: 24 modules passed.
  • Optimized Windows LDC 1.43: 24 modules passed.
  • Optimized Windows DMD 32-bit with DIP1000: four focused test modules passed.
  • Optimized Windows LDC 32-bit: four focused test modules passed using the isolated dependency fix associated with Fix x86 BigInt division by powers of two mir-algorithm#506; this does not establish success with the unmodified released dependency.
  • DMD testing against the locally combined pending discrete PR changes: 24 modules passed.
  • Git whitespace checks passed.

AI-Assisted-By: Codex (GPT-6 Astra Medium)

Exercise binomial, negative-binomial, hypergeometric, and Poisson
distributions at the same inputs for float, double, real, and Fp!64.
Cover PMFs, log-PMFs, tails, and inverse CDFs across the scalar and
checked APIs.

Include exact cumulative-boundary queries for binomial and
negative-binomial inverses, and independently rounded Fp tail
references for hypergeometric and Poisson. Require successful
checked statuses before inspecting results.

Keep these small cases in the ordinary test suite to complement
the existing precision-specific and slow-numerics tests.

AI-Assisted-By: Codex (GPT-6 Astra Medium)
@jmh530
jmh530 force-pushed the codex/discrete-shared-cases branch from b863f9f to f9cb244 Compare November 16, 2026 21:22
@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant