This file captures the current shape of the DaiSy repository so future contributors and LLM agents can recover context quickly. It is intentionally operational, not aspirational.
DaiSy is an alpha-stage exact similarity-search library with:
- C++ core implementations
- Optional Python bindings
- Tests, demos, and benchmarks as separate build layers
- Multiple algorithm families spanning in-memory, disk-based, distributed, GPU, and streaming cases
The repo is broad, but integration is still somewhat manual. Many additions require touching several disconnected files.
lib/algos/: algorithm implementations and the main extension pointlib/distance_computers/: distance logic shared by algorithmslib/isax/: SAX/iSAX support used by several index-based algorithmslib/ds_tree/: tree structures used byHerculescommons/: shared loaders, params, test and benchmark helperspybinds/setup.cpp: Python binding entry pointtests/: C++ testsbenchmark/: benchmark executablesdemos/: C++ and Python usage examplesdocs/: contributor and architecture docsscripts/groundtruth/: utilities to generate or validate ground-truth data
When adding or changing an algorithm, the important wiring points are:
- Base interface:
lib/algos/SimilaritySearchAlgorithm.hpp - Source registration:
lib/algos/CMakeLists.txt - Public umbrella include:
lib/daisy.hpp - Python exposure:
pybinds/setup.cpp - Tests:
tests/CMakeLists.txtplus newtests/test_*.cpp - Benchmarks:
benchmark/CMakeLists.txtplus newbenchmark/bm_*.cpp - Demos:
demos/CMakeLists.txtplus newdemos/demo_*
The project does not currently centralize algorithm metadata in one place. Assume cross-file manual registration is required.
From the current source tree and public includes, the main algorithm set includes:
BruteforceLbBruteforceCoconutMessiParISSingOdysseySofaHerculesDumpyOSFresh
These algorithms do not all share the same dependency profile or feature set.
- Top-k search is the baseline capability.
- Range search is modeled through
SearchConfigand is not universally implemented. - Streaming insert is not a generic capability; default behavior throws.
setNormalized(bool)is a declaration about the input data, not a preprocessing step.- Data can come from in-memory arrays or file-backed sources via
DataSource.
If you extend behavior, keep these semantics stable unless you are intentionally redesigning the interface.
The root CMakeLists.txt drives feature toggles and dependency detection.
Important options:
BUILD_PYTHONBUILD_BENCHMARKBUILD_TESTSBUILD_DEMOBUILD_ODYSSEYBUILD_SINGBUILD_SOFABUILD_COCONUT
Current optional dependency model:
- MPI gates
Odyssey - CUDA gates
Sing - FFTW3 gates
Sofa - Coconut can be fully toggled off
Backward-compatibility option aliases exist for some old names such as MPI and CUDA toggles.
These are worth checking before assuming the tree is fully uniform:
pybinds/setup.cppis monolithic and repetitive; new bindings usually require copy-adapt work rather than a clean abstraction.- Several test entries for DTW are present but commented out in
tests/CMakeLists.txt. - Test and benchmark registration is manual and verbose.
- Optional algorithms are not uniformly guarded everywhere at the conceptual level, so verify includes and bindings carefully when adding new conditional code.
- The repo mixes “library architecture” docs with practical contributor docs; not every workflow detail is encoded in one canonical place.
Read these first:
docs/how-to-contribute.mdREADME.mdlib/algos/SimilaritySearchAlgorithm.hpp- A similar existing algorithm in
lib/algos/ lib/algos/CMakeLists.txtpybinds/setup.cpptests/CMakeLists.txtbenchmark/CMakeLists.txtdemos/CMakeLists.txt
Then decide:
- Is the algorithm always buildable, or optional?
- Does it support top-k only, or also range?
- Does it support L2 squared, DTW, or both?
- Does it need new loaders, new shared utilities, or only local code?
- Should it be exposed to Python now, or intentionally remain C++-only?
For a normal new algorithm contribution, expect to touch at least:
lib/algos/<Algo>.hpplib/algos/<Algo>.cpplib/algos/CMakeLists.txtlib/daisy.hppif it should be part of the public header surfacetests/test_<Algo>_*.cpptests/CMakeLists.txtdemos/demo_<Algo>_*.cpp- Python demo and binding files if supported from Python
README.md
Benchmarks are also expected for performance-oriented algorithms.
The current repo already has useful support docs:
docs/how-to-contribute.mddocs/benchmark-framework-guide.mddocs/test-framework-guide.mddocs/pybinds-guide.mddocs/demos-guide.md
Use them, but do not assume they fully replace source inspection. The repository still relies heavily on pattern matching against existing implementations.
- Do not edit only one layer and assume the job is done.
- Mirror existing algorithm naming exactly across files.
- Prefer the nearest existing algorithm as a template.
- Be explicit about unsupported features.
- Keep optional dependencies optional.
- If you add a build flag, document it immediately.
- If you notice a current inconsistency, record it in docs or fix it in the same change if safe.
Update CONTINUITY.md when:
- A new algorithm is added or removed
- The expected contributor workflow changes
- A major build flag or optional dependency changes
- Python binding structure changes materially
- Tests, demos, or benchmarks gain a new required pattern
- A major known rough edge is fixed or a new one appears