Record the last move when adjudicating a game - #2429
Open
Menkib64 wants to merge 1 commit into
Open
Conversation
The idea raises from an example training game where the last move is a major blunder from winning to losing position. https://lichess.org/bL37LY5j The position after blunder is mate in 3. Network predicts 24.9 plies left. This change includes the last position in game which reached the clear evaluation is proven mate in 3. This hopefully includes a few provable mates that network quite doesn't manage to predict at root yet. My limited local test showed that most of end positions are just a minor shift from a really bad evaluation (Q=0.96-0.98) to threshold. I managed to see a proven mate where best_m=12 while previous move best_m=played_m=84.77. Previous move best_q=played_q=0.983. orig_q=0.978 improved to orig_q=-0.981 for the newly included move. This is only limited observation that change includes expected data. It doesn't prove that including these positions will improve training.
There was a problem hiding this comment.
Pull request overview
This PR adjusts self-play adjudication timing so that when a game is ended early via resign/adjudication thresholds, the final “clearly decided” position is still captured in the training dataset (instead of being skipped by an early break).
Changes:
- Moves the resign/adjudication check to occur after
training_data_.Add(...)so the final position is recorded before the game terminates. - Keeps the adjudication behavior unchanged, but ensures the last training sample is retained when adjudication triggers.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
john-sp
approved these changes
Jul 20, 2026
borg323
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The idea raises from an example training game where the last move is a major blunder from winning to losing position. https://lichess.org/bL37LY5j The position after blunder is mate in 3. Network predicts 24.9 plies left. This change includes the last position in game which reached the clear evaluation is proven mate in 3.
This hopefully includes a few provable mates that network quite doesn't manage to predict at root yet. My limited local test showed that most of end positions are just a minor shift from a really bad evaluation (Q=0.96-0.98) to threshold. I managed to see a proven mate where best_m=12 while previous move best_m=played_m=84.77. Previous move best_q=played_q=0.983. orig_q=0.978 improved to orig_q=-0.981 for the newly included move.
This is only limited observation that change includes expected data. It doesn't prove that including these positions will improve training.