Skip to content

Commit 0419e2f

Browse files
committed
fix(test): builder test
1 parent 6626846 commit 0419e2f

2 files changed

Lines changed: 24 additions & 9 deletions

File tree

cpp/test/src/unit/test_builder.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -724,19 +724,22 @@ TEST(EvenRegularGraphBuilder, DynamicExplorationGraphWrapperAndSpanAddEntry) {
724724
std::mt19937 rng(42);
725725
deglib::builder::EvenRegularGraphBuilder builder(deg, rng);
726726

727-
std::vector<float> sample_vector(dims, 1.0f);
727+
std::uniform_real_distribution<float> dist(0.0f, 10.0f);
728+
std::vector<float> dataset(num_vectors * dims);
729+
for (auto& val : dataset) val = dist(rng);
730+
728731
for (uint32_t i = 0; i < num_vectors; ++i) {
729-
sample_vector[0] = static_cast<float>(i);
730-
builder.addEntry(100 + i, std::span<const float>(sample_vector));
732+
std::span<const float> vec(dataset.data() + i * dims, dims);
733+
builder.addEntry(100 + i, vec);
731734
}
732735

733736
auto status = builder.build();
734737
EXPECT_EQ(status.added, num_vectors);
735738
EXPECT_EQ(deg.size(), num_vectors);
736739

737740
// Verify search works on the built graph
738-
sample_vector[0] = 5.0f;
739-
auto results = deg.search(std::span<const float>(sample_vector), 1);
741+
std::span<const float> query(dataset.data() + 5 * dims, dims);
742+
auto results = deg.search(query, 1, 0.2f);
740743
EXPECT_EQ(results.size(), 1u);
741744
EXPECT_EQ(results.top().getIdentifier(), 105u); // Closest vector is label 105
742745
EXPECT_FLOAT_EQ(results.top().getDistance(), 0.0f);

readme.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ High-throughput approximate nearest neighbor and exploratory search library impl
1919

2020
- **C++20 header-only library** with native Python bindings (`deglib`)
2121
- **Dynamic streaming**: Incremental addition, removal, and continuous edge optimization
22-
- **Multi-threaded construction** and batch vector search with SIMD acceleration (AVX2, AVX-512, NEON)
23-
- **Supported data types**: `float32`, `uint8`, `float16`
22+
- **Multi-threaded construction** and batch vector search with SIMD acceleration (AVX2, AVX-512)
23+
- **Supported data types**: `float32`, `uint8`, `float16`, `evp-bits`
2424
- **Supported metrics**: Euclidean ($L_2$), Inner Product / Cosine, quantized EVP
2525
- **Exploratory graph traversal** and label-filtered nearest neighbor search
2626
- Compact graph serialization and lightweight read-only deployment mode
@@ -61,7 +61,7 @@ print("Distances:", distances)
6161
graph.save_graph("index.deg")
6262
```
6363

64-
For incremental dynamic updates (adding / deleting vectors on the fly) and advanced filtering, see the [Python Tutorials](https://dynamic-exploration-graph.readthedocs.io/en/latest/tutorials/building_graphs.html).
64+
For more Python examples, check the [examples/](https://github.com/Visual-Computing/DynamicExplorationGraph/blob/main/examples) directory or read the [Official Documentation](https://dynamic-exploration-graph.readthedocs.io/en/latest/tutorials/quickstart.html).
6565

6666
---
6767

@@ -107,8 +107,20 @@ int main() {
107107
}
108108
```
109109

110-
For CMake presets, test execution, and C++ benchmarks, see the [C++ README](cpp/readme.md).
110+
For full C++ build instructions, CMake presets, and architecture details, refer to the [cpp/ README](https://github.com/Visual-Computing/DynamicExplorationGraph/blob/main/cpp/readme.md).
111111

112+
---
113+
114+
## Repository Structure
115+
116+
```
117+
DynamicExplorationGraph/
118+
├── cpp/ # High-performance C++20 Header-Only library, CMake Presets, Tests & Benchmarks
119+
├── python/ # Python Bindings (deglib), Pytest Suite & Wheel Build Configuration
120+
├── examples/ # Ready-to-run Python examples (knng, dynamic_data, static_data, mips)
121+
├── java/ # Java implementation & Benchmarks
122+
└── docs/ # Sphinx / ReadTheDocs Documentation
123+
```
112124

113125
---
114126

0 commit comments

Comments
 (0)