@@ -61,10 +61,6 @@ Index<T, TagT, LabelT>::Index(const IndexConfig &index_config, std::shared_ptr<A
6161 -1 , __FUNCSIG__, __FILE__, __LINE__);
6262 }
6363
64- // if (_dynamic_index && _num_frozen_pts == 0)
65- // {
66- // _num_frozen_pts = 1;
67- // }
6864 // Sanity check. While logically it is correct, max_points = 0 causes
6965 // downstream problems.
7066 if (_max_points == 0 )
@@ -276,7 +272,6 @@ void Index<T, TagT, LabelT>::save(const char *filename, bool compact_before_save
276272 if (compact_before_save)
277273 {
278274 compact_data ();
279- // compact_frozen_point();
280275 }
281276 else
282277 {
@@ -386,10 +381,6 @@ void Index<T, TagT, LabelT>::save(const char *filename, bool compact_before_save
386381 << std::endl;
387382 }
388383
389- // If frozen points were temporarily compacted to _nd, move back to
390- // _max_points.
391- // reposition_frozen_point_to_end();
392-
393384 diskann::cout << " Time taken for save: " << timer.elapsed () / 1000000.0 << " s." << std::endl;
394385}
395386
@@ -668,7 +659,6 @@ void Index<T, TagT, LabelT>::load(const char *filename, uint32_t num_threads, ui
668659 + _table_stats.label_mem_usage
669660 + _table_stats.tag_memory_usage ;
670661
671- // reposition_frozen_point_to_end();
672662 diskann::cout << " _nd: " << _nd << " _start: " << _start
673663 << " size(_location_to_tag): " << _location_to_tag.size ()
674664 << " size(_tag_to_location):" << _tag_to_location.size () << " Max points: " << _max_points
@@ -685,27 +675,6 @@ void Index<T, TagT, LabelT>::load(const char *filename, uint32_t num_threads, ui
685675 }
686676}
687677
688- #ifndef EXEC_ENV_OLS
689- // template <typename T, typename TagT, typename LabelT>
690- // size_t Index<T, TagT, LabelT>::get_graph_num_frozen_points(const std::string &graph_file)
691- // {
692- // size_t expected_file_size;
693- // uint32_t max_observed_degree, start;
694- // size_t file_frozen_pts;
695- //
696- // std::ifstream in;
697- // in.exceptions(std::ios::badbit | std::ios::failbit);
698- //
699- // in.open(graph_file, std::ios::binary);
700- // in.read((char *)&expected_file_size, sizeof(size_t));
701- // in.read((char *)&max_observed_degree, sizeof(uint32_t));
702- // in.read((char *)&start, sizeof(uint32_t));
703- // in.read((char *)&file_frozen_pts, sizeof(size_t));
704- //
705- // return file_frozen_pts;
706- // }
707- #endif
708-
709678#ifdef EXEC_ENV_OLS
710679template <typename T, typename TagT, typename LabelT>
711680size_t Index<T, TagT, LabelT>::load_graph (AlignedFileReader &reader, size_t expected_num_points)
@@ -718,7 +687,6 @@ size_t Index<T, TagT, LabelT>::load_graph(std::string filename, size_t expected_
718687#endif
719688 auto res = _graph_store->load (filename, expected_num_points);
720689 _start = std::get<1 >(res);
721- // _num_frozen_pts = std::get<2>(res);
722690 return std::get<0 >(res);
723691}
724692
@@ -1637,7 +1605,6 @@ void Index<T, TagT, LabelT>::build_with_data_populated(const std::vector<TagT> &
16371605 _data_store->get_aligned_dim ());
16381606 }
16391607
1640- // generate_frozen_point();
16411608 link ();
16421609
16431610 size_t max = 0 , min = SIZE_MAX, total = 0 , cnt = 0 ;
@@ -2433,40 +2400,6 @@ template <typename T, typename TagT, typename LabelT> size_t Index<T, TagT, Labe
24332400 return _max_points;
24342401}
24352402
2436- // template <typename T, typename TagT, typename LabelT> void Index<T, TagT, LabelT>::generate_frozen_point()
2437- // {
2438- // if (_num_frozen_pts == 0)
2439- // return;
2440- //
2441- // if (_num_frozen_pts > 1)
2442- // {
2443- // throw ANNException("More than one frozen point not supported in generate_frozen_point", -1, __FUNCSIG__,
2444- // __FILE__, __LINE__);
2445- // }
2446- //
2447- // if (_nd == 0)
2448- // {
2449- // throw ANNException("ERROR: Can not pick a frozen point since nd=0", -1, __FUNCSIG__, __FILE__, __LINE__);
2450- // }
2451- // size_t res = calculate_entry_point();
2452- //
2453- // // REFACTOR PQ: Not sure if we should do this for both stores.
2454- // if (_pq_dist)
2455- // {
2456- // // copy the PQ data corresponding to the point returned by
2457- // // calculate_entry_point
2458- // // memcpy(_pq_data + _max_points * _num_pq_chunks,
2459- // // _pq_data + res * _num_pq_chunks,
2460- // // _num_pq_chunks * DIV_ROUND_UP(NUM_PQ_BITS, 8));
2461- // _pq_data_store->copy_vectors((location_t)res, (location_t)_max_points, 1);
2462- // }
2463- // else
2464- // {
2465- // _data_store->copy_vectors((location_t)res, (location_t)_max_points, 1);
2466- // }
2467- // _frozen_pts_used++;
2468- // }
2469-
24702403template <typename T, typename TagT, typename LabelT> int Index<T, TagT, LabelT>::enable_delete ()
24712404{
24722405 assert (_enable_tags);
@@ -2584,14 +2517,6 @@ consolidation_report Index<T, TagT, LabelT>::consolidate_deletes(const IndexWrit
25842517 throw ANNException (err, -1 , __FUNCSIG__, __FILE__, __LINE__);
25852518 }
25862519
2587- // if (_location_to_tag.size() + _delete_set->size() != _nd)
2588- // {
2589- // diskann::cerr << "Error: _location_to_tag.size (" << _location_to_tag.size() << ") + _delete_set->size ("
2590- // << _delete_set->size() << ") != _nd(" << _nd << ") ";
2591- // return consolidation_report(diskann::consolidation_report::status_code::INCONSISTENT_COUNT_ERROR, 0, 0, 0,
2592- // 0, 0, 0, 0);
2593- // }
2594-
25952520 if (_location_to_tag.size () != _tag_to_location.size ())
25962521 {
25972522 throw diskann::ANNException (" _location_to_tag and _tag_to_location not of same size" , -1 , __FUNCSIG__,
@@ -2663,26 +2588,6 @@ consolidation_report Index<T, TagT, LabelT>::consolidate_deletes(const IndexWrit
26632588 duration);
26642589}
26652590
2666- // template <typename T, typename TagT, typename LabelT> void Index<T, TagT, LabelT>::compact_frozen_point()
2667- // {
2668- // if (_nd < _max_points && _num_frozen_pts > 0)
2669- // {
2670- // reposition_points((uint32_t)_max_points, (uint32_t)_nd, (uint32_t)_num_frozen_pts);
2671- // _start = (uint32_t)_nd;
2672- //
2673- // if (_filtered_index && _dynamic_index)
2674- // {
2675- // // update medoid id's as frozen points are treated as medoid
2676- // for (auto &[label, medoid_id] : _label_to_start_id)
2677- // {
2678- // /* if (label == _universal_label)
2679- // continue;*/
2680- // _label_to_start_id[label] = (uint32_t)_nd + (medoid_id - (uint32_t)_max_points);
2681- // }
2682- // }
2683- // }
2684- // }
2685-
26862591// Should be called after acquiring _update_lock
26872592template <typename T, typename TagT, typename LabelT> void Index<T, TagT, LabelT>::compact_data ()
26882593{
@@ -2970,32 +2875,6 @@ void Index<T, TagT, LabelT>::reposition_points(uint32_t old_location_start, uint
29702875 _data_store->move_vectors (old_location_start, new_location_start, num_locations);
29712876}
29722877
2973- // template <typename T, typename TagT, typename LabelT> void Index<T, TagT, LabelT>::reposition_frozen_point_to_end()
2974- // {
2975- // if (_num_frozen_pts == 0)
2976- // return;
2977- //
2978- // if (_nd == _max_points)
2979- // {
2980- // diskann::cout << "Not repositioning frozen point as it is already at the end." << std::endl;
2981- // return;
2982- // }
2983- //
2984- // reposition_points((uint32_t)_nd, (uint32_t)_max_points, (uint32_t)_num_frozen_pts);
2985- // _start = (uint32_t)_max_points;
2986- //
2987- // // update medoid id's as frozen points are treated as medoid
2988- // if (_filtered_index && _dynamic_index)
2989- // {
2990- // for (auto &[label, medoid_id] : _label_to_start_id)
2991- // {
2992- // /*if (label == _universal_label)
2993- // continue;*/
2994- // _label_to_start_id[label] = (uint32_t)_max_points + (medoid_id - (uint32_t)_nd);
2995- // }
2996- // }
2997- // }
2998-
29992878template <typename T, typename TagT, typename LabelT> void Index<T, TagT, LabelT>::resize (size_t new_max_points)
30002879{
30012880 const size_t new_internal_points = new_max_points ;
0 commit comments