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

Handle empty backtraces #185

Merged
merged 2 commits into from
Aug 1, 2021
Merged

Handle empty backtraces #185

merged 2 commits into from
Aug 1, 2021

Conversation

timholy
Copy link
Member

@timholy timholy commented Aug 1, 2021

Fixes #184

@ChrisRackauckas, at least one of the branches mentioned in #184 doesn't seem to be up, but I think this should fix the issue. I'm not sure where it comes from, but I'm happy to take a look if you push them.

@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2021

Codecov Report

Merging #185 (3f09e06) into master (1737fbb) will increase coverage by 1.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #185      +/-   ##
==========================================
+ Coverage   51.77%   52.96%   +1.18%     
==========================================
  Files           7        7              
  Lines         902      895       -7     
==========================================
+ Hits          467      474       +7     
+ Misses        435      421      -14     
Impacted Files Coverage Δ
src/backedges.jl 95.18% <100.00%> (+15.18%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1737fbb...3f09e06. Read the comment docs.

@timholy timholy merged commit 18e558f into master Aug 1, 2021
@timholy timholy deleted the teh/fix_184 branch August 1, 2021 10:02
@timholy
Copy link
Member Author

timholy commented Aug 1, 2021

Also note that the current release of Cthulhu only supports Julia 1.7+.

@ChrisRackauckas
Copy link
Contributor

Oops, I deleted that branch after merging 😅 .

# DiffEqBase#cthulhu
# OrdinaryDiffEq#cthulhu

using OrdinaryDiffEq, SnoopCompile
function lorenz(du,u,p,t)
 du[1] = 10.0(u[2]-u[1])
 du[2] = u[1]*(28.0-u[3]) - u[2]
 du[3] = u[1]*u[2] - (8/3)*u[3]
end
u0 = [1.0;0.0;0.0]
tspan = (0.0,100.0)
prob = ODEProblem(OrdinaryDiffEq.lorenz,u0,tspan)
alg = Tsit5()
tinf = @snoopi_deep solve(prob,alg)
itrigs = inference_triggers(tinf)
itrig = itrigs[11]
ascend(itrig)

still seems to hit it on v1.7-beta3.

@timholy
Copy link
Member Author

timholy commented Aug 1, 2021

Hmm, not for me with a recently devved-Cthulhu. Just to check, itrigs[11] corresponds to a call to OrdinaryDiffEq.fix_dt_at_bounds! from loopheader!; is that the one you're looking at? I tried all 19 of them and none of them triggered an immediate error upon calling ascend. Or did we have to select one of the stackframes and descend into it?

The other oddity is that I'm not seeing anything that might correspond to an empty stackframe.

@ChrisRackauckas
Copy link
Contributor

It should correspond to OrdinaryDiffEq.perform_step!. Are you on the v1.7-beta3?

(@v1.7) pkg> st
      Status `C:\Users\accou\.julia\environments\v1.7\Project.toml`
  [c52e3926] Atom v0.12.33
  [6e4b80f9] BenchmarkTools v1.1.1
  [f68482b8] Cthulhu v2.1.2 `https://github.com/JuliaDebug/Cthulhu.jl.git#master`
  [2b5f629d] DiffEqBase v6.70.0 `https://github.com/SciML/DiffEqBase.jl.git#cthulhu`
  [e5e0dc1b] Juno v0.8.4
  [1dea7af3] OrdinaryDiffEq v5.60.2 `https://github.com/SciML/OrdinaryDiffEq.jl.git#cthulhu`
  [4722fa14] PkgAuthentication v1.1.1
  [aa65fe97] SnoopCompile v2.7.0 `https://github.com/timholy/SnoopCompile.jl.git#master`

(@v1.7) pkg> st -m
      Status `C:\Users\accou\.julia\environments\v1.7\Manifest.toml`
  [1520ce14] AbstractTrees v0.3.4
  [79e6a3ab] Adapt v3.3.1
  [ec485272] ArnoldiMethod v0.1.0
  [4fba245c] ArrayInterface v3.1.17
  [bf4720bc] AssetRegistry v0.1.0
  [c52e3926] Atom v0.12.33
  [6e4b80f9] BenchmarkTools v1.1.1
  [00ebfdb7] CSTParser v2.5.0
  [d360d2e6] ChainRulesCore v1.0.2
  [53a63b46] CodeTools v0.7.1
  [da1fd8a2] CodeTracking v1.0.6
  [3da002f7] ColorTypes v0.11.0
  [5ae59095] Colors v0.12.8
  [a80b9123] CommonMark v0.8.2
  [38540f10] CommonSolve v0.2.0
  [bbf7d656] CommonSubexpressions v0.3.0
  [34da2185] Compat v3.32.0
  [187b0558] ConstructionBase v1.3.0
  [a8cc5b0e] Crayons v4.0.4
  [f68482b8] Cthulhu v2.1.2 `https://github.com/JuliaDebug/Cthulhu.jl.git#master`
  [9a962f9c] DataAPI v1.7.0
  [864edb3b] DataStructures v0.18.9
  [e2d170a0] DataValueInterfaces v1.0.0
  [2b5f629d] DiffEqBase v6.70.0 `https://github.com/SciML/DiffEqBase.jl.git#cthulhu`
  [163ba53b] DiffResults v1.0.3
  [b552c78f] DiffRules v1.2.1
  [b4f34e82] Distances v0.10.3
  [33d173f1] DocSeeker v0.4.3
  [ffbed154] DocStringExtensions v0.8.5
  [e30172f5] Documenter v0.26.3
  [d4d017d3] ExponentialUtilities v1.8.4
  [7034ab61] FastBroadcast v0.1.8
  [9aa1b823] FastClosures v0.3.2
  [5789e2e9] FileIO v1.10.1
  [6a86dc24] FiniteDiff v2.8.1
  [53c48c17] FixedPointNumbers v0.8.4
  [08572546] FlameGraphs v0.2.5
  [1eca21be] FoldingTrees v1.0.1
  [f6369f11] ForwardDiff v0.10.19
  [069b7b12] FunctionWrappers v1.1.2
  [de31a74c] FunctionalCollections v0.5.0
  [fb4132e2] FuzzyCompletions v0.4.1
  [cd3eb016] HTTP v0.9.12
  [9fb69e20] Hiccup v0.2.2
  [0e44f5e4] Hwloc v2.0.0
  [b5f81e59] IOCapture v0.1.1
  [615f187c] IfElse v0.1.0
  [9b13fd28] IndirectArrays v0.5.1
  [d25df0c9] Inflate v0.1.2
  [83e8ac13] IniFile v0.5.0
  [42fd0dbc] IterativeSolvers v0.9.1
  [82899510] IteratorInterfaceExtensions v1.0.0
  [692b3bcd] JLLWrappers v1.3.0
  [682c06a0] JSON v0.21.1
  [98e50ef6] JuliaFormatter v0.13.7
  [aa1ae85d] JuliaInterpreter v0.8.19
  [e5e0dc1b] Juno v0.8.4
  [7c4cb9fa] LNR v0.2.1
  [2ee39098] LabelledArrays v1.6.3
  [50d2b5c4] Lazy v0.15.1
  [1d6d02ad] LeftChildRightSiblingTrees v0.1.2
  [093fc24a] LightGraphs v1.3.5
  [d3d80556] LineSearches v7.1.1
  [2ab3a3ac] LogExpFunctions v0.2.5
  [bdcacae8] LoopVectorization v0.12.59
  [1914dd2f] MacroTools v0.5.6
  [d125e4d3] ManualMemory v0.1.4
  [739be429] MbedTLS v1.0.3
  [e89f7d12] Media v0.5.0
  [46d2c3a1] MuladdMacro v0.2.2
  [d41bc354] NLSolversBase v7.8.1
  [2774e3e8] NLsolve v4.5.1
  [77ba4419] NaNMath v0.3.5
  [8913a72c] NonlinearSolve v0.3.8
  [510215fc] Observables v0.3.3
  [6fe1bfb0] OffsetArrays v1.10.3
  [bac558e1] OrderedCollections v1.4.1
  [1dea7af3] OrdinaryDiffEq v5.60.2 `https://github.com/SciML/OrdinaryDiffEq.jl.git#cthulhu`
  [d96e819e] Parameters v0.12.2
  [69de0a69] Parsers v1.1.1
  [fa939f87] Pidfile v1.2.0
  [4722fa14] PkgAuthentication v1.1.1
  [f517fe37] Polyester v0.3.7
  [21216c6a] Preferences v1.2.2
  [3cdcf5f2] RecipesBase v1.1.1
  [731186ca] RecursiveArrayTools v2.15.2
  [f2c3362d] RecursiveFactorization v0.1.13
  [189a3867] Reexport v1.1.0
  [ae029012] Requires v1.1.3
  [476501e8] SLEEFPirates v0.6.25
  [0bca4576] SciMLBase v1.18.2
  [efcf1570] Setfield v0.7.1
  [699a6c99] SimpleTraits v0.9.4
  [aa65fe97] SnoopCompile v2.7.0 `https://github.com/timholy/SnoopCompile.jl.git#master`
  [e2b509da] SnoopCompileCore v2.7.0
  [47a9eef4] SparseDiffTools v1.16.1
  [276daf66] SpecialFunctions v1.6.0
  [aedffcd0] Static v0.2.5
  [90137ffa] StaticArrays v1.2.9
  [82ae8749] StatsAPI v1.0.0
  [7792a7ef] StrideArraysCore v0.1.17
  [88034a9c] StringDistances v0.10.0
  [69024149] StringEncodings v0.3.5
  [3783bdb8] TableTraits v1.0.1
  [bd369af6] Tables v1.5.0
  [8290d209] ThreadingUtilities v0.4.6
  [0796e94c] Tokenize v0.5.18
  [a2a6695c] TreeViews v0.3.0
  [30578b45] URIParser v0.4.1
  [5c2747f8] URIs v1.3.0
  [3a884ed6] UnPack v1.0.2
  [3d5dd08c] VectorizationBase v0.20.25
  [19fa3120] VertexSafeGraphs v0.1.2
  [0f1e0344] WebIO v0.8.15
  [104b5d7c] WebSockets v1.5.9
  [cc8bc4a8] Widgets v0.6.3
  [ddb6d928] YAML v0.4.7
  [700de1a5] ZygoteRules v0.2.1
  [e33a78d0] Hwloc_jll v2.5.0+0
  [94ce4f54] Libiconv_jll v1.16.1+1
  [efe28fd5] OpenSpecFun_jll v0.5.5+0
  [0dad84c5] ArgTools
  [56f22d72] Artifacts
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [8bb1440f] DelimitedFiles
  [8ba89e20] Distributed
  [f43a241f] Downloads
  [7b1f6079] FileWatching
  [9fa8497b] Future
  [b77e0a4c] InteractiveUtils
  [b27032c2] LibCURL
  [76f85450] LibGit2
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [a63ad114] Mmap
  [ca575930] NetworkOptions
  [44cfe95a] Pkg
  [de0858da] Printf
  [9abbd945] Profile
  [3fa0cd96] REPL
  [9a3f8284] Random
  [ea8e919c] SHA
  [9e88b42a] Serialization
  [1a1011a3] SharedArrays
  [6462fe0b] Sockets
  [2f01184e] SparseArrays
  [10745b16] Statistics
  [4607b0f0] SuiteSparse
  [fa267f1f] TOML
  [a4e569a6] Tar
  [8dfed614] Test
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode
  [e66e0078] CompilerSupportLibraries_jll
  [deac9b47] LibCURL_jll
  [29816b5a] LibSSH2_jll
  [c8ffd9c3] MbedTLS_jll
  [14a3606d] MozillaCACerts_jll
  [4536629a] OpenBLAS_jll
  [83775a58] Zlib_jll
  [8e850b90] libblastrampoline_jll
  [8e850ede] nghttp2_jll
  [3f19e933] p7zip_jll

@ChrisRackauckas
Copy link
Contributor

ChrisRackauckas commented Aug 1, 2021

Copying everything I can down:

using OrdinaryDiffEq, SnoopCompile
function lorenz(du,u,p,t)
 du[1] = 10.0(u[2]-u[1])
 du[2] = u[1]*(28.0-u[3]) - u[2]
 du[3] = u[1]*u[2] - (8/3)*u[3]
end
u0 = [1.0;0.0;0.0]
tspan = (0.0,100.0)
prob = ODEProblem(OrdinaryDiffEq.lorenz,u0,tspan)
alg = Tsit5()
tinf = @snoopi_deep solve(prob,alg)
itrigs = inference_triggers(tinf)
itrig = itrigs[11]

Inference triggered to call OrdinaryDiffEq.perform_step!(::OrdinaryDiffEq.ODEIntegrator{Tsit5, true, Vector{Float64}, Nothing, Float64, SciMLBase.NullParameters, Float64, 
Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, 
Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}, ::OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, ::Bool) called from toplevel

ascend(itrig)


BoundsError: attempt to access 0-element Vector{Base.StackTraces.StackFrame} at index [0]
getindex at array.jl:835 [inlined]
instance at backedges.jl:89 [inlined]
treelist!(parent::FoldingTrees.Node{Cthulhu.Data{Core.MethodInstance}}, io::IOBuffer, mi::InferenceTrigger, indent::String, visited::Base.IdSet{Core.MethodInstance}) at backedges.jl:126
treelist(mi::InferenceTrigger) at backedges.jl:118
ascend(mi::InferenceTrigger; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) at Cthulhu.jl:414
ascend(mi::InferenceTrigger) at Cthulhu.jl:414
top-level scope at test.jl:209
eval at boot.jl:373 [inlined]
julia> versioninfo()
Julia Version 1.7.0-beta3.0
Commit e76c9dad42 (2021-07-07 08:12 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: AMD Ryzen 9 5950X 16-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.0 (ORCJIT, znver3)
Environment:
  JULIA_EDITOR = "C:\Users\accou\AppData\Local\atom\app-1.58.0\atom.exe"  -a
  JULIA_NUM_THREADS = 32
  JULIA_PKG_SERVER = https://neuralsim.juliahub.com

BTW, just tried v1.7 for the first time: precompilation is like 5x faster and parallelizes even better. Really nicely done!

Project_Manifest.zip

@timholy
Copy link
Member Author

timholy commented Aug 1, 2021

Interestingly, for me perform_step! is the 12th one in the list. And it doesn't error. I used your Project & Manifest, thanks for sending that. With those, my st -m is an exact match for yours.

What commit are you on for Cthulhu? For me it's 18e558f.

julia> for (i, itrig) in enumerate(itrigs)
           println(i, ": ", Core.MethodInstance(itrig.node).def)
       end
1: solve(prob::SciMLBase.DEProblem, args...; sensealg, u0, p, kwargs...) in DiffEqBase at /home/tim/.julia/packages/DiffEqBase/Z0E10/src/solve.jl:66
2: __init(prob::Union{SciMLBase.AbstractDAEProblem, SciMLBase.AbstractODEProblem}, alg::Union{OrdinaryDiffEqAlgorithm, OrdinaryDiffEq.DAEAlgorithm}, timeseries_init, ts_init, ks_init, recompile::Type{Val{recompile_flag}}; saveat, tstops, d_discontinuities, save_idxs, save_everystep, save_on, save_start, save_end, callback, dense, calck, dt, dtmin, dtmax, force_dtmin, adaptive, gamma, abstol, reltol, qmin, qmax, qsteady_min, qsteady_max, beta1, beta2, qoldinit, controller, fullnormalize, failfactor, maxiters, internalnorm, internalopnorm, isoutofdomain, unstable_check, verbose, timeseries_errors, dense_errors, advance_to_tstop, stop_at_next_tstop, initialize_save, progress, progress_steps, progress_name, progress_message, userdata, allow_extrapolation, initialize_integrator, alias_u0, alias_du0, initializealg, kwargs...) where recompile_flag in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/solve.jl:9
3: var"#__init#472"(saveat, tstops, d_discontinuities, save_idxs, save_everystep, save_on, save_start, save_end, callback, dense, calck, dt, dtmin, dtmax, force_dtmin, adaptive, gamma, abstol, reltol, qmin, qmax, qsteady_min, qsteady_max, beta1, beta2, qoldinit, controller, fullnormalize, failfactor, maxiters, internalnorm, internalopnorm, isoutofdomain, unstable_check, verbose, timeseries_errors, dense_errors, advance_to_tstop, stop_at_next_tstop, initialize_save, progress, progress_steps, progress_name, progress_message, userdata, allow_extrapolation, initialize_integrator, alias_u0, alias_du0, initializealg, kwargs::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(SciMLBase.__init), prob::Union{SciMLBase.AbstractDAEProblem, SciMLBase.AbstractODEProblem}, alg::Union{OrdinaryDiffEqAlgorithm, OrdinaryDiffEq.DAEAlgorithm}, timeseries_init, ts_init, ks_init, recompile::Type{Val{recompile_flag}}) where recompile_flag in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/solve.jl:9
4: percolate_up!(xs::AbstractArray, i::Integer, x, o::Base.Order.Ordering) in DataStructures at /home/tim/.julia/packages/DataStructures/ixwFs/src/heaps/arrays_as_heaps.jl:36
5: alg_cache(alg::Tsit5, u, rate_prototype, ::Type{uEltypeNoUnits}, ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck, ::Val{true}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/caches/low_order_rk_caches.jl:347
6: initialize!(integrator, cache::OrdinaryDiffEq.Tsit5Cache) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/perform_step/low_order_rk_perform_step.jl:611
7: handle_dt!(integrator) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/solve.jl:502
8: ode_determine_initdt(u0, t, tdir, dtmax, abstol, reltol, internalnorm, prob::SciMLBase.AbstractODEProblem{uType, tType, true}, integrator) where {tType, uType} in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/initdt.jl:1
9: solve!(integrator::OrdinaryDiffEq.ODEIntegrator) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/solve.jl:471
10: loopheader!(integrator) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/integrators/integrator_utils.jl:4
11: fix_dt_at_bounds!(integrator) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/integrators/integrator_utils.jl:341
12: perform_step!(integrator, cache::OrdinaryDiffEq.Tsit5Cache, repeat_step) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/perform_step/low_order_rk_perform_step.jl:627
13: _loopfooter!(integrator) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/integrators/integrator_utils.jl:170
14: calc_dt_propose!(integrator, dtnew) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/integrators/integrator_utils.jl:328
15: _savevalues!(integrator, force_save, reduce_size) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/integrators/integrator_utils.jl:51
16: apply_step!(integrator) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/integrators/integrator_utils.jl:278
17: handle_tstop!(integrator) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/integrators/integrator_utils.jl:355
18: _postamble!(integrator) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/integrators/integrator_utils.jl:120
19: solution_endpoint_match_cur_integrator!(integrator) in OrdinaryDiffEq at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/integrators/integrator_utils.jl:136

julia> itrig = itrigs[12]
Inference triggered to call OrdinaryDiffEq.perform_step!(::OrdinaryDiffEq.ODEIntegrator{Tsit5, true, Vector{Float64}, Nothing, Float64, SciMLBase.NullParameters, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}, ::OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, ::Bool) from perform_step! (/home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/perform_step/low_order_rk_perform_step.jl:628) inlined into CommonSolve.solve!(::OrdinaryDiffEq.ODEIntegrator{Tsit5, true, Vector{Float64}, Nothing, Float64, SciMLBase.NullParameters, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}) (/home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/solve.jl:478)

julia> ascend(itrig)
Choose a call for analysis (q to quit):
 >   perform_step!(::OrdinaryDiffEq.ODEIntegrator{Tsit5, true, Vector{Float64}, Nothing, Float64, SciMLBase.NullParameters, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float6
       perform_step! at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/perform_step/low_order_rk_perform_step.jl:628 => solve!(::OrdinaryDiffEq.ODEIntegrator{Tsit5, true, Vector{Float64}, Nothing, Fl
         #__solve#471 at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/solve.jl:5 => __solve at /home/tim/.julia/packages/OrdinaryDiffEq/eA5tD/src/solve.jl:4 => #solve_call#58 at /home/tim/.julia/pa
           eval at ./boot.jl:373 => eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:150
             repl_backend_loop(::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:241
               start_repl_backend(::REPL.REPLBackend, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:226
                 #run_repl#47(::Bool, ::typeof(REPL.run_repl), ::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:359
                   run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:346
                     (::Base.var"#919#921"{Bool, Bool, Bool})(::Module) at ./client.jl:394
v                      #invokelatest#2 at ./essentials.jl:716 => invokelatest at ./essentials.jl:714 => run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:379
julia> versioninfo()
Julia Version 1.7.0-beta3.0
Commit e76c9dad42 (2021-07-07 08:12 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.0 (ORCJIT, skylake)
Environment:
  JULIA_CPU_THREADS = 4

@ChrisRackauckas
Copy link
Contributor

Yeah... odd. I can jump on a quick call if that helps this go quicker. I actually get different inference results from Juno and the REPL haha, so that explains that difference (to an extent).

From Juno:

julia> for (i, itrig) in enumerate(itrigs)
                  println(i, ": ", Core.MethodInstance(itrig.node).def)
              end
1: __init(prob::Union{SciMLBase.AbstractDAEProblem, SciMLBase.AbstractODEProblem}, alg::Union{OrdinaryDiffEqAlgorithm, OrdinaryDiffEq.DAEAlgorithm}, timeseries_init, ts_init, ks_init, recompile::Type{Val{recompile_flag}}; saveat, tstops, d_discontinuities, save_idxs, save_everystep, save_on, save_start, save_end, callback, dense, calck, dt, dtmin, dtmax, force_dtmin, adaptive, gamma, abstol, reltol, qmin, qmax, qsteady_min, qsteady_max, beta1, beta2, qoldinit, controller, fullnormalize, failfactor, maxiters, internalnorm, internalopnorm, isoutofdomain, unstable_check, verbose, timeseries_errors, dense_errors, advance_to_tstop, stop_at_next_tstop, initialize_save, progress, progress_steps, progress_name, progress_message, userdata, allow_extrapolation, initialize_integrator, alias_u0, alias_du0, initializealg, kwargs...) where recompile_flag in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\solve.jl:9
2: var"#__init#472"(saveat, tstops, d_discontinuities, save_idxs, save_everystep, save_on, save_start, save_end, callback, dense, calck, dt, dtmin, dtmax, force_dtmin, adaptive, gamma, abstol, reltol, qmin, qmax, qsteady_min, qsteady_max, beta1, beta2, qoldinit, controller, fullnormalize, failfactor, maxiters, internalnorm, internalopnorm, 
isoutofdomain, unstable_check, verbose, timeseries_errors, dense_errors, advance_to_tstop, stop_at_next_tstop, initialize_save, progress, progress_steps, progress_name, progress_message, userdata, allow_extrapolation, initialize_integrator, alias_u0, alias_du0, initializealg, kwargs::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(SciMLBase.__init), prob::Union{SciMLBase.AbstractDAEProblem, SciMLBase.AbstractODEProblem}, alg::Union{OrdinaryDiffEqAlgorithm, OrdinaryDiffEq.DAEAlgorithm}, timeseries_init, ts_init, ks_init, recompile::Type{Val{recompile_flag}}) where recompile_flag in OrdinaryDiffEq at 
C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\solve.jl:9
3: percolate_up!(xs::AbstractArray, i::Integer, x, o::Base.Order.Ordering) in DataStructures at C:\Users\accou\.julia\packages\DataStructures\ixwFs\src\heaps\arrays_as_heaps.jl:36
4: alg_cache(alg::Tsit5, u, rate_prototype, ::Type{uEltypeNoUnits}, ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck, ::Val{true}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\caches\low_order_rk_caches.jl:347
5: initialize!(integrator, cache::OrdinaryDiffEq.Tsit5Cache) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\perform_step\low_order_rk_perform_step.jl:611
6: handle_dt!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\solve.jl:502
7: ode_determine_initdt(u0, t, tdir, dtmax, abstol, reltol, internalnorm, prob::SciMLBase.AbstractODEProblem{uType, tType, true}, integrator) where {tType, uType} in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\initdt.jl:1
8: solve!(integrator::OrdinaryDiffEq.ODEIntegrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\solve.jl:471
9: loopheader!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:4
10: fix_dt_at_bounds!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:341
11: perform_step!(integrator, cache::OrdinaryDiffEq.Tsit5Cache, repeat_step) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\perform_step\low_order_rk_perform_step.jl:627
12: _loopfooter!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:170
13: calc_dt_propose!(integrator, dtnew) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:328
14: _savevalues!(integrator, force_save, reduce_size) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:51      
15: apply_step!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:278
16: handle_tstop!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:355
17: _postamble!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:120
18: solution_endpoint_match_cur_integrator!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:136   

julia> itrig = itrigs[11]
Inference triggered to call OrdinaryDiffEq.perform_step!(::OrdinaryDiffEq.ODEIntegrator{Tsit5, true, Vector{Float64}, Nothing, Float64, SciMLBase.NullParameters, Float64, 
Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, 
Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}, ::OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, ::Bool) called from toplevel

julia> ascend(itrig)
ERROR: BoundsError: attempt to access 0-element Vector{Base.StackTraces.StackFrame} at index [0]
Stacktrace:
 [1] getindex
   @ .\array.jl:835 [inlined]
 [2] instance
   @ C:\Users\accou\.julia\dev\Cthulhu\src\backedges.jl:89 [inlined]
 [3] treelist!(parent::FoldingTrees.Node{Cthulhu.Data{Core.MethodInstance}}, io::IOBuffer, mi::InferenceTrigger, indent::String, visited::Base.IdSet{Core.MethodInstance})
   @ Cthulhu C:\Users\accou\.julia\dev\Cthulhu\src\backedges.jl:126
 [4] treelist(mi::InferenceTrigger)
   @ Cthulhu C:\Users\accou\.julia\dev\Cthulhu\src\backedges.jl:118
 [5] ascend(mi::InferenceTrigger; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Cthulhu C:\Users\accou\.julia\dev\Cthulhu\src\Cthulhu.jl:414
 [6] ascend(mi::InferenceTrigger)
   @ Cthulhu C:\Users\accou\.julia\dev\Cthulhu\src\Cthulhu.jl:414
 [7] top-level scope
   @ none:1

From the REPL:

julia> for (i, itrig) in enumerate(itrigs)
                         println(i, ": ", Core.MethodInstance(itrig.node).def)
                     end
1: solve(prob::SciMLBase.DEProblem, args...; sensealg, u0, p, kwargs...) in DiffEqBase at C:\Users\accou\.julia\packages\DiffEqBase\Z0E10\src\solve.jl:66
2: __init(prob::Union{SciMLBase.AbstractDAEProblem, SciMLBase.AbstractODEProblem}, alg::Union{OrdinaryDiffEqAlgorithm, OrdinaryDiffEq.DAEAlgorithm}, timeseries_init, ts_init, ks_init, recompile::Type{Val{recompile_flag}}; saveat, tstops, d_discontinuities, save_idxs, save_everystep, save_on, save_start, save_end, callback, dense, calck, dt, dtmin, dtmax, force_dtmin, adaptive, gamma, abstol, reltol, qmin, qmax, qsteady_min, qsteady_max, beta1, beta2, qoldinit, controller, fullnormalize, failfactor, maxiters, internalnorm, internalopnorm, isoutofdomain, unstable_check, verbose, timeseries_errors, dense_errors, advance_to_tstop, stop_at_next_tstop, initialize_save, progress, progress_steps, progress_name, progress_message, userdata, allow_extrapolation, initialize_integrator, alias_u0, alias_du0, initializealg, kwargs...) where recompile_flag in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\solve.jl:9
3: var"#__init#472"(saveat, tstops, d_discontinuities, save_idxs, save_everystep, save_on, save_start, save_end, callback, dense, calck, dt, dtmin, dtmax, force_dtmin, adaptive, gamma, abstol, reltol, qmin, qmax, qsteady_min, qsteady_max, beta1, beta2, qoldinit, controller, fullnormalize, failfactor, maxiters, internalnorm, internalopnorm, isoutofdomain, unstable_check, verbose, timeseries_errors, dense_errors, advance_to_tstop, stop_at_next_tstop, initialize_save, progress, progress_steps, progress_name, progress_message, userdata, allow_extrapolation, initialize_integrator, alias_u0, alias_du0, initializealg, kwargs::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(SciMLBase.__init), prob::Union{SciMLBase.AbstractDAEProblem, SciMLBase.AbstractODEProblem}, alg::Union{OrdinaryDiffEqAlgorithm, OrdinaryDiffEq.DAEAlgorithm}, timeseries_init, ts_init, ks_init, recompile::Type{Val{recompile_flag}}) where recompile_flag in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\solve.jl:9
4: percolate_up!(xs::AbstractArray, i::Integer, x, o::Base.Order.Ordering) in DataStructures at C:\Users\accou\.julia\packages\DataStructures\ixwFs\src\heaps\arrays_as_heaps.jl:36
5: alg_cache(alg::Tsit5, u, rate_prototype, ::Type{uEltypeNoUnits}, ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck, ::Val{true}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\caches\low_order_rk_caches.jl:347
6: initialize!(integrator, cache::OrdinaryDiffEq.Tsit5Cache) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\perform_step\low_order_rk_perform_step.jl:611
7: handle_dt!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\solve.jl:502
8: ode_determine_initdt(u0, t, tdir, dtmax, abstol, reltol, internalnorm, prob::SciMLBase.AbstractODEProblem{uType, tType, true}, integrator) where {tType, uType} in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\initdt.jl:1
9: solve!(integrator::OrdinaryDiffEq.ODEIntegrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\solve.jl:471
10: loopheader!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:4
11: fix_dt_at_bounds!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:341
12: perform_step!(integrator, cache::OrdinaryDiffEq.Tsit5Cache, repeat_step) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\perform_step\low_order_rk_perform_step.jl:627
13: _loopfooter!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:170
14: calc_dt_propose!(integrator, dtnew) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:328
15: _savevalues!(integrator, force_save, reduce_size) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:51
16: apply_step!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:278
17: handle_tstop!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:355
18: _postamble!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:120
19: solution_endpoint_match_cur_integrator!(integrator) in OrdinaryDiffEq at C:\Users\accou\.julia\packages\OrdinaryDiffEq\eA5tD\src\integrators\integrator_utils.jl:136

julia> itrig = itrigs[12]
Inference triggered to call OrdinaryDiffEq.perform_step!(::OrdinaryDiffEq.ODEIntegrator{Tsit5, true, Vector{Float64}, Nothing, Float64, SciMLBase.NullParameters, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}, ::OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, ::Bool) called from toplevel

julia> ascend(itrig)
ERROR: BoundsError: attempt to access 0-element Vector{Base.StackTraces.StackFrame} at index [0]
Stacktrace:
 [1] getindex
   @ .\array.jl:835 [inlined]
 [2] instance
   @ C:\Users\accou\.julia\dev\Cthulhu\src\backedges.jl:89 [inlined]
 [3] treelist!(parent::FoldingTrees.Node{Cthulhu.Data{Core.MethodInstance}}, io::IOBuffer, mi::InferenceTrigger, indent::String, visited::Base.IdSet{Core.MethodInstance})
   @ Cthulhu C:\Users\accou\.julia\dev\Cthulhu\src\backedges.jl:126
 [4] treelist(mi::InferenceTrigger)
   @ Cthulhu C:\Users\accou\.julia\dev\Cthulhu\src\backedges.jl:118
 [5] ascend(mi::InferenceTrigger; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Cthulhu C:\Users\accou\.julia\dev\Cthulhu\src\Cthulhu.jl:414
 [6] ascend(mi::InferenceTrigger)
   @ Cthulhu C:\Users\accou\.julia\dev\Cthulhu\src\Cthulhu.jl:414
 [7] top-level scope
   @ REPL[15]:1

And yes I am on 18e558f

@timholy
Copy link
Member Author

timholy commented Aug 1, 2021

I know where to fix it, but this is worth figuring out how you get an empty stacktrace. Can you do this:

julia> itrig.callerframes
2-element Vector{Base.StackTraces.StackFrame}:
 perform_step! at low_order_rk_perform_step.jl:628 [inlined]
 solve!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5, true, Vector{Float64}, Nothing, Float64, SciMLBase.NullParameters, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}) at solve.jl:478

and this

julia> stacktrace(itrig)
28-element Vector{Base.StackTraces.StackFrame}:
 exit_current_timer at typeinfer.jl:164 [inlined]
 typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState) at typeinfer.jl:206
 typeinf_ext(interp::Core.Compiler.NativeInterpreter, mi::Core.MethodInstance) at typeinfer.jl:908
 typeinf_ext_toplevel(interp::Core.Compiler.NativeInterpreter, linfo::Core.MethodInstance) at typeinfer.jl:941
 typeinf_ext_toplevel(mi::Core.MethodInstance, world::UInt64) at typeinfer.jl:937
 perform_step! at low_order_rk_perform_step.jl:628 [inlined]
 solve!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5, true, Vector{Float64}, Nothing, Float64, SciMLBase.NullParameters, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}) at solve.jl:478
 #__solve#471 at solve.jl:5 [inlined]
 __solve at solve.jl:4 [inlined]
 #solve_call#58 at solve.jl:61 [inlined]
 solve_call at solve.jl:48 [inlined]
 #solve_up#60 at solve.jl:85 [inlined]
 solve_up at solve.jl:78 [inlined]
 #solve#59 at solve.jl:73 [inlined]
 solve(prob::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, args::Tsit5) at solve.jl:68
 top-level scope at snoopi_deep.jl:53
 eval at boot.jl:373 [inlined]
 eval_user_input(ast::Any, backend::REPL.REPLBackend) at REPL.jl:150
 repl_backend_loop(backend::REPL.REPLBackend) at REPL.jl:241
 start_repl_backend(backend::REPL.REPLBackend, consumer::Any) at REPL.jl:226
 run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool) at REPL.jl:359
 run_repl(repl::REPL.AbstractREPL, consumer::Any) at REPL.jl:346
 (::Base.var"#919#921"{Bool, Bool, Bool})(REPL::Module) at client.jl:394
 #invokelatest#2 at essentials.jl:716 [inlined]
 invokelatest at essentials.jl:714 [inlined]
 run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool) at client.jl:379
 exec_options(opts::Base.JLOptions) at client.jl:309
 _start() at client.jl:495

If this doesn't reveal what's going on let's try the call, but see if that's revealing first.

@ChrisRackauckas
Copy link
Contributor

julia> itrig.callerframes
Base.StackTraces.StackFrame[]

julia> stacktrace(itrig)
5-element Vector{Base.StackTraces.StackFrame}:
 exit_current_timer at typeinfer.jl:164 [inlined]
 typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState) at typeinfer.jl:206
 typeinf_ext(interp::Core.Compiler.NativeInterpreter, mi::Core.MethodInstance) at typeinfer.jl:908
 typeinf_ext_toplevel(interp::Core.Compiler.NativeInterpreter, linfo::Core.MethodInstance) at typeinfer.jl:941
 typeinf_ext_toplevel(mi::Core.MethodInstance, world::UInt64) at typeinfer.jl:937

@timholy
Copy link
Member Author

timholy commented Aug 1, 2021

😮 That's quite a surprise. Is that true for all of them?

To explain, here's what happens:

So it's quite bizarre that this isn't what you'regetting a truncated version.

It may be informative to look at the stacktrace including the C frames:

julia> stacktrace(itrig.node.bt, true)
73-element Vector{Base.StackTraces.StackFrame}:
 exit_current_timer at typeinfer.jl:164 [inlined]
 typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState) at typeinfer.jl:206
 typeinf_ext(interp::Core.Compiler.NativeInterpreter, mi::Core.MethodInstance) at typeinfer.jl:908
 typeinf_ext_toplevel(interp::Core.Compiler.NativeInterpreter, linfo::Core.MethodInstance) at typeinfer.jl:941
 typeinf_ext_toplevel(mi::Core.MethodInstance, world::UInt64) at typeinfer.jl:937
 typeinf_ext_toplevel(mi::Core.MethodInstance, world::UInt64) at sys.so:?
 _jl_invoke at gf.c:2245 [inlined]
 jl_apply_generic at gf.c:2427
 jl_apply at julia.h:1787 [inlined]
 jl_type_infer at gf.c:295
 jl_generate_fptr at jitlayers.cpp:338
 jl_compile_method_internal at gf.c:1978
 jl_compile_method_internal at gf.c:2244 [inlined]
 _jl_invoke at gf.c:2237 [inlined]
 jl_invoke at gf.c:2252
 ip:0x7f6773662819
 ip:0x7f67736626bb
 perform_step! at low_order_rk_perform_step.jl:628 [inlined]
 solve!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5, true, Vector{Float64}, Nothing, Float64, SciMLBase.NullParameters, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}) at solve.jl:478
 solve!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5, true, Vector{Float64}, Nothing, Float64, SciMLBase.NullParameters, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(OrdinaryDiffEq.lorenz), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit})
 ip:0x7f6774c714f9
 ip:0x7f6774c7147e
 #__solve#471 at solve.jl:5 [inlined]
 __solve at solve.jl:4 [inlined]
 ⋮
 run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool) at REPL.jl:359
 run_repl(repl::REPL.AbstractREPL, consumer::Any) at REPL.jl:346
 _jl_invoke at gf.c:2245 [inlined]
 jl_apply_generic at gf.c:2427
 (::Base.var"#919#921"{Bool, Bool, Bool})(REPL::Module) at client.jl:394
 (::Base.var"#919#921"{Bool, Bool, Bool})(REPL::Module) at sys.so:?
 _jl_invoke at gf.c:2245 [inlined]
 jl_apply_generic at gf.c:2427
 jl_apply at julia.h:1787 [inlined]
 jl_f__call_latest at builtins.c:757
 #invokelatest#2 at essentials.jl:716 [inlined]
 invokelatest at essentials.jl:714 [inlined]
 run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool) at client.jl:379
 exec_options(opts::Base.JLOptions) at client.jl:309
 _start() at client.jl:495
 _start() at sys.so:?
 _jl_invoke at gf.c:2245 [inlined]
 jl_apply_generic at gf.c:2427
 jl_apply at julia.h:1787 [inlined]
 true_main at jlapi.c:559
 jl_repl_entrypoint at jlapi.c:701
 main at loader_exe.c:42
 __libc_start_main at libc.so.6:?
 _start at julia:?

@timholy
Copy link
Member Author

timholy commented Aug 1, 2021

Before I file a Julia issue, do you get the truncated stacktraces from this short example? (Fresh session, no dependencies other than SnoopCompile):

julia> using SnoopCompile

julia> f(x::Real) = sizeof(x)
f (generic function with 1 method)

julia> g(x) = f(Base.inferencebarrier(x))
g (generic function with 1 method)

julia> tinf = @snoopi_deep g(1)
InferenceTimingNode: 0.011309/0.011988 on Core.Compiler.Timings.ROOT() with 2 direct children

julia> itrigs = inference_triggers(tinf)
2-element Vector{InferenceTrigger}:
 Inference triggered to call g(::Int64) from eval (./boot.jl:373) inlined into REPL.eval_user_input(::Any, ::REPL.REPLBackend) (/home/tim/src/julia-master/usr/share/julia/stdlib/v1.8/REPL/src/REPL.jl:151)
 Inference triggered to call f(::Int64) from g (./REPL[3]:1) with specialization g(::Int64)

julia> stacktrace(itrigs[2])   # should include `g(x::Int64) at REPL[3]:1` if all is working

and also check stacktrace(itrigs[2].node.bt, true).

@ChrisRackauckas
Copy link
Contributor

Looks like I don't 😅

julia> using SnoopCompile

julia> f(x::Real) = sizeof(x)
f (generic function with 1 method)

julia> g(x) = f(Base.inferencebarrier(x))
g (generic function with 1 method)

julia> tinf = @snoopi_deep g(1)
InferenceTimingNode: 0.006272/0.006679 on Core.Compiler.Timings.ROOT() with 2 direct children

julia> itrigs = inference_triggers(tinf)
2-element Vector{InferenceTrigger}:
 Inference triggered to call g(::Int64) from eval (.\boot.jl:373) inlined into REPL.eval_user_input(::Any, ::REPL.REPLBackend) (C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\REPL\src\REPL.jl:150)
 Inference triggered to call f(::Int64) from g (.\REPL[3]:1) with specialization g(::Int64)

julia> stacktrace(itrigs[2])
19-element Vector{Base.StackTraces.StackFrame}:
 exit_current_timer at typeinfer.jl:164 [inlined]
 typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState) at typeinfer.jl:206
 typeinf_ext(interp::Core.Compiler.NativeInterpreter, mi::Core.MethodInstance) at typeinfer.jl:908
 typeinf_ext_toplevel(interp::Core.Compiler.NativeInterpreter, linfo::Core.MethodInstance) at typeinfer.jl:941
 typeinf_ext_toplevel(mi::Core.MethodInstance, world::UInt64) at typeinfer.jl:937
 g(x::Int64) at REPL[3]:1
 top-level scope at snoopi_deep.jl:53
 eval at boot.jl:373 [inlined]
 eval_user_input(ast::Any, backend::REPL.REPLBackend) at REPL.jl:150
 repl_backend_loop(backend::REPL.REPLBackend) at REPL.jl:241
 start_repl_backend(backend::REPL.REPLBackend, consumer::Any) at REPL.jl:226
 run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool) at REPL.jl:359
 run_repl(repl::REPL.AbstractREPL, consumer::Any) at REPL.jl:346
 (::Base.var"#919#921"{Bool, Bool, Bool})(REPL::Module) at client.jl:394
 #invokelatest#2 at essentials.jl:716 [inlined]
 invokelatest at essentials.jl:714 [inlined]
 run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool) at client.jl:379
 exec_options(opts::Base.JLOptions) at client.jl:309
 _start() at client.jl:495

