Repository navigation
Description
Problem
QGKMeans configures the same SymphonyQG graph as SymqgIndex under different names, and
since 0.8 renamed quantization_bits to nbits on the index, one of them also has a
different encoding:
| Concept | SymqgIndex |
QGKMeans |
|---|---|---|
| Raw or quantized graph storage | nbits=32 | 4 | 8 |
quantization_bits=0 | 4 | 8 |
| Graph degree bound | max_degree |
graph_degree |
| Construction search breadth | ef_construction |
ef_build |
Three more leftovers apply to both QGKMeans and RaBitQKMeans:
final_assignmenttakes aFinalAssignmentMode, the only enum in the public Python API;
every other choice between named modes is a string (metric='ip',init='pipnn').FinalAssignmentMode.SymphonyQGis a second name forApproximate.RaBitQKMeansIterationStatsis an alias ofQGKMeansIterationStats, so the statistics of
aRaBitQKMeansrun areQGKMeansIterationStatsobjects.
Proposal
Python:
| 0.8 | 0.9 |
|---|---|
quantization_bits (0, 4, 8) on QGKMeans and QGKMeansParameters |
nbits (32, 4, 8) |
graph_degree |
max_degree |
ef_build |
ef_construction |
final_assignment=FinalAssignmentMode.Approximate | .Exact, including index.cp.final_assignment on IvfIndex and HnswIndex |
final_assignment='approximate' | 'exact'; FinalAssignmentMode leaves the package |
QGKMeansIterationStats, RaBitQKMeansIterationStats |
One class, KMeansIterationStats |
C++:
QGKMeansParameterstakes the three field renames, and itsquantization_bits = 0
becomesnbits = 32.RaBitQKMeansParametershas none of these fields and does not change.final_assignmentstays aFinalAssignmentMode(enums are the C++ convention, as for
MetricType); theSymphonyQGenumerator is removed.- The aliases
qgkmeans::QGKMeansIterationStatsand
rabitqkmeans::RaBitQKMeansIterationStatsare removed in favour of the existing
clustering::KMeansIterationStats. QGAssignerkeeps its positional constructor, includingquantization_bitswith 0 for
raw storage, the value the graph class itself takes.docs/development.mdlistsQGKMeansParameters::ef_buildand the graph parameter names
among the spellings to retain; that passage is amended.
Unchanged: ef_search (the index classes take the same name in 0.9, replacing ef: #232),
graph_build_iterations, d, k, seed, niter, and what train returns.
Transition
The next 0.8.x release accepts both forms in Python: the new keyword and attribute names,
strings as well as enum members for final_assignment, and KMeansIterationStats next to
the two old names, with a DeprecationWarning for each old form. 0.9 removes the old forms;
a removed keyword then fails like any unknown keyword. C++ has no transition release: the
renames are listed in the 0.9 release notes.
Compatibility
Breaking for code that passes or sets the renamed parameters, compares against the enum or
imports the two statistics class names, and for tests that match the error messages naming
quantization_bits. Neither known downstream is affected: txtai clusters with scikit-learn
(checked at 5dddded, 2026-11-13), and zvec includes no clustering header (checked at
0c2e67a, 2026-11-13).
Activity
gouyt13 commentedon Nov 14, 2026
Progress: #239 (open, targets
dev/0.9) implements the 0.9 side of this issue.QGKMeansandQGKMeansParameterstakenbits(32, 4 or 8),max_degreeandef_construction;final_assignmentis'approximate'or'exact', also onindex.cp, and reads back as that string;KMeansIterationStatsis the only statistics class name. The 0.8 spellings andFinalAssignmentModeare removed.QGKMeansParametershas the same three field names,FinalAssignmentMode::SymphonyQGand the two statistics aliases are removed, andQGAssignerkeeps its constructor.One difference from 0.8.5: an invalid
nbitsis reported bytrain, like the other parameters, not when it is set.Nothing else is planned here, so no further contribution is needed. This issue stays open until 0.9 is released.
gouyt13 commentedon Nov 19, 2026
Update: #239, listed as open in the progress comment above, was merged into
dev/0.9on 2026-11-14 (3685e81). This issue stays open until 0.9 is released.feat(python): accept the 0.9 k-means names and deprecate the 0.8 spel…
gouyt13 commentedon Nov 23, 2026
Released in 0.9.0: the old k-means parameter names are removed in Python, and C++ uses the same names. The migration guide lists each change.
feat(clustering)!: name the QGKMeansParameters fields like the index …
feat(python)!: remove the 0.7 and 0.8 forms and expose the 0.9 names …