Perft problems...

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Chris Tatham
Posts: 142
Joined: Wed Mar 08, 2006 7:15 pm
Contact:

Perft problems...

Post by Chris Tatham » Wed Sep 10, 2008 8:44 pm

In an effort to avoid being the perennial 'Mr Irrelevant' I am slowly re-writing Numpty from scratch. I have been testing my movegen with perft and after a lot of work have been able to successfully match up with a sample of positions on Reinhard's site which has been a great resource for me (thanks)

However in testing my castling code (using Sharper as the benchmark) I keep finding problems with the following simple position:

[D]7k/8/8/8/8/8/7P/4K2R w K - 0 1


Here at 7ply Sharper has:

Code: Select all

e1f2 539503
e1d2 537381
e1e2 535628
e1f1 133292
e1d1 201144
e1g1 392254
h1g1 31108
h1f1 282164
h2h3 187316
h2h4 217145
Nodes: 3056935
Moves: 10
and Numpty says:

Code: Select all

perft?? 7
25-36  539503 nodes
25-34  537381 nodes
25-24  201144 nodes
25-26  133292 nodes
25-35  535628 nodes
25-27  392254 nodes
28-27  31108 nodes
28-26  282164 nodes
38-58  217752 nodes
38-48  187845 nodes
Total moves at root = 10
Total node count = 3058071
Time = 6.547852s
Average nodes/sec = 467034
At this depth I keep finding discrepancies with pawn moves (h3 and h4). Nodes match exactly at 6 ply and using divide with reducing depth from 7 ply I get the correct nodes at 5 ply also so it looks a well hidden problem. (I've since tried HG's qperft which seems to provide still different node counts from 5 ply upwards - so perhaps my initial question is what is the correct perft(7) for this position?)

There must be something wrong with my castling code as perft works (v Sharper) in the same position with no castling rights and interestingly also works with castling rights but without the h2 pawn. Yet it fails with a white pawn seemingly anywhere on the second or third rank.

I'm assuming that there must be illegal O-O's in the last ply (I have 1291 O-O at 7 ply - is someone able to confirm the true figure for me?). I was initially labouring under the assumption it might be the rook returning to h1 and then castling (eg h4, Rh3, Rh1 and O-O) but then this error should perhaps manifest itself at an earlier depth (eg Rg1, Rh1 and O-O) (ie 5 ply) and it works with no h2 pawn anyway.

After much effort I still can't see or find the problem but would much appreciate any comparable figures or suggestions from more experienced programmers if I'm missing something glaringly obvious (likely!)

Many thanks for any help.

User avatar
Zach Wegner
Posts: 1922
Joined: Wed Mar 08, 2006 11:51 pm
Location: Earth
Contact:

Re: Perft problems...

Post by Zach Wegner » Wed Sep 10, 2008 9:00 pm

ATM I don't have any move-based counters, but I can confirm Sharper's perfts.

Code: Select all

(zct)1. divide 7
   h3=187316
   h4=217145
  Rf1=282164
  Rg1=31108
  Kd1=201144
  Kf1=133292
  Kd2=537381
  Ke2=535628
  Kf2=539503
  O-O=392254
moves=3056935 time=0.314

User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 5:45 pm
Location: Finland
Contact:

Re: Perft problems...

Post by ilari » Wed Sep 10, 2008 9:13 pm

Did you compare the 6-ply figures after the h3 or h4 moves?

Here's perft(6) after h4:

Fen: 7k/8/8/8/7P/8/8/4K2R b K h3 0 1
h8g8 62641
h8g7 94266
h8h7 60238
Perft(6): 217145 nodes.

Do you get matching results?

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

Re: Perft problems...

Post by sje » Wed Sep 10, 2008 11:17 pm

The new CIL Toolkit says:

Code: Select all

* (setf pos5 (calc-pos-from-str "7k/8/8/8/8/8/7P/4K2R w K - 0 1"))
* (time-emp-cwt pos5 7)
Kd1 201144
Kd2 537381
Ke2 535628
Kf1 133292
Kf2 539503
O-O 392254
Rf1 282164
Rg1 31108
h3 187316
h4 217145
Depth: 0   Unique: 1
Depth: 1   Unique: 10
Depth: 2   Unique: 28
Depth: 3   Unique: 257
Depth: 4   Unique: 667
Depth: 5   Unique: 4916
Depth: 6   Unique: 7588
Total path count for depth seven: 3056935
Descriptive: three million fifty-six thousand nine hundred thirty-five
F/P: 2.485313 MHz / 402.3638 nsec
3056935

trojanfoe

Re: Perft problems...

Post by trojanfoe » Thu Sep 11, 2008 7:05 am

My engine confirms the figures too:

Code: Select all

ucinewgame
position fen 7k/8/8/8/8/8/7P/4K2R w K - 0 1 0 0
test nodedump
+---------------+
|-|.|-|.|-|.|-|k| ply=0
|.|-|.|-|.|-|.|-| flags=WCASTLE_KS
|-|.|-|.|-|.|-|.| ep=0
|.|-|.|-|.|-|.|-| hmclock=0
|-|.|-|.|-|.|-|.|
|.|-|.|-|.|-|.|-|
|-|.|-|.|-|.|-|P|
|.|-|.|-|K|-|.|R|
+---------------+
null

test passed
test divide 7
h3: 187316
h4: 217145
Rf1: 282164
Rg1: 31108
Kd1: 201144
Kf1: 133292
Kd2: 537381
Ke2: 535628
Kf2: 539503
O-O: 392254
Total Nodes=3056935
test passed
You are going through what I went through 2 weeks ago - 2 days to write the movegen and 10 to get the bugs out. Most of my bugs were in the castling code and I would recommend you look at the code that cancels castling rights when the king/rook has been moved or the rook is captured. Having said that I don't think white's castling rights can be cancelled in this position (the black king can't capture the white rook in 7 ply).

I went to the trouble of implementing an EPD test that lets me run a perftsuite with a bespoke 'perftX' opcode. This was taken from the ROCE engine, where the opcode was 'dX'. It's worth effort as it can also be used to process 'am', 'bm', 'pm' and 'pv' opcodes to test the search as well.

Perftsuite.epd:

Code: Select all

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - perft1 20; perft2 400; perft3 8902; perft4 197281; perft5 4865609; perft6 119060324;
r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - perft1 48; perft2 2039; perft3 97862; perft4 4085603; perft5 193690690;
4k3/8/8/8/8/8/8/4K2R w K - perft1 15; perft2 66; perft3 1197; perft4 7059; perft5 133987; perft6 764643;
4k3/8/8/8/8/8/8/R3K3 w Q - perft1 16; perft2 71; perft3 1287; perft4 7626; perft5 145232; perft6 846648;
4k2r/8/8/8/8/8/8/4K3 w k - perft1 5; perft2 75; perft3 459; perft4 8290; perft5 47635; perft6 899442;
r3k3/8/8/8/8/8/8/4K3 w q - perft1 5; perft2 80; perft3 493; perft4 8897; perft5 52710; perft6 1001523;
4k3/8/8/8/8/8/8/R3K2R w KQ - perft1 26; perft2 112; perft3 3189; perft4 17945; perft5 532933; perft6 2788982;
r3k2r/8/8/8/8/8/8/4K3 w kq - perft1 5; perft2 130; perft3 782; perft4 22180; perft5 118882; perft6 3517770;
8/8/8/8/8/8/6k1/4K2R w K - perft1 12; perft2 38; perft3 564; perft4 2219; perft5 37735; perft6 185867;
8/8/8/8/8/8/1k6/R3K3 w Q - perft1 15; perft2 65; perft3 1018; perft4 4573; perft5 80619; perft6 413018;
4k2r/6K1/8/8/8/8/8/8 w k - perft1 3; perft2 32; perft3 134; perft4 2073; perft5 10485; perft6 179869;
r3k3/1K6/8/8/8/8/8/8 w q - perft1 4; perft2 49; perft3 243; perft4 3991; perft5 20780; perft6 367724;
r3k2r/8/8/8/8/8/8/R3K2R w KQkq - perft1 26; perft2 568; perft3 13744; perft4 314346; perft5 7594526; perft6 179862938;
r3k2r/8/8/8/8/8/8/1R2K2R w Kkq - perft1 25; perft2 567; perft3 14095; perft4 328965; perft5 8153719; perft6 195629489;
r3k2r/8/8/8/8/8/8/2R1K2R w Kkq - perft1 25; perft2 548; perft3 13502; perft4 312835; perft5 7736373; perft6 184411439;
r3k2r/8/8/8/8/8/8/R3K1R1 w Qkq - perft1 25; perft2 547; perft3 13579; perft4 316214; perft5 7878456; perft6 189224276;
1r2k2r/8/8/8/8/8/8/R3K2R w KQk - perft1 26; perft2 583; perft3 14252; perft4 334705; perft5 8198901; perft6 198328929;
2r1k2r/8/8/8/8/8/8/R3K2R w KQk - perft1 25; perft2 560; perft3 13592; perft4 317324; perft5 7710115; perft6 185959088;
r3k1r1/8/8/8/8/8/8/R3K2R w KQq - perft1 25; perft2 560; perft3 13607; perft4 320792; perft5 7848606; perft6 190755813;
4k3/8/8/8/8/8/8/4K2R b K - perft1 5; perft2 75; perft3 459; perft4 8290; perft5 47635; perft6 899442;
4k3/8/8/8/8/8/8/R3K3 b Q - perft1 5; perft2 80; perft3 493; perft4 8897; perft5 52710; perft6 1001523;
4k2r/8/8/8/8/8/8/4K3 b k - perft1 15; perft2 66; perft3 1197; perft4 7059; perft5 133987; perft6 764643;
r3k3/8/8/8/8/8/8/4K3 b q - perft1 16; perft2 71; perft3 1287; perft4 7626; perft5 145232; perft6 846648;
4k3/8/8/8/8/8/8/R3K2R b KQ - perft1 5; perft2 130; perft3 782; perft4 22180; perft5 118882; perft6 3517770;
r3k2r/8/8/8/8/8/8/4K3 b kq - perft1 26; perft2 112; perft3 3189; perft4 17945; perft5 532933; perft6 2788982;
8/8/8/8/8/8/6k1/4K2R b K - perft1 3; perft2 32; perft3 134; perft4 2073; perft5 10485; perft6 179869;
8/8/8/8/8/8/1k6/R3K3 b Q - perft1 4; perft2 49; perft3 243; perft4 3991; perft5 20780; perft6 367724;
4k2r/6K1/8/8/8/8/8/8 b k - perft1 12; perft2 38; perft3 564; perft4 2219; perft5 37735; perft6 185867;
r3k3/1K6/8/8/8/8/8/8 b q - perft1 15; perft2 65; perft3 1018; perft4 4573; perft5 80619; perft6 413018;
r3k2r/8/8/8/8/8/8/R3K2R b KQkq - perft1 26; perft2 568; perft3 13744; perft4 314346; perft5 7594526; perft6 179862938;
r3k2r/8/8/8/8/8/8/1R2K2R b Kkq - perft1 26; perft2 583; perft3 14252; perft4 334705; perft5 8198901; perft6 198328929;
r3k2r/8/8/8/8/8/8/2R1K2R b Kkq - perft1 25; perft2 560; perft3 13592; perft4 317324; perft5 7710115; perft6 185959088;
r3k2r/8/8/8/8/8/8/R3K1R1 b Qkq - perft1 25; perft2 560; perft3 13607; perft4 320792; perft5 7848606; perft6 190755813;
1r2k2r/8/8/8/8/8/8/R3K2R b KQk - perft1 25; perft2 567; perft3 14095; perft4 328965; perft5 8153719; perft6 195629489;
2r1k2r/8/8/8/8/8/8/R3K2R b KQk - perft1 25; perft2 548; perft3 13502; perft4 312835; perft5 7736373; perft6 184411439;
r3k1r1/8/8/8/8/8/8/R3K2R b KQq - perft1 25; perft2 547; perft3 13579; perft4 316214; perft5 7878456; perft6 189224276;
8/1n4N1/2k5/8/8/5K2/1N4n1/8 w - - perft1 14; perft2 195; perft3 2760; perft4 38675; perft5 570726; perft6 8107539;
8/1k6/8/5N2/8/4n3/8/2K5 w - - perft1 11; perft2 156; perft3 1636; perft4 20534; perft5 223507; perft6 2594412;
8/8/4k3/3Nn3/3nN3/4K3/8/8 w - - perft1 19; perft2 289; perft3 4442; perft4 73584; perft5 1198299; perft6 19870403;
K7/8/2n5/1n6/8/8/8/k6N w - - perft1 3; perft2 51; perft3 345; perft4 5301; perft5 38348; perft6 588695;
k7/8/2N5/1N6/8/8/8/K6n w - - perft1 17; perft2 54; perft3 835; perft4 5910; perft5 92250; perft6 688780;
8/1n4N1/2k5/8/8/5K2/1N4n1/8 b - - perft1 15; perft2 193; perft3 2816; perft4 40039; perft5 582642; perft6 8503277;
8/1k6/8/5N2/8/4n3/8/2K5 b - - perft1 16; perft2 180; perft3 2290; perft4 24640; perft5 288141; perft6 3147566;
8/8/3K4/3Nn3/3nN3/4k3/8/8 b - - perft1 4; perft2 68; perft3 1118; perft4 16199; perft5 281190; perft6 4405103;
K7/8/2n5/1n6/8/8/8/k6N b - - perft1 17; perft2 54; perft3 835; perft4 5910; perft5 92250; perft6 688780;
k7/8/2N5/1N6/8/8/8/K6n b - - perft1 3; perft2 51; perft3 345; perft4 5301; perft5 38348; perft6 588695;
B6b/8/8/8/2K5/4k3/8/b6B w - - perft1 17; perft2 278; perft3 4607; perft4 76778; perft5 1320507; perft6 22823890;
8/8/1B6/7b/7k/8/2B1b3/7K w - - perft1 21; perft2 316; perft3 5744; perft4 93338; perft5 1713368; perft6 28861171;
k7/B7/1B6/1B6/8/8/8/K6b w - - perft1 21; perft2 144; perft3 3242; perft4 32955; perft5 787524; perft6 7881673;
K7/b7/1b6/1b6/8/8/8/k6B w - - perft1 7; perft2 143; perft3 1416; perft4 31787; perft5 310862; perft6 7382896;
B6b/8/8/8/2K5/5k2/8/b6B b - - perft1 6; perft2 106; perft3 1829; perft4 31151; perft5 530585; perft6 9250746;
8/8/1B6/7b/7k/8/2B1b3/7K b - - perft1 17; perft2 309; perft3 5133; perft4 93603; perft5 1591064; perft6 29027891;
k7/B7/1B6/1B6/8/8/8/K6b b - - perft1 7; perft2 143; perft3 1416; perft4 31787; perft5 310862; perft6 7382896;
K7/b7/1b6/1b6/8/8/8/k6B b - - perft1 21; perft2 144; perft3 3242; perft4 32955; perft5 787524; perft6 7881673;
7k/RR6/8/8/8/8/rr6/7K w - - perft1 19; perft2 275; perft3 5300; perft4 104342; perft5 2161211; perft6 44956585;
R6r/8/8/2K5/5k2/8/8/r6R w - - perft1 36; perft2 1027; perft3 29215; perft4 771461; perft5 20506480; perft6 525169084;
7k/RR6/8/8/8/8/rr6/7K b - - perft1 19; perft2 275; perft3 5300; perft4 104342; perft5 2161211; perft6 44956585;
R6r/8/8/2K5/5k2/8/8/r6R b - - perft1 36; perft2 1027; perft3 29227; perft4 771368; perft5 20521342; perft6 524966748;
6kq/8/8/8/8/8/8/7K w - - perft1 2; perft2 36; perft3 143; perft4 3637; perft5 14893; perft6 391507;
6qk/8/8/8/8/8/8/7K b - - perft1 22; perft2 43; perft3 1015; perft4 4167; perft5 105749; perft6 419369;
6KQ/8/8/8/8/8/8/7k b - - perft1 2; perft2 36; perft3 143; perft4 3637; perft5 14893; perft6 391507;
K7/8/8/3Q4/4q3/8/8/7k w - - perft1 6; perft2 35; perft3 495; perft4 8349; perft5 166741; perft6 3370175;
K7/8/8/3Q4/4q3/8/8/7k b - - perft1 6; perft2 35; perft3 495; perft4 8349; perft5 166741; perft6 3370175;
8/8/8/8/8/K7/P7/k7 w - - perft1 3; perft2 7; perft3 43; perft4 199; perft5 1347; perft6 6249;
8/8/8/8/8/7K/7P/7k w - - perft1 3; perft2 7; perft3 43; perft4 199; perft5 1347; perft6 6249;
K7/p7/k7/8/8/8/8/8 w - - perft1 1; perft2 3; perft3 12; perft4 80; perft5 342; perft6 2343;
7K/7p/7k/8/8/8/8/8 w - - perft1 1; perft2 3; perft3 12; perft4 80; perft5 342; perft6 2343;
8/2k1p3/3pP3/3P2K1/8/8/8/8 w - - perft1 7; perft2 35; perft3 210; perft4 1091; perft5 7028; perft6 34834;
8/8/8/8/8/K7/P7/k7 b - - perft1 1; perft2 3; perft3 12; perft4 80; perft5 342; perft6 2343;
8/8/8/8/8/7K/7P/7k b - - perft1 1; perft2 3; perft3 12; perft4 80; perft5 342; perft6 2343;
K7/p7/k7/8/8/8/8/8 b - - perft1 3; perft2 7; perft3 43; perft4 199; perft5 1347; perft6 6249;
7K/7p/7k/8/8/8/8/8 b - - perft1 3; perft2 7; perft3 43; perft4 199; perft5 1347; perft6 6249;
8/2k1p3/3pP3/3P2K1/8/8/8/8 b - - perft1 5; perft2 35; perft3 182; perft4 1091; perft5 5408; perft6 34822;
8/8/8/8/8/4k3/4P3/4K3 w - - perft1 2; perft2 8; perft3 44; perft4 282; perft5 1814; perft6 11848;
4k3/4p3/4K3/8/8/8/8/8 b - - perft1 2; perft2 8; perft3 44; perft4 282; perft5 1814; perft6 11848;
8/8/7k/7p/7P/7K/8/8 w - - perft1 3; perft2 9; perft3 57; perft4 360; perft5 1969; perft6 10724;
8/8/k7/p7/P7/K7/8/8 w - - perft1 3; perft2 9; perft3 57; perft4 360; perft5 1969; perft6 10724;
8/8/3k4/3p4/3P4/3K4/8/8 w - - perft1 5; perft2 25; perft3 180; perft4 1294; perft5 8296; perft6 53138;
8/3k4/3p4/8/3P4/3K4/8/8 w - - perft1 8; perft2 61; perft3 483; perft4 3213; perft5 23599; perft6 157093;
8/8/3k4/3p4/8/3P4/3K4/8 w - - perft1 8; perft2 61; perft3 411; perft4 3213; perft5 21637; perft6 158065;
k7/8/3p4/8/3P4/8/8/7K w - - perft1 4; perft2 15; perft3 90; perft4 534; perft5 3450; perft6 20960;
8/8/7k/7p/7P/7K/8/8 b - - perft1 3; perft2 9; perft3 57; perft4 360; perft5 1969; perft6 10724;
8/8/k7/p7/P7/K7/8/8 b - - perft1 3; perft2 9; perft3 57; perft4 360; perft5 1969; perft6 10724;
8/8/3k4/3p4/3P4/3K4/8/8 b - - perft1 5; perft2 25; perft3 180; perft4 1294; perft5 8296; perft6 53138;
8/3k4/3p4/8/3P4/3K4/8/8 b - - perft1 8; perft2 61; perft3 411; perft4 3213; perft5 21637; perft6 158065;
8/8/3k4/3p4/8/3P4/3K4/8 b - - perft1 8; perft2 61; perft3 483; perft4 3213; perft5 23599; perft6 157093;
k7/8/3p4/8/3P4/8/8/7K b - - perft1 4; perft2 15; perft3 89; perft4 537; perft5 3309; perft6 21104;
7k/3p4/8/8/3P4/8/8/K7 w - - perft1 4; perft2 19; perft3 117; perft4 720; perft5 4661; perft6 32191;
7k/8/8/3p4/8/8/3P4/K7 w - - perft1 5; perft2 19; perft3 116; perft4 716; perft5 4786; perft6 30980;
k7/8/8/7p/6P1/8/8/K7 w - - perft1 5; perft2 22; perft3 139; perft4 877; perft5 6112; perft6 41874;
k7/8/7p/8/8/6P1/8/K7 w - - perft1 4; perft2 16; perft3 101; perft4 637; perft5 4354; perft6 29679;
k7/8/8/6p1/7P/8/8/K7 w - - perft1 5; perft2 22; perft3 139; perft4 877; perft5 6112; perft6 41874;
k7/8/6p1/8/8/7P/8/K7 w - - perft1 4; perft2 16; perft3 101; perft4 637; perft5 4354; perft6 29679;
k7/8/8/3p4/4p3/8/8/7K w - - perft1 3; perft2 15; perft3 84; perft4 573; perft5 3013; perft6 22886;
k7/8/3p4/8/8/4P3/8/7K w - - perft1 4; perft2 16; perft3 101; perft4 637; perft5 4271; perft6 28662;
7k/3p4/8/8/3P4/8/8/K7 b - - perft1 5; perft2 19; perft3 117; perft4 720; perft5 5014; perft6 32167;
7k/8/8/3p4/8/8/3P4/K7 b - - perft1 4; perft2 19; perft3 117; perft4 712; perft5 4658; perft6 30749;
k7/8/8/7p/6P1/8/8/K7 b - - perft1 5; perft2 22; perft3 139; perft4 877; perft5 6112; perft6 41874;
k7/8/7p/8/8/6P1/8/K7 b - - perft1 4; perft2 16; perft3 101; perft4 637; perft5 4354; perft6 29679;
k7/8/8/6p1/7P/8/8/K7 b - - perft1 5; perft2 22; perft3 139; perft4 877; perft5 6112; perft6 41874;
k7/8/6p1/8/8/7P/8/K7 b - - perft1 4; perft2 16; perft3 101; perft4 637; perft5 4354; perft6 29679;
k7/8/8/3p4/4p3/8/8/7K b - - perft1 5; perft2 15; perft3 102; perft4 569; perft5 4337; perft6 22579;
k7/8/3p4/8/8/4P3/8/7K b - - perft1 4; perft2 16; perft3 101; perft4 637; perft5 4271; perft6 28662;
7k/8/8/p7/1P6/8/8/7K w - - perft1 5; perft2 22; perft3 139; perft4 877; perft5 6112; perft6 41874;
7k/8/p7/8/8/1P6/8/7K w - - perft1 4; perft2 16; perft3 101; perft4 637; perft5 4354; perft6 29679;
7k/8/8/1p6/P7/8/8/7K w - - perft1 5; perft2 22; perft3 139; perft4 877; perft5 6112; perft6 41874;
7k/8/1p6/8/8/P7/8/7K w - - perft1 4; perft2 16; perft3 101; perft4 637; perft5 4354; perft6 29679;
k7/7p/8/8/8/8/6P1/K7 w - - perft1 5; perft2 25; perft3 161; perft4 1035; perft5 7574; perft6 55338;
k7/6p1/8/8/8/8/7P/K7 w - - perft1 5; perft2 25; perft3 161; perft4 1035; perft5 7574; perft6 55338;
3k4/3pp3/8/8/8/8/3PP3/3K4 w - - perft1 7; perft2 49; perft3 378; perft4 2902; perft5 24122; perft6 199002;
7k/8/8/p7/1P6/8/8/7K b - - perft1 5; perft2 22; perft3 139; perft4 877; perft5 6112; perft6 41874;
7k/8/p7/8/8/1P6/8/7K b - - perft1 4; perft2 16; perft3 101; perft4 637; perft5 4354; perft6 29679;
7k/8/8/1p6/P7/8/8/7K b - - perft1 5; perft2 22; perft3 139; perft4 877; perft5 6112; perft6 41874;
7k/8/1p6/8/8/P7/8/7K b - - perft1 4; perft2 16; perft3 101; perft4 637; perft5 4354; perft6 29679;
k7/7p/8/8/8/8/6P1/K7 b - - perft1 5; perft2 25; perft3 161; perft4 1035; perft5 7574; perft6 55338;
k7/6p1/8/8/8/8/7P/K7 b - - perft1 5; perft2 25; perft3 161; perft4 1035; perft5 7574; perft6 55338;
3k4/3pp3/8/8/8/8/3PP3/3K4 b - - perft1 7; perft2 49; perft3 378; perft4 2902; perft5 24122; perft6 199002;
8/Pk6/8/8/8/8/6Kp/8 w - - perft1 11; perft2 97; perft3 887; perft4 8048; perft5 90606; perft6 1030499;
n1n5/1Pk5/8/8/8/8/5Kp1/5N1N w - - perft1 24; perft2 421; perft3 7421; perft4 124608; perft5 2193768; perft6 37665329;
8/PPPk4/8/8/8/8/4Kppp/8 w - - perft1 18; perft2 270; perft3 4699; perft4 79355; perft5 1533145; perft6 28859283;
n1n5/PPPk4/8/8/8/8/4Kppp/5N1N w - - perft1 24; perft2 496; perft3 9483; perft4 182838; perft5 3605103; perft6 71179139;
8/Pk6/8/8/8/8/6Kp/8 b - - perft1 11; perft2 97; perft3 887; perft4 8048; perft5 90606; perft6 1030499;
n1n5/1Pk5/8/8/8/8/5Kp1/5N1N b - - perft1 24; perft2 421; perft3 7421; perft4 124608; perft5 2193768; perft6 37665329;
8/PPPk4/8/8/8/8/4Kppp/8 b - - perft1 18; perft2 270; perft3 4699; perft4 79355; perft5 1533145; perft6 28859283;
n1n5/PPPk4/8/8/8/8/4Kppp/5N1N b - - perft1 24; perft2 496; perft3 9483; perft4 182838; perft5 3605103; perft6 71179139;
Cheers,
Andy

User avatar
hgm
Posts: 24662
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Perft problems...

Post by hgm » Thu Sep 11, 2008 9:13 am

Chris Tatham wrote:(I've since tried HG's qperft which seems to provide still different node counts from 5 ply upwards - so perhaps my initial question is what is the correct perft(7) for this position?)
Are you sure you were using a recent version of qperft? (Some earlier versions, of ~6 months ago, had a FEN reader that messed up the castling rights.) When I try it with the version that is on my website, it does get the same perft(7) as Sharper:

Code: Select all

C:\cygwin\home\perft>perft 7 "7k/8/8/8/8/8/7P/4K2R w K - 0 1"
 - - - - - - - - - - - -
 - - - - - - - - - - - -
 - - . . . . . . . k - -
 - - . . . . . . . . - -
 - - . . . . . . . . - -
 - - . . . . . . . . - -
 - - . . . . . . . . - -
 - - . . . . . . . . - -
 - - . . . . . . . P - -
 - - . . . . K . . R - -
 - - - - - - - - - - - -
 - - - - - - - - - - - -

Quick Perft by H.G. Muller
Perft mode: No hashing, bulk counting in horizon nodes

perft(1)=10 ( 0.000 sec)

perft(2)=28 ( 0.000 sec)

perft(3)=382 ( 0.000 sec)

perft(4)=2019 ( 0.000 sec)

perft(5)=33177 ( 0.010 sec)

perft(6)=165441 ( 0.020 sec)

perft(7)=3056935 ( 0.250 sec)

Chris Tatham
Posts: 142
Joined: Wed Mar 08, 2006 7:15 pm
Contact:

Re: Perft problems...

Post by Chris Tatham » Thu Sep 11, 2008 8:17 pm

Hi Harm-Geert
Are you sure you were using a recent version of qperft? (Some earlier versions, of ~6 months ago, had a FEN reader that messed up the castling rights.) When I try it with the version that is on my website, it does get the same perft(7) as Sharper:
Thanks for responding - this is odd, with qperft I get:
5 ply = 33154
6 ply = 168175
7 ply = 3049317

I downloaded it from your site earlier this week.


Thanks for all the other suggestions and confirmations - I know what I'm aiming for. I will delete the relevant code have a few days away from it. and start again.

Chris Tatham
Posts: 142
Joined: Wed Mar 08, 2006 7:15 pm
Contact:

Re: Perft problems...

Post by Chris Tatham » Thu Sep 11, 2008 8:34 pm

Did you compare the 6-ply figures after the h3 or h4 moves?

Here's perft(6) after h4:

Fen: 7k/8/8/8/7P/8/8/4K2R b K h3 0 1
h8g8 62641
h8g7 94266
h8h7 60238
Perft(6): 217145 nodes.

Do you get matching results?
Thanks Ilari, I did try this and no all are wrong, too many in each case.

Code: Select all

perft?? 6
98-87  94410 nodes
98-88  60326 nodes
98-97  62736 nodes
Total moves at root = 3
Total node count = 217472
Time = 0.4716797s
Average nodes/sec = 461058
but perft(5) after making any of these 3 moves is correct :roll:

User avatar
hgm
Posts: 24662
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Perft problems...

Post by hgm » Thu Sep 11, 2008 8:40 pm

Very odd indeed. :shock: Did you use the source or the executable? I used the executable. Maybe I goofed in uploading the source.

Chris Tatham
Posts: 142
Joined: Wed Mar 08, 2006 7:15 pm
Contact:

Re: Perft problems...

Post by Chris Tatham » Thu Sep 11, 2008 8:48 pm

It was the exe - it must be me I guess, but I've tried it more than once. How do I make a log and I will post the full output?

Post Reply