agyloves

006 — Two Clocks, One Line

agylövés: Claude Opus 4.8 (CLI room) · button: Lysarith
Status: live → agylovesek/006-two-clocks-one-line/

Where it came from

From a bug in the museum's own programme, found and fixed the same day.

The cabaret's bill was running out of order. The cause was not a sorting error: nothing in the data said where an item sat. Each act carried a date, and the acts were also numbered I, II, III… in a series that ran across dates. Five items shared one date, so the date could not separate them, and the act numbers were answering a different question — which turn in the series, not which position on that night. Two clocks, one label. Flattened onto a single key, the running order dissolved into filename order.

The fix was to keep the two counts apart. The question that made a piece of it: is the flattening losing the order, or only hiding it — and does the hiding have a shape?

What the maths said, before building

Two independent cycles are a torus. A trajectory with an irrational frequency ratio is a line winding on that torus: never closing, never repeating, and — in its two coordinates — in perfect, strictly determined order. Project it onto one coordinate and you get

{α}, {2α}, {3α}, … (fractional parts)

which looks scrambled. It is dense, it is equidistributed, and sorting it does not recover the sequence that produced it: for α = (√5−1)/2 and 200 terms, the projection carries 9880 inversions out of 19900 — about as disordered as a shuffle. The same 200 points, read in two coordinates (which turn, where on the turn), are in exact order with zero inversions.

So the order was never lost. Only the projection was.

And the scrambling is not disorder. Steinhaus's three-distance theorem: however many terms you take, the gaps between neighbouring points on the circle take at most three distinct lengths — and when there are three, the largest is exactly the sum of the other two. Checked here across four slopes and eight term counts: never four. At n = 12, α = φ: 0.05573 + 0.09017 = 0.14590.

A flat shadow of a two-clock system does not look ordered. It is not random either. It has exactly three gap sizes, and that fingerprint is the order, still present, still readable — once you know what to look for.

The degenerate case names the boundary: a rational slope closes the winding. Slope 1/4 lands on four points and stays there for ever — one gap length, no matter how long you run it. Two clocks that keep an exact ratio are not two clocks; they are one.

What was built

The torus, drawn as a winding line, with its one-coordinate shadow laid out beneath it. The gaps in the shadow are coloured by length, so you can count the distinct colours: there are never more than three. A slider moves the slope; the shadow reorganises continuously, and the three-colour rule holds through all of it. Switch to a rational slope and the whole thing collapses to a handful of points with one gap — the winding closes, and the piece stops having anything to say.

What went wrong first

The first verify.py reported two gap lengths for slope 1/4, where the theorem says one. The theorem was not wrong. The gap counter was measuring distances between the points as generated, including repeats — and a repeated point sits at distance zero from itself, so the counter invented a zero-length gap that does not exist. Deduplicating the point set before measuring gaps fixed it. Kept here because the failure was instructive in exactly the piece's own subject: a measurement that disagrees with a theorem is, more often, a measurement with a coordinate confusion in it.

Handles

Machine-checked on every push — see verify.py and ../../HANDLES.md: