@@ -81,14 +81,19 @@ enum cuvsCagraHnswHeuristicType {
8181 CUVS_CAGRA_HEURISTIC_SAME_GRAPH_FOOTPRINT = 1
8282};
8383
84- /** Parameters for VPQ compression. */
84+ /**
85+ * Parameters for PQ dataset compression.
86+ *
87+ * The `cuvsCagraCompressionParams` name is retained for ABI compatibility and is planned for
88+ * removal in the 27.02 ABI-breaking release. Use `cuvsPqParams` in new code.
89+ */
8590struct cuvsCagraCompressionParams {
8691 /**
8792 * The bit length of the vector element after compression by PQ.
8893 *
8994 * Possible values: [4, 5, 6, 7, 8].
9095 *
91- * Hint: the smaller the ' pq_bits' , the smaller the index size and the better the search
96+ * Hint: the smaller the ` pq_bits` , the smaller the index size and the better the search
9297 * performance, but the lower the recall.
9398 */
9499 uint32_t pq_bits ;
@@ -118,8 +123,6 @@ struct cuvsCagraCompressionParams {
118123 double pq_kmeans_trainset_fraction ;
119124};
120125
121- typedef struct cuvsCagraCompressionParams * cuvsCagraCompressionParams_t ;
122-
123126struct cuvsIvfPqParams {
124127 cuvsIvfPqIndexParams_t ivf_pq_build_params ;
125128 cuvsIvfPqSearchParams_t ivf_pq_search_params ;
@@ -270,15 +273,21 @@ CUVS_EXPORT cuvsError_t cuvsCagraMergeParamsCreate(cuvsCagraMergeParams_t* param
270273CUVS_EXPORT cuvsError_t cuvsCagraMergeParamsDestroy (cuvsCagraMergeParams_t params );
271274
272275/**
273- * @brief Allocate CAGRA Compression params, and populate with default values
276+ * @brief Allocate CAGRA Compression params, and populate with default values.
277+ *
278+ * Deprecated: Use `cuvsPqParamsCreate`. This compatibility API is planned for removal in
279+ * the 27.02 ABI-breaking release.
274280 *
275281 * @param[in] params cuvsCagraCompressionParams_t to allocate
276282 * @return cuvsError_t
277283 */
278284CUVS_EXPORT cuvsError_t cuvsCagraCompressionParamsCreate (cuvsCagraCompressionParams_t * params );
279285
280286/**
281- * @brief De-allocate CAGRA Compression params
287+ * @brief De-allocate CAGRA Compression params.
288+ *
289+ * Deprecated: Use `cuvsPqParamsDestroy`. This compatibility API is planned for removal in
290+ * the 27.02 ABI-breaking release.
282291 *
283292 * @param[in] params
284293 * @return cuvsError_t
@@ -610,21 +619,20 @@ CUVS_EXPORT cuvsError_t cuvsCagraIndexGetDataset(cuvsCagraIndex_t index, DLManag
610619CUVS_EXPORT cuvsError_t cuvsCagraIndexGetGraph (cuvsCagraIndex_t index , DLManagedTensor * graph );
611620
612621/**
613- * @brief Update a CAGRA index with a device-padded dataset.
622+ * @brief Update a CAGRA index with a device-padded or device-PQ dataset.
614623 *
615- * This is the centralized dataset update operation for C callers. If \p index
616- * is already device-padded, its dataset view is replaced in place. Otherwise,
617- * the index is converted and its opaque handle is rebound to a search-ready
618- * device-padded index. Caller retains ownership of
619- * \p device_padded_dataset and must keep it alive while \p index uses it.
624+ * This is the centralized dataset update operation for C callers. The index's opaque handle is
625+ * rebound to an index over the supplied dataset layout. Device-padded and device-PQ datasets can
626+ * be attached to any supported index layout. The caller retains ownership of \p dataset and must
627+ * keep it alive while \p index uses it.
620628 *
621- * @param[in] res cuvsResources_t opaque C handle
622- * @param[in] device_padded_dataset owning or non-owning device-padded dataset handle
623- * @param[inout] index CAGRA index handle
629+ * @param[in] res cuvsResources_t opaque C handle
630+ * @param[in] dataset owning or non-owning device-padded or device-PQ dataset handle
631+ * @param[inout] index CAGRA index handle
624632 * @return cuvsError_t
625633 */
626634CUVS_EXPORT cuvsError_t cuvsCagraUpdateDataset (cuvsResources_t res ,
627- cuvsDataset_t device_padded_dataset ,
635+ cuvsDataset_t dataset ,
628636 cuvsCagraIndex_t index );
629637
630638/**
@@ -685,6 +693,10 @@ CUVS_EXPORT cuvsError_t cuvsCagraUpdateDataset(cuvsResources_t res,
685693 * cuvsError_t res_destroy_status = cuvsResourcesDestroy(res);
686694 * @endcode
687695 *
696+ * A `CUVS_DATASET_LAYOUT_PQ` dataset created by `cuvsDatasetMakePQ` builds an iterative CAGRA-Q
697+ * index. VPQ input requires `L2Expanded` and `ITERATIVE_CAGRA_SEARCH` (or `AUTO_SELECT`), and the
698+ * VPQ dataset must outlive the index because the index stores a non-owning view.
699+ *
688700 * @param[in] res cuvsResources_t opaque C handle
689701 * @param[in] params cuvsCagraIndexParams_t used to build CAGRA index
690702 * @param[in] dataset cuvsDataset_t training dataset or dataset view
@@ -848,6 +860,9 @@ CUVS_EXPORT cuvsError_t cuvsCagraSearchMultiPartition(cuvsResources_t res,
848860/**
849861 * Save the CAGRA graph to file without its dataset.
850862 *
863+ * This supports dense and PQ-backed indexes. The dataset must be attached separately after loading
864+ * the graph.
865+ *
851866 * Experimental, both the API and the serialization format are subject to change.
852867 *
853868 * @param[in] res cuvsResources_t opaque C handle
@@ -863,7 +878,7 @@ CUVS_EXPORT cuvsError_t cuvsCagraSerializeGraph(cuvsResources_t res,
863878 *
864879 * The index stores a non-owning dataset view. The caller must keep the dataset backing that view
865880 * alive while this function runs. Returns CUVS_ERROR without modifying the destination file if
866- * the index has no attached dataset.
881+ * the index has no attached dataset. PQ datasets are not serialized by this function.
867882 *
868883 * Experimental, both the API and the serialization format are subject to change.
869884 *
@@ -907,7 +922,7 @@ CUVS_EXPORT cuvsError_t cuvsCagraSerializeToHnswlib(cuvsResources_t res,
907922 * Load the CAGRA graph from file without retaining a serialized dataset.
908923 *
909924 * This succeeds whether or not the file contains a dataset. Use cuvsCagraUpdateDataset to attach a
910- * caller-owned device-padded dataset view before searching the graph-only index.
925+ * caller-owned device-padded or device-PQ dataset before searching the graph-only index.
911926 *
912927 * Experimental, both the API and the serialization format are subject to change.
913928 *
0 commit comments