[ https://issues.apache.org/jira/browse/LUCENE-9139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17017853#comment-17017853 ]
Adrien Grand commented on LUCENE-9139: -------------------------------------- The subtraction by-ay is indeed not accurate already in spite of the promotion from floats to doubles since their exponents differ by more than the number of mantissa bits of a double. And things might get worse with the multiplications. I wonder if your proposal would actually address the problem though, the problem is not that much the absolute values of the coordinates, but rather their relative values. For instance I believe you could have the same issue if we had some coordinates that are close but not equal to zero? I haven't looked at the test, but how does it know that these lines don't intersect, is it using better logic? > TestXYMultiPolygonShapeQueries test failures > -------------------------------------------- > > Key: LUCENE-9139 > URL: https://issues.apache.org/jira/browse/LUCENE-9139 > Project: Lucene - Core > Issue Type: Test > Reporter: Ignacio Vera > Priority: Major > > We recently have two failures on CI from the test method > TestXYMultiPolygonShapeQueries. The reproduction lines are: > > {code:java} > ant test -Dtestcase=TestXYMultiPolygonShapeQueries > -Dtests.method=testRandomMedium -Dtests.seed=F1E142C2FBB612AF > -Dtests.multiplier=3 -Dtests.slow=true -Dtests.badapples=true > -Dtests.locale=el -Dtests.timezone=EST5EDT -Dtests.asserts=true > -Dtests.file.encoding=US-ASCII{code} > {code:java} > ant test -Dtestcase=TestXYMultiPolygonShapeQueries > -Dtests.method=testRandomMedium -Dtests.seed=363603A0428EC788 > -Dtests.multiplier=3 -Dtests.slow=true -Dtests.badapples=true > -Dtests.locale=sv-SE -Dtests.timezone=America/Yakutat -Dtests.asserts=true > -Dtests.file.encoding=UTF-8{code} > > I dug into the failures and there seem to be due to numerical errors in the > GeoUtils.orient method. The method is detecting intersections of two very > long lines when it shouldn't. For example: > Line 1: > {code:java} > double ax = 3.314395000050712E38; > double ay = -1.4151510014141656E37; > double bx = 3.4028234663852886E38; > double by = 9.641030236797581E20;{code} > Line 2: > {code:java} > double cx = 3.4028234663852886E38; > double cy = -0.0; > double dx = 3.4028234663852886E38; > double dy = -2.7386422951137726E38;{code} > My proposal to prevent those numerical errors is to modify the shape > generator to prevent creating shapes that expands more than half the float > space. > > > > -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org