refactor: compose exact file versions explicitly#7979
Draft
Xuanwo wants to merge 1 commit into
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: QUIET Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
This draft is an end-to-end layout proposal implemented in code. It is not intended to be merged as one PR. Its purpose is to make the final ownership boundaries, composition model, and migration impact concrete enough to review. If the direction is accepted, we should split this branch into a sequence of smaller, independently validated PRs and land them incrementally.
Online version of this layout: https://www.tldraw.com/p/kT0w5pdO2-miVZL6YWHln?d=v-255.-286.3044.2080.page
Why
Lance file versions are externally parallel persisted formats, but the implementation has historically treated them as an ordered capability progression. Format policy consequently leaked into shared encoding, file, table, and dataset code through comparisons, defaults, compatibility branches, and time-relative concepts such as
previous.This makes changes risky: extending a newer version can accidentally alter an older stable format, while adding a version requires finding implicit policy throughout the repository.
Layout shown by this draft
Each exact version is a complete composition root for the grammar it writes and accepts. Shared code below those roots is limited to version-free executable mechanisms. Release selectors such as
StableandNextresolve once at the boundary and are not persisted as identities.At the other layers:
lance-encodingcontains reusable encoding and compression mechanisms without file-version policy.lance-fileowns exact reader/writer grammar and runtime dispatch between exact roots.lance::dataset::versionsowns explicit operation-level dataset differences without capability bags.lance-tableretains only persisted identity codecs, recovery, and homogeneity validation.The branch also includes exact-version fixtures and an automated boundary checker so the intended dependency direction is reviewable and enforceable.
Review focus
The useful question for this draft is whether this is the right final layout: whether the ownership boundaries are correct, whether the shared mechanisms are at the right granularity, and whether exact versions are isolated without introducing redundant wrappers or capability profiles.
Please do not review this as a request to land the entire diff directly. Once the layout is agreed, the implementation can be separated into ordered PRs covering exact identity and fixtures, V1 ownership, current-version reader/writer roots, version-free encoding mechanisms, and dataset/table dispatch cleanup.
Validation caveat
The relevant boundary checks, compatibility fixtures, crate tests, and Python/Java lint paths pass. The repository-wide
cargo clippy --all --tests --benches -- -D warningscommand is currently blocked by the pre-existingCoalesceBatchesExecdeprecation inrust/lance/src/dataset/scanner.rs, which is also present onorigin/main; targeted strict clippy for the changed architecture passes.