StockFish engine

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
andrejcher
Posts: 12
Joined: Tue Jan 11, 2011 12:58 pm

StockFish engine

Post by andrejcher » Tue Jan 11, 2011 8:43 pm

Hi,

Am I allowed to embed StockFish engine in my paid iPhone/iPad application without any changes to it and without opening full source code of my application? It is not another clone of iPhone StockFish application. About my applications - it is FICS/ICC client with ability to play in offline mode too. I want to use engine for analyze game after it is finished online or on observing other one and for local play as well. I know that there is AnalysisBot on a FICS for that purpose but I don't want to use it and integrate in application because it is not for sure that it will exist in future. The same as don't want just copy/paste code from your appliaction without any permissions. If you need more details on application you can visit ichesspack.com

Thanks,
Andriy

ppetrov
Posts: 24
Joined: Sun Mar 21, 2010 9:48 pm
Location: Sofia, Bulgaria

Re: StockFish engine

Post by ppetrov » Tue Jan 11, 2011 9:49 pm

You can communicate to it (in a separate process) via UCI without restrictions. But as long as you link your and the SF sources in the same executable, the GPL requires you to share code.

kinderchocolate
Posts: 411
Joined: Mon Nov 01, 2010 5:55 am
Full name: Ted Wong
Contact:

Re: StockFish engine

Post by kinderchocolate » Wed Jan 12, 2011 12:15 am

Stockfish team? What do you think? iPhone doesn't allow a separate process to spawn, there's no way to create a new process in iPhone. Fundamentally, it's really the same thing, unmodified executable -> UCI communication. The only technical difference is static linking. If the Stockfish team is happy for it, there wouldn't be a problem.

I think the team should give approval, because it will benefit the community (more iPhone apps), since the sources aren't modified, forcing the sources to open wouldn't benefit anyone in the community. We should give some credits to the GUI developer by not forcing him to open source.

Andriy Dzyben, how do you think you will static link Stockfish? You can't link dynamically, Apple wouldn't allow. If you link statically and spawn Stockfish with a new thread, that wouldn't work because the engine assumes the inputs are from standard input and you can't emulate standard input in C++.

mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 7:17 pm

Re: StockFish engine

Post by mcostalba » Wed Jan 12, 2011 9:29 am

andrejcher wrote:Hi,

Am I allowed to embed StockFish engine in my paid iPhone/iPad application without any changes to it and without opening full source code of my application?
First of all thanks for asking !

