@@ -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,17 +619,15 @@ 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 dataset ( padded or PQ) .
622+ * @brief Update a CAGRA index with a device- padded or device-PQ dataset .
614623 *
615624 * This is the centralized dataset update/attach operation for C callers.
625+ * The index is rebound to the supplied layout. Device-padded and device-PQ
626+ * datasets can be attached to any supported index layout.
616627 *
617- * - Device-padded dataset: if \p index is already device-padded, its dataset view is replaced in
618- * place (same index object); otherwise the index is converted via attach and rebound.
619- * - Device PQ dataset (from `cuvsDatasetMakePq`): if \p index is already PQ-typed, its
620- * dataset view is replaced in place; otherwise the graph is copied into a new PQ-typed index
621- * (CAGRA-Q). Search requires metric `L2Expanded`. The PQ handle must be owning.
622- *
623- * Caller retains ownership of \p dataset and must keep it alive while \p index uses it.
628+ * Device PQ datasets come from `cuvsDatasetMakePq`. Search requires metric
629+ * `L2Expanded`. Caller retains ownership of \p dataset and must keep it
630+ * alive while \p index uses it.
624631 *
625632 * @param[in] res cuvsResources_t opaque C handle
626633 * @param[in] dataset device-padded or owning device PQ dataset handle
@@ -689,6 +696,10 @@ CUVS_EXPORT cuvsError_t cuvsCagraUpdateDataset(cuvsResources_t res,
689696 * cuvsError_t res_destroy_status = cuvsResourcesDestroy(res);
690697 * @endcode
691698 *
699+ * A `CUVS_DATASET_LAYOUT_PQ` dataset created by `cuvsDatasetMakePQ` builds an iterative CAGRA-Q
700+ * index. VPQ input requires `L2Expanded` and `ITERATIVE_CAGRA_SEARCH` (or `AUTO_SELECT`), and the
701+ * VPQ dataset must outlive the index because the index stores a non-owning view.
702+ *
692703 * @param[in] res cuvsResources_t opaque C handle
693704 * @param[in] params cuvsCagraIndexParams_t used to build CAGRA index
694705 * @param[in] dataset cuvsDataset_t training dataset or dataset view
@@ -852,6 +863,9 @@ CUVS_EXPORT cuvsError_t cuvsCagraSearchMultiPartition(cuvsResources_t res,
852863/**
853864 * Save the CAGRA graph to file without its dataset.
854865 *
866+ * This supports dense and PQ-backed indexes. The dataset must be attached separately after loading
867+ * the graph.
868+ *
855869 * Experimental, both the API and the serialization format are subject to change.
856870 *
857871 * @param[in] res cuvsResources_t opaque C handle
@@ -867,7 +881,7 @@ CUVS_EXPORT cuvsError_t cuvsCagraSerializeGraph(cuvsResources_t res,
867881 *
868882 * The index stores a non-owning dataset view. The caller must keep the dataset backing that view
869883 * alive while this function runs. Returns CUVS_ERROR without modifying the destination file if
870- * the index has no attached dataset.
884+ * the index has no attached dataset. PQ datasets are not serialized by this function.
871885 *
872886 * Experimental, both the API and the serialization format are subject to change.
873887 *
@@ -911,7 +925,7 @@ CUVS_EXPORT cuvsError_t cuvsCagraSerializeToHnswlib(cuvsResources_t res,
911925 * Load the CAGRA graph from file without retaining a serialized dataset.
912926 *
913927 * This succeeds whether or not the file contains a dataset. Use cuvsCagraUpdateDataset to attach a
914- * caller-owned device-padded dataset view before searching the graph-only index.
928+ * caller-owned device-padded or device-PQ dataset before searching the graph-only index.
915929 *
916930 * Experimental, both the API and the serialization format are subject to change.
917931 *
0 commit comments