Stockfish/ - UCI chess engine

Overview

Overview

Build Status Build Status

Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. Stockfish is not a complete chess program and requires a UCI-compatible graphical user interface (GUI) (e.g. XBoard with PolyGlot, Scid, Cute Chess, eboard, Arena, Sigma Chess, Shredder, Chess Partner or Fritz) in order to be used comfortably. Read the documentation for your GUI of choice for information about how to use Stockfish with it.

The Stockfish engine features two evaluation functions for chess, the classical evaluation based on handcrafted terms, and the NNUE evaluation based on efficiently updatable neural networks. The classical evaluation runs efficiently on almost all CPU architectures, while the NNUE evaluation benefits from the vector intrinsics available on most CPUs (sse2, avx2, neon, or similar).

Files

This distribution of Stockfish consists of the following files:

  • Readme.md, the file you are currently reading.

  • Copying.txt, a text file containing the GNU General Public License version 3.

  • AUTHORS, a text file with the list of authors for the project

  • src, a subdirectory containing the full source code, including a Makefile that can be used to compile Stockfish on Unix-like systems.

  • a file with the .nnue extension, storing the neural network for the NNUE evaluation. Binary distributions will have this file embedded.

The UCI protocol and available options

The Universal Chess Interface (UCI) is a standard protocol used to communicate with a chess engine, and is the recommended way to do so for typical graphical user interfaces (GUI) or chess tools. Stockfish implements the majority of it options as described in the UCI protocol.

Developers can see the default values for UCI options available in Stockfish by typing ./stockfish uci in a terminal, but the majority of users will typically see them and change them via a chess GUI. This is a list of available UCI options in Stockfish:

  • Threads

    The number of CPU threads used for searching a position. For best performance, set this equal to the number of CPU cores available.

  • Hash

    The size of the hash table in MB. It is recommended to set Hash after setting Threads.

  • Clear Hash

    Clear the hash table.

  • Ponder

    Let Stockfish ponder its next move while the opponent is thinking.

  • MultiPV

    Output the N best lines (principal variations, PVs) when searching. Leave at 1 for best performance.

  • Use NNUE

    Toggle between the NNUE and classical evaluation functions. If set to "true", the network parameters must be available to load from file (see also EvalFile), if they are not embedded in the binary.

  • EvalFile

    The name of the file of the NNUE evaluation parameters. Depending on the GUI the filename might have to include the full path to the folder/directory that contains the file. Other locations, such as the directory that contains the binary and the working directory, are also searched.

  • UCI_AnalyseMode

    An option handled by your GUI.

  • UCI_Chess960

    An option handled by your GUI. If true, Stockfish will play Chess960.

  • UCI_ShowWDL

    If enabled, show approximate WDL statistics as part of the engine output. These WDL numbers model expected game outcomes for a given evaluation and game ply for engine self-play at fishtest LTC conditions (60+0.6s per game).

  • UCI_LimitStrength

    Enable weaker play aiming for an Elo rating as set by UCI_Elo. This option overrides Skill Level.

  • UCI_Elo

    If enabled by UCI_LimitStrength, aim for an engine strength of the given Elo. This Elo rating has been calibrated at a time control of 60s+0.6s and anchored to CCRL 40/4.

  • Skill Level

    Lower the Skill Level in order to make Stockfish play weaker (see also UCI_LimitStrength). Internally, MultiPV is enabled, and with a certain probability depending on the Skill Level a weaker move will be played.

  • SyzygyPath

    Path to the folders/directories storing the Syzygy tablebase files. Multiple directories are to be separated by ";" on Windows and by ":" on Unix-based operating systems. Do not use spaces around the ";" or ":".

    Example: C:\tablebases\wdl345;C:\tablebases\wdl6;D:\tablebases\dtz345;D:\tablebases\dtz6

    It is recommended to store .rtbw files on an SSD. There is no loss in storing the .rtbz files on a regular HD. It is recommended to verify all md5 checksums of the downloaded tablebase files (md5sum -c checksum.md5) as corruption will lead to engine crashes.

  • SyzygyProbeDepth

    Minimum remaining search depth for which a position is probed. Set this option to a higher value to probe less aggressively if you experience too much slowdown (in terms of nps) due to tablebase probing.

  • Syzygy50MoveRule

    Disable to let fifty-move rule draws detected by Syzygy tablebase probes count as wins or losses. This is useful for ICCF correspondence games.

  • SyzygyProbeLimit

    Limit Syzygy tablebase probing to positions with at most this many pieces left (including kings and pawns).

  • Move Overhead

    Assume a time delay of x ms due to network and GUI overheads. This is useful to avoid losses on time in those cases.

  • Slow Mover

    Lower values will make Stockfish take less time in games, higher values will make it think longer.

  • nodestime

    Tells the engine to use nodes searched instead of wall time to account for elapsed time. Useful for engine testing.

  • Debug Log File

    Write all communication to and from the engine into a text file.

