镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[diskann-inmem] Move start point handling out of Store. - #1527

Merged
Mark Hildebrand (hildebrandmw) merged 2 commits into
mainfrom
mhildebr/start-points-out-of-store
Oct 28, 2026
Merged

Mark Hildebrand (hildebrandmw) merged 2 commits into
mainfrom
mhildebr/start-points-out-of-store

Conversation

@hildebrandmw

Copy link
Copy Markdown
Contributor

Move frozen point knowledge out of Store and into Representations.

This is part of a workstream to make usage of start points more flexible. Currently, the Store has knowledge of frozen points and mandates that they go at the end. However, outside of some minor optimizations with respect to initial ID minting and ID scanning, the Store doesn't really need to know about frozen points.

The PR is broken into two commits:

Commit 1

Mechanically moves the start points handling into repr::Full and repr::Quantized and does minimal test rewrites on Store to compensate for the lack for direct frozen point knowledge.

Commit 2

A clean up pass. Instead of using std::ops::Range<u32> to represent start point ranges, this adds a bespoke Range that is closer to https://doc.rust-lang.org/std/range/struct.Range.html with the additional requirement that end >= start.

Small Perf Changes

When the Store/Freelist knew about the frozen points, we could optimize ID minting and ID scanning to not consider the frozen point range. With this PR, the Store doesn't know the start points are special. I think this is only a minor concern: there are usually only a handful of start points (usually one) for millions of vectors. So we add a few extra slot acquisition attempts but buy much more flexibility.

@hildebrandmw
Mark Hildebrand (hildebrandmw) requested review from a team and a balanced review from Copilot October 28, 2026 17:03
@hildebrandmw Mark Hildebrand (hildebrandmw) changed the title Mhildebr/start points out of store [diskann-inmem] Move start point handling out of Store. Oct 28, 2026

Copilot AI 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.

🟡 Changes recommended

Frozen IDs in the freelist can exhaust all 20 acquisition attempts, causing Store::acquire to return None even when a writable slot is available.

1 open issue
What changed in this PR

This PR moves start-point ownership from Store into the full and quantized representations, preparing the in-memory index for more flexible start-point placement.

Changes:

  • Makes stores and freelists manage a total ID limit without tracking a separate frozen-point range.
  • Moves capacity, start-point IDs, and total-point validation into representations.
  • Adds a copyable, validated Range type and updates accessors, integration wrappers, and tests.
File Description
diskann-inmem/​src/​store/​simple.rs Updates tests to initialize frozen slots explicitly.
diskann-inmem/​src/​store/​mod.rs Removes frozen-range ownership and uses total ID limits.
diskann-inmem/​src/​store/​intrusive.rs Adapts frozen-slot and acquisition tests.
diskann-inmem/​src/​repr/​quantized/​mod.rs Owns capacity and start-point IDs in the quantized representation.
diskann-inmem/​src/​repr/​internal/​simple.rs Updates test store construction.
diskann-inmem/​src/​repr/​internal/​quantization/​rerank.rs Updates reranking test store construction.
diskann-inmem/​src/​repr/​internal/​macros.rs Reads capacity from representations.
diskann-inmem/​src/​repr/​full.rs Owns capacity and start-point IDs in the full representation.
diskann-inmem/​src/​provider.rs Uses the new range type for search start points.
diskann-inmem/​src/​num.rs Adds validated ranges and boundary tests.
diskann-inmem/​src/​integration/​store/​simple.rs Converts configured capacity into an ID limit.
diskann-inmem/​src/​integration/​store/​mod.rs Reports slot counts from the total ID limit.
diskann-inmem/​src/​integration/​store/​intrusive.rs Adapts construction and panic documentation.
diskann-inmem/​src/​integration/​store/​checked.rs Adapts checked-store construction.
diskann-inmem/​src/​freelist.rs Uses IdLimit for minting, scanning, and recycling bounds.

Review effort: Balanced

Comment thread diskann-inmem/src/store/mod.rs Resolved
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.51485% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.10%. Comparing base (b83da5b) to head (3d95c32).

Files with missing lines Patch % Lines
diskann-inmem/src/freelist.rs 90.90% 1 Missing ⚠️
diskann-inmem/src/num.rs 98.83% 1 Missing ⚠️
diskann-inmem/src/repr/full.rs 94.11% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1527      +/-   ##
==========================================
+ Coverage   91.04%   92.10%   +1.05%     
==========================================
  Files         592      592              
  Lines      123565   123658      +93     
==========================================
+ Hits       112498   113890    +1392     
+ Misses      11067     9768    -1299     
Flag Coverage Δ
miri 92.10% <98.51%> (+1.05%) ⬆️
unittests 92.04% <98.51%> (+1.29%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
diskann-inmem/src/integration/store/checked.rs 100.00% <100.00%> (ø)
diskann-inmem/src/integration/store/intrusive.rs 100.00% <100.00%> (ø)
diskann-inmem/src/integration/store/mod.rs 96.55% <100.00%> (ø)
diskann-inmem/src/integration/store/simple.rs 100.00% <100.00%> (ø)
diskann-inmem/src/provider.rs 96.28% <100.00%> (ø)
diskann-inmem/src/repr/internal/macros.rs 100.00% <100.00%> (ø)
...ann-inmem/src/repr/internal/quantization/rerank.rs 98.75% <100.00%> (ø)
diskann-inmem/src/repr/internal/simple.rs 95.55% <100.00%> (ø)
diskann-inmem/src/repr/quantized/mod.rs 98.45% <100.00%> (+0.02%) ⬆️
diskann-inmem/src/store/intrusive.rs 93.95% <100.00%> (-0.03%) ⬇️
... and 5 more

... and 49 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hildebrandmw
Mark Hildebrand (hildebrandmw) merged commit 1e906aa into main Oct 28, 2026
30 checks passed
@hildebrandmw
Mark Hildebrand (hildebrandmw) deleted the mhildebr/start-points-out-of-store branch October 28, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants