Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about updating bitboards in an efficient way

Author: Bas Hamstra

Date: 07:19:04 01/10/03

Go up one level in this thread


On January 10, 2003 at 04:35:17, Uri Blass wrote:

>On January 10, 2003 at 04:05:30, Bas Hamstra wrote:
>
>>On January 09, 2003 at 10:18:23, Uri Blass wrote:
>>
>>>After I make a move of a white pawn I need to change only part of the bitboard
>>>of the pawns.
>>>
>>>Is there a more efficient way to do it then things like?
>>>
>>>if (side==LIGHT)
>>>{
>>>  pawnattacksAH[LIGHT]=(pawnBB[LIGHT]<<9)&NOTFILEABB;
>>>  pawnattacksHA[LIGHT]=(pawnBB[LIGHT]<<7)&NOTFILEHBB;
>>>...
>>>}
>>>else
>>>{
>>>  pawnattacksAH[DARK]=(pawnBB[DARK]>>7)&NOTFILEABB;
>>>...
>>>}
>>>
>>>I remember that GCP told me that I can get the information from hash tables.
>>>
>>>Updating pawnBB after every make move that change the pawn structure is cheap so
>>>I do it but I wonder how can I get the information from hash tables when I do
>>>not want to use static scores for pawn structure but to use other information in
>>>the board to evaluate pawn structure.
>>>
>>>Should I start with doing it without caring about speed and only later care
>>>about storing the information that I need in hash tables?
>>>
>>>The information that I want first is squares of the passed pawns that are
>>>protected by pawns and square of the weak pawns of both sides.
>>>
>>>There is another information that today I remember without bitboard(number of
>>>pawns in every file)
>>>
>>>Should I change the way that I remember it to bitboard and if yes how to do it?
>>>
>>>Uri
>>
>>Since you will probably evaluate each pawn anyway, you can keep counters of
>>pawns at every file. I do that (and I use rotated bitboards). I store an 3
>>character arrays in my pawnhashtable: WPawnsOnFile[8] BPawnsOnFile[8] and
>>KingSafety[8]. If white castled short and black long, KingSafety[1] will give me
>>white's kingsafety and KingSafety[6] gives black's KingSafety.
>>
>>Bas.
>
>I do not understand what does king safety in your pawn hash tables.
>
>I also do not understand your example
>KingSafety[1] is for the king in g1 so my first thought is that it is relevant
>for the g file.
>If I assume that h file is 0 and g file is 1 then in this case c file is 5 and
>not 6.

It works like this: You calculate the weaknesses in the f-g-h pawns for white,
as if white had castled short. Than you do the same for the a-b-c pawns for
white, as if it castled long. Both scores are stored in the pawnhashtable. Now
if later on the white king castled short (or long, it doesn't matter), I can
lookup the the score for the "castling formations" in the pawnhashtable. To make
this a little more advanced I also take into account the scores in case of
"opposite castling", since pawnstorms are more important there. In my case this
results in 8 KingSafety scores, 4 for white and 4 for black that are calculated
once and "looked up" many times.

Remember, the score reflects not only the structure of the 3 pawns in front of
the king, but also how many (half-) open files there are on the king, is there a
pawn storm going on, how far have I pushed my qeenside pawns if black castled
long etc.


Best regards,
Bas.




Best regards,
Bas.














This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.