Crafty 23.6 released

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

Moderators: hgm, Rebel, chrisw

skoony
Posts: 165
Joined: Thu Mar 09, 2006 2:36 am
Location: saint paul,minnesota

Re: Crafty 23.6 released

Post by skoony »

any windows exe's compiled yet.
regards
mike
by the time i get there,i'll be there.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Consideration of a C++ Crafty

Post by bob »

sje wrote:
bob wrote:If you have a threaded program for SMP search, you will ALWAYS have global data. Whether it is declared as normal C globals, or stuck in a shared memory block (which is still global).
It's possible to have variable data shared among C++ objects without requiring that data to be global. There are two basic ways of doing this:

1. Static class variables, declared private. Each instance of the class will have access, but no other objects will have access. In some cases, a mutex might be needed to prevent the usual chaos.

2. A container class instance holds the variables needed by objects of subsidiary class instances. Example: A TreeSearch class object could contain pointers to MAX_THREAD Search objects, each of which runs on a separate thread and handles a separate branch of the entire search tree. The storage for all of the branch data is constructed and initialized by a TreeSearch object and then parceled out to its Search objects at the time they are constructed. Each Search object can access only its chunk of the branch data; only the parent TreeSearch object can see all of the branch data at the same time.
Is this not just a semantic quibble? A global variable is one that is accessible by a procedure, without it being declared inside the procedure nor passed in as a formal argument. Somewhat akin to the old C "file scope" issue where a variable is global, but only within the file where it appears (could be multiple procedures in the file that could access it, but nothing outside that single source file could.

As far as the rest of your description goes, one can always write a message-passing search that doesn't use any global data whatsoever. But the point of a shared-memory architecture is sharing memory, which is way more efficient than message-passing. Just harder to debug.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Consideration of a C++ Crafty

Post by sje »

bob wrote:Is this not just a semantic quibble? A global variable is one that is accessible by a procedure, without it being declared inside the procedure nor passed in as a formal argument. Somewhat akin to the old C "file scope" issue where a variable is global, but only within the file where it appears (could be multiple procedures in the file that could access it, but nothing outside that single source file could.
The problems with traditional global data:

1. Access which is hard to control or monitor. There are no language/compiler enforced rules to prevent sloppy or inadvertent access.

2. Difficulty of modification. If all the code can see something, then all the code is potentially dependent on that something, making that something hard to change.

3. Impediment to multiplicity. If a thread accesses a global something, then it can be hard to have more than a single thread doing access, so instead of one global something, the program will need two. Or three. Or whatever. Example: A program has a Search() function which keeps a lot of its stuff as globals. Along comes the thought of having more than one Search() running at the same time, perhaps an indefinite number of Search() calls, one for each available core. Doing this the old way means big changes, perhaps even hard coding the maximum CPU core count at compilation time.

(Symbolic uses the Linux CPU limit which was 64 the last time I checked. The program doesn't allocate big storage for each thread, it only allocates pointers to per-thread allocated big storage; big storage allocated only if needed.)

When Symbolic creates a thread, the general case is to have the thread creator allocate and initialize a message area, guarded by a mutex, and pass its pointer to the thread constructor. This greatly simplifies multithreaded operations.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Consideration of a C++ Crafty

Post by bob »

sje wrote:
bob wrote:Is this not just a semantic quibble? A global variable is one that is accessible by a procedure, without it being declared inside the procedure nor passed in as a formal argument. Somewhat akin to the old C "file scope" issue where a variable is global, but only within the file where it appears (could be multiple procedures in the file that could access it, but nothing outside that single source file could.
The problems with traditional global data:

1. Access which is hard to control or monitor. There are no language/compiler enforced rules to prevent sloppy or inadvertent access.

2. Difficulty of modification. If all the code can see something, then all the code is potentially dependent on that something, making that something hard to change.

3. Impediment to multiplicity. If a thread accesses a global something, then it can be hard to have more than a single thread doing access, so instead of one global something, the program will need two. Or three. Or whatever. Example: A program has a Search() function which keeps a lot of its stuff as globals. Along comes the thought of having more than one Search() running at the same time, perhaps an indefinite number of Search() calls, one for each available core. Doing this the old way means big changes, perhaps even hard coding the maximum CPU core count at compilation time.

(Symbolic uses the Linux CPU limit which was 64 the last time I checked. The program doesn't allocate big storage for each thread, it only allocates pointers to per-thread allocated big storage; big storage allocated only if needed.)

When Symbolic creates a thread, the general case is to have the thread creator allocate and initialize a message area, guarded by a mutex, and pass its pointer to the thread constructor. This greatly simplifies multithreaded operations.
My approach is similar. An array of thread pointers to access local data, local data (Per thread) allocated in the usual way, with a little care exercised due to NUMA considerations (first CPU to touch a thread block gets that block in its local memory, so this 'first to touch" needs to be spread over all threads and processors to spread the data uniformly, then one wants to use the local data on your core, not on a remote one, etc...

I follow all the reasons why global data is bad (software engineering 101). Fortunately, not all global data is bad. 99% of my global data is just read-only (magic multiply lookup tables, zobrist random #'s, etc. Those don't cause any issues at all. My search state is purely local although with threads, one can see anything if you look hard enough.
User avatar
Peter Skinner
Posts: 1763
Joined: Sun Feb 26, 2006 1:49 pm
Location: Edmonton, Alberta, Canada
Full name: Peter Skinner

Re: Crafty 23.6 released

Post by Peter Skinner »

skoony wrote:any windows exe's compiled yet.
regards
mike
Yes sorry, I forgot to update the website even though I uploaded the files..

http://www.kikrtech.com

Peter
I was kicked out of Chapters because I moved all the Bibles to the fiction section.
User avatar
Graham Banks
Posts: 41454
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Crafty 23.6 released

Post by Graham Banks »

Peter Skinner wrote:
skoony wrote:any windows exe's compiled yet.
regards
mike
Yes sorry, I forgot to update the website even though I uploaded the files..

http://www.kikrtech.com

Peter
Thanks Pete. :)
gbanksnz at gmail.com
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: Crafty 23.6 released

Post by velmarin »

Peter Skinner wrote:
skoony wrote:any windows exe's compiled yet.
regards
mike
Yes sorry, I forgot to update the website even though I uploaded the files..

http://www.kikrtech.com

Peter

It seems that there is still an error.
The download version is 23.5

Changing the address to 23.6 download the latest version
http://www.kikrtech.com/files/crafty-23.6-x64.zip
http://www.kikrtech.com/files/crafty-23.6-x86.zip
Source code:
http://www.kikrtech.com/files/crafty-23.6.zip

Thanks for engine. :D
User avatar
Peter Skinner
Posts: 1763
Joined: Sun Feb 26, 2006 1:49 pm
Location: Edmonton, Alberta, Canada
Full name: Peter Skinner

Re: Crafty 23.6 released

Post by Peter Skinner »

velmarin wrote:
Peter Skinner wrote:
skoony wrote:any windows exe's compiled yet.
regards
mike
Yes sorry, I forgot to update the website even though I uploaded the files..

http://www.kikrtech.com

Peter

It seems that there is still an error.
The download version is 23.5

Changing the address to 23.6 download the latest version
http://www.kikrtech.com/files/crafty-23.6-x64.zip
http://www.kikrtech.com/files/crafty-23.6-x86.zip
Source code:
http://www.kikrtech.com/files/crafty-23.6.zip

Thanks for engine. :D
Sorry, it's fixed.

Peter
I was kicked out of Chapters because I moved all the Bibles to the fiction section.
skoony
Posts: 165
Joined: Thu Mar 09, 2006 2:36 am
Location: saint paul,minnesota

Re: Crafty 23.6 released

Post by skoony »

thanks much
regards
mike
by the time i get there,i'll be there.
skoony
Posts: 165
Joined: Thu Mar 09, 2006 2:36 am
Location: saint paul,minnesota

Re: Crafty 23.6 released

Post by skoony »

no problems as usual.

[Event "Computer Chess Game"]
[Site "LAPTOP1"]
[Date "2013.06.21"]
[Round "-"]
[White "Crafty-23.6"]
[Black "arasanx64"]
[Result "1-0"]
[TimeControl "180"]
[Annotator "15. +0.29 15... -0.20"]

1.e4 c6 2.d4 d5 3.Nc3 dxe4 4.Nxe4 Nd7 5.Ng5 Ngf6 6.Bd3 e6 7.N1f3 Bd6 8.Qe2
h6 9.Ne4 Nxe4 10.Qxe4 Nf6 11.Qe2 Qc7 12.Bd2 b6 13.O-O-O Bb7 14.Kb1 O-O-O
15.Rhe1 c5 16.dxc5 Bxc5 17.Bc3 Kb8 18.g3 Kc8 19.Rd2 Rhg8 20.Red1 Ng4 21.
Bb5 Rxd2 22.Rxd2 Bd6 23.Nd4 Nf6 24.Nxe6 Qe7 25.Nxg7 Qxe2 26.Rxe2 Ne4 27.
Bd4 Bf8 28.Ne8 Be7 29.f3 a6 30.Bc4 Rxe8 31.fxe4 Bc5 32.Bxc5 bxc5 33.b3
Rxe4 34.Bxa6 Kc7 35.Bd3 Rxe2 36.Bxe2 f6 37.a4 Kb6 38.Kb2 Ka5 39.c3 Bd5 40.
Ka3 Kb6 41.b4 c4 42.Kb2 f5 43.Kc2 Bc6 44.a5+ Kb5 45.Kd2 Be4 46.Ke3 Bd5 47.
Kd4 Be6 48.Bf3 Ka6 49.Bd5 Bc8 50.Bxc4+ Kb7 51.Kc5 Ka7 52.b5 Ka8 53.Kb6 Bb7
{Black resigns}
1-0

regards
mike
by the time i get there,i'll be there.