Source-linked AI summary
CoToan: Executable Rules and a Representation Contract for Reproducible Game AI Evaluation
Ha-Thanh Nguyen
TL;DR
Game AI comparisons require implementations to expose the same decision problem, but representation choices can alter action probabilities or merge states with different outcomes. CoToan specifies rules and a contract connecting GDL with OpenSpiel. Its evaluated cases show agreement across representations, while diagnostics demonstrate that action identity and state configuration affect the task.
Problem
Game AI results are comparable only when implementations expose the same decision problem, yet representational choices can alter action probabilities or merge states with different outcomes.
Source: §I · p. 1Method
CoToan combines versioned executable rules, a GDL description, and an OpenSpiel interface under a contract preserving actions, transitions, time, and configuration identity.
Source: §I · p. 1Results
No mismatches were found in evaluated cases, and diagnostics show that witness-level actions can alter sampling while omitted time or victory settings can merge states with different terminal outcomes.
Source: §VI · p. 6Takeaways & Limitations
Consistent action identity, sufficient state information, and explicit task configuration are required for reproducible game AI evaluation.
Source: §VI · p. 6Synthetic fixtures and short-horizon simulations target correctness rather than typical strategic behavior, and the diagnostics do not quantify effects on learning strength, game balance, or educational outcomes.
Source: E. Limitations and validity · p. 6
Abstract
from arXiv · showhide
Game AI results are comparable only when different implementations expose the same decision problem. Yet seemingly minor representation choices can silently change that problem by altering action probabilities or collapsing states with different outcomes. We study this issue through CoToan, an executable specification and representation contract for Vietnamese Mathematical Chess connecting the Game Description Language (GDL) with OpenSpiel. The game provides a useful case because a single capture may have multiple arithmetic justifications, while outcomes can depend on scoring rules and a finite playing horizon. CoToan therefore represents actions by their state transitions rather than by arithmetic witnesses, and treats time and victory configuration as part of task identity. Cross-representation tests show agreement in legal actions, successor states, and terminal outcomes across hundreds of sampled and constructed positions, complemented by exhaustive checks of all 32 operator masks and 512 opposing-material subsets. Controlled diagnostics further show that uniform witness-level sampling alters endpoint-action probabilities, while omitting remaining time or victory settings can merge states with different terminal behavior. These results show that action semantics, time, and victory configuration are not merely implementation details. They are part of the experimental task itself and must be represented explicitly for reproducible game AI.
I. INTRODUCTION
The introduction frames reproducibility as a question of whether implementations expose the same decision problem, not merely whether they share reachable positions. CoToan addresses this with executable rules and a cross-representation contract, then tests action identity and state sufficiency.
- Implementation choices can alter action probabilities or merge states with different outcomes, silently changing the task presented to an agent.Differences in action semantics, time information, or victory configuration also prevent clean attribution of agent behavior differences to algorithms alone.Source: §I · p. 1
- CoToan combines versioned executable rules, a declarative GDL description, an OpenSpiel environment, and reproducible conformance diagnostics.Its design separates task mechanics and settings, arithmetic witnesses, and the agent interface.Source: §I · p. 1
- The executable task definition specifies arithmetic capture, path blocking, capture-value scoring, and ordered terminal conditions, while separating invariant mechanics from victory settings.Source: §I · p. 1
- The cross-representation contract preserves legal actions, transitions, time, and configuration identity between GDL and OpenSpiel, treating arithmetic witnesses as metadata rather than agent actions.Source: §I · p. 1
- Conformance comparisons and controlled diagnostics examine legal actions, successor states, outcomes, witness-level sampling distortion, and state aliasing from omitted time or victory settings.Source: §I · p. 1
- The three research questions test representation agreement, witness-level action sampling, and whether board occupancy and player-to-move suffice under finite horizons and configurable victory rules.Together, these requirements concern consistent transitions, unambiguous action identity, and sufficient adjudication state—not training outcomes or playing strength.Source: §I · pp. 1–2
II. THE GAME: BOARD, MOVEMENT AND ARITHMETIC CAPTURE
The research profile defines a two-sided arithmetic board game with fixed zero pieces and configurable scoring and victory rules. Ordinary movement is limited by piece value and clear paths.
A. Board and objective
- Each side starts with one piece of each value from 0 through 9; Red moves first by default, and each side’s zero is fixed on the board.Capturing the opponent’s zero wins; other captures add the target’s value to the score and may trigger configured victory.Source: A. Board and objective · p. 2, Figure 1 · p. 2
B. Ordinary movement
- A nonzero piece moves 1 to its value’s number of squares in any straight or diagonal direction, but every traversed square must be empty.It cannot turn, jump, or capture an enemy through ordinary sliding movement.Source: B. Ordinary movement · p. 2
- In the local example, c4-e6 is legal, c4-f7 exceeds the red 2’s range, and c4-e4 is blocked by the piece on d4.The examples distinguish a range violation from a path obstruction.Source: Figure 2 · p. 2, B. Ordinary movement · p. 2
C. Arithmetic capture
Arithmetic capture uses an attacker and adjacent friendly support to determine a positive target distance along a straight line. The target is not an operand, and multiple arithmetic results may justify one move.
C. Arithmetic capture
- A capture requires an attacker, adjacent friendly support, and an enemy target on the same line; an enabled arithmetic result sets the positive distance from support to target.The intervening squares must be empty, the attacker replaces the target, and the support remains stationary.Source: C. Arithmetic capture · p. 2
- In the example, red 2 on c4 uses red 1 on d4 to capture on f4 because 2 × 1 = 2; the attacker moves to f4 while the support stays.Source: C. Arithmetic capture · p. 2
- Both floor(8/3)=2 and 8 mod 3=2 justify c4xf4, producing the same successor state.A piece on e4 blocks the capture of f4 but can itself be captured using 2-1=1.Source: C. Arithmetic capture · p. 2
C Blocked: c4xf4 is illegal with e4 occupied
The paper distinguishes arithmetic justifications from actions and treats scoring, victory settings, and the finite horizon as parts of task semantics. These choices affect how outcomes are adjudicated.
D Two witnesses; one action c4xf4
- Two witnesses can justify the single action c4xf4; the witnesses are not separate moves.The figure’s examples are constructed local positions, not claims about reachability.Source: Figure 3 · p. 3, D Two witnesses; one action c4xf4 · p. 3
D. Scoring and victory settings
- Captured values accumulate as scores; a positive threshold enables immediate victory, while threshold zero disables it.At the default 300-ply horizon, the higher score wins and equal scores draw; threshold victory and horizon adjudication are separate settings.Source: D. Scoring and victory settings · p. 3
- Terminal conditions are checked in order: zero capture, threshold victory, horizon adjudication, then no-move loss.Unconditional horizon draw is optional rather than the default; clocks and unbounded duration are not modeled, and each configuration has its own task identifier.Source: D. Scoring and victory settings · p. 3
III. RELATED WORK
The related work situates CoToan between declarative game-description formalisms and agent-facing interfaces, then connects its focus on task agreement to reproducible evaluation. Its contribution is a versioned game specification and conformance evidence, not a new general game language or search algorithm.
A. Game description and interoperability
- GDL and OpenSpiel serve complementary roles: CoToan uses GDL’s explicit relational semantics and OpenSpiel’s integration with search and learning code.The paper distinguishes these purposes from PGN/FEN interchange and other board-game description systems.Source: A. Game description and interoperability · p. 3
B. Search, learning and reproducible evaluation
- Search and self-play systems motivate an algorithm-independent environment with well-defined legal actions, observations, and rewards.The cited examples span UCT, MCTS, AlphaGo, AlphaZero, and MuZero.Source: B. Search, learning and reproducible… · p. 3
- CoToan addresses agreement on the task itself through a versioned specification and property-based conformance checks, rather than proposing a new game language or search algorithm.Its horizon diagnostic instantiates an established finite-horizon issue in a reachable position; it is not claimed as a new general result.Source: B. Search, learning and reproducible… · p. 3
IV. EXECUTABLE SPECIFICATION AND REPRESENTATION CONTRACT
The executable specification defines states using board occupancy, controller, elapsed plies, and immutable task settings. It formalizes movement and capture conditions and derives captured-value scores from board occupancy.
A. State and legal actions
- A state records board occupancy, the controller, elapsed plies, and immutable settings for horizon, threshold, horizon rule, operators, and starting player.Well-formed states constrain piece identities, surviving zeros, and elapsed plies; snapshots after both players have crossed a positive threshold are rejected.Source: A. State and legal actions · pp. 3–4
- Captures require friendly support, a positive arithmetic result, an enemy target at the resulting distance, and clear intervening squares.Ordinary moves travel up to the attacker’s value along an empty path; division is floored, and only enabled operators provide capture witnesses.Source: A. State and legal actions · p. 4
- Captured-value scores are derived from surviving opposing material, since captures remove pieces and no rule creates them.The initial sum is 45, and settings determine when accumulated points decide the winner.Source: A. State and legal actions · p. 4
B. Actions are transitions, not arithmetic witnesses
CoToan identifies actions by their source and destination, treating arithmetic justifications as explanatory metadata rather than separate agent choices. This preserves successor relations while avoiding a policy confound from witness multiplicity.
B. Actions are transitions, not arithmetic witnesses
- Actions use source and destination as identity; arithmetic witnesses remain explanatory metadata, not separate agent actions.The GDL term is (move sSRC sDST), while the OpenSpiel ID is 99*SRC+DST with illegal entries masked.Source: B. Actions are transitions, not… · p. 4
- Collapsing captures with identical endpoints preserves their successor relation but not uniform sampling over arithmetic witnesses.An endpoint action’s witness count can therefore change its probability under witness-level sampling.Source: B. Actions are transitions, not… · p. 4
- The endpoint contract prevents arithmetic multiplicity from becoming an extra agent decision and a potential policy confound.Source: B. Actions are transitions, not… · p. 4
C. Declarative encoding and one-step correspondence
The declarative GDL encoding and sequential OpenSpiel interface are specified to correspond on actions, transitions, and outcomes. The framework observation exposes state and task information, while executable tests check the representations’ realizations.
C. Declarative encoding and one-step correspondence
- GDL encodes dynamic facts, geometry, arithmetic pairs, enabled operators, scores, and victory settings in finite rules without engine-specific arithmetic extensions.Candidate actions precede terminal status, avoiding a legal/terminal cycle.Source: C. Declarative encoding and one-step… · p. 4
- For fixed settings and a well-formed nonterminal state, legal actions correspond bijectively, and the two representations produce matching successors and terminal outcomes.The proof sketch matches movement predicates, updates, score totals, and ordered adjudication tests.Source: C. Declarative encoding and one-step… · p. 4
- Executable tests check the representation definitions, generated facts, and adapter behavior rather than relying on the correspondence argument alone.Source: C. Declarative encoding and one-step… · p. 4
D. Observation and framework contract
- The OpenSpiel observation includes identity planes, controller, remaining budget, and configuration scalars; snapshots preserve complete settings and reject mismatched imports.Structural validation is not a reachability proof.Source: D. Observation and framework contract · pp. 4–5
E. Reusing search agents
CoToan supports agent reuse through OpenSpiel’s standard search interface while requiring shared rules, evaluation conventions, action handling, and configuration-aware state keys. Its reproducibility protocol tests implementations across sampled, constructed, and configuration-varying positions.
E. Reusing search agents
- Search agents can use OpenSpiel’s legal_actions, child or clone/apply_action, is_terminal, and returns methods, while shared cache keys distinguish configuration, board, controller, and remaining budget.A port preserves behavior only when rules, evaluation conventions, and action handling agree.Source: E. Reusing search agents · p. 5
A. Protocol and reproducibility
- The baseline protocol compares complete move sets, rotation/color-swap behavior, and snapshot round trips on 300 reachable samples and 300 structurally valid synthetic positions.The reachable samples come from ten trajectories of up to 30 plies; samples need not be distinct.Source: A. Protocol and reproducibility · p. 5
- Additional checks compare 70 selected GDL fixtures, audit nine configurations across 210 valid states, and exhaust all 32 operator masks and 512 subsets of Blue’s nonzero material.The protocol also checks histories, observations, configuration-mismatch rejection, and usability with one MCTS and one alpha-beta decision.Source: A. Protocol and reproducibility · p. 5
B. RQ1: Cross-representation conformance
The conformance audit compares representations across configurations, while the diagnostics show how witness-level actions and omitted task variables can change sampling or terminal behavior. The reported examples distinguish transition agreement from decision-problem equivalence.
B. RQ1: Cross-representation conformance
- The nine-configuration audit compared 210 valid states and one successor for each of 158 nonterminal cases across Python, GDL, and OpenSpiel; depth-one and depth-two counts were 87 and 7457 regression fingerprints.The audit also included 45 simulation tests; the depth counts are not game-tree size estimates.Source: B. RQ1: Cross-representation conformance · p. 5
C. RQ2: Arithmetic witnesses change action sampling
- Across 66 nonterminal fixtures, 6023 endpoint-action instances became 6031 witness-labeled instances; this diagnostic is not a prevalence estimate for normal play.Six fixtures contained duplicated endpoint actions.Source: C. RQ2: Arithmetic witnesses change… · p. 5
- In Fig. 3D, uniform endpoint sampling selects c4xf4 with probability 1/43, while uniform witness sampling selects it with probability 2/44=1/22 despite the identical board update.The controlled position has 43 endpoint actions and 44 witness-labeled actions.Source: C. RQ2: Arithmetic witnesses change… · p. 5
D. RQ3: Horizon omission aliases reachable states
- At plies 3 and 299, identical occupancy, controller, and legal actions lead to different outcomes after the same move: a nonterminal state at ply 4 and a draw at ply 300.The late draw follows from equal-score adjudication, not an unconditional draw rule; the budget channel separates the states.Source: D. RQ3: Horizon omission aliases… · p. 5
- With the same occupancy, controller, and ply, score adjudication yields a Red win while the optional draw setting yields a draw; threshold 9 ends the game where threshold 0 does not.These diagnostics establish information requirements, not a measured learning benefit.Source: D. RQ3: Horizon omission aliases… · p. 6
E. Limitations and validity
The specification and diagnostics are bounded in scope and do not measure strategic or learning outcomes. The conclusion reports no mismatches in evaluated cases and identifies action identity, state information, and task configuration as requirements for reproducible evaluation.
E. Limitations and validity
- The specification covers supported configurations rather than every historical or tournament variant, and its correspondence argument is not mechanized.Tests do not exhaust reachable states; GDL checks use a subset translator and clingo rather than an independent GGP competition runtime.Source: E. Limitations and validity · p. 6
- Synthetic fixtures and short-horizon simulations target correctness, while the diagnostics do not quantify effects on learning strength, game balance, or educational outcomes.The authors propose a subsequent agent study with matched computational budgets, exchanged colors, disclosed seeds, and reported uncertainty,.Source: E. Limitations and validity · p. 6
VI. CONCLUSION
- CoToan found no mismatches in evaluated cases, and its diagnostics show that reproducible evaluation requires consistent action identity, sufficient state information, and explicit task configuration.The reported effects include altered action-sampling probabilities and merged states with different terminal outcomes.Source: §VI · p. 6