[Top][All Lists]

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

[gnugo-devel] Partial Caching reference implementation`

From: Evan Berggren Daniel
Subject: [gnugo-devel] Partial Caching reference implementation`
Date: Thu, 19 Sep 2002 11:06:16 -0400 (EDT)

I have put up

Which is a reference implementation of a partial caching scheme I
discussed earlier.  Unfortunately, the web site seems to be having
trouble, so I have attached it to this email.

The idea is to implement a generic persitant cache, similar to but
hopefully better than the kind used in GNU Go currently.

My understanding of GNU Go's caches is that currently, as soon as a board
position related to the cache entry changes, the entry is invalidated.  My
goal with this caching scheme is to automatically compute dependencies of
the cache results, and use cache results whenever possible.  This is
probably best illustrated with an example.

The reference engine includes 3 variables, A, B and C, functions setA,
getA, etc. to set and get them, and functions sum and sum3.  sum computes
getA() + getB().  sum3 computes sum() + getC().  The first time sum3 is
called, the entire function tree is evaluated, and cache entries are made.
The low level get functions are considered uncacheable, but should really
be explicitly invalidated.  So, the second time sum3 is called, with the
same variable values, the three get functions are checked.  Because they
return the same results as last time, a cached answer is returned for
sum3.  If A is incremented and B decremented, and then sum3 called again,
the cache notices that getA and getB are invalid, recomputes sum, notices
it is unchanged, and returns a cached sum3 result.

The other major piece of interest is, which is a highly generic
GTP interface.  It's still slightly buggy, and should have more features,
but shows the basic structure.

To use it, compile with javac *.java, and run java GTP.  enter the GTP
command new_engine, run setA #, etc, and then do whatever with the sets,
gets, and sums.

Anyway, I hope this is interesting and or useful in some way.  If not, it
was fun to code ;)


Evan Daniel

Attachment: cachego.tar.gz
Description: cachego

reply via email to

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