perft(6) after e4 e5

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
SMIRF
Posts: 91
Joined: Wed Mar 26, 2014 4:29 pm
Location: Buettelborn/Hessen/Germany

Re: perft(6) after e4 e5

Post by SMIRF »

Henk wrote:Perft 5 and 6 both did not fail. So I have to look further. Skipper crashed when taking back rook on f1 and it said that the square is not occupied.

Code: Select all

XFEN 00: rnbqkb1r/pppp1ppp/5n2/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq - 2 3
   +-*--b--c--d--*--f--g--*-+
 8 |[r][n][b][q][k][b]   [r]|  Compiled on Feb 26 2015
 7 |[p][p][p][p]:::[p][p][p]|  MS Vis.Studio C/C++ 64-Bit Vers. 18.0
 6 |   :::   :::   [n]   :::|
 5 |:::   :::   [p]   :::   |  Break, when time >= 5.0 sec
 4 |   &#58;&#58;&#58;   &#58;&#58;&#58;<P>&#58;&#58;&#58;   &#58;&#58;&#58;|
 3 |&#58;&#58;&#58;   &#58;&#58;&#58;   &#58;&#58;&#58;<N>&#58;&#58;&#58;   |  &#40;run with 4-fold TT hashing&#41;
 2 |<P><P><P><P>   <P><P><P>|
 1 |<R><N><B><Q><K><B>&#58;&#58;&#58;<R>|
&#40;w&#41;+-*--b--c--d--*--f--g--*-+

Ply       Moves    all &#91;x&#93;   &#91;ep&#93;   all &#91;+&#93;   &#91;++&#93; Prom      Cstl  Time
 1&#58;          27          1      0         0      0    0         0  0.00
 2&#58;         725         35      0         2      0    0         0  0.00
 3&#58;       20991       1039      0       103      0    0       131  0.00
 4&#58;      603843      36372      2      4112      1    0      3731  0.02
 5&#58;    18365789    1176186    278    183251     49    0    149724  0.19
 6&#58;   554585049   40955633   9898   6433683   3225    0   4457978  2.14
 7&#58; 17542590161 1376643633 586854 263183202 235307    0 147009650 31.48
jorose
Posts: 358
Joined: Thu Jan 22, 2015 3:21 pm
Location: Zurich, Switzerland
Full name: Jonathan Rosenthal

Re: perft(6) after e4 e5

Post by jorose »

Could you give the us the PGN of the game that failed? This evening I'll likely have time to run some perft tests that might prove useful for you.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: perft(6) after e4 e5

Post by Henk »

Probably it has already been solved now.

[
But I'm not sure yet, for I don't understand. There were probably more than one positions created somehow or I assigned the wrong position to a new game, when playing a match.

All strange. I just don't know. But my last changes had to do with assigning positions to a robot chess player.
]

The strangest thing was that (almost) only castling moves went wrong. Both long and short castling for both colors.
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: perft(6) after e4 e5

Post by Daniel Anulliero »

Henk wrote:
zullil wrote:
Henk wrote:If I run perft(6) in the position after 1. e4 e5 what should be the correct result ?
My move generator says

Leaf nodes = 673070116
Time taken = 15043 ms

ok. Thank you. Only 15 seconds ? Perft of skipper uses 13 minutes. But I have to rerun it and compare for I did not add an assertion in the test.
13 minutes ? :shock:
My move generator who's not very fast, took 1'28 ..
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: perft(6) after e4 e5

Post by Sven »

Henk wrote:Perft of skipper uses 13 minutes.
To increase your productivity you can try the bulk counting method. You don't need to make/unmake all moves of the last ply, just count the number of legal moves there. For that purpose you will need to make/unmake only few moves: check evasions, king moves including castling moves, moves of pinned pieces, and e.p. captures (further optimizations are certainly possible even in this area but you will already see a major speedup without them). All other moves are legal, unless you are doing something very unusual.
User avatar
Ajedrecista
Posts: 1966
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: Perft(6) after e4, e5.

Post by Ajedrecista »

Hello Henk:

I am a bit late into the thread but I suggest JetChess as an easy-to-use perft counter. It is single core, 32-bit but very fast (around 3 seconds for perft(6) of e4, e5 in my PC of year 2006). Here are some perft values after e4, e5 given by JetChess:

Code: Select all

After e4, e5&#58;

perft&#40;1&#41; =              29
perft&#40;2&#41; =             835
perft&#40;3&#41; =          24,825
perft&#40;4&#41; =         728,887
perft&#40;5&#41; =      22,273,312
perft&#40;6&#41; =     673,070,116
perft&#40;7&#41; =  21,181,685,531
perft&#40;8&#41; = 659,888,498,841 &#40;it took a bit more than 11 minutes in my PC&#41;.
The results are given in divide mode, that is, for example in the initial position you get the subresults for each of the 20 first possible moves.

You can get more perft(n) values for e4, e5 here. Just copying and pasting:

Code: Select all

After e4, e5&#58;

 perft&#40;8&#41; =        659,888,498,841 &#40;it was confirmed by JetChess&#41;.
 perft&#40;9&#41; =     21,340,630,672,894
perft&#40;10&#41; =    683,912,587,436,650
perft&#40;11&#41; = 22,653,878,988,011,879
I know that these numbers are too large for testing, but I think that JetChess could be useful as a second opinion in your development stage.

Bonus: I write the number of unique positions after e4, e5 for some plies:

Code: Select all

After e4, e5&#58;

positions&#40;1&#41; =         29
positions&#40;2&#41; =        835
positions&#40;3&#41; =     14,337
positions&#40;4&#41; =    243,841
positions&#40;5&#41; =  3,146,774
positions&#40;6&#41; = 40,428,608 &#40;it took a bit more than a minute in my PC&#41;.
I hope no typos.

Regards from Spain.

Ajedrecista.