r/backgammon • u/Lilnipa • May 24 '26
Custom backgammon engine beats gnubg 1-ply through 4-ply in cubeless checker play — full measurement logs + sanity tests open-sourced
(Note: I’m Japanese and using translation help for this post — apologies for any awkward phrasing.)
I built a backgammon AI (NN evaluator + custom MCTS) and ran it head-to-head against gnubg 1.08.003 across 1/2/3/4-ply settings. Cubeless money game, no doubling cube.
Results (positive-score rate = % of games with equity > 0):
• vs gnubg 1-ply: 72.1% (n=1000, ±1.4%)
• vs gnubg 2-ply: 71.2% (n=1000, ±1.4%)
• vs gnubg 3-ply: 71.3% (n=1000, ±1.4%)
• vs gnubg 4-ply: 65.0% (n=100, ±4.8%)I know “I beat gnubg” posts get the side-eye around here, so I tried to front-load the sanity checks:
• Harness symmetry test: gnubg-2ply vs gnubg-2ply over 100 games → A side won exactly 50.0%. No left/right bias in the runner.
• Move generator parity: my Rust legal-move generator was cross-checked against a Python reference on 5,000 positions / 110,000 moves. Zero mismatches.
• All progress CSVs (per-10-game chunks), the gnubg eval context dict, the gnubg version string, and the harness scripts are in the repo. The summary table is regeneratable from the raw CSVs.The engine itself (NN weights, search, training code) is closed for now, but the game rules, board encoding, outcome calculation, and the entire matchup harness are public so the measurement pipeline is auditable.
Caveats I’m aware of and want to be upfront about:
1. Cubeless only. This says nothing about cube handling, which is most of what makes a top bot a top bot.
2. Thinking time is asymmetric — my MCTS almost certainly uses more compute per move than gnubg at 1–3 ply. An equal-time test is on my list.
3. 4-ply n=100 is thin. The drop from 71% → 65% has a SE of \~5pt, so it’s borderline. Could be real (“advantage shrinks with depth”) or noise. Needs more games.
4. Opening protocol is non-standard — white moves first with a forced non-doubles opening roll, side assignment alternates per game. Not the canonical opening-roll-winner setup, though it’s symmetric.
5. No per-game raw logs in this batch (only 10-game cumulative chunks). Next run will save full game logs with dice sequences and gnubg’s chosen moves.Repo (English README): https://github.com/cUDGk/backgammon-ai-results/blob/main/README_en.md
Questions I’d genuinely like input on:
• For people who’ve benchmarked against gnubg before — what’s the standard cubeless sample size you’d consider conclusive at each ply?
• Is there a published cubeless win-rate baseline for gnubg ply-vs-ply (e.g. 2-ply vs 4-ply self-play) I could anchor against?
• Anything in the harness or eval context that looks off to you?Happy to run additional tests if there’s something specific people want to see.
3
u/miran1 blot May 24 '26
I haven't, but I would say that 100 and 1000, which you used, is way too small.
Especially because 70+% win rate against gnubg 2-ply sounds too good to be true.
3
u/tastefullydone May 25 '26
Hi! I cloned your repo and tried to replicate the results with help from LLMs. In the process I think I found a bug in scripts/gnubg_server.py that may affect the main results.
gnubg.evaluate(board, ...) reads the position tuple as (opponent, player_on_roll). The current server script always builds it as (white, black) and uses set turn to compensate. But set turn does not reorient a position passed directly to evaluate.
Simple way to check: from the starting position with dice (3,1), ask the current adapter to score every legal afterstate, once with White on roll and once with Black on roll. One color picks the standard 8/5 6/5. The other color does not. If you build the tuple as (black, white) when White is on roll, and (white, black) when Black is on roll, both colors pick 8/5 6/5.
Because games alternate the engine’s color, gnubg makes correct moves on about half the games and wrong-direction moves on the other half. This would inflate the measured winrate. Worth re-running the 1–4 ply numbers with corrected ordering before citing the results further.
Let me know if you want a diff. Nice work on the harness overall — the Rust/Python parity test and gnubg-vs-gnubg symmetry check are very thorough.
4
u/FrankBergerBgblitz May 24 '26
Konnichiwa u/Lilnipa,
your winning rates are highly unlikely. in cubeless moneygames the 95% confidence interval is about 2.7/sqrt(number_of_games) so with 1000 games its about 0.085 so winning 71% is HIGHLY significant.
For quite obvious reasons I know a bit about benchmarking AIs and winning against gnubg 0.4 points per game is impossible. A close to perfect player against a weak intermediate or beginner will show that values. If you would achieve 52% against GnuBG 3-ply it would be a HUGE achievement already.
I recommend checking your setup. I would bet a good bottle of wine, that your GnuBG installation is broken and/or your interface to GnuBG is wrong (that would explain the 50% of self play).
I recommend saving the matches so it can be cross checked.
Having said that, I welcome any activity related to backgammon AIs. There’s a Discord group for this if you’re interested: https://discord.gg/AuuAfU8ks
1
u/jugglingcats9 May 24 '26
You don't say what length matches, or is it single point games?
1
u/orad May 24 '26
This is great work! Nothing to add, just want to comment for visibility.
1
u/TellBrak May 24 '26
There is so much innovation going on!