3

I am developing a chess engine to improve my Cpp. It works, which means it generates legal moves and it can play them out. I optimized a bit and now achieve ~20k N / s, which is way better than my original 100 N /s

But Stockfish does 1MK/s, which is beyond my conception. This is about 1 Node within 100 clocks. Even if I use an evaluation function, which just returns a constant, I will not get beyond 100kN/s. So how is this pure speed achieved?

5
  • 2
    By applying all the optimizations people have thought of over many decades of chess engine programming. I feel this question is much too broad for the SE format, you'll have more luck reading everything at the chess programming wiki ( chessprogramming.org/Main_Page ) and the Stockfish source code ( github.com/official-stockfish/Stockfish/tree/master/src ). Jul 14, 2021 at 19:45
  • 1
    You mention: Even if I use an evaluation function, which just returns a constant, I will not get beyond 100kN/s. Perhaps you need to improve your move generator then, which may be slowing you down greatly. Ideally, in a fast chess engine, the move generation should take up no more than 5-10% of the total cycles. Jul 15, 2021 at 9:49
  • 1
    100 clocks? No way. i5 is already GHz. As Nihar mentioned, you generate nodes too slowly. Ideally, at each move you already know the possible next moves, and can just update that set upon each move/unmove.
    – user21820
    Jul 16, 2021 at 21:06
  • 1 GHZ = 1 Billion Clocks / s => 1000 Clocks per Node ... srry
    – Niclas
    Jul 16, 2021 at 22:23
  • You are totally right!
    – Niclas
    Jul 16, 2021 at 22:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.