Where's the joy in writing a chess engine?

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Tony P.
Posts: 81
Joined: Sun Jan 22, 2017 7:30 pm
Location: Russia

Where's the joy in writing a chess engine?

Post by Tony P. » Tue Sep 19, 2017 6:29 pm

I have a conjecture that I'd like to check with the forum residents.

Namely, writing an engine can only be enjoyed by someone who already does software development as a job.

The thing is that the actual development is too stressful for an uninitiated person. Algorithm design in terms of pseudocode is much easier than making code actually work fast and as intended on real-life hardware. The latter is a huge problem that constrains one's fantasy.

Thus I suppose that coding an engine can only be enjoyable if one is already very disciplined at debugging and testing and has a very strong mindset that's not ruined by numerous bugs that inevitably happen (and, to make things worse, in chess programming, bugs tend to harm the engine's strength subtly instead of making it crash).

The reason why there are people who enjoy this utterly stressful hobby is perhaps that their main jobs are even more stressful and this hobby is something that sounds familiar but provides 'relative relaxation' because bugs in toy software like non-commercial chess engines don't have a monetary impact and thus don't place responsibility.

Even then, it puzzles me that some people like to have a hobby that reminds them of their jobs. I'd rather have a hobby that's orthogonal to the job, to forget about the job at least for a while.

Or am I missing something?

Anyway, thanks a lot to engine authors for suffering in order to provide us, mere mortals, with entertainment :!:

Robert Pope
Posts: 510
Joined: Sat Mar 25, 2006 7:27 pm

Re: Where's the joy in writing a chess engine?

Post by Robert Pope » Tue Sep 19, 2017 6:51 pm

Tony P. wrote:I have a conjecture that I'd like to check with the forum residents.

Namely, writing an engine can only be enjoyed by someone who already does software development as a job.
Seriously flawed assumption, as seen by the numerous authors who aren't professional software developers. Presumably, at least some of us don't dislike it, or we wouldn't do it.
The thing is that the actual development is too stressful for an uninitiated person. Algorithm design in terms of pseudocode is much easier than making code actually work fast and as intended on real-life hardware. The latter is a huge problem that constrains one's fantasy.
This has some truth in it. I am sure I do a number of things that a professional programmer would spot as basic flaws. That doesn't keep me from being able to enjoy developing a program, though. It might limit how strong it ever gets.
The reason why there are people who enjoy this utterly stressful hobby is perhaps that their main jobs are even more stressful and this hobby is something that sounds familiar but provides 'relative relaxation' because bugs in toy software like non-commercial chess engines don't have a monetary impact and thus don't place responsibility.

Even then, it puzzles me that some people like to have a hobby that reminds them of their jobs. I'd rather have a hobby that's orthogonal to the job, to forget about the job at least for a while.

Or am I missing something?
Often, people have jobs because that is what they like to do. So I don't think it is surprising when they continue to apply those interests after they get off work.

Robert Pope
Posts: 510
Joined: Sat Mar 25, 2006 7:27 pm

Re: Where's the joy in writing a chess engine?

Post by Robert Pope » Tue Sep 19, 2017 6:56 pm

I guess I forgot to answer the "where's the joy" part of your question.

I enjoy logic and figuring things out. I also enjoy programming computers, so it turns out I also enjoy using computers to create things and to figure things out. Chess, as a giant puzzle, lends itself well to that idea.

User avatar
hgm
Posts: 23793
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Where's the joy in writing a chess engine?

Post by hgm » Tue Sep 19, 2017 7:04 pm

I am not a professional software developer; My job was in experimental physics research, although I occasionally also did some computational physics. I learned to program as a student, and I always liked it. I noticed that I had a tendecy to balance job and hobby; when at work I was setting up experimental equipment, I liked to program at home; when I was doing calculations, I build electronic equipment at home.

Building an engine is not especially difficult, once you know how to debug it. Sometimes you have to be a bit tenacious.

Tony P.
Posts: 81
Joined: Sun Jan 22, 2017 7:30 pm
Location: Russia

Re: Where's the joy in writing a chess engine?

Post by Tony P. » Tue Sep 19, 2017 7:06 pm

Thanks for the explanations, it's good to have you both as counterexamples ITT!

I wonder why those who enjoy their job, and would like to do it as a hobby too, don't simply take extra working hours.

