Designing an analysis friendly Stockfish?
-
- 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?
Hm, a lot of talking to myself. Anyway, I've posted new builds, 32- and 64-bit, PGO, based on the PA_G and GTB code. Enjoy, please let me know how they run.
http://www.expr-i0.net/Stockfish_201_PA_GTB_G.7z
http://www.expr-i0.net/Stockfish_201_PA_GTB_G.7z
Re: Designing an analysis friendly Stockfish?
My apologies for the non-to-late response. Since yesterday after my last post, I was been away from my PC. Also away earlier today. I just logged-in today/now.Jeremy Bernstein wrote:Hm, a lot of talking to myself. Anyway, I've posted new builds, 32- and 64-bit, PGO, based on the PA_G and GTB code. Enjoy, please let me know how they run.
http://www.expr-i0.net/Stockfish_201_PA_GTB_G.7z
Your first 2 project files uploads still won't compile here, either in VS2010 GUI or via command prompt method. I still get errors.
How did you compile these 2 PGOs using your VS2008 (or 2010?) GUI? Also, did you mix or move all various sources from sub folders into the main stockfish source folder and then
"Add items" and compile? Or did you keep using the "Add item" tab for all sub folders with sources till everything has been "Added" and then compile?
Thanks for your help.
-
- 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?
Prima, I am confused. Don't take me the wrong way, but are you even looking at the stuff I'm sending? All you have to do is open the src folder in the archive and you'd see that I haven't moved any files around. Really all you have to do is open the Stockfish_PA_GTB.sln file in VS2010 and hit Build. In theory, that is.Prima wrote:My apologies for the non-to-late response. Since yesterday after my last post, I was been away from my PC. Also away earlier today. I just logged-in today/now.Jeremy Bernstein wrote:Hm, a lot of talking to myself. Anyway, I've posted new builds, 32- and 64-bit, PGO, based on the PA_G and GTB code. Enjoy, please let me know how they run.
http://www.expr-i0.net/Stockfish_201_PA_GTB_G.7z
Your first 2 project files uploads still won't compile here, either in VS2010 GUI or via command prompt method. I still get errors.
How did you compile these 2 PGOs using your VS2008 (or 2010?) GUI? Also, did you mix or move all various sources from sub folders into the main stockfish source folder and then
"Add items" and compile? Or did you keep using the "Add item" tab for all sub folders with sources till everything has been "Added" and then compile?
Thanks for your help.
So which errors do you get now, and under what circumstances (Target/Platform)? I downloaded the trial of VS2010 Ultimate, so those projects are 100% bonafide native to your setup. I was able to build both 32- and 64-bit using the projects I posted. In the meantime, I installed a 64-bit OS and have verified that the 64-bit builds work. I also downloaded the Intel compiler, which I've been using more than the built-in one on my end, but the projects I posted are for the built-in MS compiler, and you shouldn't get bogged down there yet.
The one thing you might have to change is the Runtime Library -- but this won't affect building. It would affect portability of the executables that you build.
Re: Designing an analysis friendly Stockfish?
After reading your posts, specifically on the part where I had to click on the Stockfish_PA_GTB.sln, the VS2010 GUI automatically opened and I was able to make a successful and regular (but no optimization of any kind) compiled with it. Thanks Jeremy.Jeremy Bernstein wrote:Prima, I am confused. Don't take me the wrong way, but are you even looking at the stuff I'm sending? All you have to do is open the src folder in the archive and you'd see that I haven't moved any files around. Really all you have to do is open the Stockfish_PA_GTB.sln file in VS2010 and hit Build. In theory, that is.Prima wrote:My apologies for the non-to-late response. Since yesterday after my last post, I was been away from my PC. Also away earlier today. I just logged-in today/now.Jeremy Bernstein wrote:Hm, a lot of talking to myself. Anyway, I've posted new builds, 32- and 64-bit, PGO, based on the PA_G and GTB code. Enjoy, please let me know how they run.
http://www.expr-i0.net/Stockfish_201_PA_GTB_G.7z
Your first 2 project files uploads still won't compile here, either in VS2010 GUI or via command prompt method. I still get errors.
How did you compile these 2 PGOs using your VS2008 (or 2010?) GUI? Also, did you mix or move all various sources from sub folders into the main stockfish source folder and then
"Add items" and compile? Or did you keep using the "Add item" tab for all sub folders with sources till everything has been "Added" and then compile?
Thanks for your help.
So which errors do you get now, and under what circumstances (Target/Platform)? I downloaded the trial of VS2010 Ultimate, so those projects are 100% bonafide native to your setup. I was able to build both 32- and 64-bit using the projects I posted. In the meantime, I installed a 64-bit OS and have verified that the 64-bit builds work. I also downloaded the Intel compiler, which I've been using more than the built-in one on my end, but the projects I posted are for the built-in MS compiler, and you shouldn't get bogged down there yet.
The one thing you might have to change is the Runtime Library -- but this won't affect building. It would affect portability of the executables that you build.
This still leaves me vulnerable to future Stockfish engines with GTB ported to it with multiple sub-source-folders, or, any engine that has similar multiple sub-folders within its source folder. Perhaps there's a method to how I can accomplish similar end-results you did with the project files etc.
One more thing, the VS2010 Edition does not have settings/menu for "linking" to produce a non-dll-dependent executive file we talked about earlier. Are these settings hidden? I can't find it.
I tried compiling it using the command prompt method to compile it. I pointed it to the stockfish_pa_gtb.sln (as I would point it to .cpp & .c source files) but the command prompt gave errors and couldn't compile it.
Thanks Jeremy. I appreciate these help.
Re: Designing an analysis friendly Stockfish?
SF PA_G scores about 15 Elo below SF default at very fast games in my tests. If everything would have been correctly coded in SF PA_G that should not be the case. I think the ok_to_use_tt_PV() function is not quite right. The test for TT hits should rather look like
in both cases, PV and non-PV. Please correct me if I'm wrong. If I change the code appropriately, I get a slightly positive score after 6000 ultra fast games, like expected. Result was: +1921 -1814 =2265 from changed SF PA_G's pov.
Code: Select all
bool ok_to_use_TT(const TTEntry* tte, Depth depth, Value alpha, Value beta, int ply) {
Value v = value_from_tt(tte->value(), ply);
return ( tte->depth() >= depth
|| v >= Max(value_mate_in(PLY_MAX), beta)
|| v <= Min(value_mated_in(PLY_MAX), alpha))
&& (
((tte->type() & VALUE_TYPE_LOWER) && v >= beta)
|| ((tte->type() & VALUE_TYPE_UPPER) && v <= alpha)
|| (tte->type() == VALUE_TYPE_EXACT && v < beta && v > alpha)
);
}
Last edited by fruity on Fri Feb 04, 2011 12:33 am, edited 1 time in total.
Re: Designing an analysis friendly Stockfish?
New Stockfish 2.0.1 PA GTB:
http://www.mediafire.com/?ith6bg64djk2hex
Changes:
New UCI options:
Update history and killer moves in PV- This turns on/off fruity's change suggested here, which was to update history and killer moves also in the PV. It is stronger with it on, and so it's on by default.
Max depth to update history and killers in PV - As fruity noticed, his change works best at lower depths. This controls the depth, in ply, that it is used.
Use smooth scaling - This turns on/off Dann Corbit's smooth scaling. It is off by default because it makes it weaker. It might suggest interesting moves for analysis.
Linear Factor in Centipawns, Constant Factor in Centipawns, Log Factor in Centipawns - Ask Dann Corbit what these do. They have no effect if smooth scaling is off.
With default settings, this thing is slightly stronger than the standard Stockfish in hyper-bullet (40 moves in 1 second).
Peter
http://www.mediafire.com/?ith6bg64djk2hex
Changes:
- Fixed some potential bugs, especially if compiled with a non-GCC compiler (thanks Jeremy)
- Changed how total_piece_count() works so now it just checks an instance field
- Added fruity's change suggested here, configurable with UCI options (see below)
- Added Dann Corbit's smooth scaling, configurable with UCI options (see below)
- ProbeOnlyAtRoot is now on by default, because it makes it stronger
New UCI options:
Update history and killer moves in PV- This turns on/off fruity's change suggested here, which was to update history and killer moves also in the PV. It is stronger with it on, and so it's on by default.
Max depth to update history and killers in PV - As fruity noticed, his change works best at lower depths. This controls the depth, in ply, that it is used.
Use smooth scaling - This turns on/off Dann Corbit's smooth scaling. It is off by default because it makes it weaker. It might suggest interesting moves for analysis.
Linear Factor in Centipawns, Constant Factor in Centipawns, Log Factor in Centipawns - Ask Dann Corbit what these do. They have no effect if smooth scaling is off.
With default settings, this thing is slightly stronger than the standard Stockfish in hyper-bullet (40 moves in 1 second).
Peter
-
- 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?
OK, that's a start. In my projects, optimization is turned off for the Debug build, but on for the Release. The PGO stuff is additional to the Release builds, and if you google "PGO Visual Studio" you will find some instructions about how to use it. Basically you build an instrumented version of your app, use it (I've been exercising the app with benchmark runs using different numbers of threads, hash sizes and pvs and 30s+0.5s engine matches (32 v 64 bit to exercise them both at once), and then build an optimized build on the basis of files which get saved automagically when you run the instrumented build. But see if you can't get the normal, non-PGO optimized builds going first.Prima wrote:After reading your posts, specifically on the part where I had to click on the Stockfish_PA_GTB.sln, the VS2010 GUI automatically opened and I was able to make a successful and regular (but no optimization of any kind) compiled with it. Thanks Jeremy.
It's pretty simple: you add the .c/.cpp files that you want to compile to the project. You add the folders containing any .h files that the .c files reference (which aren't in the compiler header search path already) to the list of #include directories. That's actually it. This isn't a vulnerability -- it's just the way compilers work. When I converted my project from VS2008 to VS2010, VS flattened the file structure I had in the original project (which mirrored the file system's folders) for some reason, but internally they are referenced by path relative to the project file.This still leaves me vulnerable to future Stockfish engines with GTB ported to it with multiple sub-source-folders, or, any engine that has similar multiple sub-folders within its source folder. Perhaps there's a method to how I can accomplish similar end-results you did with the project files etc.
You need to examine the options in the property pages (in the Solution Explorer, right-click on the project file and choose Properties...). That's where all of the stuff you normally specify on the command line is set, such as preprocessor variables, linked libs, optimization settings, etc.One more thing, the VS2010 Edition does not have settings/menu for "linking" to produce a non-dll-dependent executive file we talked about earlier. Are these settings hidden? I can't find it.
The .sln/.vcproj thing is an alternative to using the command line. You do one or other other, usually.I tried compiling it using the command prompt method to compile it. I pointed it to the stockfish_pa_gtb.sln (as I would point it to .cpp & .c source files) but the command prompt gave errors and couldn't compile it.
Jeremy
-
- 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?
Very cool. Thank you. I'll post some builds to compete with yours tomorrow morning.Peter C wrote:New Stockfish 2.0.1 PA GTB:
http://www.mediafire.com/?ith6bg64djk2hex
jb
-
- Posts: 127
- Joined: Thu Jun 10, 2010 1:39 am
- Real Name: Martin Wyngaarden
- Location: Holland, Michigan
Re: Designing an analysis friendly Stockfish?
I had not touched ok_to_use_TT but I will go ahead and fix this. Was the +1921 -1814 =2265 score from the 20" games?fruity wrote:SF PA_G scores about 15 Elo below SF default at very fast games in my tests. If everything would have been correctly coded in SF PA_G that should not be the case. I think the ok_to_use_tt_PV() function is not quite right. The test for TT hits should rather look likein both cases, PV and non-PV. Please correct me if I'm wrong. If I change the code appropriately, I get a slightly positive score after 6000 ultra fast games, like expected. Result was: +1921 -1814 =2265 from changed SF PA_G's pov.Code: Select all
bool ok_to_use_TT(const TTEntry* tte, Depth depth, Value alpha, Value beta, int ply) { Value v = value_from_tt(tte->value(), ply); return ( tte->depth() >= depth || v >= Max(value_mate_in(PLY_MAX), beta) || v <= Min(value_mated_in(PLY_MAX), alpha)) && ( ((tte->type() & VALUE_TYPE_LOWER) && v >= beta) || ((tte->type() & VALUE_TYPE_UPPER) && v <= alpha) || (tte->type() == VALUE_TYPE_EXACT && v < beta && v > alpha) ); }
-
- 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?
You're saying replace the contents of both ok_to_use_TT() and ok_to_use_TT_PV() with what you posted, or just for ok_to_use_TT()?fruity wrote:in both cases, PV and non-PV.
Actually, what you wrote only works in ok_to_use_TT_PV(), anyway. There is no alpha parameter in ok_to_use_TT()/
jb