Skip to content

Replace MT19937 with NumPy PCG64 - #98

Open
MLopez-Ibanez wants to merge 2 commits into
mainfrom
copilot/pcg64-rng
Open

MLopez-Ibanez wants to merge 2 commits into
mainfrom
copilot/pcg64-rng

Conversation

@MLopez-Ibanez

@MLopez-Ibanez MLopez-Ibanez commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Import only the pristine NumPy pcg64.h and LICENSE.md in the first commit, pinned to 98acfbde9876839be145d022beb76e7ff835e8e1.
  • Integrate the header-only PCG64 routines in the second commit. The only changes to the imported header are explicit casts for native, emulated, and Windows conversion warnings.
  • Update C, R, and Python builds, distributions, attribution, examples, and existing tests. Seeded results intentionally differ from earlier moocore versions and NumPy seed initialization.
  • Do not include the unused pcg64.c or a standalone C RNG test.

Merge the compatible external regressions in multi-objective/testsuite#7 first.

Fixes #85

Validation

  • Current tree: GCC make test with -O3 -flto and WERROR=1: all 111 external regressions pass; C distribution inputs verified.
  • Current tree: Python sdist and wheel build successfully; installed wheel suite: 101 passed, 2 expected failures. Both distributions contain the header, license, and provenance.
  • Current tree: R source package builds and R CMD check --no-manual --no-vignettes completes without errors or warnings (3 notes).
  • Before removing the unused source and standalone test, strict GCC and Clang builds, native and emulated arithmetic, Windows cross-builds, and all four external targets (make time, make test, make asan, make ubsan) passed. The hosted external matrix passed on that earlier PR revision.

On 32-bit MinGW, upstream tests of _M_AMD64 emit -Wundef warnings when that flag is enabled; those upstream conditionals are unchanged to keep the vendor delta limited to casts.

@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.47%. Comparing base (6102d37) to head (c2b3aa3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   78.44%   78.47%   +0.03%     
==========================================
  Files          70       69       -1     
  Lines        7593     7585       -8     
  Branches     1477     1475       -2     
==========================================
- Hits         5956     5952       -4     
+ Misses       1267     1262       -5     
- Partials      370      371       +1     
Flag Coverage Δ
R 72.18% <100.00%> (-0.08%) ⬇️
python 75.72% <100.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
C 74.83% <100.00%> (-0.02%) ⬇️
R 81.59% <ø> (ø)
Python tests 100.00% <100.00%> (ø)
Python src 81.79% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown

📚 R docs preview for this PR

@github-actions

Copy link
Copy Markdown

📚 Python docs preview for this PR

MLopez-Ibanez and others added 2 commits November 12, 2026 18:08
Source: numpy/numpy@98acfbd, numpy/random/src/pcg64

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Silence conversion warnings with explicit casts, including the emulated 128-bit paths used on Windows. Use the inline PCG64 routines directly and retain upstream provenance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Using PCG64 instead of mt19937

1 participant