lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laimonas Simutis <>
Subject TestTieBreaker failing test
Date Wed, 27 May 2015 02:00:16 GMT

I am running into an issue in with what seems to be a floating
point number comparison inconsistency. Looking for anyone's guidance or

Here is the offending code:

This conditional evaluation specifically:

termAfter ? Bottom >= CalculateMaxBoost(MaxEdits) : Bottom >

There is a code path where termAfter is false, so Bottom >
CalculateMaxBoost(MaxEdits) evaluation runs. The evaluation for what looks
like two equal numbers returns Bottom as being greater.
The way I captured this is that I pushed another branch which emits the
values of these numbers, and here is what I see:

termAfter=False, Bottom=0.8571429, maxBoost:0.8571429, yet maxEdits is

What makes this worse, I can't reproduce it locally. Also if you change the
logic to evaluate differently (precalculate max boost), it goes away on TC
(almost always :)). There is no random components involved as far as I can
tell. The same numbers / data is executed in Lucene.Net and Lucene versions
of the test.

Here is the failing test that suffers from this on TC:

Also, this issue goes away in Debug builds, even on TC.

Anyone have any suggestions how to proceed? Not sure what else to try.
Would it be a terrible idea to choose double over float here for better
accuracy, if it is some sort of rounding issue?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message