Half Move Clock Confusion
-
- Posts: 40
- Joined: Sat Jun 19, 2010 11:00 pm
- Real Name: Lee Neuse
Half Move Clock Confusion
I am using the game below as a sample game to test various bits and pieces of chess software, and noticed something unusual. I was using HIARCS Chess Explorer v1.2 to generate test FEN strings, and after Black castles on move 30, the Half Move Clock was reset to zero. My understanding is that the half move clock is "...the number of moves since the last pawn move or capture." and since castling is neither a pawn move nor a capture, I thought the FEN string was wrong. Much to my surprise, however, Fritz 12 did precisely the same thing as did Deep Shredder 12!
So here is my question: are all three mainstream chess GUIs reporting the wrong value for the half move clock, or am I misinterpreting it's purpose?
Half-Confused.
,,,^..^,,,
P.S. After submitting this message, I noticed that pgn4web does NOT reset the Half Move Clock, and reports it as 2.
So here is my question: are all three mainstream chess GUIs reporting the wrong value for the half move clock, or am I misinterpreting it's purpose?
Half-Confused.
,,,^..^,,,
P.S. After submitting this message, I noticed that pgn4web does NOT reset the Half Move Clock, and reports it as 2.
-
- Posts: 1242
- Joined: Thu Jun 10, 2010 2:13 am
- Real Name: Bob Hyatt (Robert M. Hyatt)
- Location: University of Alabama at Birmingham
- Contact:
Re: Half Move Clock Confusion
HumbleProgrammer wrote:I am using the game below as a sample game to test various bits and pieces of chess software, and noticed something unusual. I was using HIARCS Chess Explorer v1.2 to generate test FEN strings, and after Black castles on move 30, the Half Move Clock was reset to zero. My understanding is that the half move clock is "...the number of moves since the last pawn move or capture." and since castling is neither a pawn move nor a capture, I thought the FEN string was wrong. Much to my surprise, however, Fritz 12 did precisely the same thing as did Deep Shredder 12!
So here is my question: are all three mainstream chess GUIs reporting the wrong value for the half move clock, or am I misinterpreting it's purpose?
Half-Confused.
,,,^..^,,,
P.S. After submitting this message, I noticed that pgn4web does NOT reset the Half Move Clock, and reports it as 2.
No, it is the number of moves since the last IRREVERSIBLE move. A castle move, a capture, or a pawn move can't be undone.
-
- Posts: 40
- Joined: Sat Jun 19, 2010 11:00 pm
- Real Name: Lee Neuse
Re: Half Move Clock Confusion
Hence the cause of my confusion. I understand the utility in interpreting it as the number if plies since the last irreversible move -- particularly in the context of chess algorithms -- because it is a convenient boundary for finding repeated positions. Given that an irreversible move changes the board state in such a way that no position prior to the move could ever match a position occurring after the move is made, a "back to front" search for repetition of position can be terminated as soon as an irreversible move is encountered. Nonetheless, I have cause to respectfully disagree with this notion....it is the number of moves since the last IRREVERSIBLE move.
Most definitions of the FEN notation state that the Half Move clock is intended to determine when the "50 move" draw rule comes into play, which is independent of the "repeated position/perpetual check" rule. Nothing in the definition of the "50 move rule" makes any reference to irreversible moves or changes in board position; based on the statements below, castling should not reset the Half Move clock.
From http://www.freechess.org/Help/HelpFiles/fen.html: This number is the count of halfmoves (or ply) since the last pawn advance or capturing move. This value is used for the fifty move draw rule.
From http://www.fide.com/component/handbook/ ... ew=article (Section 5.2e): The game may be drawn if each player has made at least the last 50 consecutive moves without the movement of any pawn and without any capture.
Please accept my apology for harping on a matter of such triviality...
Humble Programmer
,,,^..^,,,
Re: Half Move Clock Confusion
Glad to see that I got this right, following the letter of the FIDE rules.HumbleProgrammer wrote:P.S. After submitting this message, I noticed that pgn4web does NOT reset the Half Move Clock, and reports it as 2.
It sounds odd though, I just emailed the question to the guy that writes most of the rules, you might read his answer on Guert Gijssen column on http://www.chesscafe.com
Re: Half Move Clock Confusion
Did they use the same chessbase interface?HumbleProgrammer wrote:Much to my surprise, however, Fritz 12 did precisely the same thing as did Deep Shredder 12!
I did a quick check with a recent version of scid and winboard and both apply the rule for the 50 moves counter as described in the PGN specs and in the FIDE rules (i.e. castling is NOT resetting the counter).
Re: Half Move Clock Confusion
I beg to differ. In doubt, do not listen to anyone on this forum, and have a look at the official FIDE rules:hyatt wrote:HumbleProgrammer wrote:I am using the game below as a sample game to test various bits and pieces of chess software, and noticed something unusual. I was using HIARCS Chess Explorer v1.2 to generate test FEN strings, and after Black castles on move 30, the Half Move Clock was reset to zero. My understanding is that the half move clock is "...the number of moves since the last pawn move or capture." and since castling is neither a pawn move nor a capture, I thought the FEN string was wrong. Much to my surprise, however, Fritz 12 did precisely the same thing as did Deep Shredder 12! 1
So here is my question: are all three mainstream chess GUIs reporting the wrong value for the half move clock, or am I misinterpreting it's purpose?
Half-Confused.
,,,^..^,,,
P.S. After submitting this message, I noticed that pgn4web does NOT reset the Half Move Clock, and reports it as 2.
No, it is the number of moves since the last IRREVERSIBLE move. A castle move, a capture, or a pawn move can't be undone.
http://www.fide.com/FIDE/handbook/LawsOfChess.pdf
Article 5.2.e says:
So the bug is in HIARCS Chess Explorer.The game may be drawn if each player has made at least the last 50 consecutive
moves without the movement of any pawn and without any capture.
I agree that in the spirit of the rule, the idea is irreversibility. But that's not what the rule says. And in a way, a castling move can be undone, in several moves, although it still loses the castling rights, the position is restored. And restoring the position (regardless of castling right difference) is what matters. For example, the 3 repetion rule is triggered if a position is repeated three times, even with different values of en passant square and castling rights.
"Talk is cheap. Show me the code." -- Linus Torvalds.
Re: Half Move Clock Confusion
Regarding the 50 moves rules you are right.lucasart wrote:I agree that in the spirit of the rule, the idea is irreversibility. But that's not what the rule says. And in a way, a castling move can be undone, in several moves, although it still loses the castling rights, the position is restored. And restoring the position (regardless of castling right difference) is what matters. For example, the 3 repetion rule is triggered if a position is repeated three times, even with different values of en passant square and castling rights.
Regarding the threefold position repetition you are wrong. Read article 9.2 of the document you posted: "Positions as in (a) and (b) are considered the same, if the same player has the move, pieces of the same kind and colour occupy the same squares, and the possible moves of all the pieces of both players are the same."
Hence the confusion from the inconsistent approach.
Re: Half Move Clock Confusion
Well I learnt something too, thenpgn4web wrote:Regarding the 50 moves rules you are right.lucasart wrote:I agree that in the spirit of the rule, the idea is irreversibility. But that's not what the rule says. And in a way, a castling move can be undone, in several moves, although it still loses the castling rights, the position is restored. And restoring the position (regardless of castling right difference) is what matters. For example, the 3 repetion rule is triggered if a position is repeated three times, even with different values of en passant square and castling rights.
Regarding the threefold position repetition you are wrong. Read article 9.2 of the document you posted: "Positions as in (a) and (b) are considered the same, if the same player has the move, pieces of the same kind and colour occupy the same squares, and the possible moves of all the pieces of both players are the same."
Hence the confusion from the inconsistent approach.

