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

convert method for Any is not ideal #177

Open
JeffBezanson opened this issue Dec 18, 2018 · 27 comments · May be fixed by #201
Open

convert method for Any is not ideal #177

JeffBezanson opened this issue Dec 18, 2018 · 27 comments · May be fixed by #201

Comments

@JeffBezanson
Copy link

These methods:

Base.convert(::Type{Any}, x::CatValue) = x
Base.convert(::Type{S}, x::T) where {S, T <: CatValue} =
    T <: S ? x : convert(S, get(x))

currently cause a lot of recompilation, since they involve converting to Any (which is very common) or potentially many other types. Fortunately this is not a large component of load time from what I can tell, but it would still be nice if we can live without these methods somehow.

@nalimilan
Copy link
Member

Yes, but how? The problem is that CategoricalValue may wrap any type, so we don't know in advance what conversions might be possible.

quinnj added a commit that referenced this issue Jul 26, 2019
…back convert methods that cause lots of recompilation of convert methods. This improves the package load times from 1.4s to 1.0s for me. Fixes #177. Failures on nightly are unrelated
@bkamins
Copy link
Member

bkamins commented Jul 20, 2020

@nalimilan - we could define convert methods for standard types that are normally expected to be potentially by default.

Then we can keep a dictionary of special types and dynamically add a convert method only if a CategoricalArray with such a type is created the first time this happens. This would add a small overhead to array creation for non-standard types, but I think it is not that bad (as in practice it will happen very rarely)

@JeffBezanson
Copy link
Author

IIUC, I don't think that would work very well since the dynamically-added method would not be callable in the current world age.

Now, this might just be my opinion and we might have to agree to disagree, but I find CategoricalValue fundamentally flawed. A CategoricalValue version of "x" compares equal to "x" and can be freely converted to it, and yet it does not do ordered comparisons the same as "x". On the one hand, it is trying to be the same as "x", but on the other hand the association with the pool is apparently so important that it can't be just "x". I believe it is best to pick one or the other --- either just another way to store "x" (e.g. PooledArrays), or a truly distinct data type.

@bkamins
Copy link
Member

bkamins commented Jul 20, 2020

IIUC, I don't think that would work very well since the dynamically-added method would not be callable in the current world age.

I guess you understand it correctly :) and now after thinking about it I agree that it would be just bad as in the current world age another method would be called (the one that would get dispatched to before the new definition were added) which could lead to surprising errors.

@nalimilan
Copy link
Member

Actually according to @snoopr invalidations are caused by the similar methods, not by convert nor ==. This is after removing all definitions in deprecated.jl (which cause lots of invalidations), in a clean Julia master session:

julia> using SnoopCompileCore

julia> invalidations = @snoopr using CategoricalArrays;

julia> trees = invalidation_trees(invalidations)
14-element Vector{SnoopCompile.MethodInvalidations}:
 inserting similar(A::AbstractRange, ::Type{CategoricalValue{T,R}}, dims::Tuple{Vararg{Int64,N}}) where {T, R, N} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:591 invalidated:
   backedges: 1: superseding similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in Base at abstractarray.jl:699 with MethodInstance for similar(::UnitRange{Int64}, ::DataType, ::Tuple{Int64}) (3 children)

 inserting Base.IteratorEltype(::Type{var"#s2"} where var"#s2"<:(Missings.EachReplaceMissing{T,U} where U)) where T in Missings at /home/milan/.julia/packages/Missings/Aam9N/src/Missings.jl:84 invalidated:
   backedges: 1: superseding Base.IteratorEltype(::Type) in Base at generator.jl:124 with MethodInstance for Base.IteratorEltype(::Type{var"#s435"} where var"#s435"<:AbstractArray{T,N} where N where T) (5 children)

 inserting resize!(v::JSON.Parser.PushVector, l::Integer) in JSON.Parser at /home/milan/.julia/packages/JSON/d89fA/src/pushvector.jl:28 invalidated:
   mt_backedges: 1: signature Tuple{typeof(resize!),AbstractVector{T} where T,Int64} triggered MethodInstance for _groupedunique!(::AbstractVector{T} where T) (1 children)
                 2: signature Tuple{typeof(resize!),AbstractVector{T} where T,Any} triggered MethodInstance for _unique!(::typeof(identity), ::AbstractVector{T} where T, ::Set{_A} where _A, ::Integer, ::Integer) (5 children)

 inserting similar(A::Matrix{T} where T, ::Type{CategoricalValue{T,R} where R<:Integer}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:594 invalidated:
   mt_backedges: 1: signature Tuple{typeof(similar),Array,Type,Tuple{Union{Integer, AbstractUnitRange}}} triggered MethodInstance for similar(::Array, ::Type{T}, ::Union{Integer, AbstractUnitRange}) where T (0 children)
                 2: signature Tuple{typeof(similar),Array,Type,Tuple{Union{Integer, AbstractUnitRange}}} triggered MethodInstance for similar(::Array, ::Type{T}, ::Tuple{Union{Integer, Base.OneTo}}) where T (2 children)
   backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Array, ::Type, ::Tuple{Int64}) (4 children)

 inserting similar(A::Matrix{T} where T, ::Type{CategoricalValue{T,R}}, dims::Tuple{Vararg{Int64,N}}) where {T, R, N} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:591 invalidated:
   mt_backedges: 1: signature Tuple{typeof(similar),Array,DataType,Tuple{Union{Integer, AbstractUnitRange}}} triggered MethodInstance for similar(::Array, ::DataType, ::Union{Integer, AbstractUnitRange}) (0 children)
                 2: signature Tuple{typeof(similar),Array,DataType,Tuple{Union{Integer, AbstractUnitRange}}} triggered MethodInstance for similar(::Array, ::DataType, ::Tuple{Union{Integer, Base.OneTo}}) (2 children)
   backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Array, ::DataType, ::Tuple{Int64}) (4 children)

 inserting promote_rule(::Type{C}, ::Type{T}) where {C<:CategoricalValue, T} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/value.jl:45 invalidated:
   backedges: 1: superseding promote_rule(::Type{var"#s73"} where var"#s73", ::Type{var"#s72"} where var"#s72") in Base at promotion.jl:250 with MethodInstance for promote_rule(::Type{T} where T<:Unsigned, ::Type{UInt64}) (1 children)
              2: superseding promote_rule(::Type{var"#s849"} where var"#s849"<:AbstractIrrational, ::Type{T}) where T<:Real in Base at irrationals.jl:42 with MethodInstance for promote_rule(::Type{Union{}}, ::Type{UInt64}) (5 children)

 inserting similar(A::AbstractRange, ::Type{Union{Missing, CategoricalValue{T,R} where R<:Integer}}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:600 invalidated:
   backedges: 1: superseding similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in Base at abstractarray.jl:699 with MethodInstance for similar(::StepRange{Char,Int64}, ::Type, ::Tuple{Int64}) (1 children)
              2: superseding similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in Base at abstractarray.jl:699 with MethodInstance for similar(::UnitRange{Int64}, ::Type, ::Tuple{Int64}) (8 children)

 inserting similar(A::Vector{T} where T, ::Type{CategoricalValue{T,R}}, dims::Tuple{Vararg{Int64,N}}) where {T, R, N} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:591 invalidated:
   mt_backedges: 1: signature Tuple{typeof(similar),Vector{_A} where _A,DataType,Tuple{Union{Integer, AbstractUnitRange}}} triggered MethodInstance for similar(::Vector{_A} where _A, ::DataType, ::Union{Integer, AbstractUnitRange}) (0 children)
                 2: signature Tuple{typeof(similar),Vector{_A} where _A,DataType,Tuple{Union{Integer, AbstractUnitRange}}} triggered MethodInstance for similar(::Vector{_A} where _A, ::DataType, ::Tuple{Union{Integer, Base.OneTo}}) (2 children)
   backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Any}, ::DataType, ::Tuple{Int64}) (1 children)
              2: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Dict{Any,Any}}, ::DataType, ::Tuple{Int64}) (1 children)
              3: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{SubString{String}}, ::DataType, ::Tuple{Int64}) (1 children)
              4: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Base.Docs.DocStr}, ::DataType, ::Tuple{Int64}) (1 children)
              5: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Base.RefValue{Any}}, ::DataType, ::Tuple{Int64}) (1 children)
              6: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{String}, ::DataType, ::Tuple{Int64}) (1 children)
              7: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{REPL.REPLCompletions.Completion}, ::DataType, ::Tuple{Int64}) (1 children)
              8: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{_A} where _A, ::DataType, ::Tuple{Int64}) (4 children)

 inserting Base.IteratorSize(::Type{var"#s2"} where var"#s2"<:(Missings.EachReplaceMissing{T,U} where U)) where T in Missings at /home/milan/.julia/packages/Missings/Aam9N/src/Missings.jl:82 invalidated:
   backedges: 1: superseding Base.IteratorSize(::Type) in Base at generator.jl:91 with MethodInstance for Base.IteratorSize(::Type{var"#s435"} where var"#s435"<:Tuple{Type,Vararg{Type,N} where N}) (2 children)
              2: superseding Base.IteratorSize(::Type) in Base at generator.jl:91 with MethodInstance for Base.IteratorSize(::Type{var"#s435"} where var"#s435"<:Tuple{Any}) (5 children)
              3: superseding Base.IteratorSize(::Type) in Base at generator.jl:91 with MethodInstance for Base.IteratorSize(::Type{var"#s435"} where var"#s435"<:Tuple{Pair{Symbol,String},Vararg{Pair,N} where N}) (6 children)
              4: superseding Base.IteratorSize(::Type) in Base at generator.jl:91 with MethodInstance for Base.IteratorSize(::Type{var"#s435"} where var"#s435"<:Tuple{Pair{Symbol,V} where V,Pair{Symbol,V} where V}) (10 children)

 inserting (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), v::CategoricalVector{T,V,C,U,U} where U where U where C where V where T) in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:935 invalidated:
   mt_backedges:  1: signature Tuple{Base.var"#sort!##kw",NamedTuple{(:by,),Tuple{Pkg.Operations.var"#132#138"}},typeof(sort!),Any} triggered MethodInstance for #print_status#126(::Bool, ::Bool, ::typeof(Pkg.Operations.print_status), ::Pkg.Types.Context, ::Nothing, ::Symbol, ::Vector{Union{Nothing, Base.UUID}}, ::Vector{Union{Nothing, String}}) (1 children)
                  2: signature Tuple{Base.var"#sort!##kw",NamedTuple{(:by,),Tuple{Pkg.API.var"#4#6"}},typeof(sort!),Any} triggered MethodInstance for #_print#9(::Int64, ::Bool, ::Bool, ::Pkg.API.var"#4#6", ::typeof(Pkg.TOML._print), ::IOStream, ::AbstractDict, ::Vector{String}) (2 children)
                  3: signature Tuple{Base.var"#sort!##kw",NamedTuple{(:by,),Tuple{typeof(identity)}},typeof(sort!),Any} triggered MethodInstance for #_print#9(::Int64, ::Bool, ::Bool, ::typeof(identity), ::typeof(Pkg.TOML._print), ::IOStream, ::AbstractDict, ::Vector{String}) (2 children)
                  4: signature Tuple{Base.var"#sort!##kw",NamedTuple{(:by,),Tuple{Pkg.Types.var"#30#32"}},typeof(sort!),Any} triggered MethodInstance for #_print#9(::Int64, ::Bool, ::Bool, ::Pkg.Types.var"#30#32", ::typeof(Pkg.TOML._print), ::IOBuffer, ::AbstractDict, ::Vector{String}) (2 children)
                  5: signature Tuple{Base.var"#sort!##kw",NamedTuple{(:by,),Tuple{typeof(identity)}},typeof(sort!),Any} triggered MethodInstance for #_print#9(::Int64, ::Bool, ::Bool, ::typeof(identity), ::typeof(Pkg.TOML._print), ::IOBuffer, ::AbstractDict, ::Vector{String}) (2 children)
                  6: signature Tuple{Base.var"#sort!##kw",NamedTuple{(:by,),Tuple{Pkg.Operations.var"#132#138"}},typeof(sort!),Any} triggered MethodInstance for #print_status#126(::Bool, ::Bool, ::typeof(Pkg.Operations.print_status), ::Pkg.Types.Context, ::Pkg.Types.Context, ::Symbol, ::Vector{Union{Nothing, Base.UUID}}, ::Vector{Union{Nothing, String}}) (2 children)
                  7: signature Tuple{Base.var"#sort!##kw",NamedTuple{(:by,),_A} where _A<:Tuple{Function},typeof(sort!),Any} triggered MethodInstance for #_print#9(::Int64, ::Bool, ::Bool, ::Function, ::typeof(Pkg.TOML._print), ::IOBuffer, ::AbstractDict, ::Vector{String}) (2 children)
                  8: signature Tuple{Base.var"#sort!##kw",NamedTuple{(:by,),_A} where _A<:Tuple{Function},typeof(sort!),Any} triggered MethodInstance for #_print#9(::Int64, ::Bool, ::Bool, ::Function, ::typeof(Pkg.TOML._print), ::IOStream, ::AbstractDict, ::Vector{String}) (2 children)
                  9: signature Tuple{Base.var"#sort!##kw",NamedTuple{(:by,),Tuple{Pkg.Operations.var"#132#138"}},typeof(sort!),Any} triggered MethodInstance for #print_status#126(::Bool, ::Bool, ::typeof(Pkg.Operations.print_status), ::Pkg.Types.Context, ::Pkg.Types.Context, ::Symbol, ::Vector{T} where T, ::Vector{T} where T) (4 children)
                 10: signature Tuple{Base.var"#sort!##kw",NamedTuple{(:by,),Tuple{Pkg.Operations.var"#132#138"}},typeof(sort!),Any} triggered MethodInstance for #print_status#126(::Bool, ::Bool, ::typeof(Pkg.Operations.print_status), ::Pkg.Types.Context, ::Nothing, ::Symbol, ::Vector{T} where T, ::Vector{T} where T) (24 children)
   backedges:  1: superseding (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), A::AbstractArray) in Base.Sort at sort.jl:1098 with MethodInstance for (::Base.var"#sort!##kw")(::NamedTuple{(:by,),Tuple{Pkg.Types.var"#30#32"}}, ::typeof(sort!), ::AbstractArray) (1 children)
               2: superseding (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), A::AbstractArray) in Base.Sort at sort.jl:1098 with MethodInstance for (::Base.var"#sort!##kw")(::NamedTuple{(:by,),Tuple{Pkg.API.var"#4#6"}}, ::typeof(sort!), ::AbstractArray) (1 children)
               3: superseding (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), v::AbstractVector{T} where T) in Base.Sort at sort.jl:715 with MethodInstance for (::Base.var"#sort!##kw")(::NamedTuple{(:by,),Tuple{Pkg.Types.var"#30#32"}}, ::typeof(sort!), ::AbstractVector{T} where T) (1 children)
               4: superseding (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), v::AbstractVector{T} where T) in Base.Sort at sort.jl:715 with MethodInstance for (::Base.var"#sort!##kw")(::NamedTuple{(:by,),Tuple{Pkg.API.var"#4#6"}}, ::typeof(sort!), ::AbstractVector{T} where T) (1 children)
               5: superseding (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), A::AbstractArray) in Base.Sort at sort.jl:1098 with MethodInstance for (::Base.var"#sort!##kw")(::NamedTuple{(:by,),_A} where _A<:Tuple{Function}, ::typeof(sort!), ::AbstractArray) (2 children)
               6: superseding (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), A::AbstractArray) in Base.Sort at sort.jl:1098 with MethodInstance for (::Base.var"#sort!##kw")(::NamedTuple{(:by,),Tuple{typeof(identity)}}, ::typeof(sort!), ::AbstractArray) (2 children)
               7: superseding (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), v::AbstractVector{T} where T) in Base.Sort at sort.jl:715 with MethodInstance for (::Base.var"#sort!##kw")(::NamedTuple{(:by,),_A} where _A<:Tuple{Function}, ::typeof(sort!), ::AbstractVector{T} where T) (2 children)
               8: superseding (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), v::AbstractVector{T} where T) in Base.Sort at sort.jl:715 with MethodInstance for (::Base.var"#sort!##kw")(::NamedTuple{(:by,),Tuple{typeof(identity)}}, ::typeof(sort!), ::AbstractVector{T} where T) (2 children)
               9: superseding (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), A::AbstractArray) in Base.Sort at sort.jl:1098 with MethodInstance for (::Base.var"#sort!##kw")(::NamedTuple{(:by,),Tuple{Pkg.Operations.var"#132#138"}}, ::typeof(sort!), ::AbstractArray) (4 children)
              10: superseding (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), v::AbstractVector{T} where T) in Base.Sort at sort.jl:715 with MethodInstance for (::Base.var"#sort!##kw")(::NamedTuple{(:by,),Tuple{Pkg.Operations.var"#132#138"}}, ::typeof(sort!), ::AbstractVector{T} where T) (4 children)

 inserting repr(x::CategoricalValue) in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/value.jl:75 invalidated:
   backedges: 1: superseding repr(x; context) in Base at strings/io.jl:229 with MethodInstance for repr(::Any) (71 children)

 inserting similar(A::Vector{T} where T, ::Type{CategoricalValue{T,R} where R<:Integer}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:594 invalidated:
   mt_backedges: 1: signature Tuple{typeof(similar),Vector{_A} where _A,Type,Tuple{Union{Integer, AbstractUnitRange}}} triggered MethodInstance for similar(::Vector{_A} where _A, ::Type{T}, ::Union{Integer, AbstractUnitRange}) where T (0 children)
                 2: signature Tuple{typeof(similar),Vector{_A} where _A,Type,Tuple{Union{Integer, AbstractUnitRange}}} triggered MethodInstance for similar(::Vector{_A} where _A, ::Type{T}, ::Tuple{Union{Integer, Base.OneTo}}) where T (2 children)
   backedges:  1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Union{Int64, Symbol}}, ::Type, ::Tuple{Int64}) (1 children)
               2: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{String}, ::Type, ::Tuple{Int64}) (3 children)
               3: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Base.RefValue{Any}}, ::Type, ::Tuple{Int64}) (3 children)
               4: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Dict{Any,Any}}, ::Type, ::Tuple{Int64}) (3 children)
               5: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Dict{Any,Any}}, ::Type, ::Tuple{Int64}) (5 children)
               6: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{REPL.REPLCompletions.Completion}, ::Type, ::Tuple{Int64}) (6 children)
               7: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Any}, ::Type, ::Tuple{Int64}) (6 children)
               8: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Base.RefValue{Any}}, ::Type, ::Tuple{Int64}) (8 children)
               9: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{_A} where _A, ::Type, ::Tuple{Int64}) (9 children)
              10: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{String}, ::Type, ::Tuple{Int64}) (11 children)
              11: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Base.Docs.DocStr}, ::Type, ::Tuple{Int64}) (12 children)
              12: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Any}, ::Type, ::Tuple{Int64}) (32 children)
              13: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{SubString{String}}, ::Type, ::Tuple{Int64}) (82 children)

 inserting similar(A::Vector{T} where T, ::Type{CategoricalValue{T,R} where R<:Integer}) where T in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:594 invalidated:
   backedges:  1: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Base.StackTraces.StackFrame}, ::Type) (1 children)
               2: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Symbol}, ::Type) (2 children)
               3: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{String}, ::Type) (3 children)
               4: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Vector{AbstractString}}, ::Type) (3 children)
               5: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Bool}, ::Type) (3 children)
               6: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Markdown.MD}, ::Type) (3 children)
               7: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Tuple{Base.UUID,Nothing,Pkg.Types.PackageSpec}}, ::Type) (3 children)
               8: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Tuple{Base.UUID,Pkg.Types.PackageSpec,Pkg.Types.PackageSpec}}, ::Type) (3 children)
               9: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Tuple{Tuple{String,UInt16},Int64}}, ::Type) (3 children)
              10: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{UInt64}, ::Type) (5 children)
              11: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{UInt128}, ::Type) (5 children)
              12: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{UInt32}, ::Type) (5 children)
              13: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Int64}, ::Type) (5 children)
              14: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{_A} where _A, ::Type) (146 children)

 inserting similar(::Type{T}, dims::Tuple{Vararg{Int64,N}} where N) where {U, T<:(Array{Union{Missing, CategoricalValue{U,R} where R<:Integer},N} where N)} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:611 invalidated:
   mt_backedges: 1: signature Tuple{typeof(similar),Type{Array{_A,_B}} where _B where _A,Tuple{Union{Integer, AbstractUnitRange}}} triggered MethodInstance for similar(::Type{Array{_A,_B}}, ::Union{Integer, AbstractUnitRange}) where {_A, _B} (0 children)
                 2: signature Tuple{typeof(similar),Type{Array{_A,_B}} where _B where _A,Tuple{Union{Integer, AbstractUnitRange}}} triggered MethodInstance for similar(::Type{Array{_A,_B}}, ::Tuple{Union{Integer, Base.OneTo}}) where {_A, _B} (2 children)
   backedges: 1: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64,N}} where N) where T<:AbstractArray in Base at abstractarray.jl:734 with MethodInstance for similar(::Type{Array{_A,_B}}, ::Tuple{Int64}) where {_A, _B} (2 children)
              2: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64,N}} where N) where T<:AbstractArray in Base at abstractarray.jl:734 with MethodInstance for similar(::Type{Array{_A,N} where N} where _A, ::Tuple{Int64}) (318 children)
              3: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64,N}} where N) where T<:AbstractArray in Base at abstractarray.jl:734 with MethodInstance for similar(::Type{Vector{_A}} where _A, ::Tuple{Int64}) (464 children)

