Designing an analysis friendly Stockfish?

Code, algorithms, languages, construction...
Prima
Posts: 328
Joined: Tue Dec 14, 2010 6:12 am

Re: Designing an analysis friendly Stockfish?

Post by Prima » Wed Feb 09, 2011 12:55 am

Jeremy Bernstein wrote:
Jeremy Bernstein wrote:
Jeremy Bernstein wrote: It's interesting that the TBs don't make much of a difference so far, either.
I just found a position where the TBs should have helped exclude moves, but weren't used for this purpose, causing the engine to walk into a mate that it should have known about. I'm going to add some code for that, as well, and see if that makes some difference...
New builds with proper sorting of tablebase hits. Enjoy.
Thank you, Jeremy!

Can I trouble you for the source code of this Stockfish201_PA_GTBc? Would it be asking for too much if you could also post the "project files" that is compatible with either MsVS2010 GUI and/or MsVS2010 Command Prompt window? Thanks in advance.

Prima.

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Designing an analysis friendly Stockfish?

Post by Jeremy Bernstein » Wed Feb 09, 2011 1:01 am

Prima wrote:
Jeremy Bernstein wrote:
Jeremy Bernstein wrote:
Jeremy Bernstein wrote: It's interesting that the TBs don't make much of a difference so far, either.
I just found a position where the TBs should have helped exclude moves, but weren't used for this purpose, causing the engine to walk into a mate that it should have known about. I'm going to add some code for that, as well, and see if that makes some difference...
New builds with proper sorting of tablebase hits. Enjoy.
Thank you, Jeremy!

Can I trouble you for the source code of this Stockfish201_PA_GTBc? Would it be asking for too much if you could also post the "project files" that is compatible with either MsVS2010 GUI and/or MsVS2010 Command Prompt window? Thanks in advance.

Prima.
The source is on github: https://github.com/jeremybernstein/Stockfish_PA_GTB

I just made some semi-big changes to the way the tablebases are inited and, to a certain extent, used at the root level. Running some tests and then I'll post new builds and push the code. I also want to test fruity's stuff.

I'll can PM you the project files. Problem is, they are using the Intel compiler. Do you have it?

Jeremy

Prima
Posts: 328
Joined: Tue Dec 14, 2010 6:12 am

Re: Designing an analysis friendly Stockfish?

Post by Prima » Wed Feb 09, 2011 1:24 am

Jeremy Bernstein wrote:
Prima wrote:
Jeremy Bernstein wrote:
Jeremy Bernstein wrote:
Jeremy Bernstein wrote: It's interesting that the TBs don't make much of a difference so far, either.
I just found a position where the TBs should have helped exclude moves, but weren't used for this purpose, causing the engine to walk into a mate that it should have known about. I'm going to add some code for that, as well, and see if that makes some difference...
New builds with proper sorting of tablebase hits. Enjoy.
Thank you, Jeremy!

Can I trouble you for the source code of this Stockfish201_PA_GTBc? Would it be asking for too much if you could also post the "project files" that is compatible with either MsVS2010 GUI and/or MsVS2010 Command Prompt window? Thanks in advance.

Prima.
The source is on github: https://github.com/jeremybernstein/Stockfish_PA_GTB

I just made some semi-big changes to the way the tablebases are inited and, to a certain extent, used at the root level. Running some tests and then I'll post new builds and push the code. I also want to test fruity's stuff.

I'll can PM you the project files. Problem is, they are using the Intel compiler. Do you have it?

Jeremy
I had the Intel XE 12.0 30day-trial compiler. The funny thing was, after just 1 week+ (or 2 weeks), the Intel-30day-trial compiler was giving me notices that the trial period expired! So now I'm using the Microsoft VS2010 GUI compiler and its Command Prompt windows.

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Designing an analysis friendly Stockfish?

Post by Jeremy Bernstein » Wed Feb 09, 2011 2:45 am

Prima wrote:I had the Intel XE 12.0 30day-trial compiler. The funny thing was, after just 1 week+ (or 2 weeks), the Intel-30day-trial compiler was giving me notices that the trial period expired! So now I'm using the Microsoft VS2010 GUI compiler and its Command Prompt windows.
OK, I sent you the projects and solutions for both intel and ms builds per pm. I haven't used the ms projects since the first day I started playing with this, so no guarantees, but the intel ones are working fine.

The latest code, which I'm currently testing is pushed to github. I made a branch for the fruity code, as well. Right now, after 34 20 second games, everyone is really neck and neck. I'm using ChessGUI for the first time, and I can't figure out how to paste in a text version of the current game table.
PAMC_GTBd @ 9.0 / 74.25 SB
PAMC_GTBf @ 9.0 / 68.25 SB
PAMC_GTBc @ 7.5 / 66.00 SB
Stockfish201 @ 7.5 / 63.00 SB

