Recognition: unknown
Randompack: Cross-Platform Reproducible Random Number Generation and Distribution Sampling
Pith reviewed 2026-05-08 15:37 UTC · model grok-4.3
The pith
Randompack separates random engines from distribution samplers to deliver faster performance and identical results from the same seeds across languages, hardware, and compilers.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
Randompack is a C library that implements engines including xoshiro256, PCG64, Philox, ranlux++, and sfc64 together with uniform, normal, exponential, gamma, beta, multivariate normal, and other distributions; any engine can be paired with any distribution because the layers are separated, and the same seeds produce identical results on every supported platform and language.
What carries the argument
The separation of the random engine layer from the distribution sampling layer, which allows independent selection while preserving cross-platform bit compatibility.
If this is right
- Parallel simulations can use the same seed on different machines and obtain identical results without additional synchronization.
- Any of the supported engines can be swapped into any distribution sampler without rewriting code or losing reproducibility.
- Raw bit streams, bounded integers, permutations, and sampling without replacement are all available through the same interface.
- Interfaces for Fortran, Python, Julia, and R deliver the same performance and reproducibility guarantees as the core C implementation.
- The MIT license permits free integration into both open-source and proprietary statistical software.
Where Pith is reading between the lines
- The modular design could reduce the frequency of platform-specific bugs that currently appear when the same statistical model is reimplemented in different languages.
- Adoption might allow research groups to share exact random sequences for peer review without needing to archive large binary files.
- The emphasis on raw bit streams and permutations suggests the library could serve as a foundation for Monte Carlo methods beyond the distributions explicitly listed.
- Because the library is packaged through conda-forge, it lowers the barrier for reproducible environments in data-science pipelines that mix C and Python code.
Load-bearing premise
The benchmarks used fair, fully optimized configurations of the competing libraries and Randompack contains no hidden bugs that would affect either speed or the claimed cross-platform reproducibility.
What would settle it
Execute the library's own benchmark programs and test suite on at least two different CPU architectures or compilers with identical seeds and observe either slower performance than the best competing library or any difference in generated values.
Figures
read the original abstract
A C library for random number generation, Randompack, is presented. The library implements several modern random number generators (engines), including xoshiro256, PCG64, Philox, ranlux++, and sfc64; 14 continuous distributions including uniform, normal, exponential, gamma, beta, and multivariate normal; raw bit streams, bounded integers, permutations, and sampling without replacement. The engine and the distribution layers are separated so any engine can be used with any distribution. Benchmarks show that Randompack is faster overall than competing libraries, with speedup factors ranging from about 1 to 15 depending on engine, distribution, interface, and platform. A distinguishing feature is reproducibility: with the same seeds Randompack gives compatible results across programming languages, computers, CPU architectures, and compilers. The library includes comprehensive support for parallel simulation. It is accompanied by a comprehensive test suite, benchmarking programs, and example programs. Interfaces to Fortran, Python, Julia, and R have been implemented; their benchmark results are included, although their design and implementation are otherwise outside the scope of the article. Unlike other available C libraries with comparable scope, Randompack is permissively licensed under the MIT license, and it is open source and publicly available through GitHub and conda-forge.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript presents Randompack, a permissively licensed C library for random number generation and distribution sampling. It separates RNG engines (xoshiro256, PCG64, Philox, ranlux++, sfc64) from distribution samplers for 14 continuous distributions (uniform, normal, exponential, gamma, beta, multivariate normal, etc.), plus raw bits, bounded integers, permutations, and sampling without replacement. The library supports parallel simulation, includes a test suite and benchmarking programs, and provides interfaces to Fortran, Python, Julia, and R. Benchmarks indicate overall faster performance than competing libraries with speedups ranging from 1x to 15x depending on engine, distribution, interface, and platform. A core feature is cross-platform reproducibility: identical seeds produce compatible results across programming languages, computers, CPU architectures, and compilers. The library is open source via GitHub and conda-forge.
Significance. If the performance and reproducibility claims hold under scrutiny, this provides a valuable, practical tool for reproducible Monte Carlo simulations and statistical computing workflows that span languages and hardware. The modular architecture (engine-distribution separation), comprehensive test suite, public benchmarks, and permissive MIT licensing are explicit strengths that facilitate adoption and verification. The cross-language interfaces and parallel support address real needs in multi-platform research, and the open availability mitigates concerns about hidden implementation details.
major comments (2)
- [Benchmarks] Benchmarks section: the overall 'faster' claim with speedups of 1-15x is central to the contribution, but the text does not specify the exact versions, compilation flags (e.g., -O3 vs. defaults), or hardware configurations used for all competing libraries (GSL, Boost, etc.); without this, the fairness of the comparisons cannot be fully assessed and the speedup range may not be reproducible.
- [Reproducibility] Reproducibility section: the claim that 'with the same seeds Randompack gives compatible results across programming languages, computers, CPU architectures, and compilers' is load-bearing for the distinguishing feature, yet the manuscript provides no concrete verification data, test outputs, or discussion of floating-point consistency in distribution sampling to support it beyond the architecture description.
minor comments (3)
- [Abstract] The abstract lists only a subset of the 14 distributions; a complete enumeration or reference to the full list in the library description section would improve clarity.
- Figure captions in the benchmark results should explicitly state the axes, units, and what each bar or line represents to allow readers to interpret the speedup factors without referring back to the text.
- [Examples] The parallel simulation support is described at a high level; adding a short code snippet or API usage example in the examples section would aid users implementing concurrent simulations.
Simulated Author's Rebuttal
We thank the referee for the positive assessment and the recommendation for minor revision. We address each of the major comments below, providing clarifications and committing to revisions where appropriate to strengthen the manuscript.
read point-by-point responses
-
Referee: [Benchmarks] Benchmarks section: the overall 'faster' claim with speedups of 1-15x is central to the contribution, but the text does not specify the exact versions, compilation flags (e.g., -O3 vs. defaults), or hardware configurations used for all competing libraries (GSL, Boost, etc.); without this, the fairness of the comparisons cannot be fully assessed and the speedup range may not be reproducible.
Authors: We agree that detailed specification of the benchmarking environment is necessary to substantiate the performance claims and allow for independent verification. In the revised manuscript, we will add comprehensive details on the hardware configurations (including CPU models, architectures, and operating systems), compiler versions, optimization flags (explicitly noting -O3 and any others used), and the exact versions of all competing libraries such as GSL and Boost. This information will be presented in a new table or expanded text within the Benchmarks section to ensure transparency and reproducibility of the reported speedups. revision: yes
-
Referee: [Reproducibility] Reproducibility section: the claim that 'with the same seeds Randompack gives compatible results across programming languages, computers, CPU architectures, and compilers' is load-bearing for the distinguishing feature, yet the manuscript provides no concrete verification data, test outputs, or discussion of floating-point consistency in distribution sampling to support it beyond the architecture description.
Authors: The reproducibility feature is indeed central, and while the manuscript describes the architectural choices that enable it (such as portable RNG implementations and separation of concerns), we acknowledge the value of empirical verification. We will revise the Reproducibility section to include concrete test outputs demonstrating identical results across platforms for selected distributions and engines. We will also add a discussion of floating-point consistency, explaining that the library relies on standard C math functions and IEEE 754-compliant arithmetic, with any minor variations attributable to floating-point semantics rather than the RNG or sampling methods themselves. revision: yes
Circularity Check
No significant circularity in software implementation and benchmarking paper
full rationale
The paper presents a C library (Randompack) for RNG engines and distribution sampling, with benchmarks, test suites, and cross-language interfaces. It contains no mathematical derivations, equations, predictions, or self-referential claims of the types listed in the circularity patterns. Performance and reproducibility claims are grounded in the described artifacts, public code, and empirical benchmarks rather than any reduction to fitted inputs or self-citations by construction. This matches the reader's assessment of zero circularity for a non-derivational software paper.
Axiom & Free-Parameter Ledger
Reference graph
Works this paper leans on
-
[1]
L. Yu. Barash and L. N. Shchur. 2014. PRAND: GPU accelerated parallel random number generation library: Using most reliable algorithms and applying parallelism of modern GPUs and CPUs.Computer Physics Communications185, 4 (2014), 1343–1353. doi:10.1016/j.cpc.2014.01.012
-
[2]
Bernstein
Daniel J. Bernstein. 2008. ChaCha, a variant of Salsa20. Workshop Record of SASC 2008: The State of the Art of Stream Ciphers, Vol. 8, pp. 3–5. https://cr.yp.to/chacha/chacha-20080128.pdf
2008
-
[3]
Kamalika Bhattacharjee and Sukanta Das. 2022. A search for good pseudo-random number generators: survey and empirical studies.Computer Science Review45 (2022), 100471. doi:10.1016/j.cosrev.2022.100471
-
[4]
David Blackman and Sebastiano Vigna. 2021. Scrambled linear pseudorandom number generators.ACM Trans. Math. Software47, 4 (2021), 36:1–36:32. doi:10.1145/3460772
-
[5]
George E. P. Box and Mervin E. Muller. 1958. A note on the generation of random normal deviates.The Annals of Mathematical Statistics29, 2 (1958), 610–611. doi:10.1214/aoms/1177706645
-
[6]
Robert G. Brown. 2006.DieHarder: A Gnu Public License Random Number Tester. Technical Report. Duke University Physics Department, Durham, NC. https://rurban.github.io/dieharder/manual/dieharder.pdf
2006
-
[7]
Francis X. Diebold, Todd A. Gunther, and Anthony S. Tay. 1998. Evaluating density forecasts with applications to financial risk management. International Economic Review39, 4 (Nov. 1998), 863–883. doi:10.2307/2527342
-
[8]
Jurgen A. Doornik. 2005.An Improved Ziggurat Method to Generate Normal Random Samples. Technical Report. Nuffield College, University of Oxford. https://www.doornik.com/research/ziggurat.pdf
2005
-
[9]
Chris Doty-Humphrey. 2010. PractRand: A practical random number generator test suite (including the SFC family of generators). http: //pracrand.sourceforge.net. Accessed 2026-02-23
2010
-
[10]
Richard Durstenfeld. 1964. Algorithm 235: random permutation.Commun. ACM7, 7 (1964), 420. doi:10.1145/364520.364540
- [11]
-
[12]
Fisher and Frank Yates
Ronald A. Fisher and Frank Yates. 1938.Statistical Tables for Biological, Agricultural and Medical Research(3 ed.). Oliver and Boyd, London
1938
-
[13]
Cameron Foreman, Richie Yeung, and Florian J. Curchod. 2024. Statistical testing of random number generators and their improvement using randomness extraction.Entropy26, 12 (2024), 1053. doi:10.3390/e26121053
-
[14]
Jill Leslie Gibson, Fred Burke Jones, Michael Aaron Lively, Robert Currier Little, and Joel A. Kulesza. 2025.MCNP ® Site Support Newsletter First Quarter 2025. Technical Report LA-UR-25-21113. Los Alamos National Laboratory, Los Alamos, NM, USA. https://mcnp.lanl.gov/pdf_files/ TechReport_2025_LANL_LA-UR-25-21113_GibsonJonesEtAl.pdf Newsletter
2025
-
[15]
Pré-publication, Document de travail
Brian Gladman, Vincenzo Innocente, John Mather, and Paul Zimmermann. 2025. Accuracy of Mathematical Functions in Single, Double, Double Extended, and Quadruple Precision. HAL preprint / working paper. Listed in HAL as “Pré-publication, Document de travail”
2025
- [16]
-
[17]
Hiroshi Haramoto, Makoto Matsumoto, Takuji Nishimura, François Panneton, and Pierre L’Ecuyer. 2008. Efficient Jump Ahead forF 2-Linear Random Number Generators.INFORMS Journal on Computing20, 3 (2008), 385–390
2008
-
[18]
Wolfgang Hörmann and Josef Leydold. 2000. Random-number and random-variate generation: automatic random variate generation for simulation input. InProceedings of the 32nd Conference on Winter Simulation (WSC 2000), Paul A. Fishwick, Keebom Kang, Jeffrey A. Joines, and Russell R. Barton (Eds.). IEEE Press, Piscataway, NJ, 675–682. doi:10.5555/510378.510475...
-
[19]
F. James. 1990. A review of pseudorandom number generators.Computer Physics Communications60, 3 (1990), 329–344. doi:10.1016/0010- 4655(90)90032-V
-
[20]
jirka h. 2021. ranluxpp-portable: Portable version of Ranlux++ RNG. GitHub repository. https://github.com/jirka-h/ranluxpp-portable Accessed 2026-03-15
2021
-
[21]
2023.Reassessing the MCNP Random Number Generator
Colin James Josey. 2023.Reassessing the MCNP Random Number Generator. Technical Report LA-UR-23-25111, Rev. 1. Los Alamos National Laboratory, Los Alamos, NM, USA. doi:10.2172/1998091
-
[22]
A. J. Kinderman and J. F. Monahan. 1977. Computer generation of random variables using the ratio of uniform deviates.ACM Trans. Math. Software 3, 3 (1977), 257–260. doi:10.1145/355744.355750
-
[23]
Donald E. Knuth. 1969.The Art of Computer Programming, Volume 2: Seminumerical Algorithms(1 ed.). Addison-Wesley, Reading, MA
1969
-
[24]
Pierre L’Ecuyer. 1999. Good parameters and implementations for combined multiple recursive random number generators.Operations Research47, 1 (1999), 159–164. doi:10.1287/opre.47.1.159
-
[25]
Pierre L’Ecuyer. 2015. Random number generation with multiple streams for sequential and parallel computing. InProceedings of the 2015 Winter Simulation Conference. IEEE, Huntington Beach, CA, USA, 31–44. doi:10.1109/WSC.2015.7408151
-
[26]
Pierre L’Ecuyer. 2017. History of Uniform Random Number Generation. InProceedings of the 2017 Winter Simulation Conference. IEEE, Las Vegas, NV, USA, 202–230. doi:10.1109/WSC.2017.8247790
-
[27]
Pierre L’Ecuyer, David Munger, Boris Oreshkin, and Richard Simard. 2017. Random numbers for parallel computers: requirements and methods, with emphasis on GPUs.Mathematics and Computers in Simulation135 (2017), 3–17. doi:10.1016/j.matcom.2016.05.005
-
[28]
Pierre L’Ecuyer and Richard Simard. 2007. TestU01: a C library for empirical testing of random number generators.ACM Trans. Math. Software33, 4 (2007), 22:1–22:40. doi:10.1145/1268776.1268777
-
[29]
Pierre L’Ecuyer, Richard Simard, Eric J. Chen, and W. David Kelton. 2002. An object-oriented random-number package with many long streams and substreams.Operations Research50, 6 (2002), 1073–1075. doi:10.1287/opre.50.6.1073.358
-
[30]
Derrick Henry Lehmer. 1951. Mathematical methods in large-scale computing units. InProceedings of the Second Symposium on Large-Scale Digital Calculating Machinery (Annals of the Computation Laboratory, Vol. 26). Harvard University Press, Cambridge, MA, 141–146
1951
-
[31]
Daniel Lemire. 2019. Fast random integer generation in an interval.ACM Transactions on Modeling and Computer Simulation29, 1, Article 3 (2019), 12 pages. doi:10.1145/3230636
-
[32]
Daniel Lemire and Melissa E. O’Neill. 2019. xorshift1024*, xorshift1024+, xorshift128+ and xoroshiro128+ fail statistical tests for linearity. Computational and Applied Mathematics350 (2019), 139–142. doi:10.1016/j.cam.2018.10.019
-
[33]
Joseph L. Leva. 1992. A fast normal random number generator.ACM Trans. Math. Software18, 4 (1992), 449–453. doi:10.1145/138351.138364
-
[34]
Martin Lüscher. 1994. A portable high-quality random number generator for lattice field theory simulations.Computer Physics Communications79, 1 (1994), 100–110. doi:10.1016/0010-4655(94)90232-1
-
[35]
George Marsaglia. 1964. Generating a variable from the tail of the normal distribution.Technometrics6, 1 (1964), 101–102. doi:10.1080/00401706. 1964.10490150
-
[36]
George Marsaglia. 1996. DIEHARD: A Battery of Tests of Randomness. http://stat.fsu.edu/pub/diehard/
1996
-
[37]
George Marsaglia. 2003. xorshift RNGs.Journal of Statistical Software8, 14 (2003), 1–6. doi:10.18637/jss.v008.i14
-
[38]
George Marsaglia and Wai Wan Tsang. 1984. A fast, easily implemented method for sampling from decreasing or symmetric unimodal density functions.SIAM J. Sci. Statist. Comput.5, 2 (1984), 349–359. doi:10.1137/0905027
-
[39]
George Marsaglia and Wai Wan Tsang. 2000. A simple method for generating gamma variables.ACM Trans. Math. Software26, 3 (2000), 363–372. doi:10.1145/358407.358414
-
[40]
George Marsaglia and Wai Wan Tsang. 2000. The ziggurat method for generating random variables.Journal of Statistical Software5, 8 (2000), 1–7. doi:10.18637/jss.v005.i08
-
[41]
Makoto Matsumoto and Takuji Nishimura. 1998. Mersenne Twister: a 623-dimensionally equidistributed uniform pseudorandom number generator. ACM Transactions on Modeling and Computer Simulation8, 1 (1998), 3–30. doi:10.1145/272991.272995
-
[42]
Makoto Matsumoto, Isaku Wada, Ai Kuramoto, and Hyo Ashihara. 2007. Common defects in initialization of pseudorandom number generators. ACM Transactions on Modeling and Computer Simulation17, 4 (2007), 15:1–15:14. doi:10.1145/1276927.1276928
-
[43]
Christopher D. McFarland. 2016. A modified ziggurat algorithm for generating exponentially and normally distributed pseudorandom numbers. Journal of Statistical Computation and Simulation86, 7 (2016), 1281–1294. doi:10.1080/00949655.2015.1060234
-
[44]
2025.Upgrading PCG64 with PCG64DXSM
NumPy Developers. 2025.Upgrading PCG64 with PCG64DXSM. https://numpy.org/doc/stable/reference/random/upgrading-pcg64.html Accessed 2026-03-14
2025
-
[45]
Melissa E. O’Neill. 2014.PCG: A family of simple fast space-efficient statistically good algorithms for random number generation. Technical Report HMC-CS-2014-0905. Harvey Mudd College. Available at https://www.pcg-random.org/pdf/hmc-cs-2014-0905.pdf
2014
-
[46]
Melissa E. O’Neill. 2015. Developing a seed_seq Alternative. PCG, A Better Random Number Generator (blog). https://www.pcg-random.org/posts/ developing-a-seed_seq-alternative.html Accessed 2026-03-08
2015
-
[47]
Melissa E. O’Neill. 2019. Post on NumPy issue #13635: Decide on new PRNG BitGenerator default. https://github.com/numpy/numpy/issues/ 13635#issuecomment-506088698 GitHub issue comment
2019
-
[48]
François Panneton and Pierre L’Ecuyer. 2005. On the xorshift random number generators.ACM Transactions on Modeling and Computer Simulation 15, 4 (Oct. 2005), 346–361. doi:10.1145/1113316.1113319 Manuscript submitted to ACM Randompack: Cross-Platform Reproducible Random Number Generation and Distribution Sampling 19
-
[49]
François Panneton, Pierre L’Ecuyer, and Makoto Matsumoto. 2006. Improved long-period generators based on linear recurrences modulo 2.ACM Trans. Math. Software32, 1 (2006), 1–16. doi:10.1145/1132973.1132974
-
[50]
Stephen K. Park and Keith W. Miller. 1988. Random number generators: good ones are hard to find.Commun. ACM31, 10 (1988), 1192–1201. doi:10.1145/63039.63042
-
[51]
2020.Security and Privacy Controls for Information Systems and Organizations
Andrew Rukhin, Juan Soto, James Nechvatal, Miles Smid, Elaine Barker, Stefan Leigh, Mark Levenson, Mark Vangel, David Banks, Alan Heckert, James Dray, San Vo, and Lawrence E. Bassham III. 2010.A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications. NIST Special Publication 800-22 Rev. 1a. National Institute o...
-
[52]
Markku-Juhani O. Saarinen. 2022. SP 800–22 and GM/T 0005–2012 tests: clearly obsolete, possibly harmful. In2022 IEEE European Symposium on Security and Privacy Workshops (EuroS&PW). IEEE, Genoa, Italy, 31–37. doi:10.1109/EuroSPW55150.2022.00011
-
[53]
John K. Salmon, Mark A. Moraes, Ron O. Dror, and David E. Shaw. 2011. Parallel Random Numbers: As Easy as 1, 2, 3. InProceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC ’11). ACM, New York, NY, USA, 16:1–16:12. doi:10.1145/2063384.2063405
-
[54]
Werner Schindler and Wolfgang Killmann. 2003. Evaluation Criteria for True (Physical) Random Number Generators Used in Cryptographic Applications. InCryptographic Hardware and Embedded Systems – CHES 2002 (Lecture Notes in Computer Science, Vol. 2523). Springer, Heidelberg, 431–449. doi:10.1007/3-540-36400-5_31
-
[55]
Naoki Shibata. 2025. SLEEF: SIMD Library for Evaluating Elementary Functions. https://github.com/shibatch/sleef. GitHub repository
2025
-
[56]
Naoki Shibata and Francesco Petrogalli. 2020. SLEEF: a portable vectorized library of C standard mathematical functions.IEEE Transactions on Parallel and Distributed Systems31, 6 (2020), 1316–1327. doi:10.1109/TPDS.2019.2960333
-
[57]
Alexei Sibidanov. 2017. A revision of the subtract-with-borrow random number generators.Computer Physics Communications221 (Dec. 2017), 299–303. doi:10.1016/j.cpc.2017.09.005
-
[58]
Jr. Steele, Guy L. and Sebastiano Vigna. 2021. LXM: better splittable pseudorandom number generators (and almost as fast).Proceedings of the ACM on Programming Languages5, OOPSLA (Oct. 2021), 148:1–148:31. doi:10.1145/3485525
-
[59]
Steele Jr., Doug Lea, and Christine H
Guy L. Steele Jr., Doug Lea, and Christine H. Flood. 2014. Fast splittable pseudorandom number generators. InProceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA ’14). ACM, New York, NY, USA, 453–472. doi:10.1145/2714064.2660195
-
[60]
doi:10.1090/S0025- 5718-1970-0274029-X
Robert C. Tausworthe. 1965. Random numbers generated by linear recurrence modulo two.Math. Comp.19, 90 (1965), 201–209. doi:10.1090/S0025- 5718-1965-0184406-1
-
[61]
The Julia Project and the OpenLibm Authors. 2025. OpenLibm. Project website. https://openlibm.org/
2025
-
[62]
Sebastiano Vigna. 2016. An experimental exploration of Marsaglia’s xorshift generators, scrambled.ACM Trans. Math. Software42, 4 (2016), 30:1–30:23. doi:10.1145/2845077
-
[63]
Sebastiano Vigna. 2017. Further scramblings of Marsaglia’s xorshift generators.J. Comput. Appl. Math.315 (2017), 175–181. doi:10.1016/j.cam.2016. 11.006
-
[64]
2026.A PRNG Shootout
Sebastiano Vigna. 2026.A PRNG Shootout. https://prng.di.unimi.it/ Accessed 2026-03-14
2026
-
[65]
Jeffrey S. Vitter. 1985. Random sampling with a reservoir.ACM Trans. Math. Software11, 1 (1985), 37–57. doi:10.1145/3147.3165
-
[66]
John von Neumann. 1951. Various techniques used in connection with random digits.Applied Mathematics Series12 (1951), 36–38
1951
-
[67]
B. A. Wichmann and I. D. Hill. 1982. Algorithm AS 183: an efficient and portable pseudo-random number generator.Applied Statistics31, 2 (1982), 188–190. doi:10.2307/2347988
- [68]
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.