Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: perft weirdness

Author: Uri Blass

Date: 02:14:26 01/02/03

Go up one level in this thread


On January 02, 2003 at 05:00:06, Russell Reagan wrote:

>I'm trying to nail down this bug in my move generator. I'm calculating perft for
>positions and verifying them with other perft calculating engines. First I did
>perft with only kings on the board, and things seemed fine. Then I added queens,
>and things seemed fine. Then came the kings and rooks, and things seemed fine
>when castling wasn't involved, but then I tried the following position:
>
>[D]r3k2r/8/8/8/8/8/8/R3K2R w KQkq - 0 1
>
>Things stopped being fine. Other engines I tried got perft(4)=314346, but mine
>gets perft(4)=314340, off by 6 nodes. Since there are *only* 26 legal moves in
>the above position I set out to try each one, calculate perft, and find the
>branch branch (or branches) containing the errors.
>
>The move Rb1 leads to a position that my engine incorrectly calculates perft 3.
>So I had an incorrect perft 4, and I found one branch that has an incorrect
>perft 3, so I'm on the right track (or so I thought). I tried each move from the
>position after Rb1, and to my suprise not one move turned up an incorrect perft
>1 or perft 2, which is what I was expecting.
>
>It seems like this shouldn't happen. Am I missing something? Or is this yet
>another bug?
>
>Russell

I suggest that you ask your program to give you a list of legal moves and
numbers of perft n-1 in the same run that you calculate perft n.

I did it when I was debugging my move generator.

Your program in order to calculate perft 3 need to calculate perft 2 for every
legal move and add the numbers so it can print for you a list of numbers for all
the legal moves in the same run that it calculates perft 3 and you will find
what number is not correct by trying it with other programs.

You may have a bug that is result of do undo and in order to see in what
position it happens you need to calculate perft 2 in the same run that you
calculate perft 3.

Uri



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.