Answers.Body: <p>If a king is in check, that's a major thing. There are likely to be few legal replies for the engine to consider. It's also unlikely (although <a href="https://chess.stackexchange.com/questions/8982/theoretical-limit-for-the-number-of-consecutive-checks">possible</a>) that there would be a large chain of checks from both sides. And it's very unlikely that you'd want to immediately prune the check; they're almost always worth at least considering.</p>
  <p>When the engine is evaluating lots of positions, it therefore makes sense for it to not waste time evaluating the check position itself. Instead it's quicker to look ahead to how the check is resolved.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-23T11:37:51.873Z
Answers.LastActivityDate: 2020-06-23T11:37:51.873Z
Answers.UserDisplayName: D M
Answers.Body: <p>Evaluation functions are built for &quot;quiet&quot; positions.  That is, positions without a lot of unresolved tactics.  This is why evaluation is done at the leaves of quiesence search, which resolves all reasonable captures and checks.</p>
  <p>The idea is that it would be incorrect to evaluate a position with lots of tactical options, because after those tactics are resolved the material on the board could be dramatically different than it is now.  The same thing goes for checks.</p>
  <p>Instead of calling EVAL on your positions, you should consider calling qSearch to get a score.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-26T13:15:45.520Z
Answers.LastActivityDate: 2020-06-26T13:15:45.520Z
Answers.UserDisplayName: Jeff Wilson
Body: <p>I am working on a program that should recognize the difference between human and computer players. For this purpose, I need some parameters. A part of them would be the individual values of the static position evaluations.</p>
  <p>In Stockfish you can get these values with the command EVAL. However, if I call EVAL while one of the kings is in check, I don't get a rating. Instead, I only get the info &quot;none (in check)&quot;</p>
  <p><a href="https://i.sstatic.net/zj3Wu.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zj3Wu.png" alt="Eval Stockfish with Evaluation table" /></a></p>
  <p><a href="https://i.sstatic.net/c6zRW.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/c6zRW.png" alt="Eval Stockfish error &quot;in check&quot;" /></a></p>
  <p>Does somebody know why this is the case? In my opinion, that doesn't make sense as long as it's not a checkmate or stalemate. How can you get around this?</p>
  
Tags: <engines><stockfish><evaluation><check>
Title: How to get static evaluation from Stockfish in case that a king is in check?
ThreadText: # How to get static evaluation from Stockfish in case that a king is in check?
  
  (Asked by: username_0 on 2020-06-23)
  
  I am working on a program that should recognize the difference between human and computer players. For this purpose, I need some parameters. A part of them would be the individual values of the static position evaluations.
  
  In Stockfish you can get these values with the command EVAL. However, if I call EVAL while one of the kings is in check, I don't get a rating. Instead, I only get the info "none (in check)"
  
  [![Eval Stockfish with Evaluation table](https://i.sstatic.net/zj3Wu.png)](https://i.sstatic.net/zj3Wu.png)
  
  [![Eval Stockfish error ](https://i.sstatic.net/c6zRW.png)](https://i.sstatic.net/c6zRW.png)
  
  Does somebody know why this is the case? In my opinion, that doesn't make sense as long as it's not a checkmate or stalemate. How can you get around this?
  
  **Tags:** engines, stockfish, evaluation, check
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-06-23. Score: 3
  
  If a king is in check, that's a major thing. There are likely to be few legal replies for the engine to consider. It's also unlikely (although [possible](https://chess.stackexchange.com/questions/8982/theoretical-limit-for-the-number-of-consecutive-checks)) that there would be a large chain of checks from both sides. And it's very unlikely that you'd want to immediately prune the check; they're almost always worth at least considering.
  
  When the engine is evaluating lots of positions, it therefore makes sense for it to not waste time evaluating the check position itself. Instead it's quicker to look ahead to how the check is resolved.
  
  
  ---
  
  ### Answer by username_2 on 2020-06-26. Score: 3
  
  Evaluation functions are built for "quiet" positions. That is, positions without a lot of unresolved tactics. This is why evaluation is done at the leaves of quiesence search, which resolves all reasonable captures and checks.
  
  The idea is that it would be incorrect to evaluate a position with lots of tactical options, because after those tactics are resolved the material on the board could be dramatically different than it is now. The same thing goes for checks.
  
  Instead of calling EVAL on your positions, you should consider calling qSearch to get a score.
  
  
  ---
  
  