Skip to content

spurious dispatch report from @report_opt log(2.1) #334

@aviatesk

Description

@aviatesk

From the discourse post https://discourse.julialang.org/t/log-performance-regression-and-jet-failures/78146.

The minimum reproducer is:

julia> report_opt() do
           Val()
       end
═════ 1 possible error found ═════
┌ @ REPL[21]:2 Main.Val()
│┌ @ essentials.jl:714 %1()
││ runtime dispatch detected: %1::Type{Val{_A}} where _A()
│└─────────────────────

This Cthulhu view suggests that this issue is because JET still checks frames that are folded by the new concrete evaluation features:

julia> descend(; optimize=false) do
           Val()
       end
(::var"#15#16")() in Main at REPL[23]:2
Variables
  #self#::Core.Const(var"#15#16"())

│ ─ %-1  = invoke #15()::Core.Const(Val{:ϵ}())
    @ REPL[23]:2 within `#15`
1%1 = Main.Val()::Core.Const(Val{:ϵ}())
└──      return %1
Select a call to descend into or  to ascend. [q]uit. [b]ookmark.
Toggles: [o]ptimize, [w]arn, [h]ide type-stable statements, [d]ebuginfo, [r]emarks, [e]ffects, [i]nlining costs, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
Advanced: dump [P]arams cache.
 • %1  = < consteval > Val(::Core.Const())::Core.Const(Val{:ϵ}())
   
Val(x) in Base at essentials.jl:714
Variables
  #self#::Type{Val}
  x::Symbol

│ ─ %-1  = invoke Val(::Symbol)::Val
    @ essentials.jl:714 within `Val`
1%1 = Core.apply_type(Base.Val, x)::Type{Val{_A}} where _A
│   %2 = (%1)()::Val
└──      return %2
Select a call to descend into or  to ascend. [q]uit. [b]ookmark.
Toggles: [o]ptimize, [w]arn, [h]ide type-stable statements, [d]ebuginfo, [r]emarks, [e]ffects, [i]nlining costs, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
Advanced: dump [P]arams cache.
 • %2  = Val()::Val
   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions