pawn hash table difference

Discussion of chess software programming and technical issues.

Moderator: Ras

ethanara
Posts: 134
Joined: Mon May 16, 2011 6:58 pm
Location: Denmark

Re: pawn hash table difference

Post by ethanara »

hgm wrote:The Rook-on-7th info does not depend on the pair of Rooks.You can simply put it in the piece-square tables. But for most advanced engines the bonus depends on the presence of Pawns on that same Rank, or of a King on the 8th. You could not see that from Rook positons only. In fact, the position of one Rook has very little effect on what is a good square for the other. Connecting the Rooks could get a bonus, but it is quite cheap to test 'on the fly', and thus not worth tabulating (plus that it also does not depend on Rook locations only, but on intervening pieces of any type as well).

For Pawns this is all completely different. How good a Pawn is on a certain square depends almost exclusively on where other Pawns are. A white Pawn on c4 could be a winning advantage (e.g. protected passer) or a lethal weakness (e.g. isolated doubled pawn).
What i mean is to have one bit (for each rook) indicating that it is a rook on 7th with pawns on, or if there king on 8th.
You could also make a bit for each color saying if rooks are connected, and so on.
Maybe i would make a little experiment with that
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: pawn hash table difference

Post by Desperado »

ethanara wrote:
hgm wrote:The Rook-on-7th info does not depend on the pair of Rooks.You can simply put it in the piece-square tables. But for most advanced engines the bonus depends on the presence of Pawns on that same Rank, or of a King on the 8th. You could not see that from Rook positons only. In fact, the position of one Rook has very little effect on what is a good square for the other. Connecting the Rooks could get a bonus, but it is quite cheap to test 'on the fly', and thus not worth tabulating (plus that it also does not depend on Rook locations only, but on intervening pieces of any type as well).

For Pawns this is all completely different. How good a Pawn is on a certain square depends almost exclusively on where other Pawns are. A white Pawn on c4 could be a winning advantage (e.g. protected passer) or a lethal weakness (e.g. isolated doubled pawn).
What i mean is to have one bit (for each rook) indicating that it is a rook on 7th with pawns on, or if there king on 8th.
You could also make a bit for each color saying if rooks are connected, and so on.
Maybe i would make a little experiment with that
Hi Ethan,

Again, _if_ you want to make a key for rooks only and a table to lookup
the rook evaluation you have to think about 2 points.

* which features are _independent_ of other piece positions. These are
candidates to store them into a table. _If_ you have enough of them,
or they are _very_ costly in its computation, you can benefit.
Just lookup the final result instead of computing all
of them again.

* features of this category may be trivial to compute. Eg, connected
rooks is trivial (at least with bitboards). so to manage a table for such
trivial computations does not seem to be worth it. You would need really
_a lot_ of such features.

So, your last example does not work because if you compute a key for only rooks, say keyR, this key doesnt hold the same information about
other board states. You simply can have keyR with and without pawns on 7th and so on. So storing such information will hold invalid data.

The other way around, that means that you would have to build a key like
rook-pawn-key, rook-king-key or rook-pawn-king key, so you can be sure
that your flags are really true for a position.

Michael
Aleks Peshkov
Posts: 922
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: pawn hash table difference

Post by Aleks Peshkov »

Pawn hash table (and evaluation hash table in general) are only a modest speed gain, if any at all. No reason to worry about it before a chess program become stable and mature.