Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: What is Perft? (quick clarifying question)

Author: Russell Reagan

Date: 21:01:19 01/07/03

Go up one level in this thread


On January 07, 2003 at 23:49:20, Joel wrote:

>Could someone please explain what Perft is, and perhaps what it is useful for?

Perft is a function that computes the number of nodes visited to a given depth.
Another way of thinking of this is the number of games, or paths, that exist to
a given depth. So from the opening position, perft 1 is 20, since there are 20
legal moves at depth 1. Perft 2 is 400 (which is 20 x 20). Basically you are
just counting positions to a given depth.

What this is useful for is determining if your move generation, your make move,
and your unmake move functions are working correctly. For example, if your move
generation function doesn't generate castling moves correctly, you will get an
incorrect perft result. Or if your program didn't generate double pawn moves
(like e2e4) then it would calculate perft 1 incorrectly for the initial
position, and you could see which moves it doesn't generate correctly, and you
could fix the problem. Also it tests your make/unmake functions, because if (for
example) you forgot to replace a captured piece in your unmake move function,
then you would get incorrect perft results, and you could find that bug and fix
it.

Basically it's a way to see if your move generator and make/unmake have any bugs
in them.



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.