What is interesting is the case where you have a 3 repetition where the position are the same "visually" the possible moves are the same, even though en-passant or castling may differ (for eg. en passant is impossible due to a pin, or castling cannot be played in that position, although can at a later stage).
The 3 move FIDE rule was typically not written with programming implementation in mind. Just imagine if you want to obey that silly rule to the letter, you should generate all legal moves to verify (no one does that as I would be overkill in performance).
"Talk is cheap. Show me the code." -- Linus Torvalds.
Re: Half Move Clock Confusion
Chess is a game for people and rules should be written with human players in mind, certainly not computers and their programmers.lucasart wrote:The 3 move FIDE rule was typically not written with programming implementation in mind.
Anyway, as I said, I sent a note to Guert Gijssen, he practically writes the FIDE rules, let's wait for his explanation of this apparent inconsistency between the 50 moves rules and the threefold position repetition; he's usually very helpful answering questions, so stay tuned...
-
- Posts: 1242
- Joined: Thu Jun 10, 2010 2:13 am
- Real Name: Bob Hyatt (Robert M. Hyatt)
- Location: University of Alabama at Birmingham
- Contact:
Re: Half Move Clock Confusion
I actually agree with everyone. Crafty does this correctly, always has. It was my memory that was broken.
castling does change the repetition detection, but not the 50 move counter...
