pub fn est_dot_bit4(
query: &Bit4Query,
codes: &[u8],
factors: Bit4Factors,
) -> Result<f32, QuantError>Expand description
Estimates a dot product directly from one packed four-bit row.
The native packed kernel scores unsigned nibbles directly, then applies
dot(z, 2*u - 15) = 2*dot(z, u) - 15*sum(z) once per row. The query’s
block-interleaved representation pairs directly with high- and low-nibble
vectors, so scoring needs no expanded row, ZIP interleave, or per-vector
grid conversion. If the prepared query reconstructs as scale*z, the
integer kernel gives <y,q_hat> = scale * dot(2*y,z) / 2; the stored
correction then yields the Extended-RaBitQ estimate.
For an odd dimension, the unused low nibble must be canonical zero padding.
§Errors
Returns QuantError::CodeLength for a dimension mismatch and
QuantError::NonZeroPadding for non-canonical trailing fields.