Interview with Tord Romstad (Norway), Joona Kiiski (Finland) and Marco Costalba (Italy)
Programmers of Stockfish
28th, March 2010
by Tord Romstad, Joona Kiiski, Marco Costalba & Frank Quisinsky
Tord Romstad (Norway)
At the moment Stockfish is the actual number 2 of all available chess engines. A very particularly and interesting fact because nevertheless Stockfish is still free available for everyone. Only the commercial engine Rybka 3 is around 60-70 ELO stronger with 64-Bit support and around 30 ELO stronger with 32-Bit support. This is a hard situation for all other commercials. Stockfish is still in development and with each new version in the past the engine got big ELO jumping’s. Most of computer chess friends await Stockfish as the new number 1 in the near future. This is a very high expectation in a group of programmers which working in free times on freeware projects. Tord, Joona and Marco build a team. Probably this could be one of the reasons of success. Tord worked a long time on the preview engines Gothmog / Glaurung. The Norwegian programmer with barrels of chess knowledge is one of the most talented chess programmers "we" have. It’s time for an interview!
By now words had spread about the success of Stockfish. I am sure that the Stockfish team has got a lot of mails about commercial enquiry. Are any commercials in visibility? I smell danger! I am sure that you have discussed this theme, so please give us at first a clear statement about it!
There are no plans of a commercial Stockfish. Why shouldn't it be free? All three of us have regular jobs which pay our bills; computer chess is just a hobby. Most people don't earn any money from their hobbies, and I see no reason why chess programming should be different. Going commercial would force us to deal more heavily with tasks like marketing, support and GUI programming, for which we have little skill and interest. All we would get in compensation for the extra work is a small amount of money which we don't really need.
In my opinion we have the dream situation with Stockfish. This was always my biggest wish since Winboard times. A free available engine is the best or nearly the best in the World. This is motivation enough for other amateurs and of course a must for each commercial. Apropos of playing strength: Stockfish is the measure in all categories for commercials. Stockfish animated the complete computer chess area. Do you aware of that?
Of course we are all happy and proud that people enjoy our program, and we hope that we are able to inspire amateurs as well as professionals, and to keep regular users happy.
Let's start the interview with the playing style. That’s my favoured question for chess programmers. Each engine need an own face. In the playing style description of SCHACHWELT I wrote:
Playing style description of the TOP-20 in the World (in German language):
It's easy to write about Stockfish’s playing style. The moves look logical and easy. Stockfish played comparably from a magical hand. Outstanding are the strengths in endgame and king attacks. It seems that GM José Raúl Capablanca having been behind it. The playing style is to 90% the same (symbolically) compare the Cuban national hero. I am not sure that Shredder and Rybka alone dominating the endgame. This area is history. In openings Stockfish is playing inconspicuous but balanced. In positional positions I see possible improvements. In middle game Stockfish estimated often too negative. This could be the reason for passive alternatively moves if tactical manoeuvre not playable. By the way, if I analyse such positions I can see that moves Stockfish played are probably the best. The human weaknesses say hello. I think Stockfish is the optimal engine for long time analyses. However, Stockfish seems to have a lot of potential for future improvements in middle game. The three programmer’s works very industriously on Stockfish and it's clear to see, that Stockfish is in the near future on the same level - or better - as Rybka. For this statement should nobody spend here money for a prophet education?
Tord, please have patience for my wave of enthusiasm. I think we all have to learn, the Stockfish team too, that we are speaking about 3.000 ELO. What do you thinking about my playing style description? Could you write a little bit to the playing style of Stockfish from your point of view?
Thanks for the praise and the enthusiasm, but I think it is always misleading to compare the styles of chess programs to the style of human players. Humans and computer programs are just too different. Trying to decide whether Stockfish plays more like Lasker or more like Capablanca is kind of like deciding whether the German language is more similar to Persian or to Hindi.
Reading people's opinions about the styles of chess programs is always interesting and fun (even when I don't agree), but I think describing the style of a program is a task better left to neutral users. When trying to describe your own program, it is too difficult to be objective, and too easy to describe how you want your program to be rather than how it truly is.
The endgame and the king attacks are outstanding. In endgames it’s nice to see that Stockfish has a big advantage to the others. It seems that Stockfish find moves a long time before others can find it. Wherefrom is all the knowledge about endgames? In hard work developed or from important information sources? Could you give us some hints about the information of endgames the Stockfish team used?
Actually, there isn't a tremendous amount of endgame knowledge in Stockfish, apart from a few specialized evaluation functions for basic endgames that mostly serve as a crude replacement for bitbases. Stockfish's endgame strength is somewhat mysterious even to me, but I think the explanation must be that our search is particularly efficient in the endgame. By the way, it is worth noting that the endgame seems to be Stockfish's weakest stage of the game on the iPhone, where the search speed is very low.
The specialized endgame evaluation functions are not taken from any specific source, but the knowledge contained in them is just the type of information you can find in any basic endgame book for beginning human players. It's basic stuff like the necessity of driving the king to a corner of the bishop's color in KBN vs K endgames, or Philidor's third-rank defense in KRP vs KR endgames.
I can't escape the feeling that the preview version Glaurung (around 200 ELO weaker) is a little bit more aggressive in king attacks. But this is only to see if Glaurung works against opponents with the same playing strength. I guess with a higher ELO strength engines are playing less aggressive in tactics. Nowadays it's not easy to isolate such items because the playing strength is too high. Do you think that Stockfish lost a little bit of the aggressive playing style, Glaurung has?
I haven't noticed that, and I don't see how any of the changes since Glaurung 2.2 could have a major impact on the aggressiveness. The king safety evaluation is almost unchanged, and the evaluation weights for king safety haven't changed much. However, it is possible that what you notice is simply an effect of faster hardware. It seems to me that faster hardware tends to make aggressive chess programs play more conservatively, and more generally to make the differences in styles between chess program seem less distinctive. Stockfish plays a lot more aggressively and takes bigger risks on my iPhone than on my Mac.
What's about the weaknesses? My father said to me: Make your strength stronger and nobody can see your weakness! This could be a strategy by Stockfish. If the team will work again on the endgame nobody will understand it. Perhaps my father will understand it but he never played chess in his life. I have to find out on which points the Stockfish team is working so far. Please unpack the secrets!
For this question, I hand over the microphone to our strongest chess player:
Joona Kiiski (Finland)
* Classical king's Indian kind of blocked positions where "black" slowly develops dangerous attack. Stockfish playing with "white" has no clue what is happening until it's far too late.
* Stockfish is far too optimistic in late midgame positions where it has material advantage, but its king has no real shelter and queens are still on board. The risk that opponent is able to force perpetual check is great, but Stockfish has no understanding of this.
* Stockfish greatly overvalues connected passed pawns when opponent can create a blockade with his pieces. Luckily this doesn't happen very often in practice.
* Stockfish is too optimistic in late endgame with very few pawns, like KNP vs. KN or KBPP vs. KBP which often liquidate to draw.
* Stockfish still lacks basic endgame knowledge for some trivial drawn positions like KQ vs. KP when pawn is on "c2" or "a2".
Another point of view is the support of “standard features users await”. Stockfish comes with perfect UCI, x-64, multiprocessing support and several other things. Also very interesting UCI options are included. The problem is that the UCI options aren't documented. I know it is a boring work for a programmer. But can we await a good description of all the UCI options Stockfish has?
Most of the options are either so obvious that no explanation is necessary, or so complex that they are impossible to describe without going into very technical details about how the program works (like the numerous parameters for configuring the king safety evaluation and the parallel search). Some time in the not too distant future, we should probably remove some of the most confusing options and put up brief explanations of the rest on our web page.
We have the situation that an engine like Stockfish is too strong for this World. With 3.000 ELO nobody can beat it. Stefan Meyer-Kahlen added some interesting options to reduce the playing strength in his graphical user interface, called Shredder Classic. In times when I made the marketing of Ruffian, I gave order to Per-Ola to set playing levels as UCI option. For a while Franck Zibi worked with a student, who wrote his project work. He programmed a chess teacher as UCI option for Pharaon 2.62. I think this topic will get more and more attention in computer chess in the future. Conversely, this means that the future vision is to find out which engine is the weakest. I am sure the first computer chess friends started soon their rating lists regarding to this topic. What can you do to make Stockfish more interesting for a club player with 1.600?
Adjustable strength is already implemented (but still needs to be improved) in the iPhone version. It's possible that it will be included in the UCI engine as well some time in the future, but I'm still not sure it would be a good idea. Stockfish is an open source program, and it is therefore even more important than for the average chess engine that the source code is clean, easy to read, and easy to modify. Adjustable strength would make the source code more cluttered and complicated.
Teaching features would be interesting, but working on this requires very different skills than chess engine programming. We're probably not the right people for this task.
Do you have any other ideas to additional UCI options? What do you think about the personalities of TheKing or Komodo?
As mentioned above, I think the number of UCI options is currently too big rather than too small. It is more likely that we will remove than add options. Still, it remains possible that we'll add a few more options a little further down the road, when we have cut down a bit on the excessive number of options we have today. Two things I have occasionally been thinking about are an anti-human mode and a tactical analysis mode.
I can't comment on the personalities of The King and Komodo, because I am not familiar with these programs. As far as I know, they still don't exist for Mac OS X, so I can't run them.
To one point the ELO strength of Stockfish is 2.250 points only. Stockfish needs an own webpage. Such a fantastic project without a strong webpage can't be right. Chess players all around the world should easily find all the important information. After all I know you stand to 100% to open source projects. A discrepancy! I am sure the lacking time of the team is the only reason. Perhaps a web designer, someone of the community, can create your Stockfish webpage? Maybe the Stockfish team supports such an idea? One team member more ... why not!
If you had followed the news more closely, you would have heard about
With Joona and Marco two other programmers are working on Stockfish. Nobody knows the special parts of each team members. I am sure Joona and Marco can describe a little bit their work on Stockfish.
First of all I must say that there are no special parts or hard-coded roles in our team, except that Tord and Marco have done much more for Stockfish than I.
In open-source world everyone is allowed to do developing work according to their personal preferences and this applies also to Stockfish. Often we work on different areas, but many times it happens that when one of us finds a considerable improvement in one area, also other co-developers turn their attention to that area. Then we discuss on possible alternatives and try different recipes until we think we have found the optimal solution.
Since I seriously started this computer chess hobby about 1.5 years ago, I've spend most of my time in two areas: fine tuning of existing evaluation parameters and optimizing search tree (of course also Marco and Tord have worked on these areas!). I'm much more interested in high-level code than low-level code. When one starts to write a new chess engine, he needs to spend endless amount of time in writing bug free low-level code for move generation, board presentation, bit manipulating and so on. I never had neither time nor motivation to do this, so instead of writing a new engine, I decided to start hacking existing one which in my opinion had most potential (Glaurung/Stockfish). Marco had already started his work on Stockfish around 0.5 years earlier, Tord is the original creator of the program, so it was only natural that we ended up as a team. I feel very lucky to be allowed to work with these two professionals!
To work in a team is a very interesting situation. Each team member can work on certain parts and after all it can be disputed in the crew. By internet all is possible. I wonder why 95% of the programmers go their own way alone. I remember a discussion in a German computer chess forum. The topic was to create modules for the endgame, middle game, opening, protocol support, endgame database support and so on. Why the idea is bad? I never understand it. Could you explain a little bit with very easy words for NON programmers?
Compared to most other software projects, chess engines are fairly small, and not easily divided cleanly into independent parts. Working in a team is fun and a huge advantage, but I don't think it's a good idea to work on separate parts of the program. It is easier to improve one part of the program if you have a clear understanding of how the rest of the program works, and the only good way to obtain this understanding is to work on the rest of the program as well. Therefore, it is better to let everyone work on the entire program. This is how we work on Stockfish, and I guess most other teams writing chess programs work the same way.
Let us speak about free sources. At the moment clones are standing in public interest. Not all of these clones are legal. Many computer chess friends all over the World are searching for the best engine only. This group of persons are jumping from wagon to wagon never regarding the playing style, engine support, stability and so on.
It's a matter of course for a lot of people in our society. Such dependency culture was supported by the offer of free software. It seems that the intention of free software associations wobbles!
I am very interesting in your statement about such things!
First of all, I think it is a little backwards to blame free sources for the clones. You could just as well turn the question around and say that it is the very fact that keeping the inner workings of your program secret is considered acceptable (and even the norm) is what makes cloning possible.
Although cloning by itself is annoying, I think the general distrust, animosity and suspiciousness in the computer chess community today is a far bigger problem. The community would have been healthier -- and the programs far stronger -- if we had all been open and honest about what we do and valued cooperation over competition. Changing this has always been one of my main goals in computer chess, and it is sometimes depressing to see how badly I have failed.
I think you completely mislead the whole matter. Is not keeping the sources secreted that you avoid clones, actually you foster them. I understand why commercial engines keep sources closed. I understand much less amateur engines, even the ones with average / low end strength that are kept close by their authors for no real reason.
I think this is a remnant of an old mentality in computer chess community, where year 2000 is arriving just now, 10 years later then the calendar one. I think the relatively high average age of the people involved in this community is one of the reasons for the slow rate of change in mentality, but this is something unavoidable, after Crafty and Fruit are out the way is already set and Stockfish just enforces that way. People is slowly realizing that opening the sources does not make your engine weaker and if it _could_ make other people's engine stronger the link is not direct nor trivial. Ippo sources are out from almost a year and all the biggest engines have released their new versions _after_ Ippo was out. But still no engine, commercial or not, has reached that level of strength and you can bet _all_ the top engines author have looked at the sources.
I think Stockfish has gained a lot in terms of visibility, community feed back, support and acceptance by adopting a GPL license. It has even gained from a technical point of view because people have spotted and fixed many bugs just because sources are open. A lot of people starts to use SF sources as a test bed to try new ideas and as a common accepted reference to discuss about different implementations or variations of classical chess algorithms....this is the most important and long term impact that SF is achieving in the community and the open sources are the key to this.
One of the best kept secrets discovered with the broader availability of GPL engines is that there is _no_ secret recipe to build a strong engine: algorithms, ideas and software structures used are more or less the same, and well known for years. The difference is in the accuracy achieved while implementing them....and this is something you cannot copy.
Possible that in the near future the first Stockolito, Firefish or GlauIvanRung will be available. Another new hero will create a commercial Capablanca Chess 1.0 engine with the only difference to Stockfish, that only the evaluation was changed in one position of the sources. Programmers with more knowledge used Stockfish sources in secret mission but they never speak about it.
What do you prophesy will happen?
I think the future will be similar to the present and the recent past. Some new and original engines of widely differing strengths, some old engines which keep improving, some old engines getting abandoned, and the occasional annoying, but unavoidable clone.
Do you know why Fabien lost his interest on computer chess? For most of us, you are on the same level as Fabien and nobody has interest in loosing more of freeware top programmers in the future. It's hard to comprehend how you and many other amateurs are keeping their motivation. What is your main motivation to do such time-consuming things for us during all the years?
It is just like any other hobby: Our own enjoyment is what keeps us motivated. Motivation isn't constant, but varies over time, and can sometimes disappear temporarily or permanently.
I have not been in contact with Fabien since quite a long time now, but he actually did return to computer chess briefly a couple of years after the commercial version of Fruit was released, and even wrote a new program called Chess64. It's an unfinished project, but still plays quite well, and is written in an interesting style very different from Fruit's. It's a great pity the project was abandoned.
Very helpful are your comments in the community for a in the past. I remember on a situation some years ago. The programmer of Toga was working on his multiprocessing code and had some problems. You wrote him, that it is not very difficult to do that. It will need only the work of one afternoon. Please correct me if I am wrong. Your have a very popular name in the community. In the latest years you gave a lot of great comments in German fora. Which importance does computer chess have in your life?
Interacting with the community is part of the fun, even though it is sometimes depressing. I don't visit the Computer Schach und Spiele forum nearly as often as the CCC, but I still go there occasionally, partly because trying to read German is so fun.
I recall the Toga multiprocessing discussion only very vaguely. If I recall correctly, I suggested that he could just use Glaurung's MP code (this would have been perfectly legal, since both programs were GPLed), which should be fairly easy to adapt to other programs. If I wrote "one afternoon", I was probably a little optimistic, "one weekend" sounds more realistic :-)
Back to multiprocessing. Questions 17-19 were inevitable. A commercial chess engine with multiprocessing support costs a lot of money more. Do you agree on the price-calculation? Perhaps the multiprocessing code needs again and again a lot of time for each new version. It seems that commercials spend 50% of programming time in their multiprocessing code! Is this the cause that single core engine is 50% cheaper.
Do you think the claim was reasonable? Please don’t write: You asked the wrong person!
The prices of commercial programs have no direct relation to the amount of work involved in creating them. The prices are chosen with the intention of maximizing the profit. If the single-CPU version of a program costs X euro and the multi-CPU version of the same program costs 2X euro, it only means that the programmer thinks he will earn more money this way than by any other pricing scheme.
I heard that different ways to implement multiprocessing are possible. Could you write a little bit about this topic and the possibilities programmers have today? Which way is the most popular technique?
Most programs use some variant of a technique called the "Young Brothers Wait" algorithm. The implementation in Stockfish (and, I think, in most other programs) is influenced by Crafty's. There are algorithms which are harder to implement but scale better to a higher number of CPUs, and algorithms which are easier to implement but less efficient. A plain and simple Crafty-style YBW search is a good balance between complexity and efficiency on the mass-market computers available today.
Analysing with more than one core will give us different results if we try to replay the same analyse. Could you explain this circumstance? Perhaps it is caused by one of the possible techniques to implement multiprocessing?
When a chess program searches a position somewhere deep inside the search tree, it makes use of information it remembers from previous positions examined in the same search. Things like which moves are pruned, reduced or extended depend on which positions have been examined before, and what the results of searching these positions were. Most of the information used for such decisions is taken from memory which is shared between all CPUs.
As long as the program uses a single search thread, everything is 100% deterministic. But with multiple threads, weird things start happening, because the threads never run at exactly the same speed. Once in a while, one of the CPUs will have to take a break for a few milliseconds because the operating system gives it some other task. This happens randomly and unpredictably, and you have no control of when or how often it happens. As a consequence, exactly what each CPU has seen when a certain position is reached somewhere inside the tree is essentially random, and this randomness has an impact on the search decisions made at this position.
Zappa or Komodo profit from 64-Bit around 65 ELO, Rybka and Onno around 50 ELO, Glaurung and Stockfish with around 30 ELO. What is the reason for it? Maybe Stockfish will get 30 ELO points more with improvements of 64-Bit support? Is this possible?
I think this is very unlikely. It is difficult to be sure without knowing the source code of the other programs discussed, but I think Stockfish is just as well optimized for 64-bit CPUs as Zappa, Komodo, Rybka and Onno. It is more likely that the explanation for Stockfish's smaller Elo gain on 64-bit CPUs is the reverse: Stockfish is better optimized for 32-bit CPUs than most other bitboard engines. Many of the important low-level parts of Stockfish exist in two versions: A version optimized for 64-bit CPUs, and a version optimized for 32-bit CPUs. Thanks to this, Stockfish's speed hit on 32-bit hardware, while still substantial, isn't quite as big as that of most other bitboard programs.
At the end of the interview we all have interest on actual development information. Is the next release on the way? Do you, Joona or Marco checked the Null-Move idea, Dann Corbit has?
There is always a new release on the way. Some of the details in our implementation of recursive null move pruning has been changed in the current development version. It differs from Dann's suggestion, but has some features in common with it. You'll have to wait for the next public release to see the details.
It's very interesting trying to get material the programmers have on their hard disks. Could you send me preferred 3-5 position, which are used to analyze development versions? Or games you like? I will add the graphics to the interview. It’s nice to check such things with good music in the background, like Bach. Yes Tord, I remember you wrote me some years ago that you like Bach - me too. What are your hobbies beside computer chess?
We don't have any particular positions we use to analyze development versions, apart from the 16 positions used when running the "stockfish bench" command. In these positions, we don't look at the analysis, but only the speed and node counts. Their main use is to catch bugs whenever we try to make some change that isn't supposed to affect the search or evaluation. If the node counts are different before and after the change, we know that we have broken something.
The question about favorite games is also a difficult one to answer. Most of the time, we don't watch our test games, but only look at the results and statistics. And even when we do watch the games and notice a particularly nice one, we usually don't save that game separately. It just ends up hidden and forgotten in some huge PGN file along with thousands of other games somewhere on our hard disks.
My hobbies include sprinting, reading (all kinds of stuff, both fiction and non-fiction) and playing the viola.
Here is a game that was posted on the CCC some time ago (I've forgotten by whom), played by an earlier version of Stockfish. I'm not sure it's a good game, but it's certainly an entertaining one:
FQ: After black move 33. ... b1Q
Which other engines you like?
I wish, your answer will be AnMon...
Unfortunately, MTD seems to be too difficult for programmers or it is out of interest.
After all I understand one of the most interesting techniques in programming.
1. Which Engines do you like?
2. What's your opinion about MTD (in special for me)?
Being a Macintosh user, I don't know a lot of chess engines. Most engines, including AnMon, don't have Macintosh versions. Generally, I prefer open source programs. To me, a program without source code is less than half a program. A few of my favorites are (in alphabetical order):
Crafty: The most complete, portable and feature packed free chess program, and still one of the very strongest. Arguably the most important and influential chess program ever.
Fruit: Showed the world the power of simplicity, correctness and a clean and rigorous coding style. Very elegantly written. Later derivatives, although stronger, have unfortunately not been able to preserve the style and beauty of the original.
MicroMax: Neither among the strongest, most readable or most user-friendly chess programs, but by far the most impressive. More than one Elo point per character of source code is an unbelievable achievement.
OliThink: Admirably terse, elegant and readable, and very strong for its size. Probably the best program for learning about bitboards.
Phalanx: The program that taught me chess programming, and probably still one of the best programs to learn from for beginners. Most other programs are either too basic to be useful (like TSCP) or too big and complex (Crafty, Fruit, Stockfish).
Tomorrow in the morning Fabien will stand in front of your door. "Hello Tord, we can learn from each other. So I will learn a lot from you and perhaps you from me. I have interest working in the Stockfish team. What is your answer?
I am sure we would cooperate very well with Fabien and that the results would have been excellent, but I doubt that he would have been interested in working on Stockfish in its current form. It is more likely that we would have designed a new program from scratch. This is of course very unlikely to happen, but would have been fun.
Have thanks for your time Tord, Joona and Marco.
SCHACHWELT wish many success with Stockfish in the future.
Copyrights and Sources by http://www.schach-welt.de & Frank Quisinsky
Further publication of this interview is allowed and wished,
but with the permission of http://www.schach-welt.de only.
One condition is the complete casting (e.g. in printed media).
Frank Quisinsky, March 28th, 2010