Glaurung 0.2.0

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

Re: Glaurung 0.2.0

Postby Jim Ablett » 05 Feb 2005, 16:38

Hi Tord,
Compiled the latest source (0.21) with mingw32 and using latest (ppc) book.
Glaurung is now playing moves from the book, but they are illegal ones
right from the start.

Jim.
___________________________
http://jimablett.net63.net/
Jim Ablett
 
Posts: 721
Joined: 27 Sep 2004, 10:39
Location: Essex, England

Re: Glaurung 0.2.0

Postby Tord Romstad » 05 Feb 2005, 16:44

Hi Jim!
Jim Ablett wrote:Compiled the latest source (0.21) with mingw32 and using latest (ppc) book.
Glaurung is now playing moves from the book, but they are illegal ones
right from the start.


Excellent, this is clear progress. Could you please try to run the program from the command line and type the 'book' command? What output do you get?

Tord
User avatar
Tord Romstad
 
Posts: 639
Joined: 09 Oct 2004, 12:49
Location: Oslo, Norway

Re: Glaurung 0.2.0

Postby Jim Ablett » 05 Feb 2005, 16:52

Code: Select all
g1f3 (+10305, =16488, -65535), 20%, n=92328, p=0.994860
b1c3 (+101, =114, -103), 49%, n=318, p=0.005140
___________________________
http://jimablett.net63.net/
Jim Ablett
 
Posts: 721
Joined: 27 Sep 2004, 10:39
Location: Essex, England

Re: Glaurung 0.2.0

Postby Jim Ablett » 05 Feb 2005, 16:54

Here's the Arena debug >

Code: Select all
044250>1:ucinewgame
6044250>1:isready
6044281<1:readyok
6044406>1:position startpos
6044406>1:go wtime 300000 btime 300000 winc 0 binc 0 movestogo 40
6044437<1:bestmove g1f3
6044437*1*Found move:Ng1-f3
6044671<1:bestmove 0000
6044671*1*---------> Arena:Illegal move! (0000 )
6044968********Game end: 1-0 {1-0 Arena Adjudication. Illegal move!}
___________________________
http://jimablett.net63.net/
Jim Ablett
 
Posts: 721
Joined: 27 Sep 2004, 10:39
Location: Essex, England

Re: Glaurung 0.2.0

Postby Jim Ablett » 05 Feb 2005, 17:04

Bye Tord,
I'm offline now till tomorrow.

Good luck,

Jim.
___________________________
http://jimablett.net63.net/
Jim Ablett
 
Posts: 721
Joined: 27 Sep 2004, 10:39
Location: Essex, England

Re: Glaurung 0.2.0

Postby Tord Romstad » 05 Feb 2005, 17:33

Thank you very much for your help, Jim!

