| 1125 | } |
| 1126 | |
| 1127 | static void |
| 1128 | TestHGraphRemove(const fixtures::HGraphTestIndexPtr& test_index, |
| 1129 | const fixtures::HGraphResourcePtr& resource) { |
| 1130 | using namespace fixtures; |
| 1131 | auto test_recovery = GENERATE(true, false); |
| 1132 | auto origin_size = vsag::Options::Instance().block_size_limit(); |
| 1133 | auto size = GENERATE(1024 * 1024 * 2); |
| 1134 | auto search_param = fmt::format(fixtures::search_param_tmp, 200, false); |
| 1135 | |
| 1136 | for (auto metric_type : resource->metric_types) { |
| 1137 | for (auto dim : resource->dims) { |
| 1138 | for (auto& [base_quantization_str, recall] : resource->test_cases) { |
| 1139 | INFO(fmt::format("metric_type: {}, dim: {}, base_quantization_str: {}, recall: {}", |
| 1140 | metric_type, |
| 1141 | dim, |
| 1142 | base_quantization_str, |
| 1143 | recall)); |
| 1144 | if (HGraphTestIndex::IsRaBitQ(base_quantization_str) && |
| 1145 | dim < fixtures::RABITQ_MIN_RACALL_DIM) { |
| 1146 | dim = fixtures::RABITQ_MIN_RACALL_DIM; |
| 1147 | } |
| 1148 | vsag::Options::Instance().set_block_size_limit(size); |
| 1149 | HGraphTestIndex::HGraphBuildParam build_param( |
| 1150 | metric_type, dim, base_quantization_str); |
| 1151 | build_param.support_remove = true; |
| 1152 | auto param = HGraphTestIndex::GenerateHGraphBuildParametersString(build_param); |
| 1153 | auto index = TestIndex::TestFactory(test_index->name, param, true); |
| 1154 | auto dataset = HGraphTestIndex::pool.GetDatasetAndCreate( |
| 1155 | dim, resource->base_count, metric_type); |
| 1156 | if (test_recovery) { |
| 1157 | TestIndex::TestRecoverRemoveIndex(index, dataset, search_param); |
| 1158 | HGraphTestIndex::TestGeneral(index, dataset, search_param, recall * 0.8, false); |
| 1159 | } else { |
| 1160 | TestIndex::TestRemoveIndex(index, dataset, true); |
| 1161 | HGraphTestIndex::TestGeneral(index, dataset, search_param, recall); |
| 1162 | } |
| 1163 | vsag::Options::Instance().set_block_size_limit(origin_size); |
| 1164 | } |
| 1165 | } |
| 1166 | } |
| 1167 | } |
| 1168 | |
| 1169 | TEST_CASE("(PR) HGraph Remove", "[ft][hgraph][pr]") { |
| 1170 | auto test_index = std::make_shared<fixtures::HGraphTestIndex>(); |
no test coverage detected