Candidate fix for stockfish problems under gcc

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

Moderator: Ras

mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Candidate fix for stockfish problems under gcc

Post by mcostalba »

This is a workaround that fixes the miscompile on gcc

You can download sources from:

http://www.mediafire.com/?ch0tmm3zoj5

Unfortunatly I had to set optimization to -O1 instead of -O2 because many versions of gcc miscompile the file value.h, I will post on the technical forum the details.

Note that with some versions also -O2 works and even the optimal -O3, but you should test yourself.

Please test with gcc and report any problem.

IMPORTANT: There is NO change for Windows version, so the currently JA compiles do not need to be updated.
jpqy
Posts: 554
Joined: Thu Apr 24, 2008 9:31 am
Location: Belgium

Re: Candidate fix for stockfish problems under gcc

Post by jpqy »

Hi Marco,

So there come no 1.6.1 ,and the problems are all related to gcc version?!
I was waiting for the 1.6.1 before i begin to test it!

JP.
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Candidate fix for stockfish problems under gcc

Post by mcostalba »

jpqy wrote:Hi Marco,

So there come no 1.6.1 ,and the problems are all related to gcc version?!
I was waiting for the 1.6.1 before i begin to test it!

JP.
well, if you follow the download link you will see that the sources are tagged 1.6.1 so that's the 1.6.1 but, as I said, the problem was _only_ related to gcc, so if you have in mind to test, for instance, the windows binaries you can already do this with the 1.6 JA version.
User avatar
Graham Banks
Posts: 44565
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Candidate fix for stockfish problems under gcc

Post by Graham Banks »

jpqy wrote:Hi Marco,

So there come no 1.6.1 ,and the problems are all related to gcc version?!
I was waiting for the 1.6.1 before i begin to test it!

JP.
The windows compile is okay. It was just this issue as far as I was aware.

Cheers,
Graham.
gbanksnz at gmail.com
User avatar
Werner
Posts: 2990
Joined: Wed Mar 08, 2006 10:09 pm
Location: Germany
Full name: Werner Schüle

Re: Candidate fix for stockfish problems under gcc

Post by Werner »

Congrats Marco,
to you and your team for the 3rd place in our single list behind Rybka 3 x64 1CPU and Rybka 3 w32 1CPU!
The improvement is around 80+ Elos!!
Our update follows on Sunday!

Best wishes
Werner
pgeorges

Re: Candidate fix for stockfish problems under gcc

Post by pgeorges »

I reported that Stockfish scored 0.0 for a lost position with -O3 (see http://talkchess.com/forum/viewtopic.ph ... highlight=), and was ok with option -O2.
But now it crashes whatever option I choose (-O1, -O2, -O3). Are you sure it is a compiler bug ?
GCC used : gcc 4.3.2 [gcc-4_3-branch revision 141291]

Pascal Georges
Martin Thoresen
Posts: 1833
Joined: Thu Jun 22, 2006 12:07 am

Re: Candidate fix for stockfish problems under gcc

Post by Martin Thoresen »

Marco,

Thanks for this new update.

I am finding something weird to happen in DS 11 GUI.

I am running Stockfish 1.6 64-bit 4CPU (JA) with 1024 MB Hash. No problem. Then 2048 MB Hash, also no problem. But when I set 4096 MB Hash, the hash "counter" goes to 100% immediately. With the other two options, it starts on 0.0% and goes up after some searching in a position, only to go to 100% after something like 5-8 minutes.

Any explanation for this?

PS: I have plenty of RAM to go around, so that is not the problem.

Best Regards,
Martin
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Candidate fix for stockfish problems under gcc

Post by mcostalba »

pgeorges wrote:I reported that Stockfish scored 0.0 for a lost position with -O3 (see http://talkchess.com/forum/viewtopic.ph ... highlight=), and was ok with option -O2.
But now it crashes whatever option I choose (-O1, -O2, -O3). Are you sure it is a compiler bug ?
GCC used : gcc 4.3.2 [gcc-4_3-branch revision 141291]

Pascal Georges
Could you please try with the correct fen ?

8/6p1/2p4p/pp2k3/P7/2PK2P1/7P/8 w - - 0 1
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Candidate fix for stockfish problems under gcc

Post by mcostalba »

Martin T wrote:Marco,

Thanks for this new update.

I am finding something weird to happen in DS 11 GUI.

I am running Stockfish 1.6 64-bit 4CPU (JA) with 1024 MB Hash. No problem. Then 2048 MB Hash, also no problem. But when I set 4096 MB Hash, the hash "counter" goes to 100% immediately. With the other two options, it starts on 0.0% and goes up after some searching in a position, only to go to 100% after something like 5-8 minutes.

Any explanation for this?

PS: I have plenty of RAM to go around, so that is not the problem.

Best Regards,
Martin
Currently we cannot allocate more then 2GB (2048MB) of hash table size. The bug here is that UCI option "Hash" allows to set up to 4096 MB while instead should be 2048 MB.

Thanks for pointing out that, I will fix this for next release becasue it is just a wrong maximum limit.
pgeorges

Re: Candidate fix for stockfish problems under gcc

Post by pgeorges »

mcostalba wrote: Could you please try with the correct fen ?

8/6p1/2p4p/pp2k3/P7/2PK2P1/7P/8 w - - 0 1
Yes, you are right. In that case with -O2 -> correct score, with -O3 -> draw.
But at least no more crash.

Pascal Georges