Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/algorithm/hgraph/hgraph_mci_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ class Int8QueryCheckingHGraph : public vsag::HGraph {
int64_t k,
const std::string& parameters,
const vsag::FilterPtr& filter) const override {
// Build also calls this override from MCI workers. Catch2 assertions and the
// query counter are only safe here once the serial analyzer checks begin.
if (not inspect_queries) {
return vsag::HGraph::KnnSearch(query, k, parameters, filter);
}
REQUIRE(query->GetFloat32Vectors() == nullptr);
REQUIRE(query->GetInt8Vectors() != nullptr);
const auto dim = static_cast<uint64_t>(query->GetDim());
Expand All @@ -124,6 +129,7 @@ class Int8QueryCheckingHGraph : public vsag::HGraph {
return vsag::HGraph::KnnSearch(query, k, parameters, filter);
}

bool inspect_queries{false};
std::vector<int8_t> expected_vectors;
mutable uint64_t queries{0};
};
Expand Down Expand Up @@ -1626,7 +1632,8 @@ TEST_CASE("HGraph analyzer sends only typed INT8 query buffers", "[ut][hgraph][m
->Int8Vectors(index.expected_vectors.data())
->Owner(false);
REQUIRE(index.Build(dataset).empty());
index.queries = 0;
REQUIRE(index.queries == 0);
index.inspect_queries = true;
vsag::AnalyzerParam analyzer_params(common.allocator_.get());
analyzer_params.base_sample_size = total;
analyzer_params.topk = 3;
Expand Down
Loading