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

Do not eagerly call next_uNN in fill_bytes with empty remainder #122

Merged
merged 2 commits into from
Dec 2, 2021

Conversation

lopopolo
Copy link
Member

@lopopolo lopopolo commented Dec 2, 2021

Fix a bug where random numbers are consumed from the Mersenne Twister
even when they will never be used because the remainder from the chunks
iterator in fill_bytes is non-empty.

This regression was introduced in:

Add a basic smoke check for reproducibility with MRI's RNG pulled from
spinoso-random in artichoke/artichoke.

Prepare to release this change as v4.1.1 and yank v4.1.0.

Fix a bug where random numbers are consumed from the Mersenne Twister
even when they will never be used because the remainder from the chunks
iterator in `fill_bytes` is non-empty.

This regression was introduced in:

- #116

Add a basic smoke check for reproducibility with MRI's RNG pulled from
`spinoso-random` in artichoke/artichoke.
@lopopolo lopopolo added A-core Area: Core Mersenne Twister implementation. C-bug Category: This is a bug. A-release Area: crates.io releases and version bumps. labels Dec 2, 2021
@lopopolo lopopolo merged commit 147a153 into trunk Dec 2, 2021
@lopopolo lopopolo deleted the fill-bytes-eager-with-empty-remainder branch December 2, 2021 06:48
@lopopolo
Copy link
Member Author

lopopolo commented Dec 2, 2021

v4.1.1 is released; v4.1.0 is yanked.

$ cargo publish --dry-run
    Updating crates.io index
   Packaging rand_mt v4.1.1 (/Users/lopopolo/dev/artichoke/rand_mt)
   Verifying rand_mt v4.1.1 (/Users/lopopolo/dev/artichoke/rand_mt)
   Compiling rand_core v0.6.3
   Compiling rand_mt v4.1.1 (/Users/lopopolo/dev/artichoke/rand_mt/target/package/rand_mt-4.1.1)
    Finished dev [unoptimized + debuginfo] target(s) in 2.58s
   Uploading rand_mt v4.1.1 (/Users/lopopolo/dev/artichoke/rand_mt)
warning: aborting upload due to dry run
$ cargo publish
    Updating crates.io index
   Packaging rand_mt v4.1.1 (/Users/lopopolo/dev/artichoke/rand_mt)
   Verifying rand_mt v4.1.1 (/Users/lopopolo/dev/artichoke/rand_mt)
   Compiling rand_core v0.6.3
   Compiling rand_mt v4.1.1 (/Users/lopopolo/dev/artichoke/rand_mt/target/package/rand_mt-4.1.1)
    Finished dev [unoptimized + debuginfo] target(s) in 1.44s
   Uploading rand_mt v4.1.1 (/Users/lopopolo/dev/artichoke/rand_mt)
$ cargo yank --vers 4.1.0
    Updating crates.io index
        Yank rand_mt:4.1.0

lopopolo added a commit to artichoke/artichoke that referenced this pull request Dec 2, 2021
Pull in a bugfix for MRI reproducibility:

- artichoke/rand_mt#122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core Mersenne Twister implementation. A-release Area: crates.io releases and version bumps. C-bug Category: This is a bug.
Development

Successfully merging this pull request may close these issues.

1 participant