Closed Glinkis closed 4 years ago
Are you enabling extra entropy? If so, the specified seed is only part of the actual seed used, extra random entropy is added to it to create the final seed. Thus, you wouldn't be using the same effective seed.
Beyond that, the pull count in your two examples is different, which means that the internal states of the two seedable PRNGs are at different points—i.e., you're comparing apples to oranges, so of course they aren't going to be the same. Try getting the pull count to the same value and, if you're not adding extra entropy, you should see that the results are indeed the same.
The seedable PRNG works across completely different browser JavaScript engines, let alone different instances of the same JavaScript engine in the same browser.
You're absolutely correct. It turns out our issue was that we had data structures that were generated with some randomization before we actually set the seed. So when we used those after setting the seed, of course the results would vary, even though the pull count showed the same.
Initializing the
prng
state with the same seed in different browser tabs yields different results.Tab 1:
Tab 2:
Refreshing the same tab multiple times seems to be consistent, but if I clear the session state and refresh I get a different pull/float again.