Contrived position for perft

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

Moderators: hgm, Rebel, chrisw

Maarten Claessens
Posts: 106
Joined: Mon May 12, 2014 10:08 am
Location: Near Nijmegen

Re: Contrived position for perft

Post by Maarten Claessens »

lucasart wrote: Sun Apr 21, 2019 12:25 pm
Maarten Claessens wrote: Sun Apr 21, 2019 11:31 am
elcabesa wrote: Sun Apr 21, 2019 10:31 am if my engine is not wrong those are the results:
1: 60
2: 2608
3: 113742
4: 4812099
5: 202902054
6: 8419356881
Sorry, but your engine is wrong. Perft 2 of the position "r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R1R1K2R b KQkq c3 0 1"is 2659.
Well if you mistype the FEN and search a different position...
I was refering to the modified position of Volker Annuss (with the extra rook on c1) and had assumed the perft-results were also for that position (because the post was right below it). Sorry for the confusion...
Nothing is unstable (Lawrence Krauss)
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Contrived position for perft

Post by mar »

Michael Sherwin wrote: Sun Apr 21, 2019 5:10 am Does it cover all the possibilities? Has someone done a better one already? Any suggested changes?
[d]r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R3K2R b KQkq c3 0 1
Thanks
I don't remeber one position to test all cases, not sure if it's possible; if so then it would be really nice if you don't have to go too deep.

We did some artificial positions that cover most of the gotchas in the past, I don't remember the link but Jon has a list in Arasan:

see testPerft in unit.cpp:
https://github.com/jdart1/arasan-chess/ ... c/unit.cpp

the point being it's better to do a shallow perft in multiple positions rather than deep perft on startpos for example
Martin Sedlak
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Contrived position for perft

Post by Michael Sherwin »

lucasart wrote: Sun Apr 21, 2019 9:55 am
How aboud this?
[D] r6r/1bp2pP1/R2qkn2/1P6/1pPQ4/1B3N2/1B1P2p1/4K2R b KQ c3 0
It adds pins of the 2 possible kinds:
* the normal pin, where from->to causes self-check through the vacated from square.
* the en-passant special case, where from->to causes self-check, through the square vacated by the captured enemy pawn.

There is actually a third kind of pin, but that only happens in Chess960. It's when you can't castle, because the castling rook is pinned.
There is no legal castling so castle moves are not tested.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Contrived position for perft

Post by Sven »

Michael Sherwin wrote: Sun Apr 21, 2019 3:29 pm
lucasart wrote: Sun Apr 21, 2019 9:55 am
How aboud this?
[D] r6r/1bp2pP1/R2qkn2/1P6/1pPQ4/1B3N2/1B1P2p1/4K2R b KQ c3 0
It adds pins of the 2 possible kinds:
* the normal pin, where from->to causes self-check through the vacated from square.
* the en-passant special case, where from->to causes self-check, through the square vacated by the captured enemy pawn.

There is actually a third kind of pin, but that only happens in Chess960. It's when you can't castle, because the castling rook is pinned.
There is no legal castling so castle moves are not tested.
Furthermore the FEN of Lucas is slightly wrong, white queenside castling cannot be available without a rook on a1 so it should be:

r6r/1bp2pP1/R2qkn2/1P6/1pPQ4/1B3N2/1B1P2p1/4K2R b K c3 0 1
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Contrived position for perft

Post by zullil »

elcabesa wrote: Sun Apr 21, 2019 10:31 am if my engine is not wrong those are the results:
1: 60
2: 2608
3: 113742
4: 4812099
5: 202902054
6: 8419356881
My perft agrees:
FEN string = r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R3K2R b KQkq c3 0 1
Depth = 6
Leaf nodes = 8419356881
Time taken = 89945 ms
User avatar
Ajedrecista
Posts: 1968
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: Contrived position for perft.

Post by Ajedrecista »

Hello:
zullil wrote: Mon Apr 22, 2019 1:57 am
elcabesa wrote: Sun Apr 21, 2019 10:31 am if my engine is not wrong those are the results:
1: 60
2: 2608
3: 113742
4: 4812099
5: 202902054
6: 8419356881
My perft agrees:
FEN string = r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R3K2R b KQkq c3 0 1
Depth = 6
Leaf nodes = 8419356881
Time taken = 89945 ms
A bit late, but the perft counter JetChess agrees up to perft(6) = 8,419,356,881. If there is some interest, I computed perft(7) of the same position. After giving some format to JetChess output:

