Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a3c5986
copilot's handy work
JordanMaples Apr 8, 2026
385b875
clippy
JordanMaples Apr 9, 2026
4d80c09
migrate multihop filtering test and search_utils to diskann
JordanMaples Apr 9, 2026
ed025bd
migrate test_multihop_callback_enforces_filtering to diskann
JordanMaples Apr 9, 2026
76e34fa
:wfix clippy: gate panicking test helpers with cfg(test)
JordanMaples Apr 9, 2026
b7d238b
formatter
JordanMaples Apr 13, 2026
1558165
had ai fix the clippy errors
JordanMaples Apr 13, 2026
218a63a
refactor: extract shared helpers in multihop tests
JordanMaples Apr 13, 2026
f6f9367
add two-hop reachability test for multihop search
JordanMaples Apr 13, 2026
aa46d06
Merge branch 'main' into jordanmaples/migrate_unittests
JordanMaples Apr 13, 2026
299c609
Merge branch 'main' into jordanmaples/migrate_unittests
JordanMaples Apr 14, 2026
1dbbda8
Merge branch 'main' into jordanmaples/migrate_unittests
JordanMaples Apr 15, 2026
6c7dd85
Add unit tests for NotInMutWithLabelCheck predicate
JordanMaples Apr 17, 2026
9c85d26
Rework multihop tests: unit tests + baselines, remove search_utils
JordanMaples Apr 17, 2026
a77f01a
Remove stale duplication comment from diskann-providers search_utils
JordanMaples Apr 17, 2026
d13d94e
Revert cosmetic search_utils.rs changes and make mod private
JordanMaples Apr 20, 2026
bb8cfd5
Merge branch 'main' into jordanmaples/migrate_unittests
JordanMaples Apr 20, 2026
4ab95b6
Merge branch 'main' into jordanmaples/migrate_unittests
JordanMaples Apr 21, 2026
8b6c08f
Merge branch 'main' into jordanmaples/migrate_unittests
JordanMaples Apr 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
790 changes: 3 additions & 787 deletions diskann-providers/src/index/diskann_async.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion diskann/src/graph/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use crate::{
};

mod knn_search;
mod multihop_search;
pub(crate) mod multihop_search;
mod range_search;

pub mod record;
Expand Down
54 changes: 54 additions & 0 deletions diskann/src/graph/search/multihop_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,57 @@ where

Ok(make_stats(scratch))
}

#[cfg(test)]
mod tests {
use super::*;

/// A simple label evaluator that matches only even IDs.
#[derive(Debug)]
struct EvenOnly;

impl QueryLabelProvider<u32> for EvenOnly {
fn is_match(&self, id: u32) -> bool {
id.is_multiple_of(2)
}
}

#[test]
fn predicate_eval_requires_not_visited_and_matching() {
let mut visited = HashSet::new();
visited.insert(2u32);
let label = EvenOnly;
let pred = NotInMutWithLabelCheck::new(&mut visited, &label);

// Not visited + matches label → true
assert!(pred.eval(&4));

// Already visited + matches label → false
assert!(!pred.eval(&2));

// Not visited + doesn't match label → false
assert!(!pred.eval(&3));

// Already visited + doesn't match → false
visited.insert(3);
let pred = NotInMutWithLabelCheck::new(&mut visited, &label);
assert!(!pred.eval(&3));
}

#[test]
fn predicate_eval_mut_inserts_only_matching() {
let mut visited = HashSet::new();
let label = EvenOnly;
let mut pred = NotInMutWithLabelCheck::new(&mut visited, &label);

// Matching + not visited → inserts and returns true
assert!(pred.eval_mut(&4));
// Second call → already visited, returns false
assert!(!pred.eval_mut(&4));

// Non-matching → not inserted, returns false
assert!(!pred.eval_mut(&3));
// Confirm 3 was NOT added to visited set
assert!(!pred.visited_set.contains(&3));
}
}
1 change: 1 addition & 0 deletions diskann/src/graph/test/cases/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mod consolidate;
mod grid_insert;
mod grid_search;
mod inplace_delete;
mod multihop;
mod paged_search;
mod range_search;

Expand Down
Loading
Loading