Repository navigation
Compare queue insertion-search strategies in CI - #1602
Draft
Wei Wu (wuw92) wants to merge 10 commits into
Draft
Wei Wu (wuw92) wants to merge 10 commits into
Wei Wu (wuw92) wants to merge 10 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>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Apply the measured insertion-only hybrid above filled length 1024 and retain baseline, binary, and earlier hybrid comparisons in CI. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep small-queue insertion on the original inline lookup path and compare the outlined candidate with both the original scan and prior guarded implementation. Preserve the existing cases, seeds, timing harness, and release flags. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Wei Wu (wuw92)
marked this pull request as draft
November 17, 2026 01:44
Wei Wu (wuw92)
changed the base branch from
wuw92-beam-queue-benchmark
to
main
November 17, 2026 01:44
Restore the original fixture reset, workloads, and repetition counts. Keep new(L) unchanged and select lookup through with_insertion_search and benchmark input. Remove source-rewriting variants and standalone lookup timings. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1602 +/- ##
==========================================
- Coverage 92.14% 91.16% -0.98%
==========================================
Files 621 623 +2
Lines 130986 131313 +327
==========================================
- Hits 120694 119710 -984
- Misses 10292 11603 +1311
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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
Standalone draft targeting
main, related to #1590 and #1600. This branch includes their batch-insertion and benchmark infrastructure; neither existing PR is modified. Fixed revisiona58bd09808915b3f457008217cb369a201677fd0is the workload reference, not this PR's base branch.What does this implement/fix? Briefly explain your changes.
Compare four real queue-update groups: original
insert, originalbatch_insert,insertwith a configured insertion-point search, andbatch_insertwith that search. The benchmark input selects the strategy; this PR does not select or recommend an automatic production crossover.NeighborPriorityQueue::new(L)and the resizable constructor keep their existing signatures and original SIMD/scalar lookup. The additive.with_insertion_search(InsertionSearch)method selects linear, binary, or a hybrid with an explicitly suppliedlinear_scan_limit. The selection applies to the actual insert lookup and the batch merge's initial prefix lookup. Removal, the top-L partition, sorting, merging, and cursor/visited handling are unchanged. Existing constructor callers are unchanged. No Cargo feature, callback injection API, or hardcoded 1024-element dispatch remains.Restore #1600's fixture generation, per-item reset, scalar work model, timer loop, method rotation, and configured repetition counts. Its example input remains unchanged: 23 cases, seed 20261113, eight fixtures, two blocks, nine rounds. Only the optional
insertion_searchfield and its queue construction plumbing are added to the benchmark. A Windows test that incorrectly required a short measured interval to exceed zero now accepts finite nonnegative durations; neither the timer nor repetitions were changed to accommodate it.One executable runs the original input and a copy that differs only in
insertion_search, with three independent processes per input in alternating order. The checked-in strategy configuration selects pure binary search. Hybrid remains an explicit input option, not an automatically chosen optimization. The driver no longer rewrites queue source, generates an expanded matrix, caps repetitions, or runs a lookup-only suite. It checks the original workload and measurement bodies before building, and retains binaries, source/input hashes, commands, environment, raw samples, and per-process comparisons. Speedup is linear / configured time for the same update method; historical timings are not pooled.Any other comments?
Current source:
a9f3d0b2c1de75d18d95965c41f82a7f5e3a7afb. The fresh three-platform benchmark CI passes on Linux x86-64, Linux ARM64, and Windows. All 18 independent processes and 138 same-method comparisons were re-audited against retained inputs, binaries, source hashes, and the fixed revision. This is completion of the configurable comparison, not acceptance of pure binary search as a general optimization. The PR remains a draft; no merge or auto-merge is enabled.Measured tradeoff. Pure binary search improves large-L insertion but loses on small-L insertion and many batch updates. The table shows full/uniform/shuffled cases from the original workload, with speedup = linear / binary. These are ratios of three process medians, not confidence intervals. The complete 23-case tables, all four groups' ns/update, individual process medians/ranges, raw nine-round samples, and conservative repeatability screens are in each artifact and the CI job summaries; no unfavorable case is excluded from them.
Windows L2000/N8 batch is inconclusive because the linear process medians vary substantially; the 0.836x point estimate is not a stable-loss claim. The large L2000/N2000 insertion result passes the consistent-direction/process-range screen on all three platforms. Neither batch-wide acceleration nor an architecture-independent crossover is established. Only one seed and the original fixture population were used; these warm-fixture microbenchmarks do not establish end-to-end ANN performance.
Complete tables and raw evidence: Linux x86, Linux ARM64, Windows. Each contains
summary.md,comparisons.json,process-medians.json, six raw result JSON files, exact commands, input/source/executable hashes, the executable, and build/test/environment logs. The run page exposes the same full tables in job summaries. Artifacts require GitHub access and have 30-day server retention; downloaded copies are preserved. Artifact hidden-file filtering omits.cargo/config.toml; its recorded hash was verified against the pinned repository config, which remains the authoritative source of build target flags.Runners: Linux x86 AMD EPYC 9V74, Linux ARM Neoverse-N2, Windows AMD EPYC 7763. All use rustc 1.97.1 and the same locked release build configuration. Linux timing children use the first allowed logical CPU; Windows inherits runner affinity. Exact OS/kernel, flags, affinity, source, executable, and invocation details are retained per artifact. Shared CI is not assumed quieter than local hardware.
Reproduce from the current source, without overlapping builds or benchmarks:
The candidate configuration is
diskann-benchmark/example/neighbor-queue-search-strategy.json.build --search-config <path>selects another explicit search configuration without changing cases, reset, or repetition controls.Local validation:
cargo test --locked --release -p diskann -p diskann-benchmark neighbor --features diskann/experimental_diversity_search: passed, 77 library and seven benchmark tests.cargo clippy --locked --release -p diskann -p diskann-benchmark --all-targets -- -D warnings: passed.cargo fmt --all -- --check: passed.python .github/scripts/test_benchmark_queue_search.py: passed, seven comparison/measurement-contract tests.python .github/scripts/benchmark_queue_search.py build --output <artifact-directory>: passed; includes 41 targeted queue tests.python .github/scripts/benchmark_queue_search.py run --output <artifact-directory>andsummarize --output <artifact-directory>: passed; six processes and 46 same-method comparisons using the original 23 cases.git diff --check: passed.The benchmark CI repeats targeted tests, Clippy, formatting, build, and the original-workload comparison on all three platforms. Full workspace tests and end-to-end ANN benchmarks were not run locally; the separate general CI workflow is outside this benchmark result. Numeric/tie tests and configured real-queue comparisons cover NaN filtering, NaN removal, signed zero, infinities, partial fill, unique IDs, buffer reuse, visited/cursor state, capacity, and resizable queues.
Historical experiments remain available in round 1, round 2, round 3, and round 4. Those runs used the superseded harness and/or automatic insertion-only dispatch. They do not establish this corrected four-group comparison. Their raw artifacts and source revisions are preserved; the previous small-L and boundary regressions are not reclassified as noise or resolved by this interface change.