What is a good perft speed?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Ras
Posts: 2491
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: What is a good perft speed?

Post by Ras »

lithander wrote: Thu Dec 21, 2023 1:51 pmI tried tricks like that but couldn't get any significant nps increase out of it (for search). The one you describe only works when not already in check.
Correct, my approach doesn't work for in-check positions (but I have evasions for that), king moves, and I also exclude en passant moves. Still, I got a measurable speedup, IIRC something like 10% or so. The reason is that my move generator and in-check test work with for-loops (sliders) and dedicated if-checks (knights). If your engine has a more efficient implementation to begin with, the spared work and hence the speed-up will be smaller.
Rasmus Althoff
https://www.ct800.net
User avatar
Ajedrecista
Posts: 1972
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: What is a good perft speed?

Post by Ajedrecista »

Hello:
Ajedrecista wrote: Wed Dec 20, 2023 7:34 pm[...]

So I ran benchmarks of Perft(7) of the starting position in my PC with SF 16, qperft, JetChess 1.0.0.0 and gperft 1.1 to compare:

Code: Select all

[...]

=======================================================================
ENGINE / COUNTER        HASH (MB)        THREADS        TIME (M:SS.sss)
=======================================================================
gperft 1.1                 64               2           0:00.815
gperft 1.1                 64               2           0:00.866
[...]
[...]
There is a typo at the top of the chart that I want to correct:

Code: Select all

[...]

=======================================================================
ENGINE / COUNTER        HASH (MB)        THREADS        TIME (M:SS.sss)
=======================================================================
gperft 1.1                 64               2           0:00.815
gperft 1.1                128               2           0:00.866
[...]
I wrongly duplicated 64 MB of hash when writting.

Regards from Spain.

Ajedrecista.
eduherminio
Posts: 63
Joined: Mon Apr 05, 2021 12:00 am
Full name: Eduardo Caceres

Re: What is a good perft speed?

Post by eduherminio »

kranium wrote: Thu Dec 21, 2023 12:46 am I've updated the list
https://github.com/FireFather/perft-speeds

Now it's an editable table instead of a bitmap.

I'll be happy to add engines...
just contact me here firefather at telenet dot be
and send a copy of or point me to your engine.
Isn't the used fen/position quite a relevant piece of information to include?
Author of Lynx chess engine (GitHub, Lichess)
chessbit
Posts: 6
Joined: Fri Dec 29, 2023 4:47 pm
Location: Belgium
Full name: thomas albert

Re: What is a good perft speed?

Post by chessbit »

imnoumni wrote: Tue Dec 19, 2023 11:20 pm

Code: Select all

$ time ./main divide startpos 7                                                                                                                        
... moves ...
perft 3195901860 nps 639087301 time 5.000728

real    0m5.003s
user    0m5.003s
sys     0m0.000s
This is pretty good. Could you tell us what approach you used? I assume bitboards, perhaps with pext?
Did you move some logic to compile time?
My engine is about 50% slower with only run time but I don't find many ways to improve :(
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: What is a good perft speed?

Post by mvanthoor »

639 million NPS... that's a lot. I assume you use bulk counting and/or a transposition table, and maybe other perft-specific tricks.

My engine runs at +/- 58 million NPS, on a Ryzen 7950X, without a hash table, multi-threading or bulk counting. On an older i7 6700K, it runs at 32 million NPS. It does full incremental updates for its evaluation and Zobrist key when running perft; I do not disable this (because I mainly use perft to see if everything is working as it should.)

When running with a hash-table, speed increases the deeper it goes (obviously, because more and more depths can be pulled directly from the TT):

With 256 MB TT:

Code: Select all

Perft 1: 20 (0 ms, inf leaves/sec, hash full: 0%)
Perft 2: 400 (0 ms, inf leaves/sec, hash full: 0%)
Perft 3: 8902 (0 ms, inf leaves/sec, hash full: 0%)
Perft 4: 197281 (3 ms, 65760333 leaves/sec, hash full: 0%)
Perft 5: 4865609 (58 ms, 83889810 leaves/sec, hash full: 1%)
Perft 6: 119060324 (819 ms, 145372800 leaves/sec, hash full: 13.3%)
Perft 7: 3195901860 (10874 ms, 293903058 leaves/sec, hash full: 90.3%)
Total time spent: 11754 ms
Execution speed: 282459962 leaves/second
Average at 282 million NPS/second, but because this will keep increasing, I doubt it actually says anything. Someday I'd have to make this multi-threaded to see how fast it will go. I did an experiment a few years ago when just developing the engine, and it worked, but it wasn't the best way of multi-threading perft.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL