dblock edited a comment on pull request #711: URL: https://github.com/apache/lucene/pull/711#issuecomment-1057078347
I think we have a case of floating point here. If you change `getMinCompetitiveScore` to take a `double` or `minScoreSum`, it becomes easy to reproduce. It also almost always starts tripping `testNClausesRandomScore` and often `test2ClausesRandomScore`. ```java private float getMinCompetitiveScore(double minScoreSum, double sumOfOtherMaxScores) ``` ```java public void testGetMinCompetitiveScore() throws Exception { List<FakeScorer> scorers = new ArrayList<>(); scorers.add(new FakeScorer(0.39404958f)); scorers.add(new FakeScorer(0.0028006434f)); scorers.add(new FakeScorer(0.24155897f)); float minScoreSum = 2.7810444831848145f; MaxScoreSumPropagator p = new MaxScoreSumPropagator(scorers); p.setMinCompetitiveScore(minScoreSum); } ``` ``` org.apache.lucene.search.TestMaxScoreSumPropagator > testGetMinCompetitiveScore STANDARD_ERROR minScoreSum=2.7810442447662354, sumOfOtherMaxScores=0.24435961246490479 minScoreSum=2.7810442447662354, sumOfOtherMaxScores=0.39685022830963135 minScoreSum=2.7810442447662354, sumOfOtherMaxScores=0.6356085538864136 org.apache.lucene.search.TestMaxScoreSumPropagator > testGetMinCompetitiveScore FAILED java.lang.AssertionError: 3 at __randomizedtesting.SeedInfo.seed([4705BBC182B572C6:C8E41A539F61A77B]:0) at org.apache.lucene.search.MaxScoreSumPropagator.getMinCompetitiveScore(MaxScoreSumPropagator.java:160) at org.apache.lucene.search.MaxScoreSumPropagator.setMinCompetitiveScore(MaxScoreSumPropagator.java:121) at org.apache.lucene.search.TestMaxScoreSumPropagator.testGetMinCompetitiveScore(TestMaxScoreSumPropagator.java:244) ``` I wasn't able to trip it with a float `minScoreSum` though with the values in the issue, but it has to exist, given that it happened in production. Or there's something different about that setup than my linux test machine? JVM 11.0.12+7-LTS vs. 17? I can't find anything conclusive. This works: ``` org.apache.lucene.search.TestMaxScoreSumPropagator > testGetMinCompetitiveScore STANDARD_ERROR minScoreSum=2.7810442, sumOfOtherMaxScores=0.24435961246490479 minScoreSum=2.7810442, sumOfOtherMaxScores=0.39685022830963135 minScoreSum=2.7810442, sumOfOtherMaxScores=0.6356085538864136 ``` It looks like converging in `getMinCompetitiveScore` relies on truncating (rounding?) doubles to floats, so this looks suspicious to me. Any ideas of what we can do next? I will gladly write a unit test on top of the proposed changes in this PR if I can get to reproduce it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org