Skip to content

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

@df7cb

Description

@df7cb

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions