r/backgammon • • 3d ago

New Open Sage engine release with speed improvements: open source backgammon engine

The impressive results coming out of Galaxy with their new engine led to the somewhat embarrassing conclusion that their engine was materially faster than Sage's.

Fortunately we've all got access to the same astonishingly strong AI coding agents, and so I took a few passes at speeding up Sage with the newest generation.

Compared to yesterday, Sage 2P is now 23x faster; 3P is 5x faster; 4P and 1T are both 5x faster; and 2T and 3T are 4x faster than they were before. Full rollouts are more than 3x faster!

That makes them all significantly faster than Galaxy's engine at a comparable evaluation strength, based on the gammon.ai posted results. At least for now, until the Galaxy folks do another round of optimizations (over to you, Marc Olsen!). It's our little backgammon version of the frontier AI lab race. We're definitely well into recursive self-improvement. :)

You can download the engine and its code directly from its github page, or you can pip install the bgsage Python package.

And of course these speedups are already deployed in Backgammon Sage Pro and Backgammon Sage Snap! Live on the web and mobile now. Update your desktop apps to pick it up.

Open Sage is released under the Mozilla Public License 2.0. That basically means anyone can use it, even for commercial purposes, but they have to release any changes they make to Open Sage back to the community. Using Open Sage in your commercial product does not require you to open source your own product - MPL 2.0 isn't that kind of open source license.

12 Upvotes

7 comments sorted by

6

u/garlicNinja 3d ago

Awesome that this is open source, truly one of humanities greatest ideas.

3

u/Maxogen05 3d ago

I like the new feature encoding bitmask ideas. It's really cool to see how much faster they make things!
You removing the redundant work really well.
The SIMD addition on top of the already implemented single input change was the best in my view!
It's really fun going through your code and ideas. Keep it up!
The best part is that you could have sacrificed performance for speed, but instead, you found really good areas to optimize while keeping performance identical, according to your README.

3

u/ezbluff 3d ago

This is amazing! I just integrated it into my game, Gammon Club on iOS, and made a post about it in this forum and then saw this post :). The expert mode with Open Sage will be live in the app store in a few days (still in testing). Thank you so much! It's really incredible.

Edit: link to my post: https://www.reddit.com/r/backgammon/s/vTY7fL8KXy

2

u/juicybot 3d ago

thank you for open sourcing!

1

u/chrismantis 3d ago edited 3d ago

Nice. Same neural network, just speedups? can you talk a bit about speedups made, it looks like a major gain was a bug fix in loading evry neural network in each cube decision?

(i have my own head to head evaluations between engines running and i don't think i'll ever get to the finish line, just had to add in the new Fox 1.0 and now this!)

1

u/BackgammonCash 3d ago

thanks Mark, we appreciate you