Repository navigation
docs(format): specify dense mini-block repetition index compression - #11583
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
Important Format specification voteThis PR modifies the Lance format specification, so it requires 3 binding +1 votes from PMC members (excluding the proposer), at least one of them on the latest commit, and a minimum 72-hour voting period, weekends excluded, before it can merge. Vote by approving this PR (+1) or requesting changes (−1, a veto). See the voting process. Approvals carry over across pushes, so a rebase or a typo fix does not send everyone back to re-vote. Whoever approves the latest commit is vouching that nothing substantive has changed since the earlier approvals; if something has, ask for fresh votes. Status: ❌ Blocked — 1 of 3 required approvals
Updated automatically by the format-spec vote gate, which re-checks every 15 minutes — just voted? Re-check now (press Run workflow; leave the input blank to re-check every open format PR). A PMC member may apply the |
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The packed-index contract is sufficiently defined for the separate reader/writer implementation. Real-file round trips and cold-read measurements remain part of that follow-up.
Please mark this PR with the breaking-change label: lance_encoding::format::pb23::DenseChunkLevels gains the repetition_index field, so Rust callers using exhaustive struct literals must initialize it.
…tition-index-format # Conflicts: # docs/src/format/file/encoding.md
## Motivation `PageEncoding` sits inline inside `PageInfo`, `EncodedPage`, and async read/write futures across all Lance file versions (2.0–2.3). Previously, `PageEncoding::Structural(metadata::PageLayout)` (~200+ B) and `PageEncoding::Planar(pb23::PlanarLayout)` (~240 B on `main`, ~280 B once #11583 adds `DenseChunkLevels.repetition_index`) were stored unboxed inline, inflating every `PageEncoding` value and every debug async stack frame that holds page metadata. On `main`, debug `lance-jni` runs driven via `RT.block_on(...)` on 1 MiB JVM threads (such as `OptimizeIndicesTest`) sit right at the stack cliff, so adding a single optional field to `pb23::DenseChunkLevels` in #11583 deterministically pushes `OptimizeIndicesTest` into a native stack-overflow `SIGSEGV` (exit code 139). ## Changes - Box `PageEncoding::Structural(Box<metadata::PageLayout>)` and `PageEncoding::Planar(Box<pb23::PlanarLayout>)` in `rust/lance-encoding/src/decoder.rs`, reducing `size_of::<PageEncoding>()` from ~240 B down to 56 B (bounded by `Legacy(pb::ArrayEncoding)`) and decoupling it from future 2.3/2.4 layout metadata growth. - Add `From<pb23::PlanarLayout> for PageEncoding` alongside the existing `From` conversions and update `DeepSizeOf` to include the boxed `PlanarLayout` allocation. - Add `page_encoding_keeps_inline_size_bounded` unit test to guard against future inline size regressions. - Update workspace call sites across `lance-encoding`, `lance-file`, `lance-table-runtime`, and `lance`. ## Breaking Change `lance_encoding::decoder::PageEncoding::Structural` now holds `Box<metadata::PageLayout>` and `PageEncoding::Planar` now holds `Box<pb23::PlanarLayout>`. Callers constructing variants can use `PageEncoding::from(...)` or `Box::new(...)`. ## Validation - `cargo test -p lance-encoding --lib page_encoding_keeps_inline_size_bounded` - `cargo test -p lance-file --lib compatibility_tests` (32 passed) - `cargo check --workspace --tests --benches` - `cargo check --manifest-path java/lance-jni/Cargo.toml --locked` - `cargo fmt --all -- --check` - `cargo clippy --all --tests --benches -- -D warnings`
Dense MiniBlock pages store two 64-bit repetition-index entries per chunk at depth one and load the index to locate rows. This proposal adds
DenseChunkLevels.repetition_index = 4for unstable Lance 2.3. It packs pairs of 16-bit entries into the existing unsignedu32block grammar. The descriptor preserves the index buffer ordinal, including a zero-length slot for metadata-only codecs. Pages with a positive depth and no descriptor use the existing flatu64representation.The specification defines exact trailer counts, preservation of deeper entries, and validation of row mapping and payload length. The protobuf descriptor comparison found exactly one new optional message field. Strict MkDocs, the seven docs tests, protobuf comment lint and formatting of the touched Rust files passed. The generated Rust sources and generator inputs match the previously codegen-checked proposal. Full Rust Clippy and a fresh codegen check require a build window above the shared host's disk floor.
This proposal follows the normal PMC format vote. The reader and writer implementation will follow separately after real-file round trips, cold-read byte and request measurements, and implementation review.
References #4891.