You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the weirdest problem I have ever encountered in several years of using Julia and has taken me several hours to track down to debug and distill a minimal working example:
This came up in the context of an unregistered package of mine for working with strided array views (WIP, https://github.com/Jutho/Strided.jl), and only started to be a problem when I pulled the latest master today (I guess before I was working on master from a few days ago, at most two weeks or so).
module Strided
struct StridedView{T,N,A<:DenseArray{T}} <:DenseArray{T,N}
parent::A
size::NTuple{N,Int}
strides::NTuple{N,Int}endfunction Base.convert(T::Type{<:DenseArray}, a::StridedView)
end@generatedfunctiontest1(dims::NTuple{N,Int}) where {N}
loopvars = [gensym() for k =1:N]
return :()
endfunctiontest2()
endend
dims=(1,)
Strided.test1(dims) #-> code hangs
The hanging will stop under any of the following modifications:
remove function test2() end such that the generated function is the last in the module.
add @show "hi $N" as first line of test1, however
the "hi" is important, @show "$N" is not sufficient
the display output is important, t=@elapsed "$N" is not sufficient but @time "hi $N" is, in fact with @time the hi is not necessary
the macro is important, println("hi $N") is not sufficient
remove the definition of Base.convert
simplify the type definition of StridedView
The text was updated successfully, but these errors were encountered:
If I want to prepare a PR to fix this, should I just revert the change (code addition) of 80d8719 in inference.jl? Or is there another fix in the making, @JeffBezanson ?
This seems fixed on latest master, probably due to recent changes in inference.jl originating from #24362. So thanks @vtjnash for implicitly solving this issue as well.
This is the weirdest problem I have ever encountered in several years of using Julia and has taken me several hours to track down to debug and distill a minimal working example:
This came up in the context of an unregistered package of mine for working with strided array views (WIP, https://github.com/Jutho/Strided.jl), and only started to be a problem when I pulled the latest master today (I guess before I was working on master from a few days ago, at most two weeks or so).
The hanging will stop under any of the following modifications:
function test2() end
such that the generated function is the last in the module.@show "hi $N"
as first line oftest1
, however@show "$N"
is not sufficientt=@elapsed "$N"
is not sufficient but@time "hi $N"
is, in fact with@time
thehi
is not necessaryprintln("hi $N")
is not sufficientBase.convert
StridedView
The text was updated successfully, but these errors were encountered: