mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Sync static null conditions with real one
Almost no functional change, but it seems more in line with the meaning of static null pruning. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
7dca461927
commit
1fc88071d1
1 changed files with 9 additions and 7 deletions
|
@ -1368,11 +1368,13 @@ namespace {
|
||||||
|
|
||||||
// Step 7. Static null move pruning
|
// Step 7. Static null move pruning
|
||||||
// We're betting that the opponent doesn't have a move that will reduce
|
// We're betting that the opponent doesn't have a move that will reduce
|
||||||
// the score by more than fuility_margin(depth) if we do a null move.
|
// the score by more than futility_margin(depth) if we do a null move.
|
||||||
if ( !isCheck
|
if ( allowNullmove
|
||||||
&& allowNullmove
|
|
||||||
&& depth < RazorDepth
|
&& depth < RazorDepth
|
||||||
&& refinedValue - futility_margin(depth, 0) >= beta)
|
&& !isCheck
|
||||||
|
&& !value_is_mate(beta)
|
||||||
|
&& ok_to_do_nullmove(pos)
|
||||||
|
&& refinedValue >= beta + futility_margin(depth, 0))
|
||||||
return refinedValue - futility_margin(depth, 0);
|
return refinedValue - futility_margin(depth, 0);
|
||||||
|
|
||||||
// Step 8. Null move search with verification search
|
// Step 8. Null move search with verification search
|
||||||
|
@ -1388,8 +1390,6 @@ namespace {
|
||||||
{
|
{
|
||||||
ss[ply].currentMove = MOVE_NULL;
|
ss[ply].currentMove = MOVE_NULL;
|
||||||
|
|
||||||
pos.do_null_move(st);
|
|
||||||
|
|
||||||
// Null move dynamic reduction based on depth
|
// Null move dynamic reduction based on depth
|
||||||
int R = 3 + (depth >= 5 * OnePly ? depth / 8 : 0);
|
int R = 3 + (depth >= 5 * OnePly ? depth / 8 : 0);
|
||||||
|
|
||||||
|
@ -1397,6 +1397,8 @@ namespace {
|
||||||
if (refinedValue - beta > PawnValueMidgame)
|
if (refinedValue - beta > PawnValueMidgame)
|
||||||
R++;
|
R++;
|
||||||
|
|
||||||
|
pos.do_null_move(st);
|
||||||
|
|
||||||
nullValue = -search(pos, ss, -(beta-1), depth-R*OnePly, ply+1, false, threadID);
|
nullValue = -search(pos, ss, -(beta-1), depth-R*OnePly, ply+1, false, threadID);
|
||||||
|
|
||||||
pos.undo_null_move();
|
pos.undo_null_move();
|
||||||
|
|
Loading…
Add table
Reference in a new issue