Remove score_history from GameState #86
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
score_history: Vec is vestigial. Undo penalty is correctly tracked in the upstream SessionStats type.
Resolved in commit
372b642.score_history: Vec<i32>is removed, along with its siblingis_recycle_history. These existed as an undo journal for the old hand-rolled score, which was path-dependent (clamped to >=0 at every step) and therefore could not be reconstructed from the move history — the journal was the only wayundo()could restore the pre-move score.With scoring delegated to the upstream session,
undo()restores the board viasession.undo()and the score is re-derived fromsession.stats(), so the journal is no longer needed.Caveat worth recording: upstream does NOT roll back the inner stat counts on undo (it only restores the board + increments
undos). A live game's score and the same game reloaded from disk can therefore differ once undos are involved, because the saved forward history excludes undone moves. Accepted as part of the migration.