6

I get that from the point of view of the engine there's no difference; equal is equal. But for a human analyzing with an engine, I find quite important to note that a move takes to a balanced position or to a threefold repetition (which finishes the game).

For example, say I'm analyzing a position from my favorite opening, and the engine says the best move is d4(+0.10), and the second one is h6(0.00). But it happens that h6 will be draw by repetition. Depending on my mood or my position on a tournament or whatever other factors, I could prefer one or another, and the fact that h6 just finishes the game is quite important in my opinion.

To me the main difference is that threefold repetition just immediately finishes the game in a draw, whilst a 0.00 position can just have any final result.

Of course you can check the line provided by the engine to realize that it takes to threefold repetition, but wouldn't be much useful to use some special character for it?

2
  • 3
    Maybe you might reformulate it a bit, the why is obvious: it takes work to program this :-), with a limited benefit. Maybe a chess programmer can elaborate. Nov 23, 2021 at 12:27
  • One reason is because programming languages are created to not favor any language. So while programming stockfish or other engines people put the numbers because some people might not know English.
    – Varun W.
    Dec 25, 2021 at 18:53

2 Answers 2

8

It's easy enough to make the engine say it's 0.00 because of a 3-fold repetition. If you look at the relevant part of Stockfish's code, they are basically if statements that return a particular value if the condition is met. If you want to know if there's a 3-fold, you could add a print "this is a 3-fold" command and you'll have it. I'm hard-pressed to see why it matters, though. 0.00 is 0.00, regardless of whether it's insufficient material or fortress or 3-fold or whatever.

It sounds like you want to know if the position is a dead draw or if it's still complex enough that you might be able to outplay your opponent. This is much harder to put in machine-understandable form. How would you define these things? There are certainly positions where engines have no trouble finding the best moves (and therefore all games end 1/2-1/2) while human games show it is very unbalanced.

That said, there is some effort in the computer chess community to go beyond finding the simple "best move". This started with contempt for handcrafted engines, which uses the material remaining on the board as a proxy for how complex the position is. The idea is that if you set contempt high, then the engine will play inferior moves as long as it keeps more material on the board, which leaves more scope to outplay a weaker opponent. Conversely if you set negative contempt, then the engine will simplify the position and shoot for a draw. That might be what you're looking for.

Today's strongest engines are all neural-network based, for which contempt is more difficult to implement. Neural network eval return W/D/L, which is the probability of a win, draw, or loss from that position; there is no number for complexity (and probably cannot be since you'd need a very large training set with labelled "complexity" to get started). People are trying the so-called draw score, which turns draws from worth 0.5 points to, say, worth 0.4 points. This, it is hoped, makes the engine avoid draws - after all if one move leads to a three-fold while another leads to a 10% chance of win, 80% chance of draw, and 10% chance of loss then the second move has a higher expected score and becomes preferable. But even this does not work perfectly, since your engine might assess a position as drawn while the opponent sees a big advantage, see e.g. this game where Leela saw 99.3% chance of draw on move 158, and still lost the game eventually.

Ultimately you still need a way to measure if a position is "dead", and a good way to do that doesn't exist (see this question). If you have a smart idea to measure how "live" the position is, you can probably get it published in a journal.

1
  • Ok, so technically is a trivial task, and wouldn't harm the engine performance. I edited my question in order to try to make it clearer why I think it'd be a desirable feature.
    – emdio
    Nov 23, 2021 at 13:39
4

There is in general no such thing as a simple "this leads to threefold repetition". There may have been millions of different positions considered, and of those, if you select at each branch at your move the highest evaluation for you, and vice versa at the opponent's branch, that leads to a 0.00 evaluation that happened to come from a threefold.

That doesn't mean that that threefold was forced in any way. Maybe there were a thousand different things you could have done instead but they were -0.1, or the opponent could have done but they were +0.1. And then were another thousand that also led to 0.00 but for different reasons: tablebase draw, stalemate...

So, I guess engines could change the way they work, so that evaluation is not a fixed number but there can be different ways of being 0.00 - 0.00 (threefold) would be the same value as 0.00 (stalemate), but the user could still be shown which it is.

But it'd always be quite random which of the many 0.00s in the entire tree you'd get to see.

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.