![]() Include some not fully supported levers in the (candidate) passed pawns bitboard, if otherwise unblocked. Maybe levers are usually very short lived, and some inaccuracy in the lever balance for the definition of candidate passed pawns just triggers a deeper search. Here is a example of a case where the patch has an effect on the definition of candidate passers: White c5/e5 pawns, against Black d6 pawn. Let's say we want to test if e5 is a candidate passer. The previous master looks only at files d, e and f (which is already very good) and reject e5 as a candidate. However, the lever d6 is challenged by 2 pawns, so it should not fully count. Indirectly, this patch will view such case (and a few more) to be scored as candidates. STC http://tests.stockfishchess.org/tests/view/5abcd55d0ebc5902926cf1e1 LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 16492 W: 3419 L: 3198 D: 9875 LTC http://tests.stockfishchess.org/tests/view/5abce1360ebc5902926cf1e6 LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 21156 W: 3201 L: 2990 D: 14965 This was inspired by this test of Jerry Donald Watson, except the case of zero supporting pawns against two levers is excluded, and it seems that not excluding that case is bad, while excluding is it beneficial. See the following tests on fishtest: https://github.com/official-stockfish/Stockfish/pull/1519 http://tests.stockfishchess.org/tests/view/5abccd850ebc5902926cf1dd http://tests.stockfishchess.org/tests/view/5abcdd490ebc5902926cf1e4 Closes https://github.com/official-stockfish/Stockfish/pull/1521 Bench: 5568461 ---- Comments by Jerry Donald Watson: > My thinking as to why this works: > > The evaluation is either called in an interior node or in the qsearch. > The calls at the end of the qsearch are the more important as they > ultimately determine the scoring of each move, whereas the internal > values are mainly used for pruning decisions with a margin. Some strong > engines don't even call the eval at all nodes. Now the whole point of > the qsearch is to find quiet positions where captures do not change the > evaluation of the position with regards to the search bounds - i.e. if > there were good captures they would be tried.* So when a candidate lever > appears in the evaluation at the end of the qsearch, the qsearch has > guaranteed that it cannot just be captured, or if it can, this does not > take the score past the search bounds. Practically this may mean that > the side with the candidate lever has the turn, or perhaps the stopping > lever pawn is pinned, or that side is forced for other reasons to make > some other move (e.g. d6 can only take one of the pawns in the example > above). > > Hence granting the full score for only one lever defender makes some > sense, at least, to me. > > IMO this is also why huge bonuses for possible captures in the evaluation > (e.g. threat on queen and our turn), etc. don't tend to work. Such things > are best left to the search to figure out. |
||
---|---|---|
src | ||
tests | ||
.travis.yml | ||
appveyor.yml | ||
AUTHORS | ||
Copying.txt | ||
Readme.md | ||
Top CPU Contributors.txt |
Overview
Stockfish is a free UCI chess engine derived from Glaurung 2.1. It is not a complete chess program and requires some UCI-compatible GUI (e.g. XBoard with PolyGlot, 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.
This version of Stockfish supports up to 512 cores. The engine defaults to one search thread, so it is therefore recommended to inspect the value of the Threads UCI parameter, and to make sure it equals the number of CPU cores on your computer.
This version of Stockfish has support for Syzygybases.
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.
-
src, a subdirectory containing the full source code, including a Makefile that can be used to compile Stockfish on Unix-like systems.
Syzygybases
Configuration
Syzygybases are configured using the UCI options "SyzygyPath", "SyzygyProbeDepth", "Syzygy50MoveRule" and "SyzygyProbeLimit".
The option "SyzygyPath" should be set to the directory or directories that contain the .rtbw and .rtbz files. Multiple directories should 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.
Increasing the "SyzygyProbeDepth" option lets the engine probe less aggressively. Set this option to a higher value if you experience too much slowdown (in terms of nps) due to TB probing.
Set the "Syzygy50MoveRule" option to false if you want tablebase positions that are drawn by the 50-move rule to count as win or loss. This may be useful for correspondence games (because of tablebase adjudication).
The "SyzygyProbeLimit" option should normally be left at its default value.
What to expect If the engine is searching a position that is not in the tablebases (e.g. a position with 7 pieces), it will access the tablebases during the search. If the engine reports a very large score (typically 123.xx), this means that 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 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 Syzygybases 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 Syzygybases 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.
Compiling it yourself
On Unix-like systems, it should be possible to compile Stockfish directly from the source code with the included Makefile.
Stockfish has support for 32 or 64-bit CPUs, the hardware POPCNT instruction, big-endian machines such as Power PC, and other platforms.
In general it is recommended to run make help
to see a list of make
targets with corresponding descriptions. 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.
Resource For Understanding the Code Base
-
Chess Programming Wiki has good overall chess engines explanations (techniques used here are well explained like hash maps etc), it was also recommended by the support team at stockfish.
-
Here 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.
Terms of use
Stockfish is free, and distributed under the GNU General Public License (GPL). Essentially, this means that 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 web site, 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. 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 found in the file named Copying.txt.