Skip to content

Commit

Permalink
IncrementalFutilityMargin to 4 and increased pruning
Browse files Browse the repository at this point in the history
Increase pruning at low depths while tone downa bit at
higher depths (linearize a bit the logaritmic behaviour)

This goes togheter with IncrementalFutilityMargin decreased
to 4 compensate the bigger pruning effect.

Total pruned nodes are more or less the same. We go from 36%
of nodes after prune to 37% with this patch.

After 999 games at 1+0
Mod vs Orig +250 =526 -223 +9 ELO

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
  • Loading branch information
mcostalba committed Nov 27, 2009
1 parent 1a7047f commit af3dd21
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/search.cpp
Expand Up @@ -180,7 +180,7 @@ namespace {
const Value FutilityMarginQS = Value(0x80); const Value FutilityMarginQS = Value(0x80);


// Each move futility margin is decreased // Each move futility margin is decreased
const Value IncrementalFutilityMargin = Value(0x8); const Value IncrementalFutilityMargin = Value(0x4);


// Remaining depth: 1 ply 1.5 ply 2 ply 2.5 ply 3 ply 3.5 ply // Remaining depth: 1 ply 1.5 ply 2 ply 2.5 ply 3 ply 3.5 ply
const Value FutilityMargins[12] = { Value(0x100), Value(0x120), Value(0x200), Value(0x220), Value(0x250), Value(0x270), const Value FutilityMargins[12] = { Value(0x100), Value(0x120), Value(0x200), Value(0x220), Value(0x250), Value(0x270),
Expand Down Expand Up @@ -1452,6 +1452,12 @@ namespace {
// Move count pruning limit // Move count pruning limit
const int MCLimit = 3 + (1 << (3*int(depth)/8)); const int MCLimit = 3 + (1 << (3*int(depth)/8));


/*
for (int d = 2; d < 16; d++)
std::cout << d << " -> " << 56*(0+2*bitScanReverse32(1 * int(d) * int(d) / 2)) << std::endl;
//std::cout << d << " -> " << 32*(1+3*bitScanReverse32(1 * int(d) * int(d))) << std::endl;
*/

// Loop through all legal moves until no moves remain or a beta cutoff occurs // Loop through all legal moves until no moves remain or a beta cutoff occurs
while ( bestValue < beta while ( bestValue < beta
&& (move = mp.get_next_move()) != MOVE_NONE && (move = mp.get_next_move()) != MOVE_NONE
Expand Down Expand Up @@ -1513,10 +1519,10 @@ namespace {


// Value based pruning // Value based pruning
if (approximateEval < beta) if (approximateEval < beta)
{ {//dbg_before();
if (futilityValue == VALUE_NONE) if (futilityValue == VALUE_NONE)
futilityValue = evaluate(pos, ei, threadID) futilityValue = evaluate(pos, ei, threadID)
+ 64*(2+bitScanReverse32(int(depth) * int(depth))); + 56*(0+2*bitScanReverse32(1 * int(depth) * int(depth) / 2));


futilityValueScaled = futilityValue - moveCount * IncrementalFutilityMargin; futilityValueScaled = futilityValue - moveCount * IncrementalFutilityMargin;


Expand All @@ -1526,6 +1532,7 @@ namespace {
bestValue = futilityValueScaled; bestValue = futilityValueScaled;
continue; continue;
} }
//dbg_after(); // 36% (inc == 8), 40% (inc == 4), 37%(56)
} }
} }


Expand Down

0 comments on commit af3dd21

Please sign in to comment.