Shared data structures and algorithms crate#19388
Merged
Conversation
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new shared-dsa crate to the Move workspace that provides fast, non-cryptographic hash-based collections (UnorderedMap / UnorderedSet) intended to discourage reliance on nondeterministic iteration order.
Changes:
- Introduces
UnorderedMapandUnorderedSetwrappers aroundrustc_hash::FxHashMap/FxHashSet, exposing common map/set operations while avoiding iteration APIs. - Adds basic unit tests for the new collections.
- Registers the new crate in the workspace and adds the
rustc-hashworkspace dependency.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| third_party/move/shared-dsa/src/unordered_set.rs | New UnorderedSet wrapper and tests |
| third_party/move/shared-dsa/src/unordered_map.rs | New UnorderedMap wrapper (incl. entry) and tests |
| third_party/move/shared-dsa/src/lib.rs | Crate module wiring + public re-exports |
| third_party/move/shared-dsa/Cargo.toml | New crate manifest |
| Cargo.toml | Adds crate to workspace + adds rustc-hash workspace dependency |
| Cargo.lock | Locks new shared-dsa crate dependency graph |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2 tasks
georgemitenkov
approved these changes
Apr 13, 2026
calintat
approved these changes
Apr 13, 2026
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 task
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
✅ Forge suite
|
Contributor
✅ Forge suite
|
Contributor
✅ Forge suite
|
This was referenced Apr 15, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
We implement and expose a fast, non-cryptographic, non-hash-DoS-resistant hashmap and hashset, without exposing the arbitrary iteration over keys/key-value pairs. This is what we want in a number of places in our codebase, but we end up using the slower default hashmap, which is non-deterministic, or various other hashmap implementations.
Currently, this implementation wraps
rustc_hash'sFxHash[Map|Set], used by the rust compiler.How Has This Been Tested?
Type of Change
Note
Medium Risk
Introduces new collection types backed by non-DoS-resistant hashing; if adopted in code paths that accept untrusted keys, it could create performance-attack risk despite being unused in this PR.
Overview
Adds a new workspace crate,
third_party/move/shared-dsa, exposingUnorderedMapandUnorderedSetwrappers aroundrustc_hash’sFxHashMap/FxHashSetwhile intentionally not exposing iteration APIs to avoid reliance on non-deterministic ordering.Wires the crate into the workspace (
Cargo.toml) and lockfile, adds a workspace dependency onrustc-hash, and includes unit tests covering basic map/set operations and trait behavior.Reviewed by Cursor Bugbot for commit 13019da. Bugbot is set up for automated code reviews on this repo. Configure here.