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

Search code documentation take II

No functional change

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Joona Kiiski 2010-02-24 12:37:32 +02:00 committed by Marco Costalba
parent 89b4ad6433
commit 195b54c312

View file

@ -1331,16 +1331,19 @@ namespace {
return v; //FIXME: Logically should be: return (v + 0x200 + 16 * depth); return v; //FIXME: Logically should be: return (v + 0x200 + 16 * depth);
} }
// Static null move pruning. We're betting that the opponent doesn't have // Step 7. Static null move pruning
// a move that will reduce the score by more than FutilityMargins[int(depth)] // We're betting that the opponent doesn't have a move that will reduce
// if we do a null move. // the score by more than fuility_margin(depth) if we do a null move.
if ( !isCheck if ( !isCheck
&& allowNullmove && allowNullmove
&& depth < RazorDepth && depth < RazorDepth
&& staticValue - futility_margin(depth, 0) >= beta) && staticValue - futility_margin(depth, 0) >= beta)
return staticValue - futility_margin(depth, 0); return staticValue - futility_margin(depth, 0);
// Null move search // Step 8. Null move search with verification search
// When we jump directly to qsearch() we do a null move only if static value is
// at least beta. Otherwise we do a null move if static value is not more than
// NullMoveMargin under beta.
if ( allowNullmove if ( allowNullmove
&& depth > OnePly && depth > OnePly
&& !isCheck && !isCheck
@ -1390,11 +1393,11 @@ namespace {
} }
} }
// Go with internal iterative deepening if we don't have a TT move // Step 9. Internal iterative deepening
if (UseIIDAtNonPVNodes && ttMove == MOVE_NONE && depth >= 8*OnePly && if (UseIIDAtNonPVNodes && ttMove == MOVE_NONE && depth >= 8*OnePly &&
!isCheck && ss[ply].eval >= beta - IIDMargin) !isCheck && ss[ply].eval >= beta - IIDMargin)
{ {
search(pos, ss, beta, Min(depth/2, depth-2*OnePly), ply, false, threadID); search(pos, ss, beta, depth/2, ply, false, threadID);
ttMove = ss[ply].pv[ply]; ttMove = ss[ply].pv[ply];
tte = TT.retrieve(posKey); tte = TT.retrieve(posKey);
} }