#9418·lance

bug: skip_transpose is ignored for IVF_HNSW_PQ

Author: LuciferYangCreated Sep 18, 2026Updated Sep 18, 2026
Labelsbug

Description

VectorIndexParams::skip_transpose decides whether PQ codes are stored transposed. build_vector_index_impl in rust/lance/src/index/vector.rs passes it to the builder for IvfPq and IvfRq, and for the incremental and optimize paths:

rust
.with_transpose(!params.skip_transpose)

The IvfHnswPq arm does not, so its builder keeps the default and writes transposed codes whatever the caller asked for. IVF_HNSW_PQ has PQ storage like IVF_PQ, and the builder already handles the untransposed case generically (it un-transposes before writing and records transposed: false in the storage metadata, which readers honor), so there is nothing about the HNSW sub-index that makes the flag inapplicable. It is just not wired.

The result is visible in the index: with skip_transpose(true), an IVF_PQ index records transposed: false and an IVF_HNSW_PQ index records transposed: true.

Expected behavior

Pass the flag to the IVF_HNSW_PQ builder as well, so the stored layout matches what the caller asked for.

Lance version

13.0.0-beta.4 (main)

Language binding

Rust