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

MethodError: no method matching ⊑(::Core.Compiler.JLTypeLattice, ::Core.Compiler.MustAlias, ::Type{Array}) #589

Closed
Jutho opened this issue Jan 5, 2024 · 2 comments

Comments

@Jutho
Copy link

Jutho commented Jan 5, 2024

I wanted to use JET.report_package on my TensorKit.jl package, and got the following error:

[toplevel-info] analyzing from top-level definitions (121/1609)ERROR: MethodError: no method matching (::Core.Compiler.JLTypeLattice, ::Core.Compiler.MustAlias, ::Type{Array})

Closest candidates are:
  (::Core.Compiler.ConstsLattice, ::Any, ::Any)
   @ Core compiler/typelattice.jl:511
  (::Core.Compiler.JLTypeLattice, ::Type, ::Type)
   @ Core compiler/abstractlattice.jl:151
  (::Core.Compiler.PartialsLattice, ::Any, ::Any)
   @ Core compiler/typelattice.jl:448
  ...

Stacktrace:
   [1] (lattice::Core.Compiler.ConstsLattice, a::Any, b::Any)
     @ Core.Compiler ./compiler/typelattice.jl:530
   [2] (lattice::Core.Compiler.PartialsLattice{Core.Compiler.ConstsLattice}, a::Any, b::Any)
     @ Core.Compiler ./compiler/typelattice.jl:508
   [3] 
     @ Core.Compiler ./compiler/typelattice.jl:432 [inlined]
   [4] (lattice::Core.Compiler.InferenceLattice{Core.Compiler.ConditionalsLattice{Core.Compiler.PartialsLattice{Core.Compiler.ConstsLattice}}}, a::Any, b::Any)
     @ Core.Compiler ./compiler/typelattice.jl:397
   [5] 
     @ Core.Compiler ./compiler/abstractlattice.jl:296 [inlined]
   [6] array_builtin_common_typecheck(boundscheck::Any, arytype::Any, argtypes::Vector{Any}, first_idx_idx::Int64)
     @ Core.Compiler ./compiler/tfuncs.jl:2061
   [7] array_builtin_common_nothrow(argtypes::Vector{Any}, isarrayref::Bool)
     @ Core.Compiler ./compiler/tfuncs.jl:2042
   [8] _builtin_nothrow(𝕃::Core.Compiler.InferenceLattice{JET.IntrinsicErrorCheckLattice{Core.Compiler.MustAliasesLattice{…}}}, f::Any, argtypes::Vector{Any}, rt::Any)
     @ Core.Compiler ./compiler/tfuncs.jl:2087
   [9] builtin_nothrow
     @ Core.Compiler ./compiler/tfuncs.jl:2420 [inlined]
  [10] builtin_effects(𝕃::Core.Compiler.InferenceLattice{JET.IntrinsicErrorCheckLattice{Core.Compiler.MustAliasesLattice{…}}}, f::Core.Builtin, arginfo::Core.Compiler.ArgInfo, rt::Any)
     @ Core.Compiler ./compiler/tfuncs.jl:2405
  [11] abstract_call_known(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2011
  [12] abstract_call_known(analyzer::JET.JETAnalyzer{…}, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:57
  [13] abstract_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2165
  [14] abstract_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2158
  [15] abstract_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2350
  [16] abstract_eval_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2366
  [17] abstract_eval_statement_expr(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2376
  [18] abstract_eval_statement(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2620
  [19] abstract_eval_statement(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:608
  [20] abstract_eval_basic_statement(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2909
  [21] abstract_eval_basic_statement(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/analyzers/jetanalyzer.jl:376
  [22] typeinf_local(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:3094
  [23] typeinf_nocycle(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:3182
  [24] _typeinf(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:453
  [25] typeinf(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:219
  [26] typeinf(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:349
  [27] typeinf_edge(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:930
  [28] typeinf_edge
     @ ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:168 [inlined]
  [29] abstract_call_method(interp::JET.JETAnalyzer{…}, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:629
  [30] abstract_call_method
     @ ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:19 [inlined]
  [31] abstract_call_gf_by_type(interp::JET.JETAnalyzer{…}, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:95
  [32] abstract_call_gf_by_type(analyzer::JET.JETAnalyzer{…}, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ JET ~/.julia/packages/JET/Vt1dl/src/analyzers/jetanalyzer.jl:225
  [33] abstract_call_known(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2083
--- the last 22 lines are repeated 1 more time ---
  [56] abstract_call_known(analyzer::JET.JETAnalyzer{…}, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:57
  [57] abstract_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2165
  [58] abstract_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2158
  [59] abstract_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2350
  [60] abstract_eval_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2366
  [61] abstract_eval_statement_expr(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2376
  [62] abstract_eval_statement(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2620
  [63] abstract_eval_statement(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:608
  [64] abstract_eval_basic_statement(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2885
  [65] abstract_eval_basic_statement(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/analyzers/jetanalyzer.jl:376
  [66] typeinf_local(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:3094
  [67] typeinf_nocycle(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:3182
  [68] _typeinf(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:453
  [69] typeinf(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:219
  [70] typeinf(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:349
  [71] typeinf_edge(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:930
  [72] typeinf_edge
     @ ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:168 [inlined]
  [73] abstract_call_method(interp::JET.JETAnalyzer{…}, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:629
  [74] abstract_call_method
     @ ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:19 [inlined]
  [75] abstract_call_gf_by_type(interp::JET.JETAnalyzer{…}, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:95
  [76] abstract_call_gf_by_type(analyzer::JET.JETAnalyzer{…}, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ JET ~/.julia/packages/JET/Vt1dl/src/analyzers/jetanalyzer.jl:225
  [77] abstract_call_known(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2083
  [78] abstract_call_known(analyzer::JET.JETAnalyzer{…}, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:57
  [79] abstract_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2165
  [80] abstract_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2158
  [81] abstract_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2350
  [82] abstract_eval_call(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2366
  [83] abstract_eval_statement_expr(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2376
  [84] abstract_eval_statement(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2620
  [85] abstract_eval_statement(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:608
  [86] abstract_eval_basic_statement(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:2909
--- the last 22 lines are repeated 1 more time ---
 [109] abstract_eval_basic_statement(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/analyzers/jetanalyzer.jl:376
 [110] typeinf_local(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:3094
 [111] typeinf_nocycle(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:3182
 [112] _typeinf(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:453
 [113] typeinf(interp::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:219
 [114] typeinf(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, frame::Core.Compiler.InferenceState)
     @ JET ~/.julia/packages/JET/Vt1dl/src/abstractinterpret/typeinfer.jl:349
 [115] analyze_frame!
     @ ~/.julia/packages/JET/Vt1dl/src/JET.jl:691 [inlined]
 [116] analyze_method_instance!(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, mi::Core.MethodInstance)
     @ JET ~/.julia/packages/JET/Vt1dl/src/JET.jl:674
 [117] analyze_method_signature!(analyzer::JET.JETAnalyzer{JET.DefinitionAnalysisPass}, m::Method, atype::Any, sparams::Core.SimpleVector)
     @ JET ~/.julia/packages/JET/Vt1dl/src/JET.jl:664
 [118] analyze_from_definitions!(analyzer::JET.JETAnalyzer{JET.BasicPass}, res::JET.VirtualProcessResult, config::JET.ToplevelConfig)
     @ JET ~/.julia/packages/JET/Vt1dl/src/toplevel/virtualprocess.jl:545
 [119] virtual_process(x::String, filename::String, analyzer::JET.JETAnalyzer{JET.BasicPass}, config::JET.ToplevelConfig)
     @ JET ~/.julia/packages/JET/Vt1dl/src/toplevel/virtualprocess.jl:452
 [120] #analyze_and_report_text!#131
     @ JET ~/.julia/packages/JET/Vt1dl/src/JET.jl:905 [inlined]
 [121] analyze_and_report_file!(analyzer::JET.JETAnalyzer{…}, filename::String, pkgid::Base.PkgId; jetconfigs::@Kwargs{})
     @ JET ~/.julia/packages/JET/Vt1dl/src/JET.jl:713
 [122] analyze_and_report_package!(analyzer::JET.JETAnalyzer{JET.BasicPass}, package::Module; jetconfigs::@Kwargs{ignore_missing_comparison::Bool})
     @ JET ~/.julia/packages/JET/Vt1dl/src/JET.jl:863
 [123] analyze_and_report_package!
     @ ~/.julia/packages/JET/Vt1dl/src/JET.jl:856 [inlined]
 [124] report_package(args::Module; ignore_missing_comparison::Bool, jetconfigs::@Kwargs{})
     @ JET ~/.julia/packages/JET/Vt1dl/src/analyzers/jetanalyzer.jl:1659
 [125] report_package(args::Module)
     @ JET ~/.julia/packages/JET/Vt1dl/src/analyzers/jetanalyzer.jl:1656
Some type information was truncated. Use `show(err)` to see complete types.
aviatesk added a commit to JuliaLang/julia that referenced this issue Jan 6, 2024
We would probably need to backport similar changes to 1.10 too.

xref: aviatesk/JET.jl#589
@aviatesk
Copy link
Owner

aviatesk commented Jan 6, 2024

Thanks for your report. Unfortunately, this issue requires a fix on Julia base side, meaning it will be fixed on the next patch version (xref: JuliaLang/julia#52774, and JuliaLang/julia#52773 for v1.11).

aviatesk added a commit to JuliaLang/julia that referenced this issue Jan 6, 2024
We would probably need to backport similar changes to 1.10 too.

xref: aviatesk/JET.jl#589
aviatesk added a commit to JuliaLang/julia that referenced this issue Jan 7, 2024
We would probably need to backport similar changes to 1.10 too.

xref: aviatesk/JET.jl#589
@aviatesk
Copy link
Owner

aviatesk commented Jan 7, 2024

The PRs were merged. This issue will be fixed in the next patch/minor release of Julia.

@aviatesk aviatesk closed this as completed Jan 7, 2024
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

No branches or pull requests

2 participants