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

Prepare rand 0.9.0-alpha.0 #1395

Merged
merged 5 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- [ ] Added a `CHANGELOG.md` entry

# Summary

# Motivation

# Details
36 changes: 32 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,44 @@ A [separate changelog is kept for rand_core](rand_core/CHANGELOG.md).

You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.html) useful.

## [0.9.0] - unreleased
## [0.9.0-alpha.0] - 2024-02-18
This is a pre-release. To depend on this version, use `rand = "=0.9.0-alpha.0"` to prevent automatic updates (which can be expected to include breaking changes).

### Generators
- Change `SmallRng::seed_from_u64` implementation (#1203)
- Replace `SeedableRng` impl for `SmallRng` with inherent methods, excluding `fn from_seed` (#1368)

### Sequences
- Simpler and faster implementation of Floyd's F2 (#1277). This
changes some outputs from `rand::seq::index::sample` and
`rand::seq::SliceRandom::choose_multiple`.
- New, faster algorithms for `IteratorRandom::choose` and `choose_stable` (#1268)
- New, faster algorithms for `SliceRandom::shuffle` and `partial_shuffle` (#1272)
- Re-introduce `Rng::gen_iter` (#1305)
- Split trait `SliceRandom` into `IndexedRandom`, `IndexedMutRandom`, `SliceRandom` (#1382)

### Distributions
- `{Uniform, UniformSampler}::{new, new_inclusive}` return a `Result` (instead of potentially panicking) (#1229)
- `Uniform` implements `TryFrom` instead of `From` for ranges (#1229)
- `Uniform` now uses Canon's method (single sampling) / Lemire's method (distribution sampling) for faster sampling (breaks value stability; #1287)
- Relax `Sized` bound on `Distribution<T> for &D` (#1278)
- Explicit impl of `sample_single_inclusive` (+~20% perf) (#1289)
- Impl `DistString` for `Slice<char>` and `Uniform<char>` (#1315)
- Let `Standard` support all `NonZero*` types (#1332)
- Add `trait Weight`, allowing `WeightedIndex` to trap overflow (#1353)
- Rename `WeightedError` to `WeightError`, revising variants (#1382)

### SIMD
- Switch to `std::simd`, expand SIMD & docs (#1239)
- Optimise SIMD widening multipy (#1247)

### Other
- Simpler and faster implementation of Floyd's F2 (#1277). This
changes some outputs from `rand::seq::index::sample` and
`rand::seq::SliceRandom::choose_multiple`.
- Bump MSRV to 1.60.0 (#1207, #1246, #1269, #1341)
- Improve `thread_rng` related docs (#1257)
- Add `Cargo.lock.msrv` file (#1275)
- Docs: enable experimental `--generate-link-to-definition` feature (#1327)
- Use `zerocopy` to replace some `unsafe` code (#1349)
- Support `std` feature without `getrandom` or `rand_chacha` (#1354)

## [0.8.5] - 2021-08-20
### Fixes
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rand"
version = "0.9.0"
version = "0.9.0-alpha.0"
authors = ["The Rand Project Developers", "The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down Expand Up @@ -65,18 +65,18 @@ members = [
]

[dependencies]
rand_core = { path = "rand_core", version = "0.7.0", default-features = false }
rand_core = { path = "rand_core", version = "=0.9.0-alpha.0", default-features = false }
log = { version = "0.4.4", optional = true }
serde = { version = "1.0.103", features = ["derive"], optional = true }
rand_chacha = { path = "rand_chacha", version = "0.4.0", default-features = false, optional = true }
rand_chacha = { path = "rand_chacha", version = "=0.9.0-alpha.0", default-features = false, optional = true }
zerocopy = { version = "=0.8.0-alpha.5", default-features = false, features = ["simd"] }

[target.'cfg(unix)'.dependencies]
# Used for fork protection (reseeding.rs)
libc = { version = "0.2.22", optional = true, default-features = false }

[dev-dependencies]
rand_pcg = { path = "rand_pcg", version = "0.4.0" }
rand_pcg = { path = "rand_pcg", version = "=0.9.0-alpha.0" }
# Only to test serde1
bincode = "1.2.1"
rayon = "1.5.3"
Expand Down
8 changes: 5 additions & 3 deletions rand_chacha/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Made `rand_chacha` propagate the `std` feature down to `rand_core`
- Performance improvements for AVX2: ~4-7%
## [0.9.0-alpha.0] - 2024-02-18
This is a pre-release. To depend on this version, use `rand_chacha = "=0.9.0-alpha.0"` to prevent automatic updates (which can be expected to include breaking changes).

- Made `rand_chacha` propagate the `std` feature down to `rand_core` (#1153)
- Remove usage of `unsafe` in `fn generate` (#1181) then optimise for AVX2 (~4-7%) (#1192)

## [0.3.1] - 2021-06-09
- add getters corresponding to existing setters: `get_seed`, `get_stream` (#1124)
Expand Down
4 changes: 2 additions & 2 deletions rand_chacha/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rand_chacha"
version = "0.4.0"
version = "0.9.0-alpha.0"
authors = ["The Rand Project Developers", "The Rust Project Developers", "The CryptoCorrosion Contributors"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand All @@ -19,7 +19,7 @@ rust-version = "1.60"
rustdoc-args = ["--generate-link-to-definition"]

[dependencies]
rand_core = { path = "../rand_core", version = "0.7.0" }
rand_core = { path = "../rand_core", version = "=0.9.0-alpha.0" }
ppv-lite86 = { version = "0.2.14", default-features = false, features = ["simd"] }
serde = { version = "1.0", features = ["derive"], optional = true }

Expand Down
9 changes: 9 additions & 0 deletions rand_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.9.0-alpha.0] - 2024-02-18
This is a pre-release. To depend on this version, use `rand_core = "=0.9.0-alpha.0"` to prevent automatic updates (which can be expected to include breaking changes).

- Bump MSRV to 1.60.0 (#1207, #1246, #1269, #1341)
- Allow `rand_core::impls::fill_via_u*_chunks` to mutate source (#1182)
- Add `fn RngCore::read_adapter` implementing `std::io::Read` (#1267)
- Add `trait CryptoBlockRng: BlockRngCore`; make `trait CryptoRng: RngCore` (#1273)
- Use `zerocopy` to replace some `unsafe` code (#1349, #1393)

## [0.6.4] - 2022-09-15
- Fix unsoundness in `<BlockRng64 as RngCore>::next_u32` (#1160)
- Reduce use of `unsafe` and improve gen_bytes performance (#1180)
Expand Down
2 changes: 1 addition & 1 deletion rand_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rand_core"
version = "0.7.0"
version = "0.9.0-alpha.0"
authors = ["The Rand Project Developers", "The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
19 changes: 15 additions & 4 deletions rand_distr/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.0] - unreleased
## [0.5.0-alpha.0] - 2024-02-18
This is a pre-release. To depend on this version, use `rand_distr = "=0.5.0-alpha.0"` to prevent automatic updates (which can be expected to include breaking changes).

### Additions
- Make distributions comparable with `PartialEq` (#1218)
- Add `WeightedIndexTree` (#1372)

### Changes
- Target `rand` version `0.9.0-alpha.0`
- Remove unused fields from `Gamma`, `NormalInverseGaussian` and `Zipf` distributions (#1184)
This breaks serialization compatibility with older versions.
- Upgrade Rand
- Fix Knuth's method so `Poisson` doesn't return -1.0 for small lambda
- Fix `Poisson` distribution instantiation so it return an error if lambda is infinite
- `Dirichlet` now uses `const` generics, which means that its size is required at compile time (#1292)
- The `Dirichlet::new_with_size` constructor was removed (#1292)

### Fixes
- Fix Knuth's method so `Poisson` doesn't return -1.0 for small lambda (#1284)
- Fix `Poisson` distribution instantiation so it return an error if lambda is infinite (#1291)
- Fix Dirichlet sample for small alpha values to avoid NaN samples (#1209)
- Fix infinite loop in `Binomial` distribution (#1325)

## [0.4.3] - 2021-12-30
- Fix `no_std` build (#1208)

Expand Down
8 changes: 4 additions & 4 deletions rand_distr/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rand_distr"
version = "0.5.0"
version = "0.5.0-alpha.0"
authors = ["The Rand Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand All @@ -27,15 +27,15 @@ std_math = ["num-traits/std"]
serde1 = ["serde", "rand/serde1"]

[dependencies]
rand = { path = "..", version = "0.9.0", default-features = false }
rand = { path = "..", version = "=0.9.0-alpha.0", default-features = false }
num-traits = { version = "0.2", default-features = false, features = ["libm"] }
serde = { version = "1.0.103", features = ["derive"], optional = true }
serde_with = { version = "3.6.1", optional = true }

[dev-dependencies]
rand_pcg = { version = "0.4.0", path = "../rand_pcg" }
rand_pcg = { version = "=0.9.0-alpha.0", path = "../rand_pcg" }
# For inline examples
rand = { path = "..", version = "0.9.0", features = ["small_rng"] }
rand = { path = "..", version = "=0.9.0-alpha.0", features = ["small_rng"] }
# Histogram implementation for testing uniformity
average = { version = "0.13", features = [ "std" ] }
# Special functions for testing distributions
Expand Down
4 changes: 3 additions & 1 deletion rand_pcg/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.9.0-alpha.0] - 2024-02-18
This is a pre-release. To depend on this version, use `rand_pcg = "=0.9.0-alpha.0"` to prevent automatic updates (which can be expected to include breaking changes).

- Add `Lcg128CmDxsm64` generator compatible with NumPy's `PCG64DXSM` (#1202)
- Add examples for initializing the RNGs

Expand Down
6 changes: 3 additions & 3 deletions rand_pcg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rand_pcg"
version = "0.4.0"
version = "0.9.0-alpha.0"
authors = ["The Rand Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand All @@ -22,11 +22,11 @@ rustdoc-args = ["--generate-link-to-definition"]
serde1 = ["serde"]

[dependencies]
rand_core = { path = "../rand_core", version = "0.7.0" }
rand_core = { path = "../rand_core", version = "=0.9.0-alpha.0" }
serde = { version = "1", features = ["derive"], optional = true }

[dev-dependencies]
rand = { path = "..", version = "0.9" }
rand = { path = "..", version = "=0.9.0-alpha.0" }
# This is for testing serde, unfortunately we can't specify feature-gated dev
# deps yet, see: https://github.com/rust-lang/cargo/issues/1596
# Versions prior to 1.1.4 had incorrect minimal dependencies.
Expand Down