From 5577003615af6ec9255c680467d34f60a2149bb7 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Sun, 18 Feb 2024 17:02:05 +0000 Subject: [PATCH] Update CHANGELOGs and prepare rand 0.9.0-alpha.0 (#1395) Also: add pull-request template --- .github/PULL_REQUEST_TEMPLATE.md | 7 +++++++ CHANGELOG.md | 36 ++++++++++++++++++++++++++++---- Cargo.toml | 8 +++---- rand_chacha/CHANGELOG.md | 8 ++++--- rand_chacha/Cargo.toml | 4 ++-- rand_core/CHANGELOG.md | 9 ++++++++ rand_core/Cargo.toml | 2 +- rand_distr/CHANGELOG.md | 19 +++++++++++++---- rand_distr/Cargo.toml | 8 +++---- rand_pcg/CHANGELOG.md | 4 +++- rand_pcg/Cargo.toml | 6 +++--- 11 files changed, 85 insertions(+), 26 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..02ac88f0 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +- [ ] Added a `CHANGELOG.md` entry + +# Summary + +# Motivation + +# Details diff --git a/CHANGELOG.md b/CHANGELOG.md index 8706df8c..aaccde2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 for &D` (#1278) +- Explicit impl of `sample_single_inclusive` (+~20% perf) (#1289) +- Impl `DistString` for `Slice` and `Uniform` (#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 diff --git a/Cargo.toml b/Cargo.toml index b2c7f3d6..13043a2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -65,10 +65,10 @@ 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] @@ -76,7 +76,7 @@ zerocopy = { version = "=0.8.0-alpha.5", default-features = false, features = [" 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" diff --git a/rand_chacha/CHANGELOG.md b/rand_chacha/CHANGELOG.md index 7ef621f6..dcc9d2e6 100644 --- a/rand_chacha/CHANGELOG.md +++ b/rand_chacha/CHANGELOG.md @@ -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) diff --git a/rand_chacha/Cargo.toml b/rand_chacha/Cargo.toml index 847cfdde..bcc09f61 100644 --- a/rand_chacha/Cargo.toml +++ b/rand_chacha/Cargo.toml @@ -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" @@ -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 } diff --git a/rand_core/CHANGELOG.md b/rand_core/CHANGELOG.md index 75fcbc66..b7f00895 100644 --- a/rand_core/CHANGELOG.md +++ b/rand_core/CHANGELOG.md @@ -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 `::next_u32` (#1160) - Reduce use of `unsafe` and improve gen_bytes performance (#1180) diff --git a/rand_core/Cargo.toml b/rand_core/Cargo.toml index b53a0163..28845f3d 100644 --- a/rand_core/Cargo.toml +++ b/rand_core/Cargo.toml @@ -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" diff --git a/rand_distr/CHANGELOG.md b/rand_distr/CHANGELOG.md index 7d6c0602..24b43648 100644 --- a/rand_distr/CHANGELOG.md +++ b/rand_distr/CHANGELOG.md @@ -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) diff --git a/rand_distr/Cargo.toml b/rand_distr/Cargo.toml index 2c71ac16..36533d46 100644 --- a/rand_distr/Cargo.toml +++ b/rand_distr/Cargo.toml @@ -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" @@ -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 diff --git a/rand_pcg/CHANGELOG.md b/rand_pcg/CHANGELOG.md index 63a37781..c60386cf 100644 --- a/rand_pcg/CHANGELOG.md +++ b/rand_pcg/CHANGELOG.md @@ -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 diff --git a/rand_pcg/Cargo.toml b/rand_pcg/Cargo.toml index 757cc8e3..3f502179 100644 --- a/rand_pcg/Cargo.toml +++ b/rand_pcg/Cargo.toml @@ -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" @@ -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.