Body: <p>My main goal is to detect blunders in chess games.</p>
  <p>I wrote a python program that loads a large pgn database and then analyses the games. I did it by letting Stockfish go through every game and every move and comparing the bestmove score of each move with the previous move. Now the big problem is that this task is very greedy with the cpu.</p>
  <p>Is there a faster alternative to Stockfish, maybe something that is specialized on blunder detection or move evaluations only?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-06T10:31:55.377Z
Comments.Text: To make it possible to answer this question: what do you actually mean by a "blunder"? Is there going to be another step after your automatic process where you check something further about the moves to see if they have some desired property? Or is it enough for your purposes that the difference in computer evaluation between the move played and the "best move" is large?
Comments.UserDisplayName: James Martin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-06T10:34:43.027Z
Comments.Text: Also I'm a bit unsure what you would mean by "specialized on move evaluations only". Isn't it already the case that Stockfish is specialized on move evaluations? What else are you thinking about that Stockfish does?
Comments.UserDisplayName: James Martin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-06T10:53:41.210Z
Comments.Text: @RottenSchnitzel Haha, I did something similar last year, also using the Stockfish library in python. Detecting blunders by calling get_top_moves, and comparing the best move with say the second best move. I'm John from the github issue discussion a couple weeks ago btw. In case you're interested, check out the `position-finder` project in my github page. It might not help you a lot though since my overall method was similar, and I also found it computationally expensive.
Comments.UserDisplayName: Inertial Ignorance
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-06T12:29:17.727Z
Comments.Text: ok I see where the confusion comes from. By blunder I basically mean very bad moves that turn the game around. In most examples it's probably going to be a larg centipawn gap between the current and the previous position. A chess engine usually has a way to evaluate the position and a way to iterate through the moves. Stockfish uses both to tell you the best move. Now I thought there might be engines around that are not specialized on finding the top move but on evaluating the current position only. This should increase the performance.
Comments.UserDisplayName: RottenSchnitzel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-06T12:54:35.657Z
Comments.Text: Is the question how to detect blunders while minimizing CPU?
Comments.UserDisplayName: Michael West
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-06T14:40:40.437Z
Comments.Text: Yes. Calling Stockfish every time and let it do an bestmove analysis is very CPU consuming and thus time consuming.
Comments.UserDisplayName: RottenSchnitzel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-07T20:22:56.643Z
Comments.Text: What depth do you let stockfish run at? Simple blunders should be detectable at low depth. There have been experiments running Leela with zero depth which could be very fast (idk the details).
Comments.UserDisplayName: qwr
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-09T15:06:41.467Z
Comments.Text: that's a good suggestion I actually didn't think of. I also wondered how chess.com does the quick blunder detection since the one from the game summary differs to the one from the game review. Might just be a very low stockfish depth. I will try it out and determine if a depth of <5 is sufficient for detecting blunders.
Comments.UserDisplayName: RottenSchnitzel
Tags: <engines><analysis><software>
Title: What's the fastest way to detect blunders with an engine?
ThreadText: # What's the fastest way to detect blunders with an engine?
  
  (Asked by: username_0 on 2023-06-06)
  
  My main goal is to detect blunders in chess games.
  
  I wrote a python program that loads a large pgn database and then analyses the games. I did it by letting Stockfish go through every game and every move and comparing the bestmove score of each move with the previous move. Now the big problem is that this task is very greedy with the cpu.
  
  Is there a faster alternative to Stockfish, maybe something that is specialized on blunder detection or move evaluations only?
  
  **Tags:** engines, analysis, software
  
  > **Comments:**
  > **username_1**: To make it possible to answer this question: what do you actually mean by a "blunder"? Is there going to be another step after your automatic process where you check something further about the moves to see if they have some desired property? Or is it enough for your purposes that the difference in computer evaluation between the move played and the "best move" is large?  
  > **username_1**: Also I'm a bit unsure what you would mean by "specialized on move evaluations only". Isn't it already the case that Stockfish is specialized on move evaluations? What else are you thinking about that Stockfish does?  
  > **username_2**: @username_0 Haha, I did something similar last year, also using the Stockfish library in python. Detecting blunders by calling get_top_moves, and comparing the best move with say the second best move. I'm John from the github issue discussion a couple weeks ago btw. In case you're interested, check out the `position-finder` project in my github page. It might not help you a lot though since my overall method was similar, and I also found it computationally expensive.  
  > **username_0**: ok I see where the confusion comes from. By blunder I basically mean very bad moves that turn the game around. In most examples it's probably going to be a larg centipawn gap between the current and the previous position. A chess engine usually has a way to evaluate the position and a way to iterate through the moves. Stockfish uses both to tell you the best move. Now I thought there might be engines around that are not specialized on finding the top move but on evaluating the current position only. This should increase the performance.  
  > **username_3**: Is the question how to detect blunders while minimizing CPU?  
  > **username_0**: Yes. Calling Stockfish every time and let it do an bestmove analysis is very CPU consuming and thus time consuming.  
  > **username_4**: What depth do you let stockfish run at? Simple blunders should be detectable at low depth. There have been experiments running Leela with zero depth which could be very fast (idk the details).  
  > **username_0**: that's a good suggestion I actually didn't think of. I also wondered how chess.com does the quick blunder detection since the one from the game summary differs to the one from the game review. Might just be a very low stockfish depth. I will try it out and determine if a depth of <5 is sufficient for detecting blunders.  
  
  ---
  
  ## 0 answers
  
  