r/backgammon • • 9d ago

Engine-vs-engine matches: how do you test whether one bot is stronger?

Post image

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

8 comments sorted by

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.

0

u/B37hHarm0n 9d ago

Thanks, great points!

You’re right about the numbers. I checked, and swapping dice cut variance by about 22% here, right in your 10–30% range. So the real fix is more matches plus proper variance reduction. Part of that wide range was also my own fault: I used a very conservative bound, and the honest CI is more like 47–60%. Still useless, of course 😄

The CPU-budget idea is a really good one. Ply really doesn’t compare across engines, so a fixed time per decision makes much more sense. Engine profiles like your “Quick” setup and differences like bear-off tables are worth keeping in mind too.

Next up:

  1. Switch the CI to the empirical variance of the pairs.
  2. Dig into the CPU-budget idea: how to cap time per decision fairly across engines, and how to handle engines that change depth for cube or race decisions.

Looking forward to seeing your engine!

1

u/chrismantis 8d ago

I'm going to be blunt and honest with you and leave you one final message - working on the assumption here that there's a human ultimately copy and pasting these messages.

The fact that every post from your in this thread is 100% written by AI discourages me with engaging with you further. I initially wrote a much more detailed post but deleted a lot of it because if you weren't putting the effort and engaging in good faith in the thread, i didn't want to either.

i have no issue with the use of AI to build tools like this, i think it's great. But personally, i have no interest in engaging with users in communities where the *posts themselves* and even the responses are AI written. it is disingenuous and is an indicator to me that the human behind the prompts isn't really interested long-term in the project.

so while i like the effort of what you're building, i won't be contributing further to your threads.

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/B37hHarm0n 9d ago

Thanks Frank, really appreciate you chiming in!

You’re right. I checked: the swapped dice cut variance by only ~20%, which is nice but nothing compared to the number of games needed. Turns out my CI was also way too conservative, so I’ll fix that.

Quick question: did you use luck adjustment when testing BG Blitz, or just lots of games?

1

u/FrankBergerBgblitz 9d ago

lot's of games (for the last couple of candidates usually 8-16 million games 1-ply cubeless. Even then it might not be 95% sure).

I tried luck adjustment as well but the decrease in variance were compensated by the higher calculation. It was in fact near zero gain so I sticked with the simpler approach.

1

u/Maxogen05 9d ago

Really cool! Yea a small but good way. 100k single point is enough to start ig

1

u/B37hHarm0n 9d ago

Thanks for the feedback! Makes sense: single-point games keep it simple and 100k should finally give a usable CI. I’ll give it a try.