Revert setting a flag when TT value equals static evaluation

Strangely enough it seems that optimization doesn't work.

After 760 games at 1+0: +155 -184 =421 -13 ELO

Probably the overhead, although small, for setting the flag
is not compensated by the saved evaluation call.

This could be due to the fact that after a TT value is stored,
if and when we hit the position again the stored TT value is
actually used as a cut-off so that we don't need to go on
with another search and evaluation is avoided in any case.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-03-31 14:57:44 +02:00
parent 2c0cd95ecf
commit 659c54582d
3 changed files with 8 additions and 23 deletions

View File

@@ -104,7 +104,7 @@ void TranspositionTable::clear() {
/// is bigger than the depth of t2. A TTEntry of type VALUE_TYPE_EVAL
/// never replaces another entry for the same position.
TTEntry* TranspositionTable::store(const Position &pos, Value v, Depth d,
void TranspositionTable::store(const Position &pos, Value v, Depth d,
Move m, ValueType type) {
TTEntry *tte, *replace;
@@ -116,13 +116,13 @@ TTEntry* TranspositionTable::store(const Position &pos, Value v, Depth d,
// Do not overwrite position entry when VALUE_TYPE_EVAL
if ( tte->key()
&& type == VALUE_TYPE_EVAL)
return NULL;
return;
if (m == MOVE_NONE)
m = tte->move();
*tte = TTEntry(pos.get_key(), v, type, d, m, generation);
return tte;
return;
}
else if (i == 0) // replace would be a no-op in this common case
continue;
@@ -136,7 +136,6 @@ TTEntry* TranspositionTable::store(const Position &pos, Value v, Depth d,
}
*replace = TTEntry(pos.get_key(), v, type, d, m, generation);
writes++;
return replace;
}