Skip to content

refactor(encoding): make block codecs fallible - #8040

Open
Xuanwo wants to merge 7 commits into
mainfrom
xuanwo/generic-block-stack-2-block-contract
Open

refactor(encoding): make block codecs fallible#8040
Xuanwo wants to merge 7 commits into
mainfrom
xuanwo/generic-block-stack-2-block-contract

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Stack 2 of the generic block compression series. Builds on merged #8038.

Generic block descriptors now enter one bounded, fallible decoder factory. Concrete codecs own their child codecs and framing, while Option<LanceBuffer> distinguishes metadata-only encodings from payload-bearing empty buffers. Sparse structural metadata reuses the shared validator without changing its wire format.

This layer intentionally adds no protobuf variants and does not change production block or mini-block selection. Lance 2.0–2.2 bytes and the existing variable-offset layout remain unchanged. After merging the version-free strategy refactor from main, the stable wire fixtures exposed and now cover the all-zero inline-bitpacking boundary so 0-bit blocks remain byte-for-byte stable.

Validation at de91c0a07:

  • cargo fmt --all -- --check
  • cargo check -p lance-encoding --no-default-features --tests
  • cargo test -p lance-encoding (542 passed, 5 ignored; integration and doctests passed)
  • cargo test -p lance-file (130 passed; 4 doctests passed, including exact 2.0–2.2 wire fixtures)
  • cargo clippy --all --tests --benches -- -D warnings

Stack navigation

@github-actions github-actions Bot added the A-encoding Encoding, IO, file reader/writer label Jul 28, 2026
Xuanwo added a commit that referenced this pull request Jul 30, 2026
Stack 1 of the generic block compression series.

Mini-block codecs need page framing information to compare
container-level choices without creating a parallel planner API. This
change passes one explicit context through the existing mini-block codec
tree and distinguishes ordinary mini-block pages from SparseLayout
callers.

It intentionally changes no codec selection or persisted bytes: ordinary
mini-block and SparseLayout writers keep their existing behavior, while
later stack layers can consume the context when evaluating generic
offset containers.

Validation covered the complete lance-encoding test suite and workspace
clippy with warnings denied.

<!-- generic-block-stack-navigation -->
## Stack navigation
- Umbrella / integration reference: #8002
- Next: #8040
Base automatically changed from xuanwo/generic-block-stack-1-miniblock-context to main July 30, 2026 10:02
Xuanwo added 2 commits July 31, 2026 00:07
# Conflicts:
#	rust/lance-encoding/src/compression.rs
#	rust/lance-encoding/src/encodings/logical/primitive.rs
#	rust/lance-encoding/src/encodings/logical/primitive/miniblock.rs
#	rust/lance-encoding/src/encodings/logical/primitive/sparse/writer.rs
#	rust/lance-encoding/src/encodings/physical/binary.rs
#	rust/lance-encoding/src/encodings/physical/bitpacking.rs
#	rust/lance-encoding/src/encodings/physical/byte_stream_split.rs
#	rust/lance-encoding/src/encodings/physical/fsst.rs
#	rust/lance-encoding/src/encodings/physical/general.rs
#	rust/lance-encoding/src/encodings/physical/packed.rs
#	rust/lance-encoding/src/encodings/physical/rle.rs
#	rust/lance-encoding/src/encodings/physical/value.rs
@Xuanwo
Xuanwo marked this pull request as ready for review July 31, 2026 06:22
@Xuanwo
Xuanwo requested a review from lance-community July 31, 2026 17:29
@lance-gatekeeper
lance-gatekeeper Bot removed the request for review from lance-community July 31, 2026 17:29
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant