Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: 0x88 compared to rot BB

Author: Dieter Buerssner

Date: 07:06:19 01/13/03

Go up one level in this thread


On January 13, 2003 at 09:01:55, Bas Hamstra wrote:

>Sorted piecelist, yes, updated via make/unmake. The cost of this feature is that
>I went from about 5M make/unmakes a second to 4M. The idea is to generate
>captures at MVV/LVA order in the qsearch one at a time, in which case a sorted
>piecelist is more or less needed. This, I hoped, would give an even higher nps.
>With an unsorted piecelist, you would be forced to generate/sort all captures.
>Your opinion?

I can't know, really. But I see the idea. OTOH, selecting the best (in the sense
of MVV/LVA order) move at qsearch time might not be to costy, either.

When I sent my first reply, I did not recognize, that you sorted the piece list.
In this case, I woul think, that having pawn outside the loop should be faster
most of the time, because typically, you will get an early break in the loop.

With clever defining of pieces, the extra branch (for the early break condition)
would come at little cost.

For example:

#define pawn 1
#define knight 2
#define bishop 4
#define rook 8
#define queen 16
#define king 32

The color bit could be 64. Then test for non sweeping pieces would be as easy as

  if (piece & (knight|king|pawn))

When you end your piece list with (say) 127, and have a "zero piece" at
board[127], the loop could be something like

  int *piecelistp = piecelist[color];

  while (1)
  {
    from = *pieclistp++;
    piece = board[from] & 63; /* piece must be signed, or a cast needed later */
    if (piece-1 <= 0) /* catches end of list and pawn */
      return 0;
    if (pseudo_attack_table[127+to-from] & piece) /* No shift needed anymore */
    {
      /* if (piece & (knight|king)) return 1; */
      d = dir[127+to-from];
      do
      {
        from += d;
        if (from == to)
          return 1;
      }
      while (!board[from]);
  }

Totally untested, just an idea. I hope no serious flaws in it.

Regards,
Dieter



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.