These similar methods are problematic anyway as noted at JuliaLang/julia#36106.

@JeffBezanson Do you think there would be a solution so that collect returns a CategoricalArray when an iterator returns CategoricalValue objects, without causing lots of invalidations? I mentioned some options at JuliaLang/julia#36106. Also, do you think it's a spurious result that convert doesn't appear in the list of invalidations spotted by SnoopCompile?

@quinnj
Copy link
Member

quinnj commented Aug 11, 2020

cc: @timholy ^^

@bkamins
Copy link
Member

bkamins commented Aug 11, 2020

@nalimilan - thank you for taking time and looking into it as it requires a lot of work and seemingly does not improve anything on user-visible side (except compilation times of course 😄).

@nalimilan
Copy link
Member

It looks like a lot of these invalidations could be avoided if the compiler got smarter. For example, the last (and worst) similar method gives this:

julia> show(trees[end].backedges[end])
MethodInstance for similar(::Type{Vector{_A}} where _A, ::Tuple{Int64}) (464 children)
 MethodInstance for similar(::Type{Vector{_A}} where _A, ::Tuple{Base.OneTo{Int64}}) (463 children)
  MethodInstance for _array_for(::DataType, ::Vector{Tuple}, ::Base.HasShape{1}) (51 children)
   MethodInstance for collect(::Base.Generator{Vector{Tuple},Pkg.PlatformEngines.var"#36#62"}) (48 children)
    MethodInstance for #probe_platform_engines!#14(::Bool, ::typeof(Pkg.PlatformEngines.probe_platform_engines!)) (47 children)
     MethodInstance for probe_platform_engines!() (46 children)
     
  
  MethodInstance for _array_for(::Type{T}, ::UnitRange{Int64}, ::Base.HasShape{1}) where T (345 children)
   MethodInstance for collect(::Base.Generator{UnitRange{Int64},_A} where _A) (320 children)
    MethodInstance for _ntuple(::Function, ::Int64) (316 children)
     MethodInstance for ntuple(::Serialization.var"#5#6"{Distributed.ClusterSerializer{Sockets.TCPSocket}}, ::Int64) (32 children)
     
     MethodInstance for ntuple(::typeof(one), ::Int64) (38 children)
     
     MethodInstance for ntuple(::LibGit2.var"#2#3", ::Int64) (56 children)
     
     MethodInstance for ntuple(::Base.var"#481#482"{Vector{SubString{String}}}, ::Int64) (164 children)
     
    
   
  
 

But collect(::Base.Generator{Vector{Tuple},Pkg.PlatformEngines.var"#36#62"}) (48 children) shouldn't be affected by the new methods AFAICT, since a Vector{Tuple} isn't Array{Union{Missing, CategoricalValue{...}}.

Then there are all the ntuple calls. I'm not sure why they are invalidated, as _ntuple itself is marked with @noinline_meta so shouldn't it act as a barrier which is known to return ::Tuple{Vararg{Int64,N} where N} and prevents further invalidation of dozens of methods?

Even without this, _ntuple calls collect on a generator via ([f(i) for i = 1:n]...,), and 1:n shouldn't be affected by the new similar methods either as its type is always UnitRange{Int}. (I must say I'm not sure whether collect(::Base.Generator{UnitRange{Int64},_A} where _A) (320 children) refers to a method which has been generated for a concrete type _A or assuming that _A is Any; @code_typed _Base.ntuple(one, 1) indicates that the generator is inferred as Core.PartialStruct(Base.Generator{UnitRange{Int64},typeof(one)}, Any[Core.Const(one, false), Core.PartialStruct(UnitRange{Int64}, Any[Core.Const(1, false), Int64])])).

@timholy
Copy link
Contributor

timholy commented Aug 12, 2020

Glad to see that folks are looking into CategoricalArrays, it is a standout for invalidations. And glad to hear that you're on your way to deprecating many of the problematic methods.

However, when I run with a very recent Julia build and eliminate loading of the deprecated methods of CategoricalArrays just as you have done, I get this:

