Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"check latitude of antimeridian crossing points" test failing on non-intel #173

Open
df7cb opened this issue Feb 10, 2025 · 1 comment
Open

Comments

@df7cb
Copy link

df7cb commented Feb 10, 2025

The "check latitude of antimeridian crossing points" test in h3_postgis/test/sql/postgis.sql is failing on all architectures except x68:

11:16:27 diff -U3 /tmp/autopkgtest.AAGzLw/tree/h3_postgis/test/expected/postgis.out /tmp/test-17/h3_postgis/test/results/postgis.out
11:16:27 --- /tmp/autopkgtest.AAGzLw/tree/h3_postgis/test/expected/postgis.out	2025-02-10 10:01:18.000000000 +0000
11:16:27 +++ /tmp/test-17/h3_postgis/test/results/postgis.out	2025-02-10 11:16:25.692876337 +0000
11:16:27 @@ -103,7 +103,7 @@
11:16:27      ) AS q1
11:16:27  ) AS q2
11:16:27  WHERE ABS(ABS(ST_X(p)) - 180) < :epsilon;
11:16:27 - t
11:16:27 + f

https://jengus.postgresql.org/job/h3-pg-binaries/20/

A common problem here is that x86 is still using i386's extended-precision 80-bit floating point arithmetic by default, so the results are more precise than they actually should be with 64-bit FP. This can be disabled by adding the -ffp-contract=off compiler flag. However, this doesn't work here (the test still passes on x86), possibly the same would have to be applied on the PostGIS side as well.

One fix might be to tweak the "epsilon" value used (but playing with it for a moment didn't work, I don't quite understand that test yet).

(I disabled that test for the Debian package build for now, so h3-pg is up-to-date on apt.postgresql.org and in Debian now.)

@zachasme
Copy link
Owner

I think lowering epsilon until the test pass is an acceptable solution. I didn't actually make that particular test, but I think the current value was chosen somewhat arbitrarily.

I would love to automate testing for this, but I don't believe I can choose architecture for GitHub runners. 🤔 I would be very grateful if you could help figure out many zeroes to remove such that the test pass on other architectures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants