Skip to content

Add PGN4 team replay with forced recorded moves and move comparison - #6

Merged
KnightStackSys merged 11 commits into
mainfrom
feature/pgn4-team-replay-20261115
Nov 15, 2026
Merged

KnightStackSys merged 11 commits into
mainfrom
feature/pgn4-team-replay-20261115

Conversation

@KnightStackSys

Copy link
Copy Markdown
Owner

Feature

Add tunex replay to reproduce recorded IronPhoenix 4-player Teams games while preserving the same engine process and its accumulated search history.

  • Read a complete four-seat PGN4 game from configs/*.txt (or any TXT path).
  • Select --team RY or --team BG. Tunex searches only the selected team's turns and takes all other moves directly from the PGN.
  • On tested turns show the engine's bestmove, the recorded move, MATCH or DIFFERENT, and available cp/mate score.
  • Even on a mismatch, force the PGN move so the original game sequence is followed to the end.
  • Use the existing native IronPhoenix SAN/PGN4 converter and legal-move listing; fail with ply/seat context on invalid moves.
  • Call ucinewgame only once; use one engine process to retain search histories and transposition-table contents across selected-team searches.
  • Optional --report JSON output with per-ply comparisons.
  • Add a seven-round example PGN4 TXT from the phantom-mate report and mock-engine replay tests.
  • Keep normal match/SPRT/SPSA/Bayesian/Texel commands unchanged.

Usage

tunex -c configs/replay.example.json replay --file phantom_mate_game.txt --team BG --report results/phantom_mate_bg.json
tunex -c configs/replay.example.json replay --file phantom_mate_game.txt --team RY

The PGN and report paths resolve relative to the selected config's directory. Adjust the executable path, thread count and search settings first.

Verification

Added test coverage for PGN4 round parsing, selection of only the tested team's searches, forced move continuation, persistent process/new game semantics and report output. CI and actual engine integration not yet verified; please run pytest and a real IronPhoenix replay.

Caveat

History from the selected engine's searched turns is retained; forced opponent turns do not themselves execute opponent searches. A replay can therefore differ from original online play when multiple engines or nondeterministic threads were involved.

@KnightStackSys
KnightStackSys merged commit 4ad4646 into main Nov 15, 2026
4 checks passed
@KnightStackSys
KnightStackSys deleted the feature/pgn4-team-replay-20261115 branch November 15, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant