New 6-piece tablebases

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: New 6-piece tablebases

Post by Evert »

syzygy wrote:I've always called my engine Sjaak, but this name is not unique anymore. It's playing on FICS as TrojanKnight. TrojanKnight tablebases? Trojanbases?
Sorry about that. :oops:
I did do a google search on the name at the time (since it's such an obvious name for a chess (variant) engine) and didn't find anything then.

I have been meaning to look at how easy it would be to use your generator for variants with other piece types, and it seems that it would not be too difficult to modify?
syzygy
Posts: 5647
Joined: Tue Feb 28, 2012 11:56 pm

Re: New 6-piece tablebases

Post by syzygy »

Evert wrote:
syzygy wrote:I've always called my engine Sjaak, but this name is not unique anymore. It's playing on FICS as TrojanKnight. TrojanKnight tablebases? Trojanbases?
Sorry about that. :oops:
I did do a google search on the name at the time (since it's such an obvious name for a chess (variant) engine) and didn't find anything then.
Yes, I never really advertised the name and it's indeed an obvious name from a Dutch point of view.
I have been meaning to look at how easy it would be to use your generator for variants with other piece types, and it seems that it would not be too difficult to modify?
Replacing the knight, bishop, rook, queen and I guess even king by pieces that move differently should indeed be easy, as long the "moves" of such a piece are the same as its "unmoves" and they capture by moving to the square of the captured piece. Really adding new piece types to the generator (so that in addition to N/B/Q/R/K other letters standing for other piece types could be used) is more complicated. One reason is that piece types are encoded as 1-6 (white) and 9-14 (black) and I test for color by & 0x08. I'll have a look later to see how much depends on this.

My focus has been more on allowing for different capture rules such as in atomic chess and suicide chess. This requires that kings may be on neighbouring squares, which is one of the reasons why the generator requires 2x10x64^5 bytes = 20 GB of RAM for generating 6-piece tables instead of "only" 2x462x64^4 bytes = 14.4 GB which would fit in 16 GB. For regular chess it might be doable to support the more compact format during generation. Another thing I'll have a look at.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: New 6-piece tablebases

Post by Evert »

syzygy wrote: Replacing the knight, bishop, rook, queen and I guess even king by pieces that move differently should indeed be easy, as long the "moves" of such a piece are the same as its "unmoves" and they capture by moving to the square of the captured piece. Really adding new piece types to the generator (so that in addition to N/B/Q/R/K other letters standing for other piece types could be used) is more complicated. One reason is that piece types are encoded as 1-6 (white) and 9-14 (black) and I test for color by & 0x08. I'll have a look later to see how much depends on this.
Just by grepping for 0x08 reveals many cases where the colour is tested that way, while 0x07 is used a few times as a piece mask. However, at first glance I didn't see an obvious reason why it wouldn't be possible to use 16 and up for additional piece types.

I'll have a closer look later.

Would it be hard to handle variants with two kings on one side? :P
Gerd Isenberg
Posts: 2251
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: New 6-piece tablebases

Post by Gerd Isenberg »

syzygy wrote:
ZirconiumX wrote:Ron - what are these magic tablebases called?
Good question. I've always called my engine Sjaak, but this name is not unique anymore. It's playing on FICS as TrojanKnight. TrojanKnight tablebases? Trojanbases?
syzygybases?
syzygy
Posts: 5647
Joined: Tue Feb 28, 2012 11:56 pm

Re: New 6-piece tablebases

Post by syzygy »

Evert wrote:Would it be hard to handle variants with two kings on one side? :P
Actually I wonder why the generator doesn't already handle it correctly! KKvK and KvKK give different outcomes. If it had worked correctly, only one of the two kings could be in check. The other could be captured and could give check. But apparently the presence of two kings confuses the code somewhere. (Of course without assigning different piece type values to the two types of kings the probing code would be terribly confused as well, so only KKvK could possibly work.)

Alternatively one could define check as either one of the kings being in check. I think that could be handled quite easily as well. In-check positions correspond to illegal positions with the other side to move. Those are initialised in the calc_captures_w and calc_captures_b by calls to calc_illegal_w and calc_illegal_b (which basically undo king captures by the other pieces). Doing this for all kings should do the trick. Some other changes would be needed as well.
syzygy
Posts: 5647
Joined: Tue Feb 28, 2012 11:56 pm

Re: New 6-piece tablebases

Post by syzygy »

Gerd Isenberg wrote:
syzygy wrote:
ZirconiumX wrote:Ron - what are these magic tablebases called?
Good question. I've always called my engine Sjaak, but this name is not unique anymore. It's playing on FICS as TrojanKnight. TrojanKnight tablebases? Trojanbases?
syzygybases?
Fine with me as well. Syzygy bases actually exist in mathematics.
Gerd Isenberg
Posts: 2251
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: New 6-piece tablebases

Post by Gerd Isenberg »

syzygy wrote:
Gerd Isenberg wrote:
syzygy wrote:
ZirconiumX wrote:Ron - what are these magic tablebases called?
Good question. I've always called my engine Sjaak, but this name is not unique anymore. It's playing on FICS as TrojanKnight. TrojanKnight tablebases? Trojanbases?
syzygybases?
Fine with me as well. Syzygy bases actually exist in mathematics.
Apparently quite sophisticated ...
http://en.wikipedia.org/wiki/Syzygy_%28mathematics%29
Buchberger's algorithm for computing Gröbner bases allows to compute the first syzygy module: The reduction to zero of the S-polynomial of a pair of polynomials in a Gröbner basis provides a syzygy, and these syzygies generate the first module of syzygies.
Somehow it sounds like generating endgame tablebases ;-)
tano-urayoan
Posts: 638
Joined: Thu Aug 30, 2007 8:23 pm
Location: San Juan, Puerto Rico

Re: New 6-piece tablebases

Post by tano-urayoan »

jshriver wrote:
Aye, understand the logic behind it. Just been itching for 7-men data for nearly a decade now. Meant no disrespect toward Mr Ronald de Man. Was just curious :).
There are already 7 pieces tablebases available but just accessible via internet using convekta software, either latest Aquarium or Chess Assistant.

Here is the info.
User avatar
jshriver
Posts: 1354
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: New 6-piece tablebases

Post by jshriver »

tano-urayoan wrote:
There are already 7 pieces tablebases available but just accessible via internet using convekta software, either latest Aquarium or Chess Assistant.

Here is the info.
Interesting... knew they existed but thought only for rare cases or lots of money to actually access them.

This might be the push I need to get Aquarium or one of the engines that comes bundled with it :)
User avatar
stevemulligan
Posts: 117
Joined: Wed Jul 20, 2011 2:54 pm
Location: Ottawa, Canada

Re: New 6-piece tablebases

Post by stevemulligan »

Nice work Ronald! How can they be so much smaller than the compressed Gaviota tables?