Profiling a mediocre engine

Discussion of chess software programming and technical issues.

Moderator: Ras

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

Re: Profiling a mediocre engine

Post by JVMerlino »

abulmo2 wrote: Sat Apr 23, 2022 9:15 am Dumb is a simple engine (1200 line of code in D language, I hope quite readable) but about 100 Elo stronger than Myrddin in CCRL 40/15.
Myrddin is an ancient engine written by a lazy programmer who hasn't bothered to rewrite any the glaring issues coming from early naive design "decisions" that seemed perfectly reasonable at the time. The first version, written in 2009, was over 2200 lines of code including header files, and it was rated about 1150. :-)

I've poked around in your code and it is certainly streamlined and elegant. Your use of one-character variables makes it a bit challenging for me when I see lines like:

Code: Select all

if ((r && s > bs) || (α < s && s < β)) s = -pvs(-β, -α, d + e - 1);
:)

But eventually I can wrap my head around it.

I suppose, maybe, I might retire Myrddin and start a new engine. But, like I said, I'm lazy. :wink:
abulmo2
Posts: 467
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: Profiling a mediocre engine

Post by abulmo2 »

JVMerlino wrote: Sat Apr 23, 2022 8:01 pm Your use of one-character variables makes it a bit challenging for me when I see lines like:

Code: Select all

if ((r && s > bs) || (α < s && s < β)) s = -pvs(-β, -α, d + e - 1);
:)

But eventually I can wrap my head around it.
It's a proof of my lazyness. My own coding rule allows me to use one-character variables inside functions, but I usually avoid them in class/struct members or global variables. In the above code, r = reduction; s = score; bs = best score; α = alpha; β = beta; d = depth and e = extension. Depending on my mood, I also sometimes read s as sh.t and bs as bull sh.t which can be a better description of the values they carry. :)
Richard Delorme