-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Capping stat bonus at 2000 #3731
Conversation
This patch updates the stat_bonus() function (used in the history tables to help move ordering), keeping the same quadratic for small depths but changing the values for depth >= 9: The old bonus formula was increasing from zero at depth 1 to 4100 at depth 14, then used the strange, small value of 73 for all depths >= 15. The new bonus formula increases from 0 at depth 1 to 2000 at depth 8, then keep 2000 for all depths >= 8. passed STC: LLR: 2.94 (-2.94,2.94) <-0.50,2.50> Total: 169624 W: 42875 L: 42454 D: 84295 Ptnml(0-2): 585, 19340, 44557, 19729, 601 https://tests.stockfishchess.org/tests/view/615bd69e9d256038a969b97c passed LTC: LLR: 3.07 (-2.94,2.94) <0.50,3.50> Total: 37336 W: 9456 L: 9191 D: 18689 Ptnml(0-2): 20, 3810, 10747, 4067, 24 https://tests.stockfishchess.org/tests/view/615c75d99d256038a969b9b2 closes official-stockfish/Stockfish#3731 Bench: 6261865
e64defb
to
f37e078
Compare
Congrats! One multiply could be removed with
|
Congrats! |
isn't this about equivalent to:
as value of d=8 is 2001 (and all values larger will be pushed to 2000 anyways). no real point in doing the calculations and the comparison every time (only necessary for values 0 to 7 or 1 to 7) or to use mstembera's calculation which is indeed a bit shorter
edit: d > 8 should maintain bench (untested but basically means depth 9 or above would be automatic 2000 without having to obtain a number for comparison while depth 1 to 8 would be calculated as normal, including d = 8, 2001) |
@vondele I can squash the change proposed by @Vizvezdenec in the PR, if you wish. That is, instead of
we would use this expression, which would keep the same bench:
|
@snicolet yes please squash the change. I won't be able to commit patches before tonight. |
This patch updates the stat_bonus() function (used in the history tables to help move ordering), keeping the same quadratic for small depths but changing the values for depth >= 9: The old bonus formula was increasing from zero at depth 1 to 4100 at depth 14, then used the strange, small value of 73 for all depths >= 15. The new bonus formula increases from 0 at depth 1 to 2000 at depth 8, then keep 2000 for all depths >= 8. passed STC: LLR: 2.94 (-2.94,2.94) <-0.50,2.50> Total: 169624 W: 42875 L: 42454 D: 84295 Ptnml(0-2): 585, 19340, 44557, 19729, 601 https://tests.stockfishchess.org/tests/view/615bd69e9d256038a969b97c passed LTC: LLR: 3.07 (-2.94,2.94) <0.50,3.50> Total: 37336 W: 9456 L: 9191 D: 18689 Ptnml(0-2): 20, 3810, 10747, 4067, 24 https://tests.stockfishchess.org/tests/view/615c75d99d256038a969b9b2 closes official-stockfish/Stockfish#3731 Bench: 6261865
f37e078
to
ef6b4a4
Compare
Thanks for the suggestion. I have measured the speed of these two versions (running two benches at depth 20 in parallel):
Version B is 0.3% slower than version A. I suspect that in both cases the time is dominated by the test, instead of the polynomial evaluation. However version A may use an optimized implementation for std::min while version B cannot avoid the branch. |
This patch updates the stat_bonus() function (used in the history tables to help move ordering), keeping the same quadratic for small depths but changing the values for depth >= 9: The old bonus formula was increasing from zero at depth 1 to 4100 at depth 14, then used the strange, small value of 73 for all depths >= 15. The new bonus formula increases from 0 at depth 1 to 2000 at depth 8, then keeps 2000 for all depths >= 8. passed STC: LLR: 2.94 (-2.94,2.94) <-0.50,2.50> Total: 169624 W: 42875 L: 42454 D: 84295 Ptnml(0-2): 585, 19340, 44557, 19729, 601 https://tests.stockfishchess.org/tests/view/615bd69e9d256038a969b97c passed LTC: LLR: 3.07 (-2.94,2.94) <0.50,3.50> Total: 37336 W: 9456 L: 9191 D: 18689 Ptnml(0-2): 20, 3810, 10747, 4067, 24 https://tests.stockfishchess.org/tests/view/615c75d99d256038a969b9b2 closes official-stockfish#3731 Bench: 6261865
Seems that after pull official-stockfish#3731 (Capping stat bonus at 2000) this heuristic is no more useful. STC: https://tests.stockfishchess.org/tests/view/61b8d0e2dffbe89a35815444 LLR: 2.94 (-2.94,2.94) <-2.25,0.25> Total: 30672 W: 7974 L: 7812 D: 14886 Ptnml(0-2): 106, 3436, 8072, 3634, 88 LTC: https://tests.stockfishchess.org/tests/view/61b8e90cdffbe89a35815a67 LLR: 2.94 (-2.94,2.94) <-2.25,0.25> Total: 42448 W: 10884 L: 10751 D: 20813 Ptnml(0-2): 23, 4394, 12267, 4507, 33 bench: 4801890
Seems that after pull official-stockfish#3731 (Capping stat bonus at 2000) this heuristic is no more useful. STC: https://tests.stockfishchess.org/tests/view/61b8d0e2dffbe89a35815444 LLR: 2.94 (-2.94,2.94) <-2.25,0.25> Total: 30672 W: 7974 L: 7812 D: 14886 Ptnml(0-2): 106, 3436, 8072, 3634, 88 LTC: https://tests.stockfishchess.org/tests/view/61b8e90cdffbe89a35815a67 LLR: 2.94 (-2.94,2.94) <-2.25,0.25> Total: 42448 W: 10884 L: 10751 D: 20813 Ptnml(0-2): 23, 4394, 12267, 4507, 33 bench: 4801890
Seems that after pull request #3731 (Capping stat bonus at 2000) this heuristic is no longer useful. STC: https://tests.stockfishchess.org/tests/view/61b8d0e2dffbe89a35815444 LLR: 2.94 (-2.94,2.94) <-2.25,0.25> Total: 30672 W: 7974 L: 7812 D: 14886 Ptnml(0-2): 106, 3436, 8072, 3634, 88 LTC: https://tests.stockfishchess.org/tests/view/61b8e90cdffbe89a35815a67 LLR: 2.94 (-2.94,2.94) <-2.25,0.25> Total: 42448 W: 10884 L: 10751 D: 20813 Ptnml(0-2): 23, 4394, 12267, 4507, 33 closes #3853 bench: 4474950
This patch updates the stat_bonus() function (used in the history tables to
help move ordering), keeping the same quadratic for small depths but changing
the values for depth >= 9:
The old bonus formula was increasing from zero at depth 1 to 4100 at depth 14,
then used the strange, small value of 73 for all depths >= 15.
The new bonus formula increases from 0 at depth 1 to 2000 at depth 8, then
keep 2000 for all depths >= 8.
passed STC:
LLR: 2.94 (-2.94,2.94) <-0.50,2.50>
Total: 169624 W: 42875 L: 42454 D: 84295
Ptnml(0-2): 585, 19340, 44557, 19729, 601
https://tests.stockfishchess.org/tests/view/615bd69e9d256038a969b97c
passed LTC:
LLR: 3.07 (-2.94,2.94) <0.50,3.50>
Total: 37336 W: 9456 L: 9191 D: 18689
Ptnml(0-2): 20, 3810, 10747, 4067, 24
https://tests.stockfishchess.org/tests/view/615c75d99d256038a969b9b2
closes #3731
Bench: 6261865