Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: perft weirdness - getting weirder

Author: Andreas Stabel

Date: 00:34:45 01/03/03

Go up one level in this thread


On January 02, 2003 at 21:48:22, Robert Hyatt wrote:

>On January 02, 2003 at 15:51:30, Russell Reagan wrote:
>
>>[D]r3k2r/8/8/8/8/8/8/1R2K2R b Kkq - 0 1
>>
>>In the above position, I calculate perft 3:
>>
>>> perft 3
>>26      0
>>583     0
>>14251   0.032
>>total time: 0.032
>>
>>Other engines say that perft 3 is 14252, so I assume that I am wrong here and I
>>went looking for the position where the error is. I wrote a function to tell me
>>preft (n-1) for each of the legal moves so I can tell which branch the error is
>>in, and I continue to narrow it down until I find the offending position. This
>>has worked well so far, but now I'm getting this:
>>
>>> dperft 3
>>h8h1    87      87
>>a8a1    356     443
>>a8a2    544     987
>>a8a3    631     1618
>>a8a4    631     2249
>>a8a5    631     2880
>>a8a6    631     3511
>>a8a7    631     4142
>>a8b8    524     4666
>>a8c8    559     5225
>>a8d8    488     5713
>>h8h2    428     6141
>>h8h3    547     6688
>>h8h4    575     7263
>>h8h5    602     7865
>>h8h6    628     8493
>>h8h7    650     9143
>>h8f8    490     9633
>>h8g8    560     10193
>>e8d7    720     10913
>>e8e7    742     11655
>>e8f7    692     12347
>>e8d8    510     12857
>>e8f8    490     13347
>>e8g8    474     13821
>>e8c8    431     14252
>>
>>This function reports perft n-1 for each move, and keeps a running total on the
>>right. The last number in the right column is, to my suprise, 14252, which is
>>the correct perft 3.
>>
>>So when I calculate perft 3, it is incorrect, but when I ask it to give me a
>>breakdown of perft 2 for each move, the sum (which should be the same as what I
>>am getting for perft 3) is suddenly correct.
>>
>>Any idea what this could mean? I'm stumped...
>
>Here are a couple of things to check.  I've seen them all, and done most of
>them myself.  :)
>
>(1) for castling, the king can not pass over a square that is under attack by
>the opponent.  IE for kingside castling for white, the squares g1 and f1 must
>not be attacked.  h1 can be attacked with no effect on castling.
>
>(2) for castling queenside, watch b1.  It _can_ be attacked with no problem
>as the king doesn't pass over it.  Only d1 and c1 must be free of attack and
>this is an easy mistake to make.  I did it in an early crafty, and would not
>castle if b1 was attacked.
>
>(3) make certain that once you castle, you do not castle again deeper in the
>tree.  :)  This is also an easy mistake to make.
>
>(4) make certain that if a rook moves, castling to _that_ side is prevented,
>although castling the other way is still ok.
>
>(5) make certain that if the king moves, no castling can happen at all below
>that point.
>
>I'd bet one of those is your problem...

(6) If a rook is taken, then no castling is possible to that side.

I had some strange results before I discovered this one :)

Regards
Andreas Stabel



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.