5050// @com.carrotsearch.randomizedtesting.annotations.Repeat(iterations = 100)
5151public 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 }
0 commit comments