Skip to content

feat(format): specify IVF coarse-routing fingerprints - #10851

Open
majin1102 wants to merge 4 commits into
mainfrom
codex/ivf-coarse-fingerprint-spec
Open

majin1102 wants to merge 4 commits into
mainfrom
codex/ivf-coarse-fingerprint-spec

Conversation

@majin1102

@majin1102 majin1102 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add optional VectorIndexDetails.coarse_quantizer_fingerprint (field 10): a 32-byte BLAKE3 identity of the final IVF coarse-routing state.
  • Specify the canonical byte encoding, supported metric/type tags, writer lifecycle, reader fallback, and evolution rules in the vector-index format documentation.
  • Include regenerated protobuf bindings and the minimal None initializers needed to compile. This PR does not generate fingerprints or change query execution.

Compatibility

Old readers ignore the optional field. Readers implementing routing reuse treat missing or malformed identities as independent segments. Existing indices need no migration or rewrite. The identity does not assert quantization compatibility or authorize physical merging by itself.

Related work

Implementation: #8966. The implementation PR is stacked on this format branch and should be retargeted to main after this PR merges.

Discussion: #8965

Validation

  • Formatting, protobuf generation consistency, and diff checks passed.
  • Full workspace clippy (--all --tests --benches -- -D warnings) passed on the combined format-and-implementation stack.
  • This format PR's independent head passed CI clippy, formatting, and protobuf consistency/no-protoc build checks: https://github.com/lance-format/lance/actions/runs/42600756990. Remaining runtime jobs are still in progress.
  • A redundant local library-only check was stopped after the independent head passed CI clippy; it is not reported as a local pass.

This is a persisted-format proposal and requires the repository's format-specification vote before merging.

@majin1102 majin1102 added 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). labels Nov 9, 2026
@github-actions github-actions Bot added A-index Vector index, linalg, tokenizer enhancement New feature or request labels Nov 9, 2026
@majin1102
majin1102 marked this pull request as ready for review November 25, 2026 16:43

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T16:44:28.903131Z e781340 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 25, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On e781340f, six independently constructed inputs matched the proposed fingerprint encoding. Please update Discussion #8965 to match this PR: BLAKE3 fingerprints let matching segments share routing even when another segment must route independently. The discussion still describes SHA-256 and all-or-nothing reuse.

When rebasing, please update the VectorIndexDetails initializer that landed in rust/lance/src/dataset/tests/dataset_transactions.rs. Compiling that initializer in isolation against the proposed generated type gives E0063 for the missing coarse_quantizer_fingerprint field.

For the implementation in #8966, infer_missing_vector_details replaces the details of every same-name segment when inference succeeds for one legacy segment. With two matching fingerprints and one legacy segment, that discards both valid fingerprints and produces three routing groups instead of two. Please preserve the known details and cover this combination through a reopened index in #8966.

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please make independent routing explicit for a fingerprint version the reader does not recognize. Field 10 currently contains only a 32-byte digest. Changing the domain string changes the hash, but a v1 reader comparing two equal future digests in that field would still group the segments. One way to preserve the v1 layout is to reserve field 10 for v1 and put a future scheme in a different optional field. A writer could populate field 10 only when it can compute a valid v1 fingerprint for the final routing state. A v1 reader seeing only the future field would then route each segment independently, as it does for a missing or malformed fingerprint.

Keep the general recompute-or-clear rule for every writer that changes routing, including future writer paths. In #8966, please test the reopened fingerprint after centroid retraining, metric changes, remapping and optimization, checking that it matches the final routing state or is absent. Please also cover mixed fingerprinted and legacy segments, unknown versions, and old/new reader interoperability. Matching fingerprints establish routing identity only. Quantizer compatibility and physical merge eligibility retain their own checks.

@majin1102
majin1102 force-pushed the codex/ivf-coarse-fingerprint-spec branch from e781340 to 42de882 Compare December 2, 2026 11:04
@github-actions

github-actions Bot commented Dec 2, 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 — 0 of 3 required approvals

Approvals none (0/3)
Latest commit approved by none — one PMC member must approve the latest commit
Vetoes none
Voting period elapsed — ended Mon 2026-11-30 16:43 UTC (08:43 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 removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Dec 2, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Dec 2, 2026
@lance-gatekeeper lance-gatekeeper Bot removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Dec 2, 2026

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

Reserving field 10 for v1 resolves the evolution risk raised in Xuanwo’s review. Future schemes now require a separate optional field, with field 10 omitted unless a valid v1 fingerprint can be computed, preserving independent routing for older readers. The wire schema is unchanged; execution and lifecycle validation remain in #8966.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Dec 2, 2026
@majin1102

Copy link
Copy Markdown
Contributor Author

Thanks @Xuanwo. The format clarification is in 9c5b510:

  • Field 10 is reserved for the specified v1 encoding. A future scheme needs a different optional field and domain; writers omit/clear field 10 unless they can still compute a valid v1 identity for the final routing state. The digest itself does not expose its domain or version.
  • The general recompute-or-clear rule and the distinction between routing identity and physical merge compatibility remain unchanged.
  • Discussion Reuse IVF Coarse-Quantizer Routing Across Index Segments #8965 now describes BLAKE3 and reuse within matching subsets. Its benchmark section is unchanged, and it links both PRs.
  • The missing initializer was fixed during rebase, and the breaking-change label is present.

The legacy inference guard is already fixed upstream by 818bfee. In #8966, the added regression persists and reopens two matching segments plus a legacy/future-only segment, and checks routing groups, work counters and exact Top-10 results. Existing lifecycle tests now check reopened fingerprints after metric replacement, remap, retrain, rebalance and merge against the actual final model.

Verification: protobuf generation and --check, protobuf comment checks, docs build, formatting and full workspace clippy passed for this format revision. Full workspace clippy also passed for implementation revision 11bd8b8, including the new test code. Runtime tests have not passed: on the 16 GiB local host, building the lance test binary with the repository's ci profile and one build job was OOM-killed before any test executed (confirmed in the kernel log). These regressions still need execution on a larger runner/CI.

Old/new runtime interoperability remains unverified: attempts to dispatch the existing compat-pair.yml workflow for stable 15.0.0 in both directions were rejected because Actions is disabled on my fork. This is separate from protobuf wire-compatibility checks; I am not claiming the runtime matrix passed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-format On-disk format: protos and format spec docs A-index Vector index, linalg, tokenizer breaking-change enhancement New feature or request format-change A change to the format spec, which requires a vote. Remove if minor (e.g. fixing typo). K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants