Skip to content

Tweak the delta used for vector scorer tests #126849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
// @com.carrotsearch.randomizedtesting.annotations.Repeat(iterations = 100)
public class VectorScorerFactoryTests extends AbstractVectorTestCase {

private static final float DELTA = 1e-4f;

// bounds of the range of values that can be seen by int7 scalar quantized vectors
static final byte MIN_INT7_VALUE = 0;
static final byte MAX_INT7_VALUE = 127;
Expand Down Expand Up @@ -260,6 +258,8 @@ void testRandomScorerImpl(long maxChunkSize, Function<Integer, float[]> floatArr
final byte[][] qVectors = new byte[size][];
final float[] corrections = new float[size];

float delta = 1e-6f * dims;

String fileName = "testRandom-" + sim + "-" + dims + ".vex";
logger.info("Testing " + fileName);
try (IndexOutput out = dir.createOutput(fileName, IOContext.DEFAULT)) {
Expand All @@ -280,7 +280,7 @@ void testRandomScorerImpl(long maxChunkSize, Function<Integer, float[]> floatArr

var expected = luceneScore(sim, qVectors[idx0], qVectors[idx1], correction, corrections[idx0], corrections[idx1]);
var scorer = factory.getInt7SQVectorScorer(VectorSimilarityType.of(sim), values, vectors[idx0]).get();
assertEquals(scorer.score(idx1), expected, DELTA);
assertEquals(scorer.score(idx1), expected, delta);
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,12 @@ tests:
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
method: test {p0=transform/transforms_start_stop/Test start/stop/start continuous transform}
issue: https://github.com/elastic/elasticsearch/issues/126755
- class: org.elasticsearch.simdvec.VectorScorerFactoryTests
method: testRandomScorerMax
issue: https://github.com/elastic/elasticsearch/issues/126797
- class: org.elasticsearch.search.SearchServiceSingleNodeTests
method: testBeforeShardLockDuringShardCreate
issue: https://github.com/elastic/elasticsearch/issues/126812
- class: org.elasticsearch.search.SearchServiceSingleNodeTests
method: testLookUpSearchContext
issue: https://github.com/elastic/elasticsearch/issues/126813
- class: org.elasticsearch.simdvec.VectorScorerFactoryTests
method: testRandomScorerChunkSizeSmall
issue: https://github.com/elastic/elasticsearch/issues/126847

# Examples:
#
Expand Down