Friday, December 12, 2014

Cores and Hash

  
   Configuring the number of cores and hash size is important in getting the best analysis results from your engine.
     For infinite analysis you need to use the maximum hash; typically that would be half of the computer's RAM. If your PC has 2048 MB RAM, then your maximum hash size is 1024 MB. Fortunately on my laptop when I load Stockfish 5, Komodo 8 or Houdini 2 (the only engines I use) into my Fritz 12 program it automatically tells me the maximum RAM I can use is 2560.
     If you want to play an engine tournament at blitz (5 minutes) then 128MB for each engine is enough because reading a large hash file at blitz time control is counter-productive. For longer engine matches 256MB hash for each engine is OK. The shorter the time-control for a game, the less you will gain from a large hashtable.
     The hash table is used to keep track of positions it's already analyzed along with the evaluations. The engine may run into the same position several times and the positions in the hash table allows it to look up the previous values. So, normally hash tables should be as large as possible. But, you have to make sure that the hashtable isn’t so big that the computer starts constantly shuffling blocks of data between internal memory (RAM) and the hard drive. An indicator that this is what is happening is if you hear the hard drive whirring. Usually when you specify hash size it will be the power of two: 32MB, 64MB, 128MB, 256MB, 512MB, 1024MB and 2048MB.
     Usually, engines are not good with openings so it's best to use opening books and don't rely on engine evaluations up to about the 15th move.
     Generally, it's better to analyze on one core for 30 minutes than on two cores for 15 minutes. You might think analyzing with 2 or 3 cores would be 2 or 3 times better than analyzing with one but that's not the case. Adding another core doesn't mean you double the effeciency of the analysis. The percentage of efficieny diminishes with every core you add because the cores can often try to work simultaneously on the analysis. What that means is for analysis, it's better to have one powerful core than two weaker ones. At least that's true for Infinite Analysis. If you are using Aquarium IDeA analysis, the more cores the better. Personally I don't use IDeA in Aquarium. It's probably better than Infinite Analysis, but I just never had the gumption to learn how to use it properly. ChessOK article on getting the most out of IDeA.
     Engines are not designed to work in infinite mode. They are made to slug it out against other engines in a head to head matches at fast time controls. So, when you use them for Infinite Analysis, you aren't using them as designed. In Infinite Analysis there is a horizon that engines can't pass because of the pruning and evaluations will usually not change once the engine hits a depth of around 30-32 plies. Here's a brief explanation of what you see in the engine analysis window.

+0.61 means white is better by 6/10th of a Pawn
d=26 means engine has searched to a depth of 26 plies (13 moves). Note...after 38 minutes it was at a depth of 27 plies and was still showing 26...b5 as the best move. The evaluation changed to +0.68. This analysis was conducted using only one core on a quad core laptop. It's not likely there would be much to be gained by letting the engine analyze any longer.

Time: It has been analyzing for 22 minutes and 20 seconds
b5 (1/25) means that the engine is currently looking at b5 which is one of 25 legal moves.
1515 kN/s is the number of nodes searched (a node is one position). Higher = better.
Main Line: Displays the best moves. Here the top two choices are 26...b5 and 26...e5.

     There is another caveat you must be aware of here. When I stopped the analysis and inserted it into the position and then went all the way to the end, it showed black had a nearly 3-Pawn advantage. What happened? When I stopped the analysis it ended at a point where the engine was considering an inferior move for white at some point. The way to make sure you have the correct analysis is to go all the way to the end and then step backwards through it until you find the bad move that caused the sudden shift.
     The way top level correspondence players manage to win against engines is because most engines on our 'ordinary' computers get blind somewhere around 30 plies; most of them have invested in some heavy duty equipment dedicated to their chess. Also, engines prune out a gazillion moves that upon deeper examination might yield a win. How do you find those moves? I can't say. If I could, I'd be one of the top rated players on ICCF. It's a trade secret the top rated CC players keep to themselves.

1 comment:

  1. There is a theory that says that the two cores is - 1.7 Performance of a single core, quad-core - 2.8, eight cores - 4.4 proportions relate to the effective number of positions per second, which directly translates into, for example, for the time to find a move. Chess analysis can be as little to be broken down into a number of parallel threads, but chess have it to yourself to an item that can result in a variety of moves, so if you count the different variants cores, overlaps part of the analysis.

    ReplyDelete