【Stockfish】
Stockfish，是一个自由及开放源码国际象棋引擎软件，可用于各种桌面和移动平台。可通过通用国际象棋接口在国际象棋软件中使用。
Stockfish持续在大多数国际象棋引擎排名中排在首位或接近首位。截至2022年10月，Stockfish是世界上最强大的CPU象棋引擎。它共计赢得了最强象棋引擎锦标赛13次以及Chess.com计算机象棋锦标赛19次。
Stockfish由Marco Costalba、Joona Kiiski、Gary Linscott、Tord Romstad、Stéphane Nicolet、Stefan Geschwentner和Joost VandeVondele开发，此外开源社区开发者也作出了许多贡献。它从2004年发布的Tord Romstad开发的开源象棋引擎Glaurung派生而来。
== 特性 ==
在多处理器系统中，Stockfish可以使用至多1024个线程。它的已访问位置表的大小可达32TB。Stockfish通过位棋盘实现了高级的Alpha-beta剪枝。部分上由于进行了更激进的剪枝以及后期移动缩减，与其它象棋引擎相比，Stockfish可以进行更深的搜索。7，Stockfish 15 (4线程)在CCRL 40/15评测中达到了354016的等级分。
由于其从Glaurung派生而来，Stockfish支持Chess960。曾在罗纳德·德曼维护的分叉中实现的Syzygy残局数据库于2014年被并入Stockfish中。在7个棋子的Syzygy残局数据库发布之后不久，Stockfish于2018年增加了对其的支持。
Stockfish在很多平台上受欢迎。在桌面端，它是互联网国际象棋俱乐部界面程序BlitzIn和Dasher默认的象棋引擎。在移动端，它是Stockfish、SmallFish和DroidFish等APP内置的象棋引擎。其它兼容Stockfish的图形用户界面包括Fritz、Arena、Stockfish for Mac以及PyChess。Stockfish可以被编译为WebAssembly或JavaScript，从而在浏览器中运行。在服务器端程序以外，Chess.com和Lichess都以这种形式支持Stockfish。Stockfish的正式版本和开发版本均以在Windows、macOS、Linux32位/64位和Android上的编译版本和C++源代码的形式发布。
== 历史 ==
Stockfish起源于Romstad编写并于2004年首次发布的开源国际象棋引擎Glaurung。四年之后，Costalba受这一强大的开源引擎启发，决定分叉此项目。他将其命名为Stockfish的原因是它“于挪威生产而于意大利被烹饪”（Romstad是挪威人，而Costalba是意大利人）。首个版本Stockfish 1.0于2008年11月发布。有一阵子，新想法与代码变更在两个程序之间双向流动，直到Romstad考虑到Stockfish在当时更加先进而决定不再开发Glaurung。Glaurung的最终版本（2.2）于2008年12月发布。
约于2011年，Romstad决定不再参与Stockfish的开发以专注于开发他的新的iOS国际象棋应用。2014年6月18日，Marco Costalba宣布他已经“决定不再维护Stockfish”并让开源社区建立其当前版本的分叉并继续开发它。不久之后，一个由Stockfish的核心开发者组成的志愿者团队建立了一个官方代码库并管理此项目至今。
=== Fishtest ===
自2013年以来，Stockfish的开发运用了名为“Fishtest”的分布式测试框架，志愿者可以捐赠CPU时间以测试对程序的改进。
对博弈算法的修改会应用序列概率比例测试分析在Fishtest框架上与该程序的“对照”版本对弈数万局的结果而被接受或拒绝。在框架上的测试会以卡方检验验证，仅当结果在统计意义上显著时才会被认为是可靠的并用于修改软件代码。
Fishtest出现后，Stockfish的等级分在仅仅12个月内增加了120，使其在所有主流象棋引擎排名中上升到顶部。在Stockfish 7中，作为对Fishtest的作者Gary Linscott对Stockfish的棋力的贡献的承认，他的名字被加入到正式的作者名单中。
，Fishtest框架总共用9850多年的CPU时间下了57亿多局象棋。
=== 可高效更新神经网络 ===
NNUE visualized
In June 2020, an efficiently updatable neural network (NNUE) fork introduced by computer shogi programmers called Stockfish NNUE was discussed by developers. 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." A NNUE merge into Stockfish was then announced and development builds became available.
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.
== Competition results ==
=== Top Chess Engine Championship ===
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".
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. Stockfish 5 was released the following day. In TCEC Season 7, Stockfish again made the Superfinal, but lost to Komodo with the score of 30.5–33.5. 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. In Season 9, Stockfish defeated Houdini 5 with a score of 54.5 versus 45.5.
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), 12 (60 vs. 40 against Komodo 12.1.1), and 13 (55 vs. 45 against Komodo 2155.00) convincingly. 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). Its winning streak was finally ended in season 15, when Leela qualified again and won 53.5–46.5, but Stockfish promptly won season 16, defeating AllieStein 54.5–45.5, after Leela failed to qualify for the superfinal. In season 17, Stockfish faced Leela again in the superfinal, losing 52.5–47.5. However, Stockfish convincingly defeated Leela in the next four superfinals: 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.
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. Stockfish recovered to beat Komodo in the third place playoff. 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.
=== Chess.com Computer Chess Championship ===
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.
=== Stockfish 5 versus Nakamura ===
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.
=== Stockfish 8 versus AlphaZero ===
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. 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. 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.
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), but lost the superfinal of the next season to Leela 53.5–46.5 (+14 =79 -7). The two engines remain very close in strength to each other even as they continue to improve: Leela defeated Stockfish in the superfinal of TCEC Season 17, but Stockfish won TCEC Season 18, TCEC Season 19, TCEC Season 20, and TCEC Season 21, each time defeating Leela in the superfinal.
== Derivatives ==
* YaneuraOu, a strong shogi engine and the origin of NNUE. Speaks USI, a variant of UCI for shogi.
* Fairy Stockfish, a version modified to play fairy chess. Runs with regional variants (chess, shogi, makruk, etc.) as well as other variants like antichess.
* Lichess Stockfish, a version for playing variants without fairy pieces.
* Crystal, which seeks to address common issues with chess engines such as positional or tactical blindness due to over reductions or over pruning, draw blindness due to the move horizon and displayed principal variation reliability.
* Brainfish, which contains a reduced version of Cerebellum, a chess opening library.
* BrainLearn, a derivative of Brainfish but with a persisted learning algorithm.
* ShashChess, a derivative with the goal to apply Alexander Shashin theory from the book Best Play: a New Method for Discovering the Strongest Move.
* Fat Titz, a fork of CFish which name is a pun of Fat Fritz 2 with a HalfKAv2-2048x2-64-64-1 evaluation network, which contains 4 times the knowledge of Stockfish 14. It was trained partially on Lc0 data, which gives a unique positional style, while still preserving the tactical sharpness of Stockfish.
* Houdini 6, an alleged Stockfish 8 derivative without providing the sources on request, violating the GPL license.
* Fat Fritz 2, an alleged Stockfish 12 derivative without providing the sources on request, violating the GPL license.