MadChess 3.0 Released

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

Moderators: hgm, Rebel, chrisw

supersharp77
Posts: 1242
Joined: Sat Jul 05, 2014 7:54 am
Location: Southwest USA

Re: MadChess 3.0 Released

Post by supersharp77 »

emadsen wrote: Mon Apr 19, 2021 7:49 am I have released version 3.0 of my C# chess engine, MadChess. This is a complete rewrite of the engine using bitboards. I estimate its playing strength at about 2600 ELO at blitz time control.

It supports UCI_LimitStrength and UCI_Elo, so you may configure MadChess for a more enjoyable game. I have not done stringent testing of the limit strength feature so I'm uncertain how well calibrated it is to human playing strength. If you play a game against MadChess using this feature, let me know what you think. Does it play reasonably? Or does it play too weak or too strong?

More details available on my MadChess 3.0 Released blog post.
Checked out his github page and his blog page and there are no windows binaries available for download for any of his "MadChess Engines" Not 1.0 Not 1.1 Not 2.0 Not 2.2 and not v3.0.....Only a few exe for his other engine Rumbleminze...I think someone on Chessengines site is "Producing the Binaries from the Source code...and Jim Ablett was producing Binaries for some of the other versions... :) :wink:
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: MadChess 3.0 Released

Post by Dann Corbit »

On this page:
https://www.madchess.net/downloads/

I saw a link for source and a link for executables for each version.
There are binaries in the binaries zips.

I guess that there is a requirement that all new chess engines must now exceed 20MB.
;-)
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
emadsen
Posts: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: MadChess 3.0 Released

Post by emadsen »

Dann Corbit wrote: Thu Apr 22, 2021 12:57 am I guess that there is a requirement that all new chess engines must now exceed 20MB.
MadChess 3.0 is built as a self-contained application, so the .exe includes the .NET Base Class Library, runtime, and garbage collector. I attempted to make the .exe as small as possible, yet still self-contained, so it doesn't require a separate install of a .NET runtime. I'm amused by the over-promising and under-delivering of this Visual Studio dialog for publishing .NET 5 applications...

Image

... that produces five files, not counting the logo image or .pdb (Program Debug Database) which aren't required to run MadChess. Microsoft has made improvements to trimming and linking .NET code. But they're still not down to a single file.

Image

I'm not familiar with C++. Is the C++ redistributable typically required for chess engines? On my PC, Control Panel > Programs > Programs and Features indicates the x64 version is 22.1 MB. Would static linking the C++ Standard Library pull in 22.1 MB? Or are C++ linker / trimmers smarter than .NET's linker / trimmer?

I'm interested to understand the apples-to-apples comparison of .NET and C++ self-contained .exe size, for chess engines at least.
My C# chess engine: https://www.madchess.net
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: MadChess 3.0 Released

Post by Dann Corbit »

Typically, Stockfish of old would be about one megabyte.
But now that everyone is pulling 20MB of dead weight NN nodes into the binary (we used to read data with I/O, but today people can't be bothered to browse to a file), it has ballooned into a blue whale.
Well, I do have a 140 TB disk server, so I guess I should not cry about it.
Yet I do. I am a product of the 50's, 60's, 70's, 80's and 90's. I forget about the exponential storage progress from 2000 forward.

When I was a programmer in 1976 for the USAF, we had an IBM 360 that had a total of 5 disk subsystems, each with 45 MB and each the size of a very large washing machine. If a mag tape was not completely full you could sort it on a single disk, unless you chose a bad algorithm. Sort the file in RAM sized sections, and them merge them onto the tape using a priority queue.
A class D program could use up to 200K of RAM. If you went over that, you had to get special permission to run it (class=P). And if it was going to take a long time (e.g. class=P,time=1440) you had better have a very good explanation.

In college, I wrote programs for the seismic department on a PDP 11-70, and they had 64K of RAM. That's right K, not M.

So it is hard to wash all that frugality out of my hair.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
emadsen
Posts: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: MadChess 3.0 Released

Post by emadsen »

Dann Corbit wrote: Thu Apr 22, 2021 6:01 am Well, I do have a 140 TB disk server, so I guess I should not cry about it.
Yep. Storage is one of the cheapest components in a modern computer.
Dann Corbit wrote: Thu Apr 22, 2021 6:01 am Yet I do. I am a product of the 50's, 60's, 70's, 80's and 90's... they had 64K of RAM. That's right K, not M... So it is hard to wash all that frugality out of my hair.
I appreciate this. It's one of the reasons I got into chess engine programming. I wanted to do a different style of programming, more focused on performance and algorithm optimization. Business application development is focused on code expressiveness and abstraction to represent domain knowledge, enable mocking and testing, decrease difficulty of code refactoring and feature enhancements, etc. All of this costs perf.

What's interesting is how my chess programming hobby has influenced my professional life. I can't unlearn what I've learned. So my eye immediately spots excessive memory allocations, incorrect use of collections via O(N) and O(N^2) lookups, expensive work done in tight loops that could be pre-calculated, incorrect scoping of object lifetime excused away with "don't worry, the garbage collector will take care of it" hand-waving, etc.

It's beneficial to have experience at both ends of the spectrum, highly abstract to pedal-to-the-metal, and be capable of switching styles based on the demands of the project. Of course business application development is heavily tilted towards mastering abstractions. So I often find myself advising junior developers to understand the costs of the abstractions they rely on so they can make intentional design decisions- trading x amount of perf for y business productivity benefit. Instead of just calling black boxes and blaming someone else when the mash-up solution doesn't perform well.
My C# chess engine: https://www.madchess.net
supersharp77
Posts: 1242
Joined: Sat Jul 05, 2014 7:54 am
Location: Southwest USA

Re: MadChess 3.0 Released

Post by supersharp77 »

supersharp77 wrote: Wed Apr 21, 2021 7:22 am
emadsen wrote: Mon Apr 19, 2021 7:49 am I have released version 3.0 of my C# chess engine, MadChess. This is a complete rewrite of the engine using bitboards. I estimate its playing strength at about 2600 ELO at blitz time control.

It supports UCI_LimitStrength and UCI_Elo, so you may configure MadChess for a more enjoyable game. I have not done stringent testing of the limit strength feature so I'm uncertain how well calibrated it is to human playing strength. If you play a game against MadChess using this feature, let me know what you think. Does it play reasonably? Or does it play too weak or too strong?

More details available on my MadChess 3.0 Released blog post.
Checked out his github page and his blog page and there are no windows binaries available for download for any of his "MadChess Engines" Not 1.0 Not 1.1 Not 2.0 Not 2.2 and not v3.0.....Only a few exe for his other engine Rumbleminze...I think someone on Chessengines site is "Producing the Binaries from the Source code...and Jim Ablett was producing Binaries for some of the other versions... :) :wink:
Figured it out...A web page/web browser issue (XP) Some of his Blog page downloads section is cut off (greyed out area)
Downloads section cuts off after showing source code links only...last links (exes) not showing at all on my Chrome and Firefox web Browsers Did show up under my emergency Netsurf Browser..I would bet I'm not the only one unable to correctly see those exe's (section is a bit wide) Thx AR... 8-)
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: MadChess 3.0 Released

Post by Ferdy »

emadsen wrote: Mon Apr 19, 2021 7:49 am I have released version 3.0 of my C# chess engine, MadChess. This is a complete rewrite of the engine using bitboards. I estimate its playing strength at about 2600 ELO at blitz time control.

It supports UCI_LimitStrength and UCI_Elo, so you may configure MadChess for a more enjoyable game. I have not done stringent testing of the limit strength feature so I'm uncertain how well calibrated it is to human playing strength. If you play a game against MadChess using this feature, let me know what you think. Does it play reasonably? Or does it play too weak or too strong?

More details available on my MadChess 3.0 Released blog post.
While testing MadChess I am encountering illegal PV warnings as reported by cutechess-cli, not a serious one just in case you have not noticed.

Code: Select all

Warning: Illegal PV move h7a7 from MadChess 3.0 UCI_Elo 1500 (36)
Warning: PV: Rd6 R8e7 Rd8+ Re8 h7a7
Warning: Illegal PV move g5f5 from MadChess 3.0 UCI_Elo 1500 (35)
Warning: PV: Rxf5 a3 e4 Kg4 e3 c4 Rf2 b4 g5 Kxg5 a5 g5f5
Warning: Illegal PV move g4f5 from MadChess 3.0 UCI_Elo 1500 (35)
Warning: PV: Rf4+ g4f5
Filed an issue on cutechess regarding this.
User avatar
lithander
Posts: 880
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: MadChess 3.0 Released

Post by lithander »

Woah, I totally missed your original announcement!
2579 ELO on CCRL and 141 ELO more than the previous version? An impressive step forward! Congratz!
Dann Corbit wrote: Tue Apr 20, 2021 5:19 am Is Madchess the strongest dotnet engine now? (besides the SF clone)
There is also Ceres but it's a MCTS engine!
emadsen wrote: Thu Apr 22, 2021 5:46 am Microsoft has made improvements to trimming and linking .NET code. But they're still not down to a single file.
If you build with .NET Core 3.1 you can get single file exectuables! But my tiny 600 LOC engine get's turned into a 26MB Executable nonetheless... I know it's basically a self-extracting archive and includes the complete Runtime, but even if I'm not a product of the 50s, like Dann, I find such a massive file size excessive and irritating.
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
User avatar
emadsen
Posts: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: MadChess 3.0 Released

Post by emadsen »

Ferdy wrote: Wed May 05, 2021 1:40 pm While testing MadChess I am encountering illegal PV warnings as reported by cutechess-cli, not a serious one just in case you have not noticed... Filed an issue on cutechess regarding this.
Thanks Ferdy. I have a vague memory of correcting an illegal PV bug a while ago related to listing moves beyond checkmate (to the nominal depth instead of truncating the PV when the game ends). The extra moves were from another part of the search tree placed in the shared, triangular array. Perhaps I reintroduced the bug? Or maybe related to MultiPV or LimitStrength? Anyhow, thanks for making me aware of it. I agree, it would be helpful if CuteChess reported the FEN of the illegal PV.
lithander wrote: Wed May 05, 2021 3:51 pm 2579 ELO on CCRL and 141 ELO more than the previous version? An impressive step forward! Congratz!

There is also Ceres but it's a MCTS engine!

If you build with .NET Core 3.1 you can get single file exectuables!
Thanks Thomas! I forgot about Ceres, probably because it's yet to appear in the CCRL lists... Have you actually succeeded producing a single file? .NET 5 produces an .exe + 4 .dlls for me.
My C# chess engine: https://www.madchess.net
User avatar
lithander
Posts: 880
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: MadChess 3.0 Released

Post by lithander »

emadsen wrote: Thu May 06, 2021 6:33 am Have you actually succeeded producing a single file? .NET 5 produces an .exe + 4 .dlls for me.
Yes, all releases of MinimalChess are just one single exe file except the ARM.Linux build for compatibilty with Raspberry Pi.

That's the main reason I'm still using .Net Core 3.1 over .Net 5. Another reason is that Core 3.1 has LTS.
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess