Research Report on the History of Computer Chinese Chess (Xiangqi) Game-Playing
A structured history of Chinese chess engine development from the 1980s to 2026, covering major engines, protocols, and community tooling. Xiangqi Engine Special Topic Materials 1 → Controversy 4: The Reproducibility Problem of Engine Tes…
Xiangqi Engine Special Topic Materials 1
Topic 1A: Performance Optimization of Move Generators
The move generator is one of the most frequently used functions in a Xiangqi engine. Optimizing move generator performance can significantly improve the engine’s overall search efficiency.
Optimization strategy 1: Precomputed tables. At engine startup, precompute all moves for all pieces at all positions, stored in lookup tables. At runtime, the move generator only needs to look up tables and filter legal moves, rather than dynamically generating them each time.
Optimization strategy 2: Bitboard operations. Use bitboards for move generation, generating multiple moves at once through bitwise operations, reducing loop iterations.
Optimization strategy 3: Incremental updates. After each move, only update affected move data rather than regenerating all moves.
Optimization strategy 4: Templating and inlining. Use C++ templates and inline functions to reduce function call overhead.
Optimization strategy 5: Cache friendliness. Ensure move generator data structures and access patterns are CPU cache-friendly.
Topic 1B: Evaluation Function Update Strategies
The evaluation function is called frequently during engine search; its update strategy has an important impact on performance:
Full evaluation: Recalculate all feature values each time evaluation is needed. This method is simple but computationally intensive.
Incremental evaluation: After each move, only update affected feature values. This approach significantly reduces evaluation overhead.
Lazy evaluation: In search, if the evaluation of certain branches is already sufficient to determine the result, full evaluation can be delayed or skipped.
NNUE incremental update: The NNUE evaluation network naturally supports incremental updates, updating only a few input features after each move.
Topic 1C: Search Stability Improvements
Search stability refers to the consistency of move suggestions given by the engine between consecutive positions. Methods to improve search stability:
Time management optimization: When remaining time is ample, wait for search to stabilize before outputting a move.
Evaluation smoothing: Apply smoothing to evaluation results to reduce evaluation fluctuations between adjacent searches.
PV stability checking: Continuously monitor PV (principal variation) changes during search. If the PV changes frequently, additional search time may be needed.
Randomization: Introduce a small amount of randomization among variations of similar strength to prevent the engine from repeatedly playing different moves in the same position.
Topic 1D: Opening Book Usage Strategies
Opening books have an important impact on an engine’s practical performance. Usage strategies include:
Opening book depth: Within the range covered by the opening book, the engine does not use search, directly returning moves from the opening book. The depth of an opening book is typically between 5-15 moves.
Opening book quality: Data in the opening book should come from high-level games (master-level or engine super-high-level games).
Opening book updates: Regularly update the opening book to incorporate the latest opening theory developments.
Opening book limitations: Over-reliance on an opening book may cause the engine to perform poorly in positions outside the opening book.
Topic 1E: Endgame Tablebase Usage Strategies
Endgame tablebases guide engines in precise calculation during the endgame. Usage strategies include:
Endgame tablebase coverage: The range of material combinations covered by the endgame tablebase determines the engine’s accuracy in the endgame.
Endgame tablebase priority: In positions covered by the endgame tablebase, prioritize using the tablebase result (rather than search).
Endgame tablebase query overhead: The query time of the endgame tablebase should be as short as possible, avoiding becoming a search bottleneck.
Volume XXVIII: Important Historical Controversies in the Xiangqi Engine Community
Controversy 1: The Strength Debate Between Xuanfeng and Mingshou
Between 2009 and 2014, the strength debate between Xiangqi Xuanfeng (Cyclone) and Xiangqi Mingshou (Master) was one of the most heated topics in the Xiangqi engine community. This debate had no clear conclusion, but it drove the rapid development of Xiangqi engine technology.
Core points of contention:
- Evaluation function precision: Mingshou’s hand-crafted evaluation was considered more refined, while Xuanfeng emphasized search efficiency
- Parallel search efficiency: Mingshou’s distributed support was its technical advantage
- Opening book quality: Both had their respective advantages in opening books
- Testing conditions and methods: Different test settings led to different conclusions
Controversy 2: The Closed-Source Issue of Commercial Engines
Between 2005 and 2020, the closed-source issue of commercial engines sparked heated discussions in the community:
Arguments supporting closed source:
- Engine development requires significant time and effort; developers have the right to be compensated
- Commercial operation is a condition for continuous engine improvement
- Closed source protects developers’ intellectual property
Arguments supporting open source:
- The development of Xiangqi engines relies on the accumulation and dissemination of knowledge
- Closed source hinders technological progress and innovation
- Open source allows more people to participate in engine development
This controversy was largely resolved in 2022 after the open source engine Pikafish’s strength surpassed commercial engines.
Controversy 3: The Interpretability Problem of NNUE Evaluation
The NNUE evaluation network far surpasses hand-crafted evaluation in accuracy, but its interpretability is much lower:
Interpretability of hand-crafted evaluation: Developers can understand the contribution of each feature to the evaluation value and can tune for specific position types.
The black-box problem of NNUE evaluation: It is generally impossible to understand why NNUE makes a particular evaluation. This leads to the following issues:
- When NNUE has evaluation errors in special positions, it is difficult to locate and fix
- Unable to perform targeted tuning for specific position types
- Difficult to use in legally and ethically sensitive application scenarios
Controversy 4: The Reproducibility Problem of Engine Testing
The reproducibility problem of Xiangqi engine testing:
Problem description: Different testers may obtain different test results with the same engine and same settings.
Cause analysis:
- Hardware differences (CPU model, memory configuration, etc.)
- Operating system differences (thread scheduling, memory management, etc.)
- Precision issues in time control
- Random selection in opening books
Solutions:
- The introduction of Fishtest provided a standardized testing environment
- Seeds control random number generation
- Using statistical methods to handle randomness in test results