Skip to content

Commit edc8123

Browse files
committed
fix: works
1 parent c633868 commit edc8123

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

include/svs/index/vamana/extensions.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,6 @@ double svs_invoke(
624624

625625
// Compute the distance using the appropriate distance function
626626
auto dist = svs::distance::compute(dist_f, query_span, indexed_span);
627-
fmt::print("Debug: Computing distance for ID {}: computed value = {}\n",
628-
internal_id, static_cast<double>(dist));
629627
return static_cast<double>(dist);
630628
}
631629

tests/utils/utils.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "svs/concepts/distance.h"
3838
#include "svs/core/distance.h"
3939
#include "svs/core/distance/euclidean.h"
40+
#include "svs/index/vamana/extensions.h"
4041

4142
#include "catch2/catch_approx.hpp"
4243
#include "catch2/matchers/catch_matchers_templated.hpp"
@@ -282,7 +283,7 @@ struct GetDistanceTester {
282283

283284
// Convert distance_type to a distance function
284285
svs::DistanceDispatcher dispatcher(distance_type);
285-
dispatcher([&](auto distance) {
286+
dispatcher([&](auto dist) {
286287
constexpr double TOLERANCE = 1e-5;
287288

288289
// Use a query vector for testing
@@ -298,14 +299,12 @@ struct GetDistanceTester {
298299
auto indexed_span = dataset.get_datum(id);
299300

300301
// Compute expected distance
301-
auto dist_copy = distance;
302+
auto dist_copy = svs::index::vamana::extensions::single_search_setup(dataset, dist);
303+
302304
svs::distance::maybe_fix_argument(dist_copy, query_span);
303305
double expected_distance =
304306
svs::distance::compute(dist_copy, query_span, indexed_span);
305307

306-
fmt::print(" index_distance: {}\n", index_distance);
307-
fmt::print(" expected_distance: {}\n", expected_distance);
308-
309308
// Test the distance calculation
310309
CATCH_REQUIRE(std::abs(index_distance - expected_distance) < TOLERANCE);
311310
}

0 commit comments

Comments
 (0)