Commit d4d04a8
fix endgame solver timeout handling for also-solve-move
This fixes a bug where the endgame solver would fail when using
SetAlsoSolveMove (used by the analyzer for volunteer mode) if the
main solve timed out before completing all requested plies.
The issue had three parts:
1. When the main solve timed out at (say) ply 7 after completing ply 6,
it would try to solve the also-solve move using the expired context,
which would immediately fail.
2. Even if it succeeded, the also-solve move would be solved at ply 7
while the best move was only solved to ply 6, making results
incomparable.
3. The best move from the partial solve wasn't saved to variations,
so the also-solve move would incorrectly become the "best" move.
The fix:
- Track lastCompletedPly in all three parallel algorithms (ABDADA,
LazySMP, TreeSplit) to know what depth was actually completed
- When solving also-solve move after a timeout, use the same completed
ply depth as the best move to ensure comparable results
- Create a fresh 60-second timeout context specifically for solving
the also-solve move, since the original context has expired
- Save the best move to variations before breaking on timeout, so it
doesn't get lost when also-solve move is added to variations
This ensures both moves are solved to the same depth and results are
properly comparable for spread loss calculation.
Also updated endgame.txt helptext to document the timeout behavior.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 04a4768 commit d4d04a8
2 files changed
+47
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
| |||
526 | 529 | | |
527 | 530 | | |
528 | 531 | | |
| 532 | + | |
| 533 | + | |
529 | 534 | | |
530 | 535 | | |
531 | 536 | | |
| |||
689 | 694 | | |
690 | 695 | | |
691 | 696 | | |
| 697 | + | |
| 698 | + | |
692 | 699 | | |
693 | 700 | | |
694 | 701 | | |
| |||
911 | 918 | | |
912 | 919 | | |
913 | 920 | | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
914 | 924 | | |
915 | 925 | | |
916 | 926 | | |
| |||
1145 | 1155 | | |
1146 | 1156 | | |
1147 | 1157 | | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
1148 | 1164 | | |
1149 | 1165 | | |
1150 | 1166 | | |
| |||
1181 | 1197 | | |
1182 | 1198 | | |
1183 | 1199 | | |
1184 | | - | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
1185 | 1217 | | |
1186 | 1218 | | |
1187 | 1219 | | |
1188 | 1220 | | |
| 1221 | + | |
| 1222 | + | |
1189 | 1223 | | |
1190 | 1224 | | |
1191 | 1225 | | |
| |||
1655 | 1689 | | |
1656 | 1690 | | |
1657 | 1691 | | |
| 1692 | + | |
1658 | 1693 | | |
1659 | 1694 | | |
1660 | 1695 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
130 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
0 commit comments