Loading AI tools
Free and open-source chess engine From Wikipedia, the free encyclopedia
Stockfish is a free and open-source chess engine, available for various desktop and mobile platforms. It can be used in chess software through the Universal Chess Interface.
Developer(s) | The Stockfish developers[1] |
---|---|
Initial release | November 2, 2008 |
Stable release | 17
/ September 6, 2024 |
Repository | |
Written in | C++ |
Operating system | Microsoft Windows macOS Linux iOS Android |
Type | Chess engine |
License | GPL-3.0-or-later[2] |
Website | stockfishchess |
Stockfish has been one of the best chess engines in the world for several years;[3][4][5] it has won all main events of the Top Chess Engine Championship (TCEC) and the Chess.com Computer Chess Championship (CCC) since 2020 and, as of 16 November 2024[update], is the strongest CPU chess engine in the world with an estimated Elo rating of 3642, in a time control of 40/15 (15 minutes to make 40 moves), according to CCRL.[6]
The Stockfish engine was developed by Tord Romstad, Marco Costalba, and Joona Kiiski, and was derived from Glaurung, an open-source engine by Tord Romstad released in 2004. It is now being developed and maintained by the Stockfish community.[7]
Stockfish historically used only a classical hand-crafted function to evaluate board positions, but with the introduction of the efficiently updatable neural network (NNUE) in August 2020, it adopted a hybrid evaluation system that primarily used the neural network and occasionally relied on the hand-crafted evaluation.[8][9][10] In July 2023, Stockfish removed the hand-crafted evaluation and transitioned to a fully neural network-based approach.[11][12]
Stockfish can use up to 1024 CPU threads in multiprocessor systems. The maximal size of its transposition table is 32 TB. Stockfish implements an advanced alpha–beta search and uses bitboards. Compared to other engines, it is characterized by its great search depth, due in part to more aggressive pruning and late move reductions.[13] As of September 2024[update], Stockfish 17 (4-threaded) achieved an Elo rating of 3642
+16
−16 on the CCRL 40/15 benchmark.[14]
Stockfish supports Chess960, which is one feature that was inherited from Glaurung.[15] The Syzygy tablebase support, previously available in a fork maintained by Ronald de Man, was integrated into Stockfish in 2014.[16] In 2018 support for the 7-man Syzygy was added, shortly after becoming available.[17]
Stockfish has been a very popular engine on various platforms. On desktop, it is the default chess engine bundled with the Internet Chess Club interface programs BlitzIn and Dasher. On mobile, it has been bundled with the Stockfish app, SmallFish and Droidfish. Other Stockfish-compatible graphical user interfaces (GUIs) include Fritz, Arena, Stockfish for Mac, and PyChess.[18][19] Stockfish can be compiled to WebAssembly or JavaScript, allowing it to run in the browser. Both Chess.com and Lichess provide Stockfish in this form in addition to a server-side program.[20] Release versions and development versions are available as C++ source code and as precompiled versions for Microsoft Windows, macOS, Linux 32-bit/64-bit and Android.
The Stockfish engine essentially consists of three parts: board representation, heuristic tree search, and board evaluation. Board representation is about coding a chess board state efficiently so that it can be efficiently stored and searched over. Heuristic tree search approximates minimax tree search, which would be too slow to perform. Board evaluation takes in a board representation and gives it a score for how "good" the board is (i.e. the estimated chances of winning).[21]
Starting with Stockfish 12 (2020), a neural network board evaluation function was incorporated. In Stockfish 16.1 (2024), the classical board evaluation functions were removed, leaving just the neural network.[12]
The program originated from Glaurung, an open-source chess engine created by Romstad and first released in 2004. Four years later, Costalba, inspired by the strong open-source engine, decided to fork the project. He named it Stockfish because it was "produced in Norway and cooked in Italy" (Romstad is Norwegian, Costalba is Italian). The first version, Stockfish 1.0, was released in November 2008.[22][23] For a while, new ideas and code changes were transferred between the two programs in both directions, until Romstad decided to discontinue Glaurung in favor of Stockfish, which was the more advanced engine at the time.[24] The last Glaurung version (2.2) was released in December 2008.
Around 2011, Romstad decided to abandon his involvement with Stockfish in order to spend more time on his new iOS chess app.[25] On 18 June 2014 Marco Costalba announced that he had "decided to step down as Stockfish maintainer" and asked that the community create a fork of the current version and continue its development.[26] An official repository, managed by a volunteer group of core Stockfish developers, was created soon after and currently manages the development of the project.[27]
Since 2013, Stockfish has been developed using a distributed testing framework named Fishtest, where volunteers can donate CPU time for testing improvements to the program.[28][29][30]
Changes to game-playing code are accepted or rejected based on results of playing of tens of thousands of games on the framework against an older "reference" version of the program, using sequential probability ratio testing. Tests on the framework are verified using the chi-squared test, and only if the results are statistically significant are they deemed reliable and used to revise the software code.
After the inception of Fishtest, Stockfish experienced an explosive growth of 120 Elo points in just 12 months, propelling it to the top of all major rating lists.[31] In Stockfish 7, Fishtest author Gary Linscott was added to the official list of authors in acknowledgement of his contribution to Stockfish's strength.
As of November 2024[update], the framework has used a total of more than 15,600 years of CPU time to play over 8.4 billion chess games.[32]
In June 2020, an efficiently updatable neural network (NNUE) fork introduced by computer shogi programmers called Stockfish NNUE was discussed by developers.[33][34] In July 2020 chess news reported that Stockfish NNUE had "broken new ground in computer chess by incorporating a neural network into the already incredibly powerful Stockfish chess engine."[35] A NNUE merge into Stockfish was then announced and development builds became available.[36][37]
"The NNUE branch maintained by @nodchip has demonstrated strong results and offers great potential, and we will proceed to merge ... This merge will introduce machine learning based coding to the engine, thus enlarging the community of developers, bringing in new skills. We are eager to keep everybody on board, including all developers and users of diverse hardware, aiming to be an inclusive community ...the precise steps needed will become clearer as we proceed, I look forward to working with the community to make this happen!"
— Joost VandeVondele, 25 July 2020[36]
On 2 September 2020, the twelfth version of Stockfish was released, incorporating the aforementioned neural network improvement. According to the blog announcement, this new version "plays significantly stronger than any of its predecessors", typically winning ten times more game pairs than it loses when matched against version eleven.[38][39] In July 2023, classical evaluation was completely removed.[40]
Stockfish is a TCEC multiple-time champion and the current leader in trophy count. Ever since TCEC restarted in 2013, Stockfish has finished first or second in every season except one. In TCEC Season 4 and 5, Stockfish finished runner-up, with Superfinal scores of 23–25 first against Houdini 3 and later against Komodo 1142. Season 5 was notable for the winning Komodo team as they accepted the award posthumously for the program's creator Don Dailey, who succumbed to an illness during the final stage of the event. In his honor, the version of Stockfish that was released shortly after that season was named "Stockfish DD".[41]
On 30 May 2014, Stockfish 170514 (a development version of Stockfish 5 with tablebase support) convincingly won TCEC Season 6, scoring 35.5–28.5 against Komodo 7x in the Superfinal.[42] Stockfish 5 was released the following day.[43] In TCEC Season 7, Stockfish again made the Superfinal, but lost to Komodo with the score of 30.5–33.5.[42] In TCEC Season 8, despite losses on time caused by buggy code, Stockfish nevertheless qualified once more for the Superfinal, but lost the ensuing 100-game match 46.5–53.5 to Komodo.[42] In Season 9, Stockfish defeated Houdini 5 with a score of 54.5 versus 45.5.[42][44]
Stockfish finished third during season 10 of TCEC, the only season since 2013 in which Stockfish had failed to qualify for the superfinal. It did not lose a game but was still eliminated because it was unable to score enough wins against lower-rated engines. After this technical elimination, Stockfish went on a long winning streak, winning seasons 11 (59 vs. 41 against Houdini 6.03),[42][45] 12 (60 vs. 40 against Komodo 12.1.1),[42][46] and 13 (55 vs. 45 against Komodo 2155.00)[42][47] convincingly.[48] In Season 14, Stockfish faced a new challenger in Leela Chess Zero, but managed to eke out a win by one game (50.5–49.5).[42][49] Its winning streak was finally ended in season 15, when Leela qualified again and won 53.5–46.5,[42] but Stockfish promptly won season 16, defeating AllieStein 54.5–45.5, after Leela failed to qualify for the superfinal.[42] In season 17, Stockfish faced Leela again in the superfinal, losing 52.5–47.5. However, Stockfish has won every superfinal since: beating Leela 53.5–46.5 in season 18, 54.5–45.5 in season 19, 53–47 in season 20, and 56–44 in season 21.[42] In Season 22, Komodo Dragon beat out Leela to qualify for the superfinal, but was crushed by Stockfish 59.5-40.5. Stockfish did not lose an opening pair in this match.[50] Leela made the superfinal in Seasons 23 and 24, but was crushed by Stockfish both times (58.5-41.5 and 58-42).[51][52] In Season 25, Stockfish once again defeated Leela, but this time by a narrower margin of 52-48.[53]
Stockfish also took part in the TCEC cup, winning the first edition, but was surprisingly upset by Houdini in the semifinals of the second edition.[42][54] Stockfish recovered to beat Komodo in the third-place playoff.[42] In the third edition, Stockfish made it to the finals, but was defeated by Leela Chess Zero after blundering in a 7-man endgame tablebase draw. It turned this result around in the fourth edition, defeating Leela in the final 4.5–3.5.[42] In TCEC Cup 6, Stockfish finished third after losing to AllieStein in the semifinals, the first time it had failed to make the finals. Since then, Stockfish has consistently won the tournament, with the exception of the 11th edition which Leela won 8.5-7.5.
Event | Year | Time Controls | Result | Ref |
---|---|---|---|---|
Season 1 | 2010 | 100+10 | 3rd | [55] |
Season 2 | 2011 | 150+30 | 5th | [56] |
Season 4 | 2013 | 150+60 | 2nd | [57] |
Season 5 | 2013 | 120+30 | 2nd | [58] |
Season 6 | 2014 | 120+30 | 1st | [59] |
Season 7 | 2014 | 120+30 | 2nd | [60] |
Season 8 | 2015 | 180+30 | 2nd | [61] |
Season 9 | 2016 | 180+15 | 1st | [62] |
Season 10 | 2017 | 90+10 | 2nd[note 1] | [63] |
Season 11 | 2018 | 120+15 | 1st | [64] |
Season 12 | 2018 | 120+15 | 1st | [65] |
Season 13 | 2018 | 120+15 | 1st | [66] |
Season 14 | 2018 | 120+15 | 1st | [67] |
Season 15 | 2019 | 120+10 | 2nd | [68] |
Season 16 | 2019 | 120+10 | 1st | [69] |
Season 17 | 2020 | 90+5 | 2nd | [70] |
Season 18 | 2020 | 90+10 | 1st | [71] |
Season 19 | 2020 | 120+10 | 1st | [72] |
Season 20 | 2020 | 120+10 | 1st | [73] |
Season 21 | 2021 | 120+10 | 1st | [74] |
Season 22 | 2022 | 120+12 | 1st | [75] |
Season 23 | 2022 | 120+12 | 1st | [76] |
Season 24 | 2023 | 120+12 | 1st | [77] |
Season 25 | 2023 | 120+12 | 1st | [78] |
Season 26 | 2024 | 120+12 | 1st | [79] |
Event | Year | Time Controls | Result | Ref |
---|---|---|---|---|
Cup 1 | 2018 | 30+10 | 1st | [80] |
Cup 2 | 2019 | 30+5 | 2nd[note 1] | [81] |
Cup 3 | 2019 | 30+5 | 2nd | [82] |
Cup 4 | 2019 | 30+5 | 1st | [83] |
Cup 5 | 2020 | 30+5 | 1st | [84] |
Cup 6 | 2020 | 30+5 | 3rd | [85] |
Cup 7 | 2020 | 30+5 | 1st | [86] |
Cup 8 | 2021 | 30+5 | 1st | [87] |
Cup 9 | 2021 | 30+5 | 1st | [88] |
Cup 10 | 2022 | 30+3 | 1st | [89] |
Cup 11 | 2023 | 30+3 | 2nd | [90] |
Cup 12 | 2023 | 30+3 | 1st | [91] |
Cup 13 | 2024 | 30+3 | 1st | [92] |
Event | Year | Time Controls | Result | Ref |
---|---|---|---|---|
FRD 1 | 2023 | 30+3 | 1st | [106] |
Ever since Chess.com hosted its first Chess.com Computer Chess Championship in 2018, Stockfish has been the most successful engine. It dominated the earlier championships, winning six consecutive titles before finishing second in CCC7. Since then, its dominance has come under threat from the neural-network engines Leelenstein and Leela Chess Zero, but it has continued to perform well, reaching at least the superfinal in every edition up to CCC11. CCC12 had for the first time a knockout format, with seeding placing CCC11 finalists Stockfish and Leela in the same half. Leela eliminated Stockfish in the semi-finals. However, a post-tournament match against the loser of the final, Leelenstein, saw Stockfish winning in the same format as the main event. After finishing second again to Leela in CCC13, and an uncharacteristic fourth in CCC14, Stockfish went on a long winning streak, taking first place in every championship since.
Event | Year | Time Controls | Result | Ref |
---|---|---|---|---|
CCC | 2017 | 15+2 | 1st | [107] |
CCC 1: Rapid Rumble | 2018 | 15+5 | 1st | [108] |
CCC 2: Blitz Battle | 2018 | 5+2 | 1st | [109] |
CCC 3: Rapid Redux | 2019 | 30+5 | 1st | [110] |
CCC 4: Bullet Brawl | 2019 | 1+2 | 1st | [111] |
CCC 5: Escalation | 2019 | 10+5 | 1st | [112] |
CCC 6: Winter Classic | 2019 | 10+10 | 1st | [113] |
CCC 7: Blitz Bonanza | 2019 | 5+2 | 2nd | [114] |
CCC 8: Deep Dive | 2019 | 15+5 | 1st | [115] |
CCC 9: The Gauntlet | 2019 | 5+2, 10+5 | 1st | [116] |
CCC 10: Double Digits | 2019 | 10+3 | 2nd | [117] |
CCC 11 | 2019 | 30+5 | 2nd | [118] |
CCC 12: Bullet Madness! | 2020 | 1+1 | 3rd | [119] |
CCC 13: Heptagonal | 2020 | 5+5 | 2nd | [120] |
CCC 14 | 2020 | 15+5, 5+2, 1+1 | 4th | [121] |
CCC Blitz 2020 | 2020 | 5+5 | 1st | [122] |
CCC Rapid 2021 | 2021 | 15+3 | 1st | [123] |
CCC Blitz 2021 | 2021 | 5+5 | 1st | [124] |
CCC Chess 960 Blitz | 2021 | 5+5 | 1st | [125] |
CCC 16: Rapid | 2021 | 15+3 | 1st | [126] |
CCC 16: Bullet | 2021 | 2+1 | 1st | [127] |
CCC 16: Blitz | 2022 | 5+5 | 1st | [128] |
CCC 17: Rapid | 2022 | 15+3 | 1st | [129] |
CCC 17: Bullet | 2022 | 2+1 | 1st | [130] |
CCC 17: Blitz | 2022 | 5+5 | 1st | [131] |
CCC 18: Rapid | 2022 | 15+3 | 1st | [132] |
CCC 19: Blitz | 2022 | 5+5 | 1st | [133] |
CCC 19: Rapid | 2022 | 15+3 | 1st | [134] |
CCC 19: Bullet | 2023 | 1+1 | 1st | [135] |
CCC 20: Blitz | 2023 | 3+2 | 1st | [136] |
CCC 20: Rapid | 2023 | 10+3 | 1st | [137] |
CCC 20: Bullet | 2023 | 1+1 | 1st | [138] |
CCC 21: Blitz | 2023 | 3+2 | 1st | [139] |
CCC 21: Rapid | 2023 | 10+3 | 1st | [140] |
CCC 21: Bullet | 2023 | 1+1 | 1st | [141] |
CCC 22: Blitz | 2024 | 3+2 | 1st | [142] |
CCC 22: Rapid | 2024 | 10+3 | 1st | [143] |
CCC 22: Bullet | 2024 | 1+1 | 1st | [144] |
CCC 23: Blitz | 2024 | 3+2 | 1st | [145] |
CCC 23: Rapid | 2024 | 10+3 | 1st | [146] |
Event | Year | Time Controls | Result | Ref |
---|---|---|---|---|
CPU Blitz Madness | 2020 | 3+2 | 1st | [147] |
Trillion-Node Throwdown III | 2020 | 150+5 | 1st | [148] |
No-Castle II | 2020 | 5+2 | 1st | [149] |
Bullet Chess is Fun | 2020 | 2+1 | 1st | [150] |
Checkmate in 4 | 2020 | 3+2 | 1st | [151] |
Odds Ladder | 2020 | 3+2 | 1st | [152] |
Merry Queen Sac | 2020 | 2+1 | 1st | [153] |
Budapest Bullet | 2020 | 2+1 | 2nd | [154] |
King Gambit Madness | 2021 | 5+5 | 1st | [155] |
Drawkiller Update Party | 2021 | 2+1 | 1st | [156] |
To Castle Or Not To Castle II | 2021 | 3+2 | 1st | [157] |
Eco Mega-Match 2 (part 1) | 2021 | 1+1 | 1st | [158] |
Eco Mega-Match 2 (part 2) | 2021 | 1+1 | 1st | [159] |
Caro-Kann Special | 2021 | 5+2 | 1st | [160] |
King's Indian Defense Special | 2021 | 10+2 | 2nd | [161] |
Dutch Defense Special | 2021 | 10+2 | 1st | [162] |
Evans Gambit Madness | 2021 | 10+2 | 2nd | [163] |
Sicilian Najdorf Special | 2021 | 10+2 | 1st | [164] |
Belgian Stew | 2021 | 2+1 | 1st | [165] |
Saragossa | 2021 | 2+1 | 2nd | [166] |
Double Bongcloud, Rapid | 2021 | 10+2 | 2nd | [167] |
The Hillbilly Attack | 2021 | 10+2 | 3rd | [168] |
Romantic Openings: Danish Gambit Accepted | 2021 | 3+2 | 1st | [169] |
Romantic Openings: Evans Gambit Accepted | 2021 | 3+2 | 1st | [170] |
Romantic Openings: Urusov Gambit Accepted | 2021 | 5+2 | 1st | [171] |
Romantic Openings: Blackmar-Diemer Gambit | 2021 | 5+2 | 1st | [172] |
Romantic Openings: Stafford Gambit | 2021 | 1+2 | 2nd | [173] |
Romantic Openings: Calabrese Countergambit | 2021 | 5+2 | 1st | [174] |
Romantic Openings: Traxler Counterattack | 2021 | 5+2 | 2nd | [175] |
No Black Castling | 2022 | 5+5 | 1st | [176] |
Draw Killer Bonus | 2022 | 15+5 | 1st | [177] |
Romantic Openings: Wing Gambit | 2022 | 5+2 | 1st | [178] |
Chess 324 Bonus | 2022 | 5+2 | 1st | [179] |
Classical Cup #1 | 2023 | 30+5 | 1st | [180] |
Rating Brawl: Fall 2023 | 2023 | 1+1 | 1st | [181] |
Classical Cup #2 | 2024 | 30+5 | 1st | [182] |
Classical Cup #3 | 2024 | 30+5 | 1st | [183] |
Stockfish's strength relative to the best human chess players was most apparent in a handicap match with grandmaster Hikaru Nakamura (2798-rated) in August 2014. In the first two games of the match, Nakamura had the assistance of an older version of Rybka, and in the next two games, he received White with pawn odds but no assistance. Nakamura was the world's fifth-best human chess player at the time of the match, while Stockfish 5 was denied use of its opening book and endgame tablebase. Stockfish won each half of the match 1.5–0.5. Both of Stockfish's wins arose from positions in which Nakamura, as is typical for his playing style, pressed for a win instead of acquiescing to a draw.[184]
In December 2017, Stockfish 8 was used as a benchmark to test Google division DeepMind's AlphaZero, with each engine supported by different hardware. AlphaZero was trained through self-play for a total of nine hours, and reached Stockfish's level after just four.[185][186][187] In 100 games from the normal starting position, AlphaZero won 25 games as White, won 3 as Black, and drew the remaining 72, with 0 losses.[188] AlphaZero also played twelve 100-game matches against Stockfish starting from twelve popular openings for a final score of 290 wins, 886 draws and 24 losses, for a point score of 733:467.[189][note 2]
AlphaZero's victory over Stockfish sparked a flurry of activity in the computer chess community, leading to a new open-source engine aimed at replicating AlphaZero, known as Leela Chess Zero. By January 2019, Leela was able to defeat the version of Stockfish that played AlphaZero (Stockfish 8) in a 100-game match. An updated version of Stockfish narrowly defeated Leela Chess Zero in the superfinal of the 14th TCEC season, 50.5–49.5 (+10 =81 −9),[42] but lost the superfinal of the next season to Leela 53.5–46.5 (+14 =79 -7).[42][191] The two engines remain close in strength to each other even as they continue to improve: Leela defeated Stockfish in the superfinal of TCEC Season 17, but Stockfish has won every TCEC season since.
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.