Open maartenvd opened 2 years ago
So same error in both 1.6 and 1.7, but in 1.6 it's fatal and 1.7 manages to keep going?
no, on 1.6.3 it errors with the following stacktrace:
nested task error: TypeError: in AbstractTensorMap, in S, expected S<:ElementarySpace, got Type{TensorKit.HomSpace{GradedSpace{SU2Irrep, TensorKit.SortedVectorDict{SU2Irrep, Int64}}, ProductSpace{GradedSpace{SU2Irrep, TensorKit.SortedVectorDict{SU2Irrep, Int64}}, 2}, ProductSpace{GradedSpace{SU2Irrep, TensorKit.SortedVectorDict{SU2Irrep, Int64}}, 0}}}
Stacktrace:
[1] subst_trivial_bounds(atypes::Any)
@ Core.Compiler ./compiler/utilities.jl:157
[2] subst_trivial_bounds(atypes::Any)
@ Core.Compiler ./compiler/utilities.jl:159
[3] normalize_typevars(method::Method, atypes::Any, sparams::Core.SimpleVector)
@ Core.Compiler ./compiler/utilities.jl:167
[4] specialize_method(method::Method, atypes::Any, sparams::Core.SimpleVector, preexisting::Bool, compilesig::Bool)
@ Core.Compiler ./compiler/utilities.jl:179
[5] specialize_method
@ ./compiler/utilities.jl:178 [inlined]
[6] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:769
[7] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:490
[8] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
@ Core.Compiler ./compiler/abstractinterpretation.jl:143
[9] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1048
[10] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1071
[11] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1055
[12] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1182
[13] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1470
[14] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1534
[15] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:214
[16] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:209
[17] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:806
--- the last 11 lines are repeated 2 more times ---
[40] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:490
[41] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
@ Core.Compiler ./compiler/abstractinterpretation.jl:143
[42] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1048
[43] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1071
[44] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1055
[45] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1182
[46] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1455
[47] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1534
[48] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:214
[49] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:209
[50] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:806
[51] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:490
[52] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
@ Core.Compiler ./compiler/abstractinterpretation.jl:143
[53] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1048
[54] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1071
[55] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1055
[56] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1182
[57] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1470
--- the last 11 lines are repeated 1 more time ---
[69] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1534
[70] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:214
[71] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:209
[72] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:806
[73] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:490
[74] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
@ Core.Compiler ./compiler/abstractinterpretation.jl:143
[75] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1069
[76] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1055
[77] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1182
[78] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1470
--- the last 10 lines are repeated 1 more time ---
[89] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/abstractinterpretation.jl:1534
[90] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:214
[91] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
@ Core.Compiler ./compiler/typeinfer.jl:209
[92] typeinf
@ ./compiler/typeinfer.jl:8 [inlined]
[93] typeinf_type(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector)
@ Core.Compiler ./compiler/typeinfer.jl:914
[94] return_type(interp::Core.Compiler.NativeInterpreter, f::Any, t::Any)
@ Core.Compiler ./compiler/typeinfer.jl:963
[95] return_type(f::Any, t::Any, world::UInt64)
@ Core.Compiler ./compiler/typeinfer.jl:950
[96] return_type(f::Any, t::Any)
@ Core.Compiler ./compiler/typeinfer.jl:947
[97] eigsolve(f::Function, x₀::MPSKit.LeftGaugedQP{InfiniteMPS{TensorMap{GradedSpace{SU2Irrep, TensorKit.SortedVectorDict{SU2Irrep, Int64}}, 2, 1, SU2Irrep, TensorKit.SortedVectorDict{SU2Irrep, Matrix{ComplexF64}}, FusionTree{SU2Irrep, 2, 0, 1, Nothing}, FusionTree{SU2Irrep, 1, 0, 0, Nothing}}, TensorMap{GradedSpace{SU2Irrep, TensorKit.SortedVectorDict{SU2Irrep, Int64}}, 1, 1, SU2Irrep, TensorKit.SortedVectorDict{SU2Irrep, Matrix{ComplexF64}}, FusionTree{SU2Irrep, 1, 0, 0, Nothing}, FusionTree{SU2Irrep, 1, 0, 0, Nothing}}}, TensorKit.AdjointTensorMap{GradedSpace{SU2Irrep, TensorKit.SortedVectorDict{SU2Irrep, Int64}}, 2, 1, SU2Irrep, TensorKit.SortedVectorDict{SU2Irrep, Matrix{ComplexF64}}, FusionTree{SU2Irrep, 2, 0, 1, Nothing}, FusionTree{SU2Irrep, 1, 0, 0, Nothing}}, TensorMap{GradedSpace{SU2Irrep, TensorKit.SortedVectorDict{SU2Irrep, Int64}}, 1, 2, SU2Irrep, TensorKit.SortedVectorDict{SU2Irrep, Matrix{ComplexF64}}, FusionTree{SU2Irrep, 1, 0, 0, Nothing}, FusionTree{SU2Irrep, 2, 0, 1, Nothing}}}, howmany::Int64, which::Symbol; kwargs::Base.Iterators.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:tol, :krylovdim), Tuple{Float64, Int64}}})
@ KrylovKit ~/KrylovKit.jl/src/eigsolve/eigsolve.jl:152
[98] excitations(H::Any, alg::QuasiparticleAnsatz, V₀::Union{MPSKit.LeftGaugedQP{S, T1, T2}, MPSKit.RightGaugedQP{S, T1, T2}} where {T1, T2, S<:InfiniteMPS}, lenvs::Any, renvs::Any; num::Any, solver::Any)
@ MPSKit ~/MPSKit.jl/src/algorithms/excitation/quasiparticleexcitation.jl:44
[99] excitations(H::Any, alg::QuasiparticleAnsatz, p::Real, lmps::InfiniteMPS, lenvs::Any, rmps::InfiniteMPS, renvs::Any; sector::Any, num::Any, solver::Any)
@ MPSKit ~/MPSKit.jl/src/algorithms/excitation/quasiparticleexcitation.jl:83
[100] macro expansion
@ ~/momentumwindow_chenanigans/properscatter2/main.jl:35 [inlined]
@maartenvd do you think your error is related to #43357?
In reply #5 at stack-overflow-in-type-inference-julia-1-9-0-dev I put some code called toverflow5.jl
that gets errors similar to above when run in 1.7.2 julia, running for about 12 minutes and printing probably between half a million and a million error messages before producing expected output. [Actually, less than 115000 error messages. See Stack overflow in type inference… julia 1.9.0-DEV #45286 for marginally smaller program.] When run in Julia Version 1.9.0-DEV.485 it gives half a dozen "Internal error: stack overflow in type inference of ..." errors and otherwise expected output, taking ca. 10 seconds. The one-character-different toverflow3.jl
runs ok in 1.7.2 and 1.9.0-DEV, taking about 2 seconds each time. [The different character is > vs <, in an if
statement that uses one long printfmt
argument list in the error case, and two printfmt
s in the non-error case, producing the same output either way.]
An inference stackoverflow encountered rather deep in some code, so it's hard to provide a minimal example (I can post the full code if necessary, but it's really quite large). This same code errors on 1.6.x, but luckily keeps running on v1.7.0 rc2. There are a number of similar issues, but I didn't find the exact same one.
versioninfo
stacktrace