Everything on this page uses the same rules the engine implements — the way the game is played in the village. For the standard experiments, three players and a target of 21.
So a match is a sequence of rounds with growing pressure: early rounds you want to shed pips; late rounds, with a high tally, you want to force others to score. Chance level for a three-player match is 33.3% — but as we will see, uniform random play scores far below chance against anyone consistent, and the game's real skill is working out what the hidden hands hold.
When this page opens it looks for JSON/serondo.json and JSON/cazurro.json next to itself and loads them automatically. Browsers often refuse that for local files — then load each one once with the buttons and it stays ready for the whole session. Nothing on this page learns: every brain plays greedy from its saved weights.
AI seats: Random (random play) picks blindly — the true chance level. Random strategy is a fresh untrained brain: nobody home, just random initial weights — but even that fixed arbitrary policy beats random play. Serondo and Cazurro play greedy from their trained weights, loaded from JSON/serondo.json and JSON/cazurro.json (see the card below if they are not found automatically).
Two small neural networks, written from scratch in pure JavaScript — no machine-learning libraries, no game-tree search, no move simulation, no human games to imitate. A brain sees the table exactly as a player sees it and picks a move by probability. It learns only from the outcomes of the rounds it played.
Every move is encoded as a feature vector of 106 numbers: my 7+ tiles and the full tile set (28, one-hot: in my hand / on the board / unseen), the two open ends, the size of el bote, each player's hand size and tally, and — crucially — the shown information about each opponent this round: which pip values they have played, how many tiles they drew from el bote, and their pasos. The game state that the law of the village hides (the opponents' hands) is never given to the brain. Hidden information must be inferred.
The output layer has 56 scores — one per (tile, end) pair (28 tiles × 2 ends). Illegal moves are masked out and the remaining scores become a probability distribution over legal moves.
v1 is a feed-forward network: 106 inputs → 64 hidden neurons (tanh) → 56 outputs. A second hidden layer of 64 (v1 · 2L) was also tested. Opponents' past actions enter as fixed summaries in the input vector — the counts mentioned above.
v2 keeps the same body but adds a recurrent memory: a vector of 32 numbers updated after every event of the round — any tile played by anyone, any draw from el bote, any paso, in order. At each decision, the memory is first updated with the current observation, then read together with it. The whole event sequence of the round is trained end-to-end (back-propagation through time, BPTT).
v1 is the accountant. It keeps totals — how many fives she has shown, how many tiles he drew — and reacts. It cannot represent order: "he drew twice from the bote and then passed on a 5" is just "2 draws, 1 paso, no fives" to it. Its summaries are the kind of counting a casual human player does.
v2 is the gossip. Its memory is a running story of the round. It can, in principle, hold the sequence of events and support finer inferences — "she drew two tiles and still hasn't played a five, so she probably doesn't have one" — the reasoning of an attentive player. The price: it has more to learn (the memory must be trained through time), so it matures noticeably more slowly. This is not speculation — the champion league showed v2 seeds losing every early evaluation and dominating once given 50% more pre-training (see the league).
Learning is REINFORCE (a policy-gradient method). Three copies of the same brain play complete rounds against each other. At the end of a round, each player receives a negative reward equal to the points added to their tally. Each move's contribution is weighted by the advantage of the outcome (round-average baseline), with a small entropy bonus (β = 0.01) to keep exploration alive:
All updates use the Adam optimiser with a single scalar learning rate. The experiments use a decayed schedule, one value per phase of training:
The learning rate, in plain words. The learning rate is the size of the step the brain takes after each lesson. A high rate is an enthusiastic student who overreacts to every round and never settles — trained at 0.002–0.003, brains ended 6–8 points weaker, thrashing around a plateau. A low rate is a careful student who barely moves. The schedule is a student who starts enthusiastic (0.0005 buys +20 points in a few thousand rounds), then cools down to consolidate what was learned. The surprising finding of the grand tour: the cooling itself is where most late progress comes from — each drop of the rate produces a visible jump, while extra rounds at the same rate produce almost nothing. The final phase at 0.00005 bought nothing measurable and could be skipped entirely.
Before measuring any trained brain, two honest baselines — both measured over 10,000 complete matches to 21 against two random opponents (every number wobbles only about ±1%):
| Test | Win % to 21 | vs chance |
|---|---|---|
| 1 | 35.6% | +2.3 pts |
| 2 | 33.6% | +0.2 pts |
| 3 | 34.6% | +1.2 pts |
| 4 | 39.8% | +6.5 pts |
| 5 | 34.7% | +1.4 pts |
| 6 | 39.9% | +6.5 pts |
| 7 | 36.4% | +3.1 pts |
| 8 | 35.1% | +1.7 pts |
| 9 | 35.7% | +2.4 pts |
| 10 | 31.9% | −1.5 pts |
| Mean of 10 | 35.7% | +2.4 pts |
Ten fresh, independently initialized v1 · 1L brains, each playing 10,000 complete matches to 21 (round after round, with tallies and eliminations) against two random players, greedy from their random initial weights. Chance is 33.3%; at 10,000 matches, pure noise moves each number by only about ±1%.
Why this matters. Any consistent policy — even one made of random weights — beats picking blindly. The reason is structural: uniform random play shreds pips at random, ignores the two ends, and hands the initiative to whoever happens to hold the right tiles. A fixed policy, however clumsy, at least does the same kind of thing every round, so the variance of its results drops and the weaknesses of blind play are punished. The practical lesson for everything that follows: compare trained brains against these two references, not against 33% alone — a brain at 55% is not "22 points above chance", it is ~19 points above a random-weight nobody.
The first loop was the plain one: pick the opponents (learner copies, random players, or loaded brains frozen in the other seats), a number of rounds, and watch the statistics. Training in segments of 10,000–20,000 self-play rounds against chosen opponents, and measuring each time. Two facts surfaced immediately:
Then the tournament: eleven brains — the products of different training runs (v1 and v2, one and two layers, various learning rates, self-play and training against randoms, 5,000 to 206,936 rounds) — played each other 10,000 complete matches to 21 per pairing, chairs alternating, with a random player in the third seat. Each entrant also played 10,000 matches against two random players.
Bars scaled to 50% head-to-head (with a random third seat, ~42–45% is parity between equals).
Cell (row, column) = share of matches won by the row brain when facing the column brain, over 10,000 complete matches to 21 with a random player in the third seat, chairs alternating. Shaded cell = the brain does not play itself. Last column = 10,000 matches against two random players.
| row beats column | v1·2L · .003 vs rnd | v1·2L · .003 self | v1·2L · .0005 vs rnd | v1·1L · vs rnd (207k) | v1·2L · .0005 self | v1·1L · self (200k) | v1·1L · “mike” (5k) | v2·1L · .002 self | v2·1L · .0005 self | v2·2L · .0005 self | v2·2L · “pepe” | vs two random |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| v1·2L · .003 vs rnd | – | 38.9% | 34.1% | 40.1% | 34.2% | 36.1% | 36.0% | 34.7% | 30.3% | 33.1% | 33.5% | 46.0% |
| v1·2L · .003 self | 38.9% | – | 34.8% | 41.1% | 34.5% | 36.2% | 35.7% | 36.0% | 31.3% | 34.7% | 33.0% | 46.3% |
| v1·2L · .0005 vs rnd | 47.0% | 46.9% | – | 50.0% | 42.1% | 44.6% | 43.8% | 43.6% | 39.8% | 41.9% | 40.7% | 55.1% |
| v1·1L · vs rnd (207k) | 37.1% | 35.7% | 31.2% | – | 33.0% | 35.8% | 35.6% | 33.8% | 29.7% | 32.9% | 33.3% | 45.3% |
| v1·2L · .0005 self | 48.3% | 47.3% | 42.7% | 49.4% | – | 46.8% | 46.0% | 45.7% | 40.9% | 44.3% | 43.8% | 55.7% |
| v1·1L · self (200k) | 44.7% | 44.4% | 38.4% | 44.5% | 36.1% | – | 40.8% | 40.8% | 35.3% | 40.3% | 36.6% | 52.9% |
| v1·1L · “mike” (5k) | 45.1% | 45.9% | 39.6% | 44.8% | 38.3% | 42.0% | – | 41.6% | 38.1% | 39.8% | 39.4% | 53.5% |
| v2·1L · .002 self | 45.4% | 45.3% | 39.7% | 46.2% | 37.5% | 40.9% | 40.3% | – | 37.0% | 40.4% | 39.6% | 53.4% |
| v2·1L · .0005 self | 53.5% | 51.4% | 46.0% | 53.9% | 45.1% | 48.5% | 46.2% | 48.4% | – | 48.0% | 46.8% | 61.1% |
| v2·2L · .0005 self | 49.0% | 46.8% | 41.4% | 47.9% | 38.7% | 42.5% | 42.5% | 42.7% | 36.6% | – | 40.0% | 55.2% |
| v2·2L · “pepe” | 49.7% | 49.1% | 44.2% | 49.5% | 41.6% | 47.0% | 43.9% | 45.8% | 39.3% | 44.8% | – | 57.4% |
One question the tournament could not answer: how much of a brain's strength is the architecture, and how much is the luck of its initial weights? So the same training protocol ran five times, with five independent v1 · 1L brains, each from its own fresh random initial conditions — four phases of 20,000 rounds at LR 0.0005 → 0.0003 → 0.0001 → 0.00005 (80,000 each), evaluated every 4,000 rounds over 10,000 matches to 21 against two random players.
| Rounds | LR | Run 1 | Run 2 | Run 3 | Run 4 | Run 5 | Mean |
|---|---|---|---|---|---|---|---|
| 0 (untrained) | 0.0005 | 34.6% | 34.6% | 31.5% | 35.5% | 34.7% | 34.2% |
| 4,000 | 0.0005 | 55.3% | 53.3% | 55.9% | 51.3% | 53.1% | 53.8% |
| 8,000 | 0.0005 | 58.0% | 56.9% | 56.5% | 55.0% | 56.3% | 56.6% |
| 12,000 | 0.0005 | 58.0% | 57.0% | 57.9% | 55.3% | 56.1% | 56.8% |
| 16,000 | 0.0005 | 56.1% | 59.0% | 57.8% | 54.7% | 56.8% | 56.9% |
| 20,000 | 0.0005 | 57.7% | 57.3% | 59.0% | 55.1% | 58.0% | 57.4% |
| 24,000 | 0.0003 | 57.5% | 58.4% | 59.2% | 56.1% | 57.9% | 57.8% |
| 28,000 | 0.0003 | 56.9% | 58.7% | 59.7% | 56.9% | 59.1% | 58.3% |
| 32,000 | 0.0003 | 58.3% | 59.2% | 59.2% | 58.5% | 61.0% | 59.2% |
| 36,000 | 0.0003 | 58.6% | 60.1% | 59.9% | 58.7% | 59.7% | 59.4% |
| 40,000 | 0.0003 | 59.1% | 60.0% | 59.4% | 58.9% | 59.7% | 59.4% |
| 44,000 | 0.0001 | 60.4% | 59.8% | 60.2% | 59.0% | 60.3% | 59.9% |
| 48,000 | 0.0001 | 59.3% | 59.1% | 60.4% | 59.8% | 61.3% | 60.0% |
| 52,000 | 0.0001 | 58.3% | 59.7% | 59.8% | 59.0% | 61.0% | 59.6% |
| 56,000 | 0.0001 | 59.3% | 60.3% | 60.0% | 59.2% | 60.6% | 59.9% |
| 60,000 | 0.0001 | 59.5% | 59.6% | 61.0% | 59.5% | 60.9% | 60.1% |
| 64,000 | 0.00005 | 59.3% | 62.1% | 60.6% | 59.3% | 60.8% | 60.4% |
| 68,000 | 0.00005 | 59.3% | 59.5% | 60.8% | 59.5% | 61.2% | 60.1% |
| 72,000 | 0.00005 | 59.6% | 59.7% | 59.6% | 59.4% | 62.2% | 60.1% |
| 76,000 | 0.00005 | 59.2% | 60.2% | 61.2% | 59.8% | 62.1% | 60.5% |
| 80,000 | 0.00005 | 59.8% | 60.3% | 61.5% | 60.5% | 61.4% | 60.7% |
The same disciplined protocol for all four architectures at once — v1 · 1L, v1 · 2L, v2 · 1L, v2 · 2L — each from fresh random initial conditions, trained in self-play, evaluated every 4,000 rounds over 10,000 matches to 21 vs two random players. Final standings:
| Rounds | LR | v1 · 1L | v1 · 2L | v2 · 1L | v2 · 2L |
|---|---|---|---|---|---|
| 0 (untrained) | 0.0005 | 39.1% | 36.7% | 31.2% | 35.4% |
| 4,000 | 0.0005 | 56.3% | 55.6% | 51.1% | 49.8% |
| 8,000 | 0.0005 | 59.0% | 58.1% | 55.9% | 51.3% |
| 20,000 | 0.0005 | 58.3% | 57.2% | 58.8% | 57.2% |
| 40,000 | 0.0003 | 60.0% | 60.1% | 59.4% | 57.2% |
| 60,000 | 0.0001 | 61.4% | 60.1% | 59.3% | 57.5% |
| 80,000 | 0.00005 | 61.8% | 59.3% | 60.2% | 58.4% |
(Condensed; the full table has all 21 checkpoints.)
Self-play's ceiling is 61–62%, and the five runs showed the seed lottery is worth more than tens of thousands of rounds. The champion league turns both facts into method — a small population of brains that breed, compete, and get selected, in four phases:
Six members, four cycles, serondo (the tournament champion, v2 · 1L, 61.1% vs randoms) loaded as the target. Result: champion 58.1% vs randoms, 43.0% vs serondo — a statistical tie with the old champion, not a victory. Three lessons, all confirmed by the per-cycle history:
Three changes: a higher share of random opponents in the pool (30%), 50% extra pre-training for the v2 seeds, and bigger evaluation samples. Result: champion v2 · 1L-2″ at 59.9% vs randoms, 42.7% vs serondo — parity again, but with a healthy population:
The honest verdict: two independent runs converged to the same result — the league reliably reproduces the best existing brain (parity with serondo, whose arch the champion shares) but does not exceed it. Fresh breeding spends most of its budget re-reaching the plateau; the next step is starting from strength — seeding the league with the best existing brains as competing entrants.
And the standing challenge: serondo (v2 · 1L, 61.1% vs randoms, undefeated in the tournament) has never been beaten by anything trained since. The league twice produced its equal — the reader who plays above and wants to try can challenge it in the game above.