frcperft released

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Allard Siemelink
Posts: 297
Joined: Fri Jun 30, 2006 9:30 pm
Location: Netherlands

frcperft released

Post by Allard Siemelink »

As the name implies, frcperft is a perft program for Fischer Random Chess.
Features:
- full legal move generation
- bulk counting in leaf nodes
- bitboards
- magic move generation by Pradu Kanan

Example output for the opening position (corei7@2600Mhz, with SSE4.2):

Code: Select all

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
perft 1             20       0.00s      1.$ mnps  428.4 ticks/move
perft 2            400       0.00s      1.$ mnps   51.5 ticks/move
perft 3           8902       0.00s      1.$ mnps   29.8 ticks/move
perft 4         197281       0.00s      1.$ mnps   29.9 ticks/move
perft 5        4865609       0.05s    103.5 mnps   23.1 ticks/move
perft 6      119060324       0.45s    263.4 mnps   10.1 ticks/move
perft 7     3195901860      11.11s    287.7 mnps    9.3 ticks/move
Source code and 32/64 bit binaries for Windows, Linux and OSX are available here:
http://members.ziggo.nl/allard.siemelink/spark/
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: frcperft released

Post by Daniel Shawul »

Hi Allard
I am probably wrong but isn't frc chess same as standard except for the
opening position. In which case I belive your old iperft should give the same result ?

Please excuse my shameless request below.
Could you add also a perft for spartan chess ? :) We really need chess engines for that and it would be good if you can make bright or spark play spartan. Rules here http://www.spartanchessonline.com/ . Piece movements are different for spartan pieces. Aside from the issue of two kings , the implementation is pretty easy.
Changes are minimal and you don't have to implement eval stuff. I am sure the wood counter bright would destroy all of us.

Thanks for the sources. I like optimized code even though I would never write it.
cheers
Daniel
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: frcperft released

Post by Evert »

Daniel Shawul wrote:Please excuse my shameless request below.
Could you add also a perft for spartan chess ? :)
Sjaak has a perfter for Spartan, if you want it. It's not particularly optimised for it though, doing more work than it needs to for terminal nodes. It uses the same method as PERFT_SLOW in the frcperft program (I wanted to know why the posted times were so much faster than those I get from Jazz, so I had a quick look; Sjaak uses the same code as Jazz).
We really need chess engines for that and it would be good if you can make bright or spark play spartan. Rules here http://www.spartanchessonline.com/ . Piece movements are different for spartan pieces. Aside from the issue of two kings , the implementation is pretty easy.
Yup. More entries for the next tournament would be fun!
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: frcperft released

Post by Daniel Shawul »

Oh no Evert, that was my lazy attempt to get people interested in spartan. Actually perft is what I did first, to compare my result's with HG's. Fast perfts usually use bulk counting and hash tables. I don't like bulk counting because it doesn't reflect what actually happens in a real search.
Sorry Allard for hijacking your thread. :oops:
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: frcperft released

Post by Evert »

Daniel Shawul wrote:I don't like bulk counting because it doesn't reflect what actually happens in a real search.
Same reason I don't.
Sorry Allard for hijacking your thread. :oops:
It's ok, he can re-use it to post about his new Spartan chess engine. ;)
User avatar
Giorgio Medeot
Posts: 52
Joined: Fri Jan 29, 2010 2:01 pm
Location: Ivrea, Italy

Re: frcperft released

Post by Giorgio Medeot »

Daniel Shawul wrote:Hi Allard
I am probably wrong but isn't frc chess same as standard except for the
opening position. In which case I belive your old iperft should give the same result ?
Well, as King and Rooks can start from different positions than standard, your perft have to know how to castle. Maybe this can make some difference.

Cheers,
  • Giorgio
Allard Siemelink
Posts: 297
Joined: Fri Jun 30, 2006 9:30 pm
Location: Netherlands

Re: frcperft released

Post by Allard Siemelink »

Daniel Shawul wrote:Hi Allard
I am probably wrong but isn't frc chess same as standard except for the
opening position. In which case I belive your old iperft should give the same result ?
Yes, FRC chess is a superset of standard chess and the perft counts of the opening position should be exactly the same.

However, in other positions, there are a couple of pitfalls to watch out for involving castling.
E.g. in the next position castling to the queen side is illegal, because the rook on b1 is pinned:
[D]3k4/8/8/8/8/8/8/rR2K3 w Q - 0 1

The reason I wrote frcperft is that I am adding FRC support in Spark's next release. As Spark started out as a bitboard perft, I thought I'd upgrade it to support FRC too and see how fast I could make it.
On 64 bit systems, frcperft is now faster than my older i-perft on which Bright was based.
Allard Siemelink
Posts: 297
Joined: Fri Jun 30, 2006 9:30 pm
Location: Netherlands

Re: frcperft released

Post by Allard Siemelink »

Daniel Shawul wrote: Could you add also a perft for spartan chess ? :) We really need chess engines for that and it would be good if you can make bright or spark play spartan. Rules here http://www.spartanchessonline.com/ . Piece movements are different for spartan pieces. Aside from the issue of two kings , the implementation is pretty easy.
Changes are minimal and you don't have to implement eval stuff. I am sure the wood counter bright would destroy all of us.

Thanks for the sources. I like optimized code even though I would never write it.
cheers
Daniel
Spartan chess sounds interesting, but I am afraid it is not a top priority for me.
Why aren't you inclined to writing optimized code, I should think the frcerft source code is still quite readable and malleable?
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: frcperft released

Post by Daniel Shawul »

Sorry,bad english. I meant "could not write" not "would not write" .