Skip to content

feat(format): add the MinHash LSH scalar index specification (experimental) - #9076

Merged
BubbleCal merged 1 commit into
lance-format:mainfrom
zhangyue19921010:minhash-lsh-spec
Sep 21, 2026
Merged

BubbleCal merged 1 commit into
lance-format:mainfrom
zhangyue19921010:minhash-lsh-spec

Conversation

@zhangyue19921010

Copy link
Copy Markdown
Collaborator

Add the persisted contract of the MinHash LSH scalar index for near-duplicate search over text: the MinHashLshIndexDetails message and the format specification of its two files.

  • Details: num_hashes (1..4096, a multiple of num_bands), num_bands (1..256), shingle_size (>= 1), the tokenizer recorded as a full text search index records it, and signature_version. Readers validate every field before allocating or reading; version 0 admits only tokenizers whose data ships with Lance and rejects dictionary-backed ones.
  • Signature procedure pinned for version 0: tokenizer output bytes joined by 0x1F into shingles, XXH64 (seed 42), SplitMix64 coefficients and their draw order, 64-bit permutations, multiply-shift compression to 16 bits, band keys; with known-answer vectors an implementation must reproduce.
  • Files: signatures.lance (_rowid, FixedSizeList<u16, num_hashes>, full-zip, no compression, row number = segment-local doc id) and bands.lance ((band_key, doc_id) sorted, 4096-row logical pages, page table in a global buffer), given as PyArrow schemas with their schema metadata; both repeat the serialized details and are verified when a segment is opened.
  • Reader navigation, multi-segment semantics, appends, merging, deletes.

Library edits are limited to what compiles the proto: index.proto imports index_old.proto for the cross-package reference, and the lance-index build script generates index_old.proto in its own pass and maps lance.table to crate::pbold for the index.proto pass.

@github-actions github-actions Bot added A-index Vector index, linalg, tokenizer 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). enhancement New feature or request labels Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 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-09-14 14:57 UTC (07:57 PDT)

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[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Sep 9, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Sep 10, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 10, 2026
Add the persisted contract of the MinHash LSH scalar index for
near-duplicate search over text: the MinHashLshIndexDetails message and the
format specification of its two files.

- Details: num_hashes (1..4096, a multiple of num_bands), num_bands
  (1..256), shingle_size (>= 1), the tokenizer recorded as a full text
  search index records it, and signature_version. Readers validate every
  field before allocating or reading; version 0 admits only tokenizers whose
  data ships with Lance and rejects dictionary-backed ones.
- Signature procedure pinned for version 0: tokenizer output bytes joined
  by 0x1F into shingles, XXH64 (seed 42), SplitMix64 coefficients and their
  draw order, 64-bit permutations, multiply-shift compression to 16 bits,
  band keys; with known-answer vectors an implementation must reproduce.
- Files: signatures.lance (_rowid, FixedSizeList<u16, num_hashes>, full-zip,
  no compression, row number = segment-local doc id) and bands.lance
  ((band_key, doc_id) sorted, 4096-row logical pages, page table in a global
  buffer), given as PyArrow schemas with their schema metadata; both repeat
  the serialized details and are verified when a segment is opened.
- Reader navigation, multi-segment semantics, appends, merging, deletes.

Library edits are limited to what compiles the proto: index.proto imports
index_old.proto for the cross-package reference, and the lance-index build
script generates index_old.proto in its own pass and maps lance.table to
crate::pbold for the index.proto pass.
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 11, 2026
@zhangyue19921010 zhangyue19921010 changed the title feat(format): add the MinHash LSH scalar index specification feat(format): add the MinHash LSH scalar index specification (experimental) Sep 11, 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.

The experimental designation is consistent with Lance’s unstable-format contract, and its rollback boundary remains confined to index metadata and files rather than dataset data. The previously verified signature algorithm and storage layouts are unchanged, while current unknown-index handling keeps unsupported indexes out of query use without erasing them during unrelated maintenance.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 11, 2026
@BubbleCal
BubbleCal merged commit 4a236b2 into lance-format:main Sep 21, 2026
41 of 42 checks passed
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 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