Skip to content
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

CategoricalArrays reveals possible ml_matches sorting bug #35187

Closed
vtjnash opened this issue Mar 20, 2020 · 1 comment
Closed

CategoricalArrays reveals possible ml_matches sorting bug #35187

vtjnash opened this issue Mar 20, 2020 · 1 comment
Assignees

Comments

@vtjnash
Copy link
Sponsor Member

vtjnash commented Mar 20, 2020

Doing some analysis work on serialization shakes out some issues sometimes. This one is a ml_matches mistake I observed, where in the precompile session, we're missing the third method in this list (after reload in the current session, all four start getting listed).

julia> M = [
       Tuple{typeof(Base.convert), Type{Union{Nothing, S}}, T} where T<:(Union{CategoricalArrays.CategoricalString{R}, CategoricalArrays.CategoricalValue{T, R} where T} where R) where S
       Tuple{typeof(Base.convert), Type{T}, T} where Nothing<:T<:Any
       Tuple{typeof(Base.convert), Type{S}, T} where T<:(Union{CategoricalArrays.CategoricalString{R}, CategoricalArrays.CategoricalValue{T, R} where T} where R) where S
       Tuple{typeof(Base.convert), Type{T}, Any} where Nothing<:T<:Any
       ]

julia> ms(T, S) = ccall(:jl_type_morespecific, Cint, (Any, Any), T, S)

julia> R = Tuple{typeof(Base.convert), Type{Union{Nothing, Module}}, Any}

julia> [typeintersect(M[i], M[j]) for i = 1:4, j = 1:4]
4×4 Array{UnionAll,2}:
 Tuple{typeof(convert),Type{Union{Nothing, S}},T} where T<:(Union{CategoricalString{R}, CategoricalValue{T,R} where T} where R) where S    Tuple{typeof(convert),Type{Union{Nothing, S}},T} where T<:(Union{CategoricalString{R}, CategoricalValue{T,R} where T} where R) where S
 Tuple{typeof(convert),Type{Union{Nothing, S}},Union{Nothing, S}} where S                                                                   Tuple{typeof(convert),Type{T},T} where T>:Nothing
 Tuple{typeof(convert),Type{Union{Nothing, S}},T} where T<:(Union{CategoricalString{R}, CategoricalValue{T,R} where T} where R) where S     Tuple{typeof(convert),Type{S},T} where T<:(Union{CategoricalString{R}, CategoricalValue{T,R} where T} where R) where S>:Nothing
 Tuple{typeof(convert),Type{Union{Nothing, S}},T} where T<:(Union{CategoricalString{R}, CategoricalValue{T,R} where T} where R) where S     Tuple{typeof(convert),Type{T},Any} where T>:Nothing

julia> [ms(M[i], M[j]) for i = 1:4, j = 1:4]
4×4 Array{Int32,2}:
 0  1  1  1
 0  0  0  1
 0  0  0  0
 0  0  0  0

julia> [R <: typeintersect(M[i], M[j]) for i = 1:4, j = 1:4]
4×4 Array{Bool,2}:
 0  0  0  0
 0  0  0  0
 0  0  0  0
 0  0  0  1
@vtjnash vtjnash self-assigned this Mar 20, 2020
@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Jul 13, 2020

This should be fixed by #35983

@vtjnash vtjnash closed this as completed Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant