Stable Sort Guarantee and Deterministic Tie-Breaking
Client-side sorting is guaranteed to be stable. Rows that compare as equal keep their previous relative order. An optional final tie-breaker, such as row ID, makes the order fully deterministic across reloads. This matters for multi-step sorts done one column at a time, and for reproducible exports.
Planned. This page shows the specification from issue #186. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A grid of 1,000 rows where Status has only 3 distinct values. Each row shows its original index.
Expected behavior
After sorting by Status, the original indexes inside each status group stay in ascending order. With tieBreaker=rowId, shuffling the source data produces the same visual order every time.
Planned API surface
sortStabilityBasesortTieBreakergetRowIdAcceptance criteria
- Rows with equal sort keys keep the relative order defined by sortStabilityBase (pending)
- The tie-breaker is applied only after all sortModel entries compare as equal (pending)
- The result is deterministic even when a comparator is inconsistent (pending)
- The guarantee holds for datasets of at least 100,000 rows (pending)