MadChess 3.0 Beta

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

Moderators: hgm, Rebel, chrisw

User avatar
emadsen
Posts: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

MadChess 3.0 Beta

Post by emadsen »

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: https://www.madchess.net
User avatar
Graham Banks
Posts: 41423
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: MadChess 3.0 Beta

Post by Graham Banks »

Looking forward to a new MadChess. :P
gbanksnz at gmail.com
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 Beta

Post by emadsen »

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: https://www.madchess.net
AndrewGrant
Posts: 1753
Joined: Tue Apr 19, 2016 6:08 am
Location: U.S.A
Full name: Andrew Grant

Re: MadChess 3.0 Beta

Post by AndrewGrant »

emadsen wrote: Tue Oct 30, 2018 12:54 am 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 :)
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
David Carteau
Posts: 121
Joined: Sat May 24, 2014 9:09 am
Location: France
Full name: David Carteau

Re: MadChess 3.0 Beta

Post by David Carteau »

emadsen wrote: Mon Oct 29, 2018 4: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: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: MadChess 3.0 Beta

Post by emadsen »

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: https://www.madchess.net
David Carteau
Posts: 121
Joined: Sat May 24, 2014 9:09 am
Location: France
Full name: David Carteau

Re: MadChess 3.0 Beta

Post by David Carteau »

emadsen wrote: Wed Oct 31, 2018 1: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: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: MadChess 3.0 Beta

Post by emadsen »

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: https://www.madchess.net
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 Beta

Post by emadsen »

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: https://www.madchess.net
User avatar
Steve Maughan
Posts: 1221
Joined: Wed Mar 08, 2006 8:28 pm
Location: Florida, USA

Re: MadChess 3.0 Beta

Post by Steve Maughan »

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