I now have the chance to play with a Windows computer for a couple of hours in an attempt to solve this frustrating problem. Unfortunately, I first of all face the even more frustrating problem of trying to install the MinGW compiler. :(

Tord
User avatar
Tord Romstad
 
Posts: 639
Joined: 09 Oct 2004, 12:49
Location: Oslo, Norway

Re: Glaurung 0.2.0

Postby Jim Ablett » 05 Feb 2005, 19:10

Not offline yet.
You're Welcome Tord.
It may be easier for you install the Devc++ ide which will automatically
install the latest GCC and mingw32 for you.

http://www.bloodshed.net/devcpp.html

Bye,
Jim.
___________________________
http://jimablett.net63.net/
Jim Ablett
 
Posts: 721
Joined: 27 Sep 2004, 10:39
Location: Essex, England

Re: Glaurung 0.2.0

Postby Tord Romstad » 05 Feb 2005, 19:27

Jim Ablett wrote:Not offline yet.
You're Welcome Tord.
It may be easier for you install the Devc++ ide which will automatically
install the latest GCC and mingw32 for you.

http://www.bloodshed.net/devcpp.html

Thanks Jim,

I managed to install MinGW and Cygwin. Glaurung works perfectly with its book when compiled with Cygwin. With MinGW, it doesn't work. My results are exactly the same as yours. I can't figure out precisely what is wrong, but it seems that MinGW does something very strange with 64-bit ints. Even the following simple program gives incorrect output in MinGW:

Code: Select all
#include <stdio.h>

int main(void) {
  unsigned long long x;
  int i;

  for(i=0; i<64; i++) {
    x = 1ULL << i;
    printf("x = %llx\n", x);
  }
  return 0;
}

Can any MinGW experts explain what goes wrong here? And can someone with a Windows compiler different from Cygwin and MinGW (preferably the Microsoft compiler) try to compile my latest source code and test whether it works?

If somebody wants to try, it is important that you use this source code and this book file. This combination works when compiling with gcc in Linux and Mac OS X, and also with Cygwin under Windows, but not with MinGW. :(

Tord
User avatar
Tord Romstad
 
Posts: 639
Joined: 09 Oct 2004, 12:49
Location: Oslo, Norway

Compilation attempt with MSVC 6.0

Postby Tim Foden » 05 Feb 2005, 21:12

Hi Tord,

As I thought 'long long' is not good with Microsoft's compiler. :)

It uses __int64 instead. You really need to use a typedef or #define to make it portable I'm afraid.

Sample output below...

Cheers, Tim.

Code: Select all
E:\WinBoard\Glaurung\src021\src>cl -Ox -o glaurung attacks.c board.c book.c data
.c endgame.c eval.c extend.c history.c init.c io.c main.c mersenne.c move.c move
gen.c order.c pick.c psq.c pstruct.c root.c safety.c search.c see.c strcase.c th
ink.c timeoday.c tt.c uci.c zobrist.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

attacks.c
glaurung.h(177) : warning C4005: 'max' : macro redefinition
        D:\dev\MsVS\VC98\INCLUDE\windef.h(177) : see previous definition of 'max
'
glaurung.h(178) : warning C4005: 'min' : macro redefinition
        D:\dev\MsVS\VC98\INCLUDE\windef.h(181) : see previous definition of 'min
'
glaurung.h(301) : error C2632: 'long' followed by 'long' is illegal
glaurung.h(302) : error C2632: 'long' followed by 'long' is illegal
board.c
glaurung.h(177) : warning C4005: 'max' : macro redefinition
        D:\dev\MsVS\VC98\INCLUDE\windef.h(177) : see previous definition of 'max
'
glaurung.h(178) : warning C4005: 'min' : macro redefinition
        D:\dev\MsVS\VC98\INCLUDE\windef.h(181) : see previous definition of 'min
'
glaurung.h(301) : error C2632: 'long' followed by 'long' is illegal
glaurung.h(302) : error C2632: 'long' followed by 'long' is illegal
Tim Foden
 

Re: Compilation attempt with MSVC 6.0

Postby Tord Romstad » 05 Feb 2005, 21:42

timfoden wrote:As I thought 'long long' is not good with Microsoft's compiler. :)


Hi Tim,

Thanks for your input. I think "long long" is supposed to be supported by the most recent versions of Microsoft's compiler (in fact, I think Dann uses the Microsoft compiler when compiling the Windows binary of Glaurung). If I recall correctly, it is even included in the latest C standard.

At any rate, this shouldn't be a major obstacle when compiling my program with a compiler which does not understand "long long". Just change the "typedef unsigned long long uint64" in glaurung.h into something like "typedef unsigned _int64 uint64".

Tord
User avatar
Tord Romstad
 
Posts: 639
Joined: 09 Oct 2004, 12:49
Location: Oslo, Norway

Re: Glaurung 0.2.0

Postby GeoffW » 05 Feb 2005, 22:15

Hi Tord

I just did a quick build of Glaurung for you using MS VS Ver 6. There were a few little moans by the MS VS compiler (let me know if you want me to email you the compiler output). I fixed the errors but left the warnings in so it is possible they might be causing a problem

Anyway, I tried it under Arena, I think I set it up to use its own book but I am not that familiar with it so not 100% sure.

It kept saying illegal move for each Glaurung book move, I posted the output at the bottom of this post. I have never really looked at the UCI protocol so I am guessing a bit here

the line 807641<1:bestmove 0000

looked suspicious , is that valid ? /*<1 means glaurung sends to Arena */

For info the post below was Glaurung playing as white, Arena choked on its first book move I think

Hope this is of some help

Regards Geoff



789938********- - - - Pairing 1/1 : Glaurung02 - Knightx186 - - - -
789938********Starting engine 1 Glaurung02
790281*1*------------------------Starting engine 1 Glaurung02------------------------
790281*1*Configured Engine 1 Type: UCI
790422*1*Engine 1 dir: E:\_Chess0x88\glaurung0.2\Glaurung02\Release
790484*1*Engine 1 commandline: E:\_Chess0x88\glaurung0.2\Glaurung02\Release\Glaurung02.exe
790891>1:uci
790953<1:id name Glaurung 0.2.1
790953<1:id author Tord Romstad
790953<1:option name Hash type spin default 32 min 1 max 1024
790953<1:option name King safety type spin default 100 min 0 max 200
790953<1:option name Passed pawns type spin default 140 min 0 max 200
790969<1:option name Pawn structure type spin default 150 min 0 max 200
790969<1:option name Static pruning depth type spin default 3 min 0 max 6
790969<1:option name OwnBook type check default true
790969<1:uciok
791172>1:setoption name Hash value 64
791172>1:isready
792203<1:readyok
796484********Starting engine 2 Knightx186
796828*2*------------------------Starting engine 2 Knightx186------------------------
796828*2*Configured Engine 2 Type: WB2
796969*2*Engine 2 dir: E:\ChessArena\Engines\knightx
797031*2*Engine 2 commandline: E:\ChessArena\Engines\knightx\Knightx186.exe
797281<2:KnightX 1.86 aka Techno Chess engine for Winboard
797281<2:Copyright 2004 Christophe Jolly
797281<2:Email:technochess@free.fr
797281<2:Web:http://technochess.free.fr
797328>2:xboard
797328>2:protover 2
798594<2:feature myname="KnightX 1.86" name=1 ping=1 analyze=1 done=1
798594>2:accepted myname
798594>2:accepted name
798594>2:accepted ping
798594>2:accepted analyze
798594>2:accepted done
799047>2:new
799047>2:random
799047>2:level 0 6 1
799141<2:Error (unknown command): RANDOM
799141>2:post
799141>2:hard
799141>2:easy
799141>2:ping 1
799172<2:pong 1
799297>2:name Knightx186
799297>2:computer
799328<2:Error (unknown command): COMPUTER
804547>1:isready
804578<1:readyok
804703>2:ping 2
804734<2:pong 2
805297>1:stop
805297<1:Unknown command stop
805359>2:easy
805359********????Game 1 of 100: Glaurung02 - Knightx186????
805375**-------------NewGame!!!-------------
805375>2:level 0 6 1
805375>2:new
805375>2:level 0 6 1
805484>2:post
805484>2:hard
805484>2:easy
805484>2:ping 3
805516<2:pong 3
805641>2:name Glaurung 0.2.1
807219*1*Start calc, move no: 0
807219>1:ucinewgame
807219>1:isready
807250<1:id name Glaurung 0.2.1
807250<1:id author Tord Romstad
807250<1:option name Hash type spin default 32 min 1 max 1024
807250<1:option name King safety type spin default 100 min 0 max 200
807281<1:option name Passed pawns type spin default 140 min 0 max 200
807281<1:option name Pawn structure type spin default 150 min 0 max 200
807313<1:option name Static pruning depth type spin default 3 min 0 max 6
807313<1:option name OwnBook type check default true
807313<1:uciok
807344<1:readyok
807375>1:position startpos
807375>1:go wtime 360000 btime 360000 winc 1000 binc 1000
807406<1:bestmove g1f3
807406*1*Found move:Ng1-f3
807641<1:bestmove 0000
807641*1*---------> Arena:Illegal move! (0000 )
807922********Game end: 1-0 {1-0 Arena Adjudication. Illegal move!}
807922********Last game won by Glaurung02 with White in 1 moves
807922********Glaurung02 - Knightx186: 1-0-0
807938******** 1 W 1 1.0:0.0 1.0:0.0 21:04:32 0.00 1 0:0 1-0-0
807984********Saving file E:\ChessArena0.94\crap.pgn
807984>1:stop
807984>2:?
808031<1:Unknown command stop
809563>2:result 1-0
GeoffW
 
Posts: 37
Joined: 01 Oct 2004, 18:36

Re: Glaurung 0.2.0

Postby Tord Romstad » 05 Feb 2005, 23:11

Hi Geoff,

Thanks for your help!

GeoffW wrote:I just did a quick build of Glaurung for you using MS VS Ver 6. There were a few little moans by the MS VS compiler (let me know if you want me to email you the compiler output).


Yes, I would be happy to see the compiler output. I have more or less given up fixing the book problem by now (I have been working on it almost the whole day without success), but the compiler output could perhaps help me notice other problems in my code.

Tord
User avatar
Tord Romstad
 
Posts: 639
Joined: 09 Oct 2004, 12:49
Location: Oslo, Norway

Re: Glaurung 0.2.0

Postby GeoffW » 05 Feb 2005, 23:49

Hi Tord

I didnt know your email so I posted the compiler output as a private message here. Sounds like you need to take a break from trying to fix it today anyways. Sometimes you come back to a problem like that after a day or two and the solution seems obvious.

It looks an odd problem, from the Arena debug it seems to pick a sensible opening white book move then instead of shutting up and letting black move it then wants to pick a second opening move
(bestmove 0000)

Regards Geoff
GeoffW
 
Posts: 37
Joined: 01 Oct 2004, 18:36

Re: Glaurung 0.2.0

Postby Tord Romstad » 06 Feb 2005, 00:03

Hi Geoff,

Got your message. :)

GeoffW wrote:Sounds like you need to take a break from trying to fix it today anyways.

Very good advice. I can't remember the last time I was so frustrated.

Sometimes you come back to a problem like that after a day or two and the solution seems obvious.

In this particular case, I am not so sure. Windows-specific problems are difficult to solve, because I very rarely have the opportunity to use a Windows computer, and because I am almost completely Windows-illiterate.

The sad truth is that I am not a Windows programmer, and Glaurung is not a Windows program.

It looks an odd problem, from the Arena debug it seems to pick a sensible opening white book move then instead of shutting up and letting black move it then wants to pick a second opening move
(bestmove 0000)

Yes, it's a very odd problem. I find it particularly strange that everything seems to work with Cygwin, but not with MinGW. I thought the two were almost the same.

At any rate, I am fairly sure my Cygwin executable of 0.2.1 should work correctly.

Finally, I would like to give a big thanks to all the friendly people who have tried to help me to solve this problem today! Your help and advice is greatly appreciated. :D

Tord
User avatar
Tord Romstad
 
Posts: 639
Joined: 09 Oct 2004, 12:49
Location: Oslo, Norway

Re: Glaurung 0.2.0

Postby Fabien Letouzey » 06 Feb 2005, 09:42

Hi all,

First I haven't had the time to read this thread, so I don't know if the problem has been fixed or not already.

On Windows, opening files in binary mode is a must. "r" should be "rb". Otherwise the C lib will be busy converting 0D0A into 0A everywhere.

Its' a bug, but probably not the one you're looking for.

Fabien.
Fabien Letouzey
 
Posts: 110
Joined: 03 Dec 2004, 10:17
Location: France

Re: Glaurung 0.2.0

Postby Alessandro Scotti » 06 Feb 2005, 10:13

Fabien Letouzey wrote:Hi all,

First I haven't had the time to read this thread, so I don't know if the problem has been fixed or not already.

On Windows, opening files in binary mode is a must. "r" should be "rb". Otherwise the C lib will be busy converting 0D0A into 0A everywhere.

Its' a bug, but probably not the one you're looking for.

Fabien.


Hi Fabien,
as I reported in the other thread that was the bug, but the behavior in this case was a little bit different. The loss count for g1f3 is 6813, that is 1A9D in hex. fgetc() then would interpret 1A as EOF and start returning -1. Unfortunately the return of fgetc() is not checked but converted straight into an unsigned char 0xFF. That made the loss count 65535, and then no more moves were read.
User avatar
Alessandro Scotti
 
Posts: 306
Joined: 20 Nov 2004, 00:10
Location: Rome, Italy

Previous

Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 56 guests