Chess engine


In computer chess, a chess engine is a computer program that analyzes chess or chess variant positions, and generates a move or list of moves that it regards as strongest.
A chess engine is usually a back end with a command-line interface with no graphics or windowing. Engines are usually used with a front end, a windowed graphical user interface such as Chessbase or WinBoard that the user can interact with via a keyboard, mouse or touchscreen. This allows the user to play against multiple engines without learning a new user interface for each, and allows different engines to play against each other.
Many chess engines are now available for mobile phones and tablets, making them even more accessible.

History

The meaning of the term "chess engine" has evolved over time. In 1986, Linda and Tony Scherzer entered their program Bebe into the 4th World Computer Chess Championship, running it on "Chess Engine," their brand name for the chess computer hardware made, and marketed by their company Sys-10, Inc. By 1990 the developers of Deep Blue, Feng-hsiung Hsu and Murray Campbell, were writing of giving their program a 'searching engine,' apparently referring to the software rather than the hardware. In December 1991, Computer-schach & Spiele referred to Chessbase's recently released Fritz as a 'Schach-motor,' the German translation for 'chess engine.' By early 1993, Marty Hirsch was drawing a distinction between commercial chess programs such as Chessmaster 3000 or Battle Chess on the one hand, and 'chess engines' such as ChessGenius or his own MChess Pro on the other. In his characterization, commercial chess programs were low in price, had fancy graphics, but did not place high on the SSDF rating lists while engines were more expensive, and did have high ratings.
In 1994, Shay Bushinsky was working on an early version of his Junior program. He wanted to focus on the chess playing part rather than the graphics, and so asked Tim Mann how he could get Junior to communicate with Winboard. Tim's answer formed the basis for what became known as the Chess Engine Communication Protocol or Winboard engines, originally a subset of the GNU Chess command line interface.
Also in 1994, Stephen J. Edwards released the Portable Game Notation specification. It mentions PGN reading programs not needing to have a "full chess engine." It also mentions three "graphical user interfaces" : XBoard, pgnRead and Slappy the database.
By the mid-2000s, engines had become so strong that they were able to beat even the best human players. Except for entertainment purposes, especially using engines with limited strength, matches between humans and engines are now rare; engines are increasingly regarded as tools for analysis rather than as opponents.
A 2024 article published in the British Journal of Psychology showed that the introduction of PC- and internet-based chess engines in the 1990s, and more recently neural networks and deep learning, has progressively improved the quality of decisions made by elite chess players. This has had a more pronounced effect on young players and a more gradual effects on established champions.

Interface protocol

Common Winboard engines would include Crafty, ''ProDeo, Chenard, Zarkov and Phalanx.
In 1995, Chessbase released a version of their database program including Fritz 4 as a separate engine. This was the first appearance of the Chessbase protocol. Soon after, they added the engines Junior and Shredder to their product line up, including engines in CB protocol as separate programs which could be installed in the Chessbase program or one of the other Fritz style GUI's. Fritz 1-14 were only issued as Chessbase engines, while
Hiarcs, Nimzo, Chess Tiger and Crafty have been ported to Chessbase format even though they were UCI or Winboard engines. Recently, Chessbase has begun to include Universal Chess Interface engines in their playing programs such as Komodo, Houdini, Fritz 15–16 and Rybka rather than convert them to Chessbase engines.
In 2000, Stefan Meyer-Kahlen and Franz Huber released the Universal Chess Interface, a more detailed protocol that introduced a wider set of features. Chessbase soon after dropped support for Winboard engines, and added support for UCI to their engine GUI's and Chessbase programs. Most of the top engines are UCI these days:
Stockfish, Komodo, Leela Chess Zero, Houdini, Fritz 15-16, Rybka, Shredder, Fruit, Critter, Ivanhoe and Ruffian.
From 1998, the German company Millenium 2000 briefly moved from dedicated chess computers into the software market, developing the Millennium Chess System protocol for a series of CD's containing
ChessGenius or Shredder, but after 2001 ceased releasing new software. A more longstanding engine protocol has been used by the Dutch company, Lokasoft, which eventually took over the marketing of Ed Schröder's Rebel.''

Increasing strength

