Skip to content

Commit

Permalink
Easy move fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbootsector committed Oct 5, 2015
1 parent d0578d7 commit 34ecba3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/search.cpp
Expand Up @@ -345,8 +345,11 @@ void Thread::id_loop() {

Value bestValue, alpha, beta, delta;

Move easyMove = EasyMove.get(pos.key());
EasyMove.clear();
Move easyMove = MOVE_NONE;
if (this == Threads.main()) {
easyMove = EasyMove.get(pos.key());
EasyMove.clear();
}

Stack *ss = stack+2; // To allow referencing (ss-2) and (ss+2)
std::memset(stack, 0, 5 * sizeof(Stack));
Expand Down Expand Up @@ -1084,6 +1087,7 @@ namespace {
{
// If there is an easy move for this position, clear it if unstable
if ( PvNode
&& thisThread == Threads.main()
&& EasyMove.get(pos.key())
&& (move != EasyMove.get(pos.key()) || moveCount > 1))
EasyMove.clear();
Expand Down

2 comments on commit 34ecba3

@mstembera
Copy link

Choose a reason for hiding this comment

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

@mbootsector
Thanks for fixing the easy move issue! However, just as any thread can update the PV any thread needs to be able to clear the easy move otherwise it's not safe that we won't blunder on some easy moves. So the added line 1090

&& thisThread == Threads.main()

should not be there.

BTW, this MIGHT entirely account for the regression w/ low thread counts. The original easy move tests showed at least one run w/ +8(+-3)elo
official-stockfish#283
and that was against a master that had the proper time management constants w/o easy move.

@mbootsector
Copy link
Owner Author

Choose a reason for hiding this comment

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

@mstembera Ok, I have removed the line.

Please sign in to comment.