This repository has been archived on 2023-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2020-06-24 22:17:36 +02:00
external docker: add build/run Dockerfile 2020-06-18 13:14:01 +02:00
res engine: use rays for move generation 2020-06-23 00:22:29 +02:00
src engine: use "vatunode" as debug log command 2020-06-24 22:17:36 +02:00
.gitignore init: board and basic move rules 2020-05-31 02:41:02 +02:00
.gitmodules docker: add build/run Dockerfile 2020-06-18 13:14:01 +02:00
Cargo.lock node: use bitboards 2020-06-19 02:11:01 +02:00
Cargo.toml node: use bitboards 2020-06-19 02:11:01 +02:00
README.md board: compute move ray bitboards 2020-06-23 00:22:29 +02:00

Vatu

Dumb chess engine written in Rust for fun.

Features

  • UCI
  • Barely optimized board, position and moves representations
  • Simple negamax for node evaluation
  • Alpha-beta search tree pruning for speeding searches

Last time I checked it ran approximately at 10000 nps.

Thanks to UCI the bot can run with most compatible software; Cutechess has been used for testing.

Usage

Build

With Cargo:

cargo build --release

With Docker, to avoid setting up a Rust toolchain:

docker build -f res/docker/Dockerfile -t vatu-builder --target builder .
docker create vatu-builder  # Returns a container ID.
docker cp <id>:/src/target/release/vatu .
docker rm <id>
docker rmi vatu-builder

Run

If you built it with Cargo, the binary is in target/release.

./vatu

To run your own instance of the bot on Lichess (why would you do that?), create a bot account and get an OAuth token. Then using the full Docker image:

# Fetch the lichess-bot submodule.
git submodule update --init --recursive
# Copy the config.yml template to your own copy and modify it.
cp external/lichess-bot/config.yml.example /tmp/vatu-config/config.yml
# Build the image. Make sure config.yml is not there to not embed it!
docker build -f res/docker/Dockerfile -t vatu .
# Run with the config folder mounted at /config.
docker run -v /tmp/vatu-config:/config -ti vatu
# In the container, use the following command:
python lichess-bot.py --config /config/config.yml

TODO

  • Support time constraints
  • Unmake mechanism instead of allocating nodes like there is no tomorrow
  • Precompute some pieces moves, maybe (done for knights)
  • Transposition table that does not actually slows search down
  • Check Zobrist hashes for previous point
  • Actual bitboard
  • Some kind of move ordering could be great
  • Multithreading (never)