julia> stacktrace(itrigs[2].node.bt, true)
51-element Vector{Base.StackTraces.StackFrame}:
 exit_current_timer at typeinfer.jl:164 [inlined]
 typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState) at typeinfer.jl:206
 typeinf_ext(interp::Core.Compiler.NativeInterpreter, mi::Core.MethodInstance) at typeinfer.jl:908
 typeinf_ext_toplevel(interp::Core.Compiler.NativeInterpreter, linfo::Core.MethodInstance) at typeinfer.jl:941
 typeinf_ext_toplevel(mi::Core.MethodInstance, world::UInt64) at typeinfer.jl:937
 typeinf_ext_toplevel(mi::Core.MethodInstance, world::UInt64) at sys.dll:?
 _jl_invoke at gf.c:2245 [inlined]
 jl_apply_generic at gf.c:2427 [inlined]
 jl_apply at julia.h:1787 [inlined]
 jl_type_infer at gf.c:295
 jl_generate_fptr at jitlayers.cpp:338
 jl_compile_method_internal at gf.c:1978
 jl_compile_method_internal at gf.c:1932 [inlined]
 
 #invokelatest#2 at essentials.jl:716 [inlined]
 invokelatest at essentials.jl:714 [inlined]
 run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool) at client.jl:379
 exec_options(opts::Base.JLOptions) at client.jl:309
 _start() at client.jl:495
 _start() at sys.dll:?
 jl_apply at julia.h:1787 [inlined]
 true_main at jlapi.c:559
 jl_repl_entrypoint at jlapi.c:701
 mainCRTStartup at loader_exe.c:42
 BaseThreadInitThunk at KERNEL32.DLL:?
 RtlUserThreadStart at ntdll.dll:?

@ChrisRackauckas
Copy link
Contributor

And Cthulhu is fine there:

julia> ascend(itrigs[2])
Choose a call for analysis (q to quit):
 >   f(::Int64)
       g(::Int64) at .\REPL[3]:1
         eval at .\boot.jl:373 => eval_user_input(::Any, ::REPL.REPLBackend) at C:\buildbot\worker\package_win64\build\u
           repl_backend_loop(::REPL.REPLBackend) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\R
             start_repl_backend(::REPL.REPLBackend, ::Any) at C:\buildbot\worker\package_win64\build\usr\share\julia\std
               #run_repl#47(::Bool, ::typeof(REPL.run_repl), ::REPL.AbstractREPL, ::Any) at C:\buildbot\worker\package_w
                 run_repl(::REPL.AbstractREPL, ::Any) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v
                   (::Base.var"#919#921"{Bool, Bool, Bool})(::Module) at .\client.jl:394
                     #invokelatest#2 at .\essentials.jl:716 => invokelatest at .\essentials.jl:714 => run_main_repl(::Bo
v                      exec_options(::Base.JLOptions) at .\client.jl:309

@timholy
Copy link
Member Author

timholy commented Aug 1, 2021

OMG that's funny. OK, so it's a bit more specific then. We'll have to post the full reproducer and see what can be made of it. You're OK with leaving those branches lying around for a little while?

@ChrisRackauckas
Copy link
Contributor

Yeah, I'll leave those branches up.

timholy added a commit that referenced this pull request Aug 1, 2021
timholy added a commit that referenced this pull request Aug 1, 2021
See discussion in #185

Co-authored-by: Chris Rackauckas <[email protected]>
timholy added a commit that referenced this pull request Aug 1, 2021
See discussion in #185

Co-authored-by: Chris Rackauckas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0-element Vector{Base.Stacktraces.StackFrame}
3 participants