Subject: bug#52001: numpy CPU dispatch probably prevents builds of python-numpy from being reproducible

From: Ludovic Courtès <[email-masked]>
Date: Fri, 10 Dec 2021 23:42:41 +0100

Hi,

Ricardo Wurmus <[email-masked]> skribis:

> Numpy accelerates operations with native code.  Early in the build it
> probes the CPU / compiler for supported instruction extensions and
> then proceeds to build extensions for different features.  I’m
> guessing that this won’t work when building on older CPUs, so the 
> results of two builds on different CPUs may differ.

I don’t see anything in the build log that suggests it might be building
for a specific ISA extension (on x86_64).

On the contrary, it seems to do the right thing by dispatching to the
right optimized implementation at run time, in numpy/core/src/umath.
Apparently this directory contains templates for home-made function
multi-versioning, with variants and dispatch code generated by
numpy/core/code_generators/generate_umath.py.

Besides, I see the same .pyc difference as Maxime, but I don’t think it
relates to ISA extensions.

Ludo’.