Cache evaluation score in qsearch

Instead of just drop evaluation score after stand pat
logic save it in TT so to be reused if the same position
occurs again.

Note that we NEVER use the cached value apart to avoid an
evaluation call, in particulary we never return to caller
after a succesful tt hit.

To accomodate this a new value type VALUE_TYPE_EVAL has been
introduced so that ok_to_use_TT() always returns false.

With this patch we cut about 15% of total evaluation calls.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-03-24 15:48:14 +01:00
parent 1c087dd806
commit 5a0581498c
6 changed files with 37 additions and 16 deletions

View File

@@ -137,7 +137,7 @@ void TranspositionTable::store(const Position &pos, Value v, Depth d,
/// transposition table. Returns a pointer to the TTEntry or NULL
/// if position is not found.
const TTEntry* TranspositionTable::retrieve(const Position &pos) const {
TTEntry* TranspositionTable::retrieve(const Position &pos) const {
TTEntry *tte = first_entry(pos);