Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Selecting the best board representation (excluding bitboards)

Author: Nicolas Carrasco

Date: 12:56:36 11/10/99

Go up one level in this thread


I don't worry about the unused arrays, I worry that it seems that is a bit
slower than one 64 array with MAILBOX array check. It seems that reading 64 more
ints on the array slows that advantage.

It move generator with mailbox array takes= 1:17

With 0x88 takes= 1:20

It seems that for gen functions is faster with mailbox than eating 64 unuseful
ints.

If you want I can send you a simple code.

Thanks

On November 10, 1999 at 04:12:01, Bas Hamstra wrote:

>Hi,
>
>Don't worry about that 64 unused entries. If you want to be fast you not only
>have to pay attention to fast move generation, but especially to fast capture
>generation and fast attack generation. For all that your 0x88 reprensentation is
>fine.
>
>It is also fine because you can see very fast if a piece (pseudo-) attacks
>another piece, without scanning squares. You can do that by square relationship
>testing and it is very fast.
>
>Just subtract two squares, add an offset and lookup the result in a simple
>array.
>
>
>Regards,
>Bas Hamstra.
>
>
>n November 09, 1999 at 22:29:17, Nicolas Carrasco wrote:
>
>>Dear Guys,
>>
>>I have tryed to build a move generator using a single a array faster than TSCP.
>>(I know how to increase a bit TSCP gen), and it seems that for move-generator is
>>better a pair of arrays, but I guess to know if it is the same or equal speed
>>for an eval function. I know that this depends of how you do that ,but try to
>>answer considering your experince.
>>
>>Maybe a pair of 64 int arrays is slower than a single one for eval functions
>>and/or hashing functions.
>>
>> I am asking you this in order to select the apropiate board representation for
>>a long time before going to bitboards.
>>
>>I also found an interesting board representation that uses this:
>>
>>{      0,   1,   2,   3,   4,   5,   6,   7,
>>  __,  __,  __,  __,  __,  __,  __,  __,
>>  16,  17,  18,  19,  20,  21,  22,  23,
>>  __,  __,  __,  __,  __,  __,  __,  __,
>>  32,  33,  34,  35,  36,  37,  38,  39,
>>     __,  __,  __,  __,  __,  __,  __,  __,
>>  48,  49,  50,  51,  52,  53,  54,  55,
>>     __,  __,  __,  __,  __,  __,  __,  __,
>>  64,  65,  66,  67,  68,  69,  70,  71,
>>     __,  __,  __,  __,  __,  __,  __,  __,
>>  80,  81,  82,  83,  84,  85,  86,  87,
>>     __,  __,  __,  __,  __,  __,  __,  __,
>>  96,  97,  98,  99, 100, 101, 102, 103,
>>     __,  __,  __,  __,  __,  __,  __,  __,
>> 112, 113, 114, 115, 116, 117, 118, 119 } // THE MAP TO CALCULATE THE VECTORS
>>
>>int initial_board[120]=
>>{
>>     BR,  BN,  BB,  BQ,  BK,  BB,  BN,  BR,
>>  __,  __,  __,  __,  __,  __,  __,  __,
>>  BP,  BP,  BP,  BP,  BP,  BP,  BP,  BP,
>>  __,  __,  __,  __,  __,  __,  __,  __,
>>  XX,  XX,  XX,  XX,  XX,  XX,  XX,  XX,
>>     __,  __,  __,  __,  __,  __,  __,  __,
>>  XX,  XX,  XX,  XX,  XX,  XX,  XX,  XX,
>>     __,  __,  __,  __,  __,  __,  __,  __,
>>  XX,  XX,  XX,  XX,  XX,  XX,  XX,  XX,
>>     __,  __,  __,  __,  __,  __,  __,  __,
>>  XX,  XX,  XX,  XX,  XX,  XX,  XX,  XX,
>>     __,  __,  __,  __,  __,  __,  __,  __,
>>  WP,  WP,  WP,  WP,  WP,  WP,  WP,  WP,
>>     __,  __,  __,  __,  __,  __,  __,  __,
>>  WR,  WN,  WB,  WQ,  WK,  WB,  WN,  WR
>>
>>};
>>
>>BP,WP,....,..., are number definitions :)
>>
>>the "__" are elements are not being used.
>>
>>here I skip the mailbox check doing :
>>
>>#define BOARD(z)             ((z&0x88)==0) /* To check if a position z is inside
>>the board */
>>
>>So if I put
>>gen()
>>{
>>    if(BOARD(any_position)) /// I SAVE THE MAILBOX FUNCTION
>>        THIS IS A LEGAL MOVE
>>}
>>
>>The problem that I founded here is that I have to eat 64 unused
>>elements or run an if statement to skip them, and that slows too much.
>>
>>Thanks



This page took 0.21 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.