Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: several questions about memory and how it is used by programs

Author: Omid David

Date: 13:03:29 08/27/02

Go up one level in this thread


On August 27, 2002 at 12:48:36, Matthew Hull wrote:

>On August 27, 2002 at 11:16:27, Robert Hyatt wrote:
>
>>On August 27, 2002 at 10:28:09, K. Burcham wrote:
>>
>>>
>>>I am not clear on these questions:
>>>
>>>1. when does a program write to hash?
>>
>>Whenever it completes searching at any particular node in the tree.  It
>>tries to save the results of this search so that if the same position
>>arises elsewhere the search can be avoided.  Basically one store per node
>>searched, except for the nodes where you get a hash hit to avoid a search,
>>since storing there would be pointless.
>>
>>>2. when does a program write to the hard drive?
>>
>>In my case, at three points:
>>
>>1.  when it does book learning, which is 10 moves out of book.
>>
>>2.  whenever it does "position learning" which happens when a search is
>>completely finished, a move is made, and the score is significantly worse
>>than expected.
>>
>>3.  whenever it displays a PV, because this goes into the log file.
>>But it is _very_ rare.
>>
>>
>>
>>>3. when does a program write to ram separate from the hash?
>>
>>All the time.  Updating scoring tables, temp variables, PV stuff, generating
>>moves and sticking them in a move list.  Evaluating.  You-name-it...
>>
>>>4. If a pc has 512 megs ram, If we set hash at 64 megs, what happens when hash
>>>gets full?
>>
>>Stuff starts getting replaced, even if it might be useful.
>>
>>
>>>5. lets say a program stays in book for 15 moves, is the program accessing only
>>>the hard drive to play book moves?  Or Is this info moved to ram first and then
>>>the program plays the book from ram?
>>
>>Depends on the implementation.  Some read the entire book in first.  Others
>>(myself included) do not so that the book can be far larger than physical RAM.
>>
>>
>>
>>>6. In the middle game after book, I assume this is when the program starts to
>>>store info from analysis. during this period, what is being read/write to the
>>>hard drive before the hash is full?
>>
>>
>>For Crafty, it would mainly be log file info.
>>
>>
>>>7. In the middle game after book, what is being read/write to the hard drive
>>>after the hash is full.
>>
>>
>>same as above.
>>
>>>8. In the middle game after book, if we set the hash at 64 megs, and then this
>>>fills, will the program just use more of the ram, or will it store analysis
>>>directly to the hard drive?
>>
>>
>>Neither.  It will just have to replace hash entries by overwriting them.
>>
>>
>>>9. what were programs doing with analysis before hash tables? did all this
>>>analysis set in ram? did the operating system manage this info as needed, and
>>>move the stored analysis to the hard drive as the ram filled?
>>
>>
>>They simply didn't have the hash tables.  But this has been around since the
>>early 1960's as Richard Greenblatt was the first to mention the idea and he
>>used it in Mack Hack.
>>
>>
>>
>>>10. if we set up two identical computers, running same program on each.
>>>set up same test position on both. computer A with hash tables and computer B
>>>without hash tables. how do these two compare, what memory are they using and
>>>when.
>>>
>>
>>
>>The main point is that the program with hash tables will search deeper, faster.
>
>I found out just how important hash tables are with an experiment.  Phalanx22 is
>a decent chess engine, but it is not as strong as Crafty on equal hardware.  On
>a Duron 900mhz, Crafty beats Phalanx on average 7.5-2.5 at 1 minute/move over
>several matches.
>
>I put Crafty on a p90, which performs about 16 times slower on average, and
>Phalanx on the 900.  But, I forgot to give Phalanx some hash tables, since the
>default tables are tiny.  Crafty won the match 6-4!  After I found the mistake
>and re-ran the match, Phalanx won 9-1.
>

The 20%-25% reduced search effort by using hash tables, plays a very decisive
role. And most of the reduced search effort is due to a better move ordering.

Once I conducted a few dozen matches using two versions of Genesis: one without
has tables, and the other with a mere 1 MB hash table (2^16 entries). The
version using this minimal hash table, decisively won most matches.

>>
>>
>>
>>
>>
>>>
>>>In other words when exactly, will a hard drive speed increase also speed up a
>>>chess program and why?
>>
>>Hard drive speed is irrelevant until you start probing endgame tablebases.  Then
>>that speed becomes very important.
>>
>>But otherwise, it can be ignored.
>>
>>
>>
>>
>>>
>>>some will say go study on the internet. i have at many sites. i cannot find
>>>answers to these type of questions. if you know a site that answers these
>>>questions, please let me know, i will go there and study.
>>>thanks
>>>kburcham



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.