New 6-piece tablebases

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
User avatar
Evert
Posts: 2903
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: New 6-piece tablebases

Post by Evert » Wed Apr 10, 2013 7:20 am

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: 4343
Joined: Tue Feb 28, 2012 10:56 pm

Re: New 6-piece tablebases

Post by syzygy » Wed Apr 10, 2013 11:53 am

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: 2903
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: New 6-piece tablebases

Post by Evert » Wed Apr 10, 2013 1:22 pm

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: 2110
Joined: Wed Mar 08, 2006 7:47 pm
Location: Hattingen, Germany

Re: New 6-piece tablebases

Post by Gerd Isenberg » Wed Apr 10, 2013 4:13 pm

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: 4343
Joined: Tue Feb 28, 2012 10:56 pm

Re: New 6-piece tablebases

Post by syzygy » Wed Apr 10, 2013 6:51 pm

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: 4343
Joined: Tue Feb 28, 2012 10:56 pm

Re: New 6-piece tablebases

Post by syzygy » Wed Apr 10, 2013 6:55 pm

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: 2110
Joined: Wed Mar 08, 2006 7:47 pm
Location: Hattingen, Germany

Re: New 6-piece tablebases

Post by Gerd Isenberg » Wed Apr 10, 2013 7:55 pm

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 6:23 pm
Location: San Juan, Puerto Rico

Re: New 6-piece tablebases

Post by tano-urayoan » Thu Apr 11, 2013 5:27 pm

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: 1105
Joined: Wed Mar 08, 2006 8:41 pm
Location: Morgantown, WV, USA
Contact:

Re: New 6-piece tablebases

Post by jshriver » Fri Apr 12, 2013 12:28 am

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 12:54 pm
Location: Ottawa, Canada
Contact:

Re: New 6-piece tablebases

Post by stevemulligan » Sat Apr 13, 2013 2:23 pm

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

Post Reply