In more accurate terms you are asking to relicense Stockfish under LGPL (http://en.wikipedia.org/wiki/GNU_Lesser ... ic_License) when embedded in a mobile/tablet PC.

Personally I don't see problems in this, actually I could even foreseen the possibility of a double GPL / LGPL licensing alltogheter, indipendently from the target platform, but Tord and Joona agreements are both mandatory in this case.

Michel
Posts: 2050
Joined: Sun Sep 28, 2008 11:50 pm

Re: StockFish engine

Post by Michel » Wed Jan 12, 2011 11:36 am

In more accurate terms you are asking to relicense Stockfish under LGPL (http://en.wikipedia.org/wiki/GNU_Lesser ... ic_License) when embedded in a mobile/tablet PC.
I think he is asking for a GPL exception. A GPL exception is something which is explicitly added to license to deal with certain special cases. Like apple not allowing a process to start another process on IOS. The latter is not a problem on Android and hence for Android such an exception would not be needed.

A GPL exception is much less radical than relicensing under the LGPL. IMHO such a drastic step should be _very_ carefully evaluated.

kinderchocolate
Posts: 411
Joined: Mon Nov 01, 2010 5:55 am
Full name: Ted Wong
Contact:

Re: StockFish engine

Post by kinderchocolate » Wed Jan 12, 2011 12:10 pm

Michel wrote:
In more accurate terms you are asking to relicense Stockfish under LGPL (http://en.wikipedia.org/wiki/GNU_Lesser ... ic_License) when embedded in a mobile/tablet PC.
I think he is asking for a GPL exception. A GPL exception is something which is explicitly added to license to deal with certain special cases. Like apple not allowing a process to start another process on IOS. The latter is not a problem on Android and hence for Android such an exception would not be needed.

A GPL exception is much less radical than relicensing under the LGPL. IMHO such a drastic step should be _very_ carefully evaluated.
Michel is right, LGPL wouldn't fulfill the requirements anyway. I happen to be on the same boat, my yet-to-published chess app uses Stockfish as the underlying engine. I had to modify the main loop in uci.cpp. Instead of waiting for standard inputs, it waits for a message from another thread. This way, I could spawn a Stockfish thread without modifying any other part of the code.

LGPL gives permission for dynamic linking, what we talking about is actual static linking, ie. embed the entire Stockfish code into the project. Apple's license is very strict, it wouldn't approve for dynamic linking, Unless the Stockfish team gives special permission to Andriy Dzyben and myself, I don't think we'd be able to publish Stockfish.

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

Re: StockFish engine

Post by hgm » Wed Jan 12, 2011 12:31 pm

One way aound this limitation would be to write your GUI as an operating system, which ust loads a Stockfish image into a large array, and then start a thread to run it. Or implements its own multi-tasking, if threads are not supported.

andrejcher
Posts: 12
Joined: Tue Jan 11, 2011 12:58 pm

Re: StockFish engine

Post by andrejcher » Wed Jan 12, 2011 1:26 pm

kinderchocolate wrote:
Michel wrote:
In more accurate terms you are asking to relicense Stockfish under LGPL (http://en.wikipedia.org/wiki/GNU_Lesser ... ic_License) when embedded in a mobile/tablet PC.
I think he is asking for a GPL exception. A GPL exception is something which is explicitly added to license to deal with certain special cases. Like apple not allowing a process to start another process on IOS. The latter is not a problem on Android and hence for Android such an exception would not be needed.

A GPL exception is much less radical than relicensing under the LGPL. IMHO such a drastic step should be _very_ carefully evaluated.
Michel is right, LGPL wouldn't fulfill the requirements anyway. I happen to be on the same boat, my yet-to-published chess app uses Stockfish as the underlying engine. I had to modify the main loop in uci.cpp. Instead of waiting for standard inputs, it waits for a message from another thread. This way, I could spawn a Stockfish thread without modifying any other part of the code.

LGPL gives permission for dynamic linking, what we talking about is actual static linking, ie. embed the entire Stockfish code into the project. Apple's license is very strict, it wouldn't approve for dynamic linking, Unless the Stockfish team gives special permission to Andriy Dzyben and myself, I don't think we'd be able to publish Stockfish.
Yep. It is exactly what I'm asking about - exception in StockFish licensing to embed code. LGPL will not help. The same as communication via UCI - it is not possible on iOS. Writing own engine without cloning other one is crazy idea and it can take years to polish it.

Thank you all for the response.

ppetrov
Posts: 24
Joined: Sun Mar 21, 2010 9:48 pm
Location: Sofia, Bulgaria

Re: StockFish engine

Post by ppetrov » Wed Jan 12, 2011 2:03 pm

mcostalba wrote:Personally I don't see problems in this, actually I could even foreseen the possibility of a double GPL / LGPL licensing alltogheter, indipendently from the target platform, but Tord and Joona agreements are both mandatory in this case.
It's possible that even the three of you together (Marco, Joona, Tord) don't have the authority to change the license, or grant exceptions. If you have accepted non-trivial patches from other people, without requiring copyright assignment, then their agreement is also required.

mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 7:17 pm

Re: StockFish engine

Post by mcostalba » Wed Jan 12, 2011 6:43 pm

ppetrov wrote:
mcostalba wrote:Personally I don't see problems in this, actually I could even foreseen the possibility of a double GPL / LGPL licensing alltogheter, indipendently from the target platform, but Tord and Joona agreements are both mandatory in this case.
It's possible that even the three of you together (Marco, Joona, Tord) don't have the authority to change the license, or grant exceptions. If you have accepted non-trivial patches from other people, without requiring copyright assignment, then their agreement is also required.
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.

Post Reply