Skip to content

Commit

Permalink
Adjust return value in qsearch after fail high
Browse files Browse the repository at this point in the history
Instead of returning strict fail soft fail high return value between value from
search and beta (somewhat by analogy to futility pruning and probcut).

This seems to be somewhat depth sensitive heuristic which performed much worse
at LTC while performing much better at STC if it is more aggressive, passed
version is the least aggressive one.

Passed STC:
https://tests.stockfishchess.org/tests/view/657b06414d789acf40ab1475
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 212352 W: 53900 L: 53315 D: 105137
Ptnml(0-2): 809, 25236, 53520, 25783, 828

Passed LTC:
https://tests.stockfishchess.org/tests/view/657ce36f393ac02e79120a7c
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 319362 W: 79541 L: 78630 D: 161191
Ptnml(0-2): 202, 35839, 86709, 36708, 223

closes official-stockfish#4928

Bench: 974739
  • Loading branch information
Vizvezdenec authored and Disservin committed Dec 19, 2023
1 parent a069a1b commit 9be0360
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,9 @@ Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) {
return mated_in(ss->ply); // Plies to mate from the root
}

if (abs(bestValue) < VALUE_TB_WIN_IN_MAX_PLY)
bestValue = bestValue >= beta ? (3 * bestValue + beta) / 4 : bestValue;

// Save gathered info in transposition table
tte->save(posKey, value_to_tt(bestValue, ss->ply), pvHit,
bestValue >= beta ? BOUND_LOWER : BOUND_UPPER, ttDepth, bestMove, ss->staticEval);
Expand Down

0 comments on commit 9be0360

Please sign in to comment.