MinimalChess 0.2 released

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

unserializable
Posts: 64
Joined: Sat Oct 24, 2020 6:39 pm
Full name: Taimo Peelo

Re: MinimalChess 0.2 released

Post by unserializable »

Congratulations, Thomas!

Like promised some time ago, short overview about self-building MinimalChess 0.2 on Ubuntu Linux. Below is compilation using MS .NET Core, notes are selective composition from general .NET Core Linux instructions at: https://docs.microsoft.com/en-us/dotnet ... tall/linux and Ubuntu Linux specific .NET Core installations instructions at: https://docs.microsoft.com/en-us/dotnet ... nux-ubuntu

Code: Select all

$ wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
$ sudo dpkg -i packages-microsoft-prod.deb

# Here I go for 3.1 core version explicitly, not 5.0 to verify compatibility with 3.1
$ sudo apt-get update; \
    sudo apt-get install -y apt-transport-https && \
    sudo apt-get update && \
    sudo apt-get install -y dotnet-sdk-3.1

$ git clone https://github.com/lithander/MinimalChessEngine.git
$ cd MinimalChessEngine/

$ dotnet build

Welcome to .NET Core 3.1!
---------------------
SDK Version: 3.1.406

...
snipped
...
--------------------------------------------------------------------------------------
Microsoft (R) Build Engine version 16.7.2+b60ddb6f4 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /some_folder/MinimalChessEngine/MinimalChess/MinimalChess.csproj (in 153 ms).
  Restored /some_folder/MinimalChessEngine/MinimalChessEngine/MinimalChessEngine.csproj (in 144 ms).
  Restored /some_filder/MinimalChessEngine/MinimalChessBoard/MinimalChessBoard.csproj (in 1 ms).
Board.cs(92,13): warning CS0164: This label has not been referenced [/some_folder/MinimalChessEngine/MinimalChess/MinimalChess.csproj]
Move.cs(34,13): warning CS0164: This label has not been referenced [/some_folder/MinimalChessEngine/MinimalChess/MinimalChess.csproj]
Notation.cs(61,13): warning CS0164: This label has not been referenced [/some_folder/MinimalChessEngine/MinimalChess/MinimalChess.csproj]
  MinimalChess -> /some_folder/MinimalChessEngine/MinimalChess/bin/Debug/netcoreapp3.1/MinimalChess.dll
  MinimalChessBoard -> /some_folder/MinimalChessEngine/MinimalChessBoard/bin/Debug/netcoreapp3.1/MinimalChessBoard.dll
  MinimalChessEngine -> /some_folder/MinimalChessEngine/MinimalChessEngine/bin/Debug/netcoreapp3.1/MinimalChessEngine.dll

Build succeeded.

Board.cs(92,13): warning CS0164: This label has not been referenced [/some_folder/MinimalChessEngine/MinimalChess/MinimalChess.csproj]
Move.cs(34,13): warning CS0164: This label has not been referenced [/some_folder/MinimalChessEngine/MinimalChess/MinimalChess.csproj]
Notation.cs(61,13): warning CS0164: This label has not been referenced [/some_folder/MinimalChessEngine/MinimalChess/MinimalChess.csproj]
    3 Warning(s)
    0 Error(s)

Time Elapsed 00:00:03.97
Browsing around for the binary, it was found at "/some_folder/MinimalChessEngine/MinimalChessEngine/bin/Debug/netcoreapp3.1/MinimalChessEngine" and ran without problems.

This is apparently a debug build, from my understanding the architecture-independent release build can be done with
$ dotnet build -c Release
Around 10 days ago I also did make an attempt of compiling MCE 0.1 with Mono (https://www.mono-project.com/), that I presumed would succeed, as you mentioned that you have catered for maximum compatibility by using .NET Core 3.1. However, my experience with .NET is non-existant and I did not succeed with pure Mono, as running xbuild on project solution files gave:
./MinimalChessEngine/MinimalChessEngine/MinimalChessEngine.csproj: error : ./MinimalChessEngine/MinimalChessEngine/MinimalChessEngine.csproj: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format
and msbuild:
/usr/lib/mono/msbuild/Current/bin/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(234,5): error NETSDK1004: Assets file '/some_folder/foreign/MinimalChessEngine/MinimalChessEngine/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [/some_folder/foreign/MinimalChessEngine/MinimalChessEngine/MinimalChessEngine.csproj]
I plan to use MCE 0.2 release build to run some games against my pet engine at the end of next week, current observations from bunch of 10s+0 games with MCE 0.2 debug build:
  • No timeout losses for MCE 0.2, ever!
  • Reported PV every now and then includes texts "Estimate of 405ms EXCEEDS budget of 79ms. Quit!" and "WASTED 95ms on an aborted a search"
  • As MCE 0.2 is now using alpha-beta, I would have thought it to score little better against Monchester's minimax at 10s+0 time control, but as I was using debug build, this observation should be taken with grain of salt.
Keep up the good work :)

EDIT: replaced one quote section with code section, so that https links inside the would not be shortened by forum software.
Monchester 1.0, chess engine playing at scholastic level: https://github.com/unserializable/monchester ("Daddy, it is gonna take your horsie!")
Tickle Monchester at: https://lichess.org/@/monchester
User avatar
lithander
Posts: 881
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: MinimalChess 0.2 released

Post by lithander »

unserializable wrote: Sun Feb 14, 2021 2:14 pm Browsing around for the binary, it was found at "/some_folder/MinimalChessEngine/MinimalChessEngine/bin/Debug/netcoreapp3.1/MinimalChessEngine" and ran without problems.

This is apparently a debug build, from my understanding the architecture-independent release build can be done with
I plan to update the github repository with "How to build" instructions and thanks to you I will be able to include Linux build tips! So, thanks a lot for providing all these details.
unserializable wrote: Sun Feb 14, 2021 2:14 pm Reported PV every now and then includes texts "Estimate of 405ms EXCEEDS budget of 79ms. Quit!" and "WASTED 95ms on an aborted a search"
That's fine. It's debug info that I used when implementing timecontrol. Now I should probably send that only if "debug on" was sent to the engine first. But I don't know how to cause CuteChess to send that so it's currently always on! :)
unserializable wrote: Sun Feb 14, 2021 2:14 pm As MCE 0.2 is now using alpha-beta, I would have thought it to score little better against Monchester's minimax at 10s+0 time control, but as I was using debug build, this observation should be taken with grain of salt.
I've run a tournament of 500 games on my PC (Ryzen 5 3600 @ 4.2GHz, no boost) and MMC does pretty good there.

Code: Select all

Score of Monchester vs MinimalChess 0.2: 26 - 387 - 25 [0.088]
...      Monchester playing White: 19 - 185 - 15  [0.121] 219
...      Monchester playing Black: 7 - 202 - 10  [0.055] 219
...      White vs Black: 221 - 192 - 25  [0.533] 438
Elo difference: -406.4 +/- 53.3, LOS: 0.0 %, DrawRatio: 5.7 %
438 of 500 games finished.
The tournament didn't conclude sadly. The termination reason was given as "stalled connection" and MMC got the win so I guess it was Monchester that stalled. I still have everything open if you want me to send you additional info let me know!

I also identified a crash-bug in MinimalChess the first time I tried the tourney. Everyone who want's to play against MinimalChess should please consider to update and recompile or re-download the latest build. (Because I can't edit the original post I decided to stealth-fix it by replacing the binaries in the 0.2 build. The 0.2 release now contains 0.2.1 binaries.)
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
unserializable
Posts: 64
Joined: Sat Oct 24, 2020 6:39 pm
Full name: Taimo Peelo

Re: MinimalChess 0.2 released

Post by unserializable »

lithander wrote: Sun Feb 14, 2021 6:10 pm The tournament didn't conclude sadly. The termination reason was given as "stalled connection" and MMC got the win so I guess it was Monchester that stalled. I still have everything open if you want me to send you additional info let me know!
Perhaps you could create an issue at https://github.com/unserializable/monchester with relevant games and logs attached, so I might figure out the cause now, soon or later. I have suspicion by now that it might be Windows CuteChess specific, not an easily accesible environment for me, so any bit of information will help, thanks!

Your reported tourney numbers are about what I would expect with iterative A/B vs fixed depth minimax. I used debug build of MCE because I had not yet figured out how to do release builds, but now I have and at the end of next week I will involve release build of MCE in some further testing to see whether numbers seem to match -- note that the time control that I used was 10s+0 (10 seconds per game, no increment), so any debug build slowdown could have been critical in that.
lithander wrote: Sun Feb 14, 2021 6:10 pm I also identified a crash-bug in MinimalChess the first time I tried the tourney.
Congrats on squashing that nasty ;)
Monchester 1.0, chess engine playing at scholastic level: https://github.com/unserializable/monchester ("Daddy, it is gonna take your horsie!")
Tickle Monchester at: https://lichess.org/@/monchester
User avatar
CMCanavessi
Posts: 1142
Joined: Thu Dec 28, 2017 4:06 pm
Location: Argentina

Re: MinimalChess 0.2 released

Post by CMCanavessi »

lithander wrote: Sun Feb 14, 2021 1:47 pm
CMCanavessi wrote: Sat Feb 13, 2021 10:05 pm 970 elo in my rating list, between Tikov and Frank
Thanks for playing with MinimalChess! :) Is your rating list published somewhere? Seems like Tikov is rated 1244 on CCRL and Frank at 1074. Do they have lower ELO ratings in your list? What time controls do you use? And did you experience any issues that need to be addressed in a future version?
Worked great with Arena. I use 1 minute + 1 second for these lower strength engines, with ponder on (if supported). Minimal Chess behaved very very well, no time losses, no crashes, no illegal moves. My rating list is "comparable" to CCRL somewhat, ratings are always very similar. I use a random mover as zero ELO and build up from there. I also discard games that finished in any abnormal way (illegal moves, time forefeits, crashes, etc) so I get a "better/cleaner" rating (in a way).

Code: Select all

   # PLAYER                                    :  RATING  PLAYED    W    D    L   (%)  D(%)  OppAvg  OppN  OppDiv
 560 QuteChess 1.0.1t x32                      :  1101.4     318  106  151   61    57    47  1009.8    56    43.9
 561 Safrad 2.2.40.360 x32                     :  1096.6     322  179   74   69    67    23   922.4    55    40.7
 562 Toledo Nanochess Jan/11/2010 x32          :  1093.5     478  233  122  123    62    26   893.5    67    55.7
 563 Nanook v0.17 x32                          :  1091.1     306   89  166   51    56    54  1006.1    56    44.1
 564 BRAMA 05/12/2004 x32                      :  1027.7     404  160  139  105    57    34   906.2    57    50.1
 565 Tikov 0.6.3 Rev 2 x32                     :  1012.2     316  117   60  139    47    19  1012.0    56    43.8
 566 MinimalChess 0.2 x64                      :   969.9     200   56   28  116    35    14  1109.5    50    50.0
 567 Frank 0.58 x32                            :   958.3     390  140   97  153    48    25   944.5    64    51.3
 568 StrategicDeep 1.25 x32                    :   949.5     449  210   50  189    52    11   920.7    76    64.2
 569 Iota 1.0 x32                              :   932.3     479  175  149  155    52    31   869.5    65    57.7
 570 Xadreco 5.83 x32                          :   925.0     447  199   62  186    51    14   880.5    70    64.8
 571 Talvmenni 0.1 x32                         :   919.5     420  161  132  127    54    31   836.7    65    58.1
 572 Safrad 2.1.35.210 x32                     :   892.6     508  231   98  179    55    19   817.1    68    58.8
 573 Usurpator II x32                          :   890.3     478  189   81  208    48    17   870.8    65    57.7
Follow my tournament and some Leela gauntlets live at http://twitch.tv/ccls
User avatar
CMCanavessi
Posts: 1142
Joined: Thu Dec 28, 2017 4:06 pm
Location: Argentina

Re: MinimalChess 0.2 released

Post by CMCanavessi »

lithander wrote: Sun Feb 14, 2021 6:10 pm
unserializable wrote: Sun Feb 14, 2021 2:14 pm Browsing around for the binary, it was found at "/some_folder/MinimalChessEngine/MinimalChessEngine/bin/Debug/netcoreapp3.1/MinimalChessEngine" and ran without problems.

This is apparently a debug build, from my understanding the architecture-independent release build can be done with
I plan to update the github repository with "How to build" instructions and thanks to you I will be able to include Linux build tips! So, thanks a lot for providing all these details.
unserializable wrote: Sun Feb 14, 2021 2:14 pm Reported PV every now and then includes texts "Estimate of 405ms EXCEEDS budget of 79ms. Quit!" and "WASTED 95ms on an aborted a search"
That's fine. It's debug info that I used when implementing timecontrol. Now I should probably send that only if "debug on" was sent to the engine first. But I don't know how to cause CuteChess to send that so it's currently always on! :)
unserializable wrote: Sun Feb 14, 2021 2:14 pm As MCE 0.2 is now using alpha-beta, I would have thought it to score little better against Monchester's minimax at 10s+0 time control, but as I was using debug build, this observation should be taken with grain of salt.
I've run a tournament of 500 games on my PC (Ryzen 5 3600 @ 4.2GHz, no boost) and MMC does pretty good there.

