Stockfish 1.6 (Mac)

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

Moderator: Ras

IanO
Posts: 499
Joined: Wed Mar 08, 2006 9:45 pm
Location: Portland, OR

Re: Stockfish 1.6 (Mac)

Post by IanO »

zullil wrote:I suspect RobboLito would top that list, though I understand if you're reluctant to consider it. It did compile easily on my MacBook running 10.6.2. Just had to make two or three changes (in uci.c and utils.c, if I recall correctly).
Honestly, I hadn't heard that RobboLito was compatible with a Mac/FreeBSD build environment. Could you attach diffs for the changes required to build on the Mac? (Better yet, submit those changes upstream to the developers.) I have absolutely no qualms trying it out, since I don't believe it is a clone.

Ian
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Stockfish 1.6 (Mac)

Post by zullil »

IanO wrote:
zullil wrote:I suspect RobboLito would top that list, though I understand if you're reluctant to consider it. It did compile easily on my MacBook running 10.6.2. Just had to make two or three changes (in uci.c and utils.c, if I recall correctly).
Honestly, I hadn't heard that RobboLito was compatible with a Mac/FreeBSD build environment. Could you attach diffs for the changes required to build on the Mac? (Better yet, submit those changes upstream to the developers.) I have absolutely no qualms trying it out, since I don't believe it is a clone.

Ian
In uci.c at line 26, change this

Code: Select all

#include <sys/sysinfo.h>