Chess engines increase in playing strength continually. This is partly due to the increase in processing power that enables calculations to be made to ever greater depths in a given time. In addition, programming techniques have improved, enabling the engines to be more selective in the lines that they analyze and to acquire a better positional understanding. A chess engine often uses a vast previously computed opening "book" to increase its playing strength for the first several moves, up to possibly 20 moves or more in deeply analyzed lines.
Some chess engines maintain a database of chess positions, along with previously computed evaluations and best moves—in effect, a kind of "dictionary" of recurring chess positions. Since these positions are pre-computed, the engine merely plays one of the indicated moves in the database, thereby saving computing time, resulting in stronger, faster play.
Some chess engines use endgame tablebases to increase their playing strength during the endgame. An endgame tablebase includes all possible endgame positions with a small amount of material. Each position is conclusively determined as a win, loss, or draw for the player whose turn it is to move, and the number of moves to the end with best play by both sides. The tablebase identifies for every position the move which will win the fastest against an optimal defense, or the move that will lose the slowest against an optimal offense. Such tablebases are available for all chess endgames with seven pieces or fewer.
When the maneuvering in an ending to achieve an irreversible improvement takes more moves than the horizon of calculation of a chess engine, an engine is not guaranteed to find the best move without the use of an endgame tablebase, and in many cases can fall foul of the fifty-move rule as a result. Many engines use permanent brain as a method to increase their strength.
Distributed computing is also used to improve the software code of chess engines. In 2013, the developers of the Stockfish chess playing program started using distributed computing to make improvements in the software code., a total of more than 745 years of CPU time has been used to play more than 485 million chess games, with the results being used to make small and incremental improvements to the chess-playing software. In 2017, the AlphaZero engine was introduced, which used a deep neural network to evaluate positions, learning in autonomous mode through independent play and self-improvement. AlphaZero won from Stockfish in the same year, after which Stockfish was upgraded by modifying its manually-tuned position evaluator to incorporate neural network-based evaluations. The current form of Stockfish is seen as exceptionally strong and capable of an almost perfect chess game. In 2019, Ethereal author Andrew Grant started the distributed computing testing framework OpenBench, based upon Stockfish's testing framework, and it is now the most widely used testing framework for chess engines.

Limiting an engine's strength

By the late 1990s, the top engines had become so strong that few players stood a chance of winning a game against them. To give players more of a chance, engines began to include settings to adjust or limit their strength. In 2000, when Stefan Meyer-Kahlen and Franz Huber released the Universal Chess Interface protocol they included the parameters uci_limitstrength and uci_elo allowing engine authors to offer a variety of levels rated in accordance with Elo rating, as calibrated by one of the rating lists. Most GUIs for UCI engines allow users to set this Elo rating within the menus. Even engines that have not adopted this parameter will sometimes have an adjustable strength parameter. Engines which have a uci_elo parameter include Houdini, Fritz 15–16, Rybka, Shredder, Hiarcs, Junior, Zappa, and Sjeng. GUIs such as Shredder, Chess Assistant, Convekta Aquarium, Hiarcs Chess Explorer, and Martin Blume's Arena have dropdown menus for setting the engine's uci_elo parameter. The Fritz family GUIs, Chess Assistant, and Aquarium also have independent means of limiting an engine's strength apparently based on an engine's ability to generate ranked lists of moves.

Comparisons

Tournaments

The results of computer tournaments give one view of the relative strengths of chess engines. However, tournaments do not play a statistically significant number of games for accurate strength determination. In fact, the number of games that need to be played between fairly evenly matched engines, in order to achieve significance, runs into the thousands and is, therefore, impractical within the framework of a tournament. Most tournaments also allow any types of hardware, so only engine/hardware combinations are being compared.
Historically, commercial programs have been the strongest engines. If an amateur engine wins a tournament or otherwise performs well, then it is quickly commercialized. Titles gained in these tournaments garner much prestige for the winning programs, and are thus used for marketing purposes. However, after the rise of volunteer distributed computing projects such as Leela Chess Zero and Stockfish and testing frameworks such as FishTest and OpenBench in the late 2010s, free and open source programs have largely displaced commercial programs as the strongest engines in tournaments.