Code: Select all

Score of Monchester vs MinimalChess 0.2: 26 - 387 - 25 [0.088]
...      Monchester playing White: 19 - 185 - 15  [0.121] 219
...      Monchester playing Black: 7 - 202 - 10  [0.055] 219
...      White vs Black: 221 - 192 - 25  [0.533] 438
Elo difference: -406.4 +/- 53.3, LOS: 0.0 %, DrawRatio: 5.7 %
438 of 500 games finished.
The tournament didn't conclude sadly. The termination reason was given as "stalled connection" and MMC got the win so I guess it was Monchester that stalled. I still have everything open if you want me to send you additional info let me know!

I also identified a crash-bug in MinimalChess the first time I tried the tourney. Everyone who want's to play against MinimalChess should please consider to update and recompile or re-download the latest build. (Because I can't edit the original post I decided to stealth-fix it by replacing the binaries in the 0.2 build. The 0.2 release now contains 0.2.1 binaries.)
Yeah, Monchester is losing on time quite often in my gauntlets, using Arena.
Follow my tournament and some Leela gauntlets live at http://twitch.tv/ccls
User avatar
Scally
Posts: 232
Joined: Thu Sep 28, 2017 9:34 pm
Location: Bermondsey, London
Full name: Alan Cooper

Re: MinimalChess 0.2 released

Post by Scally »

Hi Thomas,

Thanks for the Raspberry Pi build, unfortunately it doesn’t run.

Here’s some information that may help:

Al@RPi4-SSD:~/MinimalChess02 $ ls
MinimalChessEngine README.txt

Al@RPi4-SSD:~/MinimalChess02 $ ./MinimalChessEngine
Failure extracting contents of the application bundle.
I/O failure when writing extracted files.
A fatal error was encountered. Could not extract contents of the bundle

Al@RPi4-SSD:~/MinimalChess02 $ file MinimalChessEngine
MinimalChessEngine: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=7e6314d4f77d478967a1fee2dd72fc01c1a483a5, stripped

Al@RPi4-SSD:~/MinimalChess02 $ ldd MinimalChessEngine
linux-vdso.so.1 (0xbef46000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6f2c000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6f19000)
libstdc++.so.6 => /usr/local/gcc-10.1.0/lib/libstdc++.so.6 (0xb6d8a000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6d08000)
libgcc_s.so.1 => /usr/local/gcc-10.1.0/lib/libgcc_s.so.1 (0xb6cd9000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6b8b000)
/lib/ld-linux-armhf.so.3 (0xb6f70000)

Al@RPi4-SSD:~/MinimalChess02 $ readelf -p .comment MinimalChessEngine

String dump of section '.comment':
[ 1] GCC: (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.4) 4.8.4
[ 33] clang version 5.0.2-svn328729-1~exp1~20180406210737.92 (branches/release_50)
[ 80] GCC: (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.3) 4.8.4


Thanks,

Al.
User avatar
Scally
Posts: 232
Joined: Thu Sep 28, 2017 9:34 pm
Location: Bermondsey, London
Full name: Alan Cooper

Re: MinimalChess 0.2 released

Post by Scally »

Hi Thomas,

Aha, I then saw Taimo’s instructions re Ubuntu and found a way to install MS .NET Core on the RPi via:

wget https://download.visualstudio.microsoft ... arm.tar.gz

I now have your Engine compiled and running:

Al@RPi4-SSD:~/MinimalChessEngine/MinimalChessEngine/bin/Release/netcoreapp3.1 $ ./MinimalChessEngine
MinimalChess 0.2.1
uci
id name MinimalChess 0.2
id author Thomas Jahn
uciok
go infinite
info depth 1 score cp 0 nodes 20 nps 253 time 79 pv b1a3
info depth 2 score cp 0 nodes 59 nps 608 time 97 pv b1a3 a7a6
info depth 3 score cp 0 nodes 574 nps 5740 time 100 pv b1a3 a7a6 a1b1
info depth 4 score cp 0 nodes 1567 nps 13745 time 114 pv b1a3 a7a6 a1b1 a6a5
info depth 5 score cp 100 nodes 18490 nps 92914 time 199 pv e2e4 e7e6 d1f3 e6e5 f3f7
info depth 6 score cp -100 nodes 69835 nps 105015 time 665 pv e2e4 e7e6 d1f3 d8g5 b1c3 g5d2
info depth 7 score cp 100 nodes 482717 nps 252467 time 1912 pv e2e4 e7e6 d1f3 d8g5 b1c3 g5h4 f3f7

