willow-ahrens / Finch.jl

Sparse tensors in Julia and more! Datastructure-driven array programing language.
http://willowahrens.io/Finch.jl/
MIT License
158 stars 15 forks source link

Jaeyeon/newdispatch #362

Closed nullplay closed 8 months ago

nullplay commented 8 months ago

Hope this fixes the continuous tests on CI.

codecov[bot] commented 8 months ago

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (2c17510) 76.04% compared to head (6239cad) 76.06%.

Files Patch % Lines
src/util/limits.jl 66.66% 7 Missing :warning:
src/dimensions.jl 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #362 +/- ## ========================================== + Coverage 76.04% 76.06% +0.02% ========================================== Files 80 80 Lines 6830 6832 +2 ========================================== + Hits 5194 5197 +3 + Misses 1636 1635 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

willow-ahrens commented 8 months ago

Something weird I have found:

julia> hash(1.0, UInt(123))
0x5bca7c69b794f75d

julia> hash(1.0f0, UInt(123))
0x5bca7c69b794f75d

julia> hash(limit(1.0f0), UInt(123))
0xab8298daf3de8022

julia> d = Dict{Any, String}(1.0=>"hello")
Dict{Any, String} with 1 entry:
  1.0 => "hello"

julia> d[limit(1.0f0)]
"hello"

julia> for i = 1:10000
       d[i] = "bar"
       end

julia> d[limit(1.0f0)]
ERROR: KeyError: key limit(1.0) not found
Stacktrace:
 [1] getindex(h::Dict{Any, String}, key::Limit{Float32})
   @ Base ./dict.jl:482
 [2] top-level scope
   @ REPL[37]:1

Our problem is that isequal(1.0, limit(1.0f0)) == true, which isn't really helpful for us when implementing shash, as we'd really like different hashes for things with different types. I'm trying this out on https://github.com/willow-ahrens/Finch.jl/pull/363.