Skip to content
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

Use wyrand final v4.2 constants for gen_u64() #82

Merged
merged 1 commit into from
Apr 27, 2024

Conversation

Bluefinger
Copy link
Contributor

BREAKING CHANGE

This PR introduces updates to fastrand's Wyrand algorithm, primarily using updated constants from the final v4.2 implementation of wyhash. This modification of the constants means the output of the generator is different, hence the breaking change. Based on the C reference, the new constants are generated using the same secrets algorithm but with a modification to ensure the constants are also large prime numbers. This additional property has helped improve the quality of the hashing for wyhash and the reference wyrand function.

Given the wide usage of fastrand, improving the quality of the generated output will be a nice plus, especially if it does not involve any performance hits (since fastrand is about being fast). But it will necessitate a new major version as anyone relying on deterministic output will have different generated sequences compared to before.

Reference:
C reference wyrand function

Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No time to review this now, but I think there is precedent that changing the output is a minor version bump, not a major version bump.

#20 (comment)

Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@notgull notgull merged commit 351a708 into smol-rs:master Apr 27, 2024
14 checks passed
@notgull notgull mentioned this pull request Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants