Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: sliding attacks in three #define

Author: Gerd Isenberg

Date: 01:42:06 04/10/04

Go up one level in this thread


On April 09, 2004 at 23:48:36, Christophe Theron wrote:

>On April 09, 2004 at 16:51:34, Anthony Cozzie wrote:
>
>>On April 09, 2004 at 15:26:34, Christophe Theron wrote:
>>
>>>On April 09, 2004 at 14:27:48, Sune Fischer wrote:
>>>
>>>>
>>>>>Clearly, nothing beats the ugliness of bitboards.
>>>>
>>>>This may not be the best example to judge by.
>>>>
>>>>-S.
>>>>>    Christophe
>>>
>>>
>>>
>>>In the contrary, I think it's fairly typical of bitboard code.
>>>
>>>Elegance is supposed to be the strong point of bitboards.
>>>
>>>The only thing I find elegant is the pseudo-great starting idea "64 squares <->
>>>64 bits".
>>>
>>>Passed this point everything becomes unreadable and ugly.
>>>
>>>I also see it often used to pre-compute attack tables and such, which is in my
>>>opinion contrary to one of the most important things I have learned in computer
>>>chess: do not compute anything in advance if you are not certain that you will
>>>use it. This is not an intrinsic problem of bitboards, it's just that use of
>>>bitboards often go along with this misuse of computing resources, is it just by
>>>chance?
>>>
>>>Bitboards are a great tool allowing you to compute very complex things in a
>>>blink. The problem is that in a chess program you rarely need to do these
>>>complex computations if you know what you are doing, and so you end up with ugly
>>>and unreadable code and waste of resources (in particular of L1 and L2 caches).
>>>
>>>That being said, I do not want to be too harsh: it is probably possible to write
>>>a top-level chess program using bitboards, a program that would be not very far
>>>behind the programs using more portable approaches like 0x88 and derivatives.
>>>
>>>Somebody will write one some day.
>>>
>>>
>>>
>>>    Christophe (setting up a shield for the upcoming flame)
>>
>>Correct me if I am wrong, but aren't attack tables the exact opposite of your
>>"do not compute anything in advance" strategy?
>>
>>anthony
>
>
>
>Absolutely, and I think that computing attack tables at every node is
>inefficient, and I do not do it. Some say bitboards can do that quickly, but I
>have not use for it.

I guess in crafty like rotated bitboards programs that isn't neither the case.
Rotated lookup on the fly when needed...

I decited for a legale move generation approach.

After looking for a repetition but before probing hash i like to have attack
information for some extension/reduction stuff.

Even in qnodes, i like to have some attack information especially near the kings
to look whether i may do some lazy stuff or not...

During the "evolution" of my program from rotated to fill based, things changed
a bit. I probably do a lot for "nothing" - but i do it only once, and i do it
unconditionally and parallel with other tasks. Often with todays super pipelined
processors, performing two or four independent, unconditional instructions
chains doesn't matter so much as long as you have enough registers...

One other example i have in mind with my future 64-bit approach is using pairs
of bitboards to generate white as well as black sliding attacks at once with
128-bit xmm registers.

Gerd

>
>Not sure if you have read my post correctly (or maybe I did a mistake?).
>
>
>
>    Christophe



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.