StockFish engine

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 11:40 am
Location: Naperville, IL

Re: StockFish engine

Post by UncombedCoconut »

michiguel wrote:My point is, if somebody releases software under GPL, it is pointless to make exceptions like this. It beats the whole purpose.
I have no stake in this, but I wonder about a hypothetical case (in addition to giving prominent credit and explaining how to get Stockfish's source code):
(1) The app's use of Stockfish is functionally equivalent to launching it and communicating via stdin/stdout;
(2) The app implements communication with GlaurungServer.

Point (1) asks the iPhone developer to use Stockfish as a proprietary PC developer could legally use it. Point (2) is a sane attempt to restore an iPhone user's major missing freedom: to replace the included Stockfish with a modified version.

From a certain perspective, such an exception seems like a way not to punish a developer for the choice of platform, so it seems to be worth considering. Perhaps it is also worth considering that a developer who can't use Stockfish might just spend a day or two coding iVanhoe. :)
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: StockFish engine

Post by michiguel »

Tord Romstad wrote:
michiguel wrote:
kinderchocolate wrote:Stockfish team? What do you think? iPhone doesn't allow a separate process to spawn,
Droid does.
Sorry, I could not resist :-)
Pedantic correction: The iPhone does, too. It's pretty much a full-featured Unix workstation, and can do almost anything a desktop Unix box can do, albeit more slowly (but still faster than desktops from one decade ago).

It's Apple, not iOS, that doesn't allow third-party apps to start spawn new processes. An app that tries to do this will get rejected when Apple reviews it before release on the App store. I understand why Apple does this, but it would have been annoying if there was no easy way to work around it. Fortunately, working around it is easy.

:D
I have no idea, I have a crappy cell phone, but I could not resist the stupid joke. :-)

Miguel
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: StockFish engine

Post by michiguel »

