kaivalnp commented on code in PR #15698:
URL: https://github.com/apache/lucene/pull/15698#discussion_r2795610495
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene104/OffHeapScalarQuantizedVectorValues.java:
##########
@@ -177,19 +177,19 @@ public int getVectorByteLength() {
return vectorValue.length;
}
- static void packNibbles(byte[] unpacked, byte[] packed) {
+ public static void packNibbles(byte[] unpacked, byte[] packed) {
assert unpacked.length == packed.length * 2;
for (int i = 0; i < packed.length; i++) {
- int x = unpacked[i] << 4 | unpacked[packed.length + i];
+ int x = unpacked[i * 2] << 4 | unpacked[i * 2 + 1];
packed[i] = (byte) x;
}
}
Review Comment:
Sorry, you're right -- I was under the _false_ impression that dimensions
are packed one after another as:
`[1 2][3 4][5 6][7 8]`
Indeed the dimensions are packed as:
`[1 5][2 6][3 7][4 8]`
..and this would change things on disk
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]