Crafty 25.1 Release

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

Moderators: hgm, Rebel, chrisw

Gregory Owett
Posts: 249
Joined: Fri Mar 10, 2006 10:26 am
Location: France

Re: Crafty 25.1 Release

Post by Gregory Owett »

Dann Corbit wrote:I'll post one in a little while.
I made one yesterday, but it was not from the official released sources.
Thanks a lot, Dann !
Gregory Owett
Posts: 249
Joined: Fri Mar 10, 2006 10:26 am
Location: France

Re: Crafty 25.1 Release

Post by Gregory Owett »

Alexander Schmidt wrote:
Gregory Owett wrote::roll:
Many open source developers just release a source code, there are several good reasons why they do so. The "roll-eyes-smiley" is definetely out of place here.
:roll: :roll: :roll:
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Crafty 25.1 Release

Post by Dann Corbit »

Crafty is open source.
So anyone can make a UCI adapter for it to create a UCI crafty.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Crafty 25.1 Release

Post by Dann Corbit »

My crafty.rc file:

Code: Select all

mt 10
st 5
smpnice=1
egtb
tbpath=C:\chess\syzygy;J:\Syzygy;G:\Syzygy;
hash=1024M
hashp=64M
ponder off
learn 0
book off
log=off
swindle off
exit
When I start Crafty:

Code: Select all

F:\project\dcorbit\crafty-25.1>crafty
EPD Kit revision date: 1996.04.21
unable to open book file [./books.bin].

Initializing multiple threads.
System is SMP, not NUMA.
max threads set to 10.
search time set to 5.00.
SMP terminate extra threads when idle.
SYZYGY EGTB access enabled, 6 piece TBs found
hash table memory = 1G bytes (64M entries).
pawn hash table memory = 48M bytes (2M entries).
pondering disabled.
book learning disabled
book file disabled.


Crafty v25.1 (10 threads)

machine has 12 processors

White(1):
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
Werner
Posts: 2872
Joined: Wed Mar 08, 2006 10:09 pm
Location: Germany
Full name: Werner Schüle

Re: Crafty 25.1 Release

Post by Werner »

Thanks,
Now it works perfect here!
Werner
Modern Times
Posts: 3550
Joined: Thu Jun 07, 2012 11:02 pm

Re: Crafty 25.1 Release

Post by Modern Times »

Werner wrote:
peter wrote:Hi Dann!
Should there be an .exe within
:?:
Hi, I found the .exe :D
But the .exe works only on modern CPUs (Skylake, Ivy Bridge) not Bloomfield like my i7 920.
It works on my AMD FX8350 which is not that modern.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty 25.1 Release

Post by bob »

Modern Times wrote:
Werner wrote:
peter wrote:Hi Dann!
Should there be an .exe within
:?:
Hi, I found the .exe :D
But the .exe works only on modern CPUs (Skylake, Ivy Bridge) not Bloomfield like my i7 920.
It works on my AMD FX8350 which is not that modern.
This is the reason I stopped trying to distribute executables 15+ years ago. Too many operating systems / versions, too many different architectural platforms, too many different compilers, too many different GUIs, and so forth, multiply all of those together and you get a LOT of combinations to try to support. Easier to distribute source and let users type "make" and then execute the thing. :)
User avatar
GONeill
Posts: 87
Joined: Sun Jun 15, 2014 6:40 am
Location: New Zealand
Full name: Graham O'Neill

Re: Crafty 25.1 Release

Post by GONeill »

Thanks Dann. When I compile here with GCC 5.4 on Windows using your settings I get quite a few warnings:

Code: Select all

In file included from chess.h:76:0,
                 from iterate.c:1,
                 from crafty.c:13:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
In file included from crafty.c:13:0:
iterate.c: In function 'Iterate':
iterate.c:237:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
           NumaStartThread(ThreadInit, (void *) proc);
                                       ^
iterate.c:52:13: warning: unused variable 'pt' [-Wunused-variable]
   pthread_t pt;
             ^
In file included from crafty.c:27:0:
utility.c: In function 'ReadClock':
utility.c:1318:12: warning: unused variable 'tUser64' [-Wunused-variable]
   uint64_t tUser64;
            ^
utility.c:1317:40: warning: unused variable 'ftUser' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                                        ^
utility.c:1317:30: warning: unused variable 'ftKernel' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                              ^
utility.c:1317:22: warning: unused variable 'ftExit' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                      ^
utility.c:1317:12: warning: unused variable 'ftCreate' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
            ^
utility.c:1316:10: warning: unused variable 'hThread' [-Wunused-variable]
   HANDLE hThread;
          ^
utility.c: In function 'WinNumaInit':
utility.c:2629:16: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
         printf("System is NUMA. %d nodes reported by Windows\n",
                ^
utility.c:2629:16: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
utility.c:2634:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
           printf("Node %d CPUs: ", ulNode);
                  ^
utility.c:2634:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
utility.c:2642:24: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
                 printf("%d ", ulCPU);
                        ^
utility.c:2642:24: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
utility.c:2654:16: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
         printf("Current ideal CPU is %u\n", dwCPU);
                ^
utility.c:2654:16: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
utility.c:2660:22: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
               printf("Exchanging nodes 0 and %d\n", ulNode);
                      ^
utility.c:2660:22: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
utility.c:2606:13: warning: unused variable 'dwMask' [-Wunused-variable]
   DWORD_PTR dwMask;
             ^
utility.c: In function 'NumaStartThread':
utility.c:2687:12: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
     printf("Starting thread on node %d CPU mask %I64d\n", ulNumaNode,
            ^
utility.c:2687:12: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
In file included from crafty.c:40:0:
init.c: In function 'Initialize':
init.c:67:22: warning: overflow in implicit constant conversion [-Woverflow]
     fseek(book_file, -sizeof(int), SEEK_END);
                      ^
init.c:22:27: warning: unused variable 'node' [-Wunused-variable]
   int i, j, v, major, id, node;
                           ^
init.c:22:7: warning: unused variable 'i' [-Wunused-variable]
   int i, j, v, major, id, node;
       ^
They are just warnings though, and it seems to run OK.

The comments in the Makefile say to try options to find out which gives the fastest compile. Does Crafty have a Bench command to allow a speed test? Or is there some other way to accurately compare two compiles?

Thanks!
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Crafty 25.1 Release

Post by Dann Corbit »

Crafty has a bench command.
For me, I get a faster binary with no profile than with a profile.
So I usually just run make.
But you can run the make file with:

make -j windows-gcc-profile
and then run make and it will use the gcda file.

The make file automatically chooses the hardware you build on for the instruction set, so you don't have to change architecture.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
JohnS
Posts: 215
Joined: Sun Feb 24, 2008 2:08 am

Re: Crafty 25.1 Release

Post by JohnS »

GONeill wrote:Thanks Dann. When I compile here with GCC 5.4 on Windows using your settings I get quite a few warnings:

Code: Select all

In file included from chess.h:76:0,
                 from iterate.c:1,
                 from crafty.c:13:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
In file included from crafty.c:13:0:
iterate.c: In function 'Iterate':
iterate.c:237:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
           NumaStartThread(ThreadInit, (void *) proc);
                                       ^
iterate.c:52:13: warning: unused variable 'pt' [-Wunused-variable]
   pthread_t pt;
             ^
In file included from crafty.c:27:0:
utility.c: In function 'ReadClock':
utility.c:1318:12: warning: unused variable 'tUser64' [-Wunused-variable]
   uint64_t tUser64;
            ^
utility.c:1317:40: warning: unused variable 'ftUser' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                                        ^
utility.c:1317:30: warning: unused variable 'ftKernel' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                              ^
utility.c:1317:22: warning: unused variable 'ftExit' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                      ^
utility.c:1317:12: warning: unused variable 'ftCreate' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
            ^
utility.c:1316:10: warning: unused variable 'hThread' [-Wunused-variable]
   HANDLE hThread;
          ^
utility.c: In function 'WinNumaInit':
utility.c:2629:16: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
         printf("System is NUMA. %d nodes reported by Windows\n",
                ^
utility.c:2629:16: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
utility.c:2634:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
           printf("Node %d CPUs: ", ulNode);
                  ^
utility.c:2634:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
utility.c:2642:24: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
                 printf("%d ", ulCPU);
                        ^
utility.c:2642:24: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
utility.c:2654:16: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
         printf("Current ideal CPU is %u\n", dwCPU);
                ^
utility.c:2654:16: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
utility.c:2660:22: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
               printf("Exchanging nodes 0 and %d\n", ulNode);
                      ^
utility.c:2660:22: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
utility.c:2606:13: warning: unused variable 'dwMask' [-Wunused-variable]
   DWORD_PTR dwMask;
             ^
utility.c: In function 'NumaStartThread':
utility.c:2687:12: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
     printf("Starting thread on node %d CPU mask %I64d\n", ulNumaNode,
            ^
utility.c:2687:12: warning: format '%d' expects argument of type 'int', but argument 2 has type 'ULONG {aka long unsigned int}' [-Wformat=]
In file included from crafty.c:40:0:
init.c: In function 'Initialize':
init.c:67:22: warning: overflow in implicit constant conversion [-Woverflow]
     fseek(book_file, -sizeof(int), SEEK_END);
                      ^
init.c:22:27: warning: unused variable 'node' [-Wunused-variable]
   int i, j, v, major, id, node;
                           ^
init.c:22:7: warning: unused variable 'i' [-Wunused-variable]
   int i, j, v, major, id, node;
       ^
They are just warnings though, and it seems to run OK.

The comments in the Makefile say to try options to find out which gives the fastest compile. Does Crafty have a Bench command to allow a speed test? Or is there some other way to accurately compare two compiles?

Thanks!
Dann

What changes are needed to your makefile to compile and run on 32-bit Windows 7 using gcc?

Thanks.