UncombedCoconut wrote:
michiguel wrote:My point is, if somebody releases software under GPL, it is pointless to make exceptions like this. It beats the whole purpose.
I have no stake in this, but I wonder about a hypothetical case (in addition to giving prominent credit and explaining how to get Stockfish's source code):
(1) The app's use of Stockfish is functionally equivalent to launching it and communicating via stdin/stdout;
(2) The app implements communication with GlaurungServer.

Point (1) asks the iPhone developer to use Stockfish as a proprietary PC developer could legally use it. Point (2) is a sane attempt to restore an iPhone user's major missing freedom: to replace the included Stockfish with a modified version.
According to the spirit of the GPL, a major freedom is to have the source code available (and strategically trying to force everybody to open their sources, even if they don't say it). I personally do not care, I was trying to highlight the spirit of this license.

Miguel

From a certain perspective, such an exception seems like a way not to punish a developer for the choice of platform, so it seems to be worth considering. Perhaps it is also worth considering that a developer who can't use Stockfish might just spend a day or two coding iVanhoe. :)
kinderchocolate
Posts: 454
Joined: Mon Nov 01, 2010 6:55 am
Full name: Ted Wong

Re: StockFish engine

Post by kinderchocolate »

Tord Romstad wrote:
andrejcher wrote:To SF team: what is your decision?
I've been slow to reply, because I think it is a very difficult question. I really don't know what to think, and I feel quite uncomfortable about the situation.

In principle, I fully share Miguel's view. There is little point in using a GPL license if we arbitrarily grant exceptions to the license to everybody who asks politely. I also share Joona's concern that we will see a growing list of proprietary Stockfish derivatives and requests for exceptions to the license, and that just replying to the requests and reviewing the code of everything will get a nightmare. The two projects mentioned in this thread won't be the last ones. It is possible to make lots of money from selling chess programs for iOS (and no doubt Android as well), and programmers are only just beginning to discover this.

On the other hand, it doesn't feel right to punish those who are honest and actually ask, rather than just using the code illegally (which will almost certainly happen sooner or later, and may already have happened). If we're too restrictive in what we allow, there is a risk that more people use the illegal approach.

I also think of those who try to bring their own, completely original programs to iOS or Android. As Andriy pointed out himself previously in this thread, writing a chess engine from scratch takes a considerable amount of work. By using Stockfish as the starting point, someone working on an iOS chess app gets a huge competitive advantage for free compared to someone who starts from scratch. And this competitive advantage may matter a lot, because there is potentially a significant amount of money to earn. I fear that the free iOS Stockfish is already hurting the sales of commercial programs somewhat, and this problem will obviously get worse with a growing number of Stockfish-derivatives. The question, therefore, is the following: Is having to publish your source code under the GPL really an unreasonably high price to pay for this competitive advantage? After all, you can still charge for your program, and because there is no easy way for ordinary users to install it other than buying it from the App Store anyway, the public availability of the source code shouldn't hurt the sales much, if at all.

At the moment, although I see strong arguments both for and against, I lean mostly towards not allowing such exceptions to Stockfish's GPL. But I am still very much in doubt, and depending on how the current discussion develops, I may still change my mind.

Thanks for posting your concerns.

My project is a multi-platform project, it will be ported to Android and PCs. If I used Stockfish as the engine, I would definitely distributre it as an unmodified binary and therefore I wouldn't need a GPL licensing exception. It's only iOS that an exception would be needed. Stockfish had always been started as an open source project, but not everybody would like to do that. I had only spent about an hour in porting Stockfish to the project, but months in the interface and architecture. I am happy to open source the engine portion of the project or even write an article to educate the newcomers how to integrate an open source chess engine in iOS. I would explicitly state that the engine is a product of the Stockfish team and provide a link to their website. However, releasing the source for the entire project is not considerate.

The point of GPL is to encourage development with the source code available. The ultimiate goal is to benefit the community. Stockfish could play a major role, a new chess app that uses Stockfish will benefit users and increase product awareness (Stockfish, not the app itself). The reason I can't release the interface source is that it's too easy to redistribute it on AppStore. For example, the official iOS Stockfish has been cloned for a number of times, there's still a clone ChessChamp on AppStore. Last time, I emailed the author (Amy Faulkner) for a copy of the source, I received no reply. Even a tutorial could be cloned, eg: http://icodeblog.com/2009/07/08/look-familiar/.

I personally don't believe chess apps would make a lots of money. How many iPhone users play chess? A simple custom designed game would make much more money than a chess app. iPhone users generally prefer simple and fun game, this is not what chess is for. I develop a chess app because I am a chess player.

Honestly, anyone could use Stockfish illegally and it is very difficult to detect. When I was scratching my head on which engine to use, I saw a post by Tord Romstad in 2008. In the post, there was an illegal clone but Tord stated that the GPL license wasn't violated because the changes were "trivial". That's why I decided to use Stockfish for at least testing and waited until the product is stable later the year then asked the SF team for approval. I could have kept silent and I don't think anybody would notice especially if I twisted the evaluation code. It's likely that someone has already integrated Stockfish and distribute it.

What I suggest is, the product would be examined by the SF team before initial release. Subsequent releases need no notification to the team unless the source of the engine is modified (for example, from Stockfish 2.0 to 2.1). The team could request a copy of the source if in doubt. There would be a statement in the app and website that the engine is a product of the team and they are not involved in the project. Of course, there would be a link to the Stockfish website. This way, we benefit the community and nobody's inbox would be spammed.
ppetrov
Posts: 24
Joined: Sun Mar 21, 2010 10:48 pm
Location: Sofia, Bulgaria

Re: StockFish engine

Post by ppetrov »

If I was in the Stockfish team's shoes, I'd adopt a dual licensing model - similar to what Qt used to have before Nokia bought them, or what ExtJS has currently. The engine would be distributed under either GPL or a commercial license. Whenever a third party doesn't like GPL's terms, they could privately negotiate with the copyright holders (Tord+Marco+Joona) for a commercial license.
andrejcher
Posts: 12
Joined: Tue Jan 11, 2011 1:58 pm

Re: StockFish engine

Post by andrejcher »

kinderchocolate wrote:I had only spent about an hour in porting Stockfish to the project, but months in the interface and architecture. I am happy to open source the engine portion of the project or even write an article to educate the newcomers how to integrate an open source chess engine in iOS. I would explicitly state that the engine is a product of the Stockfish team and provide a link to their website. However, releasing the source for the entire project is not considerate.
The same. I'm warring about 100 $.99 clones on AppStore with the same code and even design.
kinderchocolate wrote:The reason I can't release the interface source is that it's too easy to redistribute it on AppStore. For example, the official iOS Stockfish has been cloned for a number of times, there's still a clone ChessChamp on AppStore. Last time, I emailed the author (Amy Faulkner) for a copy of the source, I received no reply. Even a tutorial could be cloned, eg: http://icodeblog.com/2009/07/08/look-familiar/.
Totally agree.
kinderchocolate wrote:I personally don't believe chess apps would make a lots of money. How many iPhone users play chess? A simple custom designed game would make much more money than a chess app. iPhone users generally prefer simple and fun game, this is not what chess is for.
From my statists (iChess Pack released on Nov 12, 2009) you will not make a lot of money and for me it is hobby that make just for paying designer and some beer.
kinderchocolate wrote: Honestly, anyone could use Stockfish illegally and it is very difficult to detect. When I was scratching my head on which engine to use, I saw a post by Tord Romstad in 2008. In the post, there was an illegal clone but Tord stated that the GPL license wasn't violated because the changes were "trivial". That's why I decided to use Stockfish for at least testing and waited until the product is stable later the year then asked the SF team for approval. I could have kept silent and I don't think anybody would notice especially if I twisted the evaluation code. It's likely that someone has already integrated Stockfish and distribute it.

What I suggest is, the product would be examined by the SF team before initial release. Subsequent releases need no notification to the team unless the source of the engine is modified (for example, from Stockfish 2.0 to 2.1). The team could request a copy of the source if in doubt. There would be a statement in the app and website that the engine is a product of the team and they are not involved in the project. Of course, there would be a link to the Stockfish website. This way, we benefit the community and nobody's inbox would be spammed.
+1
Aleks Peshkov
Posts: 892
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia

Re: StockFish engine

Post by Aleks Peshkov »

Glaurung and Stockfish was always free (in GPL sense) from the very beginning. I agree with Tord that creating a precedent for closing Stockfish as it became hot would be a bad decision. Everybody remember how fast Fruit died because of this mistake.

Right now the Stockfish is everything and the iChessPack is nothing. If the topic starter cannot afford GPL, he is free to use many other open source no-GPL programs for his project.
Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Re: StockFish engine

Post by Gian-Carlo Pascutto »

Tord Romstad wrote:The question, therefore, is the following: Is having to publish your source code under the GPL really an unreasonably high price to pay for this competitive advantage? After all, you can still charge for your program, and because there is no easy way for ordinary users to install it other than buying it from the App Store anyway, the public availability of the source code shouldn't hurt the sales much, if at all.
Publishing the entire source code under GPL would still not allow the original poster to sell his app through the iTunes store.

The problem is that the iTunes store adds additional restrictions when redistributing the code, and hence selling through it constitutes a GPL violation, because the GPL doesn't allow adding additional restrictions.

The only way to solve this is to give a specific exception, agreed among all people holding copyright on the Stockfish code.

(In my opinion, this is a problem of Apple and people choosing to develop for Apple's hardware, not a problem of the Stockfish team)
Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Re: StockFish engine

Post by Gian-Carlo Pascutto »

mcostalba wrote: No, any piece of code in is GPL and is esplicitly stated as that and there is no third party copyrighted code. We can do whatever we want with SF sources.
Are you sure? The comments aren't entirely clear, but these smell like derivative works:

book.cpp

Code: Select all

/*
  The code in this file is based on the opening book code in PolyGlot
  by Fabien Letouzey.  PolyGlot is available under the GNU General
  Public License, and can be downloaded from http://wbec-ridderkerk.nl
*/
rkhiss.h

Code: Select all

/*
 This file is based on original code by Heinz van Saanen and is
  available under the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.
*/
andrejcher
Posts: 12
Joined: Tue Jan 11, 2011 1:58 pm

Re: StockFish engine

Post by andrejcher »

I've checked a lot of open-source libraries due license they have for iPhone. Most of them have custom one.

For example check popular 2d game engine cocos2d (http://code.google.com/p/cocos2d-iphone/wiki/FAQ) and its license

"cocos2d for iPhone is licensed under the 'cocos2d for iPhone license'. Basically it is like a LGPL license but allows you to use the library as a static library or by including the cocos2d for iPhone sources in your project.

Remember that cocos2d for iPhone follows the copyleft idea. So if you improve the library, send me the patches or make them public so that I can include them in future releases."

And it doesn't require to make product open source.

Maybe the same can be done with SF engine? I can prepare open source library for static linking and guide about integration it.

Your thoughts?