3 [![Build Status](https://travis-ci.org/official-stockfish/Stockfish.svg?branch=master)](https://travis-ci.org/official-stockfish/Stockfish)
4 [![Build Status](https://ci.appveyor.com/api/projects/status/github/official-stockfish/Stockfish?svg=true)](https://ci.appveyor.com/project/mcostalba/stockfish)
6 Stockfish is a free UCI chess engine derived from Glaurung 2.1. It is
7 not a complete chess program and requires some UCI-compatible GUI
8 (e.g. XBoard with PolyGlot, eboard, Arena, Sigma Chess, Shredder, Chess
9 Partner or Fritz) in order to be used comfortably. Read the
10 documentation for your GUI of choice for information about how to use
13 This version of Stockfish supports up to 512 cores. The engine defaults
14 to one search thread, so it is therefore recommended to inspect the value of
15 the *Threads* UCI parameter, and to make sure it equals the number of CPU
16 cores on your computer.
18 This version of Stockfish has support for Syzygybases.
23 This distribution of Stockfish consists of the following files:
25 * Readme.md, the file you are currently reading.
27 * Copying.txt, a text file containing the GNU General Public License.
29 * src, a subdirectory containing the full source code, including a Makefile
30 that can be used to compile Stockfish on Unix-like systems.
37 Syzygybases are configured using the UCI options "SyzygyPath",
38 "SyzygyProbeDepth", "Syzygy50MoveRule" and "SyzygyProbeLimit".
40 The option "SyzygyPath" should be set to the directory or directories that
41 contain the .rtbw and .rtbz files. Multiple directories should be
42 separated by ";" on Windows and by ":" on Unix-based operating systems.
43 **Do not use spaces around the ";" or ":".**
45 Example: `C:\tablebases\wdl345;C:\tablebases\wdl6;D:\tablebases\dtz345;D:\tablebases\dtz6`
47 It is recommended to store .rtbw files on an SSD. There is no loss in
48 storing the .rtbz files on a regular HD.
50 Increasing the "SyzygyProbeDepth" option lets the engine probe less
51 aggressively. Set this option to a higher value if you experience too much
52 slowdown (in terms of nps) due to TB probing.
54 Set the "Syzygy50MoveRule" option to false if you want tablebase positions
55 that are drawn by the 50-move rule to count as win or loss. This may be useful
56 for correspondence games (because of tablebase adjudication).
58 The "SyzygyProbeLimit" option should normally be left at its default value.
61 If the engine is searching a position that is not in the tablebases (e.g.
62 a position with 7 pieces), it will access the tablebases during the search.
63 If the engine reports a very large score (typically 123.xx), this means
64 that it has found a winning line into a tablebase position.
66 If the engine is given a position to search that is in the tablebases, it
67 will use the tablebases at the beginning of the search to preselect all
68 good moves, i.e. all moves that preserve the win or preserve the draw while
69 taking into account the 50-move rule.
70 It will then perform a search only on those moves. **The engine will not move
71 immediately**, unless there is only a single good move. **The engine likely
72 will not report a mate score even if the position is known to be won.**
74 It is therefore clear that behaviour is not identical to what one might
75 be used to with Nalimov tablebases. There are technical reasons for this
76 difference, the main technical reason being that Nalimov tablebases use the
77 DTM metric (distance-to-mate), while Syzygybases use a variation of the
78 DTZ metric (distance-to-zero, zero meaning any move that resets the 50-move
79 counter). This special metric is one of the reasons that Syzygybases are
80 more compact than Nalimov tablebases, while still storing all information
81 needed for optimal play and in addition being able to take into account
85 ### Compiling it yourself
87 On Unix-like systems, it should be possible to compile Stockfish
88 directly from the source code with the included Makefile.
90 Stockfish has support for 32 or 64-bit CPUs, the hardware POPCNT
91 instruction, big-endian machines such as Power PC, and other platforms.
93 In general it is recommended to run `make help` to see a list of make
94 targets with corresponding descriptions. When not using the Makefile to
95 compile (for instance with Microsoft MSVC) you need to manually
96 set/unset some switches in the compiler command line; see file *types.h*
97 for a quick reference.
99 ### Resource For Understanding the Code Base
101 * [Chess Programming Wiki](https://chessprogramming.wikispaces.com) has good overall chess engines explanations
102 (techniques used here are well explained like hash maps etc), it was
103 also recommended by the [support team at stockfish.](http://support.stockfishchess.org/discussions/questions/1132-how-to-understand-stockfish-sources)
105 * [Here](https://chessprogramming.wikispaces.com/Stockfish) you can find a set of features and techniques used by stockfish and each of them is explained at the wiki, however, it's a generic way rather than focusing on stockfish's own implementation, but it will still help you.
110 Stockfish is free, and distributed under the **GNU General Public License**
111 (GPL). Essentially, this means that you are free to do almost exactly
112 what you want with the program, including distributing it among your
113 friends, making it available for download from your web site, selling
114 it (either by itself or as part of some bigger software package), or
115 using it as the starting point for a software project of your own.
117 The only real limitation is that whenever you distribute Stockfish in
118 some way, you must always include the full source code, or a pointer
119 to where the source code can be found. If you make any changes to the
120 source code, these changes must also be made available under the GPL.
122 For full details, read the copy of the GPL found in the file named