Merge remote-tracking branch 'upstream/master'
Tweak quiet move bonus Improving quiet move bonus by replacing bestvalue and alpha comparison, with checking the statScore of the previous search step instead. Inspired by @locutus2 Passed STC: https://tests.stockfishchess.org/tests/view/657f22fb893104ee25b614e8 LLR: 2.96 (-2.94,2.94) <0.00,2.00> Total: 51296 W: 13121 L: 12774 D: 25401 Ptnml(0-2): 225, 5986, 12868, 6355, 214 Passed LTC: https://tests.stockfishchess.org/tests/view/658024a2893104ee25b62587 LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 82758 W: 20606 L: 20189 D: 41963 Ptnml(0-2): 51, 9149, 22555, 9580, 44 closes https://github.com/official-stockfish/Stockfish/pull/4930 Bench: 1312822
Adjust return value in qsearch after fail high 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 https://github.com/official-stockfish/Stockfish/pull/4928 Bench: 974739
Use std::abs over abs closes https://github.com/official-stockfish/Stockfish/pull/4926 closes https://github.com/official-stockfish/Stockfish/pull/4909 No functional change Co-Authored-By: fffelix-huang <72808219+fffelix-huang@users.noreply.github.com>
Improvement of Time Management Parameters Passed STC: https://tests.stockfishchess.org/tests/view/6579c5574d789acf40aaf914 LLR: 2.93 (-2.94,2.94) <0.00,2.00> Total: 44672 W: 11354 L: 11030 D: 22288 Ptnml(0-2): 140, 5033, 11685, 5319, 159 Passed LTC: https://tests.stockfishchess.org/tests/view/657ad7f44d789acf40ab105e LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 40932 W: 10275 L: 9950 D: 20707 Ptnml(0-2): 21, 4316, 11473, 4629, 27 Passed non-regression Sudden death 10+0: https://tests.stockfishchess.org/tests/view/657b9b9e393ac02e7911f1a8 LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 21384 W: 5171 L: 4925 D: 11288 Ptnml(0-2): 112, 2420, 5409, 2612, 139 closes https://github.com/official-stockfish/Stockfish/pull/4923 No functional change
Adjust stand pat in qsearch on pv nodes Instead of immediately returning a fail high do this only at non-pv nodes, for pv nodes adjust bestValue to value between alpha and beta and continue searching. Idea is to do it the same way as it's done in search where we don't return positive beta cutoffs after ttHits / zero window search at PvNodes and instead fully search lines. Passed STC: https://tests.stockfishchess.org/tests/view/65739b0af09ce1261f122f33 LLR: 2.94 (-2.94,2.94) <0.00,2.00> Total: 189216 W: 48142 L: 47598 D: 93476 Ptnml(0-2): 584, 22463, 48051, 22845, 665 Passed LTC: https://tests.stockfishchess.org/tests/view/657701214d789acf40aac194 LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 82506 W: 20689 L: 20269 D: 41548 Ptnml(0-2): 56, 9236, 22268, 9618, 75 Two issues had to be resolved: - in rare cases it set alpha to the same value as beta and thus broke some asserts; - messed up with returning tb win values. Fix passed non-regression LTC vs this patch: https://tests.stockfishchess.org/tests/view/6578113b4d789acf40aad544 LLR: 2.96 (-2.94,2.94) <-1.75,0.25> Total: 277308 W: 68839 L: 68880 D: 139589 Ptnml(0-2): 167, 31580, 75212, 31517, 178 closes https://github.com/official-stockfish/Stockfish/pull/4922 Bench: 1069503 Co-Authored-By: Muzhen Gaming <61100393+XInTheDark@users.noreply.github.com> Co-Authored-By: Shahin M. Shahin <41402573+peregrineshahin@users.noreply.github.com> Co-Authored-By: fffelix-huang <72808219+fffelix-huang@users.noreply.github.com>
Remove UCI_AnalyseMode Option Simplify away the useless option, as documented: "An option handled by your GUI. This currently doesn't do anything." The option was originally added with the introduction of contempt (https://github.com/official-stockfish/Stockfish/commit/e9aeaad05266ca557a9496b5a17b4c5f82f0e946), but it is now no longer used. closes https://github.com/official-stockfish/Stockfish/pull/4918 No functional change
Remove SlowMover Option The SlowMover option allows users to modify the timeLeft variant, impacting the engine's time management. However, this feature, while theoretically flexible, doesn't offer substantial benefits. Instead, it introduces the risk of non-experienced users altering values without a clear understanding of the effects, potentially leading to a weaker engine. The vast majority of SF users don't use it anyway, and based on tests conducted by fauzi several months ago suggest that changing it would only lose Elo. Examples: https://tests.stockfishchess.org/tests/view/651f309bac57711436726bba https://tests.stockfishchess.org/tests/view/651fea29ac57711436727d85 https://tests.stockfishchess.org/tests/view/65257c343125598fc7eb68a1 https://tests.stockfishchess.org/tests/view/652296c83125598fc7eb2ad7 Tune: https://tests.stockfishchess.org/tests/view/652a70313125598fc7ebd706 (keeping the value at 100, zz2) closes https://github.com/official-stockfish/Stockfish/pull/4917 No functional change
Add loongarch64 support Adding support for LoongArch64 architecture. Tested on Loongson 3A6000 EVB Board. Since Loongson's SIMD extended instruction set ([LSX](https://gcc.gnu.org/onlinedocs/gcc/LoongArch-SX-Vector-Intrinsics.html), [LASX](https://gcc.gnu.org/onlinedocs/gcc/LoongArch-ASX-Vector-Intrinsics.html)) is already supported by GCC, more optimizations are being developed. Here's the benchmark result for Loongson 3A6000 (4c8t, 2.5Ghz) without SIMD optimizations. ``` Total time (ms) : 17903 Nodes searched : 1244386 Nodes/second : 69507 ``` closes https://github.com/official-stockfish/Stockfish/pull/4913 No functional change
Track seldepth in qsearch too Sometimes if we count the reported PV length, it turns out to be longer than the selective depth reported. This fixes this behavior by applying the selective depth to qsearch since we do report PVs from it as well. Passed non-regression STC: https://tests.stockfishchess.org/tests/view/656cf5b66980e15f69c7499d LLR: 2.96 (-2.94,2.94) <-1.75,0.25> Total: 223648 W: 56372 L: 56356 D: 110920 Ptnml(0-2): 710, 25580, 59231, 25590, 713 closes https://github.com/official-stockfish/Stockfish/pull/4903 No functional change
Fix TB score output in UCI without using TB This is a rewrite of the fix introduced for https://github.com/official-stockfish/Stockfish/issues/4413 in https://github.com/official-stockfish/Stockfish/pull/4591 by @windfishballad it targets only the relevant part of this issue that returns TB scores (CP 20000) without using TB due to the downgrading of potentially false mates from the TT to an optimal TB score. the difference is that it is a much clearer code that introduces a separate TB_VALUE constant to account for a correct distance from the TB_VALUE with MAX_PLY. the originally posted position in the issue does not trigger the problem anymore, so here is a new position to test: ``` position fen 3k4/8/8/8/8/8/3BN3/3K4 w - - 0 1 go infinite ``` Passed non-regression STC: https://tests.stockfishchess.org/tests/view/65578994136acbc57353b258 LLR: 2.96 (-2.94,2.94) <-1.75,0.25> Total: 119264 W: 29993 L: 29863 D: 59408 Ptnml(0-2): 372, 13692, 31379, 13812, 377 Passed non-regression LTC: https://tests.stockfishchess.org/tests/view/6558323f136acbc57353c1ca LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 237834 W: 58791 L: 58792 D: 120251 Ptnml(0-2): 193, 26200, 66111, 26241, 172 fixes https://github.com/official-stockfish/Stockfish/issues/4413 closes https://github.com/official-stockfish/Stockfish/pull/4591 closes https://github.com/official-stockfish/Stockfish/pull/4882 Bench: 1305821
VLTC Search parameters tune The SPSA tuning was done for 44k games at 120+1.2. https://tests.stockfishchess.org/tests/view/656ee2a76980e15f69c7767f. Note that the tune was originally done in combination with the recent dual NNUE idea (see #4910). VLTC: https://tests.stockfishchess.org/tests/view/65731ccbf09ce1261f12246e LLR: 2.95 (-2.94,2.94) <0.00,2.00> Total: 52806 W: 13069 L: 12760 D: 26977 Ptnml(0-2): 19, 5498, 15056, 5815, 15 VLTC SMP: https://tests.stockfishchess.org/tests/view/65740ffaf09ce1261f1239ba LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 27630 W: 6934 L: 6651 D: 14045 Ptnml(0-2): 1, 2643, 8243, 2928, 0 Estimated close to neutral at LTC: https://tests.stockfishchess.org/tests/view/6575485a8ec68176cf7d9423 Elo: -0.59 ± 1.8 (95%) LOS: 26.6% Total: 32060 W: 7859 L: 7913 D: 16288 Ptnml(0-2): 20, 3679, 8676, 3645, 10 nElo: -1.21 ± 3.8 (95%) PairsRatio: 0.99 closes https://github.com/official-stockfish/Stockfish/pull/4912 Bench: 1283323
Remove moveMalus Passed STC: https://tests.stockfishchess.org/tests/view/656e0bb86980e15f69c763fa LLR: 3.15 (-2.94,2.94) <-1.75,0.25> Total: 123008 W: 30973 L: 30831 D: 61204 Ptnml(0-2): 368, 14032, 32568, 14162, 374 closes https://github.com/official-stockfish/Stockfish/pull/4905 No functional change
Remove cutNode condition cutNode condition seems to be irrelevant. Passed STC: LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 24224 W: 6206 L: 5970 D: 12048 Ptnml(0-2): 69, 2818, 6122, 3014, 89 https://tests.stockfishchess.org/tests/view/65686910136acbc5735529ec Passed LTC: LLR: 2.96 (-2.94,2.94) <-1.75,0.25> Total: 236538 W: 58624 L: 58622 D: 119292 Ptnml(0-2): 136, 26955, 64091, 26945, 142 https://tests.stockfishchess.org/tests/view/6568925a136acbc573552d8f closes https://github.com/official-stockfish/Stockfish/pull/4901 Bench: 1244386
Tweak return value in futility pruning In futility pruning, return the average between eval and beta. Passed STC: https://tests.stockfishchess.org/tests/view/65680bb6136acbc5735521d7 LLR: 2.93 (-2.94,2.94) <0.00,2.00> Total: 15200 W: 3926 L: 3642 D: 7632 Ptnml(0-2): 36, 1699, 3867, 1941, 57 Passed LTC: https://tests.stockfishchess.org/tests/view/656817fc136acbc573552304 LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 200376 W: 49700 L: 49036 D: 101640 Ptnml(0-2): 110, 22584, 54137, 23246, 111 closes https://github.com/official-stockfish/Stockfish/pull/4897 Bench: 1403703
Remove recaptures stage in qsearch Simplify an old commit https://github.com/official-stockfish/Stockfish/commit/72760c05c64d1fb2bb71c2ac54acfbeecf513b87. Search is not stuck on the test position given r1n1n1b1/1P1P1P1P/1N1N1N2/2RnQrRq/2pKp3/3BNQbQ/k7/4Bq2 w - - 0 1 Passed STC: https://tests.stockfishchess.org/tests/view/6567050d136acbc573550919 LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 236160 W: 59475 L: 59475 D: 117210 Ptnml(0-2): 841, 28266, 59816, 28366, 791 Passed LTC: https://tests.stockfishchess.org/tests/view/6567d133136acbc573551c78 LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 201690 W: 49630 L: 49593 D: 102467 Ptnml(0-2): 128, 23214, 54122, 23255, 126 closes https://github.com/official-stockfish/Stockfish/pull/4896 Bench: 1604361
Skip LMR for 2nd move at the root only This patch reverts commit by Vizvezdenec: https://github.com/official-stockfish/Stockfish/commit/27139dedac14af400f5b18e2ab50aca3f8cf0e33 Passed STC: https://tests.stockfishchess.org/tests/view/65660b4a136acbc57354f13d LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 301952 W: 76271 L: 76344 D: 149337 Ptnml(0-2): 1053, 36293, 76348, 36238, 1044 Passed LTC: https://tests.stockfishchess.org/tests/view/656738ab136acbc573550e39 LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 25050 W: 6283 L: 6063 D: 12704 Ptnml(0-2): 10, 2756, 6775, 2972, 12 closes https://github.com/official-stockfish/Stockfish/pull/4895 Bench: 1722961
Simplify quietMoveMalus malus Use a simple depth instead of depth + 1 in the quietMoveMalus formula. Passed STC: https://tests.stockfishchess.org/tests/view/65636bf0136acbc57354b662 LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 105248 W: 26680 L: 26532 D: 52036 Ptnml(0-2): 409, 12590, 26481, 12732, 412 Passed LTC: https://tests.stockfishchess.org/tests/view/6563b5db136acbc57354bcab LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 204204 W: 50200 L: 50166 D: 103838 Ptnml(0-2): 123, 23331, 55145, 23395, 108 closes https://github.com/official-stockfish/Stockfish/pull/4893 Bench: 1717495