Replace `ahash` with `rapidhash` by fanninpm · Pull Request #7954 · RustPython/RustPython
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 4bdcd70d-0475-4054-b30b-7357b866056c
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (11)
.github/dependabot.ymlCargo.tomlcrates/codegen/Cargo.tomlcrates/codegen/src/lib.rscrates/stdlib/Cargo.tomlcrates/stdlib/src/contextvars.rscrates/vm/Cargo.tomlcrates/vm/src/builtins/type.rscrates/vm/src/intern.rscrates/vm/src/vm/interpreter.rscrates/vm/src/vm/mod.rs
💤 Files with no reviewable changes (1)
- .github/dependabot.yml
✅ Files skipped from review due to trivial changes (1)
- crates/codegen/Cargo.toml
📝 Walkthrough
Walkthrough
This PR replaces the ahash crate with rapidhash across the workspace: workspace dependencies updated, Dependabot pattern removed, and hasher types switched from ahash::RandomState to rapidhash::quality::RandomState in codegen, stdlib, and vm crates.
Changes
Hash Library Migration
| Layer / File(s) | Summary |
|---|---|
Workspace dependency and Dependabot configuration Cargo.toml, .github/dependabot.yml |
Workspace removes ahash and adds rapidhash = "4.4.1"; Dependabot cargo → random group patterns no longer includes "ahash". |
Codegen crate migration crates/codegen/Cargo.toml, crates/codegen/src/lib.rs |
crates/codegen removes ahash dep, adds rapidhash, and updates IndexMap/IndexSet aliases to use rapidhash::quality::RandomState. |
Stdlib crate migration crates/stdlib/Cargo.toml, crates/stdlib/src/contextvars.rs |
crates/stdlib swaps ahash for rapidhash and updates the Hamt IndexMap hasher to rapidhash::quality::RandomState. |
VM crate migration crates/vm/Cargo.toml, crates/vm/src/builtins/type.rs, crates/vm/src/intern.rs, crates/vm/src/vm/mod.rs, crates/vm/src/vm/interpreter.rs |
crates/vm replaces ahash with rapidhash and updates PyAttributes, StringPool.inner, PyGlobalState.frozen, and the interpreter frozen registry HashMap types to rapidhash::quality::RandomState. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
- RustPython/RustPython#7665: Adds
ahashto Dependabot Cargorandomgroup patterns; this PR removes it from the same configuration.
Suggested reviewers
- coolreader18
- youknowone
"🐰 I hopped through Cargo trees today,
swapped ahash out, made rapidhash play,
maps and sets now hum with speed,
a nimble hop for every need.
⚡🥕"
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately and concisely summarizes the main change: replacing the ahash hashing library with rapidhash across the codebase. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.