⚠ WARNING: This is a beta version
This app is in early development. Some features may be broken. Use at your own risk. Due to a bug in bun, postbot only works with bun v1.30 at the moment, when used with BanksiaGUI or the lichess-bot.
This is postbot an UCI chess engine written in Typescript. It's my second attempt to write a chess engine, since I wrote Canalla back in 2003 (C++ UCI chess engine competing in some private tournaments). Since postbot is written in TypeScript and compiled to JavaScript running in a linux docker container on my Raspberry Pi 4 it won't be breaking performance records but it's a fun project.
Play against the current version on lichess. You can play rated and casual games.
lichess: https://lichess.org/@/postbot
postbot is running on a Raspberry Pi 4.
git clone https://github.com/postnerd/postbot.git
npm install
npm build
You can analyze a position via terminal giving a fen and then starting the search.
npm start
Set position you want so analyze:
position fen <fen_string> OR position fen <fen_string> moves <moves>
To start analyzing you have a few options
Analyze the given position until you stop it.
go infinite
You can stop by typing 'stop'.
Analyze the given position until the search reaches a certain ply on the search tree.
go depth <n>
Analyze the given position for a specified time.
go movetime <time in ms>
position startpos
go depth 8
position fen 8/8/7p/3KNN1k/2p4p/8/3P2p1/8 w - -
go infinite
position fen 8/8/7p/3KNN1k/2p4p/8/3P2p1/8 b - - moves d5c6
go movetime 10000
You can stop a search by typing 'stop' and quit postbot by typing 'quit'.
If you know the UCI specification you can even play a full game in the terminal, but it's not that comfortable. But you can use a chess GUI to play against postbot on your local machine.
I'm using BanksiaGUI but it should also work with other GUIs (e.g. ChessX / Arena) as long as they support starting a bun process with an init string.
Go to Preferences -> Engines and click the little "+"-Button in the upper right.
Than fill in the requested information like this:
After this BanksiaGUI should auto detect the name and you are ready to analyze and play games against postbot.
If you have modified postbot and want so see it playing on lichess against other bots, you can use the postbot Dockerfile for building a docker container. For more information on this please take a look at the lichess subfolder.
- switched from node to bun
- performance improvements of around 26%
- no build process needed anymore
- performance optimizations
- improved move generation for castle moves
- code improvements
- performance optimizations
- generate pseudo legal moves and validate them only right before using them
- aspiration windows for search
- best move caching in capture search
- optimized docker setup to release new version on lichess by restarting docker container
- ability to install postbot as a global node packages
- finally a complete implementation of all important chess rules (50 move rule, stalemate etc.)
- transposition tables 1.0 for main search
- added endgame piece-square tables to the evaluation
- enhanced time management when playing with increment
- bugfixes (hash, castle rights)
- added perft tests
- basic evaluation based on piece-square tables for middle game
- new hash table implementation to reduce hash collisions
- evaluation score caching
- updated move list sorting (MVV-LVA and killer moves)
- search optimizations by adding alpha beta pruning and quiesce search
- basic move ordering to evaluate former best moves and capture moves first
- launched postbot on lichess
- basic evaluation and search algorithm
- basic hash table implementation
- search is handled by a worker thread to ensure proper communication between engine and GUI/lichess
- engine supports game and analyze mode via uci
- launched postbotR (little brother of postbot) on lichess
- basic board representation and move generator
- basic uci communication supporting to start from position