Skip to content

Commit 1f249c7

Browse files
authored
Tweak the delta used for vector scorer tests (#126849)
New panama operations in Lucene 10.2 change the results we get from vector operations slightly
1 parent 02f9af7 commit 1f249c7

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

libs/simdvec/src/test/java/org/elasticsearch/simdvec/VectorScorerFactoryTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
// @com.carrotsearch.randomizedtesting.annotations.Repeat(iterations = 100)
5151
public class VectorScorerFactoryTests extends AbstractVectorTestCase {
5252

53-
private static final float DELTA = 1e-4f;
54-
5553
// bounds of the range of values that can be seen by int7 scalar quantized vectors
5654
static final byte MIN_INT7_VALUE = 0;
5755
static final byte MAX_INT7_VALUE = 127;
@@ -260,6 +258,8 @@ void testRandomScorerImpl(long maxChunkSize, Function<Integer, float[]> floatArr
260258
final byte[][] qVectors = new byte[size][];
261259
final float[] corrections = new float[size];
262260

261+
float delta = 1e-6f * dims;
262+
263263
String fileName = "testRandom-" + sim + "-" + dims + ".vex";
264264
logger.info("Testing " + fileName);
265265
try (IndexOutput out = dir.createOutput(fileName, IOContext.DEFAULT)) {
@@ -280,7 +280,7 @@ void testRandomScorerImpl(long maxChunkSize, Function<Integer, float[]> floatArr
280280

281281
var expected = luceneScore(sim, qVectors[idx0], qVectors[idx1], correction, corrections[idx0], corrections[idx1]);
282282
var scorer = factory.getInt7SQVectorScorer(VectorSimilarityType.of(sim), values, vectors[idx0]).get();
283-
assertEquals(scorer.score(idx1), expected, DELTA);
283+
assertEquals(scorer.score(idx1), expected, delta);
284284
}
285285
}
286286
}

muted-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,18 +396,12 @@ tests:
396396
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
397397
method: test {p0=transform/transforms_start_stop/Test start/stop/start continuous transform}
398398
issue: https://github.com/elastic/elasticsearch/issues/126755
399-
- class: org.elasticsearch.simdvec.VectorScorerFactoryTests
400-
method: testRandomScorerMax
401-
issue: https://github.com/elastic/elasticsearch/issues/126797
402399
- class: org.elasticsearch.search.SearchServiceSingleNodeTests
403400
method: testBeforeShardLockDuringShardCreate
404401
issue: https://github.com/elastic/elasticsearch/issues/126812
405402
- class: org.elasticsearch.search.SearchServiceSingleNodeTests
406403
method: testLookUpSearchContext
407404
issue: https://github.com/elastic/elasticsearch/issues/126813
408-
- class: org.elasticsearch.simdvec.VectorScorerFactoryTests
409-
method: testRandomScorerChunkSizeSmall
410-
issue: https://github.com/elastic/elasticsearch/issues/126847
411405

412406
# Examples:
413407
#

0 commit comments

Comments
 (0)