1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Simplify 50 move rule dampening

Refactor the logic of 50 move rule dampening by removing a constant.

Passed non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 35232 W: 9214 L: 8992 D: 17026
Ptnml(0-2): 114, 4081, 8999, 4313, 109
https://tests.stockfishchess.org/tests/view/665a329013d08af3c1725610

Passed non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 38406 W: 9732 L: 9530 D: 19144
Ptnml(0-2): 14, 4132, 10708, 4336, 13
https://tests.stockfishchess.org/tests/view/665a370913d08af3c1725651

https://github.com/official-stockfish/Stockfish/pull/5327

Bench: 1059739
This commit is contained in:
MinetaS 2024-06-01 06:11:51 +09:00 committed by Joost VandeVondele
parent ec1cda1d81
commit 180cab4438

View file

@ -81,10 +81,10 @@ Value Eval::evaluate(const Eval::NNUE::Networks& networks,
int material = 300 * pos.count<PAWN>() + 350 * pos.count<KNIGHT>() + 400 * pos.count<BISHOP>() int material = 300 * pos.count<PAWN>() + 350 * pos.count<KNIGHT>() + 400 * pos.count<BISHOP>()
+ 640 * pos.count<ROOK>() + 1200 * pos.count<QUEEN>(); + 640 * pos.count<ROOK>() + 1200 * pos.count<QUEEN>();
v = (nnue * (34300 + material) + optimism * (4400 + material)) / 35967; v = (nnue * (34300 + material) + optimism * (4400 + material)) / 36672;
// Damp down the evaluation linearly when shuffling // Damp down the evaluation linearly when shuffling
v = v * (204 - pos.rule50_count()) / 208; v -= v * pos.rule50_count() / 212;
// Guarantee evaluation does not hit the tablebase range // Guarantee evaluation does not hit the tablebase range
v = std::clamp(v, VALUE_TB_LOSS_IN_MAX_PLY + 1, VALUE_TB_WIN_IN_MAX_PLY - 1); v = std::clamp(v, VALUE_TB_LOSS_IN_MAX_PLY + 1, VALUE_TB_WIN_IN_MAX_PLY - 1);