r/backgammon • u/B37hHarm0n • 9d ago
Engine-vs-engine matches: how do you test whether one bot is stronger?
I’m building BG Tutor, a local backgammon ap. It imports and analyzes matches, lets you play against the engine, and turns your own mistakes into practice cards. It uses GNUbg and Open Sage.
It also runs engine duels. In the screenshot, GNUbg 3-ply plays Open Sage 3-ply over 100 pairs of 5-point matches. In each pair the same dice are replayed with the sides swapped. GNUbg won 107–93, but the 95% CI is 39.9–67.1%, so I can’t call a winner.
I’d love input from anyone who has run engine matches before:
- Is pairing with swapped sides the right way to reduce variance, or is there something better, like luck adjustment?
- How many matches, and what match length, do you need before you trust a small difference?
- Any pitfalls you’ve hit with the cube, Crawford or deterministic play?
Thanks!
8
Upvotes
2
u/chrismantis 9d ago edited 9d ago
You need (a) thousands of matches, and (b) serious variance reduction. Your screenshots show it - 100 matches with a confidence interval of 40% to 67%. That's a range so wide to be worthless.
Swapped dice pairing does a little to reduce luck variation but not much. What I've found is basically as soon as the plays deviate, position types change, and you loose all value in dice pairs. You may as well have it, as it costs nothing, but the impact is very small - 10% to 30% luck reduction.
I like your initiative - and i'll have an engine to submit to you soon! - but it's ultimately quite a waste of CPU cycles letting each user do it itself solo. May as well run it all yourself native rather than wasm, then publish the results and the analyzed files for anyone curious?
If you do that route, i think what's important is moving away from "ply vs ply" and do it based on capped CPU cycles per decision. Ply can be very unequal - anything of reasonable size will be heavily pruned. But you could offer a huge neural network with max width search space to max out your skill but in reality that's insanely slow.
Also, you'll get engines tuned to different things. The one i'm working on that i'm calling "Quick" is mostly 2-ply (as XG would call it, 1-ply and GNUBG would call it). but it goes to 3-ply for cube decisions and in race positions. You'll also get deviations in whether it ships with bear-off tables etc. Just something to consider.
2
u/FrankBergerBgblitz 9d ago
If you play cubeless(*) moneygames you can calculate the confidence interval by roughly 2.7/sqrt(#games).
If you calaculate the necessary number of games you'll see that swapping dice wouldn't play any important roll (but it doesn't hurt either).
(*) otherwise it is hard (maybe impossible) to calculate the variance
1
u/Maxogen05 9d ago
Really cool! Yea a small but good way. 100k single point is enough to start ig