For developers the following non-standard commands might be of interest, mainly useful for debugging:

  • bench ttSize threads limit fenFile limitType evalType

    Performs a standard benchmark using various options. The signature of a version (standard node count) is obtained using all defaults. bench is currently bench 16 1 13 default depth mixed.

  • compiler

    Give information about the compiler and environment used for building a binary.

  • d

    Display the current position, with ascii art and fen.

  • eval

    Return the evaluation of the current position.

  • export_net [filename]

    Exports the currently loaded network to a file. If the currently loaded network is the embedded network and the filename is not specified then the network is saved to the file matching the name of the embedded network, as defined in evaluate.h. If the currently loaded network is not the embedded network (some net set through the UCI setoption) then the filename parameter is required and the network is saved into that file.

  • flip

    Flips the side to move.

A note on classical evaluation versus NNUE evaluation

Both approaches assign a value to a position that is used in alpha-beta (PVS) search to find the best move. The classical evaluation computes this value as a function of various chess concepts, handcrafted by experts, tested and tuned using fishtest. The NNUE evaluation computes this value with a neural network based on basic inputs (e.g. piece positions only). The network is optimized and trained on the evaluations of millions of positions at moderate search depth.

The NNUE evaluation was first introduced in shogi, and ported to Stockfish afterward. It can be evaluated efficiently on CPUs, and exploits the fact that only parts of the neural network need to be updated after a typical chess move. The nodchip repository provided the first version of the needed tools to train and develop the NNUE networks. Today, more advanced training tools are available in the nnue-pytorch repository, while data generation tools are available in a dedicated branch.

On CPUs supporting modern vector instructions (avx2 and similar), the NNUE evaluation results in much stronger playing strength, even if the nodes per second computed by the engine is somewhat lower (roughly 80% of nps is typical).

Notes:

  1. the NNUE evaluation depends on the Stockfish binary and the network parameter file (see the EvalFile UCI option). Not every parameter file is compatible with a given Stockfish binary, but the default value of the EvalFile UCI option is the name of a network that is guaranteed to be compatible with that binary.

  2. to use the NNUE evaluation, the additional data file with neural network parameters needs to be available. Normally, this file is already embedded in the binary or it can be downloaded. The filename for the default (recommended) net can be found as the default value of the EvalFile UCI option, with the format nn-[SHA256 first 12 digits].nnue (for instance, nn-c157e0a5755b.nnue). This file can be downloaded from

https://tests.stockfishchess.org/api/nn/[filename]

replacing [filename] as needed.

What to expect from the Syzygy tablebases?

If the engine is searching a position that is not in the tablebases (e.g. a position with 8 pieces), it will access the tablebases during the search. If the engine reports a very large score (typically 153.xx), this means it has found a winning line into a tablebase position.

If the engine is given a position to search that is in the tablebases, it will use the tablebases at the beginning of the search to preselect all good moves, i.e. all moves that preserve the win or preserve the draw while taking into account the 50-move rule. It will then perform a search only on those moves. The engine will not move immediately, unless there is only a single good move. The engine likely will not report a mate score, even if the position is known to be won.

It is therefore clear that this behaviour is not identical to what one might be used to with Nalimov tablebases. There are technical reasons for this difference, the main technical reason being that Nalimov tablebases use the DTM metric (distance-to-mate), while the Syzygy tablebases use a variation of the DTZ metric (distance-to-zero, zero meaning any move that resets the 50-move counter). This special metric is one of the reasons that the Syzygy tablebases are more compact than Nalimov tablebases, while still storing all information needed for optimal play and in addition being able to take into account the 50-move rule.

Large Pages

Stockfish supports large pages on Linux and Windows. Large pages make the hash access more efficient, improving the engine speed, especially on large hash sizes. Typical increases are 5..10% in terms of nodes per second, but speed increases up to 30% have been measured. The support is automatic. Stockfish attempts to use large pages when available and will fall back to regular memory allocation when this is not the case.

Support on Linux

Large page support on Linux is obtained by the Linux kernel transparent huge pages functionality. Typically, transparent huge pages are already enabled, and no configuration is needed.

Support on Windows

The use of large pages requires "Lock Pages in Memory" privilege. See Enable the Lock Pages in Memory Option (Windows) on how to enable this privilege, then run RAMMap to double-check that large pages are used. We suggest that you reboot your computer after you have enabled large pages, because long Windows sessions suffer from memory fragmentation, which may prevent Stockfish from getting large pages: a fresh session is better in this regard.

Compiling Stockfish yourself from the sources

Stockfish has support for 32 or 64-bit CPUs, certain hardware instructions, big-endian machines such as Power PC, and other platforms.

On Unix-like systems, it should be easy to compile Stockfish directly from the source code with the included Makefile in the folder src. In general it is recommended to run make help to see a list of make targets with corresponding descriptions.

    cd src
    make help
    make net
    make build ARCH=x86-64-modern

When not using the Makefile to compile (for instance, with Microsoft MSVC) you need to manually set/unset some switches in the compiler command line; see file types.h for a quick reference.

When reporting an issue or a bug, please tell us which Stockfish version and which compiler you used to create your executable. This information can be found by typing the following command in a console:

    ./stockfish compiler

Understanding the code base and participating in the project

Stockfish's improvement over the last decade has been a great community effort. There are a few ways to help contribute to its growth.

Donating hardware

Improving Stockfish requires a massive amount of testing. You can donate your hardware resources by installing the Fishtest Worker and view the current tests on Fishtest.

Improving the code

