This project aims to train super-human level AI for Tafl, an ancient Nordic strategy boardgame family. It uses 100% pure Rust, because Rust is cool.
Most of the components were developed & tested, currently in the Training phase
The Cargo workspace consists of 3 crates: bitboard, game, and most importantly, Fenrir. The bitboard crate provides the foundation of everything: It defines the bitfield representation of the game board for efficient game implementation. The game crate implements the game logic, and with
cd game
Cargo run
, you can play the game on your terminal (This application was developed using ratatui.rs)!
Tafl is known for its many variations. Fenrir is being trained for two kinds: One is a very simple 7 × 7 Brandub variant, with a bare-minimum set of rules, with the addition of max move count. On the contrast, Hnefatafl is played on 11 × 11 board, with the addition of 3rd repetition rule and shield wall capture. These two were selected so that the first one can serve as the proof of concept.
- use of tch.rs, a Rustic thin wrapper over libtorch, a C++ API of Pytorch.
- Faithful implementation of AlphaGO, AlphaZero paper.
- Tafl games are Asymmetrical, with two players playing Attacker and Defender. This creates an unavoidable imbalance to the game. This project tries to test the applicability of Curriculum-based Reinforcement Learning based on self-play.
- Use of MPI to scale the training over multiple node, espcially aimed at the HPC cluster at here in Berlin