What is a good perft speed?

Discussion of chess software programming and technical issues.

Moderator: Ras

imnoumni
Posts: 10
Joined: Sat Dec 02, 2023 4:14 am
Full name: Imno Umni

Re: What is a good perft speed?

Post by imnoumni »

Just a followup to this very old thread. I took a break from chess programming after the original discussion but recently got back to it. Comparing what I have now, I'm quite happy with perft performance. #2 (for whatever it's worth ...)

Perft 7 of startpos on 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz, just copying the relevant output from the programs:
  • Gigantua (giga_gcc): Perft Start 7: 3195901860 2797ms 1142.31 MNodes/s
  • Mine (./r startpos 7): perft 3195901860 divides 20 Mnps 702.45 time 4.549617
  • ZeroLogic (echo "go perft 7" | eval time ./ZeroLogic): Mn/s: 439
  • Stockfish 17 (echo "go perft 7" | eval time ./stockfish-ubuntu-x86-64-avx512): 12.455s, so 256.59 Mnps
So a distant second to Gigantua, but not doing crazy templating/specialization like it does. I just refactored my code and made sure compiler optimizations are taking place. No transposition tables, no hashing, single threaded. Just pump through the moves. Bulk counting is when the depth is one and you just +1, right? I am doing that. Seems a logical choice. Unlike a lot of chess code, I don't have an "undo-move". I just clone the position and make the move, and throw it away when it's done. A significant performance? Doubt it, but it saved me from having to figure out how to undo a move.

I think compiler optimization actually plays a big part of this number. For example, I noticed the compiler replaced a bunch of bitwise logic code I have with blsr/tzcnt instructions. It needed to be able to understand that code to reduce several lines of high level language to a single assembly instruction. So, how smart your compiler is plays a huge part.
chessbit
Posts: 9
Joined: Fri Dec 29, 2023 4:47 pm
Location: Belgium
Full name: thomas albert

Re: What is a good perft speed?

Post by chessbit »

Here are my results currently vs Gigantua. I shamelessly copied his function to iterate over each position to have an exact comparison.
So I'm stronger at the starting position (where king is not very active) but still slower in more open positions... for now.

Mine:

Code: Select all

Perft Start 1: 20 0ms 2 MNodes/s
Perft Start 2: 400 0ms 5.47945 MNodes/s
Perft Start 3: 8902 0ms 136.954 MNodes/s
Perft Start 4: 197281 0ms 494.439 MNodes/s
Perft Start 5: 4865609 4ms 1047.27 MNodes/s
Perft Start 6: 119060324 110ms 1081.06 MNodes/s
Perft Start 7: 3195901860 2741ms 1165.8 MNodes/s
OK

Perft Kiwi 1: 48 0ms 8 MNodes/s
Perft Kiwi 2: 2039 0ms 49.7317 MNodes/s
Perft Kiwi 3: 97862 0ms 940.981 MNodes/s
Perft Kiwi 4: 4085603 2ms 1378.41 MNodes/s
Perft Kiwi 5: 193690690 118ms 1629.83 MNodes/s
Perft Kiwi 6: 8031647685 5278ms 1521.48 MNodes/s
OK

Perft Midgame 1: 46 0ms 46 MNodes/s
Perft Midgame 2: 2079 0ms 519.75 MNodes/s
Perft Midgame 3: 89890 0ms 1321.91 MNodes/s
Perft Midgame 4: 3894594 2ms 1614 MNodes/s
Perft Midgame 5: 164075551 98ms 1672.69 MNodes/s
Perft Midgame 6: 6923051137 4036ms 1714.97 MNodes/s
OK

Perft Endgame 1: 38 0ms 19 MNodes/s
Perft Endgame 2: 1129 0ms 376.333 MNodes/s
Perft Endgame 3: 37035 0ms 740.7 MNodes/s
Perft Endgame 4: 1023977 0ms 1278.37 MNodes/s
Perft Endgame  5: 31265700 20ms 1514.15 MNodes/s
Perft Endgame 6: 849167880 577ms 1470.69 MNodes/s
OK

Perft aggregate: 18999768562 13015ms 1459.81 MNodes/s
Gigantua:

Code: Select all

Perft Start 1: 20 0ms 1.05263 MNodes/s
Perft Start 2: 400 0ms 11.7647 MNodes/s
Perft Start 3: 8902 0ms 125.38 MNodes/s
Perft Start 4: 197281 0ms 465.285 MNodes/s
Perft Start 5: 4865609 5ms 887.075 MNodes/s
Perft Start 6: 119060324 127ms 931.206 MNodes/s
Perft Start 7: 3195901860 3057ms 1045.22 MNodes/s
OK

Perft Kiwi 1: 48 0ms 5.33333 MNodes/s
Perft Kiwi 2: 2039 0ms 135.933 MNodes/s
Perft Kiwi 3: 97862 0ms 978.62 MNodes/s
Perft Kiwi 4: 4085603 2ms 1495.46 MNodes/s
Perft Kiwi 5: 193690690 110ms 1752.1 MNodes/s
Perft Kiwi 6: 8031647685 4927ms 1629.9 MNodes/s
OK

Perft Midgame 1: 46 0ms 4.18182 MNodes/s
Perft Midgame 2: 2079 0ms 297 MNodes/s
Perft Midgame 3: 89890 0ms 1284.14 MNodes/s
Perft Midgame 4: 3894594 2ms 1613.34 MNodes/s
Perft Midgame 5: 164075551 93ms 1752.51 MNodes/s
Perft Midgame 6: 6923051137 3745ms 1848.16 MNodes/s
OK

Perft Endgame 1: 38 0ms 9.5 MNodes/s
Perft Endgame 2: 1129 0ms 188.167 MNodes/s
Perft Endgame 3: 37035 0ms 861.279 MNodes/s
Perft Endgame 4: 1023977 0ms 1471.23 MNodes/s
Perft Endgame 5: 31265700 17ms 1740.85 MNodes/s
Perft Endgame 6: 849167880 520ms 1630.22 MNodes/s
OK

Perft aggregate: 18999768562 12636ms 1503.53 MNodes/s