Prima
Posts: 328
Joined: Tue Dec 14, 2010 6:12 am

Re: Designing an analysis friendly Stockfish?

Post by Prima » Wed Feb 09, 2011 3:30 am

Jeremy Bernstein wrote:
Jeremy Bernstein wrote:Prima, if you send me your projects (or post them somewhere for me to download), I can do this for you (and write instructions so you know what to do next time).

Jeremy
Actually, this isn't so hard. Let's take a quick walkthrough. You want to compile to a Static Library -- a .lib (not a .dll). I have a 2008 Express install in front of me, but I assume that the dialogs look the same in 2010.

The first thing you'll need to change is the Configuration Type under Configuration Properties->General in your Gaviota EGTB project Property Pages to Static Library.
Configuration Type
Assuming that the project builds (make 2 versions, a 64- and a 32-bit) to a static lib, you're ready for step 2.

Go to your Stockfish project's Property Pages: Configuration Properties->Linker->Input and add the .lib to the Additional Dependencies field (32-bit for your 32-bit build and 64-bit for your 64-bit build, of course):
Additional Dependencies
You'll need to be sure that your Stockfish can find the headers used by the Gaviota TBs, and it might just work now. What I don't know, and what I might need to help you with, is the question of whether or not functions are automatically exported from the static library that you built. If not, you can't really use it. I do most of my development on OSX, so it would be helpful for me to have the actual project files, should this not work, and then I can figure out whether you need an extra definitions file, or some setting in the configuration, to take care of this.

But maybe it will just work.

Jeremy
Sorry to pull this back up (page 6 of this thread). According to the MsVS2010 Edtion GUI compiler, following your tutorials, I succeeded in building a .lib file but, I can't see a .lib file! Instead, I see GTB-Lib2-x64.lastbuildstate file, not a .lib extension.

Then when I check the messages provided by the GUI, I get this:

Code: Select all

1>------ Build started: Project: GTB-Lib2-x64, Configuration: Release x64 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(299,5): warning MSB8004: Output Directory does not end with a trailing slash.  This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
On checking the specified path from the GUI, I did see the Microsoft.CppBuild.targets file but still no .lib extension file for me to link.

I followed your tutorial down to the pin, making sure everything is done step by step. I know I'm very close to succeeding in linking GTB source files with Stockfish but I'm not seeing a compiled .lib file for me to link. I did succeed in creating the "2vcproject" files: one for GTB and the other for Stockfish.

Maybe its a GUI issue? I'm I missing something here? I'm always open for suggestions. Thanks.
Last edited by Prima on Wed Feb 09, 2011 3:32 am, edited 1 time in total.

User avatar
Uly
Posts: 838
Joined: Thu Jun 10, 2010 5:33 am

Re: Designing an analysis friendly Stockfish?

Post by Uly » Wed Feb 09, 2011 3:31 am

keoki at RF sent me these results:
keoki010 wrote:Uly here are the results of a 180 game tour at 5 min. I can't believe Critter is beating Rybka but I've rechecked the configs 3x and don't see anything wrong. It's Arena 3.0 though so who knows.
All of them had 1024 hash and max threads for their program.

Program Elo + - Games Score Av.Op. Draws

1 Houdini_15a_x64 : 2561 79 76 72 76.4 % 2357 25.0 %
2 Critter_0.90_64bit_SSE4 : 2445 72 71 72 58.3 % 2386 25.0 %
3 Rybka4 : 2390 66 66 72 48.6 % 2400 33.3 %
4 Stockfish_pamc : 2315 70 71 72 35.4 % 2419 29.2 %
5 Stockfish_201_64_PA_G : 2289 72 74 72 31.2 % 2426 26.4 %
Individual statistics:

1 Houdini_15a_x64 : 2561 72 (+ 46,= 18,- 8), 76.4 %

Critter_0.90_64bit_SSE4 : 18 (+ 10,= 7,- 1), 75.0 %
Stockfish_201_64_PA_G : 18 (+ 15,= 1,- 2), 86.1 %
Rybka4 : 18 (+ 9,= 7,- 2), 69.4 %
Stockfish_pamc : 18 (+ 12,= 3,- 3), 75.0 %

2 Critter_0.90_64bit_SSE4 : 2445 72 (+ 33,= 18,- 21), 58.3 %

Houdini_15a_x64 : 18 (+ 1,= 7,- 10), 25.0 %
Stockfish_201_64_PA_G : 18 (+ 15,= 1,- 2), 86.1 %
Rybka4 : 18 (+ 3,= 8,- 7), 38.9 %
Stockfish_pamc : 18 (+ 14,= 2,- 2), 83.3 %

3 Rybka4 : 2390 72 (+ 23,= 24,- 25), 48.6 %

Houdini_15a_x64 : 18 (+ 2,= 7,- 9), 30.6 %
Critter_0.90_64bit_SSE4 : 18 (+ 7,= 8,- 3), 61.1 %
Stockfish_201_64_PA_G : 18 (+ 7,= 5,- 6), 52.8 %
Stockfish_pamc : 18 (+ 7,= 4,- 7), 50.0 %

4 Stockfish_pamc : 2315 72 (+ 15,= 21,- 36), 35.4 %

Houdini_15a_x64 : 18 (+ 3,= 3,- 12), 25.0 %
Critter_0.90_64bit_SSE4 : 18 (+ 2,= 2,- 14), 16.7 %
Stockfish_201_64_PA_G : 18 (+ 3,= 12,- 3), 50.0 %
Rybka4 : 18 (+ 7,= 4,- 7), 50.0 %

5 Stockfish_201_64_PA_G : 2289 72 (+ 13,= 19,- 40), 31.2 %

Houdini_15a_x64 : 18 (+ 2,= 1,- 15), 13.9 %
Critter_0.90_64bit_SSE4 : 18 (+ 2,= 1,- 15), 13.9 %
Rybka4 : 18 (+ 6,= 5,- 7), 47.2 %
Stockfish_pamc : 18 (+ 3,= 12,- 3), 50.0 %
I think they're the slowest time controls that have been tried, with these latest builds.

Thanks fruity for your latest proposals, will be waiting for a build 8-)

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Designing an analysis friendly Stockfish?

Post by Jeremy Bernstein » Wed Feb 09, 2011 8:41 am

Changed back to Arena, and changed time control to 1/1. Results so far:
Engine                      Score             St            St            St            St    S-B
Stockfish_64                21,0/37 ············· ===0===0===1= 111=110=====  1===1=1010==   368,00
Stockfish_201_PA_GTBf_x64   20,0/37 ===1===1===0= ············· =1=1==0=1===  0=10==1=1001   362,00
Stockfish_201_PAMC_GTBd_x64 17,0/37 000=001=====  =0=0==1=0===  ············· ==110=1=11001  312,00
Stockfish_201_PAMC_GTBc_x64 16,0/37 0===0=0101==  1=01==0=0110  ==001=0=00110 ·············  310,00

74 of 180 games played
Level: Blitz 1/1
Hardware: Intel(R) Xeon(R) CPU  W3520 @ 2.67GHz 2659 MHz with 1,0 GB Memory
So these builds are performing pretty well, so far. I'll post my d (updated GTB init code) and f (d + fruity) builds later today, once the run has gone a bit further.

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Designing an analysis friendly Stockfish?

Post by Jeremy Bernstein » Wed Feb 09, 2011 8:44 am

You need to find out where the .lib file was built. If the GTB project succeeded in linking, it should have said where it was saving the .lib file to in the output somewhere. Build location is also specified in the project preferences pane (where the compiler and linker settings are).

Sarciness
Posts: 13
Joined: Wed Feb 09, 2011 9:10 am

Re: Designing an analysis friendly Stockfish?

Post by Sarciness » Wed Feb 09, 2011 9:44 am

Hi guys, this is my first time on Openchess, and this discussion is a bit difficult for me to follow with all the different contributors and versions. I love the idea of an analysis-friendly Stockfish.

What is the best (or latest) pre-built version? I don't mind whether it probes tablebases or not. Or do I need to compile myself? How would I go about doing so?

Edit: P.S. I really appreciate your efforts!

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Designing an analysis friendly Stockfish?

Post by Jeremy Bernstein » Wed Feb 09, 2011 11:57 am

Sarciness wrote:Hi guys, this is my first time on Openchess, and this discussion is a bit difficult for me to follow with all the different contributors and versions. I love the idea of an analysis-friendly Stockfish.

What is the best (or latest) pre-built version? I don't mind whether it probes tablebases or not. Or do I need to compile myself? How would I go about doing so?

Edit: P.S. I really appreciate your efforts!
Here are two pre-built versions. The first (PAMC_GTBd) is the most recent build of the Marco Costalba PA code + Gaviota Tablebase probing. The TB initialization should be somewhat more efficient now, and won't bog down the engine when it's calculating.

The second (PA_GTBf) contains the PA modifications suggested by Fruity + the same GTB code.

We need more testing, but now you have something to test!
Attachments
Stockfish_201_PA_GTBf.7z
(540.84 KiB) Downloaded 165 times
Stockfish_201_PAMC_GTBd.7z
(540.65 KiB) Downloaded 140 times

Post Reply