Open nsajko opened 1 week ago
Julia Version 1.12.0-DEV.766
Commit 9d8ecaa899d (2024-06-21 17:00 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 8 × AMD Ryzen 3 5300U with Radeon Graphics
WORD_SIZE: 64
LLVM: libLLVM-17.0.6 (ORCJIT, znver2)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Taking effectively unbounded time on badly designed code patterns is not a bug, unless you can show it is generating an ever growing list of candidates
Looks like a tmerge / lattice convergence issue with the constant Conditional (t isa Tuple resolves to Core.Compiler.Conditional(slot=2, thentype=Tuple{Vararg{Int64}}, elsetype=Union{})
which is a refinement of Const(true)
) interacting badly with the recursion call
MWE
julia> function tail_is_ntuple((@nospecialize t::Tuple))
if unknown
t isa Tuple
else
tail_is_ntuple(t) # alternatively `Base.tail(t)` here
end
end;
julia> Base.return_types(tail_is_ntuple, Tuple{Tuple{Vararg{Int}}}) # hangs
(tested to be last-working in v1.9)
Not a regression. Reproducer:
Output when interrupted:
Alternatively, may also be reproduced with
Core.Compiler.return_type(HeterogeneousLists.from_tuple, Tuple{Tuple{Vararg{Int}}})
: