kaivalnp commented on PR #15979:
URL: https://github.com/apache/lucene/pull/15979#issuecomment-5108863429

   There was a [build 
failure](https://github.com/apache/lucene/actions/runs/30387209462/job/90369742955?pr=15979)
 with a recent commit, and I think the issue was present earlier -- it just 
surfaced with a particular seed value:
   
   ```
   org.apache.lucene.codecs.lucene106.dedup.TestDedupFlatVectorsFormat > test 
suite's output saved to 
D:\a\lucene\lucene\lucene\core\build\test-results\test\outputs\OUTPUT-org.apache.lucene.codecs.lucene106.dedup.TestDedupFlatVectorsFormat.txt,
 copied below:
      >     arrays first differed at element [0]; expected:<15360> but 
was:<17408>
      >         at 
__randomizedtesting.SeedInfo.seed([5B4E01D1CF500AC8:E45CAE26C94CE120]:0)
      >         at 
app//org.junit.internal.ComparisonCriteria.arrayEquals(ComparisonCriteria.java:78)
      >         at 
app//org.junit.internal.ComparisonCriteria.arrayEquals(ComparisonCriteria.java:28)
      >         at app//org.junit.Assert.internalArrayEquals(Assert.java:534)
      >         at app//org.junit.Assert.assertArrayEquals(Assert.java:393)
      >         at app//org.junit.Assert.assertArrayEquals(Assert.java:404)
      >         at 
app//org.apache.lucene.codecs.lucene106.dedup.TestDedupFlatVectorsFormat.testFloat16DuplicatesWithinField(TestDedupFlatVectorsFormat.java:96)
   ```
   
   [This 
test](https://github.com/kaivalnp/lucene/blob/4052a01e6b1bf0bcc78d1aec9a28ace464103352/lucene/core/src/test/org/apache/lucene/codecs/lucene106/dedup/TestDedupFlatVectorsFormat.java#L78-L100)
 indexes the same [two 
vectors](https://github.com/kaivalnp/lucene/blob/4052a01e6b1bf0bcc78d1aec9a28ace464103352/lucene/core/src/test/org/apache/lucene/codecs/lucene106/dedup/TestDedupFlatVectorsFormat.java#L80-L81)
 multiple times, and reads them back [at the 
end](https://github.com/kaivalnp/lucene/blob/4052a01e6b1bf0bcc78d1aec9a28ace464103352/lucene/core/src/test/org/apache/lucene/codecs/lucene106/dedup/TestDedupFlatVectorsFormat.java#L95-L97).
   
   However, it assumes that the ordinal in the vector values is the same as the 
original ordinal of insertion, which is not necessarily true (Lucene's random 
test suite can re-order documents).
   
   As a fix, I started storing the original ordinal in an `id` field, and using 
that to compare vectors. The test used to fail deterministically with the 
identified seed, and now passes with the fix.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to