polyglot en passant square

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
elcabesa
Posts: 677
Joined: Sun May 23, 2010 11:32 am
Contact:

polyglot en passant square

Post by elcabesa » Thu Sep 12, 2013 10:55 am

Hi all, I just noticied that polyglot book and major engines only set the en passant square if the en passant square can be attacked by a pawn.
for example
position startpos moves e2e4 doesn't set the epsquare.

why?

tpetzke
Posts: 684
Joined: Thu Mar 03, 2011 3:57 pm
Location: Germany
Contact:

Re: polyglot en passant square

Post by tpetzke » Thu Sep 12, 2013 11:16 am

Hi,

I was once also troubled by this and opened a thread about it.

http://www.talkchess.com/forum/viewtopi ... 0c79a2c68b

In summary: It helps a bit with hash tables hits as you get a bit more hits if you don't set it in positions where no ep capture is possible anyway.

Thomas...
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine

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

Re: polyglot en passant square

Post by hgm » Thu Sep 12, 2013 11:24 am

Whether a Pawn reached the 4th rank by a double-push on the previous move, or in another way, does not make the position any different if there is no Pawn to e.p. capture. Imagining they are different would be an artifact, which would have to be corrected by storing multipl versions of such a position (in an opening book), or would lead you to search positions that you searched before (in a hash table). None of that is good, and there is no up side.

User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 2:27 pm

Re: polyglot en passant square

Post by Don » Thu Sep 12, 2013 8:19 pm

hgm wrote:Whether a Pawn reached the 4th rank by a double-push on the previous move, or in another way, does not make the position any different if there is no Pawn to e.p. capture. Imagining they are different would be an artifact, which would have to be corrected by storing multipl versions of such a position (in an opening book), or would lead you to search positions that you searched before (in a hash table). None of that is good, and there is no up side.
Exactly. In theory you want each position to have only 1 fen representation if you are processing them. As it stands now a single 4 field fen position can have multiple fen representations due to this glitch.

The castling availability could also be a problem if it were not specified which order these are present. But the standard wisely requires them to be in the order KQkq - otherwise there would be even more ways to represent the same identical position.

Having said that, Komodo can process these out of order but there is function in Komodo to export fen (mostly for debugging) which follows the standard for castling.

Komodo also exports fen with correctly with respect to en-passant and I urge all software developers to NOT follow the standard in this regard. As far as I know it will not break ANY software and is a clear improvement.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.

User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 2:27 pm

Re: polyglot en passant square

Post by Don » Thu Sep 12, 2013 9:07 pm

Don wrote:
hgm wrote:Whether a Pawn reached the 4th rank by a double-push on the previous move, or in another way, does not make the position any different if there is no Pawn to e.p. capture. Imagining they are different would be an artifact, which would have to be corrected by storing multipl versions of such a position (in an opening book), or would lead you to search positions that you searched before (in a hash table). None of that is good, and there is no up side.
Exactly. In theory you want each position to have only 1 fen representation if you are processing them. As it stands now a single 4 field fen position can have multiple fen representations due to this glitch.
What I meant to say is that a single position can have multipo 4 field representations.

The castling availability could also be a problem if it were not specified which order these are present. But the standard wisely requires them to be in the order KQkq - otherwise there would be even more ways to represent the same identical position.

Having said that, Komodo can process these out of order but there is function in Komodo to export fen (mostly for debugging) which follows the standard for castling.

Komodo also exports fen with correctly with respect to en-passant and I urge all software developers to NOT follow the standard in this regard. As far as I know it will not break ANY software and is a clear improvement.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.

bob
Posts: 20342
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: polyglot en passant square

Post by bob » Thu Sep 12, 2013 9:11 pm

elcabesa wrote:Hi all, I just noticied that polyglot book and major engines only set the en passant square if the en passant square can be attacked by a pawn.
for example
position startpos moves e2e4 doesn't set the epsquare.

why?
There is no pawn that can capture the e4 pawn...

elcabesa
Posts: 677
Joined: Sun May 23, 2010 11:32 am
Contact:

Re: polyglot en passant square

Post by elcabesa » Thu Sep 12, 2013 10:14 pm

understood, I also modified my code and now it can read polyglot books :)

Post Reply