1
0
Fork 0

Store position static score in TT as soon as possible

So to maximize the possibility to avoid to recalculate it
in the future. A small speed-up of 0.8%

Idea by Ralph Stoesser.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
sf_2.3.1_base
Marco Costalba 2010-07-20 22:36:38 +01:00
parent 02f96fcf5e
commit e2c0b5f995
1 changed files with 3 additions and 4 deletions

View File

@ -1090,7 +1090,10 @@ namespace {
ei.kingDanger[pos.side_to_move()] = tte->king_danger();
}
else
{
ss->eval = evaluate(pos, ei);
TT.store(posKey, VALUE_NONE, VALUE_TYPE_NONE, DEPTH_NONE, MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]);
}
refinedValue = refine_eval(tte, ss->eval, ply); // Enhance accuracy with TT value if possible
update_gains(pos, (ss-1)->currentMove, (ss-1)->eval, ss->eval);
@ -1108,10 +1111,6 @@ namespace {
&& !value_is_mate(beta)
&& !pos.has_pawn_on_7th(pos.side_to_move()))
{
// Pass ss->eval to qsearch() and avoid an evaluate call
if (!tte)
TT.store(posKey, VALUE_NONE, VALUE_TYPE_NONE, DEPTH_NONE, MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]);
Value rbeta = beta - razor_margin(depth);
Value v = qsearch<NonPV>(pos, ss, rbeta-1, rbeta, Depth(0), ply);
if (v < rbeta)