Skip to content

Commit

Permalink
Parameter tweaks in PSQT and NMP
Browse files Browse the repository at this point in the history
This patch is a combinaison of two parameters tweaks patches which
have failed as strong yellows at LTC recently, by Alain Savard (Rocky640)
and Fabian Fichter (ianfab):
  http://tests.stockfishchess.org/tests/view/5b8a71e60ebc592cf2749b1d
  http://tests.stockfishchess.org/tests/view/5b81ce3b0ebc5902bdbb6585

Passed STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 57200 W: 12392 L: 12008 D: 32800
http://tests.stockfishchess.org/tests/view/5b8d0a5a0ebc592cf274c48f

And LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 37215 W: 6233 L: 5962 D: 25020
http://tests.stockfishchess.org/tests/view/5b8d56090ebc592cf274cb53

Closes #1764

Bench: 4136116

---------------

How to continue from there?

The null move reduction formula in line 769 of search.cpp is quite convoluted
and full of mysterious magic constants at the moment, it would certainly be
nice to simplify it and/or gain more Elo from it:

```
Depth R = (  (823 + 67 * depth / ONE_PLY) / 256
           + std::min(int(eval - beta) / 200, 3)) * ONE_PLY;
```
  • Loading branch information
ElbertoOne authored and snicolet committed Sep 4, 2018
1 parent 767c4ad commit 4bef7aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/psqt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ constexpr Score Bonus[][RANK_NB][int(FILE_NB) / 2] = {
{ S(-195,-109), S(-67,-89), S(-42,-50), S(-29,-13) }
},
{ // Bishop
{ S(-64,-58), S(-13,-31), S(-25,-37), S(-34,-19) },
{ S(-20,-34), S( 0, -9), S( 12,-14), S( 1, 4) },
{ S( -9,-23), S( 27, 0), S( 1, -3), S( 11, 16) },
{ S(-11,-26), S( 28, -3), S( 21, -5), S( 32, 16) },
{ S(-11,-26), S( 27, -4), S( 16, -7), S( 31, 14) },
{ S(-17,-24), S( 16, -2), S( -8, 0), S( 2, 13) },
{ S(-23,-34), S( -3,-10), S( 6,-12), S( -2, 6) },
{ S(-55,-55), S(-11,-32), S(-19,-36), S(-29,-17) }
{ S(-49,-58), S(- 7,-31), S(-10,-37), S(-34,-19) },
{ S(-24,-34), S( 9, -9), S( 15,-14), S( 1, 4) },
{ S( -9,-23), S( 22, 0), S( -3, -3), S( 12, 16) },
{ S( 4,-26), S( 9, -3), S( 18, -5), S( 40, 16) },
{ S( -8,-26), S( 27, -4), S( 13, -7), S( 30, 14) },
{ S(-17,-24), S( 14, -2), S( -6, 0), S( 6, 13) },
{ S(-19,-34), S(-13,-10), S( 7,-12), S(-11, 6) },
{ S(-47,-55), S( -7,-32), S(-17,-36), S(-29,-17) }
},
{ // Rook
{ S(-25, 0), S(-16, 0), S(-16, 0), S(-9, 0) },
Expand Down
2 changes: 1 addition & 1 deletion src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ namespace {
assert(eval - beta >= 0);

// Null move dynamic reduction based on depth and value
Depth R = ((823 + 67 * depth / ONE_PLY) / 256 + std::min((eval - beta) / PawnValueMg, 3)) * ONE_PLY;
Depth R = ((823 + 67 * depth / ONE_PLY) / 256 + std::min(int(eval - beta) / 200, 3)) * ONE_PLY;

ss->currentMove = MOVE_NULL;
ss->continuationHistory = &thisThread->continuationHistory[NO_PIECE][0];
Expand Down

5 comments on commit 4bef7aa

@MichaelB7
Copy link
Contributor

Choose a reason for hiding this comment

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

@ElbertoOne
with respect to your comment regarding this line:

Depth R = (  (823 + 67 * depth / ONE_PLY) / 256
           + std::min(int(eval - beta) / 200, 3)) * ONE_PLY;

you can bake it down to this with no change in bench ...

Depth R = ((13 +  depth / ONE_PLY) / 4 
            + std::min(int(eval - beta) / 200, 3)) * ONE_PLY;

with the added benefit that it actually makes it understandable...

@ianfab
Copy link

@ianfab ianfab commented on 4bef7aa Sep 11, 2018

Choose a reason for hiding this comment

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

@MichaelB7 Although it does not change bench, it still is a functional change, since the results of the formulas start to differ at depth 26. However, I agree that it would be a nice simplification, and since the functional change is very minor, it should pass [-3,1] tests.

@ElbertoOne
Copy link
Author

Choose a reason for hiding this comment

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

@MichaelB7
Copy link
Contributor

@MichaelB7 MichaelB7 commented on 4bef7aa Sep 11, 2018

Choose a reason for hiding this comment

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

Thanks is for running @ElbertoOne. Looks like LTC will fail.
You might want to try this @ (0,4):
‘’’
Depth R = ((52 + 17 * depth / ONE_PLY) / 16
+ std::min(int(eval - beta) / 200, 3)) * ONE_PLY;
‘’’
Not really a simplification, but it is tad more aggressive. I would ask for LTC test since STC will probably fail with (0,4) and this is really a parameter tweak that will only materialize at LTC. Should pass STC with (-3,1). Would they let you do that? Run STC with (-3,1) and LTC with (0,4)?

@lastwarior
Copy link

Choose a reason for hiding this comment

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

ello friends. need to something. i want to contuniue to game not to win . i must to close to win but dont want to win.i want to to continue to game. what should i do. how can i chance codes.thanks

Please sign in to comment.