Add algorithm and benchmark for filtered range search#1228
Open
magdalendobson wants to merge 41 commits into
Open
Add algorithm and benchmark for filtered range search#1228magdalendobson wants to merge 41 commits into
magdalendobson wants to merge 41 commits into
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
added 10 commits
July 6, 2026 15:38
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces filtered range search into the diskann search stack and wires it into diskann-benchmark, along with new groundtruth artifacts and integration tests. It also tightens unfiltered range-search behavior to better respect max_returned and adds regression tests to prevent future violations.
Changes:
- Added
FilteredRangesearch type todiskann(new implementation + exports) and created dedicated integration tests/baselines. - Extended
diskann-benchmark/diskann-benchmark-coreto accept a new"filtered-range"search phase and run end-to-end integration tests. - Added new (LFS-backed) range-search groundtruth files and test inputs.
Reviewed changes
Copilot reviewed 22 out of 32 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test_data/yfcc/groundtruth_rad_75000.rangeres | Adds YFCC range-search groundtruth pointer (LFS). |
| test_data/yfcc/groundtruth_rad_110000_filtered.rangeres | Adds YFCC filtered-range groundtruth pointer (LFS). |
| test_data/disk_index_search/groundtruth_rad_125000_filtered.rangeres | Adds filtered-range groundtruth pointer (LFS) for benchmark integration test data. |
| diskann/test/generated/graph/test/cases/range_search/max_results_respected_means_no_second_round.json | New baseline for range-search max_returned behavior. |
| diskann/test/generated/graph/test/cases/range_search/max_results_respected_and_second_round_triggered.json | New baseline for second-round triggering when max_returned allows it. |
| diskann/test/generated/graph/test/cases/filtered_range_search/two_round_search.json | New filtered-range baseline. |
| diskann/test/generated/graph/test/cases/filtered_range_search/max_results_respected_means_no_second_round.json | New filtered-range baseline. |
| diskann/test/generated/graph/test/cases/filtered_range_search/max_results_respected_and_second_round_triggered.json | New filtered-range baseline. |
| diskann/test/generated/graph/test/cases/filtered_range_search/inner_radius_filtering.json | New filtered-range baseline for inner radius behavior. |
| diskann/test/generated/graph/test/cases/filtered_range_search/divisible_by_four_filter_second_round_triggered.json | New filtered-range baseline for selective filter + second round. |
| diskann/test/generated/graph/test/cases/filtered_range_search/divisible_by_four_filter_no_second_round_from_max_results.json | New filtered-range baseline for selective filter + max_returned interaction. |
| diskann/test/generated/graph/test/cases/filtered_range_search/divisible_by_four_filter_no_second_round_from_l_search.json | New filtered-range baseline for selective filter + larger starting_l. |
| diskann/test/generated/graph/test/cases/filtered_range_search/basic_range_search.json | New filtered-range baseline for basic search. |
| diskann/src/graph/test/cases/range_search.rs | Exposes shared helpers/baseline struct and adds new max_returned regression tests. |
| diskann/src/graph/test/cases/mod.rs | Registers new filtered-range test module. |
| diskann/src/graph/test/cases/filtered_range_search.rs | Adds integration tests and baselines for filtered range search. |
| diskann/src/graph/search/range_search.rs | Ensures second round + frontier expansion honor max_returned. |
| diskann/src/graph/search/mod.rs | Adds filtered-range module and re-exports FilteredRange. |
| diskann/src/graph/search/inline_filter_search.rs | Makes internal return type/function pub(crate) for reuse by filtered-range search. |
| diskann/src/graph/search/filtered_range_search.rs | Implements the new FilteredRange search type and its internal second-round expansion. |
| diskann/src/graph/glue.rs | Adds PartialEq/Eq derives for Decision<T>. |
| diskann-benchmark/src/main.rs | Adds benchmark integration tests for range and filtered-range JSON examples. |
| diskann-benchmark/src/inputs/graph_index.rs | Adds "filtered-range" search phase schema + validation. |
| diskann-benchmark/src/index/search/range.rs | Generalizes range runner to support both range and filtered-range backends via parameter mapping. |
| diskann-benchmark/src/index/search/plugins.rs | Adds filtered-range plugin entry. |
| diskann-benchmark/src/index/result.rs | Adds RangeSearchResults::new_filtered constructor for filtered-range summaries. |
| diskann-benchmark/src/index/inmem/spherical.rs | Wires filtered-range plugin into spherical in-mem benchmark path. |
| diskann-benchmark/src/index/benchmarks.rs | Wires filtered-range plugin into benchmark registry + job runner. |
| diskann-benchmark/example/graph-index-filter-range.json | Adds example job config for "filtered-range". |
| diskann-benchmark-core/src/search/mod.rs | Documents filtered-range support. |
| diskann-benchmark-core/src/search/graph/mod.rs | Exposes new filtered_range module. |
| diskann-benchmark-core/src/search/graph/filtered_range.rs | Adds benchmark-core searcher + aggregation plumbing for filtered-range. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+215
to
+219
| InternalSearchStats { | ||
| cmps, | ||
| hops: hops + range_stats.hops, | ||
| range_search_second_round: true, | ||
| }, |
Comment on lines
+6
to
+9
| //! Tests for filtered range search using an always-true filter. | ||
| //! | ||
| //! These cover the filtered-range cases directly and validate the filtered-range | ||
| //! behavior against its own baselines. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
This PR adds an algorithm for filtered range search to the DiskANN repository. Details of the algorithm, along with the experiments supporting it, are at this Wiki page.
This PR:
diskann, along with integration tests.diskann-benchmark, along with an integration test.test_data.Some enhancements/fixes to range search along the way:
test_datafor yfcc.