Skip to content

docs(format): specify dense mini-block repetition index compression - #11583

Merged
Xuanwo merged 3 commits into
mainfrom
xuanwo/miniblock-repetition-index-format
Dec 2, 2026
Merged

Xuanwo merged 3 commits into
mainfrom
xuanwo/miniblock-repetition-index-format

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 27, 2026

Copy link
Copy Markdown
Member

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 = 4 for unstable Lance 2.3. It packs pairs of 16-bit entries into the existing unsigned u32 block 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 flat u64 representation.

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.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot added A-encoding Encoding, IO, file reader/writer A-format On-disk format: protos and format spec docs format-change A change to the format spec, which requires a vote. Remove if minor (e.g. fixing typo). documentation Improvements or additions to documentation labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Important

Format specification vote

This 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

Approvals @BubbleCal (1/3)
Latest commit approved by @BubbleCal
Vetoes none
Voting period ends Wed 2026-12-02 17:49 UTC (09:49 PST)

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 format-waived label to waive the vote for a trivial edit (typo, wording, formatting).

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 27, 2026
@Xuanwo Xuanwo added the format-waived Author attests no format vote is needed label Dec 2, 2026
…tition-index-format

# Conflicts:
#	docs/src/format/file/encoding.md
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Dec 2, 2026
@Xuanwo
Xuanwo merged commit a13e493 into main Dec 2, 2026
44 of 56 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/miniblock-repetition-index-format branch December 2, 2026 11:10
Xuanwo added a commit that referenced this pull request Dec 2, 2026
## 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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-encoding Encoding, IO, file reader/writer A-format On-disk format: protos and format spec docs breaking-change documentation Improvements or additions to documentation format-change A change to the format spec, which requires a vote. Remove if minor (e.g. fixing typo). format-waived Author attests no format vote is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants