AudioTaperPotTest.ScaleTest fails, but values are equal

Bug #1810495 reported by David Runge on 2019-01-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
High
Daniel Schürmann

Bug Description

Hi!

During building of the package for Arch Linux of mixxx 2.2.0, I have one failing test:

```
[----------] 1 test from AudioTaperPotTest
[ RUN ] AudioTaperPotTest.ScaleTest
Loading resources from "/build/mixxx/src/mixxx-2.2.0/res/"
src/test/audiotaperpot_test.cpp:23: Failure
Value of: catpb.parameterToValue(1)
  Actual: 1.99526
Expected: db2ratio(maxDB)
Which is: 1.99526
[ FAILED ] AudioTaperPotTest.ScaleTest (0 ms)
[----------] 1 test from AudioTaperPotTest (0 ms total)
```

It's a bit puzzling, as the values seem equal.
The full test log can be found in attachment and the PKGBUILD can be found here (might only be showing the 2.2.0 build in a couple of hours, as I'm on the road right now): https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/mixxx

Packages are built using a pristine systemd-nspawn container on each iteration and currently I'm building on a Lenovo W540 (which has a Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz - that's a Haswell), in case that's of interest to you.

David Runge (dvzrv) wrote :
Daniel Schürmann (daschuer) wrote :

I think we need to replace ASSERT_EQ by ASSERT_DOUBLE_EQ in line 23

Changed in mixxx:
status: New → Confirmed
importance: Undecided → High
milestone: none → 2.1.7
tags: added: easy
Changed in mixxx:
assignee: nobody → Daniel Schürmann (daschuer)
status: Confirmed → In Progress
Daniel Schürmann (daschuer) wrote :

A PR is here:
https://github.com/mixxxdj/mixxx/pull/1979

Can you confirm that this fixes your issue?

David Runge (dvzrv) wrote :

@daschuer, thanks for the quick reply.
Unfortunately, even after applying the patch the same error was triggered for me :-/

Daniel Schürmann (daschuer) wrote :

Ok, so we need a wider ellipsis.
I will change the code to something like
abbs(a-b) < 0.00001
It it would be interesting how big the difference is though.

Daniel Schürmann (daschuer) wrote :

I have update the PR for
ASSERT_NEAR((db2ratio(maxDB), catpb.parameterToValue(1), 1e-10);

Please check.

Thank you.

David Runge (dvzrv) wrote :

Will do!
You have introduced a leading '(' in that commit btw.

David Runge (dvzrv) wrote :

After removing the superfluous '(' from the commit, I still get this:

```
[----------] 1 test from AudioTaperPotTest
[ RUN ] AudioTaperPotTest.ScaleTest
Loading resources from "/build/mixxx/src/mixxx-2.2.0/res/"
src/test/audiotaperpot_test.cpp:44: Failure
Value of: catpb.parameterToValue(1)
  Actual: 1.99526
Expected: db2ratio(maxDB)
Which is: 1.99526
[ FAILED ] AudioTaperPotTest.ScaleTest (1 ms)
[----------] 1 test from AudioTaperPotTest (1 ms total)
```

Daniel Schürmann (daschuer) wrote :

please change it to:
ASSERT_EQ(db2ratio(maxDB) - catpb.parameterToValue(1), 0);

and post the output.

It looks like the compiler optimizes some fractional places away. Maybe we suffer a float precision overflow. Which compiler version do you use?
Do we have a bug? Normally ASSERT_DOUBLE_EQ should work. mmm

David Runge (dvzrv) wrote :

Alright, here it is:

```
[----------] 1 test from AudioTaperPotTest
[ RUN ] AudioTaperPotTest.ScaleTest
Loading resources from "/build/mixxx/src/mixxx-2.2.0/res/"
src/test/audiotaperpot_test.cpp:23: Failure
Value of: 0
Expected: db2ratio(maxDB) - catpb.parameterToValue(1)
Which is: -2.22045e-16
[ FAILED ] AudioTaperPotTest.ScaleTest (0 ms)
[----------] 1 test from AudioTaperPotTest (0 ms total)
```

On Arch Linux we're currently at gcc 8.2.1 (should've mentioned that earlier, sorry).

Daniel Schürmann (daschuer) wrote :

Thank you.
It is strange because abs(-2.22045e-16) is smaller than 1e-10.

IMHO this should work:
ASSERT_NEAR((db2ratio(maxDB), catpb.parameterToValue(1), 1e-10);

Do you have an idea what went wrong?

Ferran Pujol (ferranpujol) wrote :

I can't reproduce the original failing test on Ubuntu 18.10.
I built with the same settings and gcc 8.2.0

Daniel Schürmann (daschuer) wrote :

I cannot confirm this either so lets wait until one can confirm the issue.

Daniel Schürmann (daschuer) wrote :

Thank you for your tests.

Daniel Schürmann (daschuer) wrote :

@dvzrv: did you have more test results for us? See #11.

Changed in mixxx:
milestone: 2.1.7 → 2.2.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments