Changes

Jump to: navigation, search

Endgame Tablebases

3,359 bytes added, 12:37, 14 June 2021
no edit summary
=Purposes=
When a [[Chess Game|chess game]] goes to the [[Endgame|endgame]] phase, it may complete soon with the result as a draw or a win/loss. Both human/chess engines can finish the endgame by continuing searching, applying some endgame rules. The Even the game can finish in this way but it is not in a perfect way: it takes much time to make movecompute moves, may use more moves than necessary. Sometimes the winning side may lose the change since the rule 50 movesand/or making blunders. Both human and chess engines may miss badly the chances if they don’t know or not good enough about the endgame they are playing.
An EGTB can help to solve this period. It is a kind of a dictionary of all endgame positions which can answer directly or indirectly immediately for a given position:* If it is a draw or a win/loss* how How far/how many move from matting/being mated* what What is the best move
The main advantages of using EGTBs:
* It does not Engines don’t have to search but retrieves data thus it they can move instantly* The move is Moves are the perfect oneones, leading the shortest line to win* Engines don’t need to have the knowledge and code about those endgames
The main disadvantages of using EGTBs:
* Data Their data typically are too large for downloading and storing* If use when searching, it They may slow down the search* Require a complicated code codes for probing
=Data=
An EGTB is a set of endgames. Each endgame is a set of records about positions’ information. All involving positions (they in an endgame must have the same material). Each Typically each position 's record associates with an integer number which informs how far that position is from mating/being mated or converting (depends on the type of its metrics). All numbers of an endgame are simply organized as two arrays of integers (one array for one side/color). In other words, each item in those arrays is an integer and its index on an array is mapped to a unique position.
Those arrays Based on values of an endgame those integer numbers it can be stored in files. Popularly each array answer directly two questions of the EGTB: 1) for a given position it is a draw or a win/loss position and 2) how far it is stored in one filefrom mating/being mated or converting. But sometimes they To answer the 3rd question, the best move of a position can be combined into one file. Those files may be in the form of none or compressed. If they are compressedindirectly calculated: generate all legal moves, make them, they are divided and compressed by small blocks thus they don't need to decompress probe all to extract data of few new positions, compare probing scores for the highest one and the associated move is the best one.
Theoretically, we can add more information to each position’s record. However, due to large numbers of involving positions, any additional information may make the whole EGTB becomes significantly larger. Thus so far none of popular EGTBs store any extra information and their records actually contain those integers only.
 
All records of an endgame are simply organized as two arrays (one array for one side/color). In other words, each item in those arrays is an integer and its index on an array is mapped to a unique position. For a given chess position, we will calculate its index then access its data record/integer via that index without searching.
 
==Endgame files==
Those arrays of an endgame can be stored in files. Typically each array is stored in one file. However, sometimes they can be combined into one larger file or splitted into more files to easier copy or manage. Those files may be in compressed or uncompressed forms. If they are compressed, they are typically divided and compressed by small blocks thus they don't need to load and decompress all data to extract just a position.
 
==In memory==
Some chess engines create themselves EGTBs on-flight and keep all data in memory without saving/loading to files. Due to limit by initial time they can generate and use very small EGTBs only.
 
