Skip to content

feat(pu/tj): add Chinese chess environment and alphazero/muzero bot training demo - #499

Merged
puyuan1996 merged 5 commits into
feat/uz-ppofrom
dev-chinese-chess
Aug 21, 2026
Merged

feat(pu/tj): add Chinese chess environment and alphazero/muzero bot training demo#499
puyuan1996 merged 5 commits into
feat/uz-ppofrom
dev-chinese-chess

Conversation

@puyuan1996

Copy link
Copy Markdown
Collaborator

Summary

  • add a dependency-free Chinese chess environment with standard rules, canonical 57-plane observations, and a compact 2,086-action encoding
  • add AlphaZero and MuZero CTree random-bot training presets, terminal bot-human examples, and a multi-seed evaluation entry
  • add tests for rules, action mirroring, bot mode, state serialization, and CTree compatibility

Design

  • avoids vendoring GPL-3.0 rule engines into Apache-2.0 LightZero
  • serializes observation history, counters, and recent repetition hashes so AlphaZero CTree reset reproduces search state
  • uses scalar MuZero action encoding to avoid a 2,086-channel dynamics input

Verification

  • pytest -q zoo/board_games/chinese_chess/test — 14 passed
  • AlphaZero and MuZero model initial/recurrent forward passes with (57, 10, 9) observations and 2,086-action heads
  • AlphaZero CTree batch search and MuZero CTree search both returned legal actions

This follows the Chinese-chess work explored in #442 and #459 with an independently implemented, compact rules core.

puyuan1996 and others added 5 commits August 14, 2026 21:47
- Document Xiangqi state, observation planes, action mask, rewards, termination, and battle modes
- Explain bot-mode agent and random-bot transitions and MuZero stochasticity
- Add clear training, checkpoint evaluation, terminal-play, and direct environment examples
- Update MuZero bot-mode timestep and target settings with regression coverage
- Add a terminal example using play_with_bot_mode without a checkpoint
- Document ICCS input, deterministic seeding, and the random-bot workflow
- Clarify that this baseline is not an Xiangqi MCTS engine
@puyuan1996 puyuan1996 changed the title feat(env): add Chinese chess environment and bot training feat(pu/tj: add Chinese chess environment and bot training Aug 21, 2026
@puyuan1996 puyuan1996 changed the title feat(pu/tj: add Chinese chess environment and bot training feat(pu/tj): add Chinese chess environment and bot training Aug 21, 2026
@puyuan1996 puyuan1996 changed the title feat(pu/tj): add Chinese chess environment and bot training feat(pu/tj): add Chinese chess environment and alphazero/muzero bot training demo Aug 21, 2026
@puyuan1996
puyuan1996 merged commit 420b653 into feat/uz-ppo Aug 21, 2026
1 of 6 checks passed
puyuan1996 added a commit that referenced this pull request Aug 21, 2026
Preserve PR #496 as the first-parent integration and include the already merged PR #499 feat/uz-ppo changes.
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