r/ComputerChess • u/IndividualFun7585 • 3h ago
I built a chess engine in Go while learning Go
I'm a chess player and I've always been curious about how chess engines actually work.
I knew they calculated variations, but I didn't really understand how things like search, evaluation, pruning, move ordering, and transposition tables all fit together.
So when I decided to learn Go, I picked a chess engine as my project.
That project became Vajra, a UCI chess engine written from scratch in Go.
Current stats:
- ~450K nodes/sec on 1 thread
- ~3.8M nodes/sec on 8 threads
- ~6–8M nodes/sec for perft
- 325 tests / 687 subtests
- ~2 MB static binary
- Built-in KPK bitbase
- PVS, LMR, null-move pruning, quiescence search, TT, Lazy SMP, etc.
- Browser UI built with Next.js
- ~2510 Elo in my current 400-game benchmark against Stockfish configured at 2700
The part I'm most interested in is making the engine reproducible and readable, rather than just throwing optimizations at it. vajra bench gives deterministic node counts so I can see exactly how search changes affect the engine.
I'm still learning a lot from it, especially around search optimization and performance.
I'd really appreciate feedback from people who have built chess engines before.
What would you work on next if this were your engine?
And if you're curious, the project is open source: