Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: sliding attacks in three #define

Author: Sune Fischer

Date: 23:46:37 04/09/04

Go up one level in this thread



>>The question is what do you get in return.
>>What you get in return is a piece list which is very easy to work with.
>>You get fast checks for a lot of simple stuff, ie. is the king in the corner
>>could be something like (white_king & (H1|G1|H2|G2)) is there white rooks on
>>7th: (white_rooks & rank7) etc.
>>So a lot of little things are easy.
>
>
>
>Yes I have heard this over and over again but would you believe that in Chess
>Tiger testing for a piece on a corner, on a border (horizontal or vertical), in
>the center, in the two center rows (4 and 5) and in the two center files (e and
>f) is just a single arithmetic operation with no memory reference? I mean I'm
>beating bitboards easily on these ones.

I don't see how you can beat bitboards here, don't you need a loop of some kind,
like:

for (i=0;i<wbishoup_count;i++)
  if (wbishops_square[i] & 0x01)
     ...

Bitboards avoids the loop over the piece lists and the loop over the board.
I don't see how you can void both of those, you need at least one of them AFAIK.

>And I have more examples like these.
>
>I also need only one arithmetic operation to test if I have a passer, advanced
>passer, open files and so on. OK, this is because I update this information in
>make move, and pawn structures hashing make this basically FREE - less than 0.1%
>of execution time. But again, bitboards would not provide any advantage here.

That's true, pawn stuff gets hashed so that's cheap even with no bitboards.

>The useful little things are extremely easy in Chess Tiger as, with much less
>L1/L2 performance hit than with bitboards.
>
>When you think about it, 8 bitboards use as much L1/L2 cache as the whole board
>representation. And a bitboard program needs to handle so many bitboards!...

I think I have a round 100 bitboards as constants and then the lookup table.
It can't fit in L1 but it should almost fit in L2 and I'm hoping the most
frequently used stuff stays in L1.

>Using bitboards for attacks seems to be the most efficient when you want to
>compute all attacks at once.

If you want to compute all attacks to a single square it can be done backwards
with relative ease.
Computing all attacks is not particularly fast I think.

>Unfortunately that's exactly the kind of things I find counter productive. I
>compute an attack of one piece on a given square only when I need it. Most of
>the time I won't need all attacks of all pieces to all squares.

Bitboards allow you to do half attacks along a diagonal or file.
This I use for instance to see if a rook supports a pawn from the right angle.

I have never understood how this can be done without a loop, either over the
piece list or over the board.

>It's almost irrelevant given the little time it takes.
>
>The problem is that bitboards promise very good execution times for complex
>evaluations terms. And that I basically never need to do such complex
>calculations...

I'm sort of headed in the other direction designing wise, I want my eval to
detect more of the complicated stuff.
These are usually the things the search have trouble seeing.

The only question to me is if they are frequent enough to make it worth while,
ie. if a bishop is detected trapped only once every billion nodes it is probably
not worth the trouble even if it is cheap.

>Has a bitboard program ever topped the SSDF list?
>
>Naturally that's not a proof. We are going to be told anyway to wait for 64 bits
>computers to be widely in use.

Yes I think bitboards are just now becomming really interesting with 64 bit
computers. Of course you don't develop a world beater in 1-2 years and no
bitboarder is going to come along for the next 3 years and crush a 15 year old
fritz program. Even if bitboards have an advantage it is not _that_ big of an
advantage of course.

>And you know what? That's not going to change anything. Actually it's going to
>take excessively powerful computers with loads of L1 and L2 cache for bitboard
>programs to catch up. Just to catch up. If they ever catch up.

I have thought about trying something other than bitboards, but I just don't
want to spend a lot of time trying to figure hard mathematical relations on some
awkward non-intuitive board presentation.

With bitboards I don't have to think in hexidecimal, it comes naturally how to
do the masks. This enables me to write a lot of bugfree code fast if needed.

-S.
>    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.