lichess.org
Donate

Is this too hard to code as a draw?

It's difficult for computers to understand positions like this. We as humans can see it and understand that anything but a draw is impossible, but how would you teach a computer how to understand that that's the case?

It's also not too major an issue because positions like this are incredibly rare. Like... this is the only case I've seen of it in a human game. Even in computer games this almost never happens.

So I wouldn't worry about it too much. You have a draw offer button, so that works.
The chat says black declined the offer so it must have been a 50-moves auto-draw. And indeed, the last capture took place 50 moves before the end.

It's not impossible for computers to understand this nowadays but it's definitely also not simple. TBest already linked the very recent issue where somebody actually implemented a prototype for this but it's not clear yet whether this will be integrated into Lichess since it still requires a somewhat considerable amount of computation. Also, it's definitely not feasible to calculate this on every move for all the thousands of games that are played on Lichess at any given point. At most, this will only be used when somebody flagged to determine whether it should be a draw.

Instead, I'm rather curious why neither of you offered a draw when it's so obvious this can't be won. Also, you might want to consider just moving back in forth in order to produce a 3-fold repetition instead of waiting for the 50 moves.
It's a 50 move rule draw because on move 39 Kxd3 the counting started and on move 89 Kg2 the 50 moves completed
There is no error or glitch with lichess
The 50 move rule cut in literally when I premoved the last move so didn't exactly decline the offer.
When there's increment these positions aren't that bad, just annoying. When there's no increment that's when it's painful.

The reason I am asking about the coding because last time I saw this posted one of the mods said it is too hard to code all the possible variations. Then someone posted a link to someone who was coding it and I wondered if that was real. (I don't know anything about coding) I just wondered if it will ever be solved?...

Referring to this;

lichess.org/forum/lichess-feedback/why-this-position-isnt-recognized-as-a-draw-automatically#9
Waiting for the day when engines finally recognize fortresses ...
<Comment deleted by user>
What TBest linked to seems to be the state-of-the-art program. My opinion is:
1. There are other problems with "draw offer" functionality (for example, offers do not "stick" in time scrambles, so it's extremely rare for players to agree to a draw, even in clearly drawn positions)
2. I haven't seen any other chess site implement such an automated "unwinnable position" or "dead position" detector; implementing something which handles every possible position and performs well sounds challenging, and possibly not even worth doing since one only needs a detector when everything else has failed (for example, when players aren't agreeing to a draw and chose to play without an increment and one of the players timed out before being able to play 50 moves).
I think what has been overlooked is just how resource-light Miguel's detector is. For every game that ends in a timeout, his algorithm only requires 140 μs of time on average to run on a 3.50GHz Intel-Core i9-9900X CPU.

That's just 0.00014 seconds.

Even the worst-case scenario only takes 0.0063 seconds.

This topic has been archived and can no longer be replied to.