Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How do endgame table bases work ?

Author: Russell Reagan

Date: 08:48:37 06/08/03

Go up one level in this thread


On June 08, 2003 at 04:53:02, Geoff wrote:

>1) What format is each position stored in ?
>Does it just store position for say white and infer info for black ?

Positions are not stored. For simplicity's sake, you can think of the EGTB file
as a big array that is saved to a file. You compute the index into that array by
taking the squares of the pieces and concatenating their binary representations
together. Then you just do an array lookup into the big file, and it will report
back a score, for example: draw, mate in 5, etc.

>2) Does it store the whole position or use some symmetry tricks ?

They use symmetry tricks, rotation tricks, and other tricks for kings and pawns
since their positions on the board can be limited (Example: if the king can be
captured, that position is illegal, a pawn cannot be on the first or last rank,
etc.).

>3) How were the tables created in the first place, quite a tricky algoritm I
>would imagine !!

Let's say that you wanted to generate the endgame tablebases for all 3-piece
endings. Here is a simplified way that it might work.

- Generate all of the possible positions that contain 3-pieces, storing each
position in an array. This would be all positions containing a white king, black
king, and some other piece.

- Loop over the array and find all positions where the king can be captured by
the side to move and mark them as illegal, otherwise mark the position as a
draw.

- Find all positions that are "mate in 0", and mark them as such.

- Find all positions that are "mate in 0", find the positions that can be
reached from those positions, and mark them as "mate in 1".

-Find all positions that are "mate in 1", find the positions that can be reached
from those positions, and mark them as "mate in 2".

-Continue this process until you loop through the entire array and don't make
any changes. Now you write this data to a file and you're done.

Of course, you would have a very, very basic EGTB. It wouldn't be small in size
(compared to the Nalimov EGTBs), but it would work.

Hope this helps.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.