-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
Add Lcg128CmDxsm64 generator compatible with NumPy's PCG64DXSM #1202
Conversation
I see at least two issues here:
|
It does work by explicitly setting the state to what results from our (and pcg-cpp's) initialization, but of course this not so helpful for practical compatibility between programs using NumPy and ones using this crate.
|
It does look like LLVM exploits the cheap multiplier constant: https://godbolt.org/z/q6xcoaMKr |
@adamreichold Thanks! Does this PR supersede #1201, or do you think we need the other variants as well? |
Looks good, I only have minor comments, see above. It would be nice to have a constructor compatible with NumPy's |
Thank you for taking the time to review this!
Consider the aim for a minimal implementation for Concerning your inline comments: Since I started by copying the |
I will look into this. Due to the value stability guarantees given by NumPy, this should be possible without becoming a maintenance nightmare. But indeed, I would like to make this a separate PR to not block these changes on it (as personally, I would not immediately use that compatibility) and make them as limited as possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me!
@dhardy I think this is a reasonable addition, and minimal enough given that it is limited to one RNG.
Sure, feel free to update them as well (in a separate commit if possible). |
Added a separate commit to do the copy-editing in the existing code. Also note that according to the original author, this variant is supposed to become the "new" |
@dhardy Do you still have comments on this PR? |
No, I don't see much to comment on. Adding benchmarks would be nice but not required. @vks already reviewed so I'll let him merge this. |
…ed for Lcg128CmDxsm64.
I added
|
Thanks! |
Fixes #1200