Revolutionizing handheld chess: Glaurung 2 for the iPhone

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

Moderators: hgm, Rebel, chrisw

Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Revolutionizing handheld chess: Glaurung 2 for the iPhon

Post by Tord Romstad »

mcostalba wrote:Congratulations for your effort, Tord.
For our effort, you mean. You are listed as one of the authors, for obvious reasons. :)
I think this is a really new groundbreaking release for playing chess on a mobile, much more then some xx increase of ELO ;-)

Now you can play chess without void your batteries in 20 minutes, and this is really something new and effective.
I am not entirely sure how the effect on battery life is; I haven't tested it. It seems likely that the batteries will last longer when running the engine remotely, but it is possible that the required continuous Internet connection consumes at least as much battery as running the CPU at full speed.
Many will follow...commercials included.
I think so, too. For this reason, it is important that I don't wait too long with documenting the protocol and making the server work flawlessly with other UCI engines (it's possible that it already does; I haven't tested). It would be an awful waste if everyone had to reinvent the wheel...
User avatar
Rubinus
Posts: 1161
Joined: Thu Jan 18, 2007 4:05 pm
Location: Prague
Full name: Pavel Háse

Re: Revolutionizing handheld chess: Glaurung 2 for the iPhon

Post by Rubinus »

Tord Romstad wrote:
Rubinus wrote:And Windows Mobile? I have HTC Diamond ...
Even less likely than an Android version, I'm afraid. As far as I know, you need a Windows machine to develop Windows Mobile programs. I don't do Windows, and I don't understand Windows.

I am not talking to you or anyone else in particular, but in general I sometimes feel a little disappointed that so many complain that I don't port to all available platforms, and that so few are willing to do the job themselves.
Problem is not source, if use some C(variant). Maybe anyone create compilation for winmobile. Or leastways SF engine for Pocket Fritz 3/4 :D .
Best Regards Pavel Háse
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Revolutionizing handheld chess: Glaurung 2 for the iPhon

Post by Tord Romstad »

Rubinus wrote:Problem is not source, if use some C(variant). Maybe anyone create compilation for winmobile. Or leastways SF engine for Pocket Fritz 3/4 :D .
Best Regards Pavel Háse
I just got an idea:

With the new remote engine feature, it probably wouldn't be very hard to write a web app which lets you play against an engine running on your home computer. Such an app would, of course, work on any platform with a web browser, including Android and Windows Mobile. The only obvious disadvantage is that it would require Internet access.
alpha123
Posts: 660
Joined: Sat Dec 05, 2009 5:13 am
Location: Colorado, USA

Re: Revolutionizing handheld chess: Glaurung 2 for the iPhon

Post by alpha123 »

Tord Romstad wrote:
Rubinus wrote:Problem is not source, if use some C(variant). Maybe anyone create compilation for winmobile. Or leastways SF engine for Pocket Fritz 3/4 :D .
Best Regards Pavel Háse
I just got an idea:

With the new remote engine feature, it probably wouldn't be very hard to write a web app which lets you play against an engine running on your home computer. Such an app would, of course, work on any platform with a web browser, including Android and Windows Mobile. The only obvious disadvantage is that it would require Internet access.
I'll consider doing that. You better start documenting that protocol.... ;)

Peter
Taner Altinsoy
Posts: 147
Joined: Fri Dec 18, 2009 3:56 pm
Location: Istanbul

Re: Revolutionizing handheld chess: Glaurung 2 for the iPhon

Post by Taner Altinsoy »

Tord Romstad wrote:
Rubinus wrote:Problem is not source, if use some C(variant). Maybe anyone create compilation for winmobile. Or leastways SF engine for Pocket Fritz 3/4 :D .
Best Regards Pavel Háse
I just got an idea:

With the new remote engine feature, it probably wouldn't be very hard to write a web app which lets you play against an engine running on your home computer. Such an app would, of course, work on any platform with a web browser, including Android and Windows Mobile. The only obvious disadvantage is that it would require Internet access.
Please do that. I am dying to know my Iphone's Elo.

Taner
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Revolutionizing handheld chess: Glaurung 2 for the iPhon

Post by Tord Romstad »

Max wrote:All went well, but in analyse mode of this position

Image

Glaurung 2.0 terminates every time after about 15 seconds (shortly after the screenshot was done).
This one was hard to debug, because the program just suddenly exits without any error message whatsoever, even when compiled with debugging information.

I have now found that the problem is that the program blows the stack. The default stack size on the iPhone seems to be very low. I'll either have to look for a way to increase the stack size, or find a way to decrease Stockfish's stack usage (for instance by reducing the stack depth, or by reducing the size of the arrays used to store moves at every ply).

Thanks again for reporting the bug!
:)
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Revolutionizing handheld chess: Glaurung 2 for the iPhon

Post by Max »

Tord,

could you please take a look at your website .. the download link for the Glaurung Server source code leads to "Not found".

Thanks for your perfect user support,
Max
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Revolutionizing handheld chess: Glaurung 2 for the iPhon

Post by Tord Romstad »

Max wrote:Tord,

could you please take a look at your website .. the download link for the Glaurung Server source code leads to "Not found".

Thanks for your perfect user support,
Max
Hello Max,

You're right. Fixed now. If you want to build it from source code, you'll need Clozure Common Lisp with the cl-utilities and iterate libraries installed. Unless you already have some Lisp experience, I'm not sure it's worth the trouble.

I managed to fix the stack size problem quite easily. For the curious, this is what I had to change: In the initWithGameController: method in the EngineController class, I replaced

Code: Select all

    [self performSelectorInBackground: @selector(startEngine:) withObject: nil];
with:

Code: Select all

    NSThread *thread =
       [[NSThread alloc] initWithTarget: self
                               selector: @selector(startEngine:)
                                 object: nil];
    [thread setStackSize: 0x100000];
    [thread start];
    [thread release];
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Revolutionizing handheld chess: Glaurung 2 for the iPhon

Post by Max »

Hi Tord,
Tord Romstad wrote:If you want to build it from source code, you'll need Clozure Common Lisp with the cl-utilities and iterate libraries installed. Unless you already have some Lisp experience, I'm not sure it's worth the trouble.
as I'm stuck with OS X 10.5, my intention was to compile Glaurung server by myself. But this sounds more complicated than a simple "make".

In the meantime I replaced the provided stockfish binary in the server app (Glaurung Server.app/Contents/Resources) with my older own stockfish 1.7.1 compile. Now Glaurung server runs on Leo too! :D But perhaps the original stockfish from "Glaurung Server.app/Contents/Resources" is somehow different to the "normal" uci stockfish? :?: A first connection to the iPod works well.

Happy, that you could fix the bug so fast. Is there a little chance for an additional button (.. OK .. feature :P ) showing the mpv of , lets say 2 upto 4, moves?

Thanks,
Max
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Revolutionizing handheld chess: Glaurung 2 for the iPhon

Post by Tord Romstad »

Max wrote:In the meantime I replaced the provided stockfish binary in the server app (Glaurung Server.app/Contents/Resources) with my older own stockfish 1.7.1 compile. Now Glaurung server runs on Leo too! :D
Great!
But perhaps the original stockfish from "Glaurung Server.app/Contents/Resources" is somehow different to the "normal" uci stockfish? :?:
No, it's exactly the same. You should also be able to use Stockfish 1.8, and possibly other UCI engines as well, as long as you rename them to "stockfish" and copy them to the right location.
A first connection to the iPod works well.

Happy, that you could fix the bug so fast. Is there a little chance for an additional button (.. OK .. feature :P ) showing the mpv of , lets say 2 upto 4, moves?
Maybe, but probably not in the very near future. The top priorities right now are fixing bugs, adding iPad support, improving the remote engine feature, and upgrading the engine from Stockfish 1.7.1 to 1.8 (which by the way seems to be a much bigger improvement on the iPhone than on desktop computers).