pawn hash and ep

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

pawn hash and ep

Post by jwes »

I am implementing pawn hash and am wondering if it is useful to encode ep status. I see that crafty does this, but the info I am currently planning to store does not depend on ep status.
User avatar
hgm
Posts: 27789
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: pawn hash and ep

Post by hgm »

Doesn't that simply depend on whether your Pawn evaluation takes the e.p. status into account?

My guess is that it would be better not to, because whether you can afford to actually capture depends on a lot more than just the Pawns. (E.g. a double-push that creates a protected passer might deliver a discovered attack on your Queen, or the Pawn that presumably could capture it can be pinned on your King.) The capture presumably will be searched in QS, so you can evaluate like the capture is not possible.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: pawn hash and ep

Post by bob »

hgm wrote:Doesn't that simply depend on whether your Pawn evaluation takes the e.p. status into account?

My guess is that it would be better not to, because whether you can afford to actually capture depends on a lot more than just the Pawns. (E.g. a double-push that creates a protected passer might deliver a discovered attack on your Queen, or the Pawn that presumably could capture it can be pinned on your King.) The capture presumably will be searched in QS, so you can evaluate like the capture is not possible.
No, it is more subtle. If you reach position P from two pathways, one where the last move was a double pawn push creating an en passant capture possibility, and the second where the last move was not that double push, you can do a probe and get a completely wrong score/bound/etc. This is similar to ignoring white to move, just not as critical. But it does make a difference, that's easy enough to check.
petero2
Posts: 685
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: pawn hash and ep

Post by petero2 »

jwes wrote:I am implementing pawn hash and am wondering if it is useful to encode ep status. I see that crafty does this,
I don't see where crafty 25.0 does that. If you look at validate.c, lines 210-236, you can see that the pawn hash key does not include EP status.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: pawn hash and ep

Post by bob »

I misread the original post. I correct the normal hash signature for EP, but NOT the pawn hash, as the eval does not care about EP status.
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: pawn hash and ep

Post by jwes »

hgm wrote:Doesn't that simply depend on whether your Pawn evaluation takes the e.p. status into account?
That was my thought. I was wondering if there was something I hadn't thought of.