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