Chess960 perft

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Chess960 perft

Post by lucasart »

Does anyone have a set of FEN with perft results aimed at testing Chess960 ?

My program is already well tested in orthodox chess, but with FRC castling, I'm not sure. Code "looks correct", but I'd rather be sure.

Thanks!
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Chess960 perft

Post by mar »

Would be nice to have.
I could only dig up this position:

Code: Select all

qr1kbb1r/1pp2ppp/3npn2/3pN3/1p3P2/4PN2/P1PP2PP/QR1KBB1R w HBhb -
labeled "FRC crash" so I assume I already fixed that :)

Code: Select all

perft 5: 87972564
perft 6: 3206947488
It's possible for opponent's hslider to be present at back rank, blocked by a rook and the engine should not allow castling into check in that case, that's one of those things that can't happen in orthodox chess. Such artificial posititions should be easy to set up.
User avatar
Ajedrecista
Posts: 1968
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: Chess960 perft.

Post by Ajedrecista »

Hello Lucas:

I only found two links that I guess you found them too:

FRC perft and GUI

Subject: FRC Perft

These links offer some results but not the bunch of positions you request. You can try frcperft 1.0 by A.J. Siemelink (the author of Bright and Spark) to check your results. By the way, frcperft 1.0 agrees with Martin's results of the position of his post.

I tried qperft and JetChess and both of them does not support FRC. :( I do not know if gperft supports FRC because it is only 64-bit and I am a 32-bit living-fossil.

I do not have spare time to do Perft(1) to Perft(7) of all 960 starting positions; it is easy to do with frcperft 1.0 because you type the FEN, then 'perft 7' and all results from Perft(1) to Perft(7) are displayed. I assume that frcperft 1.0 is bug free.

Regards from Spain.

Ajedrecista.
yolin
Posts: 30
Joined: Thu Mar 30, 2006 6:12 pm

Re: Chess960 perft

Post by yolin »

See this very old post on the winboard forum (test positions and results are given in the replies):

http://www.open-aurec.com/wbforum/viewtopic.php?t=1404
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Chess960 perft

Post by mar »

I constructed this position for the back-rank test:

Code: Select all

R3rkrR/8/8/8/8/8/8/r3RKRr w EGeg - 0 1

Code: Select all

perft 5: 12667098
perft 6: 382942870
EDIT: I doubt the starting positions would be that useful to detect potential castling problems as you would have to go quite deep...
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Chess960 perft

Post by zullil »

lucasart wrote:Does anyone have a set of FEN with perft results aimed at testing Chess960 ?

My program is already well tested in orthodox chess, but with FRC castling, I'm not sure. Code "looks correct", but I'd rather be sure.

Thanks!
Compare against Stockfish? :wink:

Code: Select all

setoption name UCI_Chess960 value true
position fen rbbknnqr/pppppppp/8/8/8/8/PPPPPPPP/RBBKNNQR w KQkq - 0 1
perft 6

Position: 1/1

Perft 6 leaf nodes: 124381396

===========================
Total time (ms) : 831
Nodes searched  : 124381396
Nodes/second    : 149676770
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Chess960 perft

Post by lucasart »

mar wrote:I constructed this position for the back-rank test:

Code: Select all

R3rkrR/8/8/8/8/8/8/r3RKRr w EGeg - 0 1

Code: Select all

perft 5: 12667098
perft 6: 382942870
EDIT: I doubt the starting positions would be that useful to detect potential castling problems as you would have to go quite deep...
Interesting position. I don't have the same perft 5. Here's mine:

Code: Select all

e1a1	perft(4)=266420
e1b1	perft(4)=413440
e1c1	perft(4)=433588
e1d1	perft(4)=454928
g1h1	perft(4)=324990
a8a1	perft(4)=406704
a8a2	perft(4)=510117
a8a3	perft(4)=550895
a8a4	perft(4)=589136
a8a5	perft(4)=627116
a8a6	perft(4)=664077
a8a7	perft(4)=653738
a8b8	perft(4)=465634
a8c8	perft(4)=440049
a8d8	perft(4)=414175
a8e8	perft(4)=20275
h8h1	perft(4)=496983
h8h2	perft(4)=569188
h8h3	perft(4)=622473
h8h4	perft(4)=671506
h8h5	perft(4)=720248
h8h6	perft(4)=767793
h8h7	perft(4)=759188
h8g8	perft(4)=21603
f1f2	perft(4)=803022
perft(5) = 12667286
After which move does your perft(4) differ ?
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Chess960 perft

Post by mar »

Code: Select all

divide 5
Rxe8+ 20275
Raxa1 406546
Rxg8+ 21603
Rhxh1 496983
Rexa1 266420
Rgxh1 324990
Rb8 465634
Rc8 440034
Rd8 414160
Ra7 653738
Ra6 664077
Ra5 627116
Ra4 589136
Ra3 550895
Ra2 510117
Rh7 759188
Rh6 767793
Rh5 720248
Rh4 671506
Rh3 622473
Rh2 569188
Rb1 413440
Rc1 433588
Rd1 454928
Kf2 803022
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Chess960 perft

Post by zullil »

mar wrote:

Code: Select all

divide 5
Rxe8+ 20275
Raxa1 406546
Rxg8+ 21603
Rhxh1 496983
Rexa1 266420
Rgxh1 324990
Rb8 465634
Rc8 440034
Rd8 414160
Ra7 653738
Ra6 664077
Ra5 627116
Ra4 589136
Ra3 550895
Ra2 510117
Rh7 759188
Rh6 767793
Rh5 720248
Rh4 671506
Rh3 622473
Rh2 569188
Rb1 413440
Rc1 433588
Rd1 454928
Kf2 803022
Stockfish:

Code: Select all

setoption name UCI_Chess960 value true
position fen R3rkrR/8/8/8/8/8/8/r3RKRr w EGeg - 0 1 
divide 5

Position: 1/1
a8a1: 406546
a8a2: 510117
a8a3: 550895
a8a4: 589136
a8a5: 627116
a8a6: 664077
a8a7: 653738
a8b8: 465634
a8c8: 440034
a8d8: 414160
a8e8: 20275
h8h1: 496983
h8h2: 569188
h8h3: 622473
h8h4: 671506
h8h5: 720248
h8h6: 767793
h8h7: 759188
h8g8: 21603
e1a1: 266420
e1b1: 413440
e1c1: 433588
e1d1: 454928
f1f2: 803022
g1h1: 324990

===========================
Total time (ms) : 194
Nodes searched  : 12667098
Nodes/second    : 65294319
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Chess960 perft

Post by lucasart »

OK. I found at least one bug in my code, thanks to Stockfish's "divide" command. In this position:
[d]5krR/8/8/8/8/8/r7/2R1RKRr w GEg - 54 4
I am generating Kxe1 castling move, which is illegal, because the king would have to go on c1, which is already occupied...
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.