I notice this page is tragically empty:
https://chessprogramming.wikispaces.com/Pawn+Hash+Table
So...what is the best way to create a pawn position hash table?
Is it enough to simplify the Zobrist method and only consider pawn squares? i.e.,
- generate 2 colors * 48 squares (2nd to 7th rank) = 96 random keys
- hash the key against the random number for each pawn on each square
And what about cases where you only want to look at one side's pawns? Would 48 random keys be enough?
Best way to hash pawn positions?
Moderator: Ras
-
- Posts: 778
- Joined: Sat Jul 01, 2006 7:11 am
Re: Best way to hash pawn positions?
The easiest is to use the same Zobrist keys you use for the TT, and only hash in pawn moves and captures of pawns.
-
- Posts: 2251
- Joined: Wed Mar 08, 2006 8:47 pm
- Location: Hattingen, Germany
Re: Best way to hash pawn positions?
Yes, it is on my todo listmonk64 wrote:I notice this page is tragically empty:
https://chessprogramming.wikispaces.com/Pawn+Hash+Table
So...what is the best way to create a pawn position hash table?
Is it enough to simplify the Zobrist method and only consider pawn squares? i.e.,
- generate 2 colors * 48 squares (2nd to 7th rank) = 96 random keys
- hash the key against the random number for each pawn on each square
And what about cases where you only want to look at one side's pawns? Would 48 random keys be enough?

Most common and simple seems a dedicated Zobrist key, only considering squares occupied by pawns. Another idea is to use the 96 relevant bits of the white and black pawn-bitboards as key and to fold them down to an index range, f.i.
Code: Select all
pawnHashindex = (whitepawnBB - blackpawnBB) * magic >> (64-numbits)