1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

Separate razoring from null move

I cannot see connection between the two.

Also add one FIXME for illogical behaviour

No functional change

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Joona Kiiski 2010-02-24 12:26:36 +02:00 committed by Marco Costalba
parent 77bb9a94ae
commit 89b4ad6433

View file

@ -1316,6 +1316,21 @@ namespace {
update_gains(pos, ss[ply - 1].currentMove, ss[ply - 1].eval, ss[ply].eval); update_gains(pos, ss[ply - 1].currentMove, ss[ply - 1].eval, ss[ply].eval);
} }
// Step 6. Razoring
if ( !value_is_mate(beta)
&& !isCheck
&& depth < RazorDepth
&& staticValue < beta - (0x200 + 16 * depth)
&& ss[ply - 1].currentMove != MOVE_NULL
&& ttMove == MOVE_NONE
&& !pos.has_pawn_on_7th(pos.side_to_move()))
{
Value rbeta = beta - (0x200 + 16 * depth);
Value v = qsearch(pos, ss, rbeta-1, rbeta, Depth(0), ply, threadID);
if (v < rbeta)
return v; //FIXME: Logically should be: return (v + 0x200 + 16 * depth);
}
// Static null move pruning. We're betting that the opponent doesn't have // Static null move pruning. We're betting that the opponent doesn't have
// a move that will reduce the score by more than FutilityMargins[int(depth)] // a move that will reduce the score by more than FutilityMargins[int(depth)]
// if we do a null move. // if we do a null move.
@ -1374,20 +1389,6 @@ namespace {
return beta - 1; return beta - 1;
} }
} }
// Null move search not allowed, try razoring
else if ( !value_is_mate(beta)
&& !isCheck
&& depth < RazorDepth
&& staticValue < beta - (NullMoveMargin + 16 * depth)
&& ss[ply - 1].currentMove != MOVE_NULL
&& ttMove == MOVE_NONE
&& !pos.has_pawn_on_7th(pos.side_to_move()))
{
Value rbeta = beta - (NullMoveMargin + 16 * depth);
Value v = qsearch(pos, ss, rbeta-1, rbeta, Depth(0), ply, threadID);
if (v < rbeta)
return v;
}
// Go with internal iterative deepening if we don't have a TT move // Go with internal iterative deepening if we don't have a TT move
if (UseIIDAtNonPVNodes && ttMove == MOVE_NONE && depth >= 8*OnePly && if (UseIIDAtNonPVNodes && ttMove == MOVE_NONE && depth >= 8*OnePly &&