| 707 | vsag::Options::Instance().set_block_size_limit(origin_size); |
| 708 | } |
| 709 | static void |
| 710 | TestHGraphBuild(const fixtures::HGraphTestIndexPtr& test_index, |
| 711 | const fixtures::HGraphResourcePtr& resource) { |
| 712 | using namespace fixtures; |
| 713 | auto origin_size = vsag::Options::Instance().block_size_limit(); |
| 714 | auto size = GENERATE(1024 * 1024 * 2); |
| 715 | auto search_param = fmt::format(fixtures::search_param_tmp, 200, false); |
| 716 | |
| 717 | for (auto metric_type : resource->metric_types) { |
| 718 | for (auto dim : resource->dims) { |
| 719 | for (auto& [base_quantization_str, recall] : resource->test_cases) { |
| 720 | INFO(fmt::format("metric_type: {}, dim: {}, base_quantization_str: {}, recall: {}", |
| 721 | metric_type, |
| 722 | dim, |
| 723 | base_quantization_str, |
| 724 | recall)); |
| 725 | if (HGraphTestIndex::IsRaBitQ(base_quantization_str) && |
| 726 | dim < fixtures::RABITQ_MIN_RACALL_DIM) { |
| 727 | dim = fixtures::RABITQ_MIN_RACALL_DIM; |
| 728 | } |
| 729 | |
| 730 | vsag::Options::Instance().set_block_size_limit(size); |
| 731 | |
| 732 | HGraphTestIndex::HGraphBuildParam build_param( |
| 733 | metric_type, dim, base_quantization_str); |
| 734 | auto param = HGraphTestIndex::GenerateHGraphBuildParametersString(build_param); |
| 735 | auto index = TestIndex::TestFactory(test_index->name, param, true); |
| 736 | |
| 737 | auto dataset = HGraphTestIndex::pool.GetDatasetAndCreate( |
| 738 | dim, resource->base_count, metric_type); |
| 739 | |
| 740 | TestIndex::TestBuildIndex(index, dataset, true); |
| 741 | TestIndex::TestExportIDs(index, dataset); |
| 742 | HGraphTestIndex::TestGeneral(index, dataset, search_param, recall); |
| 743 | |
| 744 | vsag::Options::Instance().set_block_size_limit(origin_size); |
| 745 | } |
| 746 | } |
| 747 | } |
| 748 | } |
| 749 | |
| 750 | TEST_CASE("(PR) HGraph Build Test", "[ft][hgraph][pr]") { |
| 751 | auto test_index = std::make_shared<fixtures::HGraphTestIndex>(); |
no test coverage detected