A sorting algorithm usually has a god's-eye view: a central procedure shuffles passive values into order. This playground inverts that. Each element is an autonomous cell that only sees its neighbours and decides for itself whether to swap. Order emerges from the bottom up. The framing follows recent work treating sorting algorithms as "agential material," and while the agency is a metaphor, the order metrics underneath are exact, and the calibration pins them.
In the usual telling, bubble sort or insertion sort is a recipe executed on inert data. Here the data does the sorting. Each cell carries an algotype (bubble, insertion, or selection), a swap policy, and a mutation strategy, and it acts only on local comparisons with its neighbours. No cell can see the whole array. That locality is the whole point: it asks whether global order can arise from purely local, self-interested moves, the same question basal-cognition research asks of cells in a developing body.
This connects to Zhang, Goldstein and Levin's striking result that even classical sorting algorithms, reframed as populations of agents, show unexpected robustness: they still sort when some elements are "broken," and they exhibit clustering and delayed-gratification behaviours that the monolithic algorithm never displays.
Two exact metrics quantify what is happening, and the calibration checks both against hand-built arrays:
The two axes can move independently: an array can become value-sorted while its algotypes stay mixed, or cluster by algotype without being sorted. Watching both is what makes the agential dynamics legible.
Bringing this playground up to standard surfaced a real bug: the sortedness metric compared cell objects rather than their values, so it always returned zero. The function's name and its aggregation sibling (which correctly compares algotypes) made the intent unambiguous, so the comparison was fixed to use cell values. The calibration now verifies the corrected metric.
A conceptual sandbox for "sorting as agency," for exploring robustness, clustering, mutation, and the gap between a centralized algorithm and a population of local agents. It is not a sorting benchmark, and the cells are not literal biological cells. The exact, checkable content is the order metrics; the basal-cognition reading is the lens that makes them interesting.