Hi,
Leo Famulari <leo@famulari.name> writes:
Toggle quote (4 lines)
> On Fri, Apr 03, 2020 at 05:20:08PM +0200, Diego Nicola Barbato wrote:
>> The package python-matplotlib fails to build during the check phase on
>> i686-linux. The test failure appears to be deterministic:
I've taken a closer look at the failing test (on x86_64-linux, commit:
ebbf915) by keeping the build tree ...
Toggle snippet (3 lines)
guix build --no-grafts -s i686-linux --keep-failed python-matplotlib
... and running python inside of it.
Toggle snippet (6 lines)
cd /tmp/guix-build-python-matplotlib-3.1.2.drv-0/matplotlib-3.1.2/
. ../environment-variables
export PYTHONPATH="${PYTHONPATH}:build/lib.linux-i686-3.8"
python3
I retraced the steps of the failing test ...
Toggle snippet (10 lines)
import matplotlib.pyplot as plt
import matplotlib.widgets as widgets
from numpy.testing import assert_allclose
fig, ax = plt.subplots()
slider = widgets.Slider(ax=ax, label='', valmin=0, valmax=24, valinit=12, orientation='horizontal')
slider.set_val(10)
box = slider.poly.get_extents().transformed(ax.transAxes.inverted())
assert_allclose(box.bounds, [0, 0, 10/24, 1])
... and was able to reproduce the failing assertion ...
Toggle snippet (10 lines)
AssertionError:
Not equal to tolerance rtol=1e-07, atol=0
Mismatch: 25%
Max absolute difference: 1.11022302e-16
Max relative difference: 2.66453526e-16
x: array([ 0.000000e+00, -1.046255e-17, 4.166667e-01, 1.000000e+00])
y: array([0. , 0. , 0.416667, 1. ])
... , although the differing value wasn't exactly the same as the one
reported by the test. As expected, the assertion did not fail when I
followed the same steps on x86_64.
Toggle snippet (3 lines)
guix environment --ad-hoc python python-matplotlib -- python3
A closer look at the intermediate results ...
Toggle snippet (7 lines)
print(slider.poly.get_extents().bounds,
ax.transAxes.get_matrix(),
ax.transAxes.inverted().get_matrix(),
box.bounds,
sep='\n')
... revealed that only the values of box.bounds differ. The dimensions
of the slider are the same (as are the values of the transformation
matrices) on i686-linux ...
Toggle snippet (10 lines)
(80.0, 52.8, 206.66666666666663, 369.59999999999997)
[[496. 0. 80. ]
[ 0. 369.6 52.8]
[ 0. 0. 1. ]]
[[ 0.00201613 0. -0.16129032]
[ 0. 0.00270563 -0.14285714]
[ 0. 0. 1. ]]
(0.0, -1.0462550964485118e-17, 0.4166666666666666, 1.0)
Toggle snippet (10 lines)
(80.0, 52.8, 206.66666666666663, 369.59999999999997)
[[496. 0. 80. ]
[ 0. 369.6 52.8]
[ 0. 0. 1. ]]
[[ 0.00201613 0. -0.16129032]
[ 0. 0.00270563 -0.14285714]
[ 0. 0. 1. ]]
(0.0, 0.0, 0.41666666666666663, 1.0000000000000002)
Apparently there is nothing wrong with the slider. Instead matrix
multiplication, which is used under the hood for transformations, seems
to sometimes produce incorrect results on i686-linux. I have reported
Toggle quote (3 lines)
> I wonder if this scientific computing stuff should be tried on i686 at
> all. Should we limit it to contemporary architectures?
I was opposed to this at first (after all, if upstream supports Numpy on
i686, why shouldn't we?), but after seeing that even simple things like
matrix multiplication can produce incorrect results I'm in favour of
limiting it to contemporary architectures. What do others think?
Regards,
Diego