FFTW.jl icon indicating copy to clipboard operation
FFTW.jl copied to clipboard

Inference failure in brfft on 0.7

Open ararslan opened this issue 6 years ago • 4 comments

From the Travis log (also seeing locally):

ERROR: LoadError: return type Array{Float64,2} does not match inferred return type Any
Stacktrace
 [1] macro expansion at /home/travis/.julia/v0.7/FFTW/test/runtests.jl:335 [inlined]
 [2] anonymous at ./<missing>:?
 [3] include_relative(::Module, ::String) at ./loading.jl:464
 [4] include(::Module, ::String) at ./sysimg.jl:14
 [5] process_options(::Base.JLOptions) at ./client.jl:315
 [6] _start() at ./client.jl:383
while loading /home/travis/.julia/v0.7/FFTW/test/runtests.jl, in expression starting on line 331

The line that's being hit is equivalent to @inferred brfft(randn(10), 18). Oddly enough, running that from the REPL works fine for me.

ararslan avatar Jul 18 '17 23:07 ararslan

My bad, I can reproduce this at the REPL; I had the trigger of the error wrong. The code is

@inferred brfft(randn(10, 12), 18)

It's the 2-dimensional input case that can't be inferred.

ararslan avatar Jul 19 '17 03:07 ararslan

Checking out aa/dft on AbstractFFTs, aa/ugh-oh-my-god on FFTW, current Julia master:

julia> using FFTW, AbstractFFTs, Base.Test

julia> x = randn(10, 12);

julia> @inferred brfft(x, 18);
ERROR: return type Array{Float64,2} does not match inferred return type Any
Stacktrace:
 [1] error(::String) at ./error.jl:28

julia> @inferred brfft(AbstractFFTs.complexfloat(x), 18);

The interesting thing about this is that brfft(x, d) calls brfft(complexfloat(x), d), and the latter is inferred correctly while the former is not.

ararslan avatar Jul 19 '17 04:07 ararslan

I've been talking with @JeffBezanson about this a bit but I'm having difficulty putting together a reduced reproducible case. Do you have any insight on this, @stevengj?

ararslan avatar Jul 20 '17 19:07 ararslan

I haven't been able to figure this out nor isolate it further, so if anyone could lend a hand or provide some insight, that would be very much appreciated.

ararslan avatar Jul 27 '17 21:07 ararslan