-
Notifications
You must be signed in to change notification settings - Fork 295
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
Hashes are assumed to be only usize #60
Comments
Yes, this assert was mistakenly added as part of the clippy support, it should be removed. |
Are there any tests using alternate hashes? Even |
Replacing the assert with a comment explaining why the truncation is ok and adding a test that triggers this sounds good to me. |
61: Improve worst-case performance of HashSet.is_subset r=Amanieu a=Amanieu Ported from rust-lang/rust#59665 62: Remove incorrect debug_assert r=Amanieu a=Amanieu Fixes #60 Co-authored-by: Amanieu d'Antras <[email protected]>
62: Remove incorrect debug_assert r=Amanieu a=Amanieu Fixes #60 Co-authored-by: Amanieu d'Antras <[email protected]>
62: Remove incorrect debug_assert r=Amanieu a=Amanieu Fixes #60 Co-authored-by: Amanieu d'Antras <[email protected]>
56: Add additional benchmarks. r=Amanieu a=tkaitchuck This covers performance of three cases I wanted to study when looking into https://github.com/Amanieu/hashbrown/issues/48 They are: `grow_by_insertion_kb` which is similar to grow by insertion, but instead of every entry differing by 1, they differ by 1024. This makes an important performance difference to the hasher. `find_existing_high_bits` which is similar to find_existing but uses 64 bit keys instead of 32 bit keys, where the lower 32 bits are zeros. This is a pathologically bad case for FxHash. `insert_8_char_string` tests a case where the key is a string. (As opposed to all the existing tests which operate on u32 values. This is important to cover because strings as keys are very common. 62: Remove incorrect debug_assert r=Amanieu a=Amanieu Fixes #60 Co-authored-by: Tom Kaitchuck <[email protected]> Co-authored-by: Amanieu d'Antras <[email protected]>
63: Add sanity checks with alternate hashers r=Amanieu a=cuviper The `max` and `random_state` tests currently fail on 32-bit targets per #60. Co-authored-by: Josh Stone <[email protected]>
Is there an issue open to add a test for this ? The merged PR does not add any. Or was that added in https://github.com/Amanieu/hashbrown/pull/63 ? |
Tests were added in #63. |
Awesome, thank you both for fixing this, and sorry that I broke it! |
h1
will fail on 32-bit targets if a hasher yields au64
greater thanu32::MAX
:https://github.com/Amanieu/hashbrown/blob/9068eb7a2268d879dc4453ac72238e8a992f1469/src/raw/mod.rs#L120-L126
The comment in
h2
gives some insight to this, but that only applies toFxHash
:https://github.com/Amanieu/hashbrown/blob/9068eb7a2268d879dc4453ac72238e8a992f1469/src/raw/mod.rs#L131-L138
See also the failure in rust-lang/rust#58623 (comment)
The text was updated successfully, but these errors were encountered: