Working on Myrddin again

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Working on Myrddin again

Post by JVMerlino »

Hello All,

Some of you may know my old engine Myrddin, which hasn't had a new version since January 2015. Well, thanks to some prodding by Martin Sedlak (Cheng) and a few others, I've started working on it again.

First up was to (finally) implement a tapered eval, which in current testing is giving about +29 elo. Myrddin's eval is still pretty weak, particularly in the case of King Safety, so there's some more work to do there. Then Martin is going to (somehow) guide me through tuning (depending on how much patience he has). He has promised me that Myrddin will be +100 elo over the last release after that, but I don't believe him. :D

Stay tuned, and hopefully Myrddin 0.88 will be released within a few months (or at least by the end of this year).

jm
mar
Posts: 2559
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Working on Myrddin again

Post by mar »

hey John, the popular title should be "progress on Myrddin"
because everyone (except myself) thinks it's a cool name. I think it's pretty stupid.
Martin Sedlak
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Working on Myrddin again

Post by mvanthoor »

JVMerlino wrote: Mon Jun 28, 2021 9:46 pm Hello All,

Some of you may know my old engine Myrddin, which hasn't had a new version since January 2015. Well, thanks to some prodding by Martin Sedlak (Cheng) and a few others, I've started working on it again.
Good luck :)
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Working on Myrddin again

Post by JVMerlino »

mar wrote: Mon Jun 28, 2021 10:27 pm hey John, the popular title should be "progress on Myrddin"
because everyone (except myself) thinks it's a cool name. I think it's pretty stupid.
"Progress" implies "improvement". I didn't want to paint myself into a corner with that kind of thread title. :D

But it is a cool name....
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Working on Myrddin again

Post by Daniel Anulliero »

mar wrote: Mon Jun 28, 2021 10:27 pm hey John, the popular title should be "progress on Myrddin"
because everyone (except myself) thinks it's a cool name. I think it's pretty stupid.
+100 😂😂
Anyway , good luck john , I haven't for Isa since 2 years so, hope Myrddin and Isa will win some elo for 2021 Christmas 😊😉
Isa download :
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Working on Myrddin again

Post by JVMerlino »

Some actual "progress". I added tapered eval and it gave +29 elo. With Martin's help I set up a very rudimentary Texel tuning framework which appears to work, although the first major change that increased elo was to completely comment out all of the pawn structure evaluation code! :oops: :roll:

But this, along with two other changes, appear to have given another +31 elo. Still a long way to go, but I am encouraged (and simultaneously irritated) with the results.
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Working on Myrddin again

Post by JVMerlino »

I really should rename this thread "Texel Tuning for Lazy Dummies". Here's what has happened during about two weeks of occasional work on Myrddin and a lot of CPU time.

1) I added tapered eval, resulting in +29 elo. This was, of course, long overdue and took more work than any of the below steps.
2) I created a very rudimentary Texel tuning system. This involved adding code to Myrddin to run through an EPD file and produce a static evaluation for each position. I used the ~1.4M quiet positions graciously provided by Alexandru Mosoi (Zurichess) as a training set and produced a base "score" (via the well-known sigmoid function) that I would attempt to improve via manual tuning. Yes, I did all this manually, rarely tuning more than two variables at a time, and never more than three at a time - then moving on to the next pair (usually the mg/eg pair of a single factor).
3) As a first test, I simply started commenting out various bits of code in the eval to confirm that they would all result in a poorer score. Very surprisingly, commenting out all of the pawn structure eval (passers, doubled pawns, isolated pawns, everything) resulted in an improvement to the score. As did removing the code to evaluate the pawn shield in front of a king. The only actual "tuning" that took place in this step was to decrease the bonus that was given for a piece attacking the square of the enemy king, or any square adjacent to the king. Reducing that bonus by 1cp resulted in a small improvement. I then ran a gauntlet (which takes about 18 hours) and got +31 elo, confirming that the system worked, and also that my pawn structure eval was complete crap. :oops: Total improvement so far: +60 elo.
4) I then tuned mg/eg values for the bishop pair, rooks on open files, some of the pawn structure eval (doubled pawns, doubled pawns that are also blocked by an enemy pawn, and isolated pawns), and the pawn shield in front of a king. This resulted in another +26 elo, and a total improvement of +86 elo.
5) I then restored and tuned the passer code (including protected and connected passers, but removing code to evaluate rooks behind passers and passers that are outside the square of the pawn, as these two factors were not able to improve the score), mobility, and adding a "material adjustment" to the PSTs. I'm way too lazy to tune each value in the PSTs, but I thought I might be able to add a single mg/eg adjustment to the entire piece that would improve the score. This also worked out well. The result of all of this was another +23 elo and a total improvement of +109 elo. Goal achieved! :D

This entire process turned out to be surprisingly easy and shockingly effective, once I was finally able to get it through my thick and lazy brain how to do it. Thanks to Martin for the patient support, Graham and Lars for constantly asking me if I'm working on a new version, and (again) Alexandru for providing the training set.

So I'll be sending a version to Lars for independent testing. If anybody else wants to test an unreleased version, let me know.
Last edited by JVMerlino on Wed Jul 07, 2021 6:04 pm, edited 1 time in total.
John Merlino - Myrddin chess engine
User avatar
CMCanavessi
Posts: 1142
Joined: Thu Dec 28, 2017 4:06 pm
Location: Argentina

Re: Working on Myrddin again

Post by CMCanavessi »

JVMerlino wrote: Sun Jul 04, 2021 5:56 pm although the first major change that increased elo was to completely comment out all of the pawn structure evaluation code! :oops: :roll:
:mrgreen: :mrgreen: :mrgreen:
Follow my tournament and some Leela gauntlets live at http://twitch.tv/ccls
mar
Posts: 2559
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Working on Myrddin again

Post by mar »

congratulations, John! :D
now 100 more :)
Martin Sedlak