Skip to content

Commit 311c0a8

Browse files
authored
TestVectorUtilSupport increase delta for larger vector sizes (#15443)
1 parent c6856c8 commit 311c0a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lucene/core/src/test/org/apache/lucene/internal/vectorization/TestVectorUtilSupport.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,11 @@ public void testMinMaxScalarQuantize() {
306306
}
307307

308308
private void assertFloatReturningProviders(ToDoubleFunction<VectorUtilSupport> func) {
309-
assertEquals(
310-
func.applyAsDouble(LUCENE_PROVIDER.getVectorUtilSupport()),
311-
func.applyAsDouble(PANAMA_PROVIDER.getVectorUtilSupport()),
312-
delta);
309+
double luceneProviderResults = func.applyAsDouble(LUCENE_PROVIDER.getVectorUtilSupport());
310+
double panamaProviderResults = func.applyAsDouble(PANAMA_PROVIDER.getVectorUtilSupport());
311+
double delta =
312+
Math.max(this.delta, this.delta * Math.max(luceneProviderResults, panamaProviderResults));
313+
assertEquals(luceneProviderResults, panamaProviderResults, delta);
313314
}
314315

315316
private void assertIntReturningProviders(ToIntFunction<VectorUtilSupport> func) {

0 commit comments

Comments
 (0)