Comments (4)
Okay, thank you for looking into this. I'll continue to work around this using a sort on hashval, since this is only a problem with testing. It sounds like iteration order isn't guaranteed, so this isn't a bug. You can close this issue.
from parallel-hashmap.
Hum, I think that in general, tests should not depend on the order of iteration in any hash map. The iteration order is definitely not a provided guarantee, and indeed some containers (like the original abseil) make specific efforts to randomize iteration order (from here: "While std::unordered_map makes no guarantees about iteration order, many implementations happen to have a deterministic order based on the keys and their insert order. This is not true of absl::flat_hash_map and absl::node_hash_map. Thus, converting from std::unordered_map to absl::flat_hash_map can expose latent bugs where the code incorrectly depends on iteration order.").
Out of curiosity, what is the key type and hash function you are using for these containers?
from parallel-hashmap.
It's not really a bug, I'm mostly curious why the order differs. The tests that fail are ones that write some hash map contents out to disk and compare with golden results. My workaround has been to canonically sort the results for both the golden and actual run, and then everything agrees. As far as I can tell, gcc's hash_map, unordered_map, and google::sparse_hash_map agree across architectures.
The failing tests are all ones that unique polygon clips and write out the results. The key is a set of polygons (XY vertices) and the hash used is CityHash from here: https://github.com/google/cityhash. The hashes themselves agree - I printed them out. Only the iteration order disagrees. And it's only some minor changes, such as an isolated key jumping a few dozen spots in the order.
from parallel-hashmap.
Hum, not sure. My best guess as to the difference would be that maybe it uses different versions of phmap_mix<8>
in phmap_utils.h
(mixing is done after the hash computation), although in that case I would expect most keys to hash differently. If __int128 is supported on both platforms, and always provides the same results, then maybe there is a difference between the GroupSse2Impl
(used on i86_64
) and the GroupPortableImpl
(used on ARM).
from parallel-hashmap.
Related Issues (20)
- LLDB pretty-printer is buggy HOT 2
- Avoid Memory Reallocations in flat_hash_map clear for Trivial Classes HOT 3
- Suggestion: lazy_emplace_l without last argument HOT 12
- Unused variable warning HOT 2
- question about performance of `at(...)` HOT 4
- Very minor optimization: _mm_abs_epi8 instead of _mm_sign_epi8 HOT 1
- Slow in a specific case HOT 20
- asan build on linux failed with memory error HOT 3
- In template: constexpr variable 'kFirst' must be initialized by a constant expression HOT 6
- phmap_dump saving a lot more than needed HOT 4
- Thread safe way to check existence of items HOT 8
- is it possible to miss the necessary .cmake in the conda packaging? HOT 1
- nvc++: integer conversion resulted in a change of sign HOT 9
- Need a tag about `reserve` bug HOT 3
- Need help speeding up large hash map HOT 6
- merging maps HOT 8
- Release memory after shrinking HOT 6
- Memory not reclaimed after calling map.clear() HOT 4
- Ability to reset the inner sub map HOT 64
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parallel-hashmap.