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

Pkg.test("DSP") Fails #30

Closed
rickhg12hs opened this issue May 20, 2014 · 8 comments · Fixed by #48
Closed

Pkg.test("DSP") Fails #30

rickhg12hs opened this issue May 20, 2014 · 8 comments · Fixed by #48
Labels

Comments

@rickhg12hs
Copy link

$ ./julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.0-prerelease+3121 (2014-05-19 22:16 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit e1468d5* (0 days old master)
|__/                   |  i686-redhat-linux

julia> versioninfo()
Julia Version 0.3.0-prerelease+3121
Commit e1468d5* (2014-05-19 22:16 UTC)
Platform Info:
  System: Linux (i686-redhat-linux)
  CPU: Genuine Intel(R) CPU           T2250  @ 1.73GHz
  WORD_SIZE: 32
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm

julia> Pkg.installed("DSP")
v"0.0.2"

julia> Pkg.test("DSP")
INFO: Testing DSP
ERROR: assertion failed: |complex128(sort(f1.p,lt=lt)) - complex128(sort(f2.p,lt=lt))| <= 2.220446049250313e-16
  complex128(sort(f1.p,lt=lt)) = Complex{Float64}[-7.450580541412677e-9 + 0.0im,7.45058065243498e-9 + 0.0im]
  complex128(sort(f2.p,lt=lt)) = Complex{Float64}[0.0 + 0.0im,0.0 + 0.0im]
  difference = 7.45058065243498e-9 > 2.220446049250313e-16
 in error at error.jl:22
 in test_approx_eq at test.jl:109
 in zpkfilter_eq at /home/rick/.julia/v0.3/DSP/test/filter_design.jl:28
 in anonymous at no file:224
 in include_from_node1 at loading.jl:128
while loading /home/rick/.julia/v0.3/DSP/test/filter_design.jl, in expression starting on line 218
while loading /home/rick/.julia/v0.3/DSP/test/runtests.jl, in expression starting on line 3

=================================[ ERROR: DSP ]=================================

failed process: Process(`/usr/local/src/julia/julia/usr/bin/julia /home/rick/.julia/v0.3/DSP/test/runtests.jl`, ProcessExited(1)) [1]

================================================================================
INFO: No packages to install, update or remove
ERROR: DSP had test errors
 in error at error.jl:21
 in test at pkg/entry.jl:705
 in anonymous at pkg/dir.jl:28
 in cd at file.jl:20
 in cd at pkg/dir.jl:28
 in test at pkg.jl:67

julia> 
@jfsantos
Copy link
Member

@simonster, this looks similar to something that happened before when comparing the difference between polynomial coefficients, could you check it?

@jfsantos jfsantos added the bug label May 20, 2014
@simonster
Copy link
Member

I can't reproduce this on my system. I suspect it has something to do with 32 vs. 64-bit, but I don't have a 32-bit system to test on.

@jfsantos
Copy link
Member

Tests also pass for me on Julia compiled for OS X 64 bits. I'll try setting up a 32 bit Linux VM later to take a look into it.

EDIT: tested under Ubuntu 14.04 32 bits and confirmed the regression. Error report is a bit confuse but if we suppose that "anonymous" actually refers to filterdesign.jl, the error happened in the filter conversion tests.

@simonster
Copy link
Member

Not sure if this is the cause, but JuliaMath/openlibm#57 suggests that sin and cos are broken on at least some 32-bit Linux systems.

@jfsantos
Copy link
Member

jfsantos commented Jun 5, 2014

I'll try to recompile Julia using the system's libm in my Ubuntu VM later today to check this out, thanks!

@jfsantos
Copy link
Member

jfsantos commented Jun 6, 2014

I'm afraid that's not the case; results are the same both for openlibm and system's libm in Ubuntu 14.04 32 bits.

@jfsantos
Copy link
Member

Investigating this issue further, I have found that the problem lies in a call to roots(Poly([1,8.0,15.999999999999996])) while converting the bandpass filter from TFFilter to ZPKFilter. On 64 bits, the results are two roots at -4.0, but on 32 bits there's one root at -3.9999999403953552 and another at -4.000000059604645.

This is the kind of problem that's reported in this discussion: https://groups.google.com/d/msg/julia-users/Jy8v6qCXdkY/-2sCpcYo33sJ (however, in our case we have a much simpler polynomial!). I tested Polynomials.jl and it gives the right results for our test case. Since it seems Polynomials will become the "official" package, we should update our code to use it, as it is already in METADATA. We'll have to invert the order of the coefficients in all calls, but that's not a big deal.

@simonster
Copy link
Member

Thanks for figuring this out. I've opened a (WIP) PR to switch to Polynomials in #48.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants