Bug#1086188: nickle: please make the build reproducible
Chris Lamb
lamby at debian.org
Mon Oct 28 17:01:06 GMT 2024
Source: nickle
Version: 2.97
Severity: wishlist
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org
Hi Keith,
Whilst working on the Reproducible Builds effort, we noticed that
nickle could not be built reproducibly.
Looks like an interesting one in usr/share/nickle/test/math-tables.5c
@@ -1218,15 +1218,15 @@
{ .angle = π * -1.91999999999999993, .sin = 0.24868988716485535, .cos = 0.96858316112863097 },
{ .angle = -1.90999999999999992, .sin = -0.94301993129001060, .cos = -0.33273624568084514 },
{ .angle = π * -1.90999999999999992, .sin = 0.27899110603922966, .cos = 0.96029368567694295 },
{ .angle = -1.89999999999999991, .sin = -0.94630008768741447, .cos = -0.32328956686350335 },
- { .angle = π * -1.89999999999999991, .sin = 0.30901699437494767, .cos = 0.95105651629515353 },
+ { .angle = π * -1.89999999999999991, .sin = 0.30901699437494762, .cos = 0.95105651629515353 },
{ .angle = -1.88999999999999990, .sin = -0.94948561486463046, .cos = -0.31381055935888225 },
---------------------------------------> ^
this
column
... plus similar changes in the same file. Here is the code in
question:
#define FMT "%25.17f"
double
print_val(double x)
{
if (isnan(x))
return 10000;
if (x > 1e10)
return 9999;
if (x < -1e10)
return 9999;
if (fabs(x) < 1e-20)
return 0;
return x;
}
[…]
for (a = -800; a <= 800; a += 1) {
double a_f = a / 100;
printf ("\t{ .angle = " FMT ", .sin = " FMT ", .cos = " FMT " },\n",
a_f, print_val(sin(a_f)), print_val(cos(a_f)));
printf ("\t{ .angle = π * " FMT ", .sin = " FMT ", .cos = " FMT " },\n",
a_f, print_val(sin(M_PI * a_f)), print_val(cos(M_PI * a_f)));
}
It's easier to see in HTML format:
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/nickle.html
This is a native build on amd64/x86_64 both runs, and yet I can't
reproduce it locally. I thought the point of IEEE 754 or whatever it
was was to ensure this sort of thing didn't happen across runs? :)
Hope you can help.
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
More information about the Reproducible-bugs
mailing list