Skip to content

Conversation

@ibhati
Copy link
Member

@ibhati ibhati commented Jan 22, 2026

This PR implements save and load functionality for IVF indices using dense cluster storage, enabling serialization and restoration of both static and dynamic IVF indices without requiring the original dataset.

Changes:

Added save/load support for DenseClusteredDataset, IVFIndex, and DynamicIVFIndex
Implemented directory-based and stream-based serialization formats
Added comprehensive test coverage across C++ unit tests, integration tests, and Python bindings

@ibhati ibhati requested a review from Copilot January 23, 2026 20:22
Copy link
Contributor

Copilot AI left a comment

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 implements save and load functionality for IVF indices using dense cluster storage, enabling serialization and restoration of both static and dynamic IVF indices without requiring the original dataset.

Changes:

  • Added save/load support for DenseClusteredDataset, IVFIndex, and DynamicIVFIndex
  • Implemented directory-based and stream-based serialization formats
  • Added comprehensive test coverage across C++ unit tests, integration tests, and Python bindings

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/svs/index/ivf/index.cpp Added unit tests for IVF index save/load and DenseClusteredDataset serialization
tests/svs/index/ivf/dynamic_ivf.cpp Added unit tests for DynamicIVF save/load functionality
tests/integration/ivf/index_search.cpp Added integration tests for directory-based and stream-based IVF save/load
tests/integration/ivf/dynamic_scalar.cpp Added integration tests for DynamicIVF save/load with recall verification
include/svs/orchestrators/ivf.h Added save/load methods to IVF orchestrator interface and implementation
include/svs/orchestrators/dynamic_ivf.h Added save/load methods to DynamicIVF orchestrator interface
include/svs/index/ivf/index.h Implemented save method and load_ivf_index function for static IVF indices
include/svs/index/ivf/dynamic_ivf.h Updated save method to use DenseClusteredDataset serialization and added load_dynamic_ivf_index function
include/svs/index/ivf/clustering.h Implemented save/load methods for DenseClusteredDataset with binary serialization format
examples/python/example_ivf_dynamic.py Updated example to demonstrate save/load functionality
examples/python/example_ivf.py Added save/load demonstration to IVF example
bindings/python/tests/test_ivf.py Added Python test for IVF save/load functionality
bindings/python/tests/test_dynamic_ivf.py New file with comprehensive DynamicIVF tests including save/load
bindings/python/src/ivf.cpp Added Python bindings for IVF save/load methods
bindings/python/src/dynamic_ivf.cpp Added Python bindings for DynamicIVF load method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Constructor for empty clusters (for assembly/dynamic operations)
template <typename Alloc>
DenseClusteredDataset(size_t num_clusters, size_t dimensions, const Alloc& allocator)
// Note: This constructor creates empty clusters using the default allocator for Data
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The documentation comment on line 346 incorrectly states this constructor uses the default allocator for Data. However, the constructor signature has been changed to remove the allocator parameter, so the comment should be updated to reflect this change.

Suggested change
// Note: This constructor creates empty clusters using the default allocator for Data
// Note: This constructor creates empty clusters with the given dimensionality

Copilot uses AI. Check for mistakes.
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.

2 participants