perft(6) after e4 e5

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Henk
Posts: 5651
Joined: Mon May 27, 2013 8:31 am

perft(6) after e4 e5

Post by Henk » Thu Feb 26, 2015 11:09 am

If I run perft(6) in the position after 1. e4 e5 what should be the correct result ?

[Skipper crashes because of a short castling move after:

1 g4 e5 2 Nf3 Nf6 3 Bg2 Ng4 4 0-0
]

Or is there a website where I can run perft myself.

zullil
Posts: 5434
Joined: Mon Jan 08, 2007 11:31 pm
Location: PA USA
Full name: Louis Zulli

Re: perft(6) after e4 e5

Post by zullil » Thu Feb 26, 2015 11:16 am

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

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

Re: perft(6) after e4 e5

Post by SMIRF » Thu Feb 26, 2015 11:19 am

Code: Select all

XFEN 00: rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2
   +-*--b--c--d--*--f--g--*-+
 8 |[r][n][b][q][k][b][n][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 |   :::   :::   :::   :::|
 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;   &#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><N><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;          29          0      0         0      0    0        0  0.00
 2&#58;         835          8      0         4      0    0        0  0.00
 3&#58;       24825        576      0       284      0    0        0  0.00
 4&#58;      728887      23907      2     10306      1    0        0  0.02
 5&#58;    22273312     998407    420    430046     52    0    19682  0.21
 6&#58;   673070116   36172846  14340  14028981   3418    0   598518  2.36
 7&#58; 21181685531 1359626731 924634 528409498 134777    0 36210043 32.84

Henk
Posts: 5651
Joined: Mon May 27, 2013 8:31 am

Re: perft(6) after e4 e5

Post by Henk » Thu Feb 26, 2015 11:19 am

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.

Henk
Posts: 5651
Joined: Mon May 27, 2013 8:31 am

Re: perft(6) after e4 e5

Post by Henk » Thu Feb 26, 2015 11:23 am

SMIRF wrote:

Code: Select all

XFEN 00&#58; rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2
   +-*--b--c--d--*--f--g--*-+
 8 |&#91;r&#93;&#91;n&#93;&#91;b&#93;&#91;q&#93;&#91;k&#93;&#91;b&#93;&#91;n&#93;&#91;r&#93;|  Compiled on Feb 26 2015
 7 |&#91;p&#93;&#91;p&#93;&#91;p&#93;&#91;p&#93;&#58;&#58;&#58;&#91;p&#93;&#91;p&#93;&#91;p&#93;|  MS Vis.Studio C/C++ 64-Bit Vers. 18.0
 6 |   &#58;&#58;&#58;   &#58;&#58;&#58;   &#58;&#58;&#58;   &#58;&#58;&#58;|
 5 |&#58;&#58;&#58;   &#58;&#58;&#58;   &#91;p&#93;   &#58;&#58;&#58;   |  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;   &#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><N><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;          29          0      0         0      0    0        0  0.00
 2&#58;         835          8      0         4      0    0        0  0.00
 3&#58;       24825        576      0       284      0    0        0  0.00
 4&#58;      728887      23907      2     10306      1    0        0  0.02
 5&#58;    22273312     998407    420    430046     52    0    19682  0.21
 6&#58;   673070116   36172846  14340  14028981   3418    0   598518  2.36
 7&#58; 21181685531 1359626731 924634 528409498 134777    0 36210043 32.84
Enough castling moves so it might be a good test.

zullil
Posts: 5434
Joined: Mon Jan 08, 2007 11:31 pm
Location: PA USA
Full name: Louis Zulli

Re: perft(6) after e4 e5

Post by zullil » Thu Feb 26, 2015 11:25 am

Henk wrote:
SMIRF wrote:

Code: Select all

XFEN 00&#58; rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2
   +-*--b--c--d--*--f--g--*-+
 8 |&#91;r&#93;&#91;n&#93;&#91;b&#93;&#91;q&#93;&#91;k&#93;&#91;b&#93;&#91;n&#93;&#91;r&#93;|  Compiled on Feb 26 2015
 7 |&#91;p&#93;&#91;p&#93;&#91;p&#93;&#91;p&#93;&#58;&#58;&#58;&#91;p&#93;&#91;p&#93;&#91;p&#93;|  MS Vis.Studio C/C++ 64-Bit Vers. 18.0
 6 |   &#58;&#58;&#58;   &#58;&#58;&#58;   &#58;&#58;&#58;   &#58;&#58;&#58;|
 5 |&#58;&#58;&#58;   &#58;&#58;&#58;   &#91;p&#93;   &#58;&#58;&#58;   |  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;   &#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><N><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;          29          0      0         0      0    0        0  0.00
 2&#58;         835          8      0         4      0    0        0  0.00
 3&#58;       24825        576      0       284      0    0        0  0.00
 4&#58;      728887      23907      2     10306      1    0        0  0.02
 5&#58;    22273312     998407    420    430046     52    0    19682  0.21
 6&#58;   673070116   36172846  14340  14028981   3418    0   598518  2.36
 7&#58; 21181685531 1359626731 924634 528409498 134777    0 36210043 32.84
Enough castling moves so it might be a good test.
Is likely irrelevant, but Reinhard's FEN is incorrect. Should be

rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq e6 0 2

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

Re: perft(6) after e4 e5

Post by SMIRF » Thu Feb 26, 2015 11:31 am

zullil wrote:... Is likely irrelevant, but Reinhard's FEN is incorrect. Should be

rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq e6 0 2
As you will have noticed: it is compatible ! XFEN. There only then an e.p. coordinate is set, when an opposite pawn is standing at the side of the double stepped pawn.

zullil
Posts: 5434
Joined: Mon Jan 08, 2007 11:31 pm
Location: PA USA
Full name: Louis Zulli

Re: perft(6) after e4 e5

Post by zullil » Thu Feb 26, 2015 11:35 am

SMIRF wrote:
zullil wrote:... Is likely irrelevant, but Reinhard's FEN is incorrect. Should be

rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq e6 0 2
As you will have noticed: it is compatible ! XFEN. There only then an e.p. coordinate is set, when an opposite pawn is standing at the side of the double stepped pawn.
No, I failed to notice that. Sorry.

http://en.wikipedia.org/wiki/X-FEN#Encoding_en-passant

jorose
Posts: 240
Joined: Thu Jan 22, 2015 2:21 pm
Location: Zurich, Switzerland
Full name: Jonathan Rosenthal

Re: perft(6) after e4 e5

Post by jorose » Thu Feb 26, 2015 11:49 am

If you suspect you have a bug in move generation, I can recommend downloading the latest stockfish version and starting it in a terminal (not in a GUI). Then manually enter the position via UCI protocol and call it's perft function, which is extremely fast. The reason I suggest this is that SF actually offers the functionality of a divide function which means it gives a breakdown of perft (n-1) for each legal move when you call perft (n).

This is what I get for perft 6 after e2e4 e7e5:

Code: Select all

position startpos moves e2e4 e7e5
perft 6

Position&#58; 1/1
a2a3&#58; 21100966
b2b3&#58; 23596663
c2c3&#58; 23416950
d2d3&#58; 25540907
f2f3&#58; 15742641
g2g3&#58; 23364786
h2h3&#58; 20760629
a2a4&#58; 24042446
b2b4&#58; 22001165
c2c4&#58; 20896102
d2d4&#58; 38353660
f2f4&#58; 24044398
g2g4&#58; 20005227
h2h4&#58; 24059746
b1a3&#58; 22001586
b1c3&#58; 24912209
g1e2&#58; 14479984
g1f3&#58; 20419850
g1h3&#58; 21454237
f1e2&#58; 19399143
f1d3&#58; 20878923
f1c4&#58; 26828547
f1b5&#58; 20591524
f1a6&#58; 22471973
d1e2&#58; 22164322
d1f3&#58; 34059395
d1g4&#58; 33583821
d1h5&#58; 27807644
e1e2&#58; 15090672

===========================
Total time &#40;ms&#41; &#58; 4158
Nodes searched  &#58; 673070116
Nodes/second    &#58; 161873524

Henk
Posts: 5651
Joined: Mon May 27, 2013 8:31 am

Re: perft(6) after e4 e5

Post by Henk » Thu Feb 26, 2015 12:04 pm

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.

Post Reply