Skip to content

Commit 4a40814

Browse files
committed
More debugging
1 parent 4fe2414 commit 4a40814

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

test/snoop_inference.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using SnoopCompile
22
using SnoopCompile.SnoopCompileCore
33
using SnoopCompile.FlameGraphs
4+
using AbstractTrees
45
using Test
56
using InteractiveUtils
67
using Random
@@ -855,7 +856,9 @@ end
855856

856857
# Loading StaleC should "heal" StaleA.use_stale(::Vector{Any})
857858
mius = only(methodinstances(StaleA.use_stale))
858-
@test mius.cache.max_world == typemax(UInt)
859+
cius = mius.cache
860+
@test cius.max_world == typemax(UInt)
861+
# @show cius.specptr cius.invoke cius.inferred
859862

860863
trees = invalidation_trees(invalidations)
861864
tree = length(trees) == 1 ? only(trees) : trees[findfirst(tree -> !isempty(tree.backedges), trees)]
@@ -874,7 +877,6 @@ end
874877
StaleB.useA() # this should require recompilation
875878
StaleC.call_buildstale("hi") # this should still be valid (healed during loading of StaleC)
876879
end
877-
print_tree(tinf)
878880
@test isempty(SnoopCompile.StaleTree(first(smis).def, :noreason).backedges) # constructor test
879881
healed = true
880882
# If we don't discount ones left in an invalidated state,
@@ -891,6 +893,8 @@ end
891893
display(hits)
892894
println()
893895
end
896+
println("Here's tinf:")
897+
print_tree(tinf)
894898
end
895899
root, hits = only(bes)
896900
mi_stale = only(filter(mi -> endswith(String(mi.def.file), "StaleA.jl"), methodinstances(StaleA.stale, (String,))))

test/testmodules/Stale/StaleC/src/StaleC.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module StaleC
22

33
using StaleA
44

5-
StaleA.stale(x::String) = length(x) # piracy is great for triggering invalidations
5+
StaleA.stale(x::String) = length(x) # piracy is great (but not required) for triggering invalidations
66
call_buildstale(x) = StaleA.build_stale(x) # linking build_stale to a method in this module ensures caching
77

88
call_buildstale("hey") # forces re/precompilation of `StaleA.use_stale(::Vector{Any})`

0 commit comments

Comments
 (0)