kiwipete perft position

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

kiwipete perft position

Post by Henk »

[d] r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1

In this position perft 4 should be 4085603. But Skipper computes 4074224.

Is 4085603 correct ?
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: kiwipete perft position

Post by hgm »

Code: Select all

C:\cygwin\home\perft>perft 6 "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/
R3K2R w KQkq - 0 1"
 - - - - - - - - - - - -
 - - - - - - - - - - - -
 - - r . . . k . . r - -
 - - p . p p q p b . - -
 - - b n . . p n p . - -
 - - . . . P N . . . - -
 - - . p . . P . . . - -
 - - . . N . . Q . p - -
 - - P P P B B P P P - -
 - - R . . . K . . R - -
 - - - - - - - - - - - -
 - - - - - - - - - - - -

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

perft( 1)=           48 ( 0.000 sec)
perft( 2)=         2039 ( 0.000 sec)
perft( 3)=        97862 ( 0.000 sec)
perft( 4)=      4085603 ( 0.047 sec)
perft( 5)=    193690690 ( 1.719 sec)
perft( 6)=   8031647685 (78.644 sec)
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: kiwipete perft position

Post by Henk »

Ok. Trouble. Perhaps promotions or castling rights ?

I think I have to test this one first.

[d] n1n5/PPPk4/8/8/8/8/4Kppp/5N1N b - - 0 1
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: kiwipete perft position

Post by hgm »

Code: Select all

C:\cygwin\home\perft>perft 6 "n1n5/PPPk4/8/8/8/8/4Kppp/5N1N b - - 0 1"
 - - - - - - - - - - - -
 - - - - - - - - - - - -
 - - n . n . . . . . - -
 - - P P P k . . . . - -
 - - . . . . . . . . - -
 - - . . . . . . . . - -
 - - . . . . . . . . - -
 - - . . . . . . . . - -
 - - . . . . K p p p - -
 - - . . . . . N . N - -
 - - - - - - - - - - - -
 - - - - - - - - - - - -

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

perft( 1)=           24 ( 0.000 sec)
perft( 2)=          496 ( 0.000 sec)
perft( 3)=         9483 ( 0.001 sec)
perft( 4)=       182838 ( 0.004 sec)
perft( 5)=      3605103 ( 0.080 sec)
perft( 6)=     71179139 ( 1.570 sec)
KiwiPete:

Code: Select all

2. e1g1 moves =      86975 ( 0.000 sec)
2. e1c1 moves =      79803 ( 0.000 sec)
2. g2h3 moves =      82759 ( 0.000 sec)
2. g2g3 moves =      77468 ( 0.000 sec)
2. g2g4 moves =      75677 ( 0.000 sec)
2. b2b3 moves =      81066 ( 0.000 sec)
2. a2a3 moves =      94405 ( 0.015 sec)
2. a2a4 moves =      90978 ( 0.000 sec)
2. d5e6 moves =      97464 ( 0.000 sec)
2. d5d6 moves =      79551 ( 0.000 sec)
2. c3a4 moves =      91447 ( 0.000 sec)
2. c3b5 moves =      81498 ( 0.000 sec)
2. c3d1 moves =      84782 ( 0.000 sec)
2. c3b1 moves =      84773 ( 0.000 sec)
2. e5c6 moves =      83885 ( 0.000 sec)
2. e5d7 moves =      93913 ( 0.000 sec)
2. e5f7 moves =      88799 ( 0.000 sec)
2. e5g6 moves =      83866 ( 0.000 sec)
2. e5g4 moves =      79912 ( 0.016 sec)
2. e5d3 moves =      77431 ( 0.000 sec)
2. e5c4 moves =      77752 ( 0.000 sec)
2. f3g3 moves =      94461 ( 0.000 sec)
2. f3h3 moves =      98524 ( 0.000 sec)
2. f3e3 moves =      92505 ( 0.000 sec)
2. f3d3 moves =      83727 ( 0.000 sec)
2. f3f4 moves =      90488 ( 0.000 sec)
2. f3f5 moves =     104992 ( 0.000 sec)
2. f3f6 moves =      77838 ( 0.000 sec)
2. f3g4 moves =      92037 ( 0.000 sec)
2. f3h5 moves =      95034 ( 0.000 sec)
2. d2e3 moves =      90274 ( 0.000 sec)
2. d2f4 moves =      84869 ( 0.016 sec)
2. d2g5 moves =      87951 ( 0.000 sec)
2. d2h6 moves =      82323 ( 0.000 sec)
2. d2c1 moves =      83037 ( 0.000 sec)
2. e2d3 moves =      85119 ( 0.000 sec)
2. e2c4 moves =      84835 ( 0.000 sec)
2. e2b5 moves =      79739 ( 0.000 sec)
2. e2a6 moves =      69334 ( 0.000 sec)
2. e2f1 moves =      88728 ( 0.000 sec)
2. e2d1 moves =      74963 ( 0.000 sec)
2. a1b1 moves =      83348 ( 0.000 sec)
2. a1c1 moves =      83263 ( 0.000 sec)
2. a1d1 moves =      79695 ( 0.015 sec)
2. h1g1 moves =      84876 ( 0.000 sec)
2. h1f1 moves =      81563 ( 0.000 sec)
2. e1f1 moves =      77887 ( 0.000 sec)
2. e1d1 moves =      79989 ( 0.000 sec)
perft( 4)=      4085603 ( 0.062 sec)
without castling rights:

Code: Select all

C:\cygwin\home\perft>perft 5 "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/
R3K2R w - - 0 1"
 - - - - - - - - - - - -
 - - - - - - - - - - - -
 - - r . . . k . . r - -
 - - p . p p q p b . - -
 - - b n . . p n p . - -
 - - . . . P N . . . - -
 - - . p . . P . . . - -
 - - . . N . . Q . p - -
 - - P P P B B P P P - -
 - - R . . . K . . R - -
 - - - - - - - - - - - -
 - - - - - - - - - - - -

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

perft( 1)=           46 ( 0.000 sec)
perft( 2)=         1866 ( 0.000 sec)
perft( 3)=        86677 ( 0.000 sec)
perft( 4)=      3504849 ( 0.031 sec)
perft( 5)=    161724713 ( 1.204 sec)
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: kiwipete perft position

Post by Henk »

Henk wrote:Ok. Trouble. Perhaps promotions or castling rights ?

I think I have to test this one first.

[d] n1n5/PPPk4/8/8/8/8/4Kppp/5N1N b - - 0 1
In this position I only count 16 moves for black. How do they get 24

3 for the pawn
2 for the knight
4 for the second knight
7 for the king

ok minor promotions !!! Skipper doesn't support it.
Skipper also misses Kd7-d8. Bug 2.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: kiwipete perft position

Post by Henk »

ok. Fools only. Kd8 is illegal.
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: kiwipete perft position

Post by hgm »

Kd7-d8 is not legal. There are only 6 King moves. And that makes a total of 15 (not 16). Which is OK, because each of the 3 Pawn moves also has 3 under-promotions, which makes 9 extra, for a total of 24.

Unfortunately qperft has no option to suppress under-promotion. But if Skipper does not do them, it is of course logical that you get lower counts for KiwiPete, as it is full of promotions.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: kiwipete perft position

Post by Henk »

hgm wrote:Kd7-d8 is not legal. There are only 6 King moves. And that makes a total of 15 (not 16). Which is OK, because each of the 3 Pawn moves also has 3 under-promotions, which makes 9 extra, for a total of 24.

Unfortunately qperft has no option to suppress under-promotion. But if Skipper does not do them, it is of course logical that you get lower counts for KiwiPete, as it is full of promotions.
Maybe they should split promotions into queen and under promotions when giving perft examples on these chess web sites. I think there will be more engines that don't support under promotions.
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: kiwipete perft position

Post by hgm »

Well, the -u flag was easy enough to implement:

Code: Select all

C:\cygwin\home\perft>a -u 5 "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R
3K2R w - - 0 1"
 - - - - - - - - - - - -
 - - - - - - - - - - - -
 - - r . . . k . . r - -
 - - p . p p q p b . - -
 - - b n . . p n p . - -
 - - . . . P N . . . - -
 - - . p . . P . . . - -
 - - . . N . . Q . p - -
 - - P P P B B P P P - -
 - - R . . . K . . R - -
 - - - - - - - - - - - -
 - - - - - - - - - - - -

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

perft( 1)=           46 ( 0.000 sec)
perft( 2)=         1866 ( 0.000 sec)
perft( 3)=        86677 ( 0.001 sec)
perft( 4)=      3494043 ( 0.033 sec)
perft( 5)=    161365647 ( 1.295 sec)

C:\cygwin\home\perft>a -u 6 "n1n5/PPPk4/8/8/8/8/4Kppp/5N1N b - - 0 1"
 - - - - - - - - - - - -
 - - - - - - - - - - - -
 - - n . n . . . . . - -
 - - P P P k . . . . - -
 - - . . . . . . . . - -
 - - . . . . . . . . - -
 - - . . . . . . . . - -
 - - . . . . . . . . - -
 - - . . . . K p p p - -
 - - . . . . . N . N - -
 - - - - - - - - - - - -
 - - - - - - - - - - - -

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

perft( 1)=           15 ( 0.000 sec)
perft( 2)=          210 ( 0.000 sec)
perft( 3)=         3253 ( 0.000 sec)
perft( 4)=        47828 ( 0.002 sec)
perft( 5)=       807048 ( 0.020 sec)
perft( 6)=     13125620 ( 0.327 sec)
Last edited by hgm on Thu Mar 26, 2015 2:42 pm, edited 2 times in total.
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: kiwipete perft position

Post by Robert Pope »

Henk wrote:
hgm wrote:Kd7-d8 is not legal. There are only 6 King moves. And that makes a total of 15 (not 16). Which is OK, because each of the 3 Pawn moves also has 3 under-promotions, which makes 9 extra, for a total of 24.

Unfortunately qperft has no option to suppress under-promotion. But if Skipper does not do them, it is of course logical that you get lower counts for KiwiPete, as it is full of promotions.
Maybe they should split promotions into queen and under promotions when giving perft examples on these chess web sites. I think there will be more engines that don't support under promotions.
Or you could add promotions to your code. It's like 10 lines of code.