Results and assignments

Updated Sep 20, 2026

Chutoro::run returns a ClusteringResult, which exposes the per-item assignments and a pre-computed cluster_count. To construct a result manually, use the public fallible ClusteringResult::try_from_assignments. It verifies that cluster identifiers start at 0 and are contiguous, reporting invalid input through the NonContiguousClusterIds enum so actionable feedback can be surfaced upstream. The panicking from_assignments convenience is internal to chutoro-core, where the CPU pipeline guarantees the precondition.

Each assignment stores a ClusterId. The underlying value can be accessed with get() when serializing or displaying results.