You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building the latest version (0.12.3) of hashbrown on Fedora Linux, and I've been getting inconsistent failures for the doctests of HashMap::drain_filter and HashMap::retain:
It looks like the tests both failed at the assert_eq!(map.capacity(), capacity_before_retain); statement, if I'm associating the line numbers correctly.
In one failed build, both these failures happened, while during another, only the HashMap::drain_filter doctest failed, but the HashMap::retain doctest passed.
This happens with Rust 1.62.0, compiling on and for a armv7-unknown-linux-gnueabihf target.
The text was updated successfully, but these errors were encountered:
This is an artifact of how capacity works in hash tables: removing an element may or may not release capacity, depending on the contents of nearby buckets in the table. Only clear or a re-hash guarantees that the full capacity is released.
The reason this works on x86 but not ARM is that different platforms use different group sizes:
x86/x86_64 use a group size of 16 because they use SSE instructions.
64-bit platforms use a group size of 8.
32-bit platforms use a group size of 4.
Smaller group sizes increase the probability that removing an element does not release capacity.
I'm building the latest version (0.12.3) of hashbrown on Fedora Linux, and I've been getting inconsistent failures for the doctests of
HashMap::drain_filter
andHashMap::retain
:It looks like the tests both failed at
the assert_eq!(map.capacity(), capacity_before_retain);
statement, if I'm associating the line numbers correctly.In one failed build, both these failures happened, while during another, only the
HashMap::drain_filter
doctest failed, but theHashMap::retain
doctest passed.This happens with Rust 1.62.0, compiling on and for a armv7-unknown-linux-gnueabihf target.
The text was updated successfully, but these errors were encountered: