Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use StableRNGs in tests #275

Open
greimel opened this issue Jul 5, 2022 · 0 comments
Open

Use StableRNGs in tests #275

greimel opened this issue Jul 5, 2022 · 0 comments

Comments

@greimel
Copy link
Contributor

greimel commented Jul 5, 2022

@oyamad asked me to expand my comment in #274 into an issue. Here it is.

A lot of tests currently depend on outcomes of simulations. In order to get reproducible results, the tests set seeds. However the random number streams are not guaranteed to be the same across Julia versions. This led to the problem visible in #274: a test suddenly broke on Julia 1.7 and above.

In order to avoid this one can use the package https://github.com/JuliaRandom/StableRNGs.jl, which guarantees reproducible streams of random numbers across Julia versions.

I am afraid that this would require rewriting some of the functionality of this package to accept an RNG as in

rng = StableRNG(seed::Integer) # random number generator object
rand(rng, X)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants