1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Don't score as an immediate draw 2-fold repetitions of the root position

In the current version a search stops when the current position is the same as
any position earlier in the search stack,
including the root position but excluding positions before the root.
The new version makes an exception for repeating the root position.

This gives correct scores for moves in the MultiPV > 1 mode.

Fixes #948 (see it for the detailed description of the bug).

LTC: http://tests.stockfishchess.org/tests/view/587910bc0ebc5915193f754b
ELO: 0.38 +-1.7 (95%) LOS: 66.8%
Total: 40000 W: 5166 L: 5122 D: 29712

STC: http://tests.stockfishchess.org/tests/view/5922e6230ebc59035df34a50
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 94622 W: 17059 L: 17064 D: 60499

 LTC: http://tests.stockfishchess.org/tests/view/59273a000ebc59035df34c03
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 61259 W: 7965 L: 7897 D: 45397

Bench: 6599721

Closes #1126
This commit is contained in:
atumanian 2017-06-06 10:13:10 -07:00 committed by Joona Kiiski
parent 1781439fc2
commit 6d89d0b64a

View file

@ -1100,10 +1100,10 @@ bool Position::is_draw(int ply) const {
stp = stp->previous->previous;
// At root position ply is 1, so return a draw score if a position
// repeats once earlier but after or at the root, or repeats twice
// strictly before the root.
// repeats once earlier but strictly after the root, or repeats twice
// before or at the root.
if ( stp->key == st->key
&& ++cnt + (ply - i > 0) == 2)
&& ++cnt + (ply - 1 > i) == 2)
return true;
}