MadChess 3.0 Beta

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

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
emadsen
Posts: 183
Joined: Wed Apr 25, 2012 11:51 pm
Location: Naperville, IL, USA
Contact:

MadChess 3.0 Beta

Post by emadsen » Mon Oct 29, 2018 3:25 am

It's been a while since I've posted on this forum. I haven't been too involved in computer chess the last year. I released MadChess 2.2 about 16 months ago. Life and work have been busy. The time I've had for hobby programming I've devoted to exploring .NET Core, ASP.NET MVC, WebAPI, Dapper, Refit, etc- you know, work stuff. I toyed around with a poker game- wrote a shuffle routine and hand evaluator but stopped short of writing the dealer logic or AI.

Anyhow, I got the itch again about a month ago and decided it was time to get my head around bitboards. I've been rewriting MadChess using bitboards and magic move generation. I've reached the first important milestone: legal move generation. You can read the details in MadChess 3.0 Beta Build 39 (Bitboards) on my website, but I'll provide the executive summary here:
MadChess 3.0 Beta generates legal moves at a rate of 41 million per second from the starting position (4.7x faster than MadChess 2.2). Perhaps performance can be improved with profiling and low-level engineering, but I'm pretty happy with that speed for C# code.
MadChess 3.0 Beta does not yet play a game of chess. I have not written the search or evaluation functions. At this point, it only generates and plays moves, prints a visual representation of the board, and runs some unit tests.

I'll post updates to this thread as I make progress. If you have any questions, don't hesitate to ask- either here on or my website.
My C# chess engine: http://www.madchess.net

User avatar
Graham Banks
Posts: 31496
Joined: Sun Feb 26, 2006 9:52 am
Location: Auckland, NZ

Re: MadChess 3.0 Beta

Post by Graham Banks » Mon Oct 29, 2018 3:37 am

Looking forward to a new MadChess. :P
My email addresses:
gbanksnz at gmail.com
gbanksnz at yahoo.co.nz

User avatar
emadsen
Posts: 183
Joined: Wed Apr 25, 2012 11:51 pm
Location: Naperville, IL, USA
Contact:

Re: MadChess 3.0 Beta

Post by emadsen » Mon Oct 29, 2018 11:54 pm

Thanks Graham! The next major milestone is to get the engine to play a game, albeit with a simple evaluation function.
My C# chess engine: http://www.madchess.net

AndrewGrant
Posts: 424
Joined: Tue Apr 19, 2016 4:08 am
Location: U.S.A
Full name: Andrew Grant
Contact:

Re: MadChess 3.0 Beta

Post by AndrewGrant » Tue Oct 30, 2018 12:42 am

emadsen wrote:
Mon Oct 29, 2018 11:54 pm
Thanks Graham! The next major milestone is to get the engine to play a game, albeit with a simple evaluation function.
Nice to see you back in the forums. Looking forward to seeing what you come up with :)

David Carteau
Posts: 31
Joined: Sat May 24, 2014 7:09 am
Location: France
Contact:

Re: MadChess 3.0 Beta

Post by David Carteau » Tue Oct 30, 2018 9:37 am

emadsen wrote:
Mon Oct 29, 2018 3:25 am
It's been a while since I've posted on this forum. I haven't been too involved in computer chess the last year. I released MadChess 2.2 about 16 months ago. Life and work have been busy. The time I've had for hobby programming I've devoted to exploring .NET Core, ASP.NET MVC, WebAPI, Dapper, Refit, etc- you know, work stuff. I toyed around with a poker game- wrote a shuffle routine and hand evaluator but stopped short of writing the dealer logic or AI.

Anyhow, I got the itch again about a month ago and decided it was time to get my head around bitboards. I've been rewriting MadChess using bitboards and magic move generation. I've reached the first important milestone: legal move generation. You can read the details in MadChess 3.0 Beta Build 39 (Bitboards) on my website, but I'll provide the executive summary here:
MadChess 3.0 Beta generates legal moves at a rate of 41 million per second from the starting position (4.7x faster than MadChess 2.2). Perhaps performance can be improved with profiling and low-level engineering, but I'm pretty happy with that speed for C# code.
MadChess 3.0 Beta does not yet play a game of chess. I have not written the search or evaluation functions. At this point, it only generates and plays moves, prints a visual representation of the board, and runs some unit tests.

I'll post updates to this thread as I make progress. If you have any questions, don't hesitate to ask- either here on or my website.
Hello Erik !

I'm glad to see that you are working on a new Madchess version ! With iCE and Lozza, your engine is one of my favorite since I started to work on Orion (see a sort of "tribute", or as we say in french "clin d'oeil", on my own site)...

I'm looking forward to test (or beta-test) your new engine !

David

User avatar
emadsen
Posts: 183
Joined: Wed Apr 25, 2012 11:51 pm
Location: Naperville, IL, USA
Contact:

Re: MadChess 3.0 Beta

Post by emadsen » Wed Oct 31, 2018 12:29 pm

Nice to see you back in the forums. Looking forward to seeing what you come up with :)
Thanks Andrew. I have been rooting for Ethereal in the chess.com tournament. I'm amazed at the progress you've made on your engine. Fifth strongest in the world is quite an accomplishment... When I was writing code to generate all permutations of relevant bitboard occupancies, generate random ulong numbers, then test if the multiply and shift operation mapped to the correct move index... I borrowed some magic multipliers from your code. I borrowed some from Texel's too. So my magic multipliers are a mix of those found by MadChess, yours, and Texel's.
I'm glad to see that you are working on a new Madchess version ! With iCE and Lozza, your engine is one of my favorite since I started to work on Orion (see a sort of "tribute", or as we say in french "clin d'oeil", on my own site)...
Thanks David. Your Orion engine is one of MadChess' frequent sparring partners. You're brave to spar against iCE- that's an extremely strong engine. I assume Orion plays against an earlier, weaker version of iCE?
My C# chess engine: http://www.madchess.net

David Carteau
Posts: 31
Joined: Sat May 24, 2014 7:09 am
Location: France
Contact:

Re: MadChess 3.0 Beta

Post by David Carteau » Wed Oct 31, 2018 12:39 pm

emadsen wrote:
Wed Oct 31, 2018 12:29 pm
Thanks David. Your Orion engine is one of MadChess' frequent sparring partners. You're brave to spar against iCE- that's an extremely strong engine. I assume Orion plays against an earlier, weaker version of iCE?
Yes, for sure ! My objective was to reach the level of iCE v0.3. It will be harder to catch up newer versions :-)

Orion is also a bitboard engine (since the beginning). I found it helps a lot - not for the speed of move generation but - for the speed of evaluation : you can expect a big change in that field !

User avatar
emadsen
Posts: 183
Joined: Wed Apr 25, 2012 11:51 pm
Location: Naperville, IL, USA
Contact:

Re: MadChess 3.0 Beta

Post by emadsen » Fri Nov 09, 2018 5:31 am

I’ve reached an important milestone in the development of my new chess engine. MadChess 3.0 can play a timed game of chess.

With a fully featured search but simple evaluation (material and piece location only), it plays bullet chess at approximately 2100 ELO. I watched a few games and noticed it searches moves at a rate of about 2 million per second.

See the MadChess 3.0 Beta Build 58 (Baseline) post on my website for more details.

As I note in the blog post, one interesting aspect to monitor is how the ELO value of evaluation features in MadChess 3.0 compares to the same features in MadChess 2.0. In MadChess 3.0 I'll be adding them to an engine with a mature search function, which was not the case in the early days of MadChess 2.0. I am aware through personal experience of the highly non-linear relationship between individual search and evaluation features (with regards to contribution to ELO playing strength), so it’s unlikely I’ll find the same ELO values for evaluation features as I found in MadChess 2.0.
My C# chess engine: http://www.madchess.net

User avatar
emadsen
Posts: 183
Joined: Wed Apr 25, 2012 11:51 pm
Location: Naperville, IL, USA
Contact:

Re: MadChess 3.0 Beta

Post by emadsen » Sat Nov 24, 2018 10:24 pm

I've added another 47 ELO to MadChess 3.0 Beta's playing strength via Texel tuning of evaluation parameters. I used a particle swarm optimization algorithm to minimize evaluation error per Peter Österlund's technique. Details in my Eval Param Tuning blog post.

MadChess 3.0 Beta is rated 2143 at bullet chess with an evaluation function consisting of material and piece square tables only.
My C# chess engine: http://www.madchess.net

User avatar
Steve Maughan
Posts: 1042
Joined: Wed Mar 08, 2006 7:28 pm
Location: Florida, USA
Contact:

Re: MadChess 3.0 Beta

Post by Steve Maughan » Mon Nov 26, 2018 2:10 pm

Brilliant work Erik!

Playing with Particle Swarm algorithms, both for chess and professional use, is on my to-do list. I've known about them for a while, but found this video helpful:

https://www.udemy.com/share/1000JUBUsccV4=/

Have you played with Population-Based-Incremental-Learning (PBIL) algorithms? Thomas Petzke had some great success using PBIL to optimize his chess engine (ICE). It's a neat algorithm and I've used it for work. One advantage is that it can be used to optimize binary search parameters as well as evaluation terms.

Cheers,

Steve
http://www.chessprogramming.net - Maverick Chess Engine

Post Reply