Half Move Clock Confusion

General discussion about computer chess...
Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Half Move Clock Confusion

Post by Jeremy Bernstein » Wed Jan 16, 2013 12:03 pm

From Dan Heisman's latest Novice Nook:
2. Three-Fold Repetition of Position – Three-fold repetition of position does not require the moves to be the same, nor the position to occur on consecutive moves. What is required is that the same position for both players be reached three times (nothing to do with the moves required to get there), with the same player to move, and with all the same dynamic possibilities (such as castling and en passant) available each time. Sometimes inexperienced players think that in the endgame they can get a draw just by repeating their position three times irrespective of the opponent's moves. But if you could do that, I could get a draw against Magnus Carlsen just by playing 1.Nf3 2.Ng1 3.Nf3 and then claiming a draw when I play 4.Ng1! The correct way to claim a three-fold repetition in USCF play is to write down the move that you think would make the same position (for both players!) occur three times and then, without making the move on the board, stop the clock and claim the draw to your opponent. If your opponent agrees the game is over; if they do not agree, then get the TD and let him decide.

3. Fifty-move Rule – The fifty-move rule is fifty consecutive moves for both players where neither player has made a pawn move or a capture. Castling, is allowed, but captures and pawn moves reset the counter. This rule can be implemented at any point in the game and has nothing special to do with one side having just a king left on the board

pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: Half Move Clock Confusion

Post by pgn4web » Sat Feb 23, 2013 10:34 pm

pgn4web wrote:
HumbleProgrammer wrote:P.S. After submitting this message, I noticed that pgn4web does NOT reset the Half Move Clock, and reports it as 2.
Glad to see that I got this right, following the letter of the FIDE rules.
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
Guert Gijssen replied to my question confirming the different requirements for the threefold repetition and for the 50 move rules; we might agree or not with the conclusion, at least now we know that the people writing the rules are aware of the difference. See the full response here:
http://www.chesscafe.com/geurt/geurt177.htm

sje
Posts: 9
Joined: Sun Jan 29, 2012 3:03 pm
Real Name: Steven Edwards

Re: Half Move Clock Confusion

Post by sje » Wed Jun 12, 2013 3:24 am

The Half Move Clock (or Half Move Counter) is the number of ply (half moves) since the last pawn move or capture. This is the definition from the FEN specification and it was taken from the FIDE rules in force at the time (ca. 1994). Castling does not affect the Half Move Clock other than to increase it by one; note that it is possible to draw a game by the fifty move rule with a castling move.

Definitions based on phrases like "equivalent available moves" should probably be avoided because only one side at at time has moves, obviously.

syzygy
Posts: 148
Joined: Sun Oct 16, 2011 4:21 pm

Re: Half Move Clock Confusion

Post by syzygy » Wed Jun 12, 2013 8:18 pm

lucasart wrote: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).
If en passant is impossible due to a pin, then the position does not count as different for the purpose of 3-time repetition rule (nor for any other rule). Most chess engines don't get this right for efficiency reasons. (A chess interface should get it right though, imho.)

Positions that differ only in castling rights are different for the purpose of the 3-time repetition rule, even if currently castling is not possible.
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).
You only have to verify whether the position has a legal en passant move. Since en passant is relatively rare it would probably not give too much overhead, but I agree it's not really worth it. (On the other hand, in case the engine has a legal move generator anyway, the difference in efficiency should become really small if you encode in your en passant flag the possible legal ep captures.)

edit: oops, didn't realise I am responding to a quite old post...

hyatt
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

Post by hyatt » Thu Jun 13, 2013 3:02 am

how can you have two different positions where a pin prevents EP in one of them, but not the other, and ALL pieces are on the same squares? Or am I misunderstanding what you are talking about?

If an EP is not possible due to a pin, it is simply not possible, period. I think the rule says "all the same moves are possible."

syzygy
Posts: 148
Joined: Sun Oct 16, 2011 4:21 pm