If you want to help improve the code, there are several valuable resources:

  • In this wiki, many techniques used in Stockfish are explained with a lot of background information.

  • The section on Stockfish describes many features and techniques used by Stockfish. However, it is generic rather than being focused on Stockfish's precise implementation. Nevertheless, a helpful resource.

  • The latest source can always be found on GitHub. Discussions about Stockfish take place these days mainly in the FishCooking group and on the Stockfish Discord channel. The engine testing is done on Fishtest. If you want to help improve Stockfish, please read this guideline first, where the basics of Stockfish development are explained.

Terms of use

Stockfish is free, and distributed under the GNU General Public License version 3 (GPL v3). Essentially, this means you are free to do almost exactly what you want with the program, including distributing it among your friends, making it available for download from your website, selling it (either by itself or as part of some bigger software package), or using it as the starting point for a software project of your own.

The only real limitation is that whenever you distribute Stockfish in some way, you MUST always include the full source code, or a pointer to where the source code can be found, to generate the exact binary you are distributing. If you make any changes to the source code, these changes must also be made available under the GPL.

For full details, read the copy of the GPL v3 found in the file named Copying.txt.

Comments
  • Stockfish hang in TCEC S16 Division P Game 51

    Stockfish hang in TCEC S16 Division P Game 51

    In the TCEC Archive here

    Reproduces with a few seconds to move for me:

    Engine master(1) failed to respond to ping
    Terminating process of engine master(1)
    Warning: Unexpected result claim from master: 1/2-1/2 {Draw by stalled connection}
    Engine master(0) failed to respond to ping
    Terminating process of engine master(0)
    
    
    opened by xoto10 234
  • Contempt 7

    Contempt 7

    STC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 50665 W: 9813 L: 9745 D: 31107

    LTC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 13045 W: 1834 L: 1703 D: 9508

    Contempt 4 tests were also good: http://tests.stockfishchess.org/tests/view/5a512eea0ebc590ccbb8c723 http://tests.stockfishchess.org/tests/view/5a5205000ebc590ccbb8c762

    Contempt 10 tests were also good: http://tests.stockfishchess.org/tests/view/5a5227410ebc590ccbb8c76f http://tests.stockfishchess.org/tests/view/5a550fac0ebc590296938a24

    For safety reasons, it seems the best to use the medium value (7), where tests anyway showed the greatest gain.

    There is no an obvious Elo gain here, but it should be helpful against weaker engines.

    Bench 5494441

    opened by IIvec 185
  • SF NNUE

    SF NNUE

    There has been much discussion on SF NNUE, which apparently is already on par with SF10 (so about 70-80 elo behind current sf dev). People have been saying it can become 100elo stronger than SF, which would basically come from the eval. Since the net is apparently not very big, maybe someone can study the activations of each layer and see if we can extract some eval info from it? In any case, it's probably worth looking into this since it shows so much promise.

    NNUE 
    opened by adentong 183
  • New discussion regarding testing bounds, testing book, etc.

    New discussion regarding testing bounds, testing book, etc.

    There has been some discussion in https://github.com/official-stockfish/Stockfish/pull/2260 about the test bounds, how to optimize for resource usage and how to verify scaling and whatnot. So I opened a new issue for people to discuss. Also relevant is potentially switching to pentanomial statistics, which increases throughput by 10 to 15%, or so I've read in one of the discussions here.

    opened by adentong 178
  • NNUE merge

    NNUE merge

    The NNUE branch maintained by @nodchip has demonstrated strong results and offers great potential, and we will proceed to merge it into master. This will assure that Stockfish remains a reference engine based on the top computer chess technology for the foreseeable future. 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. We will keep and evolve the handcrafted evaluation, not only for the beauty and insight it offers, but for additional reasons, including its value on diverse hardware platforms, and for the potential of hybridization with NNUE, and use in search. The initial goal for the merge is the NNUE playing capability only, this focus makes sense given the complexity of the project, and the aim of Stockfish as a production quality chess engine. We will try to make changes such that the @nodchip repo and ours can be kept in sync as easily as possible. Written by knowledgeable people, NNUE is already of good quality, we will make small modifications needed to make it pass our standard CI, and integrate nicely in the existing engine. Rigorous testing will continue to be a cornerstone of our development, and accordingly integration in fishtest needs to be properly implemented. Afterwards, we will guarantee continuous progression in playing strength testing core engine and networks with our usual SPRT process. Some initial steps of the merge will be outlined below, the precise steps needed will become clearer as we proceed, I look forward to working with the community to make this happen!

    NNUE 
    opened by vondele 157
  • SPRT parameters improvement

    SPRT parameters improvement

    After a very long and interesting discussion https://github.com/official-stockfish/Stockfish/pull/1804#issuecomment-445429885 I think it's time to summarize in quantitative way what people have found and proceed in a practical / executive fashion.

    The topic is the improvement of SPRT parameters aimed at:

    • Improve precision, i.e. discard zero or negative patches and accept positive ones with higher margin

    • Manage resource consumption.

    It is immediately clear that the 2 goals go in opposite directions, anyhow from the discussion it seems there is some consensus to allow a reasonable increase of test resources in exchange for stricter parameters.

    To allow the discussion to be quantitative and on the point, I'd like people post here only simulation results in a simple and standardized format:

    | Limits | SPRT[0, 5] STC + SPRT[0, 5] LTC | | --- | --- | | 0 ELO pass prob | xxx | | 1 ELO pass prob | xxx | | <= 0 ELO pass prob | xxx | | >= 1 ELO fail prob | xxx | | Avg. STC cost | xxx | | Avg. STC + LTC Cost | xxx |

    The first 2 records give a taste of the sensibility of the scheme, the 3 and 4 give a taste of the failure rate of the scheme and the last 2 of the cost of the scheme.

    Now, on the cost. Patch's ELO is not uniformly distributed, namely the biggest part of tested patches are within [-2, 0] ELO (neutral or slightly negative). We have to consider this to compute a standardized cost.

    I propose the following. Given:

    ag(x) = Average number of games for pacthes with x ELO

    We define the cost as:

    STC Cost = 10 * ag(-2) + 35 * ag(-1) + 40 * ag(0) + 25 * ag(1) + 5 * ag(2)

    For the STC + LTC cost we have to consider that:

    LTC Cost = STC Cost * 6

    Given that all the above is not trivial to implement, I would split this project in 2 phases;

    1. First find a standard tool to reliably compute all the above. Publish it and let people refer to the same measuring tool.

    2. Once we have an open, shared and validated tool then compute the different schemes.

    The standard tool should be sound. I would prefer a tool based on simulations more than on formulas, it sounds to me simpler and easier to review for a wider audience of people, and also more flexible. Everybody is encouraged to submit their script / simulator. Once the process has stabilized on a shared and validated single tool, then we will proceed to the second phase.

    It won't be quick, but this is an engineering approach to the problem: solid, slow and boring :-)

    opened by mcostalba 132
  • Tune search constants

    Tune search constants

    This is the result of a 200k tuning run at LTC: http://tests.stockfishchess.org/tests/view/5d3576b70ebc5925cf0e9e1e

    which passed quickly at LTC: LLR: 2.95 (-2.94,2.94) [0.50,4.50] Total: 12954 W: 2280 L: 2074 D: 8600 http://tests.stockfishchess.org/tests/view/5d3ff3f70ebc5925cf0f87a2

    STC failed, but second LTC at [0,4] passed easily: LLR: 2.96 (-2.94,2.94) [0.00,4.00] Total: 8004 W: 1432 L: 1252 D: 5320

    Further work: No doubt some of these changes produce most of the gain and some are neutral or even bad, so further testing on individual/groups of parameters changed here might show more gains. It does look like these tests might need to be at LTC though, so maybe not too practical to do. This is a further indication that LTC is different from STC, we should debate whether we can increase STC slightly to make test results closer to LTC, say to 20+0.2 instead of 10+0.1.

    opened by xoto10 118
  • Fix race where it may cause a hang

    Fix race where it may cause a hang

    In case of the notifier thread doesn't find a waiter, and a subsequent wait consumes the notify in the same thread, it will give one back, if the predicate success, no more notify should fire, if it fails, this will essentially turn the offending thread into a spin loop waiting on the other threads to enter wait.

    This patch also disallow default copy operators for Mutex(as per C++11 implementations), although that doesn't really affect us. Using compiler default mutexes had issues described in the original comment, as tested recently they still cause minor slowdowns on MINGW compiles.

    No functional change

    opened by noobpwnftw 106
  • Analysis Contempt combo box

    Analysis Contempt combo box

    This patch introduces an Analysis Contempt UCI combo box to control the behaviour of contempt during analysis. The possible values are Off, White, Black.

    The engine is in analysis mode if UCI_AnalyseMode is set by the GUI or if the user has chosen infinite analysis mode ("go infinite"). (I'm not sure how many GUIs automatically set UCI_AnalyseMode in infinite analysis mode.)

    The idea for the combo box is entirely @vdbergh 's.

    No functional change outside analysis mode.

    opened by syzygy1 104
  • [NNUE] Android building issue

    [NNUE] Android building issue

    Hello SF team! I have an issue with Android compilations. I'm using NDK's Clang 9.0.8 (last available), on Windows 64 bit. During the compilation i'm getting this error.. error After I changed the line 331 (in misc.cpp) to "std_aligned_alloc", i managed to make android engine. Regarding the NETs - where should i put the NN.bin file (eg separate folder, "eval/nn.bin)? And what is the correct name of the net, is it nn.bin or nn.nnue? Thank you!!

    Android NNUE 
    opened by AlexB123 98
  • Natural TB

    Natural TB

    Rewrite TB probing code to ovecome the main traditional TB artifacts:

    1. Don't hide forever mate line in a winning position

    2. Don't stick to odd sacrifices to simplify in a TB position

    This version mostly fixes the above 2 issues. In particular it keeps searching even in a winning position so that sooner or later a mate is found and reported to user. Moreover, although in rare cases odd sacrifice moves could still be selected for a temporary and transitory time, keeping searching the engine always moves off form them.

    In both cases these phenomenons are greatly reduced compared to current version.

    DTZ tables are used only when strictly needed: to differentiate, when the root position is in TB, between a cursed win/blessed loss and an actual win/loss. This applies only if rule50 is used and also in this case the returned value is used to set as a draw a cursed/blessed result, it is NOT used to alter search result.

    The approach of this work is that a search result is never altered: TB is used to detect a draw (clear or hidden behind a 50 moves rule) and to steer the search toward winning path.

    Not altering search result is the main reason why behaviour is different from current version.

    Efficeny is preserved in 2 ways:

    • Always returning a draw score as soon as detected
    • Always returning from a deep tree WDL win/loss score

    Same bench as master, because bench does not use TB.

    opened by mcostalba 97
  • Determine endianess at compile time (GCC, Clang, ICC)

    Determine endianess at compile time (GCC, Clang, ICC)

    GCC, Clang and ICC define the BYTE_ORDER macro according to the endianess of the target architecture. We now check the macro and declare IsLittleEndian constexpr if it is set. This allows the compiler to completely optimize away the endianess checks.

    No functional change

    opened by UniQP 2
  • Assertion failed: is_open(), file syzygy/tbprobe.cpp, line 206

    Assertion failed: is_open(), file syzygy/tbprobe.cpp, line 206

    Describe the issue

    Stockfish 15.1 was compiled in debug mode and while playing out a position at syzygy assert was triggered.

    Expected behavior

    No assertion triggered.

    Steps to reproduce

    Stockfish 15.1 by the Stockfish developers (see AUTHORS file)
    uci                   
    id name Stockfish 15.1
    id author the Stockfish developers (see AUTHORS file)
    
    option name Debug Log File type string default 
    option name Threads type spin default 1 min 1 max 1024
    option name Hash type spin default 16 min 1 max 33554432
    option name Clear Hash type button
    option name Ponder type check default false
    option name MultiPV type spin default 1 min 1 max 500
    option name Skill Level type spin default 20 min 0 max 20
    option name Move Overhead type spin default 10 min 0 max 5000
    option name Slow Mover type spin default 100 min 10 max 1000
    option name nodestime type spin default 0 min 0 max 10000
    option name UCI_Chess960 type check default false
    option name UCI_AnalyseMode type check default false
    option name UCI_LimitStrength type check default false
    option name UCI_Elo type spin default 1350 min 1350 max 2850
    option name UCI_ShowWDL type check default false
    option name SyzygyPath type string default <empty>
    option name SyzygyProbeDepth type spin default 1 min 1 max 100
    option name Syzygy50MoveRule type check default true
    option name SyzygyProbeLimit type spin default 7 min 0 max 7
    option name Use NNUE type check default true
    option name EvalFile type string default nn-ad9b42354671.nnue
    uciok
    setoption name SyzygyPath value H:\Chess\345
    info string Found 510 tablebases
    position fen 8/kNp5/p1B5/8/8/7K/8/8 b - - 0 11
    go
    Assertion failed: is_open(), file syzygy/tbprobe.cpp, line 206
    

    Anything else?

    Path was specified as H:\Chess\345 however its indeed including 6man tb files as well.

    Operating system

    All

    Stockfish version

    Stockfish 15.1

    opened by Disservin 4
  • How to compile Stockfish on Windows 11 ARM, when using a MacBook Pro M1 MAX and Parallels Desktop?

    How to compile Stockfish on Windows 11 ARM, when using a MacBook Pro M1 MAX and Parallels Desktop?

    Describe the issue

    How to compile Stockfish on Windows 11 ARM, when using a MacBook Pro M1 MAX and Parallels Desktop?

    When we will have the latest dev. version for Windows ARM? https://abrok.eu/stockfish/

    Expected behavior

    It looks like I need to create a Stockfish.exe, which can use Apple MacBook ARM cores, to run Stockfish inside ChessBase 17 on Windows 11 ARM.

    Steps to reproduce

    Can someone try to compile on Windows 11 ARM or with Apples terminal?

    Anything else?

    No response

    Operating system

    Windows

    Stockfish version

    Stockfish 15

    opened by Chess321 22
  • Usage of sdot/udot in ARM

    Usage of sdot/udot in ARM

    Modern ARM processors, including Apple silicon, support sdot/udot instructions which could improve many of your NNUE operations, also overriding Simd::neon_m128_add_dpbusd_epi32x2 could help.

    Information about these instructions and their use can be read about in more detail here. We think you’d see about a 10% improvement leveraging these capabilities in Stockfish.

    opened by Developer-Ecosystem-Engineering 5
  • Losses on time when testing with adjudication=OFF

    Losses on time when testing with adjudication=OFF

    In the following run of 40.000 STC games between SF-13 and a patch for SF-16-dev, there are at least two different workers posting batches with many losses on time. For instance, the fourth worker posted a batch with 217 losses on time for 932 games.

    https://tests.stockfishchess.org/tests/view/6346c3d94bc7650f075471ce (test) https://tests.stockfishchess.org/api/pgn/6346c3d94bc7650f075471ce-3.pgn (PGN file for fourth worker) https://tests.stockfishchess.org/api/pgn/6346c3d94bc7650f075471ce-3.pgn (another PGN with time losses)

    Looking at the games in these PGN files, the time losses are both by SF 13 and by the patch, and happen very late in the games, (sometimes as late as after the engine announce mate in 5 moves: the engine is winning but loses on time).

    One thing which is "special" in this test is that I disabled adjudication. So MAYBE we have a bug in time management in master for very long games, which we don't observe in normal fishtest tests because we usually run with adjudication=ON .

    Ideas on theories to explain the situation, and how to proceed to avoid the time loses, would be welcome.

    opened by snicolet 9
Releases(sf_15.1)
  • sf_15.1(Dec 4, 2022)

    Today, we have the pleasure to announce Stockfish 15.1.

    As usual, downloads will be freely available at stockfishchess.org/download

    Elo gain and competition results

    With this release, version 5 of the NNUE neural net architecture has been introduced, and the training data has been extended to include Fischer random chess (FRC) positions. As a result, Elo gains are largest for FRC, reaching up to 50 Elo for doubly randomized FRC (DFRC). More importantly, also for standard chess this release progressed and will win two times more game pairs than it loses against Stockfish 15. Stockfish continues to win in a dominating way all chess engine tournaments, including the TCEC Superfinal, Cup, FRC, DFRC, and Swiss as well as the CCC Bullet, Blitz, and Rapid events.

    New evaluation

    This release also introduces a new convention for the evaluation that is reported by search. An evaluation of +1 is now no longer tied to the value of one pawn, but to the likelihood of winning the game. With a +1 evaluation, Stockfish has now a 50% chance of winning the game against an equally strong opponent. This convention scales down evaluations a bit compared to Stockfish 15 and allows for consistent evaluations in the future.

    ChessBase settlement

    In this release period, the Stockfish team has successfully enforced its GPL license against ChessBase. This has been an intense process that included filing a lawsuit, a court hearing, and finally negotiating a settlement that established that ChessBase infringed on the license by not distributing the Stockfish derivatives Fat Fritz 2 and Houdini 6 as free software, and that ensures ChessBase will respect the Free Software principles in the future. This settlement has been covered by major chess sites (see e.g. lichess.org and chess.com), and we are proud that it has been hailed as a ‘historic violation settlement’ by the Software Freedom Conservancy.

    Thank you

    The Stockfish project builds on a thriving community of enthusiasts (thanks everybody!) that contribute their expertise, time, and resources to build a free and open-source chess engine that is robust, widely available, and very strong. We invite our chess fans to join the fishtest testing framework and programmers to contribute to the project.

    The Stockfish team

    Source code(tar.gz)
    Source code(zip)
  • sf_15(Apr 18, 2022)

    A new major release of Stockfish is now available athttps://stockfishchess.org

    Stockfish 15 continues to push the boundaries of chess, providing unrivalled analysis and playing strength. In our testing, Stockfish 15 is ahead of Stockfish 14 by 36 Elo points and wins nine times more game pairs than it loses[1].

    Improvements to the engine have made it possible for Stockfish to end up victorious in tournaments at all sorts of time controls ranging from bullet to classical and even at Fischer random chess[2]. At CCC, Stockfish won all of the latest tournaments: CCC 16 Bullet, Blitz and Rapid, CCC 960 championship, and the CCC 17 Rapid. At TCEC, Stockfish won the Season 21, Cup 9, FRC 4 and in the current Season 22 superfinal, at the time of writing, has won 16 game pairs and not yet lost a single one.

    This progress is the result of a dedicated team of developers that comes up with new ideas and improvements. For Stockfish 15, we tested nearly 13000 different changes and retained the best 200. These include the fourth generation of our NNUE network architecture, as well as various search improvements. To perform these tests, contributors provide CPU time for testing, and in the last year, they have collectively played roughly a billion chess games. In the last few years, our distributed testing framework, Fishtest, has been operated superbly and has been developed and improved extensively. This work by Pasquale Pigazzini, Tom Vijlbrief, Michel Van den Bergh, and various other developers[3] is an essential part of the success of the Stockfish project.

    Indeed, the Stockfish project builds on a thriving community of enthusiasts to offer a free and open-source chess engine that is robust, widely available, and very strong. We invite our chess fans to join the Fishtest testing framework and programmers to contribute to the project[4].

    The Stockfish team

    [1] https://tests.stockfishchess.org/tests/view/625d156dff677a888877d1be [2] https://en.wikipedia.org/wiki/Stockfish_(chess)#Competition_results [3] https://github.com/glinscott/fishtest/blob/master/AUTHORS [4] https://stockfishchess.org/get-involved/

    Source code(tar.gz)
    Source code(zip)
  • sf_14.1(Oct 28, 2021)

    Today, we have the pleasure to announce Stockfish 14.1.

    As usual, downloads will be freely available at stockfishchess.org/download [1].

    With Stockfish 14.1 our users get access to the strongest chess engine available today. In the period leading up to this release, Stockfish convincingly won several chess engine tournaments, including the TCEC 21 superfinal, the TCEC Cup 9, and the Computer Chess Championship for Fischer Random Chess (Chess960). In the latter tournament, Stockfish was undefeated in 599 out of 600 games played.

    Compared to Stockfish 14, this release introduces a more advanced NNUE architecture and various search improvements. In self play testing, using a book of balanced openings, Stockfish 14.1 wins three times more game pairs than it loses [2]. At this high level, draws are very common, so the Elo difference to Stockfish 14 is about 17 Elo. The NNUE evaluation method, introduced to top level chess with Stockfish 12 about one year ago [3], has now been adopted by several other strong CPU based chess engines.

    The Stockfish project builds on a thriving community of enthusiasts (thanks everybody!) that contribute their expertise, time, and resources to build a free and open-source chess engine that is robust, widely available, and very strong. We invite our chess fans to join the fishtest testing framework and programmers to contribute to the project [4].

    Stay safe and enjoy chess!

    The Stockfish team

    [1] https://stockfishchess.org/download/ [2] https://tests.stockfishchess.org/tests/view/6175c320af70c2be1788fa2b [3] https://github.com/official-stockfish/Stockfish/discussions/3628 [4] https://stockfishchess.org/get-involved/

    Source code(tar.gz)
    Source code(zip)
  • sf_14(Jul 2, 2021)

    Today, we have the pleasure to announce Stockfish 14.

    As usual, downloads will be freely available at https://stockfishchess.org

    The engine is now significantly stronger than just a few months ago, and wins four times more game pairs than it loses against the previous release version [0]. Stockfish 14 is now at least 400 Elo ahead of Stockfish 7, a top engine in 2016[1]. During the last five years, Stockfish has thus gained about 80 Elo per year.

    Stockfish 14 evaluates positions more accurately than Stockfish 13 as a result of two major steps forward in defining and training the efficiently updatable neural network (NNUE) that provides the evaluation for positions.

    First, the collaboration with the Leela Chess Zero team - announced previously [2] - has come to fruition. The LCZero team has provided a collection of billions of positions evaluated by Leela that we have combined with billions of positions evaluated by Stockfish to train the NNUE net that powers Stockfish 14. The fact that we could use and combine these datasets freely was essential for the progress made and demonstrates the power of open source and open data [3].

    Second, the architecture of the NNUE network was significantly updated: the new network is not only larger, but more importantly, it deals better with large material imbalances and can specialize for multiple phases of the game [4]. A new project, kick-started by Gary Linscott and Tomasz Sobczyk, led to a GPU accelerated net trainer written in pytorch.[5] This tool allows for training high-quality nets in a couple of hours.

    Finally, this release features some search refinements, minor bug fixes and additional improvements. For example, Stockfish is now about 90 Elo stronger for chess960 (Fischer random chess) at short time control.

    The Stockfish project builds on a thriving community of enthusiasts (thanks everybody!) that contribute their expertise, time, and resources to build a free and open-source chess engine that is robust, widely available, and very strong. We invite our chess fans to join the fishtest testing framework and programmers to contribute to the project on github [6].

    Stay safe and enjoy chess!

    The Stockfish team

    [0] https://tests.stockfishchess.org/tests/view/60dae5363beab81350aca077 [1] https://nextchessmove.com/dev-builds [2] https://stockfishchess.org/blog/2021/stockfish-13/ [3] https://lczero.org/blog/2021/06/the-importance-of-open-data/ [4] https://github.com/official-stockfish/Stockfish/commit/e8d64af1 [5] https://github.com/glinscott/nnue-pytorch/ [6] https://stockfishchess.org/get-involved/

    Source code(tar.gz)
    Source code(zip)
  • sf_13(Feb 19, 2021)

    It is our pleasure to release Stockfish 13 to chess fans worldwide. As usual, downloads are freely available at

    https://stockfishchess.org

    The Stockfish project builds on a thriving community of enthusiasts who contribute their expertise, time, and resources to build a free and open-source chess engine that is robust, widely available, and very strong. We would like to thank them all!

    The good news first: from now on, our users can expect more frequent high-quality releases of Stockfish! Sadly, this decision has been triggered by the start of sales of the Fat Fritz 2 engine by ChessBase, which is a copy of a very recent development version of Stockfish with minor modifications. We refer to our statement on Fat Fritz 2 and a community blog for further information.

    This version of Stockfish is significantly stronger than any of its predecessors. Stockfish 13 outperforms Stockfish 12 by at least 35 Elo. When playing against a one-year-old Stockfish, it wins 60 times more game pairs than it loses. This release features an NNUE network retrained on billions of positions, much faster network evaluation code, and significantly improved search heuristics, as well as additional evaluation tweaks. In the course of its development, this version has won the superfinals of the TCEC Season 19 and TCEC Season 20.

    Going forward, the Leela Chess Zero and Stockfish teams will join forces to demonstrate our commitment to open source chess engines and training tools, and open data. We are convinced that our free and open-source chess engines serve the chess community very well.

    Stay safe and enjoy chess!

    The Stockfish team

    Source code(tar.gz)
    Source code(zip)
  • sf_12(Sep 2, 2020)

    It is our pleasure to release Stockfish 12 to users world-wide

    Downloads will be freely available at

    https://stockfishchess.org/download/

    This version 12 of Stockfish plays significantly stronger than any of its predecessors. In a match against Stockfish 11, Stockfish 12 will typically win at least ten times more game pairs than it loses.

    This jump in strength, visible in regular progression tests during development[1], results from the introduction of an efficiently updatable neural network (NNUE) for the evaluation in Stockfish[2], and associated tuning of the engine as a whole. The concept of the NNUE evaluation was first introduced in shogi, and ported to Stockfish afterward. Stockfish remains a CPU-only engine, since the NNUE networks can be very efficiently evaluated on CPUs. The recommended parameters of the NNUE network are embedded in distributed binaries, and Stockfish will use NNUE by default.

    Both the NNUE and the classical evaluations are available, and can be used to assign values to positions that are later used in alpha-beta (PVS) search to find the best move. The classical evaluation computes this value as a function of various chess concepts, handcrafted by experts, tested and tuned using fishtest. The NNUE evaluation computes this value with a neural network based on basic inputs. The network is optimized and trained on the evaluations of millions of positions.

    The Stockfish project builds on a thriving community of enthusiasts that contribute their expertise, time, and resources to build a free and open source chess engine that is robust, widely available, and very strong. We invite chess fans to join the fishtest testing framework and programmers to contribute on github[3].

    Stay safe and enjoy chess!

    The Stockfish team

    [1] https://github.com/glinscott/fishtest/wiki/Regression-Tests [2] https://github.com/official-stockfish/Stockfish/commit/84f3e867903f62480c33243dd0ecbffd342796fc [3] https://stockfishchess.org/get-involved/

    Source code(tar.gz)
    Source code(zip)
  • sf_11(Jan 18, 2020)

    Official release version of Stockfish 11.

    Bench: 5156767

    Release notes: https://github.com/official-stockfish/Stockfish/commit/c3483fa9a7d7c0ffa9fcc32b467ca844cfb63790

    Source code(tar.gz)
    Source code(zip)
  • sf_10(Nov 29, 2018)

A dependency-free chess engine library built to run anywhere.

♔chess-engine♚ A dependency-free chess engine library built to run anywhere. Demo | Docs | Contact Me Written in Rust ?? ?? Why write a Chess engine?

adam mcdaniel 355 Dec 26, 2022
Walleye is a chess engine written completely in rust.

Walleye is a UCI-compatible engine written using the classical alpha-beta style AI. It supports loading board positions from arbitrary FEN strings, Unicode pretty printing to the console, and UCI communication logs to help with debugging.

Mitchel Paulin 95 Dec 24, 2022
Blackmarlin is a chess engine fully written in Rust.

Blackmarlin WIP UCI Chess Engine Blackmarlin is a chess engine fully written in Rust. Make sure to compile the chess engine with cargo build --release

null 50 Oct 31, 2022
A basic web assembly chess engine written in rust.

This library is a basic implementation of a chess min-max algorithm with alpha-beta pruning (Algorithm Info). It is designed to be compiled down to WebAssembly and used for web applications.

null 2 Nov 25, 2022
A Chess Engine written in Rust that runs natively and on the web!

About The Project chess-rs is a Chess Engine written from scratch in Rust that runs natively and on web! Live Demo: https://parthpant.github.io/chess-

Parth Pant 109 Apr 6, 2023
A Chess Engine written in Rust .

Kelp Kelp is a UCI compatible chess engine written in Rust Using standard chess algorithms. Kelp is work in progress. Currently, it can be used as a U

Gautam 5 Sep 3, 2023
Opening randomizer for Chess

chess-randomizer chess-randomizer is a simple opening randomizer written in Rust using WASM and the Lichess API. To build the project, you need Rust a

null 1 Jan 31, 2022
Yet another shape chess game in Rust.

shape_chesss_in_rust Yet another shape chess game in Rust. Why the implementation is so slow? The main reason is performance of Vector iteration is ve

Simon Lee 1 Apr 10, 2022
Play jungle chess on the linux terminal.

Jungle-Chess This is my first project written in Rust. Happy for contributors and feedback! The code is dirty. Play Jungle Chess on an Emoji-Enabled L

Arne Winter 10 Aug 9, 2022
Chess implemented entirely in the Rust and TS type systems.

Type System Chess This repo contains chess implemented entirely in the (stable) Rust and Typescript type systems. Both languages feature turing comple

null 170 Jul 12, 2023
An (experimental) chess tactics trainer with spaced repetition

better-tactics A chess tactics trainer that with spaced repetition. New puzzles will be shown to you from the lichess puzzle db, according to your cal

Caitlin Wilks 6 Oct 6, 2023
A rust chess implementation using a neural network scoring function built on huggingface/candle + rust + wasm

Rusty Chess What is it? Rusty Chess aims to be a high quality embeddable chess engine that runs entirely locally in the browser (no backend required).

Gareth 3 Nov 3, 2023
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

Lucas Arriesse 125 Dec 31, 2022
A refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

Bevy Engine 21.1k Jan 4, 2023
A modern 3D/2D game engine that uses wgpu.

Harmony A modern 3D/2D game engine that uses wgpu and is designed to work out of the box with minimal effort. It uses legion for handling game/renderi

John 152 Dec 24, 2022
RTS game/engine in Rust and WebGPU

What is this? A real time strategy game/engine written with Rust and WebGPU. Eventually it will be able to run in a web browser thanks to WebGPU. This

Thomas SIMON 258 Dec 25, 2022
unrust - A pure rust based (webgl 2.0 / native) game engine

unrust A pure rust based (webgl 2.0 / native) game engine Current Version : 0.1.1 This project is under heavily development, all api are very unstable

null 368 Jan 3, 2023
Basic first-person fly camera for the Bevy game engine

bevy_flycam A basic first-person fly camera for Bevy 0.4 Controls WASD to move horizontally SPACE to ascend LSHIFT to descend ESC to grab/release curs

Spencer Burris 85 Dec 23, 2022
A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music.

rustris A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music. (C) 2020 Ben Cantrick. This code is distri

Ben Cantrick 17 Aug 18, 2022