You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2022/03/09 12:08:26 UTC

[lucene] branch branch_9x updated: LUCENE-10408 Test correction checksum (#734)

This is an automated email from the ASF dual-hosted git repository.

mayya pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 1f49781  LUCENE-10408 Test correction checksum (#734)
1f49781 is described below

commit 1f497819e6b60db7908657056512e4c65fef420a
Author: Mayya Sharipova <ma...@elastic.co>
AuthorDate: Wed Mar 9 08:02:40 2022 +0000

    LUCENE-10408 Test correction checksum (#734)
    
    Use double instead of float to test vector values checksum
---
 .../apache/lucene/tests/index/BaseKnnVectorsFormatTestCase.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseKnnVectorsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseKnnVectorsFormatTestCase.java
index 7b4a278..c149049 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseKnnVectorsFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseKnnVectorsFormatTestCase.java
@@ -594,7 +594,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe
     int numDocs = atLeast(1000);
     int numFields = TestUtil.nextInt(random(), 1, 10);
     int[] fieldDocCounts = new int[numFields];
-    float[] fieldTotals = new float[numFields];
+    double[] fieldTotals = new double[numFields];
     int[] fieldDims = new int[numFields];
     VectorSimilarityFunction[] fieldSearchStrategies = new VectorSimilarityFunction[numFields];
     for (int i = 0; i < numFields; i++) {
@@ -622,7 +622,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe
       try (IndexReader r = w.getReader()) {
         for (int field = 0; field < numFields; field++) {
           int docCount = 0;
-          float checksum = 0;
+          double checksum = 0;
           String fieldName = "int" + field;
           for (LeafReaderContext ctx : r.leaves()) {
             VectorValues vectors = ctx.reader().getVectorValues(fieldName);
@@ -1095,7 +1095,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe
         VectorSimilarityFunction.values()[
             random().nextInt(VectorSimilarityFunction.values().length)];
 
-    float fieldValuesCheckSum = 0f;
+    double fieldValuesCheckSum = 0;
     int fieldDocCount = 0;
     long fieldSumDocIDs = 0;
 
@@ -1120,7 +1120,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe
       }
 
       try (IndexReader r = w.getReader()) {
-        float checksum = 0;
+        double checksum = 0;
         int docCount = 0;
         long sumDocIds = 0;
         for (LeafReaderContext ctx : r.leaves()) {