I can think of a couple of reasons for this.

Firstly, there are FOSS proponents who feel that their corporate job isn't charitable enough.

Secondly, there are those who have relatives and/or partners who value their physical presence at home, and use the hobby as an outlet to do things similar to their occupation while being available at home.

kbhearn
Posts: 411
Joined: Thu Dec 30, 2010 3:48 am

Re: Where's the joy in writing a chess engine?

Post by kbhearn » Tue Sep 19, 2017 7:09 pm

A few things:

1) A chess engine is a bit more algorithm-oriented than most hobby programming projects you might take on. It makes it a bit more enjoyable for people who like thinking about such things than say... a user interface for anything which is a lot of design work and some very tedious programming to tie it all together.

2) Chess engines have considerably fewer moving parts than most algorithmic tasks you'd take on - so as much debugging as you think there is in writing a chess engine, other projects would be even moreso.

3) They're also small and focused enough to be handled by a single person rather than a team. If you say wanted to develop an open source video game as your hobby project, you'd either have to have a team of friends to work on it or have the talent in all of game design, UI design, art, and programming to get it to the point that others who are better at the parts you're not so good at will take an interest and start contributing.

4) While implementing it correctly is indeed very important, a common misconception is that it has to be 'fast' to be any good. Certainly at some point speed optimisations will become the low hanging fruit but there's a lot of more important work before you get to that point.

5) As a hobby project you're probably not sitting down with an initial goal of being a top chess engine (and if you are, my sympathies). Once you discard that as your goal, you don't necessarily have to take the engineering approach of rigorously testing many small variations with tens of thousands of games.

6) If you just want a taste of above engineering approach, there's always trying patches for stockfish in fishtest unchaining you from all the work of making a good core to an engine and allowing you to just try ideas you think might help (but probably don't).

Tony P.
Posts: 81
Joined: Sun Jan 22, 2017 7:30 pm
Location: Russia

Re: Where's the joy in writing a chess engine?

Post by Tony P. » Tue Sep 19, 2017 7:14 pm

kbhearn wrote:4) While implementing it correctly is indeed very important, a common misconception is that it has to be 'fast' to be any good. Certainly at some point speed optimisations will become the low hanging fruit but there's a lot of more important work before you get to that point.
Yes, exactly!

I don't like it that Stockfish is popularising the idea of dumbing down the static eval to gain strength by brute force. That's not how humans improve at chess.

Stan Arts
Posts: 179
Joined: Fri Feb 14, 2014 9:53 pm
Location: the Netherlands

Re: Where's the joy in writing a chess engine?

Post by Stan Arts » Tue Sep 19, 2017 7:27 pm

It's an intellectual challenge.
The game of chess is just complex enough so that you can approach the problem in endless different ways yet seemingly logical enough to have an irresistible attraction to some programmers minds.
Every chess programming layman must start out at some point thinking they can write something much better than what is currently around.

It's a trap.

I started some 15 years ago after having picked up playing chess again. Didn't take long to find some chess programs, get fascinated by them and think..I can do that.

I enjoy the early stages. Thinking out data structures, writing a search tree algorithm, move generation etc. And then have it play it's first moves. It's a brainchild.

Now on it's 4th incarnation I am "done". Nemeton and it's data structures was the final thing I had to get out of my system. But..I still can't completely keep my hands off of it.

duncan
Posts: 10530
Joined: Mon Jul 07, 2008 8:50 pm

Re: Where's the joy in writing a chess engine?

Post by duncan » Tue Sep 19, 2017 7:28 pm

hgm wrote:
Building an engine is not especially difficult, once you know how to debug it. Sometimes you have to be a bit tenacious.
for you it may not be especially difficult and probably with all the information out there it is not as hard now as twenty five years ago.

but for for most people I suspect it would be extremely difficult.

User avatar
Rebel
Posts: 4790
Joined: Thu Aug 18, 2011 10:04 am

Re: Where's the joy in writing a chess engine?

Post by Rebel » Tue Sep 19, 2017 7:38 pm

Tony P. wrote:Even then, it puzzles me that some people like to have a hobby that reminds them of their jobs. I'd rather have a hobby that's orthogonal to the job, to forget about the job at least for a while.
I can't imagine a programming job that is more creative than chess prgramming.

Post Reply