==Sizes==
The size of an endgame depends on:
* The number of involving pieces: more pieces, the bigger size
=Retrieving=
==Probe==
When a chess program (e.g., a chess engine or a chess GUI) works with an EGTB, it needs to retrieve data (integer numbers) for some given chess positions. The process named probe. It is not a search but retrieve data which and has below steps:
* convert a given chess position into an index via indexing algorithms
* access data (typically organized organised as an integer arrayarrays of integers) using the index to retrieve the integer of that chess position
If data of that endgame is not ready in memory, usually the probe process has to do some extra work:
* From data index calculate to the block index
* Read data of that block from storage into memory
* Uncompress the block data (if it is compressed)* Convert the endgame index into block index and retrieve the right needed data
==Search==
==Speed==
Typically the probe process requires some computing and it may access storage and decompress which is usually so slow, compared with one stored in memory. All may make it be a slow one. An engine that probes EGTB when searching may make the whole search be slower. Sometimes the benefit from probing EGTBs maybe not enough to cover the loss of slower search. That’s why the probing should be planned and implemented carefully. EGTB files may have to store in fast storage and/or using some huge systems’ caches. The good point is that the engine can stop searching on the branch probed the EGTB. 
=Brief Info=
* [[Ernst A. Heinz]] ('''1999'''). ''Endgame Databases and Efficient Index Schemes for Chess.'' [[ICGA Journal#22_1|ICCA Journal, Vol. 22, No. 1]], [http://people.csail.mit.edu/heinz/ps/edb_index.ps.gz ps]
* [[Ernst A. Heinz]] ('''1999'''). ''Knowledgeable Encoding and Querying of Endgame Databases.'' [[ICGA Journal#22_2|ICCA Journal, Vol. 22, No. 2]], [http://people.csail.mit.edu/heinz/ps/know_edb.ps.gz ps]
* [[Christoph Wirth]], [[Jürg Nievergelt]] ('''1999'''). ''Exhaustive and Heuristic Retrograde Analysis of the KPPKP Endgame.'' [[ICGA Journal#22_2|ICCA Journal, Vol. 22, No. 2]]<ref>[http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=2923 Chris Wirth's endgame tablebases] by [[Denis Mendoza|Denis P. Mendoza]], [[Computer Chess Forums|CCRL Endgame Tablebases]], December 13, 2007 » [[Chessterfield]]</ref>
* [[Eugene Nalimov]], [[Christoph Wirth]], [[Guy Haworth]] ('''1999'''). ''[http://centaur.reading.ac.uk/4564/ KQQKQQ and the Kasparov-World Game]''. [[ICGA Journal#22_4|ICCA Journal, Vol. 22, No. 4]]
* [[Ulrich Thiemonds]] ('''1999'''). ''Ein regelbasiertes Spielprogramm für Schachendspiele''. [https://en.wikipedia.org/wiki/University_of_Bonn University of Bonn], Diploma Diplom thesis, [httphttps://www.iaiidb.uni-bonn.de/~idbpublications/diplomarbeitenda/thiemonds99.psda_thiemonds_1999.gz zipped pspdf pdf] (German)
* [[Chrilly Donninger]] ('''1999'''). ''Der Fortschritt ist nicht aufzuhalten - Chrilly Donninger über Endspieldatenbanken''. [[Computerschach und Spiele|CSS]] 6/99, [http://www.mustrum.de/chrilly/tbs.pdf pdf] (German)
==2000 ...==
* [[Karsten Müller]], [[Guy Haworth]] ('''2019'''). ''FinalGen revisited: new discoveries''. [[ICGA Journal#41_1|ICGA Journal, Vol. 41, No. 1]] » [[FinalGen]]
* [[Karsten Müller]], [[Guy Haworth]] ('''2019'''). ''Stalemate and ‘DTS’ depth to stalemate endgame tables''. [[ICGA Journal#41_4|ICGA Journal, Vol. 41, No. 4]] » [[Stalemate]]
==2020 ...==
* [[Guy Haworth]] ('''2020'''). ''CEN: Thomas Ströhlein’s Endgame Tables, a 50th Anniversary''. [[ICGA Journal#42_23|ICGA Journal, Vol. 42, Nos. 2-3]]
=Forum Posts=
* [http://www.open-aurec.com/wbforum/viewtopic.php?f=4&t=4307 EGTB compression] by [[Stef Luijten]], [[Computer Chess Forums|Winboard Forum]], February 10, 2006
* [http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=2759 utility for testing tablebases integrity] by [[Victor Zakharov]], [[Computer Chess Forums|CCRL Discussion Board]], October 24, 2007
* [http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=2923 Chris Wirth's endgame tablebases] by [[Denis Mendoza|Denis P. Mendoza]], [[Computer Chess Forums|CCRL Endgame Tablebases]], December 13, 2007 » [[Chessterfield]]
* [http://www.talkchess.com/forum/viewtopic.php?t=19178 EGTB compression (H. G. Muller tablebase...)] by [[Dann Corbit]], [[CCC]], January 25, 2008
* [http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=3220 Endgame Metrics] by [[Joshua Shriver]], [[Computer Chess Forums|CCRL Discussion Board]], March 04, 2008
* [http://www.talkchess.com/forum/viewtopic.php?t=25546 Creating EGTBs] by [[Carey Bloodworth|Carey]], [[CCC]], December 21, 2008
* [http://www.talkchess.com/forum/viewtopic.php?t=26184 Other endgame tablebase generators] by [[Denis Mendoza|Denis P. Mendoza]], [[CCC]], January 23, 2009
* [http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=4219 Other endgame tablebase generators] by [[Denis Mendoza|Denis P. Mendoza]], [[Computer Chess Forums|CCRL Endgame Tablebases]], January 28, 2009
==2010 ...==
* [http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?f=6&t=5163 KK partitioning+very cheap compression fit in 8 GB (7-man)] by [[Urban Koistinen]], [[Computer Chess Forums|CCRL Discussion Board]], May 30, 2010
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=73481 Using Freeware AI and Dynamically Generated Endgame Tablebases] by Steve Schooler, [[CCC]], March 27, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=73598 Almost perfect DTM tablebase] by [[Dann Corbit]], [[CCC]], April 08, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=76089 Asynchronous tablebase lookups] by [[Steinar H. Gunderson|Sesse]], [[CCC]], December 17, 2020 <ref>[https://kernel.dk/io_uring.pdf?source=techstories.org io_uring.pdf]</ref>
'''2021'''
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=76659 Stalemate Tablebases] by Dries De Clercq, [[CCC]], February 21, 2021 » [[Stalemate]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=77249 knbk DTM] by [[Martin Sedlak]], [[CCC]], May 05, 2021 » [[KBNK Endgame]], [[#DTM|DTM]]
: [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=77249&start=4 Re: knbk DTM] by [[Harm Geert Muller]], [[CCC]], May 05, 2021 » [[Marcel van Kervinck|Marcel van Kervinck's]] pretty fast kbnk generator
=External Links=
==Online Lookup==
* [https://www.chessdb.cn/queryc_en/ Chess Cloud Database Query Interface] by [[Bojun Guo|noobpwnftw]] [[Syzygy Bases|Syzygy]] DTZ50 probing
* [http://tb7.chessok.com/ Lomonosov - online 7-man tablebases]
* [http://chessok.com/?page_id=361 Endgame Nalimov Tablebases Online] by [[ChessOK]]

Navigation menu