Remove dead pub code in diskann-tools and diskann-disk#1185
Conversation
The search_disk_index and build_disk_index modules in diskann-tools were unused: their public items had zero callers anywhere in the workspace. The only external references were the glob re-exports in utils/mod.rs. The disk index build/search entry points are provided by diskann-benchmark's own implementations, and no bin target invoked these modules (the corresponding range_search_disk_index bin is already disabled). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Delete six never-referenced test size constants from diskann-tools test_utils (keeping TEST_DATASET_SIZE_SMALL and TEST_NUM_DIMENSIONS_RECOMMENDED, which the random_data_generator tests use), across both the miri and non-miri variants. Delete diskann-disk's AssociatedDataFilter type and default_associated_data_filter function: unlike its live twin VectorFilter/default_vector_filter (wired into disk_provider search), the associated-data variant was never used by any production path and was exercised only by its own unit test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1185 +/- ##
==========================================
+ Coverage 89.46% 89.77% +0.30%
==========================================
Files 487 485 -2
Lines 92170 91762 -408
==========================================
- Hits 82460 82378 -82
+ Misses 9710 9384 -326
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR removes unused public API surface area from diskann-tools and diskann-disk, focusing on exports that were no longer wired into any live build/search paths and test-only helpers that had no remaining references.
Changes:
- Removed the unused
search_disk_indexandbuild_disk_indexutility modules (and their re-exports) fromdiskann-tools. - Deleted the unused
AssociatedDataFilteranddefault_associated_data_filter(and its unit test) fromdiskann-disk. - Trimmed
diskann-toolstest fixture constants to only those still referenced by tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| diskann-tools/src/utils/test_utils.rs | Removes unreferenced size constants, keeping only constants still used by random_data_generator tests. |
| diskann-tools/src/utils/search_disk_index.rs | Deletes an unused disk index search entry layer from diskann-tools. |
| diskann-tools/src/utils/mod.rs | Stops exporting the removed disk-index build/search modules from the diskann-tools::utils API. |
| diskann-tools/src/utils/build_disk_index.rs | Deletes an unused disk index build entry layer (and its local unit tests) from diskann-tools. |
| diskann-disk/src/build/configuration/filter_parameter.rs | Removes the unused associated-data filter API and its test, leaving the live VectorFilter path intact. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The two surviving size constants were used only by the random_data_generator test module. Inline them there as private consts (preserving the miri/non-miri split) and drop the test_utils module and its re-export, removing one more file and public export surface. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
These are still being referenced in some internal tests. Please double check that they are indeed safe to remove and if so, please update the internal tests accordingly. |
What was cleaned
diskann-toolsdisk-index entry layer —search_disk_index/build_disk_indexmodules. The live disk build/search paths live indiskann-benchmark; nobinreaches these.diskann-diskAssociatedDataFilter+default_associated_data_filter— the unwired twin of the liveVectorFilter/default_vector_filter; only its own unit test touched it.diskann-toolstest fixtures — six unreferenced size constants intest_utils(bothmirivariants), inlining the two therandom_data_generatortests.How these were detected
cargo public-apienumerates each crate's real export surface — including items behind glob re-exports (pub use mod::*), whichunreachable_pubtreats as reachable anddead_codeskips because they arepub. Cross-referencing each exported symbol against workspace callers isolates the ones with zero real references, separating genuine dead code from items that are merelypub-too-wide or test-only.