@@ -2134,6 +2134,61 @@ TEST_CASE("(Daily) HGraph Search Over Time", "[ft][hgraph][daily]") {
21342134 TestHGraphSearchOverTime (test_index, resource);
21352135}
21362136
2137+ static void
2138+ TestHGraphSearchDisableReorder (const fixtures::HGraphTestIndexPtr& test_index,
2139+ const fixtures::HGraphResourcePtr& resource) {
2140+ using namespace fixtures ;
2141+ auto origin_size = vsag::Options::Instance ().block_size_limit ();
2142+ auto size = GENERATE (1024 * 1024 * 2 );
2143+ constexpr const char * search_param_tmp = R"( {{
2144+ "hgraph": {{
2145+ "ef_search": 200,
2146+ "enable_reorder": {}
2147+ }}
2148+ }})" ;
2149+
2150+ for (auto metric_type : resource->metric_types ) {
2151+ for (auto dim : resource->dims ) {
2152+ auto base_quantization_str = " sq4_uniform,fp32" ;
2153+ float recall_with_reorder = 0.95 ;
2154+ float recall_without_reorder = 0.75 ;
2155+ INFO (
2156+ fmt::format (" metric_type: {}, dim: {}, base_quantization_str: {}, "
2157+ " recall_with_reorder: {}, recall_without_reorder: {}" ,
2158+ metric_type,
2159+ dim,
2160+ base_quantization_str,
2161+ recall_with_reorder,
2162+ recall_without_reorder));
2163+ vsag::Options::Instance ().set_block_size_limit (size);
2164+ HGraphTestIndex::HGraphBuildParam build_param (metric_type, dim, base_quantization_str);
2165+ auto param = HGraphTestIndex::GenerateHGraphBuildParametersString (build_param);
2166+ auto index = TestIndex::TestFactory (test_index->name , param, true );
2167+ auto dataset =
2168+ HGraphTestIndex::pool.GetDatasetAndCreate (dim, resource->base_count , metric_type);
2169+ TestIndex::TestBuildIndex (index, dataset, true );
2170+ auto recall_result_with_reorder = TestIndex::TestKnnSearch (
2171+ index, dataset, fmt::format (search_param_tmp, true ), recall_with_reorder, true );
2172+ auto recall_result_without_reorder = TestIndex::TestKnnSearch (
2173+ index, dataset, fmt::format (search_param_tmp, false ), recall_without_reorder, true );
2174+ REQUIRE (recall_result_with_reorder > recall_result_without_reorder);
2175+ vsag::Options::Instance ().set_block_size_limit (origin_size);
2176+ }
2177+ }
2178+ }
2179+
2180+ TEST_CASE (" (PR) HGraph Search Disable Reorder" , " [ft][hgraph][pr]" ) {
2181+ auto test_index = std::make_shared<fixtures::HGraphTestIndex>();
2182+ auto resource = test_index->GetResource (true );
2183+ TestHGraphSearchDisableReorder (test_index, resource);
2184+ }
2185+
2186+ TEST_CASE (" (Daily) HGraph Search Disable Reorder" , " [ft][hgraph][daily]" ) {
2187+ auto test_index = std::make_shared<fixtures::HGraphTestIndex>();
2188+ auto resource = test_index->GetResource (false );
2189+ TestHGraphSearchDisableReorder (test_index, resource);
2190+ }
2191+
21372192static void
21382193TestHGraphDiskIOType (const fixtures::HGraphTestIndexPtr& test_index,
21392194 const fixtures::HGraphResourcePtr& resource) {
0 commit comments