Perft 7 -> 1.6 trillion moves

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Perft 7 -> 1.6 trillion moves

Post by MikeB »

This game

[pgn][Event "HB Global Chess Challenge"]
[Site "Minneapolis, MN USA"]
[Date "2005.05.19"]
[EventDate "2005.05.18"]
[Round "2"]
[Result "1/2-1/2"]
[White "Loal W Davis"]
[Black "Magesh Chandran Panchanathan"]
[ECO "C59"]
[WhiteElo "?"]
[BlackElo "2473"]
[PlyCount "120"]

1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+
c6 7. dxc6 bxc6 8. Be2 h6 9. Nf3 e4 10. Ne5 Bd6 11. f4 exf3
12. Nxf3 O-O 13. d4 Rb8 14. a3 Re8 15. O-O c5 16. Nc3 cxd4
17. Qxd4 Nc6 18. Qh4 Bf5 19. Bd3 Bc5+ 20. Kh1 Bxd3 21. cxd3
Qxd3 22. Bxh6 Rxb2 23. Na4 Rc2 24. Nxc5 Rxc5 25. Bg5 Ne4
26. Bf4 Rc2 27. Ng5 Nxg5 28. Qxg5 Nd4 29. Rfe1 Rce2 30. Rxe2
Qxe2 31. h3 Nc2 32. Rc1 Qe4 33. Bg3 Ne3 34. Bf2 f6 35. Qxe3
Qxe3 36. Bxe3 Rxe3 37. Ra1 a5 38. Ra2 a4 39. Kg1 Kf7 40. Kf2
Rc3 41. Rb2 Rxa3 42. Rb7+ Kg6 43. Ra7 Ra1 44. Kg3 a3 45. Kf2
Kh6 46. Ra5 g6 47. Kg3 Ra2 48. Kf3 f5 49. Ra7 Ra1 50. Kf2 f4
51. Ra8 a2 52. Ra5 f3 53. Kg3 Kg7 54. Ra6 Kf7 55. Kf2 Ke7
56. Kg3 Kd7 57. Kf2 Kc7 58. Ra3 Kb6 59. Ra8 Kc5 60. Rc8+ Kb6
1/2-1/2[/pgn]

after move 23. Na4

[d]4r1k1/p4pp1/2n2n1B/2b5/N6Q/P2q1N2/1r4PP/R4R1K b - - 1 23
has the distinction of most possible moves in a rated game between humans, 79 to be exact according to
Tim Krabbé chess site
using a custom multi-threaded perft version of stockfish, perft 7 for this position equals 1,612,761,451,963 possible moves

go perft 7
a7a6: 25724485992
g7g6: 23360523846
a7a5: 24481458485
g7g5: 17671726160
g7h6: 14967259327
c6b4: 19844766321
c6d4: 18977857396
c6a5: 22363421438
c6e5: 20872320729
c6e7: 17798055165
c6b8: 19979471497
c6d8: 18612629844
f6e4: 20244239317
f6g4: 21079678036
f6d5: 29063835865
f6h5: 26438800449
f6d7: 27481210259
f6h7: 25604198905
c5g1: 24106298732
c5f2: 21329562819
c5a3: 24344154975
c5e3: 20089750437
c5b4: 22846539842
c5d4: 17865945604
c5b6: 22175123060
c5d6: 26913491992
c5e7: 18819535739
c5f8: 22059394770
b2b1: 18537064427
b2a2: 22054289160
b2c2: 21816641345
b2d2: 19775341144
b2e2: 22663202883
b2f2: 20105379478
b2g2: 22626039984
b2b3: 22576128310
b2b4: 24589795775
b2b5: 22019676813
b2b6: 21677667288
b2b7: 24132991495
b2b8: 22073605660
e8e1: 18728089318
e8e2: 21837960028
e8e3: 18818267119
e8e4: 20132952865
e8e5: 23753269631
e8e6: 22945531050
e8e7: 22180130672
e8a8: 20775044016
e8b8: 23474561273
e8c8: 21851127868
e8d8: 23309116861
e8f8: 19482358190
d3b1: 13516567004
d3d1: 16395719009
d3f1: 489045616
d3c2: 18249352216
d3d2: 18833926965
d3e2: 18358059878
d3a3: 17734097294
d3b3: 18954878557
d3c3: 20032367508
d3e3: 17463829328
d3f3: 14653152225
d3c4: 21253983339
d3d4: 17342646043
d3e4: 17907682413
d3b5: 16946491674
d3d5: 21203458584
d3f5: 22270466206
d3a6: 15769503995
d3d6: 19204368642
d3g6: 17064626235
d3d7: 20200728167
d3h7: 15056656391
d3d8: 17075280483
g8h7: 18534748945
g8f8: 20741141562
g8h8: 20456704030

Nodes searched: 1612761451963


Juts for kicks, I also ran the perft 7 after 22.Bxh6
1r2r1k1/p4pp1/2n2n1B/2b5/7Q/P1Nq1N2/1P4PP/R4R1K b - - 0 22
suspecting it would be greater, and it was ... 1.66 trillion
go perft 1 = 70

position fen 1r2r1k1/p4pp1/2n2n1B/2b5/7Q/P1Nq1N2/1P4PP/R4R1K b - - 0 22
go perft 7
a7a6: 29127646412
g7g6: 25843771858
a7a5: 28560153615
g7g5: 20371509427
g7h6: 17796839729
c6b4: 22225907484
c6d4: 21503922721
c6a5: 25780591909
c6e5: 23950019170
c6e7: 19692644021
c6d8: 21809655798
f6e4: 21662635884
f6g4: 23629078999
f6d5: 32074329747
f6h5: 29334285715
f6d7: 29424429212
f6h7: 28288422365
c5g1: 26357161858
c5f2: 25060458792
c5a3: 27893168032
c5e3: 22358283133
c5b4: 22969220146
c5d4: 18998499455
c5b6: 22232560712
c5d6: 28724736966
c5e7: 19614334476
c5f8: 23730310922
b8b2: 33071223186
b8b3: 27411136242
b8b4: 30018939563
b8b5: 28675187678
b8b6: 28662715916
b8b7: 31835417803
b8a8: 23982947209
b8c8: 23421126026
b8d8: 24377273659
e8e1: 25286504575
e8e2: 31981235535
e8e3: 24371667451
e8e4: 25757649632
e8e5: 31188466861
e8e6: 29881431761
e8e7: 28662299235
e8c8: 21953652108
e8d8: 24778812799
e8f8: 21729020371
d3b1: 16883743828
d3d1: 19595564803
d3f1: 526479889
d3c2: 24680495238
d3d2: 24470947574
d3e2: 23412260519
d3c3: 16481431995
d3e3: 19229550593
d3f3: 16896013177
d3c4: 23058719039
d3d4: 19590088065
d3e4: 20318552725
d3b5: 18524234188
d3d5: 24317674437
d3f5: 26034392075
d3a6: 18440072846
d3d6: 21380767814
d3g6: 19728271076
d3d7: 23132526647
d3h7: 17183693388
d3d8: 18504510830
g8h7: 22056171576
g8f8: 23285667613
g8h8: 23887983561

Nodes searched: 1657681099664

and some people wonder why engines seem to get stuck at times...
Image
User avatar
Ajedrecista
Posts: 1966
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: perft(7) -> 1.6 trillion moves.

Post by Ajedrecista »

Hello Mike:

I have computed perft(8) value while I confirmed perft(7) of the first position with gperft 1.1 perft counter. I have also computed the number of unique positions with JetChess 1.0.0.0 perft counter. Here are the results:

Code: Select all

4r1k1/p4pp1/2n2n1B/2b5/N6Q/P2q1N2/1r4PP/R4R1K b - - 1 23

Depth is 8.

----r-k-
p----pp-
--n--n-B
--b-----  b - -
N------Q
P--q-N--
-r----PP
R----R-K

Bxa3       1,086,892,260,213
Qxf1+         18,096,010,767
Qxa3         792,922,098,764
Qxf3         579,185,888,112
Rxg2         949,350,335,634
gxh6         584,698,453,218
Nb8          866,372,882,708
Nd8          805,164,486,196
Ne7          772,220,201,529
Na5          971,086,177,900
Ne5          888,520,755,879
Nb4          864,067,235,410
Nd4          798,884,745,605
Nd7        1,209,959,283,344
Nh7        1,128,279,232,343
Nd5        1,270,960,638,931
Nh5        1,143,665,057,614
Ne4          847,704,425,443
Ng4          869,892,105,231
Bf8          970,745,842,002
Be7          829,521,520,490
Bb6          961,298,969,202
Bd6        1,169,764,558,786
Bb4        1,006,453,053,445
Bd4          754,334,922,310
Be3          849,514,402,325
Bf2          913,021,094,492
Bg1        1,069,495,771,398
Qh7          660,741,124,738
Qa6          694,641,792,309
Qg6          741,950,967,579
Qb5          742,002,012,267
Qf5          963,345,454,071
Qc4          915,445,621,805
Qe4          754,346,004,128
Qc2          786,116,260,427
Qe2          781,017,917,165
Qb1          566,642,107,099
Ra8          906,654,553,773
Reb8       1,023,047,762,987
Rc8          953,835,917,470
Rd8        1,013,100,342,422
Rf8          849,145,927,005
Re7          950,960,243,688
Re6          979,874,183,216
Re5        1,004,830,342,085
Re4          832,309,496,474
Re3          788,839,387,216
Ree2         930,842,774,413
Re1          769,232,661,872
Qd8          754,372,338,383
Qd7          889,222,760,941
Qd6          833,521,109,068
Qd5          914,198,130,703
Qd4          734,811,562,257
Qb3          828,439,034,941
Qc3          870,372,441,824
Qe3          740,175,581,038
Qd2          805,024,113,039
Qd1          690,602,549,695
Rbb8         967,480,514,066
Rb7        1,057,234,574,866
Rb6          945,875,402,379
Rb5          958,350,370,018
Rb4        1,065,613,667,402
Rb3          979,817,632,674
Ra2          961,237,130,116
Rc2          941,145,731,240
Rd2          849,165,637,706
Rbe2         980,614,037,424
Rf2          856,648,165,152
Rb1          765,442,380,167
a6         1,112,660,797,044
g6         1,019,852,471,771
a5         1,058,045,938,053
g5           719,490,108,112
Kf8          892,202,797,270
Kh8          885,696,992,678
Kh7          798,988,079,880
TOTAL     69,457,297,313,407

Code: Select all

4r1k1/p4pp1/2n2n1B/2b5/N6Q/P2q1N2/1r4PP/R4R1K b - - 1 23

positions(1) =         79
positions(2) =      3,319
positions(3) =    124,423
positions(4) =  2,859,642
positions(5) = 64,788,485
I can compute the value of position(6) but I ran out of spare time. In view of partial results at 16 steps of calculation out of 32, the value should be in the range 1.02967e+9 < positions(6) < 1.02969e+9.

Fun fact: perft(8) of this position (69,457,297,313,407) is very similar to Perft(10) of the initial position (69,352,859,712,417). Both values are within 0.15% of difference!

Regards from Spain.

Ajedrecista.
User avatar
Ajedrecista
Posts: 1966
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: perft(7) -> 1.6 trillion moves.

Post by Ajedrecista »

Hello:
Ajedrecista wrote: Mon Apr 12, 2021 9:12 pm[...]

Code: Select all

4r1k1/p4pp1/2n2n1B/2b5/N6Q/P2q1N2/1r4PP/R4R1K b - - 1 23

positions(1) =         79
positions(2) =      3,319
positions(3) =    124,423
positions(4) =  2,859,642
positions(5) = 64,788,485
I can compute the value of position(6) but I ran out of spare time. In view of partial results at 16 steps of calculation out of 32, the value should be in the range 1.02967e+9 < positions(6) < 1.02969e+9.

[...]
I completed the task today: positions(6) = 1,029,681,307. Then:

Code: Select all

4r1k1/p4pp1/2n2n1B/2b5/N6Q/P2q1N2/1r4PP/R4R1K b - - 1 23

positions(1) =            79
positions(2) =         3,319
positions(3) =       124,423
positions(4) =     2,859,642
positions(5) =    64,788,485
positions(6) = 1,029,681,307
Regards from Spain.

Ajedrecista.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: perft(7) -> 1.6 trillion moves.

Post by MikeB »

Ajedrecista wrote: Mon Apr 12, 2021 9:12 pm Hello Mike:

I have computed perft(8) value while I confirmed perft(7) of the first position with gperft 1.1 perft counter. I have also computed the number of unique positions with JetChess 1.0.0.0 perft counter. Here are the results:

Code: Select all

4r1k1/p4pp1/2n2n1B/2b5/N6Q/P2q1N2/1r4PP/R4R1K b - - 1 23

Depth is 8.

----r-k-
p----pp-
--n--n-B
--b-----  b - -
N------Q
P--q-N--
-r----PP
R----R-K

Bxa3       1,086,892,260,213
Qxf1+         18,096,010,767
Qxa3         792,922,098,764
Qxf3         579,185,888,112
Rxg2         949,350,335,634
gxh6         584,698,453,218
Nb8          866,372,882,708
Nd8          805,164,486,196
Ne7          772,220,201,529
Na5          971,086,177,900
Ne5          888,520,755,879
Nb4          864,067,235,410
Nd4          798,884,745,605
Nd7        1,209,959,283,344
Nh7        1,128,279,232,343
Nd5        1,270,960,638,931
Nh5        1,143,665,057,614
Ne4          847,704,425,443
Ng4          869,892,105,231
Bf8          970,745,842,002
Be7          829,521,520,490
Bb6          961,298,969,202
Bd6        1,169,764,558,786
Bb4        1,006,453,053,445
Bd4          754,334,922,310
Be3          849,514,402,325
Bf2          913,021,094,492
Bg1        1,069,495,771,398
Qh7          660,741,124,738
Qa6          694,641,792,309
Qg6          741,950,967,579
Qb5          742,002,012,267
Qf5          963,345,454,071
Qc4          915,445,621,805
Qe4          754,346,004,128
Qc2          786,116,260,427
Qe2          781,017,917,165
Qb1          566,642,107,099
Ra8          906,654,553,773
Reb8       1,023,047,762,987
Rc8          953,835,917,470
Rd8        1,013,100,342,422
Rf8          849,145,927,005
Re7          950,960,243,688
Re6          979,874,183,216
Re5        1,004,830,342,085
Re4          832,309,496,474
Re3          788,839,387,216
Ree2         930,842,774,413
Re1          769,232,661,872
Qd8          754,372,338,383
Qd7          889,222,760,941
Qd6          833,521,109,068
Qd5          914,198,130,703
Qd4          734,811,562,257
Qb3          828,439,034,941
Qc3          870,372,441,824
Qe3          740,175,581,038
Qd2          805,024,113,039
Qd1          690,602,549,695
Rbb8         967,480,514,066
Rb7        1,057,234,574,866
Rb6          945,875,402,379
Rb5          958,350,370,018
Rb4        1,065,613,667,402
Rb3          979,817,632,674
Ra2          961,237,130,116
Rc2          941,145,731,240
Rd2          849,165,637,706
Rbe2         980,614,037,424
Rf2          856,648,165,152
Rb1          765,442,380,167
a6         1,112,660,797,044
g6         1,019,852,471,771
a5         1,058,045,938,053
g5           719,490,108,112
Kf8          892,202,797,270
Kh8          885,696,992,678
Kh7          798,988,079,880
TOTAL     69,457,297,313,407

Code: Select all

4r1k1/p4pp1/2n2n1B/2b5/N6Q/P2q1N2/1r4PP/R4R1K b - - 1 23

positions(1) =         79
positions(2) =      3,319
positions(3) =    124,423
positions(4) =  2,859,642
positions(5) = 64,788,485
I can compute the value of position(6) but I ran out of spare time. In view of partial results at 16 steps of calculation out of 32, the value should be in the range 1.02967e+9 < positions(6) < 1.02969e+9.

Fun fact: perft(8) of this position (69,457,297,313,407) is very similar to Perft(10) of the initial position (69,352,859,712,417). Both values are within 0.15% of difference!

Regards from Spain.

Ajedrecista.
Thanks for sharing Ajedrecista.
Image