Chess Engine Online

Repetition, the Fifty-Move Rule, and the Evaluation

Both rules turn winning positions into draws, and both are partly invisible to an engine reading a single position. What that means for what you are shown.

· 3 min read

Two rules in chess end games without either side being checkmated, and both interact awkwardly with how engines see positions.

Threefold repetition

The same position occurring three times, with the same side to move and the same castling and en passant rights, allows either player to claim a draw.

Inside a search this is handled properly. An engine exploring a line notices when it returns to a position already in that line and scores it as a draw, which is why engines find perpetual checks reliably and will steer into one when the alternative is worse.

The gap is at the root. Given a FEN and nothing else, an engine has no idea what came before. If the position on your board has already occurred twice, and the engine cheerfully recommends a move that repeats it a third time, it is not making a mistake. It was never told.

This matters in exactly one situation and it is a common one: you are winning, the opponent is checking repeatedly, and you paste the position into an analysis board to find out whether you can escape. The answer you get does not know that two of the three repetitions have already happened.

The fifty-move rule

Fifty moves by each side with no capture and no pawn move allows a draw claim. The halfmove clock in a FEN is what tracks this, and it is the field people most often set to zero when typing a position by hand.

Setting it to zero when the real count is 80 changes the answer in endgames. A position that is drawn in practice because there is not enough time to convert reads as a win, and the line the engine gives is one nobody would be permitted to finish.

Rule Tracked inside the search Tracked from a pasted FEN
Threefold repetition Yes, within the searched line No history exists
Fifty-move rule Yes, via the halfmove clock Only if the clock is correct

Where this bites hardest

Tablebase endgames. Some theoretically won positions require more than fifty moves of perfect play, and the rule turns them into draws. The longest known seven-piece win runs into the hundreds of moves.

Tablebases can be built either way, measuring distance to mate or distance to a capture or pawn move that resets the clock. The two produce different best moves in the same position, and a tool showing you one without saying which can look inconsistent.

Practical consequences

Copy the whole FEN, including both numbers. The halfmove clock is not decoration in an endgame.

When defending, count. If you are worse and the clock is at 30, forcing the position to stay static is a plan. The engine will not suggest it, because it evaluates the position rather than the race.

When attacking, also count. A win that needs sixty accurate moves is not a win if you are on move 45 of the count and cannot force a pawn move.

Do not trust a repetition verdict from a bare position. If the history matters, you have to supply it, which means analysing from a PGN rather than a FEN.

The claim is yours to make

Neither rule ends a game automatically at the three-move or fifty-move mark. Both are claims a player makes, and an unclaimed repetition simply continues.

The exception is the five-fold repetition and seventy-five-move rules, which do end the game without a claim. Those exist so a game cannot continue indefinitely when neither player notices, and they come up mostly in online play where the server enforces them.

For practical purposes: if you want the draw, you have to ask for it, and you have to ask before making another move.

Counting in your own games

The halfmove clock is displayed by most online interfaces and by no physical board. In a long endgame over the board, the count is on the scoresheet and nowhere else, which means it is on you to track it.

The habit worth building is simply noticing when a phase begins. Once you enter an endgame where no pawn can move and no capture is available, that is the moment the clock starts mattering, and it is usually forty moves before anybody thinks to look.

Common questions

Does the engine know about threefold repetition?
During a search, yes: it tracks positions in the current line and scores a repetition as a draw. From a single FEN, no, because a FEN records no history. Analysing a position where a repetition has already occurred twice gives an answer that ignores it.
Why does the engine offer a repetition when it is winning?
Usually because it is not winning by as much as you think, and the repetition is worth more than the alternative. If the evaluation is genuinely large and it still repeats, look for a defensive resource in the lines where it declines.

Try it on your own position

The analysis board runs the same engine in your browser, free. The app adds what a web page cannot: reading a position straight from a photograph, saved boards, and analysis with no connection.

Download Chess Engine for Stockfish on the App StoreGet Chess Engine for Stockfish on Google Play

Related