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

Split at root!

Another great success by Joona !

After 5876 games at 10"+0.1
Mod vs Orig: 1073 - 849 - 3954 ELO +13 (+- 5.2)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Joona Kiiski 2011-08-06 09:43:46 +01:00 committed by Marco Costalba
parent 13bc6ba2c6
commit ffa150bec3
3 changed files with 12 additions and 11 deletions

View file

@ -1226,15 +1226,14 @@ split_point_start: // At split points actual search starts from here
} }
// Step 19. Check for split // Step 19. Check for split
if ( !RootNode if ( !SpNode
&& !SpNode
&& depth >= Threads.min_split_depth() && depth >= Threads.min_split_depth()
&& bestValue < beta && bestValue < beta
&& Threads.available_slave_exists(pos.thread()) && Threads.available_slave_exists(pos.thread())
&& !StopRequest && !StopRequest
&& !thread.cutoff_occurred()) && !thread.cutoff_occurred())
Threads.split<FakeSplit>(pos, ss, &alpha, beta, &bestValue, depth, Threads.split<FakeSplit>(pos, ss, &alpha, beta, &bestValue, depth,
threatMove, moveCount, &mp, PvNode); threatMove, moveCount, &mp, NT);
} }
// Step 20. Check for mate and stalemate // Step 20. Check for mate and stalemate
@ -2210,9 +2209,11 @@ void ThreadsManager::idle_loop(int threadID, SplitPoint* sp) {
memcpy(ss, tsp->ss - 1, 4 * sizeof(SearchStack)); memcpy(ss, tsp->ss - 1, 4 * sizeof(SearchStack));
(ss+1)->sp = tsp; (ss+1)->sp = tsp;
if (tsp->pvNode) if (tsp->nodeType == Root)
search<SplitPointRoot>(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth);
else if (tsp->nodeType == PV)
search<SplitPointPV>(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth); search<SplitPointPV>(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth);
else else if (tsp->nodeType == NonPV)
search<SplitPointNonPV>(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth); search<SplitPointNonPV>(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth);
assert(threads[threadID].state == Thread::SEARCHING); assert(threads[threadID].state == Thread::SEARCHING);

View file

@ -240,7 +240,7 @@ bool ThreadsManager::available_slave_exists(int master) const {
template <bool Fake> template <bool Fake>
void ThreadsManager::split(Position& pos, SearchStack* ss, Value* alpha, const Value beta, void ThreadsManager::split(Position& pos, SearchStack* ss, Value* alpha, const Value beta,
Value* bestValue, Depth depth, Move threatMove, Value* bestValue, Depth depth, Move threatMove,
int moveCount, MovePicker* mp, bool pvNode) { int moveCount, MovePicker* mp, int nodeType) {
assert(pos.is_ok()); assert(pos.is_ok());
assert(*bestValue >= -VALUE_INFINITE); assert(*bestValue >= -VALUE_INFINITE);
assert(*bestValue <= *alpha); assert(*bestValue <= *alpha);
@ -275,7 +275,7 @@ void ThreadsManager::split(Position& pos, SearchStack* ss, Value* alpha, const V
splitPoint.threatMove = threatMove; splitPoint.threatMove = threatMove;
splitPoint.alpha = *alpha; splitPoint.alpha = *alpha;
splitPoint.beta = beta; splitPoint.beta = beta;
splitPoint.pvNode = pvNode; splitPoint.nodeType = nodeType;
splitPoint.bestValue = *bestValue; splitPoint.bestValue = *bestValue;
splitPoint.mp = mp; splitPoint.mp = mp;
splitPoint.moveCount = moveCount; splitPoint.moveCount = moveCount;
@ -341,5 +341,5 @@ void ThreadsManager::split(Position& pos, SearchStack* ss, Value* alpha, const V
} }
// Explicit template instantiations // Explicit template instantiations
template void ThreadsManager::split<false>(Position&, SearchStack*, Value*, const Value, Value*, Depth, Move, int, MovePicker*, bool); template void ThreadsManager::split<false>(Position&, SearchStack*, Value*, const Value, Value*, Depth, Move, int, MovePicker*, int);
template void ThreadsManager::split<true>(Position&, SearchStack*, Value*, const Value, Value*, Depth, Move, int, MovePicker*, bool); template void ThreadsManager::split<true>(Position&, SearchStack*, Value*, const Value, Value*, Depth, Move, int, MovePicker*, int);

View file

@ -38,7 +38,7 @@ struct SplitPoint {
const Position* pos; const Position* pos;
Depth depth; Depth depth;
Value beta; Value beta;
int pvNode; int nodeType;
int ply; int ply;
int master; int master;
Move threatMove; Move threatMove;
@ -116,7 +116,7 @@ public:
template <bool Fake> template <bool Fake>
void split(Position& pos, SearchStack* ss, Value* alpha, const Value beta, Value* bestValue, void split(Position& pos, SearchStack* ss, Value* alpha, const Value beta, Value* bestValue,
Depth depth, Move threatMove, int moveCount, MovePicker* mp, bool pvNode); Depth depth, Move threatMove, int moveCount, MovePicker* mp, int nodeType);
private: private:
Thread threads[MAX_THREADS]; Thread threads[MAX_THREADS];
Lock mpLock; Lock mpLock;