Visual C++ 2012 PGO issues

Discussion of chess software programming and technical issues.

Moderator: Ras

jdart
Posts: 4427
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Visual C++ 2012 PGO issues

Post by jdart »

So, I have tried compiling Arasan with Visual C++ 2012 but am hitting a couple of issues:

1. PGO fails if the app being profiled is run multi-threaded (GCC has always had this issue but Visual C++ 2005, which I was using before, worked ok).

The errors occur in the final link step and look like this:

Code: Select all

Merging ..\win64\pgo_build\arasanx!1.pgc
'Scoring::mateScore': Arc 2 --> 4 has negative count (-1068)
Expectation failed: f line 4254
'Scoring::mateScore': Arc 2 --> 4 has negative count (-1068)
Expectation failed: f line 4233
'Board::undoMove': Arc 1 --> 81 has negative count (-167044)
Expectation failed: f line 4254
'Board::doMove': Arc 54 --> 55 has negative count (-145616)
Expectation failed: f line 4254
Expectation failed: f line 4224
'Board::doMove': Arc 54 --> 55 has negative count (-145616)
Expectation failed: f line 4233
'Board::doMove': Arc 55 --> 104 has negative count (-145616)
Expectation failed: f line 4254
'Board::doMove': Arc 55 --> 104 has negative count (-145616)
Expectation failed: f line 4233
'Scoring::calcEndgame': Arc 1 --> 14 has negative count (-658)
Expectation failed: f line 4254
2. If I run the profiled executable in single-threaded mode, the link completes, but then I get this message:

Code: Select all

32 of 1824 (  1.75%) profiled functions will be compiled for speed, and the rest of the functions will be compiled for size
which is clearly not what I wanted. And in fact, the executable is slower than one built without PGO.

--Jon
Joost Buijs
Posts: 1680
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Visual C++ 2012 PGO issues

Post by Joost Buijs »

I had the same problem when I was profiling to long, so it looks like it is a counter overflow in the profiler. It has probably nothing to do with multithreading itself. When I have some time I will take a more detailed look at it.
jdart
Posts: 4427
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Visual C++ 2012 PGO issues

Post by jdart »

I tried reducing the profiling time to 15 seconds but that didn't fix it.

Still works using 1 core in the profiling run though.

--Jon
Joost Buijs
Posts: 1680
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Visual C++ 2012 PGO issues

Post by Joost Buijs »

jdart wrote:I tried reducing the profiling time to 15 seconds but that didn't fix it.

Still works using 1 core in the profiling run though.

--Jon
This is very strange because for me it does work. On average I get a 10% increase in nps when doing a SMP build with PGO.

I get the message '8.40% profiled functions will be compiled for speed', this is exactly the same message as with VC-2008. The 8.40% is probably due to the TB code that won't be profiled because im checking this on an early midgame position. I don't get the messages about the negative count, but I remember that I have seen that in the past, it is possible that this was with a beta version of VC-2012. At the moment I use ver. 11.0.50727.1 this is the RTM build.