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. Chapter 7: Chinese Chess Engine Compilation and Makefile Build → Chapter 1: Portraits of Engine Dev…

☰ Contents

Chapter 7: Chinese Chess Engine Compilation and Makefile Build

7.1 Basic Makefile Structure

The Makefile of a Chinese Chess engine typically includes the following targets:

release: Release version (full optimization, no debug information) debug: Debug version (no optimization, includes debug symbols) profile: Profiling version (includes profiling symbols) test: Test version (includes unit tests)

Compiler flag selection: -O3: Highest level of optimization (release version) -march=native: Optimize for the current CPU architecture -lto: Link-Time Optimization -fno-exceptions: Disable exception handling (not needed in engines)

7.2 Compilation Options for Different CPU Architectures

Generic compilation: make build ARCH=x86-64

Specific architecture compilation: make build ARCH=x86-64-avx2 (for CPUs supporting AVX2) make build ARCH=x86-64-bmi2 (for CPUs supporting BMI2) make build ARCH=x86-64-avx512 (for CPUs supporting AVX512, some high-end CPUs)

ARM architecture compilation: make build ARCH=armv8 (generic ARMv8) make build ARCH=armv8-neon (for ARMv8 with NEON support, such as Apple Silicon)

Chapter 8: Future Technical Directions for Chinese Chess Engines

8.1 Meta-Learning and Transfer Learning

Meta-Learning and Transfer Learning may bring breakthroughs to Chinese Chess engine development:

Transfer learning applications in chess: Using network weights from international chess NNUE training as the starting point for Chinese Chess training. Due to the structural similarity between international chess and Chinese Chess (both are perfect-information, two-player alternating-move games), transfer learning can significantly reduce the number of samples required for training.

Potential of meta-learning: Through meta-learning, engines can more quickly adapt to new positions and new opponents. Meta-learning gives engines the ability to “learn how to learn.”

8.2 Deepening Human-Computer Collaboration

Future human-computer collaboration may go beyond the simple “human watches engine analysis and plays” model:

Conversational analysis: Interact with the engine through natural language; the engine can explain its analytical results in natural language.

Personalized training: The engine can generate targeted training tasks based on the user’s specific weaknesses.

Cognitive assistance: The engine can identify and supplement blind spots in the human player’s cognition.

8.3 Continued Standardization

Future directions for standardization in Chinese Chess engines include:

  1. Protocol standardization: Further refine the UCCI protocol, standardize engine options and extensions
  2. Testing standardization: Establish unified Chinese Chess engine testing benchmarks
  3. Data standardization: Promote the formatting and open availability of game record data and NNUE training data
  4. API standardization: Provide standardized engine APIs for online analysis platforms

Volume VIII: Detailed Explanation of Technical Terms

Mathematical Foundation of Alpha-Beta Pruning

The mathematical principle of Alpha-Beta pruning is based on the Minimax theorem and pruning conditions. Given a game tree node n, assuming search depth d, the pruning condition is:

If alpha >= beta, prune.

The intuitive meaning of this condition: The MAX player (alpha player) already has a guaranteed payoff of at least alpha, while the MIN player (beta player) guarantees that the MAX player will not obtain a payoff higher than beta. When alpha >= beta, the guarantees of both sides conflict — the MAX player has already achieved the upper limit that the MIN player is willing to accept.

Under optimal ordering (best move searched first), the node complexity of Alpha-Beta is: N = O(b^(d/2))

Under worst-case ordering (worst move searched first), the complexity degrades to: N = O(b^d)

The branching factor b for Chinese Chess is approximately 40-60, meaning that under optimal ordering, the search depth can increase by approximately 60-80%.

Mathematical Principle of Iterative Deepening

The total computational cost of Iterative Deepening (ID) can be expressed as: Total = Σ_{i=1}^{D} N_i

where N_i is the number of search nodes at depth i, and D is the final search depth.

In Alpha-Beta search, N_i ≈ O(b^(i/2)) (under optimal ordering).

The total computational cost of iterative deepening: Total ≈ Σ_{i=1}^{D} k × b^(i/2) = k × (b^(D/2+1) - b^(1/2)) / (b^(1/2) - 1)

Compared to the computational cost of direct deepest search (k × b^(D/2)), the additional cost of iterative deepening is: Ratio ≈ 1 / (1 - 1/b^(1/2))

When b=40, Ratio ≈ 1.19. That is, iterative deepening consumes only about 19% more computation than direct deepest search, while providing multiple benefits such as time controllability, transposition table warm-up, and search stability.

Mathematical Principle of SEE (Static Exchange Evaluation)

SEE evaluates the net gain or loss of a capture exchange sequence. Its evaluation method is as follows:

Given a capture move (piece A at position P1 captures piece B at position P2), SEE calculates the net gain or loss of the exchange sequence at position P2:

  1. Record the piece value V_B at position P2
  2. Assume the attacking side uses piece A to capture piece B, generating a net gain gain = V_B (tentative for now)
  3. The defending side recaptures the attacking piece at P2 with the lowest-value piece that can legally move to P2
  4. The attacking side recaptures the defending piece at P2 with the lowest-value piece
  5. Repeat until one side cannot continue
  6. The total net gain is the accumulation of all steps

Assumption of SEE: Both sides perform captures in order from lowest value to highest value. This assumption holds in most cases, but may not hold in sacrifice attacks.


Document Metadata

Report Title: Research Report on the History of Computer Chinese Chess Game-Playing Version: V1.0 Date: July 2026 Author: Community Collaborative Writing Maintenance and Updates: Will be continuously updated License: Public Document (free distribution)

Volume IX: Community History Deep Dive

Chapter 1: Portraits of Engine Developers

1.1 Chen Chaoying (陈朝营): From Individual Developer to Commercial Engine Leader

Chen Chaoying is one of the most important figures in the history of Chinese Chess engines. His engines Cyclone (Xiangqi Xuanfeng / 象棋旋风) and Intella (Yitian Xiangqi / 倚天象棋) represented the highest level of Chinese Chess engines between 2005 and 2010.

Chen Chaoying did not have a formal computer science background. Driven by his passion for programming and Chinese Chess, he started learning engine development technology from scratch. His technical accumulation process included:

  1. Studying the open-source code of ElephantEye to understand the basic architecture of Chinese Chess engines
  2. Learning advanced technologies from international chess engines (especially Crafty and Fruit)
  3. Exchanging ideas with community members on the Qizhong Forum (棋中论坛), receiving feedback and technical advice
  4. Testing engine performance through competitions, continuously optimizing and improving

Chen Chaoying’s developer diary (published on the Qizhong Forum) recorded his mental journey and technical thoughts during engine development. These diaries are precious historical materials for Chinese Chess engine development.

Chen Chaoying’s technical philosophy:

  • Search is king: He believed the core of engine strength lies in search efficiency, with evaluation function being secondary
  • Engineering first: He emphasized code efficiency and performance optimization, focusing on compile-time and runtime performance
  • User-oriented: He valued engine usability and user experience, making Cyclone the ideal choice for most users

1.2 Huang Chen (黄晨): Technical Contributions of the “Father of Open Source”

Huang Chen’s contributions to the UCCI protocol have already been discussed in detail in earlier chapters. Here we supplement some aspects of his technical persona:

Huang Chen’s technical philosophy:

  • Open sharing: He insisted on releasing ElephantEye under the LGPL license, even though it meant his engine could never catch up to commercial engines in playing strength
  • Education first: The technical documentation he wrote aimed at teaching, helping beginners understand and master engine development technology
  • Standardization promotion: The UCCI protocol and XQF format he designed promoted the standardization of the Chinese Chess engine ecosystem

Huang Chen’s xqbase.com website not only released ElephantEye but also compiled extensive Chinese Chess programming resources. The website content includes:

  • Detailed implementation of position representation
  • Algorithmic optimization of move generation
  • Implementation framework of the search tree
  • Design concepts of the evaluation function
  • Complete specification of the UCCI protocol
  • FAQ on Chinese Chess programming

The maintenance of xqbase.com continued for over a decade, during which Huang Chen continuously updated and supplemented content. Even after ElephantEye’s playing strength was surpassed by commercial engines, he persisted in maintaining the website and code.

Huang Chen also developed a series of tools:

  • ElephantBoard (Xiangqi Wizard / 象棋巫师): a feature-rich Chinese Chess GUI
  • XQFTOOLS: conversion tools between XQF format and PGN format
  • UCCI debugger: a tool to help developers test UCCI protocol implementations

These tools formed the infrastructure for Chinese Chess engine development, lowering the barrier to entry for others.

1.3 Jiang Zhimin (蒋志敏) and Zhang Min (张闽): The Technical Story of the “Mingshou” Duo

Jiang Zhimin and Zhang Min’s Xiangqi Mingshou (象棋名手) created a glorious history in the field of commercial Chinese Chess engines. The characteristics of this duo:

Jiang Zhimin was primarily responsible for the engine’s search algorithm and core engine logic. He had profound expertise in search optimization, and Mingshou’s PVS search efficiency was leading among engines of its era.

Zhang Min was primarily responsible for the evaluation function and positional understanding. He had a deep understanding of Chinese Chess principles, and Mingshou’s evaluation function is considered the pinnacle of the handcrafted evaluation era.

The division of labor and cooperation between the two was the key to Mingshou’s success: one focused on “how to search” (search algorithms), and the other focused on “how to evaluate” (evaluation function). This specialized division of labor was extremely rare in the Chinese Chess engine community, which was dominated by individual developers.

The naming of Mingshou also has an interesting story: the characters “名手” (Mingshou) simultaneously convey the meaning of “famous player” and implicitly the corporate vision of “a famous master produces outstanding students” (the engine helps players improve their level).

Mingshou’s emphasis on the Chinese Chess teacher community was also a factor in its success. The Mingshou team collaborated with multiple chess schools and training institutions, making Mingshou the standard tool for chess teaching.

1.4 Li Guolai (李国来) and GGzero: A Pioneer in Reinforcement Learning

Li Guolai’s Jiajia Xiangqi (佳佳象棋) initially used a traditional Alpha-Beta architecture. However, he keenly recognized the revolutionary significance of AlphaZero for chess AI.

The GGzero project was Li Guolai’s exploration of the reinforcement learning path. The main challenges faced by this project:

  1. Insufficient computational resources: Deep reinforcement learning requires extensive GPU computing resources, which were very limited for an individual developer
  2. Immature technical approach: At the time, academic research on reinforcement learning for Chinese Chess was in a very early stage
  3. The gap from Alpha-Beta: GGzero’s playing strength never reached the level of traditional Alpha-Beta engines

Nevertheless, GGzero’s exploration accumulated important experience for the subsequent development of Chinese Chess engines. It proved that:

  1. MCTS + neural networks can be applied to Chinese Chess
  2. Self-play training can generate useful position evaluation data
  3. The technical path of reinforcement learning for Chinese Chess requires more community collaboration

1.5 Daniel Tan: A New Generation Cross-Disciplinary Developer

Daniel Tan represents a new generation of Chinese Chess engine developers. His background reflects the diversification trend among Chinese Chess engine developers:

  • Academic background: Daniel Tan has research experience in computer science
  • Cross-disciplinary vision: His research covers NNUE design, training dataset optimization, search algorithm improvement, etc.
  • International collaboration: He co-authored an academic paper on NNUE training datasets with Neftali Watkinson Medina

Daniel Tan’s Orange engine is a representative example of an independent Chinese Chess NNUE engine. Unlike Pikafish, which is based on the Stockfish codebase, Orange is a standalone engine implemented from scratch. Although difficult, this “from scratch” development approach helps deepen understanding of NNUE technical details.