Hi Aaron,

Yes. Attached is a patch that just skip the two tests.

The issue here is that when running fftw_execute on an input vector full
of 0, the output vector contains some -0 on powerpc, instead of all 0
other architectures.

When computing the phase using atan2(im, re), the result is no more all
0, but can also be -0, pi, or -pi, as described in atan2f(3).

If I remember correctly, this is due to a powerpc specific optimization
in fftw3, (not a bug, a feature).

Attached is a patch that fixes the build by checking the phases are one
of those 4 values, and marking the unit test as skipped.

I will upload 0.4.3-2 tomorrow evening, with a few other minor changes.

Thanks,
Paul

On 11/06/2016 11:57 PM, Aaron M. Ucko wrote:
> Source: aubio
> Version: 0.4.1-2.2
> Severity: serious
> Justification: fails to build from source (but built successfully in the past)
> 
> Builds of aubio for ppc64el and the non-release architectures powerpc
> and ppc64 all failed; see below for an excerpt from the ppc64el log at
> https://buildd.debian.org/status/fetch.php?pkg=aubio&arch=ppc64el&ver=0.4.3-1&stamp=1478460825
> Could you please take a look?
> 
> Thanks!
> 
>   ======================================================================
>   FAIL: test_zeros (test_phasevoc.aubio_pvoc_test_case)
>   check the resynthesis of zeros gives zeros
>   ----------------------------------------------------------------------
>   Traceback (most recent call last):
>     File "/«PKGBUILDDIR»/python/tests/test_phasevoc.py", line 49, in 
> test_zeros
>       assert_equal ( s.phas, 0.)
>     File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 322, 
> in assert_equal
>       return assert_array_equal(actual, desired, err_msg, verbose)
>     File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 813, 
> in assert_array_equal
>       verbose=verbose, header='Arrays are not equal')
>     File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 739, 
> in assert_array_compare
>       raise AssertionError(msg)
>   AssertionError: 
>   Arrays are not equal
>   
>   (mismatch 34.6978557505%)
>    x: array([ 0.      ,  0.      ,  0.      ,  0.      ,  0.      ,  0.      ,
>           0.      ,  0.      ,  0.      ,  0.      ,  0.      ,  0.      ,
>           0.      ,  0.      ,  0.      ,  0.      , -0.      ,  0.      ,...
>    y: array(0.0)
>   
>   ======================================================================
>   FAIL: test_zeros (test_fft.aubio_fft_test_case)
>   check the transform of zeros is all zeros
>   ----------------------------------------------------------------------
>   Traceback (most recent call last):
>     File "/«PKGBUILDDIR»/python/tests/test_fft.py", line 36, in test_zeros
>       assert_equal ( fftgrain.phas, 0 )
>     File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 322, 
> in assert_equal
>       return assert_array_equal(actual, desired, err_msg, verbose)
>     File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 813, 
> in assert_array_equal
>       verbose=verbose, header='Arrays are not equal')
>     File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 739, 
> in assert_array_compare
>       raise AssertionError(msg)
>   AssertionError: 
>   Arrays are not equal
>   
>   (mismatch 31.5175097276%)
>    x: array([ 0.      ,  0.      ,  0.      ,  0.      ,  0.      ,  0.      ,
>           0.      ,  0.      ,  0.      ,  0.      ,  0.      ,  0.      ,
>           0.      ,  0.      ,  0.      ,  0.      , -0.      ,  0.      ,...
>    y: array(0)
>   
>   ----------------------------------------------------------------------
>   Ran 745 tests in 12.995s
>   
>   FAILED (failures=2, skipped=4)
> 
diff --git a/python/tests/test_fft.py b/python/tests/test_fft.py
index fa349e5..a8f82b9 100755
--- a/python/tests/test_fft.py
+++ b/python/tests/test_fft.py
@@ -33,7 +33,14 @@ class aubio_fft_test_case(TestCase):
         f = fft (win_s)
         fftgrain = f (timegrain)
         assert_equal ( fftgrain.norm, 0 )
-        assert_equal ( fftgrain.phas, 0 )
+        try:
+            assert_equal ( fftgrain.phas, 0 )
+        except AssertionError:
+            assert_equal (fftgrain.phas[fftgrain.phas > 0], +pi)
+            assert_equal (fftgrain.phas[fftgrain.phas < 0], -pi)
+            assert_equal (np.abs(fftgrain.phas[np.abs(fftgrain.phas) != pi]), 0)
+            self.skipTest('fft(fvec(%d)).phas != +0, ' % win_s \
+                    + 'This is expected when using fftw3 on powerpc.')
 
     def test_impulse(self):
         """ check the transform of one impulse at a random place """
diff --git a/python/tests/test_phasevoc.py b/python/tests/test_phasevoc.py
index 23cbad5..957d3b1 100755
--- a/python/tests/test_phasevoc.py
+++ b/python/tests/test_phasevoc.py
@@ -46,7 +46,14 @@ class aubio_pvoc_test_case(TestCase):
             r = f.rdo(s)
             assert_equal ( t, 0.)
             assert_equal ( s.norm, 0.)
-            assert_equal ( s.phas, 0.)
+            try:
+                assert_equal ( s.phas, 0 )
+            except AssertionError:
+                assert_equal (s.phas[s.phas > 0], +np.pi)
+                assert_equal (s.phas[s.phas < 0], -np.pi)
+                assert_equal (np.abs(s.phas[np.abs(s.phas) != np.pi]), 0)
+                self.skipTest('pvoc(fvec(%d)).phas != +0, ' % win_s \
+                        + 'This is expected when using fftw3 on powerpc.')
             assert_equal ( r, 0.)
 
     @params(

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to