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.
What is a good perft speed?
Moderators: hgm, Rebel, chrisw
-
- Posts: 2491
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: What is a good perft speed?
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net
-
- Posts: 1972
- Joined: Wed Jul 13, 2011 9:04 pm
- Location: Madrid, Spain.
Re: What is a good perft speed?
Hello:
I wrongly duplicated 64 MB of hash when writting.
Regards from Spain.
Ajedrecista.
There is a typo at the top of the chart that I want to correct: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 [...]
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
[...]
Regards from Spain.
Ajedrecista.
-
- Posts: 63
- Joined: Mon Apr 05, 2021 12:00 am
- Full name: Eduardo Caceres
Re: What is a good perft speed?
Isn't the used fen/position quite a relevant piece of information to include?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.
-
- Posts: 6
- Joined: Fri Dec 29, 2023 4:47 pm
- Location: Belgium
- Full name: thomas albert
Re: What is a good perft speed?
This is pretty good. Could you tell us what approach you used? I assume bitboards, perhaps with pext?imnoumni wrote: ↑Tue Dec 19, 2023 11:20 pmCode: Select all
$ time ./main divide startpos 7 ... moves ... perft 3195901860 nps 639087301 time 5.000728 real 0m5.003s user 0m5.003s sys 0m0.000s
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
-
- Posts: 1784
- Joined: Wed Jul 03, 2019 4:42 pm
- Location: Netherlands
- Full name: Marcel Vanthoor
Re: What is a good perft speed?
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:
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.
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