unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Diego Nicola Barbato <dnbarbato@posteo.de>
To: Leo Famulari <leo@famulari.name>
Cc: 40406@debbugs.gnu.org
Subject: bug#40406: python-matplotlib fails to build on i686-linux
Date: Tue, 02 Jun 2020 18:18:28 +0200	[thread overview]
Message-ID: <878sh5a1bf.fsf@GlaDOS.home> (raw)
In-Reply-To: <20200403161802.GA3560@jasmine.lan> (Leo Famulari's message of "Fri, 3 Apr 2020 12:18:02 -0400")

Hi,

Leo Famulari <leo@famulari.name> writes:

> 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 ...

--8<---------------cut here---------------start------------->8---
guix build --no-grafts -s i686-linux --keep-failed python-matplotlib
--8<---------------cut here---------------end--------------->8---

... and running python inside of it.

--8<---------------cut here---------------start------------->8---
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
--8<---------------cut here---------------end--------------->8---

I retraced the steps of the failing test ...

--8<---------------cut here---------------start------------->8---
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])
--8<---------------cut here---------------end--------------->8---

... and was able to reproduce the failing assertion ...

--8<---------------cut here---------------start------------->8---
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.      ])
--8<---------------cut here---------------end--------------->8---

... , 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.

--8<---------------cut here---------------start------------->8---
guix environment --ad-hoc python python-matplotlib -- python3
--8<---------------cut here---------------end--------------->8---

A closer look at the intermediate results ...

--8<---------------cut here---------------start------------->8---
print(slider.poly.get_extents().bounds,
      ax.transAxes.get_matrix(),
      ax.transAxes.inverted().get_matrix(),
      box.bounds,
      sep='\n')
--8<---------------cut here---------------end--------------->8---

... 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 ...

--8<---------------cut here---------------start------------->8---
(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)
--8<---------------cut here---------------end--------------->8---

... and on x86_64-linux.

--8<---------------cut here---------------start------------->8---
(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)
--8<---------------cut here---------------end--------------->8---

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
this as a separate bug (https://debbugs.gnu.org/41665).

> 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




  reply	other threads:[~2020-06-02 16:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 15:20 bug#40406: python-matplotlib fails to build on i686-linux Diego Nicola Barbato
2020-04-03 16:18 ` Leo Famulari
2020-06-02 16:18   ` Diego Nicola Barbato [this message]
2020-06-02 17:39     ` Leo Famulari
2020-06-08 14:22     ` Diego Nicola Barbato
2020-11-15  3:14       ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878sh5a1bf.fsf@GlaDOS.home \
    --to=dnbarbato@posteo.de \
    --cc=40406@debbugs.gnu.org \
    --cc=leo@famulari.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).