Skip to content

Remove dead pub code in diskann-tools and diskann-disk#1185

Open
wuw92 wants to merge 3 commits into
mainfrom
wewu2/remove-dead-disk-index-tool-modules
Open

Remove dead pub code in diskann-tools and diskann-disk#1185
wuw92 wants to merge 3 commits into
mainfrom
wewu2/remove-dead-disk-index-tool-modules

Conversation

@wuw92

@wuw92 wuw92 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What was cleaned

  • diskann-tools disk-index entry layersearch_disk_index / build_disk_index modules. The live disk build/search paths live in diskann-benchmark; no bin reaches these.
  • diskann-disk AssociatedDataFilter + default_associated_data_filter — the unwired twin of the live VectorFilter / default_vector_filter; only its own unit test touched it.
  • diskann-tools test fixtures — six unreferenced size constants in test_utils (both miri variants), inlining the two the random_data_generator tests.

How these were detected

cargo public-api enumerates each crate's real export surface — including items behind glob re-exports (pub use mod::*), which unreachable_pub treats as reachable and dead_code skips because they are pub. Cross-referencing each exported symbol against workspace callers isolates the ones with zero real references, separating genuine dead code from items that are merely pub-too-wide or test-only.

wuw92 and others added 2 commits June 18, 2026 09:58
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-commenter

codecov-commenter commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.77%. Comparing base (3aa44ac) to head (bc0c37b).

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
miri 89.77% <ø> (+0.30%) ⬆️
unittests 89.42% <ø> (+0.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...n-disk/src/build/configuration/filter_parameter.rs 100.00% <ø> (ø)
diskann-tools/src/utils/random_data_generator.rs 97.14% <ø> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wuw92 wuw92 marked this pull request as ready for review June 18, 2026 06:35
@wuw92 wuw92 requested review from a team and Copilot June 18, 2026 06:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_index and build_disk_index utility modules (and their re-exports) from diskann-tools.
  • Deleted the unused AssociatedDataFilter and default_associated_data_filter (and its unit test) from diskann-disk.
  • Trimmed diskann-tools test 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.

Comment thread diskann-tools/src/utils/test_utils.rs Outdated
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>
@hildebrandmw

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants