Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Mixing 0x88 and bitboards

Author: Robert Hyatt

Date: 17:10:16 06/25/02

Go up one level in this thread


On June 25, 2002 at 19:13:39, Tony Werten wrote:

>On June 25, 2002 at 18:17:05, Sune Fischer wrote:
>
>>On June 25, 2002 at 17:17:04, Tony Werten wrote:
>>
>>>On June 25, 2002 at 17:04:43, Robert Hyatt wrote:
>>>
>>>>On June 25, 2002 at 16:35:26, Gian-Carlo Pascutto wrote:
>>>>
>>>>>On June 25, 2002 at 14:26:37, Russell Reagan wrote:
>>>>>
>>>>>>On June 25, 2002 at 05:07:26, Gian-Carlo Pascutto wrote:
>>>>>>
>>>>>>>Hrmpf. In my experience, there are many things
>>>>>>>that are both faster and easier to evaluate via
>>>>>>>a classic approach.
>>>>>>
>>>>>>Could you give some examples of things that you have found that can be
>>>>>>calculated faster using the classic approach?
>>>>>
>>>>>'Is there a white pawn on e6?'
>>>>>
>>>>>if (board[E6] == wpawn)
>>>>>
>>>>>1 load
>>>>>1 compare
>>>>>
>>>>>if (WhitePawns & Mask[e6])
>>>>>
>>>>>2 64-bit loads
>>>>>1 64-bit and
>>>>>1 64-bit compare
>>>>>
>>>>>--
>>>>>GCP
>>>>
>>>>
>>>>What about more commonly:  Is the black pawn on e6 passed.  Now you have
>>>>to check 12 squares...  d2/e2/f2, d3/e3/f3, d4/e4/f4, d5/e5/f5.
>>>>
>>>>Bitmaps:  two loads one and.  No compare.  Just a branch not zero.
>>>>
>>>>traditional...  12 loads 12 compares.
>>>>
>>>>Asking simple questions with bitmaps is not so good on 32 bit machines.  On
>>>>a 64 bit machine, your above becomes
>>>>
>>>>1 load.  1 mask create (set 1 bit and shift, two instructions, done in the
>>>>"shadow" of the load, then one compare.
>>>>
>>>>On a 64 bit machine, they are equally fast for the simple operation.  For
>>>>the second case, the 64 bit machine is an easy winner.
>>>
>>>No, this is 1 pawnhashtable lookup. Don't care how you got the information you
>>>put in the hashtable, because of the hitrate that's not important.
>>>
>>>Bitboards are best for pawns (imo) but because of the hashtable, it's not that
>>>important. (Altough "is this rook behind and not in front of a passed pawn"
>>>would save me some time with bitboards instead of what I'm doing now.
>>>
>>>Tony
>>
>>What if you want to check for connected rooks, or connected bishop and queen?
>>This is easy with bitboards, you just have to produce the attackboard of one of
>>the pieces and mask it with the location the other piece.
>
>In your evaluation ( unless you're using piece square ) you will bump into those
>pieces.
>
>>Attacks in general seem fast with bitboards, once you have generated the attack
>>board you know what it is attacking using 1 load, one AND and one compare (did I
>>get that right?:).
>>
>>I don't know how this is done in 0x88, there must be some attack info
>>constructed in a way, or else there will be loops everywhere.
>
>Sort of. You can ask "can a piece of this type attack that square from this
>square" If so, and the piece is a slider only then you have to loop.
>
>>How else do you generate king moves, such as regular king moves and castle
>>moves?
>
>Regular king moves in bitboards will need your and's and stuff and then a loop
>over all the bits that are set in your bitboard. Not much different from other
>ways.

Note that there is no requirement to generate the attack bitmap, then loop
thru it and stuff the moves into a movelist as I do in Crafty.  The paper by
Slate and Atkin (and I think  Darkthought) give an approach where you just
generate moves one at a time and use them, rather than generating them all
and then using them one at a time.

I simply didn't like the idea as I wanted to be able to order moves in any
way imaginable, rather than try to trick my move generator to produce them in
a reasonable order.

>
>>
>>The question becomes "how quickly can you generate the attack table"?
>>To generate the whole attack table it seems you must generate all the moves,
>>even when you only need the best capture move?
>
>If I only need a capture I don't think I need to generate an attack table.
>
>Tony
>>
>>
>>-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.