Skip to content

Commit

Permalink
Distinct iteration paths for Lazy SMP threads
Browse files Browse the repository at this point in the history
STC 5+0.1, threads 7
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 6026 W: 1047 L: 901 D: 4078

LTC: 20+0.2, threads 7
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 19739 W: 2910 L: 2721 D: 14108

STC 5+0.1, threads 20
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 2493 W: 462 L: 331 D: 1700

LTC 30+0.3, threads 20
ELO: 8.86 +-3.7 (95%) LOS: 100.0%
Total: 8000 W: 1076 L: 872 D: 6052

Bench: 8012530

Resolves #525
  • Loading branch information
pb00068 authored and zamar committed Dec 18, 2015
1 parent 2c1797a commit 38adb48
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,29 @@ void Thread::search() {
// Iterative deepening loop until requested to stop or target depth reached
while (++rootDepth < DEPTH_MAX && !Signals.stop && (!Limits.depth || rootDepth <= Limits.depth))
{
// Set up the new depth for the helper threads
// Set up the new depth for the helper threads skipping in average each
// 2nd ply (using a half density map similar to a Hadamard matrix).
if (!isMainThread)
rootDepth = std::min(DEPTH_MAX - ONE_PLY, Threads.main()->rootDepth + Depth(int(2.2 * log(1 + this->idx))));
{
int d = rootDepth + rootPos.game_ply();

if (idx <= 6 || idx > 24)
{
if (((d + idx) >> (msb(idx + 1) - 1)) % 2)
continue;
}
else
{
// Table of values of 6 bits with 3 of them set
static const int HalfDensityMap[] = {
0x07, 0x0b, 0x0d, 0x0e, 0x13, 0x16, 0x19, 0x1a, 0x1c,
0x23, 0x25, 0x26, 0x29, 0x2c, 0x31, 0x32, 0x34, 0x38
};

if ((HalfDensityMap[idx - 7] >> (d % 6)) & 1)
continue;
}
}

// Age out PV variability metric
if (isMainThread)
Expand Down

2 comments on commit 38adb48

@stockfishdeveloper
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An 8-ELO patch? Incredible! Good job @pb00068 !

@MichaelB7
Copy link
Contributor

@MichaelB7 MichaelB7 commented on 38adb48 Dec 18, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.