mirror of
https://github.com/sockspls/badfish
synced 2025-05-02 01:29:36 +00:00
Rename sp to splitPoint
Still keep 'sp' name when used as local variable with limited scope. From Jundery. No functional change.
This commit is contained in:
parent
0fc9a01933
commit
0e1ad3ad33
3 changed files with 23 additions and 23 deletions
|
@ -374,4 +374,4 @@ Move MovePicker::next_move<false>() {
|
||||||
/// from the split point's shared MovePicker object. This function is not thread
|
/// from the split point's shared MovePicker object. This function is not thread
|
||||||
/// safe so must be lock protected by the caller.
|
/// safe so must be lock protected by the caller.
|
||||||
template<>
|
template<>
|
||||||
Move MovePicker::next_move<true>() { return ss->sp->movePicker->next_move<false>(); }
|
Move MovePicker::next_move<true>() { return ss->splitPoint->movePicker->next_move<false>(); }
|
||||||
|
|
|
@ -494,7 +494,7 @@ namespace {
|
||||||
Move movesSearched[64];
|
Move movesSearched[64];
|
||||||
StateInfo st;
|
StateInfo st;
|
||||||
const TTEntry *tte;
|
const TTEntry *tte;
|
||||||
SplitPoint* sp;
|
SplitPoint* splitPoint;
|
||||||
Key posKey;
|
Key posKey;
|
||||||
Move ttMove, move, excludedMove, bestMove, threatMove;
|
Move ttMove, move, excludedMove, bestMove, threatMove;
|
||||||
Depth ext, newDepth;
|
Depth ext, newDepth;
|
||||||
|
@ -511,15 +511,15 @@ namespace {
|
||||||
|
|
||||||
if (SpNode)
|
if (SpNode)
|
||||||
{
|
{
|
||||||
sp = ss->sp;
|
splitPoint = ss->splitPoint;
|
||||||
bestMove = sp->bestMove;
|
bestMove = splitPoint->bestMove;
|
||||||
threatMove = sp->threatMove;
|
threatMove = splitPoint->threatMove;
|
||||||
bestValue = sp->bestValue;
|
bestValue = splitPoint->bestValue;
|
||||||
tte = NULL;
|
tte = NULL;
|
||||||
ttMove = excludedMove = MOVE_NONE;
|
ttMove = excludedMove = MOVE_NONE;
|
||||||
ttValue = VALUE_NONE;
|
ttValue = VALUE_NONE;
|
||||||
|
|
||||||
assert(sp->bestValue > -VALUE_INFINITE && sp->moveCount > 0);
|
assert(splitPoint->bestValue > -VALUE_INFINITE && splitPoint->moveCount > 0);
|
||||||
|
|
||||||
goto split_point_start;
|
goto split_point_start;
|
||||||
}
|
}
|
||||||
|
@ -794,8 +794,8 @@ split_point_start: // At split points actual search starts from here
|
||||||
if (!pos.pl_move_is_legal(move, ci.pinned))
|
if (!pos.pl_move_is_legal(move, ci.pinned))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
moveCount = ++sp->moveCount;
|
moveCount = ++splitPoint->moveCount;
|
||||||
sp->mutex.unlock();
|
splitPoint->mutex.unlock();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
moveCount++;
|
moveCount++;
|
||||||
|
@ -869,7 +869,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
&& (!threatMove || !refutes(pos, move, threatMove)))
|
&& (!threatMove || !refutes(pos, move, threatMove)))
|
||||||
{
|
{
|
||||||
if (SpNode)
|
if (SpNode)
|
||||||
sp->mutex.lock();
|
splitPoint->mutex.lock();
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -884,7 +884,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
if (!PvNode && futilityValue < beta)
|
if (!PvNode && futilityValue < beta)
|
||||||
{
|
{
|
||||||
if (SpNode)
|
if (SpNode)
|
||||||
sp->mutex.lock();
|
splitPoint->mutex.lock();
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -894,7 +894,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
&& pos.see_sign(move) < 0)
|
&& pos.see_sign(move) < 0)
|
||||||
{
|
{
|
||||||
if (SpNode)
|
if (SpNode)
|
||||||
sp->mutex.lock();
|
splitPoint->mutex.lock();
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -928,7 +928,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
ss->reduction = reduction<PvNode>(depth, moveCount);
|
ss->reduction = reduction<PvNode>(depth, moveCount);
|
||||||
Depth d = std::max(newDepth - ss->reduction, ONE_PLY);
|
Depth d = std::max(newDepth - ss->reduction, ONE_PLY);
|
||||||
if (SpNode)
|
if (SpNode)
|
||||||
alpha = sp->alpha;
|
alpha = splitPoint->alpha;
|
||||||
|
|
||||||
value = -search<NonPV>(pos, ss+1, -(alpha+1), -alpha, d);
|
value = -search<NonPV>(pos, ss+1, -(alpha+1), -alpha, d);
|
||||||
|
|
||||||
|
@ -942,7 +942,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
if (doFullDepthSearch)
|
if (doFullDepthSearch)
|
||||||
{
|
{
|
||||||
if (SpNode)
|
if (SpNode)
|
||||||
alpha = sp->alpha;
|
alpha = splitPoint->alpha;
|
||||||
|
|
||||||
value = newDepth < ONE_PLY ?
|
value = newDepth < ONE_PLY ?
|
||||||
givesCheck ? -qsearch<NonPV, true>(pos, ss+1, -(alpha+1), -alpha, DEPTH_ZERO)
|
givesCheck ? -qsearch<NonPV, true>(pos, ss+1, -(alpha+1), -alpha, DEPTH_ZERO)
|
||||||
|
@ -966,9 +966,9 @@ split_point_start: // At split points actual search starts from here
|
||||||
// Step 18. Check for new best move
|
// Step 18. Check for new best move
|
||||||
if (SpNode)
|
if (SpNode)
|
||||||
{
|
{
|
||||||
sp->mutex.lock();
|
splitPoint->mutex.lock();
|
||||||
bestValue = sp->bestValue;
|
bestValue = splitPoint->bestValue;
|
||||||
alpha = sp->alpha;
|
alpha = splitPoint->alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finished searching the move. If Signals.stop is true, the search
|
// Finished searching the move. If Signals.stop is true, the search
|
||||||
|
@ -1003,20 +1003,20 @@ split_point_start: // At split points actual search starts from here
|
||||||
|
|
||||||
if (value > bestValue)
|
if (value > bestValue)
|
||||||
{
|
{
|
||||||
bestValue = SpNode ? sp->bestValue = value : value;
|
bestValue = SpNode ? splitPoint->bestValue = value : value;
|
||||||
|
|
||||||
if (value > alpha)
|
if (value > alpha)
|
||||||
{
|
{
|
||||||
bestMove = SpNode ? sp->bestMove = move : move;
|
bestMove = SpNode ? splitPoint->bestMove = move : move;
|
||||||
|
|
||||||
if (PvNode && value < beta) // Update alpha! Always alpha < beta
|
if (PvNode && value < beta) // Update alpha! Always alpha < beta
|
||||||
alpha = SpNode ? sp->alpha = value : value;
|
alpha = SpNode ? splitPoint->alpha = value : value;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert(value >= beta); // Fail high
|
assert(value >= beta); // Fail high
|
||||||
|
|
||||||
if (SpNode)
|
if (SpNode)
|
||||||
sp->cutoff = true;
|
splitPoint->cutoff = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1669,7 +1669,7 @@ void Thread::idle_loop() {
|
||||||
Position pos(*sp->pos, this);
|
Position pos(*sp->pos, this);
|
||||||
|
|
||||||
memcpy(ss, sp->ss - 1, 4 * sizeof(Stack));
|
memcpy(ss, sp->ss - 1, 4 * sizeof(Stack));
|
||||||
(ss+1)->sp = sp;
|
(ss+1)->splitPoint = sp;
|
||||||
|
|
||||||
sp->mutex.lock();
|
sp->mutex.lock();
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace Search {
|
||||||
/// has its own array of Stack objects, indexed by the current ply.
|
/// has its own array of Stack objects, indexed by the current ply.
|
||||||
|
|
||||||
struct Stack {
|
struct Stack {
|
||||||
SplitPoint* sp;
|
SplitPoint* splitPoint;
|
||||||
int ply;
|
int ply;
|
||||||
Move currentMove;
|
Move currentMove;
|
||||||
Move excludedMove;
|
Move excludedMove;
|
||||||
|
|
Loading…
Add table
Reference in a new issue