Jegao/mutiple filtered test - #1319
Draft
Jerry Gao (Sanhaoji2) wants to merge 26 commits into
Draft
Conversation
Adds a production-style, query-time filter-match path for multihop search and the benchmark/report artifacts from the multiple-filter evaluation. diskann-label-filter: - New live_filter module: InlineAttributeIndex (builder) -> FrozenAttributeIndex exposing a QueryLabelProvider whose is_match evaluates an AND/OR (+equality) predicate live, per visited node, against the node's roaring attribute-id set (lock-free read, integer-encoded terminals, no FFI, no global posting list). NOT/relational operators are rejected; evaluation errors are treated as non-match. Includes unit tests. diskann-benchmark: - New search type 'topk-multihop-live-filter' (plugin + SearchPhase wiring) that builds the attribute index once from the label file and evaluates the filter live during search, so reported latency includes the real per-node filter cost. - filters.rs helpers: build_inline_attribute_index / make_live_providers. diskann-benchmark-core / diskann-benchmark-runner: - Add p99.9 latency percentile to the search output (percentiles, knn Summary, result DTO + console table). Adds diskann-benchmark/multiple_filter_test_report.md documenting the 9-case multihop vs beta vs live-filter comparison (recall + latency incl. p90/p99/p99.9). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds InlineAttributeIndexCsr/FrozenAttributeIndexCsr, an alternative to the roaring InlineAttributeIndex that stores each node's sorted attribute-ids in a flat CSR layout (offsets: Vec<u32> + values: Vec<u32>). is_match reads one contiguous row and answers each equality terminal with a binary_search, avoiding the HashMap probe and RoaringTreemap heap pointer-chases of the roaring path. Reuses AttributeEncoder/EncodedFilterExpr so predicate parsing, semantics, and errors are identical. Exported from lib.rs; includes parity unit tests asserting CSR == roaring per node. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 19cdd8e8-cc28-4b87-af2b-97a3f1ac9488
New criterion bench (live_filter_bench) comparing the per-node is_match cost of three representations of the same corpus/predicate: roaring treemap (current), flat CSR, and per-attribute posting bitmaps. All three are asserted to agree on every probe before timing. Tunable via LF_BENCH_N / LF_BENCH_PROBES. Run: cargo bench -p diskann-label-filter --bench main -- live_filter. Also repairs evaluator_bench, which used the removed \\\ operator and panicked at setup, blocking the shared bench binary; swapped for equivalent exact-array \\\ clauses. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 19cdd8e8-cc28-4b87-af2b-97a3f1ac9488
New multihop live-filter search type backed by the flat-CSR attribute index instead of the roaring HashMap<u32, RoaringTreemap>. Identical traversal and recall to topk-multihop-live-filter; only the per-node is_match differs. Wires the SearchPhase variant (graph_index.rs), the plugin (plugins.rs), registration + Plugin impl (benchmarks.rs), and build_inline_attribute_index_csr / make_live_providers_csr (filters.rs). End-to-end on the 10M index (k=150, L=150, 1 thread): 3.4x (S1) - 4.4x (S4) lower mean/p99 latency at equal recall. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 19cdd8e8-cc28-4b87-af2b-97a3f1ac9488
New section 8.1 documenting the is_match microbenchmark (roaring 14-20x slower than flat CSR) and the end-to-end A/B of topk-multihop-live-filter vs -csr (3.4-4.4x lower latency at equal recall), plus CSR artifacts in section 9. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 19cdd8e8-cc28-4b87-af2b-97a3f1ac9488
bin_cast: widen a DiskANN .bin file's element type (u8/i8/f16 -> f32). tsv_to_diskann_bin: convert a label-tagged TSV of embeddings into DiskANN bin + JSONL label/predicate files for compute_groundtruth and the filtered-search benchmark. Both are standalone CLIs used to prepare the multiple-filter test data. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 19cdd8e8-cc28-4b87-af2b-97a3f1ac9488
Add posting-list materialization, selectivity-adaptive CSR/bitmap selection, and bit-sliced lookup providers with parity and boundary tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expose bitmap, adaptive, and bit-sliced multihop search modes. Recreate lazy providers for every repetition and search-L run so materialization remains part of measured query latency. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document the posting bitmap crossover and the adaptive and bit-sliced results, including latency, selectivity, and memory tradeoffs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (67.01%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1319 +/- ##
==========================================
- Coverage 91.26% 90.53% -0.74%
==========================================
Files 517 521 +4
Lines 98511 101946 +3435
==========================================
+ Hits 89910 92298 +2388
- Misses 8601 9648 +1047
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
|
If this is intended to merge to main rather than being speculative/experimental changes, let me know and I can start a preliminary review. |
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
What does this implement/fix? Briefly explain your changes.
Any other comments?