Skip to content

Commit d5ed29e

Browse files
authored
Fix doc deployment, completely disable JET (#437)
The most important change is to update the `repo` in `deploydocs`, which should have happened when I transferred the package. Also: - Improve printing a bit - disable JET and its tutorial for now
1 parent a0f08b6 commit d5ed29e

File tree

8 files changed

+52
-47
lines changed

8 files changed

+52
-47
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ jobs:
4949
with:
5050
coverage: false # FIXME: this is very sad, but coverage changes the snoop_inference.jl/Stale tests (as of Julia 1.13.0-DEV.1058)
5151
- run: julia --check-bounds=yes --project -e 'using Pkg; Pkg.test(; test_args=["cthulhu"], coverage=false)'
52-
- run: julia --check-bounds=yes --project -e 'using Pkg; Pkg.test(; test_args=["jet"], coverage=false)'
53-
continue-on-error: true # JET test is non-fatal
52+
# - run: julia --check-bounds=yes --project -e 'using Pkg; Pkg.test(; test_args=["jet"], coverage=false)'
53+
# continue-on-error: true # JET test is non-fatal
5454
# - uses: julia-actions/julia-processcoverage@v1
5555
# with:
5656
# directories: src,SnoopCompileCore/src

Project.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
1818

1919
[weakdeps]
2020
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
21-
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
21+
# JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
2222
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
2323

2424
[sources]
2525
SnoopCompileCore = {path = "SnoopCompileCore"}
2626

2727
[extensions]
2828
CthulhuExt = "Cthulhu"
29-
JETExt = ["JET", "Cthulhu"]
29+
# JETExt = ["JET", "Cthulhu"]
3030
SCPrettyTablesExt = "PrettyTables"
3131
SCPyPlotExt = "PyPlot"
3232

@@ -36,7 +36,7 @@ CodeTracking = "1.3.9, 2"
3636
Cthulhu = "2.17.6"
3737
FlameGraphs = "1"
3838
InteractiveUtils = "1"
39-
JET = "0.9, 0.10"
39+
# JET = "0.9, 0.10"
4040
MethodAnalysis = "1"
4141
OrderedCollections = "1"
4242
Pkg = "1"
@@ -55,7 +55,7 @@ julia = "1.12"
5555
[extras]
5656
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
5757
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
58-
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
58+
# JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
5959
MethodAnalysis = "85b6ec6f-f7df-4429-9514-a64bcd9ee824"
6060
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
6161
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
@@ -64,4 +64,5 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
6464
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6565

6666
[targets]
67-
test = ["Cthulhu", "PrettyTables", "Documenter", "JET", "MethodAnalysis", "Pkg", "Random", "REPL", "Test"]
67+
# test = ["Cthulhu", "PrettyTables", "Documenter", "JET", "MethodAnalysis", "Pkg", "Random", "REPL", "Test"]
68+
test = ["Cthulhu", "PrettyTables", "Documenter", "MethodAnalysis", "Pkg", "Random", "REPL", "Test"]

docs/Project.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
33
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
44
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
5-
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
5+
# JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
66
MethodAnalysis = "85b6ec6f-f7df-4429-9514-a64bcd9ee824"
77
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
88
SnoopCompile = "aa65fe97-06da-5843-b5b1-d5d13cad87d2"
99
SnoopCompileCore = "e2b509da-e806-4183-be48-004708413034"
1010

11+
[sources]
12+
SnoopCompile = {path = ".."}
13+
SnoopCompileCore = {path = "../SnoopCompileCore"}
14+
1115
[compat]
1216
AbstractTrees = "0.4"
1317
Cthulhu = "2"
1418
Documenter = "1"
15-
JET = "0.9"
19+
# JET = "0.9"
1620
MethodAnalysis = "0.4"
1721
PyPlot = "2"
1822
SnoopCompile = "3"

docs/make.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ makedocs(
1313
# doctest = :fix,
1414
warnonly=true, # delete when https://github.com/JuliaDocs/Documenter.jl/issues/2541 is fixed
1515
pages = ["index.md",
16-
"Basic tutorials" => ["tutorials/invalidations.md", "tutorials/snoop_inference.md", "tutorials/snoop_llvm.md", "tutorials/pgdsgui.md", "tutorials/jet.md"],
16+
"Basic tutorials" => ["tutorials/invalidations.md", "tutorials/snoop_inference.md", "tutorials/snoop_llvm.md", "tutorials/pgdsgui.md", #="tutorials/jet.md"=#], # FIXME re-enable jet tutorial when JET supports 1.12
1717
"Advanced tutorials" => ["tutorials/snoop_inference_analysis.md", "tutorials/snoop_inference_parcel.md"],
1818
"Explanations" => ["explanations/tools.md", "explanations/gotchas.md", "explanations/fixing_inference.md", "explanations/invalidation_classes.md", "explanations/devs.md"],
1919
"reference.md",
20-
]
20+
],
2121
)
2222

2323
deploydocs(
24-
repo = "github.com/timholy/SnoopCompile.jl.git",
24+
repo = "github.com/JuliaDebug/SnoopCompile.jl.git",
2525
push_preview=true
2626
)

docs/src/tutorials/snoop_inference.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ end
3838
3939
# output
4040
41-
FlattenDemo
41+
Main.var"Main".FlattenDemo
4242
```
4343

4444
The main call, `packintype`, stores the input in a `struct`, and then calls functions that extract the field value and performs arithmetic on the result.
@@ -55,7 +55,7 @@ julia> tinf = @snoop_inference FlattenDemo.packintype(1);
5555
julia> using SnoopCompile
5656
5757
julia> tinf
58-
InferenceTimingNode: 0.002712/0.003278 on Core.Compiler.Timings.ROOT() with 1 direct children
58+
InferenceTimingNode: 0.000010/0.002443 on MethodInstance for Base.Compiler.Timings.ROOT() with 1 direct children
5959
```
6060

6161
!!! tip
@@ -80,7 +80,7 @@ If you do have a lot of invalidations, [`precompile_blockers`](@ref) may be an e
8080

8181
Let's start unpacking the output of `@snoop_inference` and see how to get more insight.
8282
First, notice that the output is an `InferenceTimingNode`: it's the root element of a tree of such nodes, all connected by caller-callee relationships.
83-
Indeed, this particular node is for `Core.Compiler.Timings.ROOT()`, a "dummy" node that is the root of all such trees.
83+
Indeed, this particular node is for `Base.Compiler.Timings.ROOT()`, a "dummy" node that is the root of all such trees.
8484

8585
You may have noticed that this `ROOT` node prints with two numbers.
8686
It will be easier to understand their meaning if we first display the whole tree.
@@ -90,14 +90,13 @@ We can do that with the [AbstractTrees](https://github.com/JuliaCollections/Abst
9090
julia> using AbstractTrees
9191
9292
julia> print_tree(tinf, maxdepth=100)
93-
InferenceTimingNode: 0.002712/0.003278 on Core.Compiler.Timings.ROOT() with 1 direct children
94-
└─ InferenceTimingNode: 0.000133/0.000566 on FlattenDemo.packintype(::Int64) with 2 direct children
95-
├─ InferenceTimingNode: 0.000094/0.000094 on FlattenDemo.MyType{Int64}(::Int64) with 0 direct children
96-
└─ InferenceTimingNode: 0.000089/0.000339 on FlattenDemo.dostuff(::FlattenDemo.MyType{Int64}) with 2 direct children
97-
├─ InferenceTimingNode: 0.000064/0.000122 on FlattenDemo.extract(::FlattenDemo.MyType{Int64}) with 2 direct children
98-
│ ├─ InferenceTimingNode: 0.000034/0.000034 on getproperty(::FlattenDemo.MyType{Int64}, ::Symbol) with 0 direct children
99-
│ └─ InferenceTimingNode: 0.000024/0.000024 on getproperty(::FlattenDemo.MyType{Int64}, x::Symbol) with 0 direct children
100-
└─ InferenceTimingNode: 0.000127/0.000127 on FlattenDemo.domath(::Int64) with 0 direct children
93+
InferenceTimingNode: 0.000010/0.002443 on MethodInstance for Base.Compiler.Timings.ROOT() with 1 direct children
94+
└─ InferenceTimingNode: 0.001744/0.002433 on MethodInstance for Main.var"Main".FlattenDemo.packintype(::Int64) with 2 direct children
95+
├─ InferenceTimingNode: 0.000067/0.000070 on MethodInstance for MyType{Int64}(::Int64) with 0 direct children
96+
└─ InferenceTimingNode: 0.000140/0.000415 on MethodInstance for Main.var"Main".FlattenDemo.dostuff(::MyType{Int64}) with 2 direct children
97+
├─ InferenceTimingNode: 0.000090/0.000124 on MethodInstance for Main.var"Main".FlattenDemo.extract(::MyType{Int64}) with 1 direct children
98+
│ └─ InferenceTimingNode: 0.000027/0.000027 on MethodInstance for getproperty(::MyType{Int64}, ::Symbol) with 0 direct children
99+
└─ InferenceTimingNode: 0.000073/0.000073 on MethodInstance for Main.var"Main".FlattenDemo.domath(::Int64) with 0 direct children
101100
```
102101

103102
This tree structure reveals the caller-callee relationships, showing the specific types that were used for each `MethodInstance`.
@@ -112,10 +111,10 @@ You can extract the `MethodInstance` with
112111

113112
```jldoctest flatten-demo
114113
julia> Core.MethodInstance(tinf)
115-
MethodInstance for Core.Compiler.Timings.ROOT()
114+
MethodInstance for Base.Compiler.Timings.ROOT()
116115
117116
julia> Core.MethodInstance(tinf.children[1])
118-
MethodInstance for FlattenDemo.packintype(::Int64)
117+
MethodInstance for Main.var"Main".FlattenDemo.packintype(::Int64)
119118
```
120119

121120
Each node in this tree is accompanied by a pair of numbers.
File renamed without changes.

ext/JETExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ julia> mapfib(list) = map(fib, list)
5050
mapfib (generic function with 1 method)
5151
5252
julia> tinf = @snoop_inference try mapfib(list) catch end
53-
InferenceTimingNode: 0.049825/0.071476 on Core.Compiler.Timings.ROOT() with 5 direct children
53+
InferenceTimingNode: 0.049825/0.071476 on Base.Compiler.Timings.ROOT() with 5 direct children
5454
5555
julia> @report_call mapfib(list)
5656
No errors detected

src/parcel_snoop_inference.jl

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,18 @@ lookups_key(ip) = ip
4747
lookups_key(ip::Ptr{Nothing}) = UInt(ip)
4848

4949
_showtiming(io, node) = print(io, @sprintf("%8.6f", exclusive(node)), "/", @sprintf("%8.6f", inclusive(node)), " on ")
50+
showmi(io, mi::MethodInstance) = print(io, replace(sprint(show, mi), "MethodInstance for " => ""))
5051
function Base.show(io::IO, node::InferenceTiming)
5152
print(io, "InferenceTiming: ")
5253
_showtiming(io, node)
53-
show(io, MethodInstance(node))
54+
showmi(io, MethodInstance(node))
5455
end
5556

5657
# This should be in SnoopCompileCore, except that it promises not to specialize Base methods to avoid invalidating other code
5758
function Base.show(io::IO, node::InferenceTimingNode)
5859
print(io, "InferenceTimingNode: ")
5960
_showtiming(io, node)
60-
show(io, MethodInstance(node))
61+
showmi(io, MethodInstance(node))
6162
print(io, " with ", string(length(node.children)), " direct children")
6263
end
6364

@@ -76,10 +77,10 @@ We'll use [`SnoopCompile.flatten_demo`](@ref), which runs `@snoop_inference` on
7677
7778
```jldoctest flatten; setup=:(using SnoopCompile), filter=r"([0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?/[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?|WARNING: replacing module FlattenDemo\\.\\n)"
7879
julia> tinf = SnoopCompile.flatten_demo()
79-
InferenceTimingNode: 0.002148974/0.002767166 on Core.Compiler.Timings.ROOT() with 1 direct children
80+
InferenceTimingNode: 0.002148974/0.002767166 on Base.Compiler.Timings.ROOT() with 1 direct children
8081
8182
julia> using AbstractTrees; print_tree(tinf)
82-
InferenceTimingNode: 0.00242354/0.00303526 on Core.Compiler.Timings.ROOT() with 1 direct children
83+
InferenceTimingNode: 0.00242354/0.00303526 on Base.Compiler.Timings.ROOT() with 1 direct children
8384
└─ InferenceTimingNode: 0.000150891/0.000611721 on SnoopCompile.FlattenDemo.packintype(::$Int) with 2 direct children
8485
├─ InferenceTimingNode: 0.000105318/0.000105318 on SnoopCompile.FlattenDemo.MyType{$Int}(::$Int) with 0 direct children
8586
└─ InferenceTimingNode: 9.43e-5/0.000355512 on SnoopCompile.FlattenDemo.dostuff(::SnoopCompile.FlattenDemo.MyType{$Int}) with 2 direct children
@@ -95,8 +96,8 @@ that `getproperty` was inferred with. This reflects constant-propagation in infe
9596
Then:
9697
```jldoctest flatten; setup=:(using SnoopCompile), filter=[r"[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?/[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?", r"WARNING: replacing module FlattenDemo.*"]
9798
julia> flatten(tinf; sortby=nothing)
98-
8-element Vector{SnoopCompileCore.InferenceTiming}:
99-
InferenceTiming: 0.002423543/0.0030352639999999998 on Core.Compiler.Timings.ROOT()
99+
8-element Vector{InferenceTiming}:
100+
InferenceTiming: 0.002423543/0.0030352639999999998 on Base.Compiler.Timings.ROOT()
100101
InferenceTiming: 0.000150891/0.0006117210000000001 on SnoopCompile.FlattenDemo.packintype(::$Int)
101102
InferenceTiming: 0.000105318/0.000105318 on SnoopCompile.FlattenDemo.MyType{$Int}(::$Int)
102103
InferenceTiming: 9.43e-5/0.00035551200000000005 on SnoopCompile.FlattenDemo.dostuff(::SnoopCompile.FlattenDemo.MyType{$Int})
@@ -108,20 +109,20 @@ julia> flatten(tinf; sortby=nothing)
108109
109110
```
110111
julia> flatten(tinf; tmin=1e-4) # sorts by exclusive time (the time before the '/')
111-
4-element Vector{SnoopCompileCore.InferenceTiming}:
112+
4-element Vector{InferenceTiming}:
112113
InferenceTiming: 0.000105318/0.000105318 on SnoopCompile.FlattenDemo.MyType{$Int}(::$Int)
113114
InferenceTiming: 0.000136496/0.000136496 on SnoopCompile.FlattenDemo.domath(::$Int)
114115
InferenceTiming: 0.000150891/0.0006117210000000001 on SnoopCompile.FlattenDemo.packintype(::$Int)
115-
InferenceTiming: 0.002423543/0.0030352639999999998 on Core.Compiler.Timings.ROOT()
116+
InferenceTiming: 0.002423543/0.0030352639999999998 on Base.Compiler.Timings.ROOT()
116117
117118
julia> flatten(tinf; sortby=inclusive, tmin=1e-4) # sorts by inclusive time (the time after the '/')
118-
6-element Vector{SnoopCompileCore.InferenceTiming}:
119+
6-element Vector{InferenceTiming}:
119120
InferenceTiming: 0.000105318/0.000105318 on SnoopCompile.FlattenDemo.MyType{$Int}(::$Int)
120121
InferenceTiming: 6.6458e-5/0.000124716 on SnoopCompile.FlattenDemo.extract(::SnoopCompile.FlattenDemo.MyType{$Int})
121122
InferenceTiming: 0.000136496/0.000136496 on SnoopCompile.FlattenDemo.domath(::$Int)
122123
InferenceTiming: 9.43e-5/0.00035551200000000005 on SnoopCompile.FlattenDemo.dostuff(::SnoopCompile.FlattenDemo.MyType{$Int})
123124
InferenceTiming: 0.000150891/0.0006117210000000001 on SnoopCompile.FlattenDemo.packintype(::$Int)
124-
InferenceTiming: 0.002423543/0.0030352639999999998 on Core.Compiler.Timings.ROOT()
125+
InferenceTiming: 0.002423543/0.0030352639999999998 on Base.Compiler.Timings.ROOT()
125126
```
126127
127128
As you can see, `sortby` affects not just the order but also the selection of frames; with exclusive times, `dostuff` did
@@ -162,7 +163,7 @@ We'll use [`SnoopCompile.flatten_demo`](@ref), which runs `@snoop_inference` on
162163
163164
```jldoctest accum1; setup=:(using SnoopCompile), filter=[r"(in|@)", r"([0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?|:[0-9]+\\)|at .*/inference_demos.jl:\\d+|at Base\\.jl:\\d+|at compiler/typeinfer\\.jl:\\d+|WARNING: replacing module FlattenDemo\\.\\n)"]
164165
julia> tinf = SnoopCompile.flatten_demo()
165-
InferenceTimingNode: 0.004978/0.005447 on Core.Compiler.Timings.ROOT() with 1 direct children
166+
InferenceTimingNode: 0.004978/0.005447 on Base.Compiler.Timings.ROOT() with 1 direct children
166167
167168
julia> accumulate_by_source(flatten(tinf))
168169
7-element Vector{Tuple{Float64, Union{Method, Core.MethodInstance}}}:
@@ -306,14 +307,14 @@ main purpose of PrecompileTools.)
306307
julia> module A
307308
a(x) = x
308309
end
309-
Main.A
310+
A
310311
311312
julia> module B
312313
using ..A
313314
struct BType end # this type is not known to A
314315
b(x) = x
315316
end
316-
Main.B
317+
B
317318
```
318319
319320
Now let's run these methods to generate some compiled `MethodInstance`s:
@@ -323,23 +324,23 @@ julia> A.a(3.2) # Float64 is not "owned" by A, but A loads Base so A kn
323324
3.2
324325
325326
julia> A.a(B.BType()) # B.BType is not known to A
326-
Main.B.BType()
327+
B.BType()
327328
328329
julia> B.b(B.BType()) # B knows about B.BType
329-
Main.B.BType()
330+
B.BType()
330331
331332
julia> mia1, mia2 = Base.specializations(only(methods(A.a)));
332333
333334
julia> @show mia1 SnoopCompile.isprecompilable(mia1);
334-
mia1 = MethodInstance for Main.A.a(::Float64)
335+
mia1 = MethodInstance for A.a(::Float64)
335336
SnoopCompile.isprecompilable(mia1) = true
336337
337338
julia> @show mia2 SnoopCompile.isprecompilable(mia2);
338-
mia2 = MethodInstance for Main.A.a(::Main.B.BType)
339+
mia2 = MethodInstance for A.a(::B.BType)
339340
SnoopCompile.isprecompilable(mia2) = false
340341
341342
julia> mib = only(Base.specializations(only(methods(B.b))))
342-
MethodInstance for Main.B.b(::Main.B.BType)
343+
MethodInstance for B.b(::B.BType)
343344
344345
julia> SnoopCompile.isprecompilable(mib)
345346
true
@@ -454,7 +455,7 @@ We'll use [`SnoopCompile.itrigs_demo`](@ref), which runs `@snoop_inference` on a
454455
455456
```jldoctest parceltree; setup=:(using SnoopCompile), filter=r"([0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?|WARNING: replacing module ItrigDemo\\.\\n|UInt8|Float64|SnoopCompile\\.ItrigDemo\\.)"
456457
julia> tinf = SnoopCompile.itrigs_demo()
457-
InferenceTimingNode: 0.004490576/0.004711168 on Core.Compiler.Timings.ROOT() with 2 direct children
458+
InferenceTimingNode: 0.004490576/0.004711168 on Base.Compiler.Timings.ROOT() with 2 direct children
458459
459460
julia> ttot, pcs = SnoopCompile.parcel(tinf);
460461
@@ -808,7 +809,7 @@ We'll use [`SnoopCompile.itrigs_demo`](@ref), which runs `@snoop_inference` on a
808809
809810
```jldoctest triggers; setup=:(using SnoopCompile), filter=r"([0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?|.*/inference_demos\\.jl:\\d+|WARNING: replacing module ItrigDemo\\.\\n)"
810811
julia> tinf = SnoopCompile.itrigs_demo()
811-
InferenceTimingNode: 0.004490576/0.004711168 on Core.Compiler.Timings.ROOT() with 2 direct children
812+
InferenceTimingNode: 0.004490576/0.004711168 on Base.Compiler.Timings.ROOT() with 2 direct children
812813
813814
julia> itrigs = inference_triggers(tinf)
814815
2-element Vector{InferenceTrigger}:
@@ -1822,7 +1823,7 @@ a workload designed to yield reproducible results:
18221823
18231824
```jldoctest flamegraph; setup=:(using SnoopCompile), filter=r"([0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?/[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?|at.*typeinfer\\.jl:\\d+|0:\\d+|WARNING: replacing module FlattenDemo\\.\\n)"
18241825
julia> tinf = SnoopCompile.flatten_demo()
1825-
InferenceTimingNode: 0.002148974/0.002767166 on Core.Compiler.Timings.ROOT() with 1 direct children
1826+
InferenceTimingNode: 0.002148974/0.002767166 on Base.Compiler.Timings.ROOT() with 1 direct children
18261827
18271828
julia> fg = flamegraph(tinf)
18281829
Node(FlameGraphs.NodeData(ROOT() at typeinfer.jl:75, 0x00, 0:3334431))

0 commit comments

Comments
 (0)