Engine-Engine matches on Android

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
abik
Posts: 819
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

Engine-Engine matches on Android

Post by abik »

I am extending Chess for Android with a feature to run automatic engine-engine matches between UCI engines that have been "natively" compiled for Android. After importing two UCI engines, or using the built-in Java engine for one, a fixed number of games is played using random openings from the built-in book while allocating a fixed time per move. All games are saved in a "match.pgn" file, which can be used by another chess program, such as Arena or Chessbase. A cross-table for a 1-second-per-move tournament between some UCI engines compiled for Android is shown below.

I hope to release this feature sometimes early in January.

Code: Select all

                 1          2          3          4          5 
1 Stockfish 1.9  ********** 11½0100101 111111½111 1111111111 1111111111 35.0/40
2 Crab 1.0 beta  00½1011010 ********** 111½1½1111 1111111111 1111111111 33.5/40
3 GNU Chess 5.07 000000½000 000½0½0000 ********** ½½11111110 1111111111 19.5/40
4 BikJump v2.1P  0000000000 0000000000 ½½00000001 ********** 1111111111 12.0/40
5 ZCT-0.3.2500   0000000000 0000000000 0000000000 0000000000 **********  0.0/40  (++)
++ ZCT replies immediately on "movetime" commands, explaining its poor performance in this tournament
outAtime
Posts: 226
Joined: Sun Mar 08, 2009 3:08 pm
Location: Canada

Re: Engine-Engine matches on Android

Post by outAtime »

Does your app connect to FICS or ICC?
outAtime
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Engine-Engine matches on Android

Post by Michel »

abik wrote:I am extending Chess for Android with a feature to run automatic engine-engine matches between UCI engines that have been "natively" compiled for Android. After importing two UCI engines, or using the built-in Java engine for one, a fixed number of games is played using random openings from the built-in book while allocating a fixed time per move. All games are saved in a "match.pgn" file, which can be used by another chess program, such as Arena or Chessbase. A cross-table for a 1-second-per-move tournament between some UCI engines compiled for Android is shown below.

I hope to release this feature sometimes early in January.

Code: Select all

                 1          2          3          4          5 
1 Stockfish 1.9  ********** 11½0100101 111111½111 1111111111 1111111111 35.0/40
2 Crab 1.0 beta  00½1011010 ********** 111½1½1111 1111111111 1111111111 33.5/40
3 GNU Chess 5.07 000000½000 000½0½0000 ********** ½½11111110 1111111111 19.5/40
4 BikJump v2.1P  0000000000 0000000000 ½½00000001 ********** 1111111111 12.0/40
5 ZCT-0.3.2500   0000000000 0000000000 0000000000 0000000000 **********  0.0/40  (++)
++ ZCT replies immediately on "movetime" commands, explaining its poor performance in this tournament
Very very nice!

Android is really a nice open hackable platform.

One small comment. I had a look at the generated pgn and seems to be not entirely standard compliant yet (it doesn't use SAN and it also does not give a result string at the end of the movetext, finally it is not 80 chars wrapped). It would also be nice if the time control was included.
User avatar
abik
Posts: 819
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

Re: Engine-Engine matches on Android

Post by abik »

Kenny,
Sorry, no online play.

Michel,
Thanks. Yes, I am rather sloppily using a long-flavored SAN, mainly because it allowed me to reuse code but also because all the chess programs that I tested accepted the extended notation. I have added time control information and now also annotate each move with engine analysis information.

Happy 2011 everyone!
User avatar
abik
Posts: 819
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

Re: Engine-Engine matches on Android

Post by abik »

I made the PGN format 'more' standard compliant using SAN and a few other changes. I now also annotate each move with search depth, score, expected reply if a principal variation is available, and the taken time in seconds. I am using my own annotation format to avoid misinterpretation in other chess programs, but this can easily change if required. A sample game is shown below (see http://www.open-chess.org/viewtopic.php ... 1&start=30 for a playable version).

Code: Select all

[Event "Chess for Android Match"]
[Date "2011.01.02"]
[Round "1"]
[TimeControl "1/1"]
[White "Chess for Android Engine"]
[Black "Stockfish 1.9"]
[Result "0-1"]
[PlyCount "48"]

1. e4 {[opening] 0.009} e5 {[opening] 0.001}
2. Nf3 {[opening] 0.021} Nc6 {[opening] 0.066}
3. Bc4 {[opening] 0.002} Nf6 {[opening] 0.002}
4. Ng5 {[opening] 0.001} d5 {[opening] 0.023}
5. Bxd5 {[5/9]6 1.145} Nxd5 {[10]355/d2d3 1.834}
6. exd5 {[4/9]6 1.188} Qxg5 {[11]375/d5c6 2.096}
7. dxc6 {[4/9]-94 1.271} Qxg2 {[12]404/h1f1 1.924}
8. Rf1 {[4/8]-474 1.124} Bh3 {[11]351/d1e2 1.474}
9. Qe2 {[5/10]-311 1.192} bxc6 {[12]379/d2d3 1.741}
10. Nc3 {[4/9]-307 1.151} Be7 {[11]436/c3e4 1.208}
11. Ne4 {[4/9]-316 1.242} f5 {[10]537/e4g3 1.968}
12. Ng3 {[4/9]-191 1.328} f4 {[10]529/g3e4 1.201}
13. Nh5 {[4/9]-329 1.294} g6 {[10]674/d2d4 1.67}
14. Ng7+ {[4/9]-390 1.398} Kf7 {[11]763/b2b3 1.62}
15. Ne8 {[4/9]-515 1.252} Rhxe8 {[9]965/e2c4 1.203}
16. a4 {[5/9]-623 1.103} Rad8 {[10]1062/b2b3 1.29}
17. a5 {[4/9]-724 1.146} Bh4 {[11]1377/e1d1 1.793}
18. a6 {[4/10]-703 1.115} Bg4 {[10]1640/e2c4 1.48}
19. Qc4+ {[4/9]-495 1.442} Kg7 {[13]1749/d2d3 1.692}
20. b4 {[4/9]-1151 1.215} Rd4 {[10]mate6/d2d3 1.237}
21. d3 {[4/9]-1143 1.156} Qf3 {[13]mate5/c4g8 1.465}
22. Kd2 {black mates in #3 1.182} Rxc4 {[49]mate3/d3c4 1.59}
23. dxc4 {black mates in #2 0.091} Rd8+ {[100]mate2/d2e1 0.542}
24. Ke1 {black mates in #1 0.003} Rd1+ 0-1
User avatar
abik
Posts: 819
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

Re: Engine-Engine matches on Android

Post by abik »

Zach send me a patch for ZCT that implements movetime. I recompiled the engine and put the latest binary on the UCI engines for Android website (http://www.aartbik.com/MISC/eng.html). Below an updated cross table of a quick tournament between a few engines.

Code: Select all

Chess for Android Match  2011

                              1          2          3          
1   GNU Chess 5.07.153.3b-32  ********** 1111111111 1111111111  20.0/20
2   ZCT-0.3.2500              0000000000 ********** 110½110½½0   5.5/20
3   BikJump v2.1P (32-bit)    0000000000 001½001½½1 **********   4.5/20