Repository navigation
Clock times in the PGN of games against Maia, and in the analysis export - #463
Merged
Merged
Conversation
Play vs. Maia (and Hand and Brain): the PGN has each move's clock as a %clk comment, rebuilt from the time the server charged each move under its rule (the first move of each side free, then charged and given the increment). The board now takes the server's move times when its answers come, in place of the times the page first gave the moves. Analysis: a stored game keeps the PGN the backend sends, and the export writes the clocks in a game's PGN (a played game's once the backend has them, and a Lichess game's). Practice games have no clocks: a takeback keeps the time used, and extra time isn't kept move by move, so they can't be rebuilt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
From a Discord request: the PGN of a Play vs. Maia game lost all its clock times, which players want for seeing whether they spend too much or too little time on moves.
What changes
%clkcomment, as Lichess exports it:1. e4 { [%clk 0:03:00] } 1... c5 { [%clk 0:03:00] } 2. Nf3 { [%clk 0:02:59] } ...The clocks are rebuilt from the time the server charged each move, with the server's rule (first move of each side free, then charged and given the increment):
mainlineClocksinsrc/lib/pgn.ts. The board now takes the server'smove_timeswhen its answers come (syncMoveTimes), in place of the times the page first gave the moves.AnalyzedGame.pgn), and the export writes the clocks found in a game's PGN (pgnClocks). Played games get them once CSSLab/maia-platform-backend#388 is deployed; Lichess games get theirs now (their exports used to drop them too).Checks
src/lib/pgn.test.tsandExportGame.test.tsx;npx tsc --noEmit,npm run lint, and all 678 tests pass.Either PR can merge first: until the backend is deployed, played games' analysis exports simply have no clocks.
🤖 Generated with Claude Code