[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] What does the cache do?

From: Joern Thyssen
Subject: Re: [Bug-gnubg] What does the cache do?
Date: Sat, 5 Jul 2003 18:29:27 +0000
User-agent: Mutt/1.4.1i

On Mon, Jun 30, 2003 at 07:44:14AM +1200, Joseph Heled wrote
> The cubeless 0ply evaluations can always stay (unless the net is 
> changed), and they are the what counts.

One of the problems is that we use the same cache for cubeless and
cubeful evaluations.

A better idea is to save 0-ply evaluations in one cache, and cubeful 0+
ply evaluations and cubeless 1+ ply evaluations in another cache. For
example, a cubeful 0-ply evaluation should store the 0-ply gwc in the
former cache and the cubeful equity (and the gwc) in the latter cache.
This division should give maximum reuse, e.g., if we re-evaluate the
same position for another score we can reuse the gwc from the first
cache, so we only have to do the Janowski transformation of the equity.

As an alternative to using two caches, it should be possible to ensure
that gnubg writes both evaluations to the same cache. Hmmm, gnubg
actually already does that... However, I think the following change
should be made to EvalKey, otherwise we won't get the full effect:

  if ( nPlies || fCubefulEquity ) {  /* NEW IF STATEMENT */

  /* In match play, the score and cube value and position are important.  */
  if( pci->nMatchTo )
     [lines snipped]

  if( fCubefulEquity )
      iKey ^= 0x6a47b47e;


With respect to clearing the cache, it should be possible to go through
all entries and not clearing those who has a cacheNode.nEvalContext that
suggests 1+ ply or cubeful evaluations.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]