void options_initialization(){
	numCPU = get_nprocs_conf();
to this

Code: Select all

/* #include <sys/sysinfo.h> */

void options_initialization(){
	numCPU = 2; /* Assuming you have two cores. */
And in utils.c at line 195, simply comment out

Code: Select all

#include <bits/time.h>
Then just look at the Makefile and pick an appropriate target. I used

Code: Select all

make x86_64-icc
By the way, I started from

http://www.cyclonechess.com/RobboLito_0085g3l_x86.rar,

which I unarchived with UnRarX.

(If your processor supports sse4.2, be sure to use -DHAS_POPCNT when you build.)
IanO
Posts: 499
Joined: Wed Mar 08, 2006 9:45 pm
Location: Portland, OR

Re: Stockfish 1.6 (Mac)

Post by IanO »

Thanks!
zullil wrote:
IanO wrote:Could you attach diffs for the changes required to build on the Mac?
In uci.c at line 26, change this

Code: Select all

#include <sys/sysinfo.h>

void options_initialization(){
	numCPU = get_nprocs_conf();
to this

Code: Select all

/* #include <sys/sysinfo.h> */

void options_initialization(){
	numCPU = 2; /* Assuming you have two cores. */
I found this snippet which will count the processors correctly:

Code: Select all

#ifdef __APPLE__
#include <sys/sysctl.h>
int get_nprocs_conf()
{
	int	count = 1;
	size_t	size=sizeof(count) ;

	sysctlbyname("hw.ncpu",&count,&size,NULL,0);

	return count;
}
#else
#include <sys/sysinfo.h>
#endif
Since RobboLito is single threaded, this is only used for reporting estimated load average correctly.
And in utils.c at line 195, simply comment out

Code: Select all

#include <bits/time.h>
Then just look at the Makefile and pick an appropriate target. I used

Code: Select all

make x86_64-icc
By the way, I started from

http://www.cyclonechess.com/RobboLito_0085g3l_x86.rar,

which I unarchived with UnRarX.

(If your processor supports sse4.2, be sure to use -DHAS_POPCNT when you build.)
I made a new target:

Code: Select all

x86_64-darwin:
	gcc -fast -Dx86_64 -o $(OUTPUTFILE) *.c
I'll try -DHAS_POPCNT later. Does a Core2Duo support popcntq, or is that only on the Core i7 (Nehalem)?

At first blush, RobboLito is scary fast, obliterating HIARCS 12.1 (+4=2-0) in fast games, even without a book or extra processor! It seems to have very good time management.

Ian
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Stockfish 1.6 (Mac)

Post by zullil »

IanO wrote:
I'll try -DHAS_POPCNT later. Does a Core2Duo support popcntq, or is that only on the Core i7 (Nehalem)?

At first blush, RobboLito is scary fast, obliterating HIARCS 12.1 (+4=2-0) in fast games, even without a book or extra processor! It seems to have very good time management.

Ian
Core 2 Duo does not support sse4.2. Nehalem does.

Stockfish-1.6 has been very impressive too. I'm interested in knowing the results of your testing.
IanO
Posts: 499
Joined: Wed Mar 08, 2006 9:45 pm
Location: Portland, OR

Re: Stockfish 1.6 (Mac)

Post by IanO »

zullil wrote:
IanO wrote:At first blush, RobboLito is scary fast, obliterating HIARCS 12.1 (+4=2-0) in fast games, even without a book or extra processor! It seems to have very good time management.
Stockfish-1.6 has been very impressive too. I'm interested in knowing the results of your testing.
RobboLito handily defeated Stockfish 1.6 at a fast time control match. (+30=20-10)

Ian
Kaj Soderberg

Re: Stockfish 1.6 (Mac)

Post by Kaj Soderberg »

Thanks, but Stockfish (both versions) won't run in analysis mode in the DS12 interface. I'm using MAC OS 10.6. Any thoughts?
Cheers,
Kaj
schlucke
Posts: 58
Joined: Thu Apr 09, 2009 1:38 pm

Re: Stockfish 1.6 (Mac)

Post by schlucke »

Same problem here, but don't know why :(

The compile is good, it works perfectly under Scid. Perhaps a Stockfish UCI bug!?
schlucke
Posts: 58
Joined: Thu Apr 09, 2009 1:38 pm

Re: Stockfish 1.6 (Mac)

Post by schlucke »

IanO wrote:Also, I've had success with the Apple-specific gcc -fast option when compiling crafty on the Mac. It subsumes -O3 and adds a handful of other speed optimizations.

As it stands, Stockfish 1.6 is the first Mac engine I've tested which has managed to defeat Hiarcs 12.1 in a match at fast time controls. My Mac engine ranking is now:
  1. Stockfish 1.6
  2. HIARCS 12.1
  3. Stockfish 1.5.1
  4. Rybka 2.2n2 + microwine
  5. Stockfish 1.4
  6. Glaurung 2.2
  7. Toga 1.4 beta5
  8. Fruit 2.3.1 (SP)
  9. Crafty 23.1
Ian
Thanks for the tip. The option -fast is about 4% faster than -O3. I've also tried GCC PGO (-fprofile...), but was never faster than with -fast (somtimes worse).

Code: Select all

Stockfish 1.6.2 64bit

Results for 'stockfish bench 32 1 60 default time':

GCCFLAGS = -O3 -msse (default)

Total time (ms) : 960203
Nodes searched  : 995613282
Nodes/second    : 1036877

GCCFLAGS = -fast -msse

Total time (ms) : 960259
Nodes searched  : 1042383074
Nodes/second    : 1085522

System

Model Name: MacBook Pro
Model Identifier: MacBookPro3,1
Processor Name: Intel Core 2 Duo
Processor Speed: 2,4 GHz
Number Of Processors: 1
Total Number Of Cores: 2
L2 Cache: 4 MB
Memory: 2 GB
Bus Speed: 800 MHz
System Version: Mac OS X 10.6.2 (10C540)
Kernel Version: Darwin 10.2.0
Holger
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Stockfish 1.6 (Mac)

Post by mcostalba »

Care to modify the shipped Makefile with the option -fast for Mac OS ?

So I will include in next release.


To verify possible miscompilations (already happened with gcc), please at the end try to run the following:

stockfish bench 128 1 12 default depth

The "node searched" count must be 22308138, otherwise the binary has been miscompiled.

Thanks
Marco
schlucke
Posts: 58
Joined: Thu Apr 09, 2009 1:38 pm

Re: Stockfish 1.6 (Mac)

Post by schlucke »

mcostalba wrote:Care to modify the shipped Makefile with the option -fast for Mac OS ?

So I will include in next release.
Do it if you wish. But only for MacOS + GCC, not Linux + GCC. Someone mentioned that -fast is special to 'gcc version 4.2.1 (Apple Inc. build 5646) (dot 1)'.

mcostalba wrote:To verify possible miscompilations (already happened with gcc), please at the end try to run the following:

stockfish bench 128 1 12 default depth

The "node searched" count must be 22308138, otherwise the binary has been miscompiled.

Thanks
Marco
Thanks for the tip. Checked!

Code: Select all

Total time (ms) : 22004
Nodes searched  : 22308138
Nodes/second    : 1013821
Bye,
Holger