Re: Half Move Clock Confusion

Post by syzygy » Fri Jun 14, 2013 1:40 am

hyatt wrote:how can you have two different positions where a pin prevents EP in one of them, but not the other, and ALL pieces are on the same squares? Or am I misunderstanding what you are talking about?
No idea who you mean by "you", but this is what I wrote:
syzygy wrote:If en passant is impossible due to a pin, then the position does not count as different for the purpose of 3-time repetition rule (nor for any other rule).
That should speak for itself, me thinks.

The rule COULD have been different: it COULD have stated that if the previous move was a double pawn push and at least one of the opponent's pawn is in the correct position for an e.p. capture had it been legal, then the position is different for the purpose of the 3-time repetition rule from the position where all pieces are in the same position and the same side is to move, but the previous move was not a double pawn push.

As we know the rule does not state this. The rule states that the position after the double pawn move with the potential e.p. capture being illegal is NOT different from the position where all pieces are in the same position and the same side is to move, but the previous move was not a double pawn push.

I don't know what there was to misread in what I wrote, but now you have it all spelled out.

yoshiharu
Posts: 1
Joined: Fri Jul 16, 2010 9:42 am
Real Name: Mauro Riccardi

Re: Half Move Clock Confusion

Post by yoshiharu » Thu Oct 24, 2013 9:07 am

I'm sorry to jump in into a quite old post, but as this thread has been referenced on chessprogramming wiki I think it has some importance for programmers.
syzygy wrote: The rule COULD have been different: it COULD have stated that if the previous move was a double pawn push and at least one of the opponent's pawn is in the correct position for an e.p. capture had it been legal, then the position is different for the purpose of the 3-time repetition rule from the position where all pieces are in the same position and the same side is to move, but the previous move was not a double pawn push.

As we know the rule does not state this. The rule states that the position after the double pawn move with the potential e.p. capture being illegal is NOT different from the position where all pieces are in the same position and the same side is to move, but the previous move was not a double pawn push.
Of course your discussion about what makes two positions equal in the context of the 3-rep draw rule is in principle right, but I think there is something fishy here. Let's say I have a position where an e.p. capture is possible but not legal (well, you know what I mean :-) ): then the very last move must have been a double pawn push, which is an irreversible move, hence no previous position can be the same as the current one. Therefore your argument looks correct, but I think it doesn't apply (in particular, it doesn't apply to a pair of positions within the *same* game).
I am missing something?

Cheers, Mauro

syzygy
Posts: 148
Joined: Sun Oct 16, 2011 4:21 pm

Re: Half Move Clock Confusion

Post by syzygy » Fri Oct 25, 2013 10:02 pm

yoshiharu wrote:I'm sorry to jump in into a quite old post, but as this thread has been referenced on chessprogramming wiki I think it has some importance for programmers.
syzygy wrote: The rule COULD have been different: it COULD have stated that if the previous move was a double pawn push and at least one of the opponent's pawn is in the correct position for an e.p. capture had it been legal, then the position is different for the purpose of the 3-time repetition rule from the position where all pieces are in the same position and the same side is to move, but the previous move was not a double pawn push.

As we know the rule does not state this. The rule states that the position after the double pawn move with the potential e.p. capture being illegal is NOT different from the position where all pieces are in the same position and the same side is to move, but the previous move was not a double pawn push.
Of course your discussion about what makes two positions equal in the context of the 3-rep draw rule is in principle right, but I think there is something fishy here. Let's say I have a position where an e.p. capture is possible but not legal (well, you know what I mean :-) ): then the very last move must have been a double pawn push, which is an irreversible move, hence no previous position can be the same as the current one. Therefore your argument looks correct, but I think it doesn't apply (in particular, it doesn't apply to a pair of positions within the *same* game).
I am missing something?
Clearly no previous positions can be the same, but you should not forget about later positions...

Post Reply