Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Table-based SEE

Author: Anthony Cozzie

Date: 04:55:21 11/20/03

Go up one level in this thread


On November 19, 2003 at 14:27:59, Tord Romstad wrote:

>On November 19, 2003 at 12:16:52, Anthony Cozzie wrote:
>
>>Zappa uses tables; they are 32KB in size.  What on earth are you doing that
>>makes it several hundred KB?
>
>A slightly simplified description of what I do:
>
>My SEE lookup table is indexed by the piece under attack (in the range 0..5)
>and the entries of the attack tables for both sides (in the range 0..255).
>Hence the total size of the array is 6*256*256=327680 bytes.
>
>From the description on Ed's pages, it looks like he is doing almost exactly
>the same.
>
>How does your 32KB table look, and how do you use it?
>
>Tord

I get rid of the 0-5 index.  It only costs a few ops to put it back.  My code
looks like this:

static zforceinline int see_capture(zpos *p, zmove m)
{
  int mg, dmg;

  mg = mat_gain(p, m);
  dmg = abs_piece_value[m_ptype(m)];

  return int_min(mg, mg - (dmg + see_noncapture(p, m)));
}

see_noncapture says, if I move my piece to this square, what happens.  In range
0 - -Q.  So the defense has two choices: Recapture (second choice) or leave it
alone (first choice).  The mat_gain function is basically "value of piece on
square" except that it also handles promotions.  Right now I am compressing the
table to 4 bit quantities, but I'm about to get rid of that . .

anthony



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.