Possible pawn hash speed optimization?

Discussion of chess software programming and technical issues.

Moderator: Ras

Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: Possible pawn hash speed optimization?

Post by Edmund »

sje wrote:
bob wrote:
sje wrote:If there are more than two pawns on the board, then a regeneration will cost more than an update/downdate.
I think he is talking about the search path. If you search 40 plies deep, you update the pawn hash signature 40 times, and then do one probe (which uses that). It would be more efficient to recalculate. But it is probably a 0.1% improvement overall since the pawn hash stays in cache because it is updated so often. Hanging on to it might actually make it faster if the memory layout is such that it gets displaced before it is used in eval, and you burn a few thousand cycles waiting to get it back...
If you search 40 plies deep, you update the pawn hash signature 40 times only if all 40 moves are pawn moves.
you still have to check every move whether it is a pawn move or not. Or more likely you have a branch-less solution like the one below.

pawnhash ^= zobristkey[move] & -(move == Pawnmove)