Closed charleskawczynski closed 1 year ago
Base: 84.08% // Head: 83.70% // Decreases project coverage by -0.38%
:warning:
Coverage data is based on head (
5b4a42f
) compared to base (dcae62d
). Patch coverage: 87.50% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
bump π
Bump! π
I think we could have this, but I'd rather it be loaded under a @require PrettyTables = ...
block. Often the best practice is to define the function
"""
Lotsa docs
Using `tabulated_invalidations` requires that you first load the PrettyTables package.
"""
function tabulated_invalidations end # this defines a function with no methods, but the docstring is available.
as a "stub" in the main package, and then in __init__()
function __init__()
# other stuff
@require PettyTables = sha include("tabulated.jl")
end
and put the tabulated_invalidations
methods in "tabulated.jl".
Ok, this now works I think as expected, here's a mwe (assuming some packages are loadable):
import SnoopCompileCore
invalidations = SnoopCompileCore.@snoopr begin
using ForwardDiff
end;
import SnoopCompile
using PrettyTables # needed for report_invalidations to be defined
SnoopCompile.report_invalidations(;
invalidations,
process_filename = x -> last(split(x, ".julia/packages/"))
)
Which produces
β Warning: Could not attribute the following delayed invalidations:
β @ SnoopCompile ~/Dropbox/Caltech/work/dev/clones/forks/SnoopCompile.jl/src/invalidations.jl:552
Any[MethodInstance for eltype(::Type{A} where A<:(NamedTuple{(:init,), _A} where _A<:Tuple{AbstractDict})), MethodInstance for eltype(::Type{T} where T<:Tuple{AbstractDict}), MethodInstance for eltype(::Type{A} where A<:(NamedTuple{(:maxlog, :form), _A} where _A<:Tuple{Int64, Type})), MethodInstance for eltype(::Type{T} where T<:Tuple{Int64, Type})] invalidated Core.MethodInstance[MethodInstance for StaticArrays.var"#s25#170"(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any), MethodInstance for StaticArrays._precompile_()]
Any[MethodInstance for eltype(::Type{T} where T<:Tuple{AbstractDict}), MethodInstance for eltype(::Type{A} where A<:(NamedTuple{(:init,), _A} where _A<:Tuple{AbstractDict}))] invalidated MethodInstance for MacroTools.allbindings(::Any, ::Vector{Any})
[ Info: 233 methods invalidated for 6 functions
βββββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββ¬ββββββββββββββββ¬ββββββββββββββββββ
β <file name>:<line number> β Function Name β Invalidations β Invalidations % β
β β β β (xα΅’/βx) β
βββββββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββΌββββββββββββββββΌββββββββββββββββββ€
β ForwardDiff/QdStj/src/dual.jl:427 β promote_rule β 209 β 82 β
β StaticArrays/x7lS0/src/abstractarray.jl:150 β similar β 18 β 7 β
β StaticArrays/x7lS0/src/SizedArray.jl:88 β convert β 15 β 6 β
β StaticArrays/x7lS0/src/mapreduce.jl:253 β foldl##kw β 8 β 3 β
β ForwardDiff/QdStj/src/dual.jl:145 β isequal β 3 β 1 β
β StaticArrays/x7lS0/src/SOneTo.jl:57 β getproperty β 3 β 1 β
βββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββ΄ββββββββββββββββ΄ββββββββββββββββββ
Based on https://github.com/JuliaDiff/ForwardDiff.jl/issues/620#issuecomment-1370119947 and https://github.com/JuliaDiff/ForwardDiff.jl/issues/620#issuecomment-1370142934, should we update how report_invalidations
works? cc @ChrisRackauckas @timholy
I think one last thing that we could do, that would really put this over the top in terms of ease of use, would be if we followed through with https://github.com/CliMA/ReportMetrics.jl/issues/7#issuecomment-1015618744, and made the file / line number hypertext links through PrettyTables (which I think is supported here).
I think this can be a followup feature, though. Thumbs up to open an issue π
Thanks! This is a nice addition. Release of SnoopCompile 2.10.0 is underway.
Hello ππ»! There has been a lot of activity around hunting down invalidations lately, for example:
As mentioned in this comment of the
discourse thread
, I've added a function calledreport_invalidations
to ReportMetrics.jl which summarizes the output ofSnoopCompileCore.@snoopr
with quantitative and actionable information.I'd like to call this function from the
julia-invalidations
github action. I thought it might be cleaner to add this functionality to SnoopCompile directly (rather than a separate package) since it's relatively light weight (barring PrettyTables) and uses SnoopCompile internals.The
ReportMetrics.jl
version of the printed table looks like this: