3

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

Eval Stockfish error "in check"

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?

2 Answers 2

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) 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.

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.

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.