User Tools

Site Tools


chess:programming:perft

This is an old revision of the document!


Chess - Programming - Perft

Perft does a raw node count, up to some specified depth, by doing a full tree search.

Draws by threefold repetition are ignored.


Perft Values

Start Positition

Perft against normal opening position:

FEN-string: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
DepthNodesCapturesE.p.CastlesPromotionsChecksCheckmatesTotal Nodes
12000000020
2400000000420
38902340001209322
419728115760004698206603
548656098271925800273513475072212
6119060324281200852480080909910828124132536
731959018603320034396 32668081435767
884998978956 9591295579852036
92439530234167 35695709940400191963
1069352859712417 10788546694868790619155
112097651003696806 391476876618031078854669486
1262,854,969,236,701,747 12244485286520168361091858959

DepthChecksSingle Discovered Check OnlyDirect and Discovered ChecksDouble Discovered Checks
100000
200000
31200012
4469800461
5273513470027004
680909910828460798271
7326680814357671628032668081
895912955798520361472150959129557
93569570994040019196355472211035695709940
10107885466948687906191553029007338791078854669486
11391476876618031078854669486117218523935744339147687661803
121224448528652016 8361091858959

Perft Estimates

DepthNodes
131.9810e+18
146.187e+19
152.015e+21
166.507e+22
172.175e+24
187.214e+25
192.462e+27
208.350e+28

NOTE: These estimates are done by randomly pruning the game tree.


Good Test Position

The startposition is not a very good test position as it does not uncover flaws that might still be hidden regarding promotion or castling.

  • Therefore the following position should be a better test.
FEN-string: r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1 
DepthNodesCapturesE.p.CastlesPromotionsChecksCheckmatesTotal Nodes
14880200048
220393511910302087
397862171024531620993199949
4408560375716319291280131517225523434185552
5193690690350434167336549936378392330988730171197876242
68031647685 8229523927

Discover promotion bugs

The following position does not look very realistic but nevertheless helps to uncover promotion bugs.

FEN-string: n1n5/PPPk4/8/8/8/8/4Kppp/5N1N b - - 0 1 
DepthNodesTotal Nodes
12424
2496520
3948310003
4182838192841
536051033797944
67117913974977083

Position 2

FEN-string: 8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - -
DepthNodesCapturesE.p.CastlesPromotionsChecksCheckmatesTotal Nodes
114100020
219114000100
328122092002670
443238334812300168017
567462452051116500529500
61103008394035033325075524524732733
71786336611451903629487401400241279740687

Position 3

FEN-string: r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1

Or mirrored (with the same perft results):

FEN-string: r2q1rk1/pP1p2pp/Q4n2/bbp1p3/Np6/1B3NBn/pPPP1PPP/R3K2R b KQ - 0 1
DepthNodesCapturesE.p.CastlesPromotionsChecksCheckmatesTotal Nodes
1600000
226487064810
3946710214012038
4422333131393077956003215492
515833292204617365120329464200568
6706045033210369132212108820068110298426973664

—-

References

chess/programming/perft.1634029667.txt.gz · Last modified: 2021/10/12 09:07 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki