Perpetual Check

Discussion of chess software programming and technical issues.

Moderator: Ras

CRoberson
Posts: 2091
Joined: Mon Mar 13, 2006 2:31 am
Location: North Carolina, USA

Perpetual Check

Post by CRoberson »

Has anybody implemented this? The USCF dropped the perpetual check rule due to it eventually going into 3-fold occurance or the 50 move rule. Don't know about FIDE. I am interested in implementing it, because Ares just lost a game on CCRL that was a draw. It's pv claimed 15
consecutive checks. But not a 3-fold occurance or 50 move rule hit (which are in Ares). Ares is down material but the king can't escape the checks. Stockfish, Dragon and Ares given time think it is a draw with scores of 0.00.

The question is how many consecutive checks to base peretual on. When it hits n then report 0.00, but what is n? It might be safest to not do this in the search, but report 0.00 in the final score if the last n moves by the attacker are checks.
Joost Buijs
Posts: 1627
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Perpetual Check

Post by Joost Buijs »

I've never heard of a perpetual-check rule. It seems to me you can only lose a game on time when you have perpetual-check.
Nightmare only knows about 3-fold repetition and the 50 move rule.
chrisw
Posts: 4624
Joined: Tue Apr 03, 2012 4:28 pm
Location: Midi-Pyrénées
Full name: Christopher Whittington

Re: Perpetual Check

Post by chrisw »

Joost Buijs wrote: Fri Apr 11, 2025 8:49 am I've never heard of a perpetual-check rule. It seems to me you can only lose a game on time when you have perpetual-check.
Nightmare only knows about 3-fold repetition and the 50 move rule.
Me neither
Uri Blass
Posts: 10787
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Perpetual Check

Post by Uri Blass »

CRoberson wrote: Fri Apr 11, 2025 12:51 am Has anybody implemented this? The USCF dropped the perpetual check rule due to it eventually going into 3-fold occurance or the 50 move rule. Don't know about FIDE. I am interested in implementing it, because Ares just lost a game on CCRL that was a draw. It's pv claimed 15
consecutive checks. But not a 3-fold occurance or 50 move rule hit (which are in Ares). Ares is down material but the king can't escape the checks. Stockfish, Dragon and Ares given time think it is a draw with scores of 0.00.

The question is how many consecutive checks to base peretual on. When it hits n then report 0.00, but what is n? It might be safest to not do this in the search, but report 0.00 in the final score if the last n moves by the attacker are checks.
It may be interesting question what is the position with the maximal consectutive number of checks that the losing side can force.

My guess is more than 15.
ovenel
Posts: 6
Joined: Mon Apr 24, 2023 4:11 pm
Full name: Nelson Overboe

Re: Perpetual Check

Post by ovenel »

According to Wikipedia, the rules for drawing by perpetual check had been dropped by 1967. So it's not surprising that people are unaware of this rule.

In regards to engine development, it seems like it would be difficult to say whether a perpetual check is a draw because it's sometimes part of a king walk to safety. In particular, in endgames there are oftentimes lines where a checkmate is delayed by the losing player continuously checking the opponent's king until they eventually run out of checks, at which point the other player can start the checkmating sequence. So flatly saying that a perpetual check is a draw would be difficult as the king may eventually make it to a safe square. But maybe it would be beneficial to evaluate a draw after what appears to be a perpetual check in quiescent search?
User avatar
Ajedrecista
Posts: 2097
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: Perpetual check.

Post by Ajedrecista »

Hello:
ovenel wrote: Fri Apr 11, 2025 4:39 pmAccording to Wikipedia, the rules for drawing by perpetual check had been dropped by 1967. So it's not surprising that people are unaware of this rule.

[...]
Just to complete Nelson's find, I found the following:

a) I found an incomplete transcription of FIDE Laws of Chess 1977/1978 (https://www.janko.at/Retros/Glossary/FideLaws1977.htm):
FIDE Laws of Chess 1977/1978 wrote:Part I. General Laws

[...]

ARTICLE 12 • THE DRAWN GAME

The game is drawn –

[...]

4. when a player having the move demonstrates that at least fifty consecutive moves have been made by each side without me capture of any piece or the movement of any pawn.

This number of fifty moves can be increased for certain positions, provided that this increase in number and these positions nave been clearly established before the commencement of the game.

FIDE Interpretation Art. 12.4 (1958A)

Question: Can a player lose the game by exceeding the time-limit when the position is such that no mate is possible, whatever continuation the players may employ (this concerns Part II of the Laws)?

Answer: The Commission declares that the Laws must be interpreted in such a way that in this case, as in the case of perpetual check, a draw cannot be decreed against the will of one of the players before the situation foreseen in Article 12.4 is attained.

[...]
There was not such a 'draw by perpetual check' rule then, this is, there were other ways to claim a draw, as already stated before in this thread.

As 1958 is cited above (1958A), I also found the preface of 1958 Rules of Chess at FIDE Arbiters' Commission Arbiters' Manual (September 2024):
FIDE Arbiters' Commission Arbiters' Manual (September 2024) wrote:1958

"GENERAL OBSERVATIONS. The Laws of Chess cannot, and should not, regulate all possible situations that may arise during a game, nor they can regulate all questions of organization. In most cases not precisely regulate by an Article of the Laws, one should be able to reach a correct judgment by applying analogous stipulations for situations of a similar character. As to the arbiters' tasks, in most cases one must presuppose that arbiters have the competence, sound of judgment, and absolute objectivity necessary. A regulation too detailed would deprive the arbiter of his/her freedom of judgment and might prevent him from finding the solution dictated by fairness and compatible with the circumstances of a particular case, since one cannot foresee every possibility."
------------------------

b) I found a mention to and old rule (sic) covering a draw by perpetual check at page 51 of The Official Blue Book and Encyclopedia of Chess (1956) by Kenneth Harkness, published for the United States Chess Federation:

Image

The excerpt says that this old rule had been abandoned. Again, a threefold repetition is the way to claim the draw:

https://books.google.es/books?redir_esc ... =perpetual

Image
The Official Blue Book and Encyclopedia of Chess (1956) wrote:It will be noted that the old rule covering a draw by perpetual check has been abandoned. A player who can subject his opponent's King to an endless series of checks can force a third repetition of the position and claim the draw under Article 12, No. 3.
Regards from Spain.

Ajedrecista.
Jouni
Posts: 3621
Joined: Wed Mar 08, 2006 8:15 pm
Full name: Jouni Uski

Re: Perpetual Check

Post by Jouni »

Fide 2023 chess laws have 75 moves draw rule:

9.6 If one or both of the following occur(s) then the game is drawn:

9.6.1 the same position has appeared, as in 9.2.2 at least five times.

9.6.2 any series of at least 75 moves have been made by each player without the movement of any pawn and without any capture. If the last move resulted in checkmate, that shall take precedence.

:? :o
Jouni
CRoberson
Posts: 2091
Joined: Mon Mar 13, 2006 2:31 am
Location: North Carolina, USA

Re: Perpetual Check

Post by CRoberson »

Checked some old USCF rule books: it is in the 5th edition (2003) but not the 6th edition (2014). So, it looks like the USCF dropped it in 2014. Statement for history sake only.

My point is that after the PV has n consecutive checks, why not cut the score in half? Don't set it to zero as that could miss 3-fold rep.

Another interesting USCF rule is the insufficient moves rule (14d4): This is one exception to loss on time (just like insufficient material).
14D4. No legal moves leading to checkmate by opponent.
There are no legal moves that could lead to the player being checkmated by the opponent.

So, if player A runs out of time and player B calls it, normally that would be a win for B. But there are exceptions to that such as the well know insufficient material rule. 14D4 allows player A to claim he has mate in N, assuming that can be proven, then the game is a draw.
Don't know if FIDE has such a rule.
ovenel
Posts: 6
Joined: Mon Apr 24, 2023 4:11 pm
Full name: Nelson Overboe

Re: Perpetual Check

Post by ovenel »

The Chess Programming Wiki page on Check lists a few different threads discussing perpetual check. I'm not entirely clear about the issue that you had where you lost a game that was drawn, but I think that it would be related to the Spite Checks that hgm had posted about back in 2014. It sounds like the resolution in that thread was in regards to being selective about which checks to extend in the search and relying on a deeper search to sort out the issue.

It looks like the same thread was referenced here in 2015 with another explanation of the idea that hgm had for resolving spite checks. In essence, he proposed classifying checks as potentially pointless if every other possible move is bad.

However, if I'm understanding your question correctly, it may be the case that these "spite checks" are the only way to survive. That is, if a check is not played, then the opponent can proceed with a forced checkmate, but you are able to push that checkmate out indefinitely with a series of checks (possibly losing material in the meantime), thus turning a loss into a draw. So in that case, we'd want to evaluate the position as a draw (or a potential draw) before we continue down the full line that leads to a draw by repetition. In that case, maybe you can implement something akin to what hgm was suggesting in these threads to classify checks as suspect and then adjust the score as you were suggesting if the best move is a suspect check.

I could also be misunderstanding these other threads, and I know that hgm is still a very active member here (and certainly much more knowledgeable about the theory behind chess engines than I), so he can probably give a better interpretation of his thoughts on this matter.
CRoberson
Posts: 2091
Joined: Mon Mar 13, 2006 2:31 am
Location: North Carolina, USA

Re: Perpetual Check

Post by CRoberson »

Nelson,
Yes, it is common even for humans to use a series of checks to draw especially against a king in the open field.
Here is the game. You can see the final position: the white king is in the open and enough black pieces are there to produce a long series of checks. Thus the no progress rule could be invoked in USCF events, if the TC didn't have an increment. But no USCF or FIDE TD/Arbiter would call this game a win for white.
Stockfish, Dragon, Ares and others (John Merilino said CM9 sees the draw) all see the draw in 20 ply or less.
Interestingly enough, a superficial position inspection looks like white has a mate in 1 in the waiting, but will not get to pull it off.