julia> trees = invalidation_trees(invs)
23-element Vector{SnoopCompile.MethodInvalidations}:
 inserting isless(x::CategoricalValue, y) in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:142 invalidated:
   mt_backedges: 1: signature Tuple{typeof(isless),Any,Char} triggered MethodInstance for <(::Any, ::Char) (0 children)

 inserting isless(y, x::CategoricalValue) in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:144 invalidated:
   mt_backedges: 1: signature Tuple{typeof(isless),Char,Any} triggered MethodInstance for <(::Char, ::Any) (0 children)

 inserting <(x::CategoricalValue, y) in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:157 invalidated:
   backedges: 1: superseding <(x, y) in Base at operators.jl:277 with MethodInstance for <(::Any, ::Char) (1 children)

 inserting <(y, x::CategoricalValue) in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:165 invalidated:
   backedges: 1: superseding <(x, y) in Base at operators.jl:277 with MethodInstance for <(::Char, ::Any) (1 children)

 inserting similar(A::AbstractRange, ::Type{CategoricalValue{T,R}}, dims::Tuple{Vararg{Int64,N}}) where {T, R, N} in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/array.jl:591 invalidated:
   backedges: 1: superseding similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in Base at abstractarray.jl:699 with MethodInstance for similar(::UnitRange{Int64}, ::DataType, ::Tuple{Int64}) (3 children)

 inserting similar(A::AbstractRange, ::Type{Union{Missing, CategoricalValue{T,R} where R<:Integer}}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/array.jl:600 invalidated:
   backedges: 1: superseding similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in Base at abstractarray.jl:699 with MethodInstance for similar(::StepRange{Char,Int64}, ::Type, ::Tuple{Int64}) (1 children)
              2: superseding similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in Base at abstractarray.jl:699 with MethodInstance for similar(::UnitRange{Int64}, ::Type, ::Tuple{Int64}) (3 children)

 inserting resize!(v::JSON.Parser.PushVector, l::Integer) in JSON.Parser at /home/tim/.julia/packages/JSON/d89fA/src/pushvector.jl:28 invalidated:
   mt_backedges: 1: signature Tuple{typeof(resize!),AbstractVector{T} where T,Int64} triggered MethodInstance for _groupedunique!(::AbstractVector{T} where T) (1 children)
                 2: signature Tuple{typeof(resize!),AbstractVector{T} where T,Int64} triggered MethodInstance for _unique!(::typeof(identity), ::AbstractVector{T} where T, ::Set{_A} where _A, ::Int64, ::Int64) (5 children)

 inserting similar(A::Matrix{T} where T, ::Type{CategoricalValue{T,R} where R<:Integer}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/array.jl:594 invalidated:
   backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Array, ::Type, ::Tuple{Int64}) (6 children)

 inserting similar(A::Matrix{T} where T, ::Type{CategoricalValue{T,R}}, dims::Tuple{Vararg{Int64,N}}) where {T, R, N} in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/array.jl:591 invalidated:
   backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Array, ::DataType, ::Tuple{Int64}) (6 children)

 inserting promote_rule(::Type{C}, ::Type{T}) where {C<:CategoricalValue, T} in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:45 invalidated:
   backedges: 1: superseding promote_rule(::Type{var"#s844"} where var"#s844"<:AbstractIrrational, ::Type{T}) where T<:Real in Base at irrationals.jl:42 with MethodInstance for promote_rule(::Type{Union{}}, ::Type{UInt64}) (2 children)
              2: superseding promote_rule(::Type{var"#s68"} where var"#s68", ::Type{var"#s67"} where var"#s67") in Base at promotion.jl:235 with MethodInstance for promote_rule(::Type{T} where T<:Unsigned, ::Type{UInt64}) (10 children)

 inserting similar(A::Vector{T} where T, ::Type{CategoricalValue{T,R}}, dims::Tuple{Vararg{Int64,N}}) where {T, R, N} in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/array.jl:591 invalidated:
   backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Any}, ::DataType, ::Tuple{Int64}) (1 children)
              2: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Dict{Any,Any}}, ::DataType, ::Tuple{Int64}) (1 children)
              3: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Base.Docs.DocStr}, ::DataType, ::Tuple{Int64}) (1 children)
              4: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Base.RefValue{Any}}, ::DataType, ::Tuple{Int64}) (1 children)
              5: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{String}, ::DataType, ::Tuple{Int64}) (1 children)
              6: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{REPL.REPLCompletions.Completion}, ::DataType, ::Tuple{Int64}) (1 children)
              7: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{_A} where _A, ::DataType, ::Tuple{Int64}) (6 children)

 inserting repr(x::CategoricalValue) in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:92 invalidated:
   backedges: 1: superseding repr(x; context) in Base at strings/io.jl:229 with MethodInstance for repr(::Any) (12 children)

 inserting Base.IteratorSize(::Type{var"#s2"} where var"#s2"<:(Missings.EachReplaceMissing{T,U} where U)) where T in Missings at /home/tim/.julia/packages/Missings/Aam9N/src/Missings.jl:82 invalidated:
   backedges: 1: superseding Base.IteratorSize(::Type) in Base at generator.jl:91 with MethodInstance for Base.IteratorSize(::Type{var"#s431"} where var"#s431"<:Tuple{Type,Vararg{Type,N} where N}) (2 children)
              2: superseding Base.IteratorSize(::Type) in Base at generator.jl:91 with MethodInstance for Base.IteratorSize(::Type{var"#s431"} where var"#s431"<:Tuple{Pair{Symbol,String},Vararg{Pair,N} where N}) (6 children)
              3: superseding Base.IteratorSize(::Type) in Base at generator.jl:91 with MethodInstance for Base.IteratorSize(::Type{var"#s431"} where var"#s431"<:Tuple{Pair{Symbol,V} where V,Pair{Symbol,V} where V}) (10 children)

 inserting ==(x::CategoricalValue, y) in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:112 invalidated:
   backedges:  1: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::typeof(+)) (1 children)
               2: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::typeof(-)) (1 children)
               3: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::Base.UUID) (1 children)
               4: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::Symbol) (2 children)
               5: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::Module) (2 children)
               6: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::Nothing) (2 children)
               7: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::Distributed.WorkerState) (2 children)
               8: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::Pkg.BinaryPlatforms.Linux) (2 children)
               9: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::Pkg.BinaryPlatforms.MacOS) (2 children)
              10: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::Pkg.BinaryPlatforms.Windows) (2 children)
              11: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::REPL.LineEdit.Prompt) (2 children)
              12: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Any, ::Base.Docs.Binding) (3 children)

 inserting ==(x, y::CategoricalValue) in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:113 invalidated:
   backedges:  1: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#45#76", ::Any) (1 children)
               2: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#46#77", ::Any) (1 children)
               3: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#74#105"{REPL.LineEdit.HistoryPrompt}, ::Any) (1 children)
               4: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#75#106"{REPL.LineEdit.HistoryPrompt}, ::Any) (1 children)
               5: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#251#255"{REPL.LineEdit.PrefixHistoryPrompt}, ::Any) (1 children)
               6: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#252#256"{REPL.LineEdit.PrefixHistoryPrompt}, ::Any) (1 children)
               7: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Pkg.BinaryPlatforms.Platform, ::Any) (1 children)
               8: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Method, ::Any) (1 children)
               9: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::typeof(+), ::Any) (1 children)
              10: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.var"#72#82"{REPL.LineEdit.Prompt}, ::Any) (1 children)
              11: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.var"#74#84"{REPL.LineEdit.Prompt}, ::Any) (1 children)
              12: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Base.UUID, ::Any) (1 children)
              13: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.Prompt, ::Any) (1 children)
              14: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Core.TypeName, ::Any) (2 children)
              15: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Module, ::Any) (3 children)
              16: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Symbol, ::Any) (6 children)

 inserting isequal(x::CategoricalValue, y) in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:123 invalidated:
   backedges:  1: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::typeof(-)) (2 children)
               2: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::typeof(+)) (3 children)
               3: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::Base.UUID) (3 children)
               4: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::Distributed.WorkerState) (4 children)
               5: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::Base.Docs.Binding) (4 children)
               6: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::REPL.LineEdit.Prompt) (4 children)
               7: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::Nothing) (5 children)
               8: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::Pkg.BinaryPlatforms.Linux) (5 children)
               9: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::Pkg.BinaryPlatforms.MacOS) (5 children)
              10: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::Pkg.BinaryPlatforms.Windows) (5 children)
              11: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::Symbol) (8 children)
              12: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Any, ::Module) (17 children)

 inserting similar(A::Vector{T} where T, ::Type{CategoricalValue{T,R} where R<:Integer}, dims::Tuple{Vararg{Int64,N}}) where {T, N} in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/array.jl:594 invalidated:
   backedges:  1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Union{Int64, Symbol}}, ::Type, ::Tuple{Int64}) (1 children)
               2: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{String}, ::Type, ::Tuple{Int64}) (3 children)
               3: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Base.RefValue{Any}}, ::Type, ::Tuple{Int64}) (3 children)
               4: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Dict{Any,Any}}, ::Type, ::Tuple{Int64}) (3 children)
               5: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Dict{Any,Any}}, ::Type, ::Tuple{Int64}) (5 children)
               6: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{REPL.REPLCompletions.Completion}, ::Type, ::Tuple{Int64}) (6 children)
               7: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Any}, ::Type, ::Tuple{Int64}) (6 children)
               8: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Base.RefValue{Any}}, ::Type, ::Tuple{Int64}) (8 children)
               9: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{String}, ::Type, ::Tuple{Int64}) (11 children)
              10: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{_A} where _A, ::Type, ::Tuple{Int64}) (11 children)
              11: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Base.Docs.DocStr}, ::Type, ::Tuple{Int64}) (12 children)
              12: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64,N}}) where N in Base at array.jl:380 with MethodInstance for similar(::Vector{Any}, ::Type, ::Tuple{Int64}) (32 children)

 inserting similar(A::Vector{T} where T, ::Type{CategoricalValue{T,R} where R<:Integer}) where T in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/array.jl:594 invalidated:
   backedges:  1: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Base.StackTraces.StackFrame}, ::Type) (1 children)
               2: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Symbol}, ::Type) (2 children)
               3: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{String}, ::Type) (3 children)
               4: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Bool}, ::Type) (3 children)
               5: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Markdown.MD}, ::Type) (3 children)
               6: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Tuple{Tuple{String,Int64},Int64}}, ::Type) (3 children)
               7: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{UInt64}, ::Type) (5 children)
               8: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{UInt128}, ::Type) (5 children)
               9: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{UInt32}, ::Type) (5 children)
              10: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{Int64}, ::Type) (5 children)
              11: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:377 with MethodInstance for similar(::Vector{_A} where _A, ::Type) (127 children)

 inserting convert(::Type{String}, x::CategoricalValue) in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:60 invalidated:
   mt_backedges:  1: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{DataType,String}(::Any, ::Any) (0 children)
                  2: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for push!(::Vector{String}, ::Any) (0 children)
                  3: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Vector{String}, ::Any, ::Int64) (0 children)
                  4: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#112#165"}(::Any, ::Any) (0 children)
                  5: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#113#166"}(::Any, ::Any) (0 children)
                  6: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#114#167"}(::Any, ::Any) (0 children)
                  7: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#115#168"}(::Any, ::Any) (0 children)
                  8: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#116#169"}(::Any, ::Any) (0 children)
                  9: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#117#170"}(::Any, ::Any) (0 children)
                 10: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#118#171"}(::Any, ::Any) (0 children)
                 11: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#119#172"}(::Any, ::Any) (0 children)
                 12: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#120#173"}(::Any, ::Any) (0 children)
                 13: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#121#174"}(::Any, ::Any) (0 children)
                 14: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#122#175"}(::Any, ::Any) (0 children)
                 15: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#123#176"}(::Any, ::Any) (0 children)
                 16: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#124#177"}(::Any, ::Any) (0 children)
                 17: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#125#178"}(::Any, ::Any) (0 children)
                 18: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#126#179"}(::Any, ::Any) (0 children)
                 19: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#127#180"}(::Any, ::Any) (0 children)
                 20: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#128#181"}(::Any, ::Any) (0 children)
                 21: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#129#182"}(::Any, ::Any) (0 children)
                 22: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#130#183"}(::Any, ::Any) (0 children)
                 23: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#131#184"}(::Any, ::Any) (0 children)
                 24: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#132#185"}(::Any, ::Any) (0 children)
                 25: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#133#186"}(::Any, ::Any) (0 children)
                 26: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#134#187"}(::Any, ::Any) (0 children)
                 27: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#135#188"}(::Any, ::Any) (0 children)
                 28: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#136#189"}(::Any, ::Any) (0 children)
                 29: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#137#190"}(::Any, ::Any) (0 children)
                 30: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#138#191"}(::Any, ::Any) (0 children)
                 31: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#139#192"}(::Any, ::Any) (0 children)
                 32: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#140#193"}(::Any, ::Any) (0 children)
                 33: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#141#194"}(::Any, ::Any) (0 children)
                 34: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#142#195"}(::Any, ::Any) (0 children)
                 35: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#143#196"}(::Any, ::Any) (0 children)
                 36: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#144#197"}(::Any, ::Any) (0 children)
                 37: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#145#198"}(::Any, ::Any) (0 children)
                 38: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#146#199"}(::Any, ::Any) (0 children)
                 39: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#147#200"}(::Any, ::Any) (0 children)
                 40: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#148#201"}(::Any, ::Any) (0 children)
                 41: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#149#202"}(::Any, ::Any) (0 children)
                 42: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#150#203"}(::Any, ::Any) (0 children)
                 43: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#151#204"}(::Any, ::Any) (0 children)
                 44: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#152#205"}(::Any, ::Any) (0 children)
                 45: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#153#206"}(::Any, ::Any) (0 children)
                 46: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#154#207"}(::Any, ::Any) (0 children)
                 47: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#155#208"}(::Any, ::Any) (0 children)
                 48: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#156#209"}(::Any, ::Any) (0 children)
                 49: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#157#210"}(::Any, ::Any) (0 children)
                 50: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#158#211"}(::Any, ::Any) (0 children)
                 51: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#159#212"}(::Any, ::Any) (0 children)
                 52: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#160#213"}(::Any, ::Any) (0 children)
                 53: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#161#214"}(::Any, ::Any) (0 children)
                 54: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#215#225"}(::Any, ::Any) (0 children)
                 55: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#216#226"}(::Any, ::Any) (0 children)
                 56: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#217#227"}(::Any, ::Any) (0 children)
                 57: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#218#228"}(::Any, ::Any) (0 children)
                 58: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#219#229"}(::Any, ::Any) (0 children)
                 59: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#220#230"}(::Any, ::Any) (0 children)
                 60: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#221#231"}(::Any, ::Any) (0 children)
                 61: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#222#232"}(::Any, ::Any) (0 children)
                 62: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#223#233"}(::Any, ::Any) (0 children)
                 63: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#224#234"}(::Any, ::Any) (0 children)
                 64: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#235#243"}(::Any, ::Any) (0 children)
                 65: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#236#244"}(::Any, ::Any) (0 children)
                 66: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#237#245"}(::Any, ::Any) (0 children)
                 67: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#238#246"}(::Any, ::Any) (0 children)
                 68: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#239#247"}(::Any, ::Any) (0 children)
                 69: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,Pkg.REPLMode.OptionSpec}, ::Any, ::Any) (0 children)
                 70: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,Pkg.REPLMode.CommandSpec}, ::Any, ::Any) (0 children)
                 71: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,Dict{String,Pkg.REPLMode.CommandSpec}}, ::Any, ::Any) (0 children)
                 72: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,Nothing}, ::Nothing, ::Any) (0 children)
                 73: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,Vector{Pkg.Types.Stage1}}, ::Vector{Pkg.Types.Stage1}, ::Any) (0 children)
                 74: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,Any}, ::Any, ::Any) (0 children)
                 75: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for find_registered!(::Pkg.Types.Context, ::Vector{String}, ::Vector{Base.UUID}) (0 children)
                 76: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Base.UUID,String},_A} where _A)(::Int64) (0 children)
                 77: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,Vector{Base.UUID}}, ::Any, ::Any) (0 children)
                 78: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,Base.UUID}, ::Any, ::Any) (0 children)
                 79: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,Pkg.Types.VersionSpec}, ::Any, ::Any) (0 children)
                 80: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Pkg.Types.PackageSpec,String},_A} where _A)(::Int64) (0 children)
                 81: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,Vector{String}}, ::Any, ::Any) (0 children)
                 82: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,Base.UUID}, ::Base.UUID, ::Any) (0 children)
                 83: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,String}, ::Any, ::Any) (0 children)
                 84: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::IdDict{Any,String}, ::Any, ::Any) (1 children)
                 85: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for REPL.LineEditREPL(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (1 children)
                 86: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Pkg.REPLMode.QString(::Any, ::Bool) (1 children)
                 87: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for setindex!(::Dict{String,String}, ::Any, ::String) (1 children)
                 88: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for REPL.REPLCompletions.PathCompletion(::Any) (2 children)
                 89: signature Tuple{typeof(convert),Union{Type{Base.UUID}, Type{String}},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Base.UUID,String},_A} where _A)(::Int64) (3 children)
                 90: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Base.UUID,String,String,VersionNumber},_A} where _A)(::Int64) (3 children)
                 91: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{String,Vector{UInt8},Pkg.GitTools.GitMode},_A} where _A)(::Int64) (4 children)
                 92: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{String,String},_A} where _A)(::Int64) (5 children)
                 93: signature Tuple{typeof(convert),Union{Type{String}, Type{Pkg.Types.PackageSpec}},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Pkg.Types.PackageSpec,String},_A} where _A)(::Int64) (5 children)
                 94: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for Cmd(::Cmd, ::Any, ::Any, ::Any, ::Any) (8 children)
                 95: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for REPL.LineEdit.PrefixSearchState(::Any, ::Any, ::Any, ::Any) (10 children)
                 96: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{String,Int32},_A} where _A)(::Int64) (13 children)
                 97: signature Tuple{typeof(convert),Type{String},Any} triggered MethodInstance for convert(::Type{Union{Nothing, String}}, ::Any) (133 children)

 inserting isequal(x, y::CategoricalValue) in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:124 invalidated:
   backedges:  1: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Pkg.BinaryPlatforms.Platform, ::Any) (4 children)
               2: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::typeof(+), ::Any) (4 children)
               3: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::REPL.LineEdit.var"#45#76", ::Any) (5 children)
               4: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::REPL.LineEdit.var"#46#77", ::Any) (5 children)
               5: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::REPL.LineEdit.var"#74#105"{REPL.LineEdit.HistoryPrompt}, ::Any) (5 children)
               6: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::REPL.LineEdit.var"#75#106"{REPL.LineEdit.HistoryPrompt}, ::Any) (5 children)
               7: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::REPL.var"#72#82"{REPL.LineEdit.Prompt}, ::Any) (5 children)
               8: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::REPL.var"#74#84"{REPL.LineEdit.Prompt}, ::Any) (5 children)
               9: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Base.UUID, ::Any) (5 children)
              10: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::REPL.LineEdit.var"#251#255"{REPL.LineEdit.PrefixHistoryPrompt}, ::Any) (6 children)
              11: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::REPL.LineEdit.var"#252#256"{REPL.LineEdit.PrefixHistoryPrompt}, ::Any) (6 children)
              12: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::REPL.LineEdit.Prompt, ::Any) (11 children)
              13: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Method, ::Any) (22 children)
              14: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Core.TypeName, ::Any) (24 children)
              15: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Module, ::Any) (76 children)
              16: superseding isequal(x, y) in Base at operators.jl:123 with MethodInstance for isequal(::Symbol, ::Any) (134 children)

 inserting convert(::Type{S}, x::T) where {S, T<:CategoricalValue} in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:68 invalidated:
   mt_backedges:   1: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,Base.IRShow.var"#31#33"}(::Any, ::Any) (0 children)
                   2: signature Tuple{typeof(convert),Type{Base.IRShow.var"#31#33"},Any} triggered MethodInstance for Pair{Symbol,Base.IRShow.var"#31#33"}(::Any, ::Any) (0 children)
                   3: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,Base.IRShow.var"#32#34"}(::Any, ::Any) (0 children)
                   4: signature Tuple{typeof(convert),Type{Base.IRShow.var"#32#34"},Any} triggered MethodInstance for Pair{Symbol,Base.IRShow.var"#32#34"}(::Any, ::Any) (0 children)
                   5: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for setindex!(::Dict{Symbol,Any}, ::Any, ::Any) (0 children)
                   6: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(+)}(::Any, ::Any) (0 children)
                   7: signature Tuple{typeof(convert),Type{typeof(+)},Any} triggered MethodInstance for Pair{Symbol,typeof(+)}(::Any, ::Any) (0 children)
                   8: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(-)}(::Any, ::Any) (0 children)
                   9: signature Tuple{typeof(convert),Type{typeof(-)},Any} triggered MethodInstance for Pair{Symbol,typeof(-)}(::Any, ::Any) (0 children)
                  10: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(*)}(::Any, ::Any) (0 children)
                  11: signature Tuple{typeof(convert),Type{typeof(*)},Any} triggered MethodInstance for Pair{Symbol,typeof(*)}(::Any, ::Any) (0 children)
                  12: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(/)}(::Any, ::Any) (0 children)
                  13: signature Tuple{typeof(convert),Type{typeof(/)},Any} triggered MethodInstance for Pair{Symbol,typeof(/)}(::Any, ::Any) (0 children)
                  14: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(^)}(::Any, ::Any) (0 children)
                  15: signature Tuple{typeof(convert),Type{typeof(^)},Any} triggered MethodInstance for Pair{Symbol,typeof(^)}(::Any, ::Any) (0 children)
                  16: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(div)}(::Any, ::Any) (0 children)
                  17: signature Tuple{typeof(convert),Type{typeof(div)},Any} triggered MethodInstance for Pair{Symbol,typeof(div)}(::Any, ::Any) (0 children)
                  18: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for setindex!(::Dict{Symbol,Function}, ::Any, ::Any) (0 children)
                  19: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(==)}(::Any, ::Any) (0 children)
                  20: signature Tuple{typeof(convert),Type{typeof(==)},Any} triggered MethodInstance for Pair{Symbol,typeof(==)}(::Any, ::Any) (0 children)
                  21: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(<)}(::Any, ::Any) (0 children)
                  22: signature Tuple{typeof(convert),Type{typeof(<)},Any} triggered MethodInstance for Pair{Symbol,typeof(<)}(::Any, ::Any) (0 children)
                  23: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(>)}(::Any, ::Any) (0 children)
                  24: signature Tuple{typeof(convert),Type{typeof(>)},Any} triggered MethodInstance for Pair{Symbol,typeof(>)}(::Any, ::Any) (0 children)
                  25: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(<=)}(::Any, ::Any) (0 children)
                  26: signature Tuple{typeof(convert),Type{typeof(<=)},Any} triggered MethodInstance for Pair{Symbol,typeof(<=)}(::Any, ::Any) (0 children)
                  27: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(>=)}(::Any, ::Any) (0 children)
                  28: signature Tuple{typeof(convert),Type{typeof(>=)},Any} triggered MethodInstance for Pair{Symbol,typeof(>=)}(::Any, ::Any) (0 children)
                  29: signature Tuple{typeof(convert),Type{DataType},Any} triggered MethodInstance for Pair{DataType,String}(::Any, ::Any) (0 children)
                  30: signature Tuple{typeof(convert),Type{Union{Core.CodeInfo, Core.MethodInstance}},Any} triggered MethodInstance for convert(::Type{Union{Nothing, Core.CodeInfo, Core.MethodInstance}}, ::Any) (0 children)
                  31: signature Tuple{typeof(convert),Type{Module},Any} triggered MethodInstance for convert(::Type{Union{Nothing, Module}}, ::Any) (0 children)
                  32: signature Tuple{typeof(convert),Type{WeakRef},Any} triggered MethodInstance for setindex!(::Dict{WeakRef,Any}, ::Any, ::Any) (0 children)
                  33: signature Tuple{typeof(convert),Type{Function},Any} triggered MethodInstance for Dates.DateFunction(::Any, ::Dates.Date) (0 children)
                  34: signature Tuple{typeof(convert),Type{Function},Any} triggered MethodInstance for setindex!(::Vector{Function}, ::Any, ::Int64) (0 children)
                  35: signature Tuple{typeof(convert),Type{DataType},Any} triggered MethodInstance for Pair{Char,DataType}(::Any, ::Any) (0 children)
                  36: signature Tuple{typeof(convert),Type{DataType},Any} triggered MethodInstance for Pair{DataType,Int64}(::Any, ::Any) (0 children)
                  37: signature Tuple{typeof(convert),Type{DataType},Any} triggered MethodInstance for Pair{DataType,Dates.AMPM}(::Any, ::Any) (0 children)
                  38: signature Tuple{typeof(convert),Type{Dates.AMPM},Any} triggered MethodInstance for Pair{DataType,Dates.AMPM}(::Any, ::Any) (0 children)
                  39: signature Tuple{typeof(convert),Type{DataType},Any} triggered MethodInstance for Pair{DataType,Tuple{DataType,DataType,DataType}}(::Any, ::Any) (0 children)
                  40: signature Tuple{typeof(convert),Type{Tuple{DataType,DataType,DataType}},Any} triggered MethodInstance for Pair{DataType,Tuple{DataType,DataType,DataType}}(::Any, ::Any) (0 children)
                  41: signature Tuple{typeof(convert),Type{DataType},Any} triggered MethodInstance for Pair{DataType,NTuple{8,DataType}}(::Any, ::Any) (0 children)
                  42: signature Tuple{typeof(convert),Type{NTuple{8,DataType}},Any} triggered MethodInstance for Pair{DataType,NTuple{8,DataType}}(::Any, ::Any) (0 children)
                  43: signature Tuple{typeof(convert),Type{DataType},Any} triggered MethodInstance for Pair{DataType,NTuple{7,DataType}}(::Any, ::Any) (0 children)
                  44: signature Tuple{typeof(convert),Type{NTuple{7,DataType}},Any} triggered MethodInstance for Pair{DataType,NTuple{7,DataType}}(::Any, ::Any) (0 children)
                  45: signature Tuple{typeof(convert),Type{Distributed.RRID},Any} triggered MethodInstance for setindex!(::Dict{Distributed.RRID,Any}, ::Any, ::Any) (0 children)
                  46: signature Tuple{typeof(convert),Type{WeakRef},Any} triggered MethodInstance for setindex!(::Dict{WeakRef,Nothing}, ::Nothing, ::Any) (0 children)
                  47: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#109#162"},Any} triggered MethodInstance for Pair{Char,REPL.LineEdit.var"#109#162"}(::Any, ::Any) (0 children)
                  48: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#110#163"},Any} triggered MethodInstance for Pair{Char,REPL.LineEdit.var"#110#163"}(::Any, ::Any) (0 children)
                  49: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#111#164"},Any} triggered MethodInstance for Pair{Char,REPL.LineEdit.var"#111#164"}(::Any, ::Any) (0 children)
                  50: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#112#165"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#112#165"}(::Any, ::Any) (0 children)
                  51: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#113#166"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#113#166"}(::Any, ::Any) (0 children)
                  52: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#114#167"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#114#167"}(::Any, ::Any) (0 children)
                  53: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#115#168"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#115#168"}(::Any, ::Any) (0 children)
                  54: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#116#169"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#116#169"}(::Any, ::Any) (0 children)
                  55: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#117#170"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#117#170"}(::Any, ::Any) (0 children)
                  56: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#118#171"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#118#171"}(::Any, ::Any) (0 children)
                  57: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#119#172"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#119#172"}(::Any, ::Any) (0 children)
                  58: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#120#173"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#120#173"}(::Any, ::Any) (0 children)
                  59: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#121#174"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#121#174"}(::Any, ::Any) (0 children)
                  60: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#122#175"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#122#175"}(::Any, ::Any) (0 children)
                  61: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#123#176"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#123#176"}(::Any, ::Any) (0 children)
                  62: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#124#177"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#124#177"}(::Any, ::Any) (0 children)
                  63: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#125#178"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#125#178"}(::Any, ::Any) (0 children)
                  64: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#126#179"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#126#179"}(::Any, ::Any) (0 children)
                  65: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#127#180"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#127#180"}(::Any, ::Any) (0 children)
                  66: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#128#181"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#128#181"}(::Any, ::Any) (0 children)
                  67: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#129#182"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#129#182"}(::Any, ::Any) (0 children)
                  68: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#130#183"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#130#183"}(::Any, ::Any) (0 children)
                  69: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#131#184"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#131#184"}(::Any, ::Any) (0 children)
                  70: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#132#185"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#132#185"}(::Any, ::Any) (0 children)
                  71: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#133#186"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#133#186"}(::Any, ::Any) (0 children)
                  72: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#134#187"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#134#187"}(::Any, ::Any) (0 children)
                  73: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#135#188"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#135#188"}(::Any, ::Any) (0 children)
                  74: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#136#189"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#136#189"}(::Any, ::Any) (0 children)
                  75: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#137#190"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#137#190"}(::Any, ::Any) (0 children)
                  76: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#138#191"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#138#191"}(::Any, ::Any) (0 children)
                  77: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#139#192"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#139#192"}(::Any, ::Any) (0 children)
                  78: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#140#193"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#140#193"}(::Any, ::Any) (0 children)
                  79: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#141#194"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#141#194"}(::Any, ::Any) (0 children)
                  80: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#142#195"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#142#195"}(::Any, ::Any) (0 children)
                  81: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#143#196"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#143#196"}(::Any, ::Any) (0 children)
                  82: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#144#197"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#144#197"}(::Any, ::Any) (0 children)
                  83: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#145#198"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#145#198"}(::Any, ::Any) (0 children)
                  84: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#146#199"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#146#199"}(::Any, ::Any) (0 children)
                  85: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#147#200"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#147#200"}(::Any, ::Any) (0 children)
                  86: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#148#201"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#148#201"}(::Any, ::Any) (0 children)
                  87: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#149#202"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#149#202"}(::Any, ::Any) (0 children)
                  88: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#150#203"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#150#203"}(::Any, ::Any) (0 children)
                  89: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#151#204"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#151#204"}(::Any, ::Any) (0 children)
                  90: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#152#205"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#152#205"}(::Any, ::Any) (0 children)
                  91: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#153#206"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#153#206"}(::Any, ::Any) (0 children)
                  92: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#154#207"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#154#207"}(::Any, ::Any) (0 children)
                  93: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#155#208"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#155#208"}(::Any, ::Any) (0 children)
                  94: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#156#209"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#156#209"}(::Any, ::Any) (0 children)
                  95: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#157#210"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#157#210"}(::Any, ::Any) (0 children)
                  96: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#158#211"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#158#211"}(::Any, ::Any) (0 children)
                  97: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#159#212"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#159#212"}(::Any, ::Any) (0 children)
                  98: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#160#213"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#160#213"}(::Any, ::Any) (0 children)
                  99: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#161#214"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#161#214"}(::Any, ::Any) (0 children)
                 100: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#215#225"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#215#225"}(::Any, ::Any) (0 children)
                 101: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#216#226"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#216#226"}(::Any, ::Any) (0 children)
                 102: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#217#227"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#217#227"}(::Any, ::Any) (0 children)
                 103: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#218#228"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#218#228"}(::Any, ::Any) (0 children)
                 104: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#219#229"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#219#229"}(::Any, ::Any) (0 children)
                 105: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#220#230"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#220#230"}(::Any, ::Any) (0 children)
                 106: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#221#231"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#221#231"}(::Any, ::Any) (0 children)
                 107: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#222#232"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#222#232"}(::Any, ::Any) (0 children)
                 108: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#223#233"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#223#233"}(::Any, ::Any) (0 children)
                 109: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#224#234"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#224#234"}(::Any, ::Any) (0 children)
                 110: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#235#243"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#235#243"}(::Any, ::Any) (0 children)
                 111: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#236#244"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#236#244"}(::Any, ::Any) (0 children)
                 112: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#237#245"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#237#245"}(::Any, ::Any) (0 children)
                 113: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#238#246"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#238#246"}(::Any, ::Any) (0 children)
                 114: signature Tuple{typeof(convert),Type{REPL.LineEdit.var"#239#247"},Any} triggered MethodInstance for Pair{String,REPL.LineEdit.var"#239#247"}(::Any, ::Any) (0 children)
                 115: signature Tuple{typeof(convert),Type{Regex},Any} triggered MethodInstance for Pair{Regex,typeof(Pkg.Types.semver_interval)}(::Any, ::Any) (0 children)
                 116: signature Tuple{typeof(convert),Type{typeof(Pkg.Types.semver_interval)},Any} triggered MethodInstance for Pair{Regex,typeof(Pkg.Types.semver_interval)}(::Any, ::Any) (0 children)
                 117: signature Tuple{typeof(convert),Type{Regex},Any} triggered MethodInstance for Pair{Regex,typeof(Pkg.Types.inequality_interval)}(::Any, ::Any) (0 children)
                 118: signature Tuple{typeof(convert),Type{typeof(Pkg.Types.inequality_interval)},Any} triggered MethodInstance for Pair{Regex,typeof(Pkg.Types.inequality_interval)}(::Any, ::Any) (0 children)
                 119: signature Tuple{typeof(convert),Type{Regex},Any} triggered MethodInstance for Pair{Regex,typeof(Pkg.Types.hyphen_interval)}(::Any, ::Any) (0 children)
                 120: signature Tuple{typeof(convert),Type{typeof(Pkg.Types.hyphen_interval)},Any} triggered MethodInstance for Pair{Regex,typeof(Pkg.Types.hyphen_interval)}(::Any, ::Any) (0 children)
                 121: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.test)}(::Any, ::Any) (0 children)
                 122: signature Tuple{typeof(convert),Type{typeof(Pkg.API.test)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.test)}(::Any, ::Any) (0 children)
                 123: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.parse_package)}(::Any, ::Any) (0 children)
                 124: signature Tuple{typeof(convert),Type{typeof(Pkg.REPLMode.parse_package)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.parse_package)}(::Any, ::Any) (0 children)
                 125: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.complete_installed_packages)}(::Any, ::Any) (0 children)
                 126: signature Tuple{typeof(convert),Type{typeof(Pkg.REPLMode.complete_installed_packages)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.complete_installed_packages)}(::Any, ::Any) (0 children)
                 127: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(identity)}(::Any, ::Any) (0 children)
                 128: signature Tuple{typeof(convert),Type{typeof(identity)},Any} triggered MethodInstance for Pair{Symbol,typeof(identity)}(::Any, ::Any) (0 children)
                 129: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,Pkg.REPLMode.var"#63#68"}(::Any, ::Any) (0 children)
                 130: signature Tuple{typeof(convert),Type{Pkg.REPLMode.var"#63#68"},Any} triggered MethodInstance for Pair{Symbol,Pkg.REPLMode.var"#63#68"}(::Any, ::Any) (0 children)
                 131: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.complete_help)}(::Any, ::Any) (0 children)
                 132: signature Tuple{typeof(convert),Type{typeof(Pkg.REPLMode.complete_help)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.complete_help)}(::Any, ::Any) (0 children)
                 133: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.instantiate)}(::Any, ::Any) (0 children)
                 134: signature Tuple{typeof(convert),Type{typeof(Pkg.API.instantiate)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.instantiate)}(::Any, ::Any) (0 children)
                 135: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.rm)}(::Any, ::Any) (0 children)
                 136: signature Tuple{typeof(convert),Type{typeof(Pkg.API.rm)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.rm)}(::Any, ::Any) (0 children)
                 137: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.add)}(::Any, ::Any) (0 children)
                 138: signature Tuple{typeof(convert),Type{typeof(Pkg.API.add)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.add)}(::Any, ::Any) (0 children)
                 139: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,Pkg.REPLMode.var"#64#69"}(::Any, ::Any) (0 children)
                 140: signature Tuple{typeof(convert),Type{Pkg.REPLMode.var"#64#69"},Any} triggered MethodInstance for Pair{Symbol,Pkg.REPLMode.var"#64#69"}(::Any, ::Any) (0 children)
                 141: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.do_preserve)}(::Any, ::Any) (0 children)
                 142: signature Tuple{typeof(convert),Type{typeof(Pkg.REPLMode.do_preserve)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.do_preserve)}(::Any, ::Any) (0 children)
                 143: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.complete_add_dev)}(::Any, ::Any) (0 children)
                 144: signature Tuple{typeof(convert),Type{typeof(Pkg.REPLMode.complete_add_dev)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.complete_add_dev)}(::Any, ::Any) (0 children)
                 145: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.develop)}(::Any, ::Any) (0 children)
                 146: signature Tuple{typeof(convert),Type{typeof(Pkg.API.develop)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.develop)}(::Any, ::Any) (0 children)
                 147: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,Pkg.REPLMode.var"#65#70"}(::Any, ::Any) (0 children)
                 148: signature Tuple{typeof(convert),Type{Pkg.REPLMode.var"#65#70"},Any} triggered MethodInstance for Pair{Symbol,Pkg.REPLMode.var"#65#70"}(::Any, ::Any) (0 children)
                 149: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.free)}(::Any, ::Any) (0 children)
                 150: signature Tuple{typeof(convert),Type{typeof(Pkg.API.free)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.free)}(::Any, ::Any) (0 children)
                 151: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.pin)}(::Any, ::Any) (0 children)
                 152: signature Tuple{typeof(convert),Type{typeof(Pkg.API.pin)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.pin)}(::Any, ::Any) (0 children)
                 153: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.build)}(::Any, ::Any) (0 children)
                 154: signature Tuple{typeof(convert),Type{typeof(Pkg.API.build)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.build)}(::Any, ::Any) (0 children)
                 155: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.resolve)}(::Any, ::Any) (0 children)
                 156: signature Tuple{typeof(convert),Type{typeof(Pkg.API.resolve)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.resolve)}(::Any, ::Any) (0 children)
                 157: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.activate)}(::Any, ::Any) (0 children)
                 158: signature Tuple{typeof(convert),Type{typeof(Pkg.API.activate)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.activate)}(::Any, ::Any) (0 children)
                 159: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.parse_activate)}(::Any, ::Any) (0 children)
                 160: signature Tuple{typeof(convert),Type{typeof(Pkg.REPLMode.parse_activate)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.parse_activate)}(::Any, ::Any) (0 children)
                 161: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.complete_activate)}(::Any, ::Any) (0 children)
                 162: signature Tuple{typeof(convert),Type{typeof(Pkg.REPLMode.complete_activate)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.complete_activate)}(::Any, ::Any) (0 children)
                 163: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.up)}(::Any, ::Any) (0 children)
                 164: signature Tuple{typeof(convert),Type{typeof(Pkg.API.up)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.up)}(::Any, ::Any) (0 children)
                 165: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.generate_deprecated)}(::Any, ::Any) (0 children)
                 166: signature Tuple{typeof(convert),Type{typeof(Pkg.API.generate_deprecated)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.generate_deprecated)}(::Any, ::Any) (0 children)
                 167: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,Pkg.REPLMode.var"#66#71"}(::Any, ::Any) (0 children)
                 168: signature Tuple{typeof(convert),Type{Pkg.REPLMode.var"#66#71"},Any} triggered MethodInstance for Pair{Symbol,Pkg.REPLMode.var"#66#71"}(::Any, ::Any) (0 children)
                 169: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.precompile)}(::Any, ::Any) (0 children)
                 170: signature Tuple{typeof(convert),Type{typeof(Pkg.API.precompile)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.precompile)}(::Any, ::Any) (0 children)
                 171: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.status)}(::Any, ::Any) (0 children)
                 172: signature Tuple{typeof(convert),Type{typeof(Pkg.API.status)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.status)}(::Any, ::Any) (0 children)
                 173: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.gc)}(::Any, ::Any) (0 children)
                 174: signature Tuple{typeof(convert),Type{typeof(Pkg.API.gc)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.gc)}(::Any, ::Any) (0 children)
                 175: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.undo)}(::Any, ::Any) (0 children)
                 176: signature Tuple{typeof(convert),Type{typeof(Pkg.API.undo)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.undo)}(::Any, ::Any) (0 children)
                 177: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.redo)}(::Any, ::Any) (0 children)
                 178: signature Tuple{typeof(convert),Type{typeof(Pkg.API.redo)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.API.redo)}(::Any, ::Any) (0 children)
                 179: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.Registry.add)}(::Any, ::Any) (0 children)
                 180: signature Tuple{typeof(convert),Type{typeof(Pkg.Registry.add)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.Registry.add)}(::Any, ::Any) (0 children)
                 181: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,Pkg.REPLMode.var"#67#72"}(::Any, ::Any) (0 children)
                 182: signature Tuple{typeof(convert),Type{Pkg.REPLMode.var"#67#72"},Any} triggered MethodInstance for Pair{Symbol,Pkg.REPLMode.var"#67#72"}(::Any, ::Any) (0 children)
                 183: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.Registry.rm)}(::Any, ::Any) (0 children)
                 184: signature Tuple{typeof(convert),Type{typeof(Pkg.Registry.rm)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.Registry.rm)}(::Any, ::Any) (0 children)
                 185: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.parse_registry)}(::Any, ::Any) (0 children)
                 186: signature Tuple{typeof(convert),Type{typeof(Pkg.REPLMode.parse_registry)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.REPLMode.parse_registry)}(::Any, ::Any) (0 children)
                 187: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.Registry.update)}(::Any, ::Any) (0 children)
                 188: signature Tuple{typeof(convert),Type{typeof(Pkg.Registry.update)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.Registry.update)}(::Any, ::Any) (0 children)
                 189: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.Registry.status)}(::Any, ::Any) (0 children)
                 190: signature Tuple{typeof(convert),Type{typeof(Pkg.Registry.status)},Any} triggered MethodInstance for Pair{Symbol,typeof(Pkg.Registry.status)}(::Any, ::Any) (0 children)
                 191: signature Tuple{typeof(convert),Type{REPL.AbstractREPL},Any} triggered MethodInstance for convert(::Type{Union{Nothing, REPL.AbstractREPL}}, ::Any) (0 children)
                 192: signature Tuple{typeof(convert),Type{REPL.LineEdit.HistoryProvider},Any} triggered MethodInstance for setproperty!(::REPL.LineEdit.Prompt, ::Symbol, ::Any) (0 children)
                 193: signature Tuple{typeof(convert),Type{Pkg.BinaryPlatforms.Platform},Any} triggered MethodInstance for setindex!(::Dict{Pkg.BinaryPlatforms.Platform,Dict{String,Any}}, ::Dict{String,Any}, ::Any) (0 children)
                 194: signature Tuple{typeof(convert),Type{REPL.Terminals.AbstractTerminal},Any} triggered MethodInstance for REPL.LineEdit.PrefixSearchState(::Any, ::Any, ::Any, ::Any) (0 children)
                 195: signature Tuple{typeof(convert),Type{REPL.LineEdit.PrefixHistoryPrompt},Any} triggered MethodInstance for REPL.LineEdit.PrefixSearchState(::Any, ::Any, ::Any, ::Any) (0 children)
                 196: signature Tuple{typeof(convert),Type{IOBuffer},Any} triggered MethodInstance for REPL.LineEdit.PrefixSearchState(::Any, ::Any, ::Any, ::Any) (0 children)
                 197: signature Tuple{typeof(convert),Type{REPL.LineEdit.HistoryPrompt},Any} triggered MethodInstance for REPL.LineEdit.SearchState(::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
                 198: signature Tuple{typeof(convert),Type{IOBuffer},Any} triggered MethodInstance for REPL.LineEdit.SearchState(::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
                 199: signature Tuple{typeof(convert),Type{REPL.Terminals.TextTerminal},Any} triggered MethodInstance for REPL.LineEditREPL(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
                 200: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for setindex!(::Dict{Symbol,REPL.LineEdit.Prompt}, ::Any, ::Any) (0 children)
                 201: signature Tuple{typeof(convert),Type{Module},Any} triggered MethodInstance for setindex!(::Dict{Module,Symbol}, ::Symbol, ::Any) (0 children)
                 202: signature Tuple{typeof(convert),Type{Method},Any} triggered MethodInstance for setindex!(::Array{Method,0}, ::Any, ::Int64) (0 children)
                 203: signature Tuple{typeof(convert),Type{Method},Any} triggered MethodInstance for setindex!(::Vector{Method}, ::Any, ::Int64) (0 children)
                 204: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for push!(::Vector{Symbol}, ::Any) (0 children)
                 205: signature Tuple{typeof(convert),Type{Core.SimpleVector},Any} triggered MethodInstance for showerror(::IOContext{REPL.Terminals.TTYTerminal}, ::MethodError) (0 children)
                 206: signature Tuple{typeof(convert),Type{Union{Function, String}},Any} triggered MethodInstance for REPL.LineEdit.Prompt(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
                 207: signature Tuple{typeof(convert),Type{Dict{Char,V} where V},Any} triggered MethodInstance for REPL.LineEdit.Prompt(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
                 208: signature Tuple{typeof(convert),Type{REPL.LineEdit.CompletionProvider},Any} triggered MethodInstance for REPL.LineEdit.Prompt(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
                 209: signature Tuple{typeof(convert),Type{Function},Any} triggered MethodInstance for REPL.LineEdit.Prompt(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
                 210: signature Tuple{typeof(convert),Type{REPL.LineEdit.HistoryProvider},Any} triggered MethodInstance for REPL.LineEdit.Prompt(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
                 211: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Base.StackTraces.StackFrame(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::UInt64) (0 children)
                 212: signature Tuple{typeof(convert),Type{Distributed.WorkerPool},Any} triggered MethodInstance for convert(::Type{Union{Nothing, Distributed.WorkerPool}}, ::Any) (0 children)
                 213: signature Tuple{typeof(convert),Type{Task},Any} triggered MethodInstance for setindex!(::Vector{Task}, ::Any, ::Int64) (0 children)
                 214: signature Tuple{typeof(convert),Type{Tuple},Any} triggered MethodInstance for Distributed.CallWaitMsg(::Any, ::Any, ::Any) (0 children)
                 215: signature Tuple{typeof(convert),Type{Tuple},Any} triggered MethodInstance for Distributed.RemoteDoMsg(::Any, ::Any, ::Any) (0 children)
                 216: signature Tuple{typeof(convert),Type{Tuple},Any} triggered MethodInstance for Distributed.CallMsg{:call}(::Any, ::Any, ::Any) (0 children)
                 217: signature Tuple{typeof(convert),Type{Tuple},Any} triggered MethodInstance for Distributed.CallMsg{:call_fetch}(::Any, ::Any, ::Any) (0 children)
                 218: signature Tuple{typeof(convert),Type{Cmd},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Cmd,Function},_A} where _A)(::Int64) (0 children)
                 219: signature Tuple{typeof(convert),Type{Function},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Cmd,Function},_A} where _A)(::Int64) (0 children)
                 220: signature Tuple{typeof(convert),Type{Cmd},Any} triggered MethodInstance for #probe_platform_engines!#14(::Bool, ::typeof(Pkg.PlatformEngines.probe_platform_engines!)) (0 children)
                 221: signature Tuple{typeof(convert),Type{Pkg.Types.VersionRange},Any} triggered MethodInstance for push!(::Vector{Pkg.Types.VersionRange}, ::Any) (0 children)
                 222: signature Tuple{typeof(convert),Type{Dict},Any} triggered MethodInstance for convert(::Type{Union{Nothing, Dict}}, ::Any) (0 children)
                 223: signature Tuple{typeof(convert),Type{Pkg.Types.PackageEntry},Any} triggered MethodInstance for setindex!(::Dict{Base.UUID,Pkg.Types.PackageEntry}, ::Any, ::Base.UUID) (0 children)
                 224: signature Tuple{typeof(convert),Type{Dict{String,Any}},Any} triggered MethodInstance for find_registered!(::Pkg.Types.Context, ::Vector{String}, ::Vector{Base.UUID}) (0 children)
                 225: signature Tuple{typeof(convert),Type{Tuple{Base.UUID,String}},Any} triggered MethodInstance for setindex!(::Vector{Tuple{Base.UUID,String}}, ::Any, ::Int64) (0 children)
                 226: signature Tuple{typeof(convert),Type{Base.UUID},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Base.UUID,String},_A} where _A)(::Int64) (0 children)
                 227: signature Tuple{typeof(convert),Type{Base.UUID},Any} triggered MethodInstance for push!(::Vector{Base.UUID}, ::Any) (0 children)
                 228: signature Tuple{typeof(convert),Type{Base.UUID},Any} triggered MethodInstance for setindex!(::Dict{Base.UUID,String}, ::String, ::Any) (0 children)
                 229: signature Tuple{typeof(convert),Type{Base.UUID},Any} triggered MethodInstance for convert(::Type{Union{Nothing, Base.UUID}}, ::Any) (0 children)
                 230: signature Tuple{typeof(convert),Type{Pkg.BinaryPlatforms.Platform},Any} triggered MethodInstance for setindex!(::Dict{Pkg.BinaryPlatforms.Platform,Dict{String,Any}}, ::Any, ::Any) (0 children)
                 231: signature Tuple{typeof(convert),Type{VersionNumber},Any} triggered MethodInstance for setindex!(::Dict{VersionNumber,Nothing}, ::Nothing, ::Any) (0 children)
                 232: signature Tuple{typeof(convert),Type{Tuple{Any,String}},Any} triggered MethodInstance for setindex!(::Vector{Tuple{Any,String}}, ::Any, ::Int64) (0 children)
                 233: signature Tuple{typeof(convert),Type{Base.UUID},Any} triggered MethodInstance for setindex!(::Dict{Base.UUID,Pkg.Resolve.ResolveLogEntry}, ::Any, ::Any) (0 children)
                 234: signature Tuple{typeof(convert),Type{VersionNumber},Any} triggered MethodInstance for convert(::Type{Union{Nothing, VersionNumber}}, ::Any) (0 children)
                 235: signature Tuple{typeof(convert),Type{Pkg.Types.PackageSpec},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Pkg.Types.PackageSpec,String},_A} where _A)(::Int64) (0 children)
                 236: signature Tuple{typeof(convert),Type{Pkg.Types.PackageSpec},Any} triggered MethodInstance for #download_source#53(::Bool, ::typeof(Pkg.Operations.download_source), ::Pkg.Types.Context, ::Vector{Pkg.Types.PackageSpec}, ::Dict{Base.UUID,Vector{String}}) (0 children)
                 237: signature Tuple{typeof(convert),Type{Pkg.GitTools.GitMode},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{String,Vector{UInt8},Pkg.GitTools.GitMode},_A} where _A)(::Int64) (0 children)
                 238: signature Tuple{typeof(convert),Type{Base.UUID},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Base.UUID,String,String,VersionNumber},_A} where _A)(::Int64) (0 children)
                 239: signature Tuple{typeof(convert),Type{VersionNumber},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Base.UUID,String,String,VersionNumber},_A} where _A)(::Int64) (0 children)
                 240: signature Tuple{typeof(convert),Type{Pkg.REPLMode.Option},Any} triggered MethodInstance for push!(::Vector{Pkg.REPLMode.Option}, ::Any) (0 children)
                 241: signature Tuple{typeof(convert),Type{Pkg.REPLMode.QString},Any} triggered MethodInstance for pushfirst!(::Vector{Pkg.REPLMode.QString}, ::Any) (0 children)
                 242: signature Tuple{typeof(convert),Type{Base.StackTraces.StackFrame},Any} triggered MethodInstance for push!(::Vector{Base.StackTraces.StackFrame}, ::Any) (0 children)
                 243: signature Tuple{typeof(convert),Type{AbstractDisplay},Any} triggered MethodInstance for setindex!(::Vector{AbstractDisplay}, ::Any, ::Int64) (0 children)
                 244: signature Tuple{typeof(convert),Type{Union{Function, String}},Any} triggered MethodInstance for setproperty!(::REPL.LineEdit.Prompt, ::Symbol, ::Any) (0 children)
                 245: signature Tuple{typeof(convert),Type{Base.StackTraces.StackFrame},Any} triggered MethodInstance for setindex!(::Vector{Base.StackTraces.StackFrame}, ::Any, ::Int64) (0 children)
                 246: signature Tuple{typeof(convert),Type{Base.Docs.MultiDoc},Any} triggered MethodInstance for push!(::Vector{Base.Docs.MultiDoc}, ::Any) (0 children)
                 247: signature Tuple{typeof(convert),Type{Base.Docs.DocStr},Any} triggered MethodInstance for push!(::Vector{Base.Docs.DocStr}, ::Any) (0 children)
                 248: signature Tuple{typeof(convert),Type{Union{Vector{String}, String}},Any} triggered MethodInstance for setindex!(::Dict{String,Union{Vector{String}, String}}, ::Any, ::String) (0 children)
                 249: signature Tuple{typeof(convert),Type{Base.UUID},Any} triggered MethodInstance for setindex!(::Dict{Base.UUID,Nothing}, ::Nothing, ::Any) (0 children)
                 250: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for setindex!(::Vector{Symbol}, ::Any, ::Int64) (0 children)
                 251: signature Tuple{typeof(convert),Type{IO},Any} triggered MethodInstance for convert(::Type{Union{Nothing, IO, IOBuffer}}, ::Any) (0 children)
                 252: signature Tuple{typeof(convert),Type{REPL.LineEdit.Prompt},Any} triggered MethodInstance for convert(::Type{Union{Nothing, REPL.LineEdit.Prompt}}, ::Any) (0 children)
                 253: signature Tuple{typeof(convert),Type{IOBuffer},Any} triggered MethodInstance for REPL.REPLHistoryProvider(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
                 254: signature Tuple{typeof(convert),Type{Dict{Symbol,REPL.LineEdit.Prompt}},Any} triggered MethodInstance for REPL.REPLHistoryProvider(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
                 255: signature Tuple{typeof(convert),Type{Function},Any} triggered MethodInstance for setindex!(::Dict{Symbol,Function}, ::Any, ::Symbol) (1 children)
                 256: signature Tuple{typeof(convert),Type{Dict{Symbol,Any}},Any} triggered MethodInstance for Base.Docs.DocStr(::Core.SimpleVector, ::Nothing, ::Any) (1 children)
                 257: signature Tuple{typeof(convert),Type{Dict{Symbol,Any}},Any} triggered MethodInstance for setproperty!(::Base.Docs.DocStr, ::Symbol, ::Any) (1 children)
                 258: signature Tuple{typeof(convert),Type{Method},Any} triggered MethodInstance for push!(::Vector{Method}, ::Any) (1 children)
                 259: signature Tuple{typeof(convert),Type{Function},Any} triggered MethodInstance for convert(::Type{Pair{Regex,Function}}, ::Pair{Regex,B} where B) (1 children)
                 260: signature Tuple{typeof(convert),Type{Pkg.REPLMode.OptionSpec},Any} triggered MethodInstance for setindex!(::Dict{String,Pkg.REPLMode.OptionSpec}, ::Any, ::String) (1 children)
                 261: signature Tuple{typeof(convert),Type{Pkg.REPLMode.CommandSpec},Any} triggered MethodInstance for setindex!(::Dict{String,Pkg.REPLMode.CommandSpec}, ::Any, ::String) (1 children)
                 262: signature Tuple{typeof(convert),Type{REPL.LineEdit.HistoryProvider},Any} triggered MethodInstance for REPL.LineEdit.HistoryPrompt(::Any) (1 children)
                 263: signature Tuple{typeof(convert),Type{REPL.LineEdit.HistoryProvider},Any} triggered MethodInstance for REPL.LineEdit.PrefixHistoryPrompt(::Any, ::REPL.LineEdit.Prompt) (1 children)
                 264: signature Tuple{typeof(convert),Type{REPL.Terminals.AbstractTerminal},Any} triggered MethodInstance for REPL.LineEdit.SearchState(::Any, ::Any, ::Any, ::Any, ::Any) (1 children)
                 265: signature Tuple{typeof(convert),Type{REPL.LineEdit.Prompt},Any} triggered MethodInstance for setindex!(::Dict{Symbol,REPL.LineEdit.Prompt}, ::Any, ::Symbol) (1 children)
                 266: signature Tuple{typeof(convert),Type{Dict{Symbol,REPL.LineEdit.Prompt}},Any} triggered MethodInstance for REPL.REPLHistoryProvider(::Vector{String}, ::Nothing, ::Int64, ::Int64, ::Int64, ::IOBuffer, ::Nothing, ::Any, ::Vector{UInt8}) (1 children)
                 267: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Distributed.JoinPGRPMsg(::Any, ::Any, ::Any, ::Any, ::Any) (1 children)
                 268: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for merge(::NamedTuple{(:version, :payload),Tuple{UInt32,Ptr{Nothing}}}, ::Base.Iterators.Pairs{_A,_B,_C,_D} where _D where _C where _B where _A) (1 children)
                 269: signature Tuple{typeof(convert),Type{Base.UUID},Any} triggered MethodInstance for setindex!(::Dict{String,Base.UUID}, ::Any, ::String) (1 children)
                 270: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for setproperty!(::Base.RefValue{Symbol}, ::Symbol, ::Any) (1 children)
                 271: signature Tuple{typeof(convert),Type{Union{Pkg.Types.UpgradeLevel, VersionNumber, Pkg.Types.VersionSpec}},Any} triggered MethodInstance for setproperty!(::Pkg.Types.PackageSpec, ::Symbol, ::Any) (1 children)
                 272: signature Tuple{typeof(convert),Type{Dict{String,Any}},Any} triggered MethodInstance for setindex!(::Dict{Pkg.BinaryPlatforms.Platform,Dict{String,Any}}, ::Any, ::Pkg.BinaryPlatforms.Platform) (1 children)
                 273: signature Tuple{typeof(convert),Type{Pkg.Types.VersionSpec},Any} triggered MethodInstance for setindex!(::Dict{String,Pkg.Types.VersionSpec}, ::Any, ::String) (1 children)
                 274: signature Tuple{typeof(convert),Type{Pkg.Resolve.ResolveLogEntry},Any} triggered MethodInstance for setindex!(::Dict{Base.UUID,Pkg.Resolve.ResolveLogEntry}, ::Any, ::Base.UUID) (1 children)
                 275: signature Tuple{typeof(convert),Type{REPL.Terminals.AbstractTerminal},Any} triggered MethodInstance for REPL.LineEdit.PrefixSearchState(::Any, ::REPL.LineEdit.PrefixHistoryPrompt, ::String, ::IOBuffer) (1 children)
                 276: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Base.StackTraces.StackFrame(::Any, ::Any, ::Any, ::Core.CodeInfo, ::Bool, ::Bool, ::Int64) (1 children)
                 277: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Base.StackTraces.StackFrame(::Any, ::Any, ::Any, ::Core.MethodInstance, ::Bool, ::Bool, ::Int64) (1 children)
                 278: signature Tuple{typeof(convert),Type{REPL.Terminals.AbstractTerminal},Any} triggered MethodInstance for REPL.LineEdit.SearchState(::Any, ::REPL.LineEdit.HistoryPrompt, ::Bool, ::IOBuffer, ::IOBuffer) (1 children)
                 279: signature Tuple{typeof(convert),Type{IO},Any} triggered MethodInstance for REPL.Terminals.TTYTerminal(::String, ::Any, ::Any, ::Any) (2 children)
                 280: signature Tuple{typeof(convert),Type{Union{Pkg.Types.UpgradeLevel, VersionNumber, Pkg.Types.VersionSpec}},Any} triggered MethodInstance for Pkg.Types.PackageSpec(::String, ::Nothing, ::Any, ::Nothing, ::Pkg.Types.GitRepo, ::Nothing, ::Bool, ::Pkg.Types.PackageMode) (2 children)
                 281: signature Tuple{typeof(convert),Type{Union{Pkg.Types.UpgradeLevel, VersionNumber, Pkg.Types.VersionSpec}},Any} triggered MethodInstance for Pkg.Types.PackageSpec(::Nothing, ::Base.UUID, ::Any, ::Nothing, ::Pkg.Types.GitRepo, ::Nothing, ::Bool, ::Pkg.Types.PackageMode) (2 children)
                 282: signature Tuple{typeof(convert),Type{Union{Pkg.Types.UpgradeLevel, VersionNumber, Pkg.Types.VersionSpec}},Any} triggered MethodInstance for Pkg.Types.PackageSpec(::String, ::Base.UUID, ::Any, ::Nothing, ::Pkg.Types.GitRepo, ::Nothing, ::Bool, ::Pkg.Types.PackageMode) (2 children)
                 283: signature Tuple{typeof(convert),Type{Union{Dict{String,Base.UUID}, AbstractVector{var"#s844"} where var"#s844"<:AbstractString, StridedVector{var"#s844"} where var"#s844"<:AbstractString}},Any} triggered MethodInstance for Pkg.Types.Stage1(::Base.UUID, ::Pkg.Types.PackageEntry, ::Any) (2 children)
                 284: signature Tuple{typeof(convert),Type{REPL.LineEdit.Prompt},Any} triggered MethodInstance for setproperty!(::REPL.LineEdit.PrefixSearchState, ::Symbol, ::Any) (2 children)
                 285: signature Tuple{typeof(convert),Type{REPL.LineEdit.Prompt},Any} triggered MethodInstance for setproperty!(::REPL.LineEdit.PrefixHistoryPrompt, ::Symbol, ::Any) (2 children)
                 286: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for setproperty!(::Distributed.ProcessGroup, ::Symbol, ::Any) (2 children)
                 287: signature Tuple{typeof(convert),Type{Type},Any} triggered MethodInstance for REPL.REPLCompletions.MethodCompletion(::Any, ::Any, ::Method) (2 children)
                 288: signature Tuple{typeof(convert),Union{Type{Cmd}, Type{Function}},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Cmd,Function},_A} where _A)(::Int64) (3 children)
                 289: signature Tuple{typeof(convert),Type{Base.PkgId},Any} triggered MethodInstance for setindex!(::IdDict{Module,Base.PkgId}, ::Any, ::Any) (4 children)
                 290: signature Tuple{typeof(convert),Type{IO},Any} triggered MethodInstance for TextDisplay(::Any) (4 children)
                 291: signature Tuple{typeof(convert),Type{Union{Pkg.Types.UpgradeLevel, VersionNumber, Pkg.Types.VersionSpec}},Any} triggered MethodInstance for Pkg.Types.PackageSpec(::Nothing, ::Nothing, ::Any, ::Nothing, ::Pkg.Types.GitRepo, ::Nothing, ::Bool, ::Pkg.Types.PackageMode) (4 children)
                 292: signature Tuple{typeof(convert),Type{REPL.LineEdit.TextInterface},Any} triggered MethodInstance for setproperty!(::REPL.LineEdit.MIState, ::Symbol, ::Any) (4 children)
                 293: signature Tuple{typeof(convert),Type{Tuple{Vector{REPL.REPLCompletions.Completion},UnitRange{Int64},Bool}},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Bool,Tuple{Vector{REPL.REPLCompletions.Completion},UnitRange{Int64},Bool}},_A} where _A)(::Int64) (4 children)
                 294: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for Base.StackTraces.StackFrame(::Any, ::Any, ::Any, ::Nothing, ::Bool, ::Bool, ::Int64) (5 children)
                 295: signature Tuple{typeof(convert),Type{Base.StackTraces.StackFrame},Any} triggered MethodInstance for _simplify_include_frames(::Vector{Any}) (6 children)
                 296: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for REPL.REPLCompletions.PropertyCompletion(::Any, ::Any) (6 children)
                 297: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for REPL.REPLCompletions.FieldCompletion(::DataType, ::Any) (6 children)
                 298: signature Tuple{typeof(convert),Type{IO},Any} triggered MethodInstance for Pkg.Types.Context(::Pkg.Types.EnvCache, ::Any, ::Bool, ::Bool, ::Int64, ::Bool, ::Bool, ::Nothing) (7 children)
                 299: signature Tuple{typeof(convert),Type{Dict{Symbol,Any}},Any} triggered MethodInstance for setindex!(::IdDict{Function,Dict{Symbol,Any}}, ::Any, ::Any) (8 children)
                 300: signature Tuple{typeof(convert),Type{UnitRange{Int64}},Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Vector{REPL.REPLCompletions.Completion},UnitRange{Int64},Bool},_A} where _A)(::Int64) (10 children)
                 301: signature Tuple{typeof(convert),Type{REPL.Terminals.AbstractTerminal},Any} triggered MethodInstance for REPL.LineEdit.PromptState(::Any, ::REPL.LineEdit.Prompt, ::IOBuffer, ::Symbol, ::Vector{IOBuffer}, ::Int64, ::REPL.LineEdit.InputAreaState, ::Int64, ::Base.Threads.SpinLock, ::Float64, ::Float64) (11 children)
                 302: signature Tuple{typeof(convert),Type{Core.MethodTable},Any} triggered MethodInstance for Base.MethodList(::Vector{Method}, ::Any) (23 children)
                 303: signature Tuple{typeof(convert),Type{AbstractChannel},Any} triggered MethodInstance for Distributed.RemoteValue(::Any) (30 children)
                 304: signature Tuple{typeof(convert),Type{Symbol},Any} triggered MethodInstance for merge(::NamedTuple{(),Tuple{}}, ::Base.Iterators.Pairs) (252 children)

 inserting similar(::Type{T}, dims::Tuple{Vararg{Int64,N}} where N) where {U, T<:(Array{Union{Missing, CategoricalValue{U,R} where R<:Integer},N} where N)} in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/array.jl:611 invalidated:
   backedges: 1: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64,N}} where N) where T<:AbstractArray in Base at abstractarray.jl:734 with MethodInstance for similar(::Type{Array{_A,_B}}, ::Tuple{Int64}) where {_A, _B} (4 children)
              2: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64,N}} where N) where T<:AbstractArray in Base at abstractarray.jl:734 with MethodInstance for similar(::Type{Array{_A,N} where N} where _A, ::Tuple{Int64}) (355 children)
              3: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64,N}} where N) where T<:AbstractArray in Base at abstractarray.jl:734 with MethodInstance for similar(::Type{Vector{_A}} where _A, ::Tuple{Int64}) (463 children)

 inserting convert(::Type{Union{Nothing, S}}, x::T) where {S, T<:CategoricalValue} in CategoricalArrays at /home/tim/.julia/dev/CategoricalArrays/src/value.jl:72 invalidated:
   backedges: 1: superseding convert(::Type{T}, x) where T>:Nothing in Base at some.jl:36 with MethodInstance for convert(::Type{Union{Nothing, IO, IOBuffer}}, ::Any) (1 children)
              2: superseding convert(::Type{T}, x) where T>:Nothing in Base at some.jl:36 with MethodInstance for convert(::Type{Union{Nothing, Distributed.WorkerPool}}, ::Any) (2 children)
              3: superseding convert(::Type{T}, x) where T>:Nothing in Base at some.jl:36 with MethodInstance for convert(::Type{Union{Nothing, REPL.LineEdit.Prompt}}, ::Any) (3 children)
              4: superseding convert(::Type{T}, x) where T>:Nothing in Base at some.jl:36 with MethodInstance for convert(::Type{Union{Nothing, Base.UUID}}, ::Any) (4 children)
              5: superseding convert(::Type{T}, x) where T>:Nothing in Base at some.jl:36 with MethodInstance for convert(::Type{Union{Nothing, VersionNumber}}, ::Any) (9 children)
              6: superseding convert(::Type{T}, x) where T>:Nothing in Base at some.jl:36 with MethodInstance for convert(::Type{Union{Nothing, REPL.AbstractREPL}}, ::Any) (17 children)
              7: superseding convert(::Type{T}, x) where T>:Nothing in Base at some.jl:36 with MethodInstance for convert(::Type{Union{Nothing, Core.CodeInfo, Core.MethodInstance}}, ::Any) (36 children)
              8: superseding convert(::Type{T}, x) where T>:Nothing in Base at some.jl:36 with MethodInstance for convert(::Type{Union{Nothing, Module}}, ::Any) (228 children)
              9: superseding convert(::Type{Any}, x) in Base at essentials.jl:204 with MethodInstance for convert(::Type{Any}, ::Any) (1336 children)

which has lots of convert and == MethodInstances.

julia> versioninfo()
Julia Version 1.6.0-DEV.627
Commit b9e1fa78af* (2020-08-12 16:12 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
  JULIA_CPU_THREADS = 4

(@v1.6) pkg> st SnoopCompile
Status `~/.julia/environments/v1.6/Project.toml`
  [aa65fe97] SnoopCompile v2.0.0 `~/.julia/dev/SnoopCompile`

(The distinction between my dev branch and the released 2.0.0 is just doc improvements, timholy/SnoopCompile.jl#128.)

@timholy
Copy link
Contributor

timholy commented Aug 12, 2020

That's not to say that similar doesn't need attention, I think it does.

@nalimilan
Copy link
Member

Woops, my bad. I was on a branch were I had precisely removed ==, < and convert to check whether it makes DataFrames faster. So yes they are bad, though similar is as bad as them. One issue with these is that they are usually inlined so IIUC their invalidation also invalidates most functions that use them.

@bkamins
Copy link
Member

bkamins commented Aug 13, 2020

I am not sure who is the best person to ask what I want to ask now 😄, but let me voice the concerns from the "receiving end" (i.e. DataFrames.jl).

  1. We want to go for 1.0 release in DataFrames.jl. There is no rush of course if things have to take time.
  2. It is possible to remove from DataFrames.jl dependency on CategoricalArrays.jl but it is not a free lunch (i.e. there are functionalities that require CategoricalArrays.jl; removing them will break them and slightly reduce the functionality - if you would like to know the details in which area - please comment and I can list them, but the short message is: "we can live without it but I would prefer to keep it").
  3. Other pivotal packages in the data ecosystem like MLJ.jl rely on CategoricalArrays.jl heavily (actually I see that @nalimilan gets requests to add functionality to them).

Given these three considerations, and seeing that this issue is already very long standing (it is open for almost 2 years + probably it is known much longer), my questions would be:

  1. are we sure what is the problem exactly (I understand that invalidations, but is there someone who knows exactly the root cause of the problem)
  2. is the analysis provided by @nalimilan sufficient to diagnose things, or some more information is needed
  3. when 1 and 2 are done (maybe all that is required to be known is already known), is it possible to improve things on the "compiler side".
    • if "yes" then can we expect it to happen in the realistic future
    • if "not" then are there some recommendations that @nalimilan could implement in CategoricalArrays.jl to significantly improve things (I am not asking here for total change of how CategoricalArrays.jl works, but for suggestions assuming that the API it provides stays roughly as it is - if we wanted to fundamentally change how things work probably we should create another package that works differently - tons of code currently uses the API CategoricalArrays.jl now provides so I do not think it is a reasonable option to assume it will fundamentally change)

I am asking these questions because I feel that I (and probably at least some of other non-core contributors to Julia Base) am not qualified enough to judge what is possible on the compiler side and what is not; while at the same time we all would love to see the things getting improved and would like to help, but - at least I - do not know what help would be best here.

@nalimilan
Copy link
Member

Something I wonder in particular is whether convert(::Type{Any}, ::Any) could be special-cased by the compiler to always be a no-op. It doesn't seem like it would be legitimate to redefine this to do something different. At least that could help a bit.

@timholy
Copy link
Contributor

timholy commented Aug 23, 2020

So yes they are bad, though similar is as bad as them

Unlikely to be true in the near future: see JuliaLang/julia#37163. Locally for me the invalidations are almost entirely due to convert, isequal, and ==.

@quinnj
Copy link
Member

quinnj commented Aug 23, 2020

I can't seem to find where it was suggested to limit the types allowed in CategoricalArrays.jl, but that seems to me the best compromise to move forward. It seems with sufficiently general abstract types, we could include basically everything without having to sacrifice much for users. Do we know of any cases that would break with that change?

@nalimilan
Copy link
Member

Yes, I've tried that (with Union{AbstractString, Symbol, Char, Real}) and it seems to improve the situation significantly. One small issue is that e.g. convert(Union{String, T}, CategoricalValue{String}) wouldn't work anymore for any T, even though convert(String, CategoricalValue{String}) would. It's not very satisfactory, though in practice it's probably not a big deal. Maybe we could also work around that by defining a convert(::Union, ::CategoricalValue) method.

@nalimilan
Copy link
Member

#310 restricts supported types to AbstractString, AbstractChar and Number.

Now main offender is similar (on julia master), but there are also lots of invalidations with Tuple{typeof(convert), Type{String}, Any}. These seem to be mostly in REPL.LineEdit, but I couldn't really find out what's the problem. @timholy Any pointers would be appreciated.

julia> using SnoopCompileCore

julia> invalidations = @snoopr using CategoricalArrays;
[ Info: Precompiling CategoricalArrays [324d7699-5711-5eae-9e2f-1d82baa6b597]

julia> using SnoopCompile

julia> trees = invalidation_trees(invalidations)
10-element Vector{SnoopCompile.MethodInvalidations}:
 inserting convert(::Type{Union{Nothing, S}}, x::CategoricalValue) where S<:Union{AbstractChar, AbstractString, Number} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/value.jl:77 invalidated:
   backedges: 1: superseding convert(::Type{T}, x) where T>:Nothing in Base at some.jl:36 with MethodInstance for convert(::Type{Union{Nothing, String}}, ::Any) (2 children)

 inserting Base.IteratorSize(::Type{var"#s2"} where var"#s2"<:(Missings.EachReplaceMissing{T, U} where U)) where T in Missings at /home/milan/.julia/packages/Missings/notdc/src/Missings.jl:83 invalidated:
   backedges: 1: superseding Base.IteratorSize(::Type) in Base at generator.jl:91 with MethodInstance for Base.IteratorSize(::Type{var"#s433"} where var"#s433"<:LinearAlgebra.Factorization{T} where T) (3 children)
   94 mt_cache

 inserting similar(A::AbstractRange, ::Type{Union{Missing, CategoricalValue{T, R} where R<:Integer}}, dims::Tuple{Vararg{Int64, N}}) where {T, N} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:649 invalidated:
   backedges: 1: superseding similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64, N}}) where {T, N} in Base at abstractarray.jl:730 with MethodInstance for similar(::UnitRange{Int64}, ::Type, ::Tuple{Int64}) (3 children)

 inserting similar(A::AbstractRange, ::Type{CategoricalValue{T, R}}, dims::Tuple{Vararg{Int64, N}}) where {T, R, N} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:640 invalidated:
   backedges: 1: superseding similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64, N}}) where {T, N} in Base at abstractarray.jl:730 with MethodInstance for similar(::UnitRange{Int64}, ::DataType, ::Tuple{Int64}) (3 children)

 inserting promote_rule(::Type{C}, ::Type{T}) where {C<:CategoricalValue, T} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/value.jl:54 invalidated:
   backedges: 1: superseding promote_rule(::Type{var"#s73"} where var"#s73", ::Type{var"#s72"} where var"#s72") in Base at promotion.jl:245 with MethodInstance for promote_rule(::Type{T} where T<:Unsigned, ::Type{UInt64}) (1 children)
              2: superseding promote_rule(::Type{var"#s820"} where var"#s820"<:AbstractIrrational, ::Type{T}) where T<:Real in Base at irrationals.jl:42 with MethodInstance for promote_rule(::Type{Union{}}, ::Type{UInt64}) (5 children)
   38 mt_cache

 inserting similar(A::Vector{T} where T, ::Type{CategoricalValue{T, R}}, dims::Tuple{Vararg{Int64, N}}) where {T, R, N} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:640 invalidated:
   backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:358 with MethodInstance for similar(::Vector{Pair{DataType, Function}}, ::DataType, ::Tuple{Int64}) (1 children)
              2: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:358 with MethodInstance for similar(::Vector{Any}, ::DataType, ::Tuple{Int64}) (1 children)
              3: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:358 with MethodInstance for similar(::Vector{T} where T, ::DataType, ::Tuple{Int64}) (6 children)

 inserting similar(A::Vector{T} where T, ::Type{CategoricalValue{T, R} where R<:Integer}) where T in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:643 invalidated:
   backedges: 1: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:355 with MethodInstance for similar(::Vector{_A} where _A, ::Type) (26 children)
   1 mt_cache

 inserting convert(::Type{S}, x::CategoricalValue) where S<:Union{AbstractChar, AbstractString, Number} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/value.jl:73 invalidated:
   mt_backedges:  1: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{DataType, String}(::Any, ::Any) (0 children)
                  2: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#112#165"}(::Any, ::Any) (0 children)
                  3: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#113#166"}(::Any, ::Any) (0 children)
                  4: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#114#167"}(::Any, ::Any) (0 children)
                  5: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#115#168"}(::Any, ::Any) (0 children)
                  6: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#116#169"}(::Any, ::Any) (0 children)
                  7: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#117#170"}(::Any, ::Any) (0 children)
                  8: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#118#171"}(::Any, ::Any) (0 children)
                  9: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#119#172"}(::Any, ::Any) (0 children)
                 10: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#120#173"}(::Any, ::Any) (0 children)
                 11: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#121#174"}(::Any, ::Any) (0 children)
                 12: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#122#175"}(::Any, ::Any) (0 children)
                 13: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#123#176"}(::Any, ::Any) (0 children)
                 14: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#124#177"}(::Any, ::Any) (0 children)
                 15: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#125#178"}(::Any, ::Any) (0 children)
                 16: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#126#179"}(::Any, ::Any) (0 children)
                 17: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#127#180"}(::Any, ::Any) (0 children)
                 18: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#128#181"}(::Any, ::Any) (0 children)
                 19: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#129#182"}(::Any, ::Any) (0 children)
                 20: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#130#183"}(::Any, ::Any) (0 children)
                 21: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#131#184"}(::Any, ::Any) (0 children)
                 22: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#132#185"}(::Any, ::Any) (0 children)
                 23: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#133#186"}(::Any, ::Any) (0 children)
                 24: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#134#187"}(::Any, ::Any) (0 children)
                 25: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#135#188"}(::Any, ::Any) (0 children)
                 26: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#136#189"}(::Any, ::Any) (0 children)
                 27: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#137#190"}(::Any, ::Any) (0 children)
                 28: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#138#191"}(::Any, ::Any) (0 children)
                 29: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#139#192"}(::Any, ::Any) (0 children)
                 30: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#140#193"}(::Any, ::Any) (0 children)
                 31: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#141#194"}(::Any, ::Any) (0 children)
                 32: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#142#195"}(::Any, ::Any) (0 children)
                 33: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#143#196"}(::Any, ::Any) (0 children)
                 34: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#144#197"}(::Any, ::Any) (0 children)
                 35: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#145#198"}(::Any, ::Any) (0 children)
                 36: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#146#199"}(::Any, ::Any) (0 children)
                 37: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#147#200"}(::Any, ::Any) (0 children)
                 38: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#148#201"}(::Any, ::Any) (0 children)
                 39: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#149#202"}(::Any, ::Any) (0 children)
                 40: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#150#203"}(::Any, ::Any) (0 children)
                 41: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#151#204"}(::Any, ::Any) (0 children)
                 42: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#152#205"}(::Any, ::Any) (0 children)
                 43: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#153#206"}(::Any, ::Any) (0 children)
                 44: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#154#207"}(::Any, ::Any) (0 children)
                 45: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#155#208"}(::Any, ::Any) (0 children)
                 46: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#156#209"}(::Any, ::Any) (0 children)
                 47: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#157#210"}(::Any, ::Any) (0 children)
                 48: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#158#211"}(::Any, ::Any) (0 children)
                 49: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#159#212"}(::Any, ::Any) (0 children)
                 50: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#160#213"}(::Any, ::Any) (0 children)
                 51: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#161#214"}(::Any, ::Any) (0 children)
                 52: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#215#225"}(::Any, ::Any) (0 children)
                 53: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#216#226"}(::Any, ::Any) (0 children)
                 54: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#217#227"}(::Any, ::Any) (0 children)
                 55: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#218#228"}(::Any, ::Any) (0 children)
                 56: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#219#229"}(::Any, ::Any) (0 children)
                 57: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#220#230"}(::Any, ::Any) (0 children)
                 58: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#221#231"}(::Any, ::Any) (0 children)
                 59: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#222#232"}(::Any, ::Any) (0 children)
                 60: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#223#233"}(::Any, ::Any) (0 children)
                 61: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#224#234"}(::Any, ::Any) (0 children)
                 62: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#235#243"}(::Any, ::Any) (0 children)
                 63: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#236#244"}(::Any, ::Any) (0 children)
                 64: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#237#245"}(::Any, ::Any) (0 children)
                 65: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#238#246"}(::Any, ::Any) (0 children)
                 66: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Pair{String, REPL.LineEdit.var"#239#247"}(::Any, ::Any) (0 children)
                 67: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for setindex!(::Vector{String}, ::Any, ::Int64) (0 children)
                 68: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for convert(::Type{Union{Nothing, String}}, ::Any) (0 children)
                 69: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Test.Fail(::Symbol, ::Any, ::Any, ::Bool, ::LineNumberNode) (0 children)
                 70: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for setindex!(::Dict{String, Any}, ::Any, ::Any) (0 children)
                 71: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for push!(::Vector{String}, ::Any) (0 children)
                 72: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for setindex!(::Dict{String, Union{Base.SHA1, String}}, ::Any, ::Any) (0 children)
                 73: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for setindex!(::Dict{String, Vector{String}}, ::Any, ::Any) (0 children)
                 74: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for setindex!(::Dict{String, Base.UUID}, ::Base.UUID, ::Any) (0 children)
                 75: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for setindex!(::Dict{String, String}, ::Any, ::Any) (0 children)
                 76: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Pkg.Types.PackageSpec, String}, _A} where _A)(::Int64) (0 children)
                 77: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for setindex!(::IdDict{Any, String}, ::Any, ::Any) (1 children)
                 78: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Test.Error(::Symbol, ::Any, ::Any, ::Nothing, ::LineNumberNode) (1 children)
                 79: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Test.Error(::Symbol, ::Any, ::Any, ::Any, ::LineNumberNode) (1 children)
                 80: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for REPL.LineEdit.PrefixSearchState(::Any, ::Any, ::Any, ::Any) (1 children)
                 81: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for REPL.LineEditREPL(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (1 children)
                 82: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for setindex!(::Dict{String, String}, ::Any, ::String) (1 children)
                 83: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{String, String}, _A} where _A)(::Int64) (3 children)
                 84: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Base.UUID, String, String, VersionNumber}, _A} where _A)(::Int64) (3 children)
                 85: signature Tuple{typeof(convert), Union{Type{String}, Type{Pkg.Types.PackageSpec}}, Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{Pkg.Types.PackageSpec, String}, _A} where _A)(::Int64) (5 children)
                 86: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{String, Int32}, _A} where _A)(::Int64) (24 children)

 inserting similar(A::Vector{T} where T, ::Type{CategoricalValue{T, R} where R<:Integer}, dims::Tuple{Vararg{Int64, N}}) where {T, N} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:643 invalidated:
   backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:358 with MethodInstance for similar(::Vector{Union{Int64, Symbol}}, ::Type, ::Tuple{Int64}) (1 children)
              2: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:358 with MethodInstance for similar(::Vector{Any}, ::Type, ::Tuple{Int64}) (3 children)
              3: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:358 with MethodInstance for similar(::Vector{Pair{DataType, Function}}, ::Type, ::Tuple{Int64}) (3 children)
              4: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:358 with MethodInstance for similar(::Vector{Pair{DataType, Function}}, ::Type, ::Tuple{Int64}) (5 children)
              5: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:358 with MethodInstance for similar(::Vector{Any}, ::Type, ::Tuple{Int64}) (5 children)
              6: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:358 with MethodInstance for similar(::Vector{T} where T, ::Type, ::Tuple{Int64}) (32 children)
   19 mt_cache

 inserting similar(::Type{T}, dims::Tuple{Vararg{Int64, N}} where N) where {U, T<:(Array{Union{Missing, CategoricalValue{U, R} where R<:Integer}, N} where N)} in CategoricalArrays at /home/milan/.julia/dev/CategoricalArrays/src/array.jl:660 invalidated:
   backedges: 1: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64, N}} where N) where T<:AbstractArray in Base at abstractarray.jl:765 with MethodInstance for similar(::Type{Array{_A, _B}}, ::Tuple{Int64}) where {_A, _B} (4 children)
              2: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64, N}} where N) where T<:AbstractArray in Base at abstractarray.jl:765 with MethodInstance for similar(::Type{Array{_A, N} where N} where _A, ::Tuple{Int64}) (11 children)
              3: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64, N}} where N) where T<:AbstractArray in Base at abstractarray.jl:765 with MethodInstance for similar(::Type{Vector{_A}} where _A, ::Tuple{Int64}) (283 children)
   21 mt_cache

@timholy
Copy link
Contributor

timholy commented Nov 1, 2020

Awesome! I poked briefly at the last item on your list and there's a pretty easy fix that should be made in julia. I could tell you where or just make it but it's best if you know how to do this stuff: it isn't rocket science, but it helps to have someone hold your hand the first time. Send me an email or discourse DM and we could set up a zoom/hangout and I can demo it for you. Or, if you haven't seen https://www.youtube.com/watch?v=7VbXbI6OmYo, you could just watch that---I think it would lead you to the culprit I identified pretty quickly.

@nalimilan
Copy link
Member

Thanks! The video is very nice (I had already read the SnoopCompiler docs which are quite good too). Looks like the last similar invalidation can indeed by fixed using a simple ::Union{Expr, Symbol}. I'll make a PR.

What do you think about the series of Tuple{typeof(convert), Type{String}, Any}? They seem to be caused by this function but I don't understand why inference fails there.
https://github.com/JuliaLang/julia/blob/94e908fa8cc07e75ad6588bee4cadbd29ec323f9/stdlib/REPL/src/LineEdit.jl#L1930

@timholy
Copy link
Contributor

timholy commented Nov 2, 2020

They mostly seem to originate from tuple conversions. For example:

julia> sig, root = methinvs.mt_backedges[end-1]
Pair{Any, SnoopCompile.InstanceNode}(Tuple{typeof(convert), Type{String}, Any}, MethodInstance for (::Base.var"#cvt1#1"{Tuple{String, Int32}, _A} where _A)(::Int64) at depth 0 with 85 children)

