-
Notifications
You must be signed in to change notification settings - Fork 43
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
r_session$new()
afects the random seed generator in a non reproducible way on Windows
#390
Comments
Indeed, to generate a unique pipe name: Lines 93 to 98 in 118704a
|
I believe it's OK to use R's RNG, but starting a session should modify the RNG state in a predictable manner. Such that, the RNG state is consistent accross multiple runs. With the current behavior, if you do |
So how is the code in the original post different than this? set.seed(1)
digest::sha1(.Random.seed)
rnorm(5)
digest::sha1(.Random.seed) I am sorry, my argument is not with you, really. But I am also not entirely sure what to do here. |
Here are two runs from the above and another two runs using the r_session:
Note that |
Well, yes, because it keeps generating random file names until one does not exist, and you are creating the second session while the first is still around, so that pipe file already exists. If you re-run it in a different session you get the same:
But yeah, I guess the file name is not something that is supposed to be reproducible, so I should not use the R RNG. Sadly, it is kind of hard to run the equivalent of |
I can do a release soon if this is important for you. |
Thanks! No hurry for a release, that's not urgent! |
For example, on Windows, if you run a few times:
You'll see that it that the RNG state is different after every execution.
The text was updated successfully, but these errors were encountered: