JuliaRandom / StableRNGs.jl

A Julia RNG with stable streams
MIT License
58 stars 6 forks source link

Crush tests fail on M1 Pro #16

Open andreasnoack opened 1 year ago

andreasnoack commented 1 year ago

I'm getting

========= Summary results of Crush =========

 Version:          TestU01 1.2.3
 Generator:
 Number of statistics:  144
 Total CPU time:   00:23:31.56
 The following tests gave p-values outside [0.001, 0.9990]:
 (eps  means a value < 1.0e-300):
 (eps1 means a value < 1.0e-15):

       Test                          p-value
 ----------------------------------------------
  3  CollisionOver, t = 2            0.9998
 71  LinearComp, r = 0              1 -  8.3e-5
 ----------------------------------------------
 All other tests were passed

when running

julia> _rng = StableRNG(123)

julia> RNGTest.crushTestU01(() -> rand(_rng))

on the following system

julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 8 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, westmere)
  Threads: 1 on 8 virtual cores
rfourquet commented 1 year ago

I'm surprised that this test passes on my x86_64-linux-gnu but not on M1 Pro... Beside, I also tested StableRNG agains PractRand a couple of weeks ago, and there was also a "problem" there. I'm not sure what to do about this though, except introducing another stable RNG, e.g. StableXoshiro, which could extend the scope of this package by providing a modern all-purpose RNG (suitable e.g. for simulations). Ref: https://discourse.julialang.org/t/saving-rng-state-reproducibility-in-large-scale-monte-carlo-simulations/89408