@@ -184,6 +184,7 @@ Drivers MUST validate vector metadata and raise an error if any invariant is vio
184
184
185
185
- Padding MUST be 0 for all dtypes where padding doesn’t apply, and MUST be within \[ 0, 7\] for PACKED_BIT.
186
186
- A PACKED_BIT vector MUST NOT be empty if padding is in the range \[ 1, 7\] .
187
+ - For a PACKED_BIT vector, ignored bits must be zero.
187
188
- When unpacking binary data into a FLOAT32 Vector structure, the length of the binary data following the dtype and
188
189
padding MUST be a multiple of 4 bytes.
189
190
@@ -237,16 +238,26 @@ See the [README](tests/README.md) for tests.
237
238
## FAQ
238
239
239
240
- What MongoDB Server version does this apply to?
241
+
240
242
- Files in the "specifications" repository have no version scheme. They are not tied to a MongoDB server version.
243
+
241
244
- In PACKED_BIT, why would one choose to use integers in \[ 0, 256)?
245
+
242
246
- This follows a well-established precedent for packing binary-valued arrays into bytes (8 bits), This technique is
243
247
widely used across different fields, such as data compression, communication protocols, and file formats, where
244
248
you want to store or transmit binary data more efficiently by grouping 8 bits into a single byte (uint8). For an
245
249
example in Python, see
246
250
[ numpy.unpackbits] ( https://numpy.org/doc/2.0/reference/generated/numpy.unpackbits.html#numpy.unpackbits ) .
247
251
252
+ - In PACKED_BIT, why are ignored bits required to be zero?
253
+
254
+ - To ensure the same data representation has the same encoding. For drivers supporting comparison operations, this
255
+ avoids comparing different unused bits.
256
+
248
257
## Changelog
249
258
259
+ - 2025-04-08: In PACKED_BIT vectors, ignored bits must be zero.
260
+
250
261
- 2025-03-07: Update tests to use Extended JSON representation of +/-Infinity. (DRIVERS-3095)
251
262
252
263
- 2025-02-04: Update validation for decoding into a FLOAT32 vector.
0 commit comments