Changes

Jump to: navigation, search

Syzygy Bases

343 bytes added, 03:35, 21 April 2020
Data publish
'''Syzygy Bases''', <ref>[http://www.talkchess.com/forum/viewtopic.php?t=47681&start=45 Re: New 6-piece tablebases] by [[Ronald de Man]], [[CCC]], April 10, 2013</ref><br/>
a compact six piece endgame database developed by [[Ronald de Man]], published on April 01, 2013. Since August 2018, '''seven piece''' Syzygy Bases are available after an effort by [[Bojun Guo]] started in March 2018 <ref>[http://talkchess.com/forum3/viewtopic.php?f=7&t=66797&start=472 Re: 7-men Syzygy attempt] by [[Bojun Guo]], [[CCC]], August 19, 2018 </ref>. Syzygy Bases consist of two sets of files, '''WDL''' files storing win/draw/loss information considering the [[Fifty-move Rule|fifty-move rule]] for access during [[Search|search]], and '''DTZ''' files with [[Endgame Tablebases#DTZ50|distance-to-zero]] information for access at the [[Root|root]]. The generator is released under the [[Free Software Foundation#GPL|GNU General Public License Version 2]], the [[Thread|thread safe]] probing code is released without restrictions <ref>[http://www.talkchess.com/forum/viewtopic.php?t=47681 New 6-piece tablebases] by [[Ronald de Man]], [[CCC]], April 01, 2013</ref> . As of February 2015, all 3-5 and most important 6-men Syzygy Bases are commercially available on 4 [https://en.wikipedia.org/wiki/DVD DVDs] by [[ChessBase]] as ''Endgame Turbo 4'' for their products [[Fritz|Deep Fritz 14]], [[Komodo#8|Komodo Chess 8]], [[Houdini|Houdini 4]] or [[ChessBase (Database)|ChessBase 12/13]] <ref>[http://shop.chessbase.com/en/products/endspiel_turbo_4 Endgame Turbo 4] by [[ChessBase]]</ref> <ref>[http://en.chessbase.com/post/syzygy-tablebases-newest-fastest-smallest Syzygy Tablebases: newest, fastest, smallest] by [[Albert Silver]], [[ChessBase|ChessBase News]], February 08, 2015</ref>.  
=Data=
==File Types==
There are Syzygy Bases consist of two file types: sets of files, '''WDL ''' files (extension .rtbw) storing win/draw/loss information considering the [[Fifty-move Rule|fifty-move rule]] for access during [[Search|search]], and DTZ50 '''DTZ''' files (extension .rtbz)with [[Endgame Tablebases#DTZ50|distance-to-zero]] information for access at the [[Root|root]]. WDL has full data for two sides but DTZ50 omitted data of one side to save space. Each endgame has a pair of those types.
==File Sizes==
==Comparision==
Syzygy EGTB is significantly smaller than all any [[Endgame Tablebases#DTM|DTM]] EGTBsEGTB. It is 7 times as small as Gaviota for 5 men, 8 times as small as Nalimov for 7 6 men, 8 times as small as Lomonosov for 7 men. However, when all DTM EGTBs have full data of two sides, Syzygy EGTB omits data of one side for DTZ data to save space. [[Ronald de Man]] estimated that if keep them all, the Syzygy's 6 men size may increase 158 GB, become 307 GBin total, double on size, 4 times as small as Nalimov 6 men. =Generation===Up to 6-man==On the first release (Apr 01, 2013) the generator was ready to generate all endgames up to 6 men. The generation is multithreaded and processes completely in RAM. To generate all 6 men, it requires a system with at least 32 GB of RAM and may run in 5 days (the period was measured with a computer 6-core i3930K @ 4.2Ghz, 64 GB). ==7-man==Ronald de Man wasn't initially interested in the creation of 7-men Syzygy Based <ref>[http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=7618#p83771 Re: 7-piece syzygy] by [[Ronald de Man|syzygy]], [[Computer Chess Forums|CCRL Discussion Board]], July 03, 2014</ref> since the generation would require about 1 TB of RAM, too expensive at that time. Generation time would be about 64 x per table, which means around 175 x time total <ref>[http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=7396#p83338 Re: Syzygy tb generator for windows] by [[Ronald de Man|syzygy]], [[Computer Chess Forums|CCRL Discussion Board]], June 01, 2014</ref>.His original generator could not create them. But in 2018, he supported [[Bojun Guo]] in his 5 -month attempt to generated them <ref>[http://www.talkchess.com/forum/viewtopic.php?t=66797 7-menSyzygy attempt] by [[Bojun Guo]], [[CCC]], March 10, 2018</ref>. His hardware was estimated at over US$ 90K. In August of 2018 their creation was completed<ref>[https://syzygy-tables.info/ Powered by Ronald de Man's Syzygy endgame tablebases, 7-piece tables generated by Bojun Guo and a public API hosted by lichess.org], August 19, 2018</ref><ref>[http://tablebase.lichess.ovh/tables/standard/7/ Index of /tables/standard/7/ on lichess], August 19, 2018</ref>.
[[Ronald de Man]] in a reply to [[phhnguyen]], April 15, 2020 <ref>[http://talkchess.com/forum3/viewtopic.php?f=7&t=73598 Re: Almost perfect DTM tablebase] by [[Dann Corbit]], [[Computer Chess Forums|CCRL Discussion Board]], April 15, 2020</ref> :Checksums== Syzygy WDL is double sided, DTZ is single sided. So to know whether a 7endgame files may contain 128-piece position is winning, losing or drawn (or cursed), bit checksum keys at the engine needs to do only a single probe end of a 7-piece WDL tablethose files. (It may in addition have to do some probes of 6-piece WDL tables if any direct captures are available.) If the engine needs to know the DTZ value (which is only necessary when a TB root position also has been reached), the probing its own code may have to do a 1-ply search to get to the "right" side of the DTZ table.if some data is omitted, what the for checksums (roughlybased on Google's cityhash library) size of full data, say 5 men? Just for comparing with other EGTBs. We don't need the fairest comparison, but enough for a quick evaluation.For 6-piece TBs, DTZ is 81.9GB when storing only the smaller side of each table. Storing both sides might require perhaps 240GB.
=7-man=
Generation of 7-man tablebases would require about 1 TB of RAM. Generation time will be about 64 x per table, which means around 175 x time total <ref>[http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=7396#p83338 Re: Syzygy tb generator for windows] by [[Ronald de Man|syzygy]], [[Computer Chess Forums|CCRL Discussion Board]], June 01, 2014</ref> . Ronald de Man wasn't initially interested in creation of 7-men Syzygy Based <ref>[http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=7618#p83771 Re: 7-piece syzygy] by [[Ronald de Man|syzygy]], [[Computer Chess Forums|CCRL Discussion Board]], July 03, 2014</ref>. But in 2018, he supported [[Bojun Guo]] in his 5 month attempt to generated them <ref>[http://www.talkchess.com/forum/viewtopic.php?t=66797 7-men Syzygy attempt] by [[Bojun Guo]], [[CCC]], March 10, 2018</ref>. In August of 2018 their creation was completed<ref>[https://syzygy-tables.info/ Powered by Ronald de Man's Syzygy endgame tablebases, 7-piece tables generated by Bojun Guo and a public API hosted by lichess.org], August 19, 2018</ref><ref>[http://tablebase.lichess.ovh/tables/standard/7/ Index of /tables/standard/7/ on lichess], August 19, 2018</ref>.
=Search=
 
==During the Search==
During the [[Search|search]], with the WDL tables stored on [https://en.wikipedia.org/wiki/Solid-state_drive SSD] <ref>[http://www.talkchess.com/forum/viewtopic.php?t=47931&start=2 Re: SSD and the use of Tablebases] by [[Ronald de Man]], [[CCC]], May 08, 2013</ref> , it is possible to probe the tables at all [[Depth|depths]] without much slowdown. They have been tested in Ronald de Man's engine [[Sjaak]] (playing on [[FICS]] as TrojanKnight(C)) a couple of months quite successfully, don't probing in [[Quiescence Search|quiescence search]].
At the [[Root|root]], since pure DTZ50-optimal play (i.e. minimaxing the number of moves to the next [[Captures|capture]] or [[Pawn Push|pawn move]] by either side) can be very unnatural, it might be desirable to let the engine search on the winning moves until it becomes clear that insufficient progress is being made and only then switch to DTZ-optimal play (e.g. by detecting [[Repetitions|repetitions]] and monitoring the [[Halfmove Clock|halfmove clock]]) <ref>[http://www.talkchess.com/forum/viewtopic.php?t=47681&start=8 Re: New 6-piece tablebases] by [[Ronald de Man]], [[CCC]], April 05, 2013</ref>.
=Quotes=
by [[Ronald de Man]] in a reply to [[Guy Haworth]], April 06, 2013 <ref>[http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=6971&start=6 Re: New 6-piece tablebase generator] by [[Ronald de Man|syzygy]], [[Computer Chess Forums|CCRL Discussion Board]], April 06, 2013</ref> :
I create both WDL and DTZ in one go, so I don't use WDL in the creation of DTZ. The algorithm used is the [[Retrograde Analysis#Algorithm|grandfather algorithm]] with 2 plies per iteration (I think [[Harm Geert Muller|HGM]] calls this leapfrogging, but I might be wrong). I tried the outcounting method, but it didn't seem to be competitive (and it makes things more complicated). <ref>[http://www.open-chess.org/viewtopic.php?f=5&t=779 Retrograde tablebase methods] by [[Mark Watkins|BB+]], [[Computer Chess Forums|OpenChess Forum]], November 26, 2010</ref> <ref>[http://home.hccnet.nl/h.g.muller/EGT7/retro.html Leapfrog: Retrograde Analysis] from [http://home.hccnet.nl/h.g.muller/EGT7/7-men.html Leapfrog tablebase generator] by [[Harm Geert Muller]]</ref>
A pure WDL/DTZ pair is not of much use for creating WDL50+/DTZ50+. I create tables in RAM that have all the information necessary for WDL50+ and DTZ50+, then permute them to different indexing schemes and compress. I do test runs on subsets of the data to find good permutations. (The idea to try permutations is from [[Jesper Torp Kristensen|Jesper Torp Kristensen's]] master thesis.) <ref>[[Jesper Torp Kristensen]] ('''2005'''). ''[https://issuu.com/jespertk/docs/master_thesis Generation and compression of endgame tables in chess with fast random access using OBDDs]''. Master thesis, supervisor [[Mathematician#Miltersen|Peter Bro Miltersen]], [https://en.wikipedia.org/wiki/Aarhus_University Aarhus University]</ref> <ref>[https://en.wikipedia.org/wiki/Binary_decision_diagram OBDD - Ordered Binary Decision Diagram from Wikipedia]</ref>
=Endgame NewsPros & Cons===Pros== In his 2014 ''Chess Endgame News'' in * Small sizes. It is about 8 times as small as the second-best EGTBs. Having small sizes is the main success key of Syzygy Bases since it is much easier to create, store, provide, download than other EGTBs* Free and more popular (than other EGTBs) to find on the Internet* Support [[ICGA JournalEndgame Tablebases#37_2DTZ50|ICGA Journal, Vol. 37, No. 2DTZ50]] <ref>metric. That metric can help engines to have better results than [[Guy Haworth]] ('''2014'''). ''Chess Endgame News''. [[ICGA JournalTablebases#37_2DTM|ICGA Journal, Vol. 37, No. 2DTM]]</ref> , which is supported widely by other EGTBs ==Cons==* Hard to integrate with chess engines. [[Guy HaworthRonald de Man]] classified Syzygy Bases has not provided probing code as an independent library but as '''new''' data in '''three''' ways:# 5-valued scale for evaluating positions in the context a part of the [[FIDEStockfish]] [[Fiftychess engines. The probe code has integrated too deeply with that chess engine code and it requires a lot of effort to de-move Rule|50-move rule]] (50mr) which constrains the length of phases of playintegrate, modify and integrate with other chess projects## +2 ≡ unconditional win for the side * Hard to move## +1 ≡ ‘win’ which can be frustrated by best play understand and contribute to the project. ETGB itself is a 50mr drawhard topic. Syzygy EGTB has also integrated with many advanced techniques/tricks. It is written in old-claim## <span style="color: #ffffff;">_<C language. All make it become very hard to understand and/span>0 ≡ unconditional draw## -1 ≡ ‘loss’ saved by a 50mr draw-claim## -2 ≡ unconditional loss# depths or modify to improve or for ‘50mr draw’ positions with value ±1other purposes* [[Endgame Tablebases# depths DTZ50|DTZ50]] metric may lead the engines to win in symmetricmuch longer and ugly ways, information-preserving ply ‘p’compared with [[Endgame Tablebases#DTM|DTM]] one
and further gives some news about early software bugs and glitches concerning [[ChessBase]] products, and the importance of [https://en.wikipedia.org/wiki/MD5 MD5] to check the EGT integrity.
<span id="Fathom"></span>
=ProsData publish=* Small sizes. It is about 8 times as small as the second-best EGTBs. Having small sizes is the main success key of Syzygy Bases since it helps to create, store and provide it much easier than other EGTBs* Free and more popular (than other EGTBs) to find on the Internet* Support [[Endgame Tablebases#DTZ50|DTZ50Ronald de Man]] metrichas provided only open source code for generators/probers but not endgame files themselves. That metric can help engines to Using his tools some people have better results than [[Endgame Tablebases#DTM|DTM]] which is supported widely by other EGTBsgenerated endgames and published them via DVD or online.
=Cons=DVD==* Hard to integrate with chess enginesAs of February 2015, all 3-5 and most important 6-men Syzygy Bases are commercially available on 4 [https://en. wikipedia.org/wiki/DVD DVDs] by [[Ronald de ManChessBase]] has not provided probing code as an independent library. Instead''Endgame Turbo 4'' for their products [[Fritz|Deep Fritz 14]], [[Komodo#8|Komodo Chess 8]], he provided it as a part of [[StockfishHoudini|Houdini 4]] or [[ChessBase (Database)|ChessBase 12/13]] chess engines. The code has integrated too deeply with that chess engine code and it requires a lot of effort to de-integrate<ref>[http://shop. All make the reuse of the code for other chess engines become hard jobs* Hard to understand and contribute to the projectchessbase. ETGB itself is a hard topic. Syzygy EGTB has also integrated with many advance techniquescom/en/products/endspiel_turbo_4 Endgame Turbo 4] by [[ChessBase]]</ref> <ref>[http://tricksen. It is written in old-style C languagechessbase. All make it become very hard to understand andcom/post/or modify to improve or for other purposes* syzygy-tablebases-newest-fastest-smallest Syzygy Tablebases: newest, fastest, smallest] by [[Endgame Tablebases#DTZ50|DTZ50Albert Silver]] metric may lead the engines to win in much longer ways, compared with [[Endgame Tablebases#DTMChessBase|DTMChessBase News]] one, February 08, 2015</ref>.
=Endgame =Free Download==[[Ronald de Man]] has provided only open source code for generators/probers but not endgame files themselves. Using his tools some people have generated endgames and published them online via There are some free FTP servers for downloading such as FTP server of [[Bojun Guo]], and [[Lichess]] serverservers.
===3-6 men===
1) KRPPvKRP 2) KBPPvKBP 3) KPPPvKPP 4) KRPPPvKR 5) KQPPvKQP 6) KNPPvKNP 7) KNPPvKBP 8) KRBPvKRP 9) KQPPvKPP 10) KQPPPvKP
11) KBPPvKNP 12) KRPPvKRB 13) KRPPvKPP 14) KBPPvKRP 15) KRNPvKRP 16) KRBPPvKR 17) KBPPvKPP 18) KRPPPvKP 19) KRBPvKRB 20) KRPPvKRN
 
=Checksums=
Syzygy endgame files may contain 128-bit checksum keys at the end of those files. It also has its own code for checksums (based on Google's cityhash library).
=Probe Code and Tools=
==1) Stockfish== 
[[Ronald de Man]] did not provide the probe code as an independent library. Instead, he published it firstly as an already integrated code for [[Stockfish]] chess engines. It is c++ code and it has been rewritten, updated several times by [[Stockfish]] team.
==2) Fathom== 
'''Fathom''' is a stand-alone Syzygy based probing tool and [https://en.wikipedia.org/wiki/Application_programming_interface API] by [[Basil Falcinelli]], introduced in November 2015 along with his [[Gull|Gull 3]] release <ref>[http://www.talkchess.com/forum/viewtopic.php?t=58299 Gull 3 Linux+Syzygy and Fathom released] by [[Basil Falcinelli]], [[CCC]], November 20, 2015</ref> . Unlike the original tbprobe code, Fathom does not necessarily require the callee to provide [[Move Generation|move generation]] functionality. The new modifications and extensions to Ronald de Man's original code which can be "redistributed and/or modified without restrictions", are released under the permissive [[Massachusetts Institute of Technology#License|MIT License]]. The API consists of three functions <ref>[https://github.com/basil00/Fathom GitHub - basil00/Fathom: Syzygy TB probe tool] by [[Basil Falcinelli]]</ref> :
* tb_init initializes the tablebase
[[Jon Dart]] has a fork of Fathom with some bug fixes and enhancements <ref>[https://github.com/jdart1/Fathom jdart1/Fathom · GitHub] by [[Jon Dart]]</ref>, also supporting 7-man <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=7&t=70568 7-man Syzygy support in Fathom] by [[Jon Dart]], [[CCC]], April 23, 2019</ref>.
.
 
 
=Quotes=
by [[Ronald de Man]] in a reply to [[Guy Haworth]], April 06, 2013 <ref>[http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=6971&start=6 Re: New 6-piece tablebase generator] by [[Ronald de Man|syzygy]], [[Computer Chess Forums|CCRL Discussion Board]], April 06, 2013</ref> :
I create both WDL and DTZ in one go, so I don't use WDL in the creation of DTZ. The algorithm used is the [[Retrograde Analysis#Algorithm|grandfather algorithm]] with 2 plies per iteration (I think [[Harm Geert Muller|HGM]] calls this leapfrogging, but I might be wrong). I tried the outcounting method, but it didn't seem to be competitive (and it makes things more complicated). <ref>[http://www.open-chess.org/viewtopic.php?f=5&t=779 Retrograde tablebase methods] by [[Mark Watkins|BB+]], [[Computer Chess Forums|OpenChess Forum]], November 26, 2010</ref> <ref>[http://home.hccnet.nl/h.g.muller/EGT7/retro.html Leapfrog: Retrograde Analysis] from [http://home.hccnet.nl/h.g.muller/EGT7/7-men.html Leapfrog tablebase generator] by [[Harm Geert Muller]]</ref>
A pure WDL/DTZ pair is not of much use for creating WDL50+/DTZ50+. I create tables in RAM that have all the information necessary for WDL50+ and DTZ50+, then permute them to different indexing schemes and compress. I do test runs on subsets of the data to find good permutations. (The idea to try permutations is from [[Jesper Torp Kristensen|Jesper Torp Kristensen's]] master thesis.) <ref>[[Jesper Torp Kristensen]] ('''2005'''). ''[https://issuu.com/jespertk/docs/master_thesis Generation and compression of endgame tables in chess with fast random access using OBDDs]''. Master thesis, supervisor [[Mathematician#Miltersen|Peter Bro Miltersen]], [https://en.wikipedia.org/wiki/Aarhus_University Aarhus University]</ref> <ref>[https://en.wikipedia.org/wiki/Binary_decision_diagram OBDD - Ordered Binary Decision Diagram from Wikipedia]</ref>
 
[[Ronald de Man]] in a reply to [[Pham Hong Nguyen|Nguyen Pham]], April 15, 2020 <ref>[http://talkchess.com/forum3/viewtopic.php?f=7&t=73598 Re: Almost perfect DTM tablebase] by [[Dann Corbit]], [[Computer Chess Forums|CCRL Discussion Board]], April 15, 2020</ref> :
Syzygy WDL is double sided, DTZ is single sided.
So to know whether a 7-piece position is winning, losing or drawn (or cursed), the engine needs to do only a single probe of a 7-piece WDL table. (It may in addition have to do some probes of 6-piece WDL tables if any direct captures are available.)
If the engine needs to know the DTZ value (which is only necessary when a TB root position has been reached), the probing code may have to do a 1-ply search to get to the "right" side of the DTZ table.
For 6-piece TBs, DTZ is 81.9GB when storing only the smaller side of each table. Storing both sides might require perhaps 240GB.
 
 
=Endgame News=
In his 2014 ''Chess Endgame News'' in [[ICGA Journal#37_2|ICGA Journal, Vol. 37, No. 2]] <ref>[[Guy Haworth]] ('''2014'''). ''Chess Endgame News''. [[ICGA Journal#37_2|ICGA Journal, Vol. 37, No. 2]]</ref> , [[Guy Haworth]] classified Syzygy Bases as '''new''' data in '''three''' ways:
# 5-valued scale for evaluating positions in the context of the [[FIDE]] [[Fifty-move Rule|50-move rule]] (50mr) which constrains the length of phases of play
## +2 ≡ unconditional win for the side to move
## +1 ≡ ‘win’ which can be frustrated by best play and a 50mr draw-claim
## <span style="color: #ffffff;">_</span>0 ≡ unconditional draw
## -1 ≡ ‘loss’ saved by a 50mr draw-claim
## -2 ≡ unconditional loss
# depths for ‘50mr draw’ positions with value ±1
# depths in symmetric, information-preserving ply ‘p’
 
and further gives some news about early software bugs and glitches concerning [[ChessBase]] products, and the importance of [https://en.wikipedia.org/wiki/MD5 MD5] to check the EGT integrity.
<span id="Fathom"></span>
 
=See also=

Navigation menu