GiacomoPorpiglia / Mida

C++ UCI Chess Engine
GNU General Public License v3.0
1 stars 1 forks source link
alpha-beta-pruning chess chess-engine cplusplus cpp neural nnue
Mida logo Strong UCI chess engine written in C++ GitHub all releases

Overview

Mida is a chess engine built entirely in C++. From version 2.0 it uses NNUE for evaluation.

Engine strength (Elo)

Version CCRL 40/15 CCRL Blitz
2.3 3146 3107
2.2 3088 3088
2.1 2941 /
2.0 / (~2600) / (~2600)
1.2.1 / 2360
1.2 / /
1.1 / 2331
1.0 / 2233

Representation of the board

To represent various board states, most chess engines, including Mida, use bitboards, which are 64-bits unsigned integers: this representation is convenient because there are 64 squares on a chess board: therefore, we can represent the occupied squares, attacked squares ecc... by setting to 1 (or "hot") the bits that correspond to an occupied or attacked square, for example.
This implementation is faster because bit-wise operations are very efficient. You can explore further here, understanding the full potential of bitboards implementation.

Move generation

Move genearation consists in generating all the legal moves for a given side and a given position. While this task may seem easy at first, I can assure you will find many obstacles along the way. To do this, I followed this article that I strongly recommend.

Evaluation

From version 2.0, Mida uses Neural Network evaluation, with HalfKP structure.

The network was very briefly trained, because for now that's not what I want to focus on. Still, it does the job. More specifically, it was trained for 35 epochs on a small set of Leela and Stockfish data of around 600 million positions. A small part of these were from DFRC games, but I haven't had the chance to test Mida in this chess variant, so I don't know how it could perform.

Search

The search is based on Alpha-beta pruning algorithm, with various pruning and reduction techniques to reduce the number of visited nodes and increase the reached depth:


How to use

To compile the code, just run the commands:

 git clone https://github.com/GiacomoPorpiglia/Mida
 cd Mida/src
 make 
./Mida

The engine is built to work with UCI (Universal Chess Interface), and you can easily find all the commands online. The most useful are:

Special thanks

For this project I used a lot of awesome resources:

Also, thanks to Graham Banks, admin of CCRL, for helping me compile the code properly so that it can execute also on machines without GCC installed, and to all the testers for the useful work they do.

Donations

Thank you for supporting Mida developement and training through

Paypal.

v2.3.1 Updates

v2.3 Updates

v2.2 Updates

v2.1 Updates

v2.0 Updates

v1.2 Updates

This version has its main updates in the search function.

v1.1 updates

The main updates in v1.1 are: