Adam-Kulju / Patricia

Extremely aggressive chess engine, written in C++
MIT License
51 stars 6 forks source link
aggression chess chess-engine cpp sacrifices uci

Patricia Chess Engine

[![License][license-badge]][license-link] [![Release][release-badge]][release-link] [![Commits][commits-badge]][commits-link]

The most aggressive chess engine ever written, Patricia is a killer bunny who will not hesitate to ram as many pieces as possible down your throat.



Aggression

The metric that Patricia's aggression claims are based off of is Stefan Pohl's EAS tool (found here), which is the most well known and well regarded tool for determining the aggressiveness of chess engines. It looks at a combination of factors, such as sacrifice rate, short win rate, and unnecessary draw rate, and outputs a score that captures how "exciting" an engine tends to play.

The average engine's EAS score generally falls between 50,000 and 100,000. The most aggressive top engine is Stockfish, due to its extreme tactical ability; it has an EAS score of 190,000. The most aggressive engine of any notable strength that Stefan Pohl has ever seen is Velvet 4.1.0, which topped out at a remarkable EAS Score of 280,000.

Patricia, with an EAS score of 420,000 in gauntlet testing, is leaps and bounds above any engine that has ever existed in terms of attacking, sacrificing, and playing stylishly.

It's worth noting that Patricia is still well into superhuman territory, with an estimated CCRL elo of 3300-3350; she can put up a solid fight against top engines, and can crush any human or weak engine that dares to oppose her.



What Patricia currently does to increase aggressiveness



Search Features

This is not a comprehensive list of search features that Patricia has.



Customization Options

Patricia supports a few options for users: Hash: The memory alloted to the transposition table.

Threads: Number of threads to search with.

UCI_LimitStrength: Enables Patricia to be weakened using UCI_Elo.

UCI_Elo: Sets Patricia to play at a given strength range, anywhere from 500 to 3000. These ratings were calibrated by playing many matches against engines of all strengths.

MultiPV: Patricia searches the best X moves instead of only looking for the best line.

Skill_Level: Sets Patricia to play at one of 20 possible strength levels. They are:

Skill Level         ELO
     1              500
     2              800
     3              1000
     4              1200
     5              1300
     6              1400
     7              1500
     8              1600
     9              1700
     10             1800
     11             1900
     12             2000
     13             2100
     14             2200
     15             2300
     16             2400
     17             2500
     18             2650
     19             2800
     20             3000

go nodes: Search a position for a given number of nodes.

go depth: Search a position to a given depth.

go movetime: Search a position for a given number of milliseconds.



Evaluation and Filtering

Patricia's evaluation is a neural network with a 768x2->768->1 perspective arch, trained on 2.4 billion positions of my other engine Willow's data. It has been additionally retrained on a filtered dataset of 10 million positions specially selected for being "aggressive positions", in order to increase Patricia's understanding of them and to make her more likely to play into similar positions.

Code for filtering programs are found in the utils/ directory, and are indentified as follows:

Patricia currently uses positions that were filtered out by script 9.

Additionally, the converter.cpp file allows you to transform bullet-format data into text data, so that you can then use the filtering scripts on the resulting file.

All filtering programs are run with the command ./[exe] [input.txt] [output.txt]. You'll have to compile the particular program that you want to run yourself, or you can ask me for a binary for a specific filtering method.



Datagen

Patricia has support for data generation; in order to compile the datagen script, run make datagen in the engines directory. This will give you an executable named data; run ./data [number of threads] [optional EPD opening book] to start datagen, and exit the process whenever you want with Ctr-C.



Acknowledgements



Other

Instructions for downloading/building Patricia can be found in the Releases section. If you know UCI protocol, you can run Patricia directly, otherwise she will work with any major GUI (Arena, BanksiaGUI, etc.)

If you think Patricia is a cool project, please spread the word! There are lots of people interested in an aggressive engine, whether it be for sparring or for analysis, and greater awareness of the undisputed queen of style would make their wish come true.