Question: Polyglot books and Chess960

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Question: Polyglot books and Chess960

Post by hgm »

But I cannot imagine what you have in mind that would need 32 keys, so I cannot judge if it is simple. In fact it makes me suspect that it must be very contrived. Imagine a ye of FEN where you would not only need the letters A-Ha-h to indicate castling rights, such as in Shredder FEN, but also I-Pi-p (32 letters total). It is hard to imagine how that could be simple.

What I have in mind I know to be simple:

There is a white and a black key for each board file, and if Rook on that file has castling rights, the corresponding key is ORed into the hash key.

What could be simpler?
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Question: Polyglot books and Chess960

Post by Michel »

You have a word of 4 letters chosen from a-h (or empty). So 4x8=32. This is like the current situation where you represent a word of 4 bits by 4x1 keys.

But i already said I agree to 16.

But you said you would want to reduce it further since every file indicator can take only 5 values (apart from kqKQ). So you need only extra 10 keys. I was objecting to that. I am sure you can reduce 10 even further but I don't see the point.

Michel
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Question: Polyglot books and Chess960

Post by hgm »

You must have misunderstood me: I am not aware I ever proposed something with less than 16 keys (KQkq = HAha, plus 12 new for B-G and b-g). I don't even see how this could be done, anda gree hat it would be pointless. So I am happy with the 16-key solution.

I was wrong in sating that XFEN nd Shredder would be the same in a language where King is spelled with H nand Queen with A, though. They are only the same then for poitions where the Rooks start in the corners.

This shows that there is an altenative way to define a FEN standard for Chess960 that offer backwards compatibility for normal Chess than XFEN:

Only use KQkq for Rooks on the edge files, (in stead of any outer-most Rook), and the file letter otherwise.

This is simpler than XFEN, yet compatible with normal Chess.
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Question: Polyglot books and Chess960

Post by Michel »

I included the Chess960 specification in

http://alpha.uhasselt.be/Research/Algeb ... ormat.html

Please have a look if there are any remaining ambiguities.

Michel
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Question: Polyglot books and Chess960

Post by Michel »

Actually I see that you are now proposing a convention more akin to Shredder fen. This has as an advantage that the offset of a rook in the table of random numbers would not change if an outer rook became an inner rook.

But it would not be compatible with the way PG currently encodes Chess960 positions in which there is no castling ambiguity.