go_game_board

Crates.iogo_game_board
lib.rsgo_game_board
version0.1.1
created_at2025-08-31 15:22:23.619813+00
updated_at2025-11-03 03:12:26.282695+00
descriptionGo/Baduk/Weiqi rules implementation with libEGo-based algorithms
homepage
repositoryhttps://github.com/lukaszlew/go_game_board
max_upload_size
id1818637
size78,198
Ɓukasz Lew (lukaszlew)

documentation

README

go_game_board

High-performance Go/Baduk/Weiqi board representation and Monte Carlo playouts in Rust.

Based on the libEGo library's proven algorithms and data structures.

Features

  • Fast board representation with Zobrist hashing
  • Efficient move generation and validation
  • Monte Carlo playout engine with pattern-based move sampling
  • Second-order pseudo liberty tracking - allows finding liberty of groups in atari
  • Ko detection and super-ko via positional hashing
  • Performance counters for benchmarking

Usage

use go_game_board::{Board, Player, Vertex};

let mut board = Board::new();
board.clear();

// Play a move
let vertex = Vertex::from_coords(3, 3);
board.play_legal(Player::Black, vertex);

// Run benchmark
use go_game_board::Benchmark;
let mut bench = Benchmark::new();
println!("{}", bench.run(10000, None));

Performance

This library is optimized for high-performance Monte Carlo tree search (MCTS) applications. On 2GHz CPU it achieves ~3M moves per second (compared to libEGo's 3.6M moves per second - the fastest implementation in the world)

Run benchmarks with:

cargo test --release --test benchmark_test

Dependencies

  • go_game_types - Shared type definitions for Go game libraries
  • arrayvec - Stack-allocated vectors for performance
  • lazy_static - Lazy static initialization
  • perf-event - Performance counter support (Linux)

License

Apache-2.0

Commit count: 7

cargo fmt