[ 
https://issues.apache.org/jira/browse/LUCENE-9976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17357046#comment-17357046
 ] 

Zach Chen commented on LUCENE-9976:
-----------------------------------

{quote}I'm using mac, and trying with main branch head commit a6cf46dad
{quote}
Okay I should have also tried to pull the latest main branch before running the 
tests, and after that I'm also able to consistently reproduce this failure. 
Sorry for the confusion earlier!

The failure happened at this line: 
{code:java}
assert minCompetitiveScore == 0 || tailMaxScore < minCompetitiveScore{code}
I reset the commits a few times to see where it started to fail, and believed 
it started from the performance regression fix commit 820e63d2ddf235c from 
https://issues.apache.org/jira/browse/LUCENE-9958 . The change was
{code:java}
diff --git a/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java 
b/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java
index f33af6b8ee8..f5bab49fb71 100644
--- a/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java
+++ b/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java
@@ -548,7 +548,7 @@ final class WANDScorer extends Scorer {
 
   /** Insert an entry in 'tail' and evict the least-costly scorer if full. */
   private DisiWrapper insertTailWithOverFlow(DisiWrapper s) {
-    if (tailMaxScore + s.maxScore < minCompetitiveScore) {
+    if (tailMaxScore + s.maxScore < minCompetitiveScore || tailSize + 1 < 
minShouldMatch) {
       // we have free room for this new entry
       addTail(s);
       tailMaxScore += s.maxScore;
{code}
I think from this logic, _tailMaxScore >= minCompetitiveScore_ is intended to 
happen now, since the block may be entered from condition _tailSize + 1 < 
minShouldMatch._ So the assertion logic should be updated to the following 
(tested locally and passed the test):

 
{code:java}
assert minCompetitiveScore == 0 || tailMaxScore < minCompetitiveScore || 
tailSize < minShouldMatch{code}
 

I can raise a quick PR if that looks good?  [~jpountz]

> WANDScorer assertion error in ensureConsistent
> ----------------------------------------------
>
>                 Key: LUCENE-9976
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9976
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Dawid Weiss
>            Priority: Major
>
> Build fails and is reproducible:
> https://ci-builds.apache.org/job/Lucene/job/Lucene-NightlyTests-main/283/console
> {code}
> ./gradlew test --tests TestExpressionSorts.testQueries 
> -Dtests.seed=FF571CE915A0955 -Dtests.multiplier=2 -Dtests.nightly=true 
> -Dtests.slow=true -Dtests.asserts=true -p lucene/expressions/
> {code}



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

Reply via email to