Chinese chess Xiangqi perft results

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Chinese chess Xiangqi perft results

Post by maksimKorzh »

Hi guys

I've just implemented move generator for my new xiangqi engine:
https://github.com/maksimKorzh/wukong-x ... /wukong.js

This was incredibly fun experience but surprisingly it wasn't trivial to get decent perft reults
as well as an engine to calibrate those results' accuracy by. But anyway I wanted to share
the perft results I found so far - one for initial positions and other for what I call Xiangqi Kiwipete equivalent:

Code: Select all

rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w - - 0 1
      depth       nodes    checks    captures
          1          44         0           2
          2        1920         6          72
          3       79666       384        3159
          4     3290240     19380      115365
          5   133312995    953251     4917734  
          6  5392831844

      r1ba1a3/4kn3/2n1b4/pNp1p1p1p/4c4/6P2/P1P2R2P/1CcC5/9/2BAKAB2 w - - 0 1
      depth       nodes    checks    captures
          1          38         1           1
          2        1128        12          10
          3       43929      1190        2105
          4     1339047     21299       31409
          5    53112976   1496697     3262495
This is the very first experience in my life when I came up with implementation completely on my own,
without grabbing it from other engines. I used mapping of piece codes to colors and types instead of
using bits to encode them within a piece itself - maybe not the fastest solution but at least no worth then my recent optimized WukongJS.
Anyway it's highly didactic so it would be truly trivial to understand how it works.

Guys you just probably can't ever imagine how happy and excited I am!
I didn't feel that happy when passed perft tests for chess for the first long time ago.

EDIT:
If you want to play around with it - just clone the source and run /src/gui/xiangqi.html in your browser.
Open devtools and perft would be there.

EDIT2:
To Gerd Isenberg:
Maybe you could add these 2 positions into CPW?
For now page for Chinese chess perft seems to be vacant.

EDIT3:
Ahhh... I thought I'm posting it to tech discussions...
Can moderators please move it to tech discussion?
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Chinese chess Xiangqi perft results

Post by maksimKorzh »

Thanks for moving to tech room.
Really sorry for miss clicking to general room.
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Chinese chess Xiangqi perft results

Post by phhnguyen »

maksimKorzh wrote: Wed Jan 27, 2021 5:59 pm
EDIT2:
To Gerd Isenberg:
Maybe you could add these 2 positions into CPW?
For now page for Chinese chess perft seems to be vacant.
I could update and recently I have been updating the Chinese chess topic for CPW. We need to verify the data then update it. That job takes time. If you are willing you may ask Gerd Isenberg for an Editor role and update yourself :)
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Chinese chess Xiangqi perft results

Post by maksimKorzh »

phhnguyen wrote: Sat Jan 30, 2021 12:21 pm
maksimKorzh wrote: Wed Jan 27, 2021 5:59 pm
EDIT2:
To Gerd Isenberg:
Maybe you could add these 2 positions into CPW?
For now page for Chinese chess perft seems to be vacant.
I could update and recently I have been updating the Chinese chess topic for CPW. We need to verify the data then update it. That job takes time. If you are willing you may ask Gerd Isenberg for an Editor role and update yourself :)
Editing CPW is great honor but I think that's a bit too much for me. It's kind of too big responsibility for me and also I'm nobody to edit CPW)
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Chinese chess Xiangqi perft results

Post by phhnguyen »

Come on. Wiki is for typical people but not only professors. You can post messages here thus you definitely can post too for CPW. You have some good data and you want to share since it may be useful to other people. That is enough to start updating CPW (say, just upload your data to a page) :D
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Chinese chess Xiangqi perft results

Post by phhnguyen »

https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Chinese chess Xiangqi perft results

Post by maksimKorzh »

phhnguyen wrote: Thu Feb 04, 2021 8:29 am Done for the first edit:

https://www.chessprogramming.org/Chinese_Chess_Perft
I still see empty page like before
Raphexon
Posts: 476
Joined: Sun Mar 17, 2019 12:00 pm
Full name: Henk Drost

Re: Chinese chess Xiangqi perft results

Post by Raphexon »

User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Chinese chess Xiangqi perft results

Post by maksimKorzh »

Awesome! Thanks for adding! Thanks for adding my Wukong Xiangqi engine and video tutorials as well!
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Chinese chess Xiangqi perft results

Post by phhnguyen »

Some Perft results from my test set. All are computed & verified by two different chess apps.

Middle games:

Code: Select all

1ceak4/9/h2a5/2p1p3p/5cp2/2h2H3/6PCP/3AE4/2C6/3A1K1H1 w - - 0 1
1: 7
2: 281
3: 8620
4: 326201
5: 10369923
6: 380156340
7: 12345505147

5a3/3k5/3aR4/9/5r3/5h3/9/3A1A3/5K3/2EC2E2 w - - 0 1
1: 25
2: 424
3: 9850
4: 202884
5: 4739553
6: 100055401
7: 2447759037

Below positions are complicated checks (double-checks with pins), especially designed to test lazy/update-on-fly move generators. They are easily passed for simple-straightforward generators but maybe so buggy for complicated ones.

Code: Select all

CRH1k1e2/3ca4/4ea3/9/2hr5/9/9/4E4/4A4/4KA3 w - - 0 1
1: 28
2: 516
3: 14808
4: 395483
5: 11842230
6: 367168327
7: 11194690506


R1H1k1e2/9/3aea3/9/2hr5/2E6/9/4E4/4A4/4KA3 w - - 0 1
1: 21
2: 364
3: 7626
4: 162837
5: 3500505
6: 81195154
7: 1765627003

C1hHk4/9/9/9/9/9/h1pp5/E3C4/9/3A1K3 w - - 0 1
1: 28
2: 222
3: 6241
4: 64971
5: 1914306
6: 23496493
7: 713048593

4ka3/4a4/9/9/4H4/p8/9/4C3c/7h1/2EK5 w - - 0 1
1: 23
2: 345
3: 8124
4: 149272
5: 3513104
6: 71287903
7: 1657573114

2e1ka3/9/e3H4/4h4/9/9/9/4C4/2p6/2EK5 w - - 0 1
1: 21
2: 195
3: 3883
4: 48060
5: 933096
6: 12250386
7: 235622620

1C2ka3/9/C1Hae1h2/p3p3p/6p2/9/P3P3P/3AE4/3p2c2/c1EAK4 w - - 0 1
1: 30
2: 830
3: 22787
4: 649866
5: 17920736
6: 517687990
7: 14455679002


ChH1k1e2/c3a4/4ea3/9/2hr5/9/9/4C4/4A4/4KA3 w - - 0 1
1: 19
2: 583
3: 11714
4: 376467
5: 8148177
6: 270587571
7: 6347480650

https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager