Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak root LMR #2282

Closed
wants to merge 1 commit into from
Closed

Conversation

locutus2
Copy link
Member

@locutus2 locutus2 commented Aug 25, 2019

Maintain best move counter at the root and allow there only moves which has a counter of zero for LMR. For compensation only the first three moves are excluded from LMR per default instead the first four moves.

What we can further do:

  • here we use a simple counting scheme but perhaps some aging to fade out early iterations could be helpful
  • use the best move counter also at inner nodes for LMR and/or pruning

STC:
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 17414 W: 3984 L: 3733 D: 9697
http://tests.stockfishchess.org/tests/view/5d6234bb0ebc5939d09f2aa2

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 38058 W: 6448 L: 6166 D: 25444
http://tests.stockfishchess.org/tests/view/5d62681a0ebc5939d09f2f27

Bench: 3568210

…ch has a counter of zero for LMR. For compensation at root only the frist three moves are excluded from LMR per default instead the first four moves. Bench: 3568210
@@ -1072,7 +1075,8 @@ namespace {
// Step 16. Reduced depth search (LMR). If the move fails high it will be
// re-searched at full depth.
if ( depth >= 3 * ONE_PLY
&& moveCount > 1 + 3 * rootNode
&& moveCount > 1 + 2 * rootNode
&& (!rootNode || thisThread->bestMoveCount(move) == 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to move this condition last since calling bestMoveCount(move) traverses the move list and so is likely slower than the other conditions?

Copy link
Member Author

Choose a reason for hiding this comment

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

In this case the effect would be insignificant because the funtion best_move_count is only called at the root. And at non-PV nodes line 1079 wouldn't even be compiled in the code because of template paramter PvNode=false is evaluated to true.

But if we use best_move_count at inner nodes this could be important.

@@ -56,6 +56,7 @@ class Thread {
void idle_loop();
void start_searching();
void wait_for_search_finished();
int bestMoveCount(Move move);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the usual SF style for function names is to use "_" Something like best_move_count().

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, you are right. For my own coding style i prefer upper-lower cases instead of underscores.

@snicolet snicolet closed this in 8fec883 Aug 26, 2019
@snicolet
Copy link
Member

Merged via 8fec883, congrats :-)

mstembera pushed a commit to mstembera/Stockfish that referenced this pull request Aug 29, 2019
Maintain best move counter at the root and allow there only moves which has a counter
of zero for Late Move Reduction. For compensation only the first three moves are excluded
from Late Move Reduction per default instead the first four moves.

What we can further do:

- here we use a simple counting scheme but perhaps some aging to fade out early iterations
  could be helpful
- use the best move counter also at inner nodes for LMR and/or pruning

STC:
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 17414 W: 3984 L: 3733 D: 9697
http://tests.stockfishchess.org/tests/view/5d6234bb0ebc5939d09f2aa2

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 38058 W: 6448 L: 6166 D: 25444
http://tests.stockfishchess.org/tests/view/5d62681a0ebc5939d09f2f27

Closes official-stockfish#2282

Bench: 3568210
pb00068 pushed a commit to pb00068/Stockfish that referenced this pull request Sep 10, 2019
Maintain best move counter at the root and allow there only moves which has a counter
of zero for Late Move Reduction. For compensation only the first three moves are excluded
from Late Move Reduction per default instead the first four moves.

What we can further do:

- here we use a simple counting scheme but perhaps some aging to fade out early iterations
  could be helpful
- use the best move counter also at inner nodes for LMR and/or pruning

STC:
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 17414 W: 3984 L: 3733 D: 9697
http://tests.stockfishchess.org/tests/view/5d6234bb0ebc5939d09f2aa2

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 38058 W: 6448 L: 6166 D: 25444
http://tests.stockfishchess.org/tests/view/5d62681a0ebc5939d09f2f27

Closes official-stockfish#2282

Bench: 3568210
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants