| 2211 | } |
| 2212 | |
| 2213 | static void |
| 2214 | TestHGraphSearchOverTime(const fixtures::HGraphTestIndexPtr& test_index, |
| 2215 | const fixtures::HGraphResourcePtr& resource) { |
| 2216 | using namespace fixtures; |
| 2217 | auto origin_size = vsag::Options::Instance().block_size_limit(); |
| 2218 | auto size = GENERATE(1024 * 1024 * 2); |
| 2219 | constexpr const char* search_param = R"({ |
| 2220 | "hgraph": { |
| 2221 | "ef_search": 200, |
| 2222 | "timeout_ms": 5.0 |
| 2223 | } |
| 2224 | })"; |
| 2225 | for (auto metric_type : resource->metric_types) { |
| 2226 | for (auto dim : resource->dims) { |
| 2227 | for (auto& [base_quantization_str, recall] : resource->test_cases) { |
| 2228 | INFO(fmt::format("metric_type: {}, dim: {}, base_quantization_str: {}, recall: {}", |
| 2229 | metric_type, |
| 2230 | dim, |
| 2231 | base_quantization_str, |
| 2232 | recall)); |
| 2233 | if (HGraphTestIndex::IsRaBitQ(base_quantization_str) && |
| 2234 | dim < fixtures::RABITQ_MIN_RACALL_DIM) { |
| 2235 | dim = fixtures::RABITQ_MIN_RACALL_DIM; |
| 2236 | } |
| 2237 | vsag::Options::Instance().set_block_size_limit(size); |
| 2238 | HGraphTestIndex::HGraphBuildParam build_param( |
| 2239 | metric_type, dim, base_quantization_str); |
| 2240 | auto param = HGraphTestIndex::GenerateHGraphBuildParametersString(build_param); |
| 2241 | auto index = TestIndex::TestFactory(test_index->name, param, true); |
| 2242 | auto dataset = HGraphTestIndex::pool.GetDatasetAndCreate( |
| 2243 | dim, resource->base_count, metric_type); |
| 2244 | TestIndex::TestBuildIndex(index, dataset, true); |
| 2245 | TestIndex::TestSearchOvertime(index, dataset, search_param); |
| 2246 | vsag::Options::Instance().set_block_size_limit(origin_size); |
| 2247 | } |
| 2248 | } |
| 2249 | } |
| 2250 | } |
| 2251 | |
| 2252 | TEST_CASE("(PR) HGraph Search Over Time", "[ft][hgraph][pr]") { |
| 2253 | auto test_index = std::make_shared<fixtures::HGraphTestIndex>(); |
no test coverage detected