Skip to content

Type inference: Encountered unexpected error in runtime #59004

@kalmarek

Description

@kalmarek

Package SymbolicWedderburn.jl compiles and runs fine on julia-1.11, fails with the recent julia-12-rc1:

This is the stacktrace:

nested task error: StackOverflowError:
    
    caused by: MethodError: no method matching (::Compiler.JLTypeLattice, ::Compiler.LimitedAccuracy, ::Compiler.LimitedAccuracy)
    The function `` exists, but no method is defined for this combination of argument types.
    
    Closest candidates are:
      (::Compiler.ConstsLattice, ::Any, ::Any)
       @ Base /opt/hostedtoolcache/julia/1.12.0-rc1/x64/share/julia/Compiler/src/typelattice.jl:497
      (::Compiler.InferenceLattice, ::Any, ::Any)
       @ Base /opt/hostedtoolcache/julia/1.12.0-rc1/x64/share/julia/Compiler/src/typelattice.jl:364
      (::Compiler.PartialsLattice, ::Any, ::Any)
       @ Base /opt/hostedtoolcache/julia/1.12.0-rc1/x64/share/julia/Compiler/src/typelattice.jl:423
      ...
    
    Stacktrace:
      [1] 
        @ ./../usr/share/julia/Compiler/src/typelattice.jl:516 [inlined]
      [2] (lattice::Compiler.PartialsLattice{Compiler.ConstsLattice}, a::Any, b::Any)
        @ Compiler ./../usr/share/julia/Compiler/src/typelattice.jl:494
      [3] (lattice::Compiler.ConditionalsLattice{Compiler.PartialsLattice{Compiler.ConstsLattice}}, a::Any, b::Any)
        @ Compiler ./../usr/share/julia/Compiler/src/typelattice.jl:407
      [4] _issubconditional(𝕃::Compiler.ConditionalsLattice{Compiler.PartialsLattice{Compiler.ConstsLattice}}, a::Compiler.Conditional, b::Compiler.Conditional, check_isdefined::Bool)
        @ Compiler ./../usr/share/julia/Compiler/src/typelattice.jl:257
      [5] issubconditional(𝕃::Compiler.ConditionalsLattice{Compiler.PartialsLattice{Compiler.ConstsLattice}}, a::Compiler.Conditional, b::Compiler.Conditional)
        @ Compiler ./../usr/share/julia/Compiler/src/typelattice.jl:251
      [6] 
        @ ./../usr/share/julia/Compiler/src/typelattice.jl:392 [inlined]
      [7] is_lattice_equal(lattice::Compiler.ConditionalsLattice{Compiler.PartialsLattice{Compiler.ConstsLattice}}, a::Any, b::Any)
        @ Compiler ./../usr/share/julia/Compiler/src/typelattice.jl:535
      [8] is_lattice_equal
        @ ./../usr/share/julia/Compiler/src/typelattice.jl:528 [inlined]
      [9] record_ssa_assign!(𝕃ᵢ::Compiler.InferenceLattice{Compiler.ConditionalsLattice{Compiler.PartialsLattice{Compiler.ConstsLattice}}}, ssa_id::Int64, new::Any, frame::Compiler.InferenceState)
        @ Compiler ./../usr/share/julia/Compiler/src/inferencestate.jl:792
     [10] typeinf_local(interp::Compiler.NativeInterpreter, frame::Compiler.InferenceState, nextresult::Compiler.CurrentState)
        @ Compiler ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:4325
     [11] typeinf(interp::Compiler.NativeInterpreter, frame::Compiler.InferenceState)
        @ Compiler ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:4443
     [12] typeinf_ext(interp::Compiler.NativeInterpreter, mi::Core.MethodInstance, source_mode::UInt8)
        @ Compiler ./../usr/share/julia/Compiler/src/typeinfer.jl:1259
     [13] typeinf_ext_toplevel
        @ ./../usr/share/julia/Compiler/src/typeinfer.jl:1442 [inlined]
     [14] typeinf_ext_toplevel(mi::Core.MethodInstance, world::UInt64, source_mode::UInt8, trim_mode::UInt8)
        @ Compiler ./../usr/share/julia/Compiler/src/typeinfer.jl:1451

Stacktrace:
  [1] threading_run(fun::SymbolicWedderburn.Characters.var"#complex_character_table##2#complex_character_table##3"{SymbolicWedderburn.Characters.var"#complex_character_table##4#complex_character_table##5"{SymbolicWedderburn.Characters.CharacterTable{PermutationGroups.PermGroup{PermutationGroups.Perm{UInt16}, PermutationGroups.Transversal{UInt16, PermutationGroups.Perm{UInt16}}}, SymbolicWedderburn.Characters.FiniteFields.GF{7}, PermutationGroups.Orbit{PermutationGroups.Permutation{PermutationGroups.Perm{UInt16}, PermutationGroups.PermGroup{PermutationGroups.Perm{UInt16}, PermutationGroups.Transversal{UInt16, PermutationGroups.Perm{UInt16}}}}}}, Vector{Cyclotomics.Cyclotomic{Int64, SparseArrays.SparseVector{Int64, Int64}}}, Matrix{Cyclotomics.Cyclotomic{Rational{Int64}, SparseArrays.SparseVector{Rational{Int64}, Int64}}}, Int64, Array{Int64, 3}, UnitRange{Int64}}}, static::Bool)
    @ Base.Threads ./threadingconstructs.jl:196
  [2] macro expansion
    @ ./threadingconstructs.jl:213 [inlined]
  [3] complex_character_table(R::Type{Rational{Int64}}, tblFp::SymbolicWedderburn.Characters.CharacterTable{PermutationGroups.PermGroup{PermutationGroups.Perm{UInt16}, PermutationGroups.Transversal{UInt16, PermutationGroups.Perm{UInt16}}}, SymbolicWedderburn.Characters.FiniteFields.GF{7}, PermutationGroups.Orbit{PermutationGroups.Permutation{PermutationGroups.Perm{UInt16}, PermutationGroups.PermGroup{PermutationGroups.Perm{UInt16}, PermutationGroups.Transversal{UInt16, PermutationGroups.Perm{UInt16}}}}}})
    @ SymbolicWedderburn.Characters ~/work/SymbolicWedderburn.jl/SymbolicWedderburn.jl/src/Characters/character_tables.jl:115

On the top of the message there's something like this:

Failed to precompile SymbolicWedderburn [858aa9a9-4c7c-4c62-b466-2421203962a2] to "/home/runner/.julia/compiled/v1.12/SymbolicWedderburn/jl_hxIlLb".
Internal error: during type inference of
(::Base.Threads.var"#threading_run##0#threading_run##1"{SymbolicWedderburn.Characters.var"#complex_character_table##2#complex_character_table##3"{SymbolicWedderburn.Characters.var"#complex_character_table##4#complex_character_table##5"{SymbolicWedderburn.Characters.CharacterTable{PermutationGroups.PermGroup{PermutationGroups.Perm{UInt16}, PermutationGroups.Transversal{UInt16, PermutationGroups.Perm{UInt16}}}, SymbolicWedderburn.Characters.FiniteFields.GF{7}, PermutationGroups.Orbit{PermutationGroups.Permutation{PermutationGroups.Perm{UInt16}, PermutationGroups.PermGroup{PermutationGroups.Perm{UInt16}, PermutationGroups.Transversal{UInt16, PermutationGroups.Perm{UInt16}}}}}}, Array{Cyclotomics.Cyclotomic{Int64, SparseArrays.SparseVector{Int64, Int64}}, 1}, Array{Cyclotomics.Cyclotomic{Base.Rational{Int64}, SparseArrays.SparseVector{Base.Rational{Int64}, Int64}}, 2}, Int64, Array{Int64, 3}, Base.UnitRange{Int64}}}, Int64})()
Encountered unexpected error in runtime:
MethodError(f=Base.Compiler.:(⊑), args=(Base.Compiler.JLTypeLattice(), Base.Compiler.LimitedAccuracy(typ=String, causes=Base.IdSet{Base.Compiler.InferenceState}(list=Memory{Any}(4, 0x7fe47927f4a0)[
  Base.Compiler.InferenceState(linfo=mapfoldl_impl(typeof(Base.identity), typeof(Base.add_sum), Base._InitialValue, Base.Generator{Base.UnitRange{Int64}, SymbolicWedderburn.Characters.var"#complex_character_table##6#complex_character_table##7"{Int64, Int64, Array{Cyclotomics.Cyclotomic{Int64, SparseArrays.SparseVector{Int64, Int64}}, 1}, Array{Int64, 3}}}) from mapfoldl_impl(F, OP, Any, Any) where {F, OP}, world=Base.Compiler.WorldWithRange(this=0x00000000000099e3, valid_worlds=Base.Compiler.WorldRange(min_world=0x00000000000031f8, max_world=0x00000000000099e3)), mod=Base, sptypes=Array{Base.Compiler.VarState, 1}(dims=(2,), mem=Memory{Base.Compiler.VarState}(2, 0x7fe4791edc60)[Base.Compiler.VarState(typ=Core.Const(val=typeof(Base.identity)), undef=false), Base.Compiler.VarState(typ=Core.Const(val=typeof(Base.add_sum)), undef=false)]), slottypes=Array{Any, 1}(dims=(8,), mem=Memory{Any}(8, 0x7fe4733604a0)[
  Core.Const(val=Base.mapfoldl_impl),
  Core.Const(val=Base.identity),
  Core.Const(val=Base.add_sum),
  Core.Const(val=Base._InitialValue()),
  Base.Generator{Base.UnitRange{Int64}, SymbolicWedderburn.Characters.var"#complex_character_table##6#complex_character_table##7"{Int64, Int64, Array{Cyclotomics.Cyclotomic{Int64, SparseArrays.SparseVector{Int64, Int64}}, 1}, Array{Int64, 3}}},
  Union{},
  Union{},
  Union{}]), src=Core.CodeInfo(code=Array{Any, 1}(dims=(17,), mem=Memory{Any}(17, 0x7fe4731c5f60)[
  Base._xfadjoint,
  Base.BottomRF,
  Expr(:call, SSAValue(2), Core.SlotNumber(id=3)),
  Base.Generator,
  Expr(:call, SSAValue(4), Core.SlotNumber(id=2), Core.SlotNumber(id=5)),
  Expr(:call, SSAValue(1), SSAValue(3), SSAValue(5)),
  Expr(:call, Base.indexed_iterate, SSAValue(6), 1),
  Core.SlotNumber(id=8) = Expr(:call, Core.getfield, SSAValue(7), 1),
  Core.SlotNumber(id=6) = Expr(:call, Core.getfield, SSAValue(7), 2),
  Core.SlotNumber(id=6),
  Expr(:call, Base.indexed_iterate, SSAValue(6), 2, SSAValue(10)),
  Core.SlotNumber(id=7) = Expr(:call, Core.getfield, SSAValue(11), 1),
  Base.foldl_impl,
  Core.SlotNumber(id=8),
  Core.SlotNumber(id=7),
  Expr(:call, SSAValue(13), SSAValue(14), Core.SlotNumber(id=4), SSAValue(15)),
  Core.ReturnNode(val=SSAValue(16))]), debuginfo=Core.DebugInfo(def=:var"reduce.jl", linetable=nothing, edges=svec(), codelocs="#\

[...]

The full log (6000 lines of it) can be accessed here:

https://github.com/kalmarek/SymbolicWedderburn.jl/actions/runs/16273785801/job/45947677912

raw form:

https://productionresultssa15.blob.core.windows.net/actions-results/977ec0f4-8b8b-4472-9a62-5f7db7447c00/workflow-job-run-e0373416-944d-5021-bdab-4048550d4599/logs/job/job-logs.txt?rsct=text%2Fplain&se=2025-07-15T09%3A47%3A36Z&sig=VFAcPWoSYjhvEvOFYzq5UdHcBTWWjetFqIZxkEf4wrA%3D&ske=2025-07-15T18%3A36%3A28Z&skoid=ca7593d4-ee42-46cd-af88-8b886a2f84eb&sks=b&skt=2025-07-15T06%3A36%3A28Z&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skv=2025-05-05&sp=r&spr=https&sr=b&st=2025-07-15T09%3A37%3A31Z&sv=2025-05-05

Originally reported in kalmarek/SymbolicWedderburn.jl#94

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inference

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions