Your motivation for writing a chess engine?

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

Moderators: hgm, Rebel, chrisw

User avatar
towforce
Posts: 11589
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK

Re: Your motivation for writing a chess engine?

Post by towforce »

glav wrote: Mon Mar 08, 2021 10:14 am Great thread. Our community would be today well served not from another engine that pushes the Elo limit another 100 points or so (though would be nice). What is really missing today is an engine that can explain in more or less human understable terms what is going on in a given position. Even a 2600 engine that does that would preferable to me to the latest lc0 running on the best hardware. Some GUIs have taken this job by explaining things in a more structured way, as the latest video by Charles Bicknell shows very well ( Another interesting project in this sense is Decode chess, but still I find their technology a little rudimentary (https://decodechess.com/). I know that this is a very hard project to accomplish, but it is what the community of players need most.

I agree that AI to explain difficult concepts would be wonderfully satisfying: Agadmator's chess channel (link) has over a million subscribers (who knew that this was possible for a channel that examines chess positions???), he's obviously a very strong player, and he explains everything both quickly and with a crystal clear clarity.

I am going to introduce a "but" here. I believe strongly in positive thinking (introduced at a slow, manageable rate), so apologies for the negative sentiment that follows.

In the lead up to the "reveal" in his videos, he will often quickly show you some alternative ideas: he's good at picking out the important themes. However, I can't help but feel that it's "just" entertainment: IMO, if you don't know everything, you don't know enough. If a GM spent two minutes showing novices some themes from difficult positions and then tested them on a similar position, I don't think many would pick the best move.

When you have chess engines with big nets and deep searching, they will uncover a large number of important themes in a position. Which ones are you going to pick to show the user?

Anyway - maybe I'm underestimating the value of good entertainment: for one thing, shared culture is a remarkably powerful tool for starting the process of overcoming apparent differences. The motto of FIDE is "gens una sumus" - we are one family.

With regards to "how" to build a chess position explainer: I would use case-based reasoning (CBR - link). In short:

1. build a database of positions with an explanation of the important themes in these positions

2. when a user provides a position, find the closest match in the database and offer the associated explanations

3. if the position found isn't quite right, allow the user to amend the search parameters to find a better match

4. if none of the positions in the database are useful, generate a new record for this new position

One thing we know about CBR - it usually takes a lot fewer cases to make a good system than you'd expect. Here's my estimate of what you'd need:

Good system: 1000 cases

Excellent system: 50000 cases

So VERY achievable!
Writing is the antidote to confusion.
It's not "how smart you are", it's "how are you smart".
Your brain doesn't work the way you want, so train it!
jonkr
Posts: 178
Joined: Wed Nov 13, 2019 1:36 am
Full name: Jonathan Kreuzer

Re: Your motivation for writing a chess engine?

Post by jonkr »

xr_a_y wrote: Mon Mar 08, 2021 8:42 am
jonkr wrote: Mon Mar 08, 2021 2:33 am
  • For example I saw this win in TCEC FRC against Minic https://tcec-chess.com/#div=frc3lb&game=12&season=20.
    V("BISHOP_STUCK_BLOCKED_PAWN", SB(-43, -51)); // Stuck on back rank, any forward directions blocked by blocked pawns )
    This term came into play even though it would impossible for me to measure elo difference from it, by move 30 Slow has Minic's bishop is out of play.
Good point, but here Minic was playing with a net, so it is hard to say that this "feature" was not covered. Even when using HCE, Minic has a quite strong mobility term for bishop and I guess this situation is taken into account. I think Slow is simply outplaying Minic here, not because of a particular term in evaluation but because it is as a whole stronger.
My thinking was more I liked the connection for hard-coded eval terms of showing an engine something new that it would use in games, rather than anything comparative. Felt like teaching a super GM, and experimenting with what was important in chess myself. And as more was eval was added, I could see the terms in play on the board but with much better quality chess than I could play. (I'm sure sometimes imagined.)

The (relative) ease I was able to replace my HCE with a fairly generic neural net structure for standard chess shows the computer is much better at it than me, and more FRC training would produce results there too. (Technically nets plural for full game since Slow has endgame nets)
User avatar
flok
Posts: 481
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: Your motivation for writing a chess engine?

Post by flok »

It was around 1996. I had a friend who was avid chess player. We both had an MSX homecomputer with ultrachess on it. Long story short: I got inspired by that and started developing a chess program. Unfortunately he died before my program got reasonably strong.
I started writing it on a compaq laptop (if I remember correctly) with an i386 processor and linux on it. Storage was floppy disks.

Code: Select all

total 36
-rw-rw-r-- 1 folkert users 4931 mei 21  1996 CHESSALG.DOC
-rw-rw-r-- 1 folkert users 1393 mei 26  1996 COMMON.H
-rw-rw-r-- 1 folkert users 5468 mei 25  1996 MOVELST.C
-rw-rw-r-- 1 folkert users 1211 mei 25  1996 MOVELST.H
-rw-rw-r-- 1 folkert users 5172 mei 26  1996 THINK.C
-rw-rw-r-- 1 folkert users  525 mei 26  1996 THINK.H
:D
JohnWoe
Posts: 491
Joined: Sat Mar 02, 2013 11:31 pm

Re: Your motivation for writing a chess engine?

Post by JohnWoe »

maksimKorzh wrote: Sat Mar 06, 2021 7:44 am
JohnWoe wrote: Fri Mar 05, 2021 7:55 pm I think becoming a grandmaster. Passing the 2500 Elo mark was nice.
Was my main motivation with Mayhem. Mayhem is still 99% of my own code. Besides some NNUE grab.

I actually hit 2800 Elo. Barely. But I got there: http://talkchess.com/forum3/viewtopic.p ... 23#p880623

I wasn't very happy tinkering around with weak Sapeli 1900 - 2000 Elo. Original or not. I was stuck at 1900 Elo.
On the CCRL list I was around 100% original (~2000 Elo) weak engines: Vice, Wutang (Maksim Korch), MicroMax (hgm) ...
This is the company where you end up with 1 man + 100% original approach.

I just wanted the title. Not the prettiest and most original approach but I got there.
Like they say in America. "if you ain't cheating you ain't trying".

I still like improving my programs.
I like seeing my engines get better.
I started Havoc from:

Code: Select all

int main() {
  return 0;
}
And kept going. Now I'm 2000-2100 Elo. And improving.

Open source is too stressful for me. So Mayhem will be my only OSS contribution.
In chess engines there's no money nor fame. Chess programming is just labour of love.
Actually WukongJS, not Wutang ;)
Wutang is Vice rewritten in C++ with mistuned eval and weird dumb LMR that slices even useful nodes, it searches twice deeper than vice but around 70 Elo weaker because of that.
That's it!
I remember quickly looking at list. These engines were around the engine I dropped a long time ago.

I think most chess programmers have their brains wired to only chess related stuff. All of their other projects are somewhat chess related. Chess GUI, chess networks, chess egtb, chess this, chess that ... Makes you almost wonder whether there's huge money in chess. I've been solving the remaining aoc puzzles recently. You really need wire your brain differently. Once synapses start firing differently. These puzzles start flowing off your fingers easily. Chess programming makes you only good at chess programming. Not general problem solving. A Truism statement. But there it is.
mar
Posts: 2559
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Your motivation for writing a chess engine?

Post by mar »

JohnWoe wrote: Tue Mar 09, 2021 10:07 am I think most chess programmers have their brains wired to only chess related stuff. All of their other projects are somewhat chess related. Chess GUI, chess networks, chess egtb, chess this, chess that ... Makes you almost wonder whether there's huge money in chess. I've been solving the remaining aoc puzzles recently. You really need wire your brain differently. Once synapses start firing differently. These puzzles start flowing off your fingers easily. Chess programming makes you only good at chess programming. Not general problem solving. A Truism statement. But there it is.
So not true. This is my oldschool FPS engine I've been writing, the project is dead now unfortunately as I can't make art, but it's VERY different from chess programming. 100% from scratch (except for FXAA shader): http://www.crabaware.com/public/minidemo.zip
Way more fun that working on a chess engine, way more difficult (decent chess programmers can write a chess engine in a weekend, strong engines - that's a different story of course)

Of course this is a computer chess forum so people won't appreciate a custom scripting language, custom navmesh generator, bsp-portalization and realtime analytic visibility, morton-based dynamic BVH, swept capsule collision detection, job system, event-based profiler, custom heap with leak detection, temporary/pool allocators, custom audio engine and much much more.
Martin Sedlak
Tony P.
Posts: 216
Joined: Sun Jan 22, 2017 8:30 pm
Location: Russia

Re: Your motivation for writing a chess engine?

Post by Tony P. »

Chess has been a toy game for AI researchers. DeepMind conquered it before throwing A0 on serious, high-stakes problems such as protein modeling. Among the next breakthroughs will probably be deep learning on graphs, for which tactical board games with heterogeneous long-range pieces like chess and shogi and potentially their extensions to bigger boards are natural testbeds, more instructive than go that exhibits homogeneous spatial relations and has turned out tractable by CNNs despite the much bigger board. I'd be happy to contribute to that breakthrough :D
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Your motivation for writing a chess engine?

Post by Daniel Anulliero »

JohnWoe wrote: Fri Mar 05, 2021 10:21 pm
mvanthoor wrote: Fri Mar 05, 2021 9:19 pm
JohnWoe wrote: Fri Mar 05, 2021 7:55 pm I wasn't very happy tinkering around with weak Sapeli 1900 - 2000 Elo. Original or not. I was stuck at 1900 Elo.
On the CCRL list I was around 100% original (~2000 Elo) weak engines: Vice, Wutang (Maksim Korch), MicroMax (hgm) ...
This is the company where you end up with 1 man + 100% original approach.
Thanks for the prediction. It's nice to know that I'll never ever break 2100.

IMHO, this is bullocks.

Vice is a tutorial engine, never meant to be as strong as possible, but to show and explain concepts.
Wukong is a tutorial engine as well.
Wuttang is a port of Vice to Javascript (if I remember correctly) , but not by Maksim Krozh.
MicroMax tries to be the smallest program counted in number of characters in the world.

Those are programs with different goals than being the strongest engine ever.
I just wanted the title. Not the prettiest and most original approach but I got there.
Like they say in America. "if you ain't cheating you ain't trying".
...
Open source is too stressful for me. So Mayhem will be my only OSS contribution.
In chess engines there's no money nor fame. Chess programming is just labour of love.
OMG. I think you should actually quit programming chess engines. If all you're doing this for is to see your engine as high up on the list as possible, then by all means go the Fat Fritz route. Grab Stockfish, some net training tools, train your own net, throw it in there, and release it as "your own" engine, and you'll be done. A week or so, and some waiting is all it takes.

Remind me to quit, as soon as I feel that the Elo number is the only thing I'm doing this for. That is just a nice thing aside, that someone else but myself (so, hopefully, independent) tests my engine, and I can see it improve from one version to the next.

And to be honest, I see no reason except for time to research, and computer power, why I couldn't reach 2850+ or even 3000 Elo+ in time, with a single-threaded engine, without adding NNUE. Many other people did. Some did it 15 years ago. Some reached 2250+ almost 30 years (!) ago. (Yes people... the 80486 DX is over 30 years old now. A massively powerful CPU in its time, but no more than a calculator compared to what we use now. And they wrote 2250+ chess engiens for it.)
I have already retired from 8x8 chess :D
I'm gonna still release Mayhem 3.4 as I made some massive improvements.
While working on Havoc.

You don't want Mayhem engine?
Mayhem isn't actually on any rating list atm AFAIK
They can test whatever they want. I'm not blaming them at all.
Because I actually don't even care about rating lists.

I like that someone independent confirms progress. Like mr. Sylwy
As my Elo gains are too positive always.

Is Mayhem original or not? Just look at the source code. It's more original than 99% engines.
I didn't start from 2100 Elo Vice template. Or 1800 Elo TSCP. I started from 0 Elo and went to 2800 Elo. I gained +2800 Elo.
Not that there's anything wrong starting with templates.

But if I participate to the World Champs or smt w/ Mayhem I'll argue to ad nauseam on Mayhem's originality. Mayhem is still 99.9% of my work.
They'll better come up with good stuff. As I know Mayhem's code as I have typed every character.

Mayhem now has good classical evaluation as I copy-pasted Pesto too. It's 100% original w/o nnue :lol:
And from your read me :
Credits: SF ( EvalFile + PolyGlot ) and Dr. Shawul ( NNUE lib ).
99.9% original ?
You guy are very funny to read 😁
Isa download :
Madeleine Birchfield
Posts: 512
Joined: Tue Sep 29, 2020 4:29 pm
Location: Dublin, Ireland
Full name: Madeleine Birchfield

Re: Your motivation for writing a chess engine?

Post by Madeleine Birchfield »

JohnWoe wrote: Fri Mar 05, 2021 10:21 pm Mayhem isn't actually on any rating list atm AFAIK
They can test whatever they want. I'm not blaming them at all.
Because I actually don't even care about rating lists.

I like that someone independent confirms progress. Like mr. Sylwy
As my Elo gains are too positive always.

Is Mayhem original or not? Just look at the source code. It's more original than 99% engines.
I didn't start from 2100 Elo Vice template. Or 1800 Elo TSCP. I started from 0 Elo and went to 2800 Elo. I gained +2800 Elo.
Not that there's anything wrong starting with templates.

But if I participate to the World Champs or smt w/ Mayhem I'll argue to ad nauseam on Mayhem's originality. Mayhem is still 99.9% of my work.
They'll better come up with good stuff. As I know Mayhem's code as I have typed every character.

Mayhem now has good classical evaluation as I copy-pasted Pesto too. It's 100% original w/o nnue :lol:
That is because Mayhem is not 99.9% unique, it is a Sapeli clone whose neural network file and whose book polyglot code is taken from Stockfish.
Ras
Posts: 2488
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Your motivation for writing a chess engine?

Post by Ras »

Madeleine Birchfield wrote: Sat Mar 13, 2021 5:11 pmit is a Sapeli clone
JohnWoe is also the author of Sapeli.
Rasmus Althoff
https://www.ct800.net
User avatar
flok
Posts: 481
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: Your motivation for writing a chess engine?

Post by flok »

Ras wrote: Sat Mar 13, 2021 7:59 pm
Madeleine Birchfield wrote: Sat Mar 13, 2021 5:11 pmit is a Sapeli clone
JohnWoe is also the author of Sapeli.
This clone-obsession is getting ridiculous.