timholy / SnoopCompile.jl

Provide insights about latency (TTFX) for Julia packages
https://timholy.github.io/SnoopCompile.jl/dev/
Other
309 stars 48 forks source link

unexpected item Core.TypeMapEntry during invalidation_trees() #124

Closed IanButterworth closed 4 years ago

IanButterworth commented 4 years ago

I thought I'd give the new invalidation tooling a go on Flux, but hit this error below.

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.6.0-DEV.425 (2020-07-10)
 _/ |\__'_|_|_|\__'_|  |  Commit 8320fcc7d9 (0 days old master)
|__/                   |

(@v1.6) pkg> st
Status `~/.julia/environments/v1.6/Project.toml`
  [587475ba] Flux v0.11.0
  [7869d1d1] IRTools v0.4.0 `~/.julia/dev/IRTools`
  [aa65fe97] SnoopCompile v1.7.1
  [9ea4277c] SnoopCompileAnalysis v1.7.1
  [e2b509da] SnoopCompileCore v1.7.1

julia> using SnoopCompileCore

julia> invalidations = @snoopr using Flux
6076-element Vector{Any}:
  MethodInstance for #_print#9(::Int64, ::Bool, ::Bool, ::Pkg.API.var"#4#6", ::typeof(Pkg.TOML._print), ::IOStream, ::AbstractDict, ::Vector{String})
 0
  MethodInstance for (::Pkg.TOML.var"#_print##kw")(::NamedTuple{(:indent, :first_block, :sorted, :by),Tuple{Int64,Bool,Bool,Pkg.API.var"#4#6"}}, ::typeof(Pkg.TOML._print), ::IOStream, ::AbstractDict, ::Vector{String})
 1
  MethodInstance for (::Pkg.TOML.var"#_print##kw")(::NamedTuple{(:indent, :sorted, :by),Tuple{Int64,Bool,Pkg.API.var"#4#6"}}, ::typeof(Pkg.TOML._print), ::IOStream, ::AbstractDict, ::Vector{String})
 1
  Tuple{Base.var"#sort!##kw",NamedTuple{(:by,),Tuple{Pkg.API.var"#4#6"}},typeof(sort!),Any}
  MethodInstance for #_print#9(::Int64, ::Bool, ::Bool, ::typeof(identity), ::typeof(Pkg.TOML._print), ::IOStream, ::AbstractDict, ::Vector{String})
 0
  MethodInstance for (::Pkg.TOML.var"#_print##kw")(::NamedTuple{(:indent, :first_block, :sorted, :by),Tuple{Int64,Bool,Bool,typeof(identity)}}, ::typeof(Pkg.TOML._print), ::IOStream, ::AbstractDict, ::Vector{String})
 ⋮
  "insert_backedges"
  MethodInstance for Base.IteratorEltype(::AbstractArray)
 1
  MethodInstance for unique(::AbstractArray)
 2
  MethodInstance for Base.IteratorEltype(::Type{var"#s429"} where var"#s429"<:AbstractArray{T,N} where N where T)
  "jl_method_table_insert"
  Base.IteratorEltype(::Type{var"#s34"} where var"#s34"<:AbstractTrees.TreeIterator) in AbstractTrees at /Users/ian/.julia/packages/AbstractTrees/VQ0nX/src/iteration.jl:5
  "jl_method_table_insert"

julia> using SnoopCompileAnalysis

julia> trees = invalidation_trees(invalidations);
insert_backedges for MethodInstance for _progress(::String, ::Float64, ::Expr, ::Union{Expr, Symbol}, ::Union{Expr, Symbol}, ::Union{typeof(Juno._comprehension), typeof(Juno._for)}, ::Any, ::Any, ::Expr)
insert_backedges for MethodInstance for _progress(::Expr, ::Float64, ::Expr, ::Union{Expr, Symbol}, ::Union{Expr, Symbol}, ::Union{typeof(Juno._comprehension), typeof(Juno._for)}, ::Any, ::Any, ::Expr)
insert_backedges for MethodInstance for (::StaticArrays.var"#65#71")(::Int64)
insert_backedges for MethodInstance for (::ForwardDiff.var"#6#10"{Dict{Symbol,Expr}})(::Any)
insert_backedges for MethodInstance for rand(::Type{ColorTypes.AGray32}, ::Tuple{Int64,Int64})
insert_backedges for MethodInstance for find_maximum_chroma(::ColorTypes.LCHuv, ::Float64, ::Float64)
insert_backedges for MethodInstance for find_maximum_chroma(::ColorTypes.LCHuv, ::Int64, ::Float64)
insert_backedges for MethodInstance for find_maximum_chroma(::ColorTypes.LCHuv, ::Float64, ::Int64)
insert_backedges for MethodInstance for find_maximum_chroma(::ColorTypes.LCHuv, ::Int64, ::Int64)
insert_backedges for MethodInstance for #MSC#13(::Bool, ::typeof(Colors.MSC), ::Any, ::Any)
insert_backedges for MethodInstance for _parse_colorant(::String)
insert_backedges for MethodInstance for evaluate_cost_tile(::LoopVectorization.LoopSet, ::Vector{Symbol}, ::LoopVectorization.UnrollSymbols)
insert_backedges for MethodInstance for prefetchisagoodidea(::LoopVectorization.LoopSet, ::LoopVectorization.Operation, ::LoopVectorization.UnrollArgs{Int64})
ERROR: unexpected item Core.TypeMapEntry(nothing, Tuple{typeof(show),IOBuffer,Type}, Tuple{typeof(show),IOBuffer,Any}, svec(Tuple{typeof(show),IOBuffer,Core.TypeofBottom}), 0x000000000000269a, 0x0000000000006f0e, MethodInstance for show(::IOBuffer, ::Type), false, false, false) at 5814
Stacktrace:
 [1] error(::String, ::Core.TypeMapEntry, ::String, ::Int64)
   @ Base ./error.jl:42
 [2] invalidation_trees(list::Vector{Any})
   @ SnoopCompileAnalysis ~/.julia/packages/SnoopCompileAnalysis/vI2vl/src/invalidations.jl:323
 [3] top-level scope
   @ REPL[4]:1

To edit a specific method, type the corresponding number into the REPL and press Ctrl+Q