feat: minimal MCTS engine with UCI

Bitboard board with fancy magics and fully legal move generation, checked
by a perft suite. PUCT search over a node arena with FPU reduction and
in-tree draw detection. Hand-written value (eval + quiescence) and
heuristic policy stand in until the network is trained. UCI loop with a
search thread, OpenBench-compatible bench and Makefile.

Bench: 546127

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rektdieandclaude committed 2026-11-15 00:31:20 +01:00
commit d3044c0b88
19 files changed
+1997

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
#include <cstdlib>
#include <string>
#include "bitboard.h"
#include "eval.h"
#include "perft.h"
#include "position.h"
#include "uci.h"
int main(int argc, char* argv[]) {
rigby::attacks::init();
rigby::zobrist::init();
rigby::eval::init();
if (argc > 1) {
const std::string cmd = argv[1];
if (cmd == "bench") {
rigby::run_bench(argc > 2 ? std::atoi(argv[2]) : 5000);
return 0;
}
if (cmd == "perftsuite") {
return rigby::perft_suite(argc > 2 ? std::atoi(argv[2]) : 6) ? 0 : 1;
}
}
rigby::uci_loop();
return 0;
}