Thanks to both of you for your help.


Al.
User avatar
lithander
Posts: 881
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: MinimalChess 0.2 released

Post by lithander »

Hi Al,
Scally wrote: Mon Feb 15, 2021 10:01 am Al@RPi4-SSD:~/MinimalChess02 $ ./MinimalChessEngine
Failure extracting contents of the application bundle.
I/O failure when writing extracted files.
A fatal error was encountered. Could not extract contents of the bundle
Google didn't turn up anything useful. But it sounds like the big executable which is really a self extracting archive of the actual executable plus all dependencies failed to extract it's contents. So I made you another build what doesn't bundle all that stuff up. Instead the MinimalChess.0.2.Linux.ARM.NoBundle.zip contains many smaller files including a MinimalChessEngine binary which is the one you'd want to run.

If this doesn't work you could install .Net Core on the Raspi and build the engine from source, following a process that is probably very similar to what 'unserializable' described above. Here's the 'official' doc for .Net Core on the Raspi.

If you can't get it to run let me know! Then I would give it a try myself by installing a Raspi emulator on Windows.
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
User avatar
lithander
Posts: 881
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: MinimalChess 0.2 released

Post by lithander »

Scally wrote: Mon Feb 15, 2021 10:31 am I now have your Engine compiled and running:
You beat me to it. That's great news! :)

Also interesting insight into the performance on the Pi. Seems like the engine runs 5-6x slower than on my PC.
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
User avatar
Scally
Posts: 232
Joined: Thu Sep 28, 2017 9:34 pm
Location: Bermondsey, London
Full name: Alan Cooper

Re: MinimalChess 0.2 released

Post by Scally »

Hi Thomas,

Thanks, your binary works too:

Code: Select all

 Al@RPi4-SSD:~/minChess/MinimalChess 0.2 Linux ARM $ ls
createdump                      MinimalChessEngine.deps.json           System.Native.a
libclrjit.so                    MinimalChessEngine.dll                 System.Native.so
libcoreclr.so                   MinimalChessEngine.pdb                 System.Net.Http.Native.a
libcoreclrtraceptprovider.so    MinimalChessEngine.runtimeconfig.json  System.Net.Http.Native.so
libdbgshim.so                   MinimalChess.pdb                       System.Net.Security.Native.a
libhostfxr.so                   README.txt                             System.Net.Security.Native.so
libhostpolicy.so                SOS_README.md                          System.Private.CoreLib.dll
libmscordaccore.so              System.Collections.dll                 System.Runtime.Extensions.dll
libmscordbi.so                  System.Console.dll                     System.Security.Cryptography.Native.OpenSsl.a
Microsoft.Win32.Primitives.dll  System.Globalization.Native.so         System.Security.Cryptography.Native.OpenSsl.so
MinimalChess.dll                System.IO.Compression.Native.a
MinimalChessEngine              System.IO.Compression.Native.so

Al@RPi4-SSD:~/minChess/MinimalChess 0.2 Linux ARM $ chmod a+x MinimalChessEngine

Al@RPi4-SSD:~/minChess/MinimalChess 0.2 Linux ARM $ ./MinimalChessEngine 
MinimalChess 0.2.1
uci
id name MinimalChess 0.2
id author Thomas Jahn
uciok
go infinite
info depth 1 score cp 0 nodes 20 nps 303 time 66 pv c2c3
info depth 2 score cp 0 nodes 59 nps 786 time 75 pv c2c3 a7a6
info depth 3 score cp 0 nodes 605 nps 7658 time 79 pv c2c3 a7a6 b1a3
info depth 4 score cp 0 nodes 1528 nps 16791 time 91 pv c2c3 a7a6 b1a3 a6a5
info depth 5 score cp 100 nodes 15294 nps 104753 time 146 pv c2c3 a7a6 d1b3 h7h6 b3f7
info depth 6 score cp -100 nodes 66351 nps 121299 time 547 pv c2c3 b7b6 d1b3 c8b7 b3c2 b7g2
info depth 7 score cp 100 nodes 446822 nps 295908 time 1510 pv c2c3 b7b6 d1b3 c8b7 b1a3 h7h6 b3f7

Cheers,

Al.