How
The network, in brief — and where the full write-ups live
Raccoon is a single neural network and no search. When it is your opponent’s turn it generates every legal play for the dice, encodes all of them at once, and evaluates them in one batched forward pass; the play with the best value wins. The network’s value head predicts six mutually exclusive outcomes — win, gammon and backgammon, each way — from which cubeless equity follows directly.
That is the whole move-selection algorithm. There is no tree search, no rollout and no policy head at play time, which is why it answers in milliseconds in a browser tab and still outplays GNU Backgammon’s own network.
What the network is
| Architecture | 10-block, 256-channel residual network — 11.9M parameters |
| Input | A (26, 2, 12) tensor: checker planes, bar/borne-off/dice broadcasts, and handcrafted pip, blot, anchor and contact features |
| Value head | Six mutually exclusive outcomes — win, gammon, backgammon, each way — from which cubeless equity follows |
| Move selection | 0-ply value lookahead: every legal play is evaluated in one batched forward pass, no search |
| Training | Supervised distillation of 40M positions labelled by GNU Backgammon’s 2-ply search |
| In the browser | The same weights exported to ONNX and run client-side by ONNX Runtime Web |
The browser really does run the measured network: the exported file scores PR 0.9500 on the benchmark against 0.9498 for the PyTorch checkpoint it came from. The numbers in full.
Run it yourself
The code is MIT-licensed Python and PyTorch, with game rules from OpenSpiel.
git clone https://github.com/lassehjorthmadsen/raccoon.git
cd raccoon
make setup # editable install with dev dependencies
make test # run the test suite
make play # starts an untrained network — see the note belowThe trained weights are not in that repository, and make play without a checkpoint quietly starts an untrained network that will play badly. The network this site actually runs is published — exp018-ep22-fp32.onnx under app/models/ in the website repository, the same file measured at PR 0.9500 — but loading it from the Python engine is not wired up yet. If you want to run the measured network outside a browser, get in touch; milestone 5 is about exposing it over HTTP so this stops being a caveat.
Embedding it
The engine speaks the Raccoon Game Protocol, a UCI-style line protocol over stdin/stdout intended for analysis GUIs — see raccoon/protocol/rgp.py. Exposing the same engine over HTTP, so a front-end developer never has to run Python at all, is milestone 5 on the roadmap. If you are building a tool and want to embed Raccoon before then, get in touch.
Where the work is published
Every experiment behind the engine is written up at research.raccoonbg.com: one hypothesis, one primary metric fixed before the run, every checkpoint scored against it with sample sizes and confidence intervals — including the runs that failed and the measurement bugs found in our own evaluation code. Start with the distillation results, which is how the current network was trained, or variance reduction, which is how it was measured against GNU Backgammon.
It is a working lab notebook rather than documentation, and it reads like one. The short version is on Strength.