Code: Select all

JetChess 1.0.0.0:

r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R3K2R b KQkq c3 0 1

  1  Qd4-c3        7,302,693,178
  2  Qd4xb2        5,630,760,813
  3  Qd4-e3+         391,353,239
  4  Qd4-f2+         321,492,647
  5  Qd4-g1+         350,874,071
  6  Qd4-e5+         865,369,749
  7  Qd4-c5        8,520,395,809
  8  Qd4-b6        8,296,963,775
  9  Qd4-a7        6,324,214,905
 10  Qd4-d3        9,315,297,308
 11  Qd4xd2+         390,305,342
 12  Qd4-e4+         580,198,160
 13  Qd4-f4       10,084,506,705
 14  Qd4-g4       10,611,660,192
 15  Qd4-h4+         622,553,334
 16  Qd4xc4       10,307,013,804
 17  Qd4xd5        7,152,413,229
 18  Ra8-a7        6,945,323,471
 19  Ra8-a6        8,087,966,039
 20  Ra8-a5        6,896,541,587
 21  Ra8-a4        6,224,988,162
 22  Ra8-a3        7,204,117,750
 23  Ra8-a2        5,911,970,364
 24  Ra8xa1+         360,224,836
 25  Ra8-b8        6,532,007,218
 26  Ra8-c8        6,051,713,003
 27  Ra8-d8        7,369,910,740
 28  Rh8-h7        6,648,934,772
 29  Rh8-h6        6,933,297,583
 30  Rh8-h5        6,765,334,557
 31  Rh8-h4        6,433,415,729
 32  Rh8-h3        6,395,876,149
 33  Rh8-h2        5,118,360,202
 34  Rh8xh1+         238,019,733
 35  Rh8-g8        4,904,565,739
 36  Rh8-f8        6,930,220,026
 37  Bb7-a6        5,830,030,077
 38  Bb7-c6        7,355,816,557
 39  Bb7xd5        5,438,495,885
 40  Bb7-c8        8,943,426,029
 41  Nf6xd5        5,694,231,567
 42  Nf6-e4        9,095,539,215
 43  Nf6-g4        8,562,406,007
 44  Nf6-h5        6,245,923,940
 45  Nf6-d7       10,136,463,008
 46  Nf6-g8        7,037,798,433
 47  Nf6-h7        5,953,383,680
 48   g2-g1=Q+       579,623,618
 49   g2-g1=N+     6,880,558,076
 50   g2-g1=R+       578,298,898
 51   g2-g1=B+     7,585,089,123
 52   g2xh1=Q+       365,393,226
 53   g2xh1=N+     4,422,426,789
 54   g2xh1=R+       343,451,226
 55   g2xh1=B+     4,603,479,980
 56   b4-b3        7,632,871,851
 57   c7-c6        7,201,179,964
 58   c7-c5        5,957,761,833
 59   b4xc3(ep)   10,170,106,435
 60  Ke8-e7       12,165,048,933
--------------------------------
TOTAL:           347,799,658,270
There is other position in this thread without results. I have computed up to perft(16) using JetChess again:

Code: Select all

JetChess 1.0.0.0:

8/K7/8/8/2Q1Pp1k/8/8/8 b - e3 0 1

perft( 1) =                       6 {f3, Kg3, Kg4, Kg5, Kh3, Kh5}
perft( 2) =                     162
perft( 3) =                     937
perft( 4) =                  24,947
perft( 5) =                 139,087
perft( 6) =               3,627,518
perft( 7) =              20,788,396
perft( 8) =             536,974,869
perft( 9) =           3,337,766,318
perft(10) =          84,940,058,005
perft(11) =         620,982,650,117
perft(12) =      15,350,018,981,603
perft(13) =     143,776,103,176,009
perft(14) =   3,401,570,053,784,826
perft(15) =  41,281,698,329,924,860
perft(16) = 934,163,576,401,850,485
I hope no typos.

Regards from Spain.

Ajedrecista.