Measure batched neighbor queue insertion - #1600
Draft
Wei Wu (wuw92) wants to merge 14 commits into
Draft
Wei Wu (wuw92) wants to merge 14 commits into
Wei Wu (wuw92) wants to merge 14 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Wei Wu (wuw92)
force-pushed
the
wuw92-beam-queue-benchmark
branch
from
November 13, 2026 11:55
1387514 to
ba0b492
Compare
Wei Wu (wuw92)
force-pushed
the
wuw92-beam-queue-batching
branch
from
November 13, 2026 11:55
da80f17 to
25e8b68
Compare
Wei Wu (wuw92)
changed the base branch from
wuw92-beam-queue-batching
to
main
November 13, 2026 12:47
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1600 +/- ##
==========================================
+ Coverage 92.14% 92.26% +0.12%
==========================================
Files 621 629 +8
Lines 130986 133398 +2412
==========================================
+ Hits 120694 123082 +2388
- Misses 10292 10316 +24
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
4 of 5 tasks
Wei Wu (wuw92)
force-pushed
the
wuw92-beam-queue-benchmark
branch
from
November 19, 2026 08:20
93fc8fb to
a58bd09
Compare
Keep linear lookup as the default and allow binary lookup or a caller-configured size threshold for individual inserts and batch prefix lookup. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep binary top-L partitioning, merge candidates backwards, and copy old runs in place without a separate lower-bound prefix lookup. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep binary top-L partitioning, merge candidates backwards, and copy old runs in place without a separate lower-bound prefix lookup. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use exponential probing and local binary lookup to locate contiguous old runs without scanning each old distance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve timer-resolution zeros, omit unresolved ratios, and reject negative or nonfinite measurements. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use stable descending candidate order and standard slice operations while preserving sequential insertion tie behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use insert when cutoff filtering leaves one candidate. Find old-entry merge boundaries with a right-to-left exponential search. Express old/new top-L selection as a partition point with explicit bounds. Keep cursor updates and equal-distance ordering consistent with insert. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use 18 workload cases and 15 samples per process. Cover sparse cutoff survivors, input ordering, placement, and partial occupancy. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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.
Reference Issues/PRs
Queue-only benchmarks for #1590. This PR is not intended to merge.
What does this implement/fix? Briefly explain your changes.
Compare per-item
insertwith fixed-capacitybatch_insertusing the same fixtures. Untimed verification compares the ordered IDs and distance bit patterns, the unvisited sequence, and buffer reuse against sequential insertion.The workload covers 18 cases with different queue capacities, batch sizes, initial queue sizes, cutoff survivors, and candidate placements and orders. Fixture generation, queue reset, and candidate refill are outside the timer.
Any other comments?
Current results
Three-platform CI run: all three benchmark jobs passed. Benchmark head:
67deb5c1c5f4887bf4c9be275e0104e3942f42d4; measured CI merge:588b3e1931e220d61d16a21931af0752dcdda7ea.At L=2000/N=2000, batch_insert speedup over insert is 3.59x on Linux x64, 18.47x on Linux ARM64, 6.66x on Windows x64. Results depend on cutoff survivors, input order, placement, and queue occupancy. These measurements isolate queue updates, not end-to-end search speedups.
With L=20, N=64, and all candidates passing the initial cutoff, shuffled input is slower with batch_insert on all three platforms, both for full queues and for queues starting with 10 entries. Ascending and descending input are faster with batch_insert. Singleton results vary by platform.
Method and environment
Three independent processes per platform, 15 samples per process, eight shared fixtures, two blocks per sample, seed 20261113. Table values are medians over all 45 samples per method. Method order rotates. Fixture generation, queue reset, candidate refill, and verification are outside the timer.
At L=2000/N=2000, per-process speedup ratios range from 3.576-3.603x on Linux x64, 18.294-18.511x on Linux ARM64, 6.632-6.740x on Windows x64. Raw samples and all process medians are in the artifacts below.
All builds use Rust 1.97.1, LLVM 22.1.6,
cargo build --locked --release -p diskann-benchmark, and the repository's target configuration. Each job builds once and reuses its binary for all three processes. Runners are shared VMs; elapsed times are reference measurements and can vary with VM load.Speedup is a ratio of pooled medians, not a median of paired ratios. Small timings are sensitive to timer resolution and process variation; a rounded 1.00x does not establish parity.
Full measurement table
Each cell is insert µs → batch_insert µs; speedup. Speedup is
median(insert) / median(batch_insert), computed from unrounded samples: above 1x favors batch_insert; below 1x means a regression. N is the input candidate count. Cutoff survivors pass the initial queue cutoff; they are not necessarily retained in the final top-L.Run
From this PR's checkout, run the 18-case workload without a dataset (PowerShell):
The summary script reports
batch_insert / insert; values below 1 favor batching. Editneighbor-queue.jsonto change workload parameters. To reproduce the measured build, use the CI merge revision identified above.Raw results
Artifacts contain the environment, three raw result files, logs, and per-process medians. Downloads are retained for 30 days: