Where it stops

Loopy games

The whole theory assumes play stops. Allow a position to recur and the induction that every value rests on has nothing to stand on — and a fifth outcome appears that normal-play theory has no name for.

Every definition on this site is a recursion, and every recursion needs a base case. The base case is the position with no moves, and reaching it is guaranteed by an assumption stated so early it is easy to miss: play ends.

Drop it and the theory has no floor.

A position that comes backThree positions whose moves lead round in a circle. Every value in this subject is defined by recursion on the options, and that recursion assumes play ends — here it need not, so the definition has nothing to stand on and the outcome may be a draw, which normal-play theory has no name for.ABCthe moves lead back to where they startedno base case, so the recursion never bottoms outa third outcome appears: neither player can force a winloopy game theory is a separate subject with separate machinery
Fig. 1 A position that can return to itself. The recursion that assigns it a value never terminates, and the outcome it needs is one the four classes do not contain.

The assumption, made explicit

The formal statement is that a game is short: finitely many positions, and no position reachable from itself. Every line of play then terminates, and every recursion over options bottoms out.

That assumption underwrites everything. The value recursion needs it. Canonicalisation needs it — the reduction loop terminates because options are strictly smaller. Comparison needs it. Sprague–Grundy needs it: mex over an infinite descending chain is not defined.

A game with repetition breaks all of them at once, and not by making them harder. It makes them meaningless — there is nothing to compute.

The fifth outcome

The immediate consequence is a new possibility.

If play can go on forever, then neither player wins. Under the normal-play convention a player loses by being unable to move; a player who is never unable to move never loses, and a game in which both players can move indefinitely ends in nothing.

That is a draw, and it is the fifth outcome. The four classes — L, R, P, N — were derived from two yes-or-no questions, “can Left win moving first” and “can Right win moving first”. With draws available the questions have three answers each: win, lose, or draw. The classification grows accordingly.

Chess and Go both have draw provisions, and both need them precisely because their positions can repeat. The rules that prevent infinite play — threefold repetition, the fifty-move rule, ko rules in Go — are patches on exactly this problem, and every one of them is a rule about the history rather than the position, which is why they sit awkwardly in a theory whose objects are positions.

On, off, and the loopy values

Conway’s treatment does not abandon values. It extends them.

Define on as the game on={on  }\text{on} = \{\text{on} \mid \;\}: Left can move, and the move returns to the same position. Left can move forever; Right can never move.

So on is a Left win, and it is larger than every number — larger than a million, larger than any integer, because Left simply never runs out. Its mirror, off ={  off} = \{\; \mid \text{off}\}, is a Right win smaller than every number.

Then there is dud\text{dud} — deathless universal draw — defined as {duddud}\{\text{dud} \mid \text{dud}\}. Both players can move, both moves return to the start, and neither player ever loses. It is the pure draw, and it is confused with everything: not greater than any number, not less, not equal.

Smaller than every positive number, and not zeroValues that sit between zero and every positive number. Up is genuinely greater than zero — Left wins it whoever moves — and genuinely less than a thousandth. Star is not comparable with zero at all. None of them is a number, and in a close game they are the entire margin.{0 | {0 | 0}}> 0< 1/1024outcome L{0 | {{0 | 0}, 0 | 0}}> 0< 1/1024outcome L↑∗{{0 | 0}, 0 | 0}‖ 0< 1/1024outcome N{0 | 0}‖ 0< 1/1024outcome N{{0 | 0} | 0}< 0< 1/1024outcome Rvaluecanonical formagainst 0against a thousandth↑ is positive and smaller than every positive number — which no real number is∗ is none of greater, smaller or equal — the order is partial, and that is the point
Fig. 2 The small values, for scale. The loopy values sit at the other extreme — on is above every number on this line, off below every one, and dud is comparable with none of them.

These definitions are circular, which is the point. They are fixed points rather than constructions: a loopy value is defined as the solution of an equation rather than built up from smaller pieces, and the theory’s task is to show the equations have solutions and that the solutions behave.

A loop, traced

The smallest loopy position is worth walking round once, because the failure is easier to see than to describe.

Take a position XX from which Left has exactly one move, and that move leads back to XX. Right has no moves.

Evaluate it. The value of XX is {value of X  }\{\,\text{value of } X \mid \;\}, so computing the value of XX requires the value of XX. The recursion calls itself with the same argument and does not descend.

Now play it. Left moves. The position is XX. Left moves. The position is XX. This continues. Right never gets a move and never loses by being unable to move, because being unable to move only matters when it is that player’s turn — and Right’s turn never arrives with a terminal position on the board, since the position is never terminal.

So Left never wins either. The game is infinite, and under the draw convention it is drawn; under the convention that the looping player wins, Left wins; under the convention that the looping player loses, Left loses.

Conway’s on\text{on} is exactly this position, and the choice made is that on\text{on} is a Left win, larger than every number. That is a stipulation with consequences, not a derivation.

Add a single Right move somewhere and everything changes. If Right can move once, then Left looping forever means Right sits with an unused move and the position is still infinite — so the draw stands, and the extra option changed nothing. If Right’s move ends the loop, the analysis becomes about whether Left wants to loop or to let Right end it, which is where the fixed-point machinery earns its keep.

A position that comes backThree positions whose moves lead round in a circle. Every value in this subject is defined by recursion on the options, and that recursion assumes play ends — here it need not, so the definition has nothing to stand on and the outcome may be a draw, which normal-play theory has no name for.ABCthe moves lead back to where they startedno base case, so the recursion never bottoms outa third outcome appears: neither player can force a winloopy game theory is a separate subject with separate machinery
Fig. 3 The cycle, drawn. The recursion enters the marked position, follows its options, and arrives back where it started — which is the point at which every definition on this site has nothing left to say.

Short games hidden inside loopy ones

The reason the short-game theory is useful for real games, despite most of them being loopy, is worth spelling out.

A chess or Go position is loopy in principle and short in practice for long stretches. Pieces are captured, stones are placed, liberties are filled, and a position that has consumed something cannot return to the state before it consumed it. Those stretches are short games, and the theory applies to them.

The loopy parts are localised. In Go they are ko fights, and a ko fight is a small loopy component embedded in an otherwise short position. The applied machinery — Berlekamp’s ko treatment inside the temperature framework — handles exactly that shape: a short board with a bounded loopy region.

So the honest picture is not “the theory covers a narrow class of games”. It is that the theory covers the parts of real games where something is being consumed, and needs extensions for the parts where nothing is.

That is a better position than it first appears, and it is also why the endgame is where every application on this site lives. An endgame is by definition the part of a game where the loops have run out.

Termination and the other limits

One clean way to see where loopy games sit is to compare the three boundaries directly.

Misère play leaves the game graph exactly as it was and inverts the base case. Every recursion still terminates; the results just stop composing. The damage is to the algebra.

Loops leave the base case exactly as it was and remove the guarantee of reaching it. The algebra would be fine if the recursion ran; it does not run. The damage is to the induction.

Complexity leaves both intact. Every recursion terminates and every value composes; there are simply too many positions. The damage is to the computation.

Three different failures, and they are independent — a game can be misère, loopy and intractable at once, and misère loopy games are worse than the sum of the two difficulties. Distinguishing them matters because the responses differ: misère play needs a new algebra, loops need fixed points, and intractability needs approximation.

Only the third has anything to do with difficulty in the ordinary sense. The first two are failures of the model rather than of the machine.

Why the induction cannot be patched

A natural hope is that some cleverness recovers the recursion — evaluate the loop once, take a limit, cut the cycle somewhere.

The obstruction is that the value of a loopy position genuinely depends on the loop, not on any finite unrolling. Consider a position from which Left can either take a small immediate gain or return to the start. Whether looping is good for Left depends on what else is on the board — if Left is ahead elsewhere, looping forever is a draw and a draw may be worse than the small gain; if behind, the draw is a rescue.

So the loop’s value is contextual in a way finite positions’ values are not, and the substitution property that makes values worth computing is weakened. Loopy games do have a theory of sums, and it is considerably more delicate than the short-game one.

The replacement machinery works with greatest and least fixed points — the value of a loopy position is defined as an extremal solution of the defining equations, and different extremal choices correspond to different conventions about who benefits from an infinite game. The choice is not forced by the rules; it has to be stipulated, which is another way of saying that the draw convention is an extra piece of input the theory does not derive.

The draw convention has to be chosen

That last point deserves isolating.

In a short game, the outcome of every line is determined by the rules. In a loopy game, an infinite line has no outcome unless one is assigned, and assigning one is a decision.

A draw is the usual choice, and it is what chess and Go do.

A loss for the player who caused the repetition is another, used in some Chinese chess rules and in some Go rulesets.

A win for the player who can loop is a third, and it is the natural one for pursuit games — a game where one player is trying to catch another and the other is trying to survive, in which surviving forever is winning.

Three conventions, three different theories, all consistent. That is a genuine difference in kind from the short-game case, where normal and misère play are the only two choices and both are about the terminal position rather than about infinity.

Four things a position can beEvery position falls into one of four outcome classes, and only three of them correspond to a comparison with zero. The fourth — first player wins — is a position confused with zero, neither greater, smaller nor equal, and it is where the subject departs from arithmetic.0outcome P= 0whoever must move, loses10outcome L> 0Left wins, whoever starts-10outcome R< 0Right wins, whoever starts00outcome N‖ 0whoever moves first, winsblue edges are Left's moves, red are Right'sthree of the four are comparisons with zero; the fourth is not
Fig. 4 The four short-game outcome classes. A fifth is needed as soon as play can be infinite, and what the fifth means is a convention rather than a consequence.

What the solver computed

lib/cgt.js implements short games only. The recursion has no cycle detection, because it does not need any: every position it is given is loop-free by construction.

That is a deliberate limit and the site states it rather than working around it. Nothing here computes a loopy value.

What the loopy figure shows is the structure — a position graph with a cycle in it, drawn so the cycle is visible, with the recursion’s failure marked at the point where it would revisit a position it has already entered. That is a picture of why the computation cannot run, and it is honest in a way that a picture of a loopy value would not be.

The check that the code enforces is the converse: assertValue runs the recursion, and the recursion would not terminate on a loopy input. Every position the site evaluates is short, and the build’s completion is itself the proof that none of them contained a cycle.

Where loops come from

Loops are not exotic. They are what happens whenever a move can be undone.

Chess. Pieces move back and forth. The rules add repetition and move-count limits to force termination.

Go. The ko rule exists solely to prevent an immediate recapture cycle, and the more complex superko rules exist because the simple ko rule does not prevent longer cycles.

Checkers, Chinese chess, most abstract games with mobile pieces. All the same.

Fox and Geese, a classic loopy game and the standard worked example — one player can circle indefinitely, and whether that is a win, loss or draw is exactly the convention question above.

Which means the assumption this whole site rests on — that play terminates — excludes most of the games people actually play. The theory covers games where moves consume something: counters, edges, empty squares. It does not natively cover games where pieces move around.

That is a large exclusion and it is worth stating plainly rather than leaving in a footnote.

Which questions are answerableThe theory is exact and much of it is expensive. Values are computable by definition; computing one for a position of any size is a different matter, and deciding the winner of a generalised board game is complete for PSPACE — as hard as anything solvable in polynomial space.the value of a Nim positioninstantthe Grundy value of a small subtraction gamelinearthe canonical form of a moderate positionexponential in theorywho wins a general Domineering boardno efficient methodwho wins a generalised board gamePSPACE-completecostthe definitions are constructive, so everything here is computable in principleand the practical range of an exact evaluator is a few dozen moves, which is the working constraint
Fig. 5 The reach of exact analysis. Loopy games are outside it in a different way from large games — not too big to compute, but not of a kind this recursion computes at all.

The rules that force termination

Real games make themselves short, and the devices they use are worth cataloguing, because each one is a different answer to the same problem.

Consume something. Nim removes counters, Hackenbush removes edges, Domineering fills cells. Nothing can be put back, so no position recurs and termination is automatic. Every game this site evaluates works this way.

Forbid repetition. Go’s ko rule bans an immediate recapture; superko bans any repetition of a whole-board position. Both are rules about history, which means a Go “position” in the strict sense includes what came before it.

Count moves. Chess’s fifty-move rule ends a game that has gone nowhere. Crude, effective, and entirely outside the position.

Declare a draw. Threefold repetition in chess. This does not force termination so much as define an outcome for the failure to terminate.

The first is the only one internal to the position, and it is the only one the short-game theory handles natively. The other three are all statements about the history of play, which is why they sit so awkwardly with a theory whose objects are positions and whose central operation is substituting one position for another. A position cannot be substituted freely if its legality depends on what preceded it.

The picture is the numeralBlue-red Hackenbush strings and their values. Left may cut a blue edge, Right a red one, and everything above the cut falls. The value of each string is a number, and reading the string from the ground upward gives the binary expansion of exactly that number.1blue2blue blue1/2blue red3/4blue red blue1/4blue red red3/8blue red red blueeach string is worth a number, and the string spells itblue is Left · red is Right · the ground is what holds it up
Fig. 6 Positions from a game that terminates by construction. Every move removes an edge, nothing is ever replaced, and no sequence of moves can return to an earlier picture — which is why these have values at all.

Who found it, and when

Conway treats loopy games in On Numbers and Games, and on and off are his, with the names. The fuller development is in Winning Ways, which has a chapter on games that go on forever and works through Fox and Geese.

The fixed-point machinery was developed further by Aviezri Fraenkel and others, and by Clark Smith in the 1960s in work on games with cycles that predates the general theory.

The practical importance is largest in Go, where ko fights are loopy sub-games embedded in a short game, and where Berlekamp and others developed specific machinery for handling them within the temperature framework. That is the case where the loopy theory has done real work rather than existing as a completeness exercise.

Where the model stops

This site computes short games only. No loopy value is claimed anywhere.

The draw convention is input. Different choices give different theories, all valid.

Sums of loopy games are delicate. Additivity holds in a weakened form, with side conditions the short-game theory does not need.

Most played games are loopy. The short-game theory reaches them only through their endgames, and only after the loops have been eliminated by the rules or by the position.

Normal play, still — the misère and loopy complications are independent, and combining them is worse than either.

The ladder from here

Nearby: on and off with their arithmetic; dud and the confused values; Fox and Geese worked through; greatest and least fixed points, and what each convention corresponds to; and the ko machinery in Go, which is the applied case.

Then across to the other two boundaries. Misère play breaks the ordering while leaving the induction intact; loops break the induction while leaving the ordering intact; and complexity leaves both intact and puts the answers out of reach. Three independent ways to run out, and a game can suffer all three at once.