BimmerBass / Loki

C++17 chess engine
GNU General Public License v3.0
9 stars 2 forks source link

Loki

Loki is a UCI-compliant chess engine written in C++. At the moment it has been tested to have a strength of 2490 (version 3.5.0 on CCRL 40/15) elo.

Why the name?

After a bit of googling I found someone who recommended that one uses a name that describes what the program does (duh..). Then, I thought that a chess engine is cold, calculating and cunning, so naturally the first name to come to mind was the nordic god, Loki. After elementary school - where we learned about the nordic gods - I've always thought he was a bit of a d*ck, and so is a chess engine.

Elo history

Version Elo TC
1.0.2 1766 2'+1"
1.2.0 1821 2'+1"
2.0.0 2036 2'+1"
3.0.0 2466 2'+1"
3.5.0 2490 40/15

Implementation

Loki uses bitboards as its main board representation

Move generation

Evaluation

The evaluation considers the following characteristics of a given position:

A tapered eval is used to interpolate between game phases. Additionally, each thread's evaluation function object has its own evaluation hash table (128KB).

The evaluation function is tuned using an SPSA-texel tuning framework. This will later be changed though.

Search

With all the above mentioned move ordering techniques, Loki achieves a cutoff on the first move around 85%-90% of the time.

Note: Features with a striketrough (line through the text) are disabled at the moment due to missing elo gains. These will hopefully be successfully implemented in the future.

Building Loki

Loki has been tested to build without errors on both MSVC and GCC (with some warnings by the former). If Loki should be compiled to a non-native popcount version one will have to either:

Additionally, a 32-bit compilation in GCC needs BIT=32 when running make. It should be noted however, that 32-bit compilation on 64-bit systems is unstable and should be avoided at the moment.

It is also possible to change the amount of optimizations with both compilers by (if MSVC) going to the project properties or (if GCC) using optimize=no when running make.

TO-DO

Special thanks to