Why are Xiangqi rules controversial?
The rules of Xiangqi have never been unified, the main example being the repetition rules.
The repetition parts of the offline "Xiangqi Competition Rules" (《象棋竞赛规则》) and the "World Xiangqi Rules" (《世界象棋规则》, formerly the Asian Xiangqi Competition Regulations) are not qualified Xiangqi rules: they are imprecise and inaccurate, vague and ambiguous, and highly subjective. Different referees each have their own interpretations.
This has led to program rules that are also not unified. The program rules written by different authors are not entirely the same.
So it is perfectly normal for different engines and different platforms to disagree on the rules.
Some platforms additionally ban certain repetitions. Where these conflict with the engine's rules, you get the so-called "rule trap" (棋规刀). For example, the engine's rules consider a certain repetition a draw with a score of 0, but the platform rules it a violation.
To deal with this inconsistency, Pikafish drew up a rigorous set of program rules based on the World Xiangqi Rules. The detailed written rules can be found at the following link: Xiangqi Program Competition Rules (HTML)
For the specific code implementation, see GitHub.
