Dead Position Detection Proposal

Sort:
EndgameEnthusiast2357

I thought I had already created a thread on this, maybe it was in one of the clubs, but can't find it, so let me just post it in the regular forums. Dead positions are positions such as the following:

Where no sequence of legal moves will ever lead to a checkmate. Note that there are potential pawn moves, checks, and captures in this position, yet it is still dead drawn, and emphasis on "drawn" not "drawish". The game is over, it is equivalent to stalemate/insufficient material/repetition, despite legal moves still being available. The site however doesn't recognize these as draws/game over, and players have to make random moves until 50 moves or repetition is reached. I propose that some sort of detection system be programmed for this. I know there's probably tens of thousands or maybe even millions of variations of these positions but very basic ones could probably be detected via certain patterns like the following:

Ilampozhil25

too complicated? i presume

but yeah, your timeout proposal (vs forced mate) is realistic (to an extent)

2718a

If a dead position occurs, usually you have enough time that you can just keep on pre-moving and avoid getting flagged. (50-move rule = 5 secs needed if no pawns can move and no captures can be made)

EndgameEnthusiast2357

But why should someone have to play on in such a position? It's equivalent to forcing people to play on in an insufficient material position. It is impossible for either side to win the game.

Martin_Stahl
EndgameEnthusiast2357 wrote:

But why should someone have to play on in such a position? It's equivalent to forcing people to play on in an insufficient material position. It is impossible for either side to win the game.

There were over 500 million live games played in February (likely more in later months) and it wouldn't make any sense to check for dead positions after moves are made. It would be computationally too expensive and catch very few positions.

Potentially some kind of check could be done on timeout instead but even then, coding to do that seems pretty complex and prone to missing things, and doesn't really solve the need to play on until timeout.

I very seriously doubt something like that would ever be implemented.

EndgameEnthusiast2357

It would detect a dead position once it is reached, not after the fact. The same way stalemate or checkmate is automatically detected. I know there are probably millions of these positions, but I bet some of them could be coded for. Specific patterns like locked alternating file pawns on the same rank across the board with bishops on their own same respective color as the pawns, and kings below the rank with their pawns. Then you could include doubled pawns where no captures are possible, and then include irrelevant captures such as capturing an opponent pawn that will still result in a pawn-locked position. Any possibility of captures that could result in pawn promotions would automatically cancel any dead position detection. Diagonal pawn chains that are locked would be harder, but probably some mathematical algorithm could be programmed. An interesting challenge in chess computer programming.

EndgameEnthusiast2357

Some of the positions, like the more complicated ones in the OP, could be number crunched in. The simpler ones definitely have mathematical patterns that could trigger detection systems:

5 parameters:

1. Pawns locked on same rank

2. Locked pawns alternate files

3. Locked pawns pattern continues at least 4 times

4. Both kings below respective 4th ranks.

5. Bishops on same colored squares as their own sides Locked pawns, regardless of what ranks they are on.

This would account for all positions with Locked pawns and bishops on the same color, no matter what rank the pawns are on, no matter where the bishops are, and no matter where the kings are as long as they are on their side of the pawns. The only exception to this would be the case of multiple bishops of the same color, as checkmate would become possible there:

So each side could only have 1 bishop.

JkCheeseChess
EndgameEnthusiast2357 wrote:

The only exception to this would be the case of multiple bishops of the same color, as checkmate would become possible there:

This case is similar to the two knights case where the player with two knights cannot forced checkmate but the opponent can just walk into it. However two knights is still considered insufficient material and the game is automatically drawn. So I don't think a special scenario for two bishops like you posted is necessary either.

EndgameEnthusiast2357

Well I actually created a separate thread on that issue. I think if checkmate is possible in anyway, the player who runs out of time should lose. Even if it's 1 knight vs 9 queens and a rook. In fact, current site rules for insufficient material vs timeouts allow a player to improve their game result by deliberately losing on time. For example:

After white player Kf8, black, seeing that he will be mated next move, can decide to deliberately let his clock run out to get a draw, since the site will declare that white had insufficient material to win. The issue is the site only takes into account the material white has, even if it's not vs a lone king. Losing on time should never improve one's game result. 2 knights I really don't understand because that isn't insufficient, even against a lone king! That's why the rule should be that if checkmate is possible in anyway, the player flagging loses. But this is a separate issue.

For the purposes of dead positions, time doesn't factor into it, even if both sides had 10 minutes left these positions would still be drawn. One side having insufficient material vs NOT a lone king only factors in when one side runsbout of time.

Martin_Stahl
EndgameEnthusiast2357 wrote:

It would detect a dead position once it is reached, not after the fact. The same way stalemate or checkmate is automatically detected. I know there are probably millions of these positions, but I bet some of them could be coded for. Specific patterns like locked alternating file pawns on the same rank across the board with bishops on their own same respective color as the pawns, and kings below the rank with their pawns. Then you could include doubled pawns where no captures are possible, and then include irrelevant captures such as capturing an opponent pawn that will still result in a pawn-locked position. Any possibility of captures that could result in pawn promotions would automatically cancel any dead position detection. Diagonal pawn chains that are locked would be harder, but probably some mathematical algorithm could be programmed. An interesting challenge in chess computer programming.

Again, checking the positions after every single move on hundreds of millions of games each day would be computationally expensive for something that maybe happens a miniscule number of times.

No matter how interesting the challenge would be, from a programming perspective, unless the code was extremely fast and efficient, it's very unlikely to ever happen. Even then, the number of times it happens in practice on its own makes it highly unlikely to spend any development time on, even if it was really fast and efficient to call billions/trillions of times a day.

Sea_TurtIe

but what if a person has less than 5 seconds in a dead position? then its a forced, unfair loss

EndgameEnthusiast2357

You have a point, especially since dead positions can get as complicated as the following:

Captures, pawn moves, checks, all possible, as well as multiple pieces still on the board, yet a dead drawn position. Would be very hard to program in an algorithm to instantly detect ones like this.

2718a

https://www.chess.com/game/live/2449103502?username=fryedk

Obvious draw but chess.com did not detect it.

EndgameEnthusiast2357

Did you deliberately construct that game with a friend or something? I can't believe an 1800 would miss that many mates in 1s..

Leither123

There's also positions where technically one side can win, but it requires the other side to blunder really badly, which is never going to happen (unless bullet). It's not a "dead position" by definition but it basically is. I suppose automatic detection wouldn't make sense here though

Just for fun, here's a position I made for which stockfish claims white has a massive advantage, but I'm fairly certain it is still a draw:

EndgameEnthusiast2357

For the purposes of this thread, we are talking strictly about positions where checkmate is impossible, even if the opponent were to help the other side win, no sequence of legal moves would ever lead to checkmate. The position you are showing may fall under the category of "insufficient losing chances" which applies in USCF tournaments but I don't know if FIDE has anything equivalent. Essentially if there's a 90+% chance that a 1500 rated player would be able to hold the position against a 2200+ rated player given more time, the 1500 can stop the clock and call the arbiter over to claim a draw if it's obvious the opponent is doing nothing other than trying to win on time with pointless moves. Now personally I don't think that should exist, especially in online, as players may try to trick their opponent into Blundering by playing like a4 in that position, (pretend the pawn on a6 wasn't there and the black king was on like h5) hoping the player blunders on low time and let's the pawn through, but of course he'll lose if he doesn't fall for it. But even in OTB, it isn't necessary because if a position is that drawish, a 1500 should be able to hold the position with the standard increments until 50 moves is reached.

EndgameEnthusiast2357

You're right. Man I'm not thinking straight today, that is an easily holdable draw, deleted that comment. Stockfish doesn't understand many endgame positions.

Leither123

About detecting dead positions, I agree that it would be inefficient to check for all possibilities, but detecting basic patterns could be possible. I have an idea for a way to detect a locked pawn structure, but I'm no programmer and I don't know if this is possible, or practical if it is possible. Might be a fun thought bubble though:

To detect an impenetrable pawn structure for white, the program will first see if white can move their pawns. If not, it can detect all the squares that black's pawns control, and then detect all the squares that white's pawns occupy, saving them into some temporary storage and marked with their respective positions (a4, b3, etc.). Then it will see if those squares ever form a line, as in there are eight saved squares a-b that all have the same matching line number (a4, b4, c4, etc.). If there is a line, and the row number for white's king is less than the row number for the line, then it is an impenetrable pawn structure. The same test can then be done for black.

Obviously there are a few locked pawn structures that don't form a straight line, such as the one below. Again, I don't know if this is even possible or practical if it was, but if the square data was available something like this could be done

I feel weird now for posting about something I have no knowledge in

EndgameEnthusiast2357

That was actually one of the best posts on this thread. That's exactly what I suggested. Specific patterns could be detected such as locked pawns alternating files with kings below their respective pawn ranks. For even more specific pawn locked patterns like the one below, bishops on the same color as the players pawns could be detected:

Now multiple bishops of the same color could make it a still alive position, because then you have theoretical mates:

So there are many different aspects of position possibilities that need to be taken into account. Doubles pawns for example, on the same file as their own locked pawns have no effect, position is still drawn, unless the bishops are beyond the locked pawns rank, cause the doubled pawns could then take them. But without doubled pawns this isn't the case as the 1st position in this post. A very interesting computer programming challenge. Then you have positions like the OP with knights in the corner!

Sea_TurtIe

ive had a position like this on lichess and should this also be considered a dead position?