mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
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>
This commit is contained in:
parent
02f96fcf5e
commit
e2c0b5f995
1 changed files with 3 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue