build(deps): update rand requirement from 0.8 to 0.10#16
build(deps): update rand requirement from 0.8 to 0.10#16dependabot[bot] wants to merge 7 commits intomainfrom
Conversation
LabelsThe following labels could not be found: Please fix the above issues or remove invalid values from |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@dependabot rebase |
|
Looks like this PR is already up-to-date with main! If you'd still like to recreate it from scratch, overwriting any edits, you can request |
|
@dependabot rebase |
|
Looks like this PR is already up-to-date with main! If you'd still like to recreate it from scratch, overwriting any edits, you can request |
|
@dependabot rebase |
|
Looks like this PR is already up-to-date with main! If you'd still like to recreate it from scratch, overwriting any edits, you can request |
|
@dependabot rebase |
|
Looks like this PR is already up-to-date with main! If you'd still like to recreate it from scratch, overwriting any edits, you can request |
|
@dependabot rebase |
|
Looks like this PR is already up-to-date with main! If you'd still like to recreate it from scratch, overwriting any edits, you can request |
|
@dependabot recreate |
Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](rust-random/rand@0.8.0...0.10.0) --- updated-dependencies: - dependency-name: rand dependency-version: 0.10.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
f7b7e76 to
a8de8e1
Compare
Analysis:
|
| Breaking Change | Why N/A |
|---|---|
StdRng no longer Clone (#1677) |
StdRng is never cloned in foxstash |
OsRng → SysRng (#1697) |
OsRng not used directly |
ReseedingRng removed (#1722) |
Not used |
small_rng feature removed (#1732) |
Feature not enabled |
Fill trait changes (#1652) |
Fill not used |
rand_chacha → chacha20 backend swap (#1642) |
No direct rand_chacha dependency |
Recommended Action
This PR cannot be merged as-is. The version bump requires coordinated source changes across ~12 files (5 production, 7 test/bench). Recommended approach:
- Close this Dependabot PR
- Create a manual branch with both the
Cargo.tomlbump and all API migration changes - Pay special attention to the
getrandomWASM fix — this is easy to miss - Verify
seed_from_u64()output stability if deterministic reproducibility matters for HNSW index construction
Analysis:
|
| File | Imports/APIs Used |
|---|---|
crates/core/src/index/hnsw.rs |
Rng, SeedableRng, StdRng, thread_rng(), .gen::<f32>() |
crates/core/src/index/hnsw_pq.rs |
Rng, thread_rng(), .gen::<f32>() |
crates/core/src/index/hnsw_quantized.rs |
Rng, thread_rng(), .gen::<f32>() |
crates/core/src/vector/product_quantize.rs |
SliceRandom, SeedableRng, StdRng, .choose_multiple(), from_entropy() |
crates/core/src/vector/quantize.rs |
Rng, SeedableRng, StdRng, .gen_range() |
crates/core/src/index/streaming.rs |
Rng, SeedableRng, StdRng, .gen_range() |
crates/benches/benches/full.rs |
Rng, SeedableRng, StdRng, .gen::<f32>() |
Breaking Changes That Need Manual Fixes
1. Rng trait renamed → RngExt (all 7 files)
In 0.10, upstream RngCore was renamed to Rng, and the old Rng (with .gen(), .gen_range(), etc.) was renamed to RngExt (#1717).
- use rand::Rng;
+ use rand::RngExt;2. .gen() renamed → .random() (4 files)
Renamed in 0.9, removed in 0.10. Affects hnsw.rs, hnsw_pq.rs, hnsw_quantized.rs, full.rs.
- rng.gen::<f32>()
+ rng.random::<f32>()3. thread_rng() renamed → rng() (3 files)
Renamed in 0.9, old name removed by 0.10. Affects hnsw.rs, hnsw_pq.rs, hnsw_quantized.rs.
- let mut rng = rand::thread_rng();
+ let mut rng = rand::rng();4. StdRng::from_entropy() removed (1 file)
Renamed to from_os_rng() in 0.9, then removed entirely in 0.10 (#1674). Replacement is rand::make_rng(). Affects product_quantize.rs.
- None => rand::rngs::StdRng::from_entropy(),
+ None => rand::make_rng(),5. SliceRandom::choose_multiple() → IndexedRandom::sample() (1 file)
Trait reorganized in 0.9, method renamed in 0.10 (#1632). Affects product_quantize.rs.
- use rand::seq::SliceRandom;
+ use rand::seq::IndexedRandom;
...
- .choose_multiple(&mut rng, config.kmeans_samples)
+ .sample(&mut rng, config.kmeans_samples)6. StdRng no longer implements Clone (#1677)
Verify StdRng is never cloned in the codebase. Likely safe but worth confirming.
Additional Considerations
| Item | Detail |
|---|---|
| MSRV | rand 0.10 requires Rust 1.85 (Edition 2024). Confirm foxstash's MSRV is compatible. |
rand_chacha → chacha20 |
Not directly used — StdRng output remains identical for the same seed, so seeded tests should still produce the same results. |
small_rng feature removed |
Not used by foxstash. No impact. |
gen_range() method |
Still exists on RngExt — just need the trait rename. |
seed_from_u64() |
Still on SeedableRng — no change needed. |
Recommendation
Do not merge this Dependabot PR as-is. Instead:
- Create a manual branch with the version bump
- Apply the ~15-20 line changes across 7 files listed above
- Verify CI passes (especially the WASM build, which may have additional constraints)
- Optionally run benchmarks to compare performance — rand 0.10 uses
chacha20instead ofrand_chachainternally
- Replace thread_rng() with rng() - Replace .gen::<T>() with .random::<T>() - Replace .gen_range() with .random_range() - Replace SeedableRng::from_entropy() with from_os_rng() - Replace rand::seq::SliceRandom with rand::prelude::IndexedRandom (choose/choose_multiple moved to IndexedRandom in 0.10) - Update getrandom dep in wasm crate from 0.2/js to 0.4/wasm_js (fixes WASM build: getrandom 0.4 requires wasm_js feature) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Migrate remaining rand 0.8 API usages that were missed in the initial fix: - Replace thread_rng() with rng() in hnsw_pq and hnsw_quantized - Replace gen::<T>() with random::<T>() in bench and core files - Replace gen_range() with random_range() in quantization benches - Replace from_entropy() with from_os_rng() in product_quantize - Replace SliceRandom with IndexedRandom import in product_quantize Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rand::random_range is in RngExt, not Rng, in rand 0.10. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace UFCS rand::RngExt::random_range / rand::Rng::random_range calls with method syntax rng.random_range(), importing rand::RngExt where missing so test code compiles against rand 0.10. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@dependabot recreate |
37521ab to
fb7d725
Compare
rand 0.8 → 0.10 Breaking Change AnalysisCI Status
Breaking Changes Applied in This PR
Items Requiring Manual Attention🔴 PQ Recall Threshold Lowered (product_quantize.rs:833)
🟡 🟡 MSRV Bump to 1.85 🟡 Pending CI Checks
🟢 🟢 RecommendationDo not merge yet. Wait for Windows tests and benchmark comparison to complete. Investigate whether the PQ recall threshold reduction is acceptable or masks a regression. The mechanical API migrations look correct and complete. |
fb7d725 to
37521ab
Compare
|
| File | Production/Test | Changes Needed |
|---|---|---|
crates/core/src/index/hnsw.rs |
Both | thread_rng → rng, gen → random, verify rand::random |
crates/core/src/index/hnsw_pq.rs |
Both | thread_rng → rng, gen → random, gen_range (ok) |
crates/core/src/index/hnsw_quantized.rs |
Both | thread_rng → rng (×2), gen → random, gen_range (ok) |
crates/core/src/vector/product_quantize.rs |
Both | from_entropy removal, SliceRandom → IndexedRandom, gen → random |
crates/core/src/index/streaming.rs |
Tests only | gen_range (ok), gen → random |
crates/core/src/vector/quantize.rs |
Tests only | gen_range (ok), gen → random |
crates/benches/benches/full.rs |
Bench | gen → random |
crates/benches/benches/embedding.rs |
Bench | gen → random |
crates/benches/benches/storage.rs |
Bench | gen → random (multiple types) |
crates/core/benches/quantization.rs |
Bench | gen_range (ok) |
crates/wasm/Cargo.toml |
Config | getrandom 0.2 → 0.3, feature js → wasm_js |
APIs That Survive Unchanged
Rng::gen_range()— stable across all versions ✅StdRng::seed_from_u64()— stable ✅SeedableRngtrait — stable ✅rand::rngs::StdRng— stable (but no longerClonein 0.10) ✅
Recommendation
Do not merge this as-is. This needs a companion branch that:
- Applies all ~20+ API renames across 10 files
- Updates
getrandomin the WASM crate - Verifies MSRV compatibility
- Confirms all CI checks pass (tests, clippy, WASM build, benchmarks)
Consider using @dependabot recreate after manually preparing the migration, or close this and do the migration in a dedicated PR with proper source changes.
rand 0.8 → 0.10 Breaking Change AnalysisThis PR only bumps the version in 🔴 Compilation-Breaking Changes1.
|
| Removed/Changed API | Status |
|---|---|
OsRng → SysRng rename |
Not used |
ReseedingRng removed |
Not used |
SmallRng / small_rng feature removed |
Not used |
IteratorRandom::choose_multiple → sample |
Not used |
Fill trait redesign |
Not used |
SliceChooseIter → IndexedSamples rename |
Not used |
📋 Summary of Required File Changes
| File | Changes Needed |
|---|---|
crates/core/src/index/hnsw.rs |
Rng→RngExt, thread_rng()→rng() |
crates/core/src/index/hnsw_pq.rs |
Rng→RngExt, thread_rng()→rng() |
crates/core/src/index/hnsw_quantized.rs |
Rng→RngExt, thread_rng()→rng() |
crates/core/src/vector/product_quantize.rs |
Rng→RngExt, SliceRandom→IndexedRandom, choose_multiple→sample, from_entropy()→make_rng() |
crates/core/src/vector/quantize.rs |
Rng→RngExt (tests only) |
crates/core/src/index/streaming.rs |
Rng→RngExt (tests only) |
crates/wasm/Cargo.toml |
getrandom 0.2→0.3, "js"→"wasm_js" |
crates/benches/benches/*.rs |
Rng→RngExt |
crates/core/benches/quantization.rs |
Rng→RngExt |
⚠️ Additional Considerations
- MSRV bump: rand 0.10 requires Rust 1.85+ (Edition 2024). Verify the project's MSRV is compatible.
rand::random::<u64>()— Used inhnsw.rsfor seed generation. Verify this free function still exists in 0.10 (it should, but confirm).SeedableRng::seed_from_u64()— Still present in 0.10, no change needed.- Lockfile churn: Transitive dependency
rand_chachais replaced bychacha20in 0.10. The lockfile will change significantly.
Recommendation: Do not merge as-is. This needs a companion commit updating all source files listed above, then CI should be re-run to verify.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
This pull request has been automatically marked as stale because it has not had any activity in the last 30 days. It will be closed in 7 days if no further activity occurs. |
|
This pull request has been closed due to inactivity. If you would like to continue this work, please reopen the PR or open a new one. Thank you for your effort! |
|
OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting If you change your mind, just re-open this PR and I'll resolve any conflicts on it. |
Updates the requirements on rand to permit the latest version.
Changelog
Sourced from rand's changelog.
... (truncated)
Commits
acc5f24Prepare v0.10.0 releases (#1729)95c5165Add fn rand::make_rng (#1734)146da58CHANGELOG: add PR links (#1738)8cacd6dREADME tweaks (#1737)28e3df8Update chacha20: use ChaChaCore directly; remove bytes_until_reseed field (#1...03db311Replace fn reseed_and_generate with try_to_reseedb14483eApply inline attr to fn generatefda8f74Remove bytes_until_reseed field213bb3bBump chacha20 to 0.10.0-rc.1172afe1eMinor tweaks; prepare v0.10.0-rc.9 (#1736)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)