Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Compact attacks in Crafty

Author: Russell Reagan

Date: 19:52:27 05/22/03

Go up one level in this thread


On May 22, 2003 at 22:14:42, Robert Hyatt wrote:

>Yes.  The compact attack stuff compresses this quite a bit, so that the
>"endpoints" are not needed in an index (IE there is no need for 8 bit indices
>for an entire rank/file/long diagonal since the endpoints are known already.)

Do you mean, the endpoints are known at compile time to compute a smaller lookup
table, or the endpoints are known at runtime? If at runtime, where is this
information stored?

>This cuts one dimension to 2^6 rather than 2^8, a 3/4 reduction.  It also makes
>use of the fact that doing extra work is much faster than doing memory
>references,
>so that some of the computation is faster than the corresponding table lookups
>would be.

So the compact attacks use around 64 KB (1/4th of 512 KB)? Looking at your code,
it looks more like only about 8 KB.

# if defined(COMPACT_ATTACKS)
    struct at    at;                                       //           1588
    BITBOARD     diag_attack_bitboards[NDIAG_ATTACKS];     // 296 * 8 = 2368
    BITBOARD     anti_diag_attack_bitboards[NDIAG_ATTACKS];// 296 * 8 = 2368
    DIAG_INFO    diag_info[64];                            // 28 * 64 = 1792
                                                           //  #bytes = 8116



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.