Changing the algorithm of random.h
#65450
Replies: 2 comments 2 replies
-
Is it used seeded in CLR tests? (@trylek) |
Beta Was this translation helpful? Give feedback.
-
There are no compat issues to be worried about with this algorithm. Majority of uses of this random number generator is for various runtime stress modes. Some runtime stress modes have their own local pseudo random number generator (e.g. look for StressRNG in gc.cpp). If you believe that it is better to have our own implementation of random number generator instead of just depending on
|
Beta Was this translation helpful? Give feedback.
-
I noticed that the CoreCLR's random number generator in
random.h
is using the original partially superseded algorithm ofSystem.Random
.While in the BCL we couldn't fully throw the old one away due to compatibility, the runtime's RNG is not a user-facing component but an internal implementation detail. I am interested in trying to replace it with Xoshiro128 or 256, like the BCL when unseeded but fully, meaning that same seeds will now return different results, and I am wondering if there any compatibility concerns I should be mindful of.
Perhaps @jkotas knows the answer.
Beta Was this translation helpful? Give feedback.
All reactions