Comments (4)
I will need to think about what the right answer is here. Before #52193 we indeed used the key
itself here.
But yes an objectid collision does cause a perfect hash collision. I am kinda curious how IdDict survives that.
from julia.
I will need to think about what the right answer is here. Before #52193 we indeed used the
key
itself here.
Even with pre-#52193 implementation rehashing was ineffective for some key types, e.g. Symbols. That's because hash(s::Symbol)
is defined as objectid(s)
and hash(s, h)
depends only on objectid(s)
:
https://github.com/JuliaLang/julia/blob/master/base/hashing.jl#L38-L40
from julia.
So looking at IDdict it also "just" uses objectid
and then uses the typical probe + egal check and grow the table on conflict.
For HAMT that statregy wouldn't work. We would probably need to introduce a "PerfectConflict" node with a linear probe,
but as you noted with Symbols this is a general property of using objectid
as source of the hash.
from julia.
I'm pretty sure it is a bug if objectid has collisions. It seems like something that could be provably made to cause miscompiles.
from julia.
Related Issues (20)
- Autocomplete for keys of custom non-dictionary type
- Broadcast view of `Base.Experimental.Const` fails on 1.11 HOT 4
- Segfault from `NTuple{N,Base.RefValue{...}}` on Julia 1.7.1+ HOT 3
- v1.11-rc1: Using `copy!` or `.=` with `Memory` is slower than `[:] =` and `Vector` HOT 2
- `TOML.print` generates invalid TOML on stdout when the values include multiline strings HOT 1
- Function alias of `Base.Cartesian.@nif`
- 2x regression in indexing benchmarks due to 'Remove references to non opaque pointers in codegen and LLVM passes (#54853)' HOT 1
- ERROR: LoadError: UndefVarError: `UUIDs` not defined. HOT 5
- Possible improvement in memory used in storage of a `Union` of immutable structs?
- Enable opt-in recursive constant propagation
- Common code not included in optionally-generated function HOT 5
- Stack overflow during type inference HOT 8
- Regression 1.9 -> 1.10: `getproperty` 3x longer HOT 2
- [LinearAlgebra] Wrong positive definite check when performing Cholesky decomposition HOT 3
- Assertion failure inside rr causing test x86_64-linux-gnuassertrr to fail HOT 2
- Impossible values of allunique() and allequal() HOT 3
- `permute_dims` fails in edge case because of use if `1:length`
- Documentation example not behaving as displayed - behavior of "const" on immutable objects. HOT 1
- Make precise semantics of world-age increments in top-level thunks
- New precompilation crashes on Julia 1.11-rc1 HOT 15
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 julia.