julia> ascend(root)
Choose a call for analysis (q to quit):
 >   (::Base.var"#cvt1#1"{Tuple{String, Int32}, _A} where _A)(::Int64)
       ntuple(::Base.var"#cvt1#1"{Tuple{String, Int32}, _A} where _A, ::Val{2})
         convert(::Type{Tuple{String, Int32}}, ::Tuple{String, Union{Int32, Int64}})
           updated_methodloc(::Method)
             show(::IOBuffer, ::JuliaInterpreter.Frame)
               signature(::Function, ::JuliaInterpreter.Frame, ::Any, ::Int64)
                 #methoddef!#7(::Bool, ::typeof(LoweredCodeUtils.methoddef!), ::Function, ::Vector{Any}, ::JuliaInterpreter.Frame, ::Expr, ::Int64)
                   (::LoweredCodeUtils.var"#methoddef!##kw")(::NamedTuple{(:define,), Tuple{Bool}}, ::typeof(LoweredCodeUtils.methoddef!), ::Function, ::Vector{Any}, ::JuliaInterpreter.Frame, ::Expr, ::In
                     #methods_by_execution!#26(::Symbol, ::Bool, ::typeof(Revise.methods_by_execution!), ::Function, ::Revise.CodeTrackingMethodInfo, ::Dict{Module, Vector{Expr}}, ::JuliaInterpreter.Frame
v                      (::Revise.var"#methods_by_execution!##kw")(::NamedTuple, ::typeof(Revise.methods_by_execution!), ::Function, ::Revise.CodeTrackingMethodInfo, ::Dict{Module, Vector{Expr}}, ::JuliaIn
...

It calls this method. The current code dates to JuliaLang/julia#32427.

If we can't/shouldn't fix it generically, each can be fixed at its call site. For instance, here one could just change it to return file, Int32(line).

But from the length of the list, there are a lot of such call sites. @vtjnash, how important is it to avoid those commented-out optimizations? Or to avoid specializing on the x argument? As you can see from this, it only takes one element of non-concrete type (even if it's a small Union) to send us down a rabbit hole of ::Any-annotated convert calls.

@KristofferC
Copy link
Contributor

After that similar is fixed, I would say that CategoricalArrays are not significantly worse in terms of invalidations than many other packages. So this is a great improvement.

@timholy
Copy link
Contributor

timholy commented Nov 2, 2020

xref JuliaIO/Tar.jl#78. This didn't show up for me until I rebuilt just this morning.

@nalimilan, now I see what you mean about that LineEdit method. I'm not sure. Possibly it's JuliaLang/julia#37098. But the "0 children" might imply that it's something that happens only during building, and it won't have serious consequences.

@KristofferC
Copy link
Contributor

Bump, any plans on fixing the similar method? It shows up as the highest invalidation source in many applications I look at.

@bkamins
Copy link
Member

bkamins commented Mar 22, 2021

I thought it got changed: https://github.com/JuliaData/CategoricalArrays.jl/blob/master/src/value.jl#L78-L84

Where do you observe these invalidations?

@KristofferC
Copy link
Contributor

Note that I meant similar:

Here is one example from SnoopCompile:

 inserting similar(::Type{T}, dims::Tuple{Vararg{Int64, N}} where N) where {U, T<:(Array{Union{Missing, CategoricalArrays.CategoricalValue{U, R} where R<:Integer}, N} where N)} in CategoricalArrays at /Users/kristoffercarlsson/.julia/packages/CategoricalArrays/MYrys/src/array.jl:689 invalidated:
   backedges: 1: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64, N}} where N) where T<:AbstractArray in Base at abstractarray.jl:785 with MethodInstance for similar(::Type{Array{_A, _B}}, ::Tuple{Int64}) where {_A, _B} (2 children)
              2: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64, N}} where N) where T<:AbstractArray in Base at abstractarray.jl:785 with MethodInstance for similar(::Type{Array{_A, N} where N} where _A, ::Tuple{Int64}) (39 children)
              3: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64, N}} where N) where T<:AbstractArray in Base at abstractarray.jl:785 with MethodInstance for similar(::Type{Vector{_A}} where _A, ::Tuple{Int64}) (1006 children)
   43 mt_cache

similar(::Type{T}, dims::Dims) where {U, T<:Array{Union{CategoricalValue{U}, Missing}}} =
CategoricalArray{eltype(T)}(undef, dims)

similar(A::$A, ::Type{Union{CategoricalValue{T}, Missing}},
dims::NTuple{N, Int}=size(A)) where {T, N} =
CategoricalArray{Union{T, Missing}, N}(undef, dims)

similar(A::$A, ::Type{CategoricalValue{T}},
dims::NTuple{N, Int}=size(A)) where {T, N} =
CategoricalArray{T, N}(undef, dims)

@bkamins
Copy link
Member

bkamins commented Mar 22, 2021

Ah - sorry for mixing this. I looked at the topmost post in this issue. With similar the question for @nalimilan is if we need these methods. I guess we should not rely on these similar methods in the package codes. So the case of collect below:

julia> using CategoricalArrays

julia> x = categorical(["a"])
1-element CategoricalArray{String,1,UInt32}:
 "a"

julia> y = [x[1]]
1-element CategoricalArray{String,1,UInt32}:
 "a"

julia> collect(y)
1-element CategoricalArray{String,1,UInt32}:
 "a"

does not have to work as it does now.

@nalimilan
Copy link
Member

What's tricky is that without these similar methods we will have to define custom map and collect methods to return CategoricalArray when their input is a CategoricalArray and the output element type is CategoricalValue. As we want to avoid allocating Array{<:CategoricalValue} objects as much as possible as they are inefficient and inconvenient, we have to ensure no cases end up calling the fallback methods. In particular, [v for v in x::CategoricalArray] ends up calling collect(::Generator), but it shouldn't return a Vector{<:CategoricalValue}. Maybe we can overload collect(::Generator{<:CategoricalArray)}.

Then we have to handle broadcast too (#193).

I think this shows that we lack a generic mechanism to say "give an an AbstractArray with the most appropriate type for eltype CategoricalValue", that all Base functions would use instead of calling similar(1:1, T, axes(itr)) or the like. See JuliaLang/julia#36106.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants