Skip to content

XorShiftRng::new should use a non-constant seed #8359

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

Closed
brson opened this issue Aug 7, 2013 · 4 comments
Closed

XorShiftRng::new should use a non-constant seed #8359

brson opened this issue Aug 7, 2013 · 4 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Aug 7, 2013

It appears that all XorShiftRng's are initialized with the same seed by default. Looks like a foot-gun to me.

@brson
Copy link
Contributor Author

brson commented Aug 7, 2013

I'm not entirely sure if it's ok to just seed with random numbers or not. Paper is here: http://www.jstatsoft.org/v08/i14/paper

@brson
Copy link
Contributor Author

brson commented Aug 7, 2013

Apparently bad seeds make xorshift suck, so this may not be easy.

@ghost ghost assigned huonw Aug 7, 2013
@omasanori
Copy link
Contributor

FYI xorshift engines obviously work bad when w = x = y = z = 0.

@lilyball
Copy link
Contributor

From skimming the paper, it suggests that the seeds can be drawn randomly from the set of integers, as long as they're not all 0. Looking at various results for Googling for "xorshift seed" seems to back this up.

bors added a commit that referenced this issue Aug 18, 2013
@bors bors closed this as completed in e7b8524 Aug 18, 2013
@brson brson unassigned huonw Jun 16, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Jan 27, 2022
Rustup

r? `@ghost`

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants