You are browsing as a guest. Sign up (or log in) to start making projects!

Gofer

  • 2 Devlogs
  • 12 Total hours

Go (Baduk) engine in Go: Chinese rules, MCTS, GTP, terminal play, analysis, self-play, and SGF.

Ship #1 Changes requested

Gofer is a full Go (Baduk) engine written in Go, implementing Chinese rules with Monte Carlo Tree Search (MCTS) as its core decision-making algorithm. The engine supports terminal play, self-play, position analysis, and SGF import/export, making it usable both as a standalone player and as a research tool. It also implements the Go Text Protocol (GTP), which lets it plug directly into popular Go GUIs like Sabaki and Lizzie for a more visual playing and analysis experience.

Technical Implementation Paragraph
Under the hood, Gofer uses PUCT-based MCTS with a transposition table and parallel playouts, paired with a heuristic evaluator (stones, liberties, territory estimate, move priors) or an ONNX neural network backend for stronger play. The project includes a full machine learning training loop inspired by AlphaGo Zero-style research, with a PyTorch bootstrap trainer, self-play sample generation, and arena gating (using Wilson confidence intervals) to validate that new model versions actually outperform prior ones before promotion. It's built primarily in Go (70.8%) with Python for the training pipeline and Shell for automation scripts, and ships with a nightly 200-game arena workflow on GitHub Actions plus a public web demo hosted at gofer.devomb.com.

Progress and Learnings Paragraph
The current release, v2.7.0, includes in-process ONNX inference (no external sidecar needed), a parity harness proving the Go inference engine matches the Python reference implementation bit-for-bit, and profile-guided build optimization for performance tuning. Building Gofer meant tackling real research-to-code translation, implementing ideas from the Wu et al. 2020 Go ML paper, wiring together board logic, tree search, and neural inference into one coherent binary. Remaining goals include closing the strength gap toward KataGo-level play, moving fully off the ONNX sidecar architecture, and adding complete time control support like byo-yomi.

  • 2 devlogs
  • 12h
Try project → See source code →
Open comments for this post

11h 14m 35s logged

Gofer is a Go (Baduk) playing engine I built from scratch in Go, inspired by the AlphaGo Zero research paper, currently at version 2.7.0. It supports Chinese rules, a GTP interface so it works with popular Go analysis tools like Sabaki and Lizzie, terminal play, self-play generation, and SGF import/export. Rather than trying to compete with production-grade engines like KataGo, I built it as a research-focused project to deeply understand how these systems actually work under the hood.

At its core, Gofer uses Monte Carlo Tree Search with a PUCT selection strategy — the same family of algorithm that powers AlphaZero — combined with a neural network evaluator to judge board positions. I implemented ONNX-based neural inference directly in Go, which let me plug in trained model weights and validate that my Go inference pipeline produces results that exactly match a Python reference implementation. Playout counts scale with board size, so the engine can play quick games on small boards or think harder on a full 19x19 board.

Beyond just the engine itself, I built a full training and validation pipeline around it, including a replay buffer for generating self-play data and an “arena” system that only promotes a new model if it statistically beats the current best version. I also set up automated nightly games and performance benchmarks through GitHub Actions to make sure new changes don’t quietly make the engine weaker or slower. It’s been a great deep dive into machine learning, search algorithms, and systems engineering all in one project.

0
0
1

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…