JuliaDebug / JuliaDebug/Cthulhu.jl
MethodInstance not found
Open
@aviatesk is already working on this.
Since Dec 5, 2021.
bug
- Dominant language
- Julia
- Stars
- 709
- Forks
- 46
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 2
Description
To reproduce checkout https://github.com/simeonschaub/SchurPolynomials.jl/tree/sds/invoke and run the following:
julia> using SchurPolynomials, Transducers, Cthulhu
julia> using AbstractAlgebra: Partition
julia> SSYT = SchurPolynomials.SemiStandardYoungTableaux(6, Partition([3, 2, 1]));
julia> @descend SchurPolynomials._worker!(1, Transducers.BottomRF(Transducers.SideEffect(identity)), nothing, SSYT)
_worker!(i, rf::RF, acc, ssyt) where RF in SchurPolynomials at /home/simeon/Documents/MIT/18.338/Project/SchurPolynomials/src/SchurPolynomials.jl:56
[...]
Press enter a bunch of times until the IR for the function _row! is shown and then select the second of the two invoke statements to _row! again below:
[...]
%22 = invoke next(::BottomRF{…},::Nothing,::Nothing)::AbstractAlgebra.Generic.YoungTableau{Int64}
%57 = invoke throw_boundserror(::SubArray{Int64, 1, Vector{Int64}, Tuple{UnitRange{Int64}}, true},::Tuple{Int64})::Union{}
%121 = invoke throw_boundserror(::SubArray{Int64, 1, Vector{Int64}, Tuple{UnitRange{Int64}}, true},::Tuple{Int64})::Union{}
%168 = invoke _row!(::Int64,::Int64,::SubArray{…},::Array{…},::Int64,::BottomRF{…},::Nothing)::Any
• %173 = invoke _row!(::Int64,::Int64,::SubArray{…},::Array{…},::Int64,::BottomRF{…},::YoungTableau{…})::Any
↩
ERROR: KeyError: key MethodInstance for SchurPolynomials._row!(::Int64, ::Int64, ::SubArray{Int64, 1, Vector{Int64}, Tuple{UnitRange{Int64}}, true}, ::Vector{SubArray{Int64, 1, Vector{Int64}, Tuple{UnitRange{Int64}}, true}}, ::Int64, ::Transducers.BottomRF{Completing{SchurPolynomials.var"#3#4"{Int64, Transducers.BottomRF{Transducers.SideEffect{typeof(identity)}}, SchurPolynomials.SemiStandardYoungTableaux}}}, ::AbstractAlgebra.Generic.YoungTableau{Int64}) not found
Stacktrace:
[1] getindex(h::Dict{Core.MethodInstance, Core.CodeInstance}, key::Core.MethodInstance)
@ Base ./dict.jl:498
[2] _descend(term::REPL.Terminals.TTYTerminal, interp::Cthulhu.CthulhuInterpreter, mi::Core.MethodInstance; override::Nothing, debuginfo::Cthulhu.DInfo.DebugInfo, optimize::Bool, interruptexc::Bool, iswarn::Bool, hide_type_stable::Bool, verbose::Nothing, remarks::Bool, inline_cost::Bool, type_annotations::Bool)
@ Cthulhu ~/.julia/dev/Cthulhu/src/Cthulhu.jl:249
[3] _descend(term::REPL.Terminals.TTYTerminal, interp::Cthulhu.CthulhuInterpreter, mi::Core.MethodInstance; override::Nothing, debuginfo::Cthulhu.DInfo.DebugInfo, optimize::Bool, interruptexc::Bool, iswarn::Bool, hide_type_stable::Bool, verbose::Nothing, remarks::Bool, inline_cost::Bool, type_annotations::Bool) (repeats 15 times)
@ Cthulhu ~/.julia/dev/Cthulhu/src/Cthulhu.jl:379
[4] _descend(::REPL.Terminals.TTYTerminal, ::Any, ::Vararg{Any}; interp::Core.Compiler.NativeInterpreter, kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:iswarn,), Tuple{Bool}}})
@ Cthulhu ~/.julia/dev/Cthulhu/src/Cthulhu.jl:496
[5] _descend_with_error_handling(::Any, ::Vararg{Any}; terminal::Any, kwargs::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
@ Cthulhu ~/.julia/dev/Cthulhu/src/Cthulhu.jl:148
[6] descend_code_typed(f::Function, tt::Any; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Cthulhu ~/.julia/dev/Cthulhu/src/Cthulhu.jl:120
[7] descend_code_typed(f::Function, tt::Any)
@ Cthulhu ~/.julia/dev/Cthulhu/src/Cthulhu.jl:120
[8] top-level scope
@ REPL[4]:1
So it seems that Cthulhu is somehow not handling the union split input types together with the widened return type due to bounded recursion correctly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.