Skip to content

Add a focused DUB target for distribution unit tests - #392

Merged
jmh530 merged 3 commits into
libmir:masterfrom
jmh530:codex/distribution-tests
Dec 1, 2026
Merged

jmh530 merged 3 commits into
libmir:masterfrom
jmh530:codex/distribution-tests

Conversation

@jmh530

@jmh530 jmh530 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Run dub test mir-stat:distribution-tests from the repository root to exercise the ordinary distribution tests and their shared helpers. Use dub test for the full library suite.

The target discovers modules under mir.stat.distribution automatically, including modules that no other test imports. It lists shared helper sources in the DUB recipe so per-file builds compile each helper once. A short local runner path keeps Windows coverage report names manageable in long checkouts.

Move the Fp!64 noncentral chi-squared log-density cutoff test to module scope. DMD and LDC could silently skip the nested unittest when a separately compiled module instantiated the template.

Validation

  • On the rebased branch, the focused suite passed all 72 modules on Windows with DMD 2.114.0 in default mode and LDC 1.43.0 in singleFile mode. The full DMD suite passed all 113 modules.
  • Before rebasing, DMD coverage confirmed that each of the three cutoff assertions ran exactly once in both default and singleFile modes.

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

Register `dub test mir-stat:distribution-tests` for local work on
distributions. Compile the distribution source tree with the ordinary
mir_stat_test version and follow its imports so DMD and LDC also run
the unit tests for shared helpers, including covariance views.

Document the focused command alongside the full suite and slow numerical
reference sweeps. On Windows with DMD 2.114.0, a forced build and test
run took 42 seconds for the 72 focused modules and 2m 09s for the full
113-module suite.

AI-Assisted-By: Codex (GPT-6.2 Astra Medium)
The folded log-density test lived inside the NoncentralChi2 template.
When a separately compiled module instantiated it for Fp!64, DMD and
LDC could skip the nested unittest and still report a passing suite.

Move the test to module scope and instantiate NoncentralChi2!(Fp!64)
there. DMD coverage confirmed that all three assertions ran once in
both the default package build and per-file compilation.

AI-Assisted-By: Codex (GPT-6.2 Astra Medium)
Keep automatic discovery of distribution modules and list their shared
helpers as DUB sources. With singleFile compilation, the previous -i
flags could emit the same helper in multiple objects and cause duplicate
definitions at link time.

Enable mir_stat_test for coverage builds as well as ordinary unittests.
Use a short local runner path so Windows coverage report names fit in
long checkout paths.

AI-Assisted-By: Codex (GPT-6.2 Astra Medium)
@codecov

codecov Bot commented Dec 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jmh530
jmh530 merged commit 6f3b5de into libmir:master Dec 1, 2026
23 checks passed
@jmh530
jmh530 deleted the codex/distribution-tests branch December 1, 2026 00:51
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