Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Way of compressing attacks bitboards

Author: Robert Hyatt

Date: 17:07:01 05/06/04

Go up one level in this thread


On May 06, 2004 at 17:12:58, Gerd Isenberg wrote:

>On May 06, 2004 at 17:07:53, Gerd Isenberg wrote:
>
>>On May 06, 2004 at 17:03:56, Robert Hyatt wrote:
>>
>>>On May 06, 2004 at 16:59:57, Sune Fischer wrote:
>>>
>>>>On May 06, 2004 at 16:07:16, Robert Hyatt wrote:
>>>>
>>>>>On May 06, 2004 at 13:00:06, Mathieu Pagé wrote:
>>>>>
>>>>>>Hi,
>>>>>>
>>>>>> Actualy my engine use pre-calculated bitboards to generate the moves. and I was
>>>>>>asking myself if compressing them, in order to keep them in cache would make my
>>>>>>move generator faster. I tought about two techniques to compress them.
>>>>>>
>>>>>>1. Use a 7 bits mask as a representation of the occupancy of the line as we
>>>>>>always know that the position where the piece that we want to move is occupied.
>>>>>>I already use this and it cut the space used by the index by a factor of two.
>>>>>>I'm sure you were all aware of this trick.
>>>>>
>>>>>What about using a 5-bit mask then.  You don't need the two endpoint bits anyway
>>>>>as you attack those squares whether they are occupied or not.
>>>>
>>>>What if the square is on the edge and thus already removed?
>>>>Seems you end up with some being 5 bit and some being 6 bit lines.
>>>
>>>
>>>Doesn't matter.  Remember that you already know whether you are on the edge or
>>>not.  The only thing that matters is the occupied squares between the two
>>>extreme points.  That is why I currently use 6 bits.  But by removing the bit
>>>for the piece being tested, that would/could drop to 5.
>>>
>
>For a rook on a1 you really need six squares from b1 to g1, to decide whether h1
>is attacked or not ;-)
>

OK.  I see what Sune and you are talking about.  I only use 6 bit indices
everywhere which works just fine.  5 would be quirky when the missing bit is on
the end...


>
>
>
>>>
>>>>
>>>>>I use 6 bit myself as squeezing out the square the piece is on is not
>>>>>convenient...
>>>>
>>>>-S.



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.