Open vext01 opened 7 months ago
Hmm. Looks like big time problem with float rounding. Not much of a problem for 99% of the Prolog code, but correct rounding is needed for e.g., the clpBNR package. Could be compiler flags. I think gcc has a flag to choose between fast and correct floats. You may have a look at that. Another source of problems are broken libm implementations, but it seems this also involves things where libm is not used.
And yes, for ssl, please raise an issue or send a PR. Thanks!
gcc
amd64 uses clang by default. I've just checked and it's:
penBSD clang version 16.0.6
Target: amd64-unknown-openbsd7.5
Thread model: posix
InstalledDir: /usr/bin
Here's a build log. Do you see any suspicious flags in the invocations on the files that'd matter for those test failures? https://theunixzoo.co.uk/random/swipl-log.txt
I notice:
-- llround(nextoward(0.5),-10) == 1 (broken)
Is that relevant?
amd64 uses clang by default
That is bad luck. SWI-Prolog's performance using GCC is quite a bit better on x64 (~30%)
It doesn't use any interesting flags.
Is that relevant?
Looks like a symptom. There is a work-around in the code for particular bugs in nexttoward(), but apparently not the one in OpenBSD. Seems there is something big scale wrong with IEEE float rounding. Unfortunately it is an area that is often not taken serious as very few applications rely on it. That also applies to Prolog applications; very few are affected by this not working.
The best way out is probably to concentrate on one failing test, turn it into a small C program that reproduces the issue and raise it upstream. That shouldn't be too hard. All the arithmetic is in src/pl-arith.c
.
Is the previous OpenBSD port so old that it predates SWI-Prolog's IEEE float support?
Hi there,
I've just encountered these test failures when updating the OpenBSD package to version 9.2.3:
This was on amd64.
(I also have some patches for the SSL module (to make it work with a recent LibreSSL), which I can share if you are interested)
Thanks