Perft 12 in progress

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Re: Perft 12 in progress

Post by sje »

FlavusSnow wrote:What software do you run for this?
It's the C+ version of my general purpose chess program Symbolic.
FlavusSnow
Posts: 89
Joined: Thu Apr 01, 2010 5:28 am
Location: Omaha, NE

Re: Perft 12 in progress

Post by FlavusSnow »

How many nodes per second do you get?

I tried calculating it from some of your previous posts, but I'm guessing your output is centiseconds or maybe something else?
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Perft 12 in progress

Post by sje »

FlavusSnow wrote:How many nodes per second do you get?

I tried calculating it from some of your previous posts, but I'm guessing your output is centiseconds or maybe something else?
The output is in seconds and in Hertz. The runs included two core and four core machines. Transposition tables and other techniques are used, so the timing data is not for real nodes per second.

The new CIL toolkit manages only about 6,000 nodes per second in analysis! The node count will go down as hopefully the quality of the analysis goes up.

WAC 82:
[D]3rr1k1/pp3pp1/4b3/8/2P1B2R/6QP/P3q1P1/5R1K w - - 0 1

Code: Select all

* (simpleton (string->pos "3rr1k1/pp3pp1/4b3/8/2P1B2R/6QP/P3q1P1/5R1K w - - 0 1"))

[si] Starting iteration one
[pv] 1 Ra1 Bxc4 2 Bxb7   score: -0.074
[pv] 1 Rc1 Qxa2 2 Bxb7   score: +0.200
[pv] 1 Bh7+ Kf8 2 Rb1 Qxa2 3 Rxb7   score: +0.230
[si] Starting iteration two
[pv] 1 Bh7+ Kf8 2 Qa3+ Re7 3 Rb1   score: +0.170
[si] Starting iteration three
[pv] 1 Bh7+ Kf8 2 Rf2 Qe1+ 3 Kh2 f5   score: +0.016
[pv] 1 Qf4 Re7 2 Bh7+ Kf8 3 a4   score: +0.022
[pv] 1 Re1 Qxa2 2 Bxb7   score: +0.260
[si] Starting iteration four
[pv] 1 Re1 Qxa2 2 c5 Re7   score: -0.856
[pv] 1 Bh7+ Kf8 2 Qa3+ Re7 3 Bd3 Qxf1+ 4 Bxf1 b6   score: +3.566
[si] Starting iteration five
[pv] 1 Bh7+ Kf8 2 Qa3+ Re7 3 Bd3 Qxf1+ 4 Bxf1 f6 5 Qxa7   score: +4.528
[si] Starting iteration six
[pv] 1 Bh7+ Kf8 2 Qa3+ Re7 3 Bd3 Qxf1+ 4 Bxf1 f5 5 Rh8+ Bg8 6 Rxg8+ Kxg8 7 Qxe7   score: +6.946
[si] Starting iteration seven
[pv] 1 Bh7+ Kf8 2 Qa3+ Re7 3 Bd3 Qxf1+ 4 Bxf1 f5 5 Rh8+ Bg8 6 Rxg8+ Kxg8 7 Qxe7 Rd2 8 Qxb7 Rxa2   score: +6.976
[si] Starting iteration eight

[st] Interrupted   Elapsed: 000.01:53:14.657
[+6.976/16/6794.657/46,356,911/0] 1 Bh7+ Kf8 2 Qa3+ Re7 3 Bd3 Qxf1+ 4 Bxf1 f5 5 Rh8+ Bg8 6 Rxg8+ Kxg8 7 Qxe7 Rd2 8 Qxb7 Rxa2
FlavusSnow
Posts: 89
Joined: Thu Apr 01, 2010 5:28 am
Location: Omaha, NE

Re: Perft 12 in progress

Post by FlavusSnow »

Oliver Brausch has created some very fast perft code:

http://home.arcor.de/dreamlike/chess/

Downsides are that it appears to only be capable of using one thread. The good part is that it gets more than 100,000 knps (thats 100,000,000 nodes per second) in 32-bit, and 200,000 knps with 64-bit. I used it to verify perft 8 in a matter of minutes.

If you're going to sit there and watch a screen run numbers, may as well do it as efficiently as possible.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Perft 12 in progress

Post by sje »

The reason that Symbolic has a movepath enumerator is not for generating perft values, but to help verify the generate/execute/retract code of the regular searcher. Therefore, the enumerator has no special code of its own for most of its work. Only one concession is made to the enumerator; the transposition table now uses 128 bit hash values to avoid false positives as is required for long running enumerations.

The new CIL Toolkit has five different enumerators, each of which tests different portions of the rest of the code. One of them even shows a little chessboard movie as it does the counting! The toolkit has a parameter to set the bit length of the Zobrist codes from one to whatever and is currently set at 116 bits for obscure reasons. I've even tried 1,000+ bit codes just to see if it works (it does). However, it is pointless to go above the number of bits needed to represent a board position explicitly, around 256 bits for an easy mapping.

At this time, the perft 12 project is working on the perft 11 values for d4 e4 g4 and h3. The count for h4 hasn't yet started.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Perft 12 in progress

Post by Don »

What if the power goes off in the middle of the calculation?

Is your perft designed to be able to checkpoint from time to time to store intermediate results? Or I suppose if you save and restore the hash table you will get most of it back in short time?

Just curious.
sje wrote:For the record, there has already been a claim to the calculation of Perft(12) for the initial chess array. It appeared in this forum back in October 2006 and is referenced at:

http://wismuth.com/chess/perft12.txt

Paul Byrne reported his value of 62,854,969,236,701,747 which took a few months of elapsed time. I have been unable to locate any earlier claim, and more importantly, I can't find any verification either. The lack of verification is the main reason for my decision to give it a try myself and is also why I'll provide all twenty ply 1 subtotals along with 20 ply 2 sub-subtotals for each ply 1 subtotal. These numbers will better allow others to verify my attempt.

Example:

Perft([Na3], 11) = 2,101,612,201,748,156

To build the above, the 20 Perft([Na3 x], 10) subtotals are:

Na6 70,164,254,747,876
Nc6 91,710,661,510,033
Nf6 90,221,933,390,595
Nh6 71,156,085,799,766
a5 87,112,726,457,222
a6 61,211,806,080,331
b5 80,265,837,110,112
b6 79,486,175,018,475
c5 101,956,640,896,317
c6 92,057,453,487,994
d5 213,782,760,833,766
d6 152,569,571,614,918
e5 245,413,911,922,747
e6 240,156,512,798,893
f5 68,386,284,663,519
f6 51,715,576,377,483
g5 74,156,576,416,427
g6 82,992,220,161,143
h5 86,892,547,773,711
h6 60,202,664,686,828
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Perft 12 in progress

Post by sje »

Don wrote:What if the power goes off in the middle of the calculation?

Is your perft designed to be able to checkpoint from time to time to store intermediate results? Or I suppose if you save and restore the hash table you will get most of it back in short time?
Having a dump/restore on the transposition table would certainly help, but as this is a one-time calculation I didn't implement the option. Also, the partial sums for positions near the root are kept in a shared access tree and that would have to be saved as well. But this tree is loaded with pointers and so there's another complication for externalization.

If I ever try perft(13), I'll reconsider the dump/restore option.

What I need is an extension cord. A long one that can reach up north to Quebec where the electricity is cheaper and more reliable.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Perft(11) after 1 h3

Post by sje »

Code: Select all

[] df (h3)
rnbqkbnr/pppppppp/8/8/8/7P/PPPPPPP1/RNBQKBNR b KQkq - 0 1
[] emptran 11
Na6 60,389,141,405,493
Nh6 61,683,534,767,995
Nf6 77,905,651,056,649
Nc6 78,822,140,279,150
a6 52,087,178,055,127
b5 69,179,094,948,589
b6 68,415,649,134,749
a5 73,260,246,530,057
c5 89,188,732,306,415
c6 79,320,966,034,808
d6 135,235,518,693,219
f5 58,792,545,262,990
f6 44,542,035,614,681
d5 187,657,849,896,090
g5 64,950,608,413,048
g6 71,309,420,808,506
h6 51,746,258,222,500
h5 73,770,742,953,023
e5 210,306,401,043,510
e6 205,704,463,106,172
Depth: 11   Count: 1,814,268,178,532,771   Elapsed: 211051  (8.59636e+09 Hz / 1.16328e-10 s)
16 down, 4 to go. [d4 e4 g4 h4]

Sum (16/20): 44,426,048,212,058,007
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Summary of results to date

Post by sje »

Summary of results to date (perft 11 subtotals):

Code: Select all

Na3 2,101,612,201,748,156
Nc3 2,731,501,636,365,779
Nf3 2,704,348,041,301,604
Nh3 2,133,059,306,892,947
a3 1,825,396,176,881,632
a4 2,572,564,331,526,038
b3 2,407,514,849,528,875
b4 2,412,357,918,298,534
c3 2,751,675,948,507,059
c4 3,119,892,147,087,203
d3 4,588,998,634,450,632
d4
e3 7,160,631,171,539,800
e4
f3 1,552,858,858,446,419
f4 2,050,768,802,609,121 
g3 2,498,600,008,341,437
g4
h3 1,814,268,178,532,771
h4
About another week to go.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Perft(11) after 1 g4

Post by sje »

Code: Select all

[] df (g4)
rnbqkbnr/pppppppp/8/8/6P1/8/PPPPPP1P/RNBQKBNR b KQkq - 0 1
[] emptran 11
Na6 74,346,372,601,899
Nh6 75,580,283,395,814
Nf6 95,315,387,917,771
Nc6 96,254,120,986,842
a6 63,697,273,450,084
b5 86,962,955,421,099
a5 90,104,255,390,618
b6 85,308,570,329,092
c5 110,810,246,314,544
c6 97,084,855,329,079
d6 149,951,425,522,576
f5 93,412,836,657,688
d5 207,321,791,906,722
f6 57,917,277,183,035
g5 60,888,120,438,021
g6 86,449,817,897,748
h5 117,982,667,976,545
h6 65,309,272,482,273
e5 253,853,503,244,365
e6 249,211,708,642,782
Depth: 11   Count: 2,217,762,743,088,597   Elapsed: 292931  (7.57093e+09 Hz / 1.32084e-10 s)
17 down, 3 to go. [d4 e4 h4]

Sum (17/20): 46,643,810,955,146,604