]> git.sesse.net Git - stockfish/log
stockfish
3 years agoRetuned values after eval quantize patch.
xoto10 [Sun, 14 Jun 2020 20:50:27 +0000 (21:50 +0100)]
Retuned values after eval quantize patch.

The last search tune patch was tested before the implementation of #2733 which
presumably changed the search characteristics noticeably. Another tuning run was
done, see https://tests.stockfishchess.org/tests/view/5ee5b434ca6c451633a9a08c
and the updated values passed these tests:

STC:
LLR: 2.93 (-2.94,2.94) {-0.50,1.50}
Total: 34352 W: 6600 L: 6360 D: 21392
Ptnml(0-2): 581, 3947, 7914, 4119, 615
https://tests.stockfishchess.org/tests/view/5ee62f05ca6c451633a9a15f

LTC 60+0.6 th 1 :
LLR: 2.97 (-2.94,2.94) {0.25,1.75}
Total: 11176 W: 1499 L: 1304 D: 8373
Ptnml(0-2): 69, 933, 3403, 1100, 83
https://tests.stockfishchess.org/tests/view/5ee6205bca6c451633a9a147

SMP LTC 20+0.2 th 8 :
LLR: 2.93 (-2.94,2.94) {0.25,1.75}
Total: 54032 W: 6126 L: 5826 D: 42080
Ptnml(0-2): 278, 4454, 17280, 4698, 306
https://tests.stockfishchess.org/tests/view/5ee62f25ca6c451633a9a162

Closes https://github.com/official-stockfish/Stockfish/pull/2742

Bench 4957812

3 years agoTuned values for search constants
xoto10 [Sat, 13 Jun 2020 08:54:07 +0000 (09:54 +0100)]
Tuned values for search constants

Tuned search constants after many search patches since the last
successful tune.

1st LTC @ 60+0.6 th 1 :
LLR: 2.97 (-2.94,2.94) {0.25,1.75}
Total: 57656 W: 7369 L: 7036 D: 43251
Ptnml(0-2): 393, 5214, 17336, 5437, 448
https://tests.stockfishchess.org/tests/view/5ee1e074f29b40b0fc95af19

SMP LTC @ 20+0.2 th 8 :
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 83576 W: 9731 L: 9341 D: 64504
Ptnml(0-2): 464, 7062, 26369, 7406, 487
https://tests.stockfishchess.org/tests/view/5ee35a21f29b40b0fc95b008

The changes were rebased on top of a successful patch by Viz (see #2734)
and two different ways of doing this were tested. The successful test
modified the constants in the patch by Viz in a similar manner to the
tuning run:

LTC (rebased) @ 60+0.6 th 1 :
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 193384 W: 24241 L: 23521 D: 145622
Ptnml(0-2): 1309, 17497, 58472, 17993, 1421
https://tests.stockfishchess.org/tests/view/5ee43319ca6c451633a995f9

Further work: the recent patch to quantize eval #2733 affects search quit
quite a bit, so doing another tune in, say, three months time might be a
good idea.

closes https://github.com/official-stockfish/Stockfish/pull/2735

Bench 4246971

3 years agoQuantize eval to multiples of 16
Joost VandeVondele [Wed, 10 Jun 2020 11:19:21 +0000 (13:19 +0200)]
Quantize eval to multiples of 16

Removes some excess precision, helps searchs.

Effectively reintroduces evaluation grain, with a slightly different context.
https://github.com/official-stockfish/Stockfish/commit/45dbd9cd0303d0db469670af8ec3598731a4eace

passed STC
LLR: 2.97 (-2.94,2.94) {-0.50,1.50}
Total: 197032 W: 37938 L: 37462 D: 121632
Ptnml(0-2): 3359, 22994, 45446, 23246, 3471
https://tests.stockfishchess.org/tests/view/5ee0c228f29b40b0fc95ae53

passed LTC
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 77696 W: 9970 L: 9581 D: 58145
Ptnml(0-2): 530, 7075, 23311, 7340, 592
https://tests.stockfishchess.org/tests/view/5ee21426f29b40b0fc95af43

passed LTC SMP
LLR: 2.96 (-2.94,2.94) {0.25,1.75}
Total: 64136 W: 7425 L: 7091 D: 49620
Ptnml(0-2): 345, 5416, 20228, 5718, 361
https://tests.stockfishchess.org/tests/view/5ee387bbf29b40b0fc95b04c

closes https://github.com/official-stockfish/Stockfish/pull/2733

Bench: 4939103

3 years agoAdjust history threshold for quiet moves futility pruning
Vizvezdenec [Sat, 13 Jun 2020 02:03:59 +0000 (05:03 +0300)]
Adjust history threshold for quiet moves futility pruning

This patch adjusts the threshold for futility pruning of quiet moves
using the continuation history array contHist[5], in the same way as
it is used in movepicker.

passed STC:
https://tests.stockfishchess.org/tests/view/5ee3f88bca6c451633a9959f
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 55984 W: 10822 L: 10552 D: 34610
Ptnml(0-2): 952, 6435, 12941, 6719, 945

passed LTC:
https://tests.stockfishchess.org/tests/view/5ee4186dca6c451633a995cf
LLR: 2.96 (-2.94,2.94) {0.25,1.75}
Total: 41712 W: 5402 L: 5114 D: 31196
Ptnml(0-2): 293, 3766, 12469, 4016, 312

closes https://github.com/official-stockfish/Stockfish/pull/2734

Bench: 4715960

3 years agoImprove the anti-shuffling policy
Stéphane Nicolet [Tue, 9 Jun 2020 22:10:07 +0000 (00:10 +0200)]
Improve the anti-shuffling policy

We replace the current decrease of the complexity term in initiative
when shuffling by a direct damping of the evaluation. This scheme may
have two benefits over the initiative approach:

a) the damping effect is more brutal for fortresses with heavy pieces
   on the board, because the initiative term is almost an endgame term;

b) the initiative implementation had a funny side effect, almost a bug,
   in the rare positions where mg > 0, eg < 0 and the tampered eval
   returned a positive value (ie with heavy pieces still on the board):
   sending eg to zero via shuffling would **increase** the tampered
   eval instead of decreasing it, which is somewhat illogical. This
   patch avoids this phenomenon.

STC:
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 43072 W: 8373 L: 8121 D: 26578
Ptnml(0-2): 729, 4954, 9940, 5162, 751
https://tests.stockfishchess.org/tests/view/5ee008ebf29b40b0fc95ade2

LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 37376 W: 4816 L: 4543 D: 28017
Ptnml(0-2): 259, 3329, 11286, 3508, 306
https://tests.stockfishchess.org/tests/view/5ee03b06f29b40b0fc95ae0c

Closes https://github.com/official-stockfish/Stockfish/pull/2727

Bench: 4757174

3 years agoIncrease the maximum hash size by a factor of 256
Sami Kiminki [Fri, 5 Jun 2020 17:17:00 +0000 (20:17 +0300)]
Increase the maximum hash size by a factor of 256

Conceptually group hash clusters into super clusters of 256 clusters.
This scheme allows us to use hash sizes up to 32 TB
(= 2^32 super clusters = 2^40 clusters).

Use 48 bits of the Zobrist key to choose the cluster index. We use 8
extra bits to mitigate the quantization error for very large hashes when
scaling the hash key to cluster index.

The hash index computation is organized to be compatible with the existing
scheme for power-of-two hash sizes up to 128 GB.

Fixes https://github.com/official-stockfish/Stockfish/issues/1349

closes https://github.com/official-stockfish/Stockfish/pull/2722

Passed non-regression STC:
LLR: 2.93 (-2.94,2.94) {-1.50,0.50}
Total: 37976 W: 7336 L: 7211 D: 23429
Ptnml(0-2): 578, 4295, 9149, 4356, 610
https://tests.stockfishchess.org/tests/view/5edcbaaef29b40b0fc95abc5

No functional change.

3 years agoImprove Readme.md about compiling
nguyenpham [Sun, 7 Jun 2020 22:49:27 +0000 (08:49 +1000)]
Improve Readme.md about compiling

Reparagraph, add an example how to compile on Unix-like systems

closes https://github.com/official-stockfish/Stockfish/pull/2724

No functional change

3 years agoshow coordinates when displaying board
NguyenPham [Sun, 7 Jun 2020 21:48:38 +0000 (07:48 +1000)]
show coordinates when displaying board

closes https://github.com/official-stockfish/Stockfish/pull/2723

No functional change

3 years agoRefactor some threads related code.
protonspring [Mon, 1 Jun 2020 05:31:14 +0000 (23:31 -0600)]
Refactor some threads related code.

This is a code style change that moves some pure thread code into the threads class.

It is a bit more code, but it makes search.cpp cleaner and easier to read by hiding some thread specific functionality.

STC (SMP)
LLR: 2.93 (-2.94,2.94) {-1.50,0.50}
Total: 75896 W: 12073 L: 12026 D: 51797
Ptnml(0-2): 828, 8224, 19872, 8121, 903
https://tests.stockfishchess.org/tests/view/5ed492e8f29b40b0fc95a74c

closes https://github.com/official-stockfish/Stockfish/pull/2720

No functional change.

3 years agoWrap all access to LineBB and add assert
protonspring [Sun, 7 Jun 2020 03:25:32 +0000 (21:25 -0600)]
Wrap all access to LineBB and add assert

This is a non-functional code style change which provides a safe access handler for LineBB.
Also includes an assert in debug mode to verify square correctness.

closes https://github.com/official-stockfish/Stockfish/pull/2719

No functional change

3 years agojoin scale_factor, initiative and mg+eg reduction
xoto10 [Wed, 3 Jun 2020 10:05:58 +0000 (11:05 +0100)]
join scale_factor, initiative and mg+eg reduction

Merging this code into one function `winnable()`.
Should allow common concepts used to adjust the eg value,
either by addition or scaling, to be combined more effectively.

Improve trace function.

closes https://github.com/official-stockfish/Stockfish/pull/2710

No functional change.

3 years agoUse lowply-history also on low depths
pb00067 [Sat, 6 Jun 2020 10:56:38 +0000 (12:56 +0200)]
Use lowply-history also on low depths

STC:
https://tests.stockfishchess.org/tests/view/5ed75078f29b40b0fc95a8b9
LLR: 2.93 (-2.94,2.94) {-0.50,1.50}
Total: 73928 W: 14301 L: 14005 D: 45622
Ptnml(0-2): 1243, 8572, 17096, 8752, 1301

LTC:
https://tests.stockfishchess.org/tests/view/5ed895e0f29b40b0fc95a976
LLR: 2.93 (-2.94,2.94) {0.25,1.75}
Total: 154848 W: 19684 L: 19074 D: 116090
Ptnml(0-2): 1048, 14108, 46627, 14468, 1173

closes https://github.com/official-stockfish/Stockfish/pull/2718

bench: 4582693

3 years agosmall speed-up in movegen
protonspring [Thu, 4 Jun 2020 00:06:49 +0000 (18:06 -0600)]
small speed-up in movegen

pass color as a template parameter.

closes https://github.com/official-stockfish/Stockfish/pull/2715

No functional change.

3 years agoMinimal thinking time, even if only one rootMove.
Moez Jellouli [Sun, 31 May 2020 14:51:38 +0000 (16:51 +0200)]
Minimal thinking time, even if only one rootMove.

without search, the eval returned can be misleading (e.g. mate instead of draw),
leading to wrong adjudication. With a minimal search, this is avoided.
This patch leads to 1ms long searches if there is only 1 move,
similar patches all indicate a small Elo gain.

Fixes https://github.com/official-stockfish/Stockfish/issues/2707

Passed non-regression STC:
LLR: 2.93 (-2.94,2.94) {-1.50,0.50}
Total: 22312 W: 4350 L: 4204 D: 13758
Ptnml(0-2): 323, 2488, 5437, 2536, 372
https://tests.stockfishchess.org/tests/view/5ed562b0f29b40b0fc95a7d0

closes https://github.com/official-stockfish/Stockfish/pull/2709

Bench: 4733799

3 years agoSingular quiet LMR
Moez Jellouli [Tue, 2 Jun 2020 20:27:11 +0000 (22:27 +0200)]
Singular quiet LMR

If ttMove is a capture and had a singular extension, it is probably the best move.
No need to make a decrease of LMR on other moves.

STC
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 41968 W: 8170 L: 7918 D: 25880
Ptnml(0-2): 733, 4770, 9726, 5022, 733
https://tests.stockfishchess.org/tests/view/5ed6b666f29b40b0fc95a884

LTC
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 71376 W: 9200 L: 8827 D: 53349
Ptnml(0-2): 486, 6544, 21342, 6743, 573
https://tests.stockfishchess.org/tests/view/5ed7578bf29b40b0fc95a8c9

closes https://github.com/official-stockfish/Stockfish/pull/2713

Bench: 4733799

3 years agoGive bonus for bishops that are alligned with enemy kingring.
Stefan Geschwentner [Sun, 31 May 2020 15:00:47 +0000 (17:00 +0200)]
Give bonus for bishops that are alligned with enemy kingring.

Inspired by the succesful patch "Give bonus for rooks that are alligned with enemy kingring" from Vizvezdenec,
this idea has been reused for bishops. Here, we only consider attacks that are not blocked by any pawn.
Also we have a 50% higher bonus than for the rooks.

STC:
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 68960 W: 13495 L: 13202 D: 42263
Ptnml(0-2): 1213, 8018, 15802, 8157, 1290
https://tests.stockfishchess.org/tests/view/5ed27495042fa6d77c3553aa

LTC:
LLR: 2.96 (-2.94,2.94) {0.25,1.75}
Total: 54560 W: 7105 L: 6780 D: 40675
Ptnml(0-2): 379, 4986, 16254, 5253, 408
https://tests.stockfishchess.org/tests/view/5ed30375596e6dc1e1f97425

closes https://github.com/official-stockfish/Stockfish/pull/2708

Bench: 4860021

3 years agoIsolated pawns tweak
ElbertoOne [Sun, 31 May 2020 14:39:03 +0000 (16:39 +0200)]
Isolated pawns tweak

Give opposed doubled isolated pawns only the Doubled penalty.
The other isolated pawns get the Isolated penalty and the WeakUnopposed penalty.
The popcount condition has been replaced with an opposed check,
which is non-functional, but probably gives a speed-up.

Passed STC (https://tests.stockfishchess.org/tests/view/5ed0f0f0042fa6d77c3552f5):
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 121832 W: 23562 L: 23195 D: 75075
Ptnml(0-2): 2092, 14064, 28313, 14279, 2168

LTC: (https://tests.stockfishchess.org/tests/view/5ed22e40042fa6d77c355387)
LLR: 2.96 (-2.94,2.94) {0.25,1.75}
Total: 103368 W: 13232 L: 12768 D: 77368
Ptnml(0-2): 693, 9484, 30919, 9842, 746

closes https://github.com/official-stockfish/Stockfish/pull/2706

Bench: 4085694

3 years agoLess pruning in draw PV lines.
Joost VandeVondele [Thu, 28 May 2020 20:34:43 +0000 (22:34 +0200)]
Less pruning in draw PV lines.

no futility pruning for certain captures if the PvNode has a draw eval.

passed STC:
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 59392 W: 11576 L: 11302 D: 36514
Ptnml(0-2): 977, 6816, 13920, 6922, 1061
https://tests.stockfishchess.org/tests/view/5ed0b1bb042fa6d77c355295

passed LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 64040 W: 8273 L: 7923 D: 47844
Ptnml(0-2): 424, 5842, 19220, 6028, 506
https://tests.stockfishchess.org/tests/view/5ed145e0042fa6d77c35531c

closes https://github.com/official-stockfish/Stockfish/pull/2705

Bench: 4704615

3 years agoConsolidate all attacks bitboards
protonspring [Thu, 28 May 2020 15:48:31 +0000 (09:48 -0600)]
Consolidate all attacks bitboards

This is a non-functional simplification that simplifies getting attacks bitboards.

* consolidates all attacks to attacks_bb (remove Position::attacks_from(..)).
* attacks_bb<PieceType>(square) gets pseudo attacks
* attacks_bb<PieceType>(square, bitboard) gets attacks considering occupied squares in the bitboard).
* pawn_attacks_bb(Color, Square) gets pawn attacks like other pawn attack bitboards.
* Wraps all access to PawnAttacks arrays and PseudoAttacks arrays and adds asserts as appropriate.

Passed STC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 90208 W: 17533 L: 17482 D: 55193
Ptnml(0-2): 1412, 10232, 21798, 10217, 1445
https://tests.stockfishchess.org/tests/view/5ece996275787cc0c05d9790

closes https://github.com/official-stockfish/Stockfish/pull/2703

No functional change

3 years agoIn BlockedStorm, theirPawns includes ones attacked by us.
xoto10 [Mon, 25 May 2020 23:27:05 +0000 (00:27 +0100)]
In BlockedStorm, theirPawns includes ones attacked by us.

Pawns heading towards our king tend to be dangerous whether or not we are attacking them so remove this test.

STC:
LLR: 2.93 (-2.94,2.94) {-1.50,0.50}
Total: 91184 W: 18196 L: 18137 D: 54851
Ptnml(0-2): 1580, 10656, 21092, 10653, 1611
https://tests.stockfishchess.org/tests/view/5ecc3f7080f2c838b9655841

LTC:
LLR: 2.93 (-2.94,2.94) {-1.50,0.50}
Total: 14152 W: 2045 L: 1937 D: 10170
Ptnml(0-2): 99, 1325, 4130, 1413, 109
https://tests.stockfishchess.org/tests/view/5ecc4f3180f2c838b9655861

closes https://github.com/official-stockfish/Stockfish/pull/2702

Bench 4828973

3 years agoGive bonus for rooks that are alligned with enemy kingring
Vizvezdenec [Mon, 25 May 2020 18:14:07 +0000 (21:14 +0300)]
Give bonus for rooks that are alligned with enemy kingring

The idea of this patch is that if rooks are not directly attacking the opponent king,
they can support king attacks staying behind pawns or minor pieces and be really
deadly if position slightly opens up at enemy king ring ranks. Loosely based on
some stockfish games where it underestimated attacks on it king when enemy has one
or two rooks supporting pawn pushes towards it king.

passed STC
https://tests.stockfishchess.org/tests/view/5ecb093680f2c838b96550f9
LLR: 2.93 (-2.94,2.94) {-0.50,1.50}
Total: 53672 W: 10535 L: 10265 D: 32872
Ptnml(0-2): 952, 6210, 12258, 6448, 968

passed LTC
https://tests.stockfishchess.org/tests/view/5ecb639f80f2c838b9655117
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 62424 W: 8094 L: 7748 D: 46582
Ptnml(0-2): 426, 5734, 18565, 6042, 445

closes https://github.com/official-stockfish/Stockfish/pull/2700

Bench: 4663220

3 years agoRemove attacked pawns from storm evaluation
Moez Jellouli [Sat, 23 May 2020 23:54:37 +0000 (01:54 +0200)]
Remove attacked pawns from storm evaluation

STC:
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 54456 W: 11009 L: 10737 D: 32710
Ptnml(0-2): 929, 6326, 12523, 6444, 1006
https://tests.stockfishchess.org/tests/view/5ec962e4404591b2793008a5

LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 62448 W: 9018 L: 8664 D: 44766
Ptnml(0-2): 462, 5928, 18121, 6220, 493
https://tests.stockfishchess.org/tests/view/5ec976a8a586eee45aa2ab40

Non regression STC with "noob_3moves.epd" opening book
LLR: 3.81 (-2.94,2.94) {-1.50,0.50}
Total: 91896 W: 17770 L: 17653 D: 56473
Ptnml(0-2): 1598, 10782, 21124, 10793, 1651
https://tests.stockfishchess.org/tests/view/5ec9b83ea586eee45aa2ab96

closes https://github.com/official-stockfish/Stockfish/pull/2698

Bench 4488597

3 years agoRemove and replace DoubledIsolated penalty by Doubled
ElbertoOne [Sat, 23 May 2020 11:14:02 +0000 (13:14 +0200)]
Remove and replace DoubledIsolated penalty by Doubled

The values for both penalties were very close, so DoubledIsolated can be removed and replaced by Doubled.

Passed STC (simplification): https://tests.stockfishchess.org/tests/view/5ec7c18e2a585b485af54407
LLR: 2.97 (-2.94,2.94) {-1.50,0.50}
Total: 105360 W: 20175 L: 20136 D: 65049
Ptnml(0-2): 1803, 12230, 24572, 12275, 1800

Passed LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 15440 W: 1978 L: 1877 D: 11585
Ptnml(0-2): 92, 1405, 4667, 1422, 134

closes https://github.com/official-stockfish/Stockfish/pull/2696

Bench: 4668875

3 years agoQueen Mobility Tweak
FauziAkram [Sat, 23 May 2020 09:22:34 +0000 (12:22 +0300)]
Queen Mobility Tweak

It's ok to have low mobility values for the Queen in the middlegame, but it's absolutely not ok to have low mobility values for the Queen in the endgame.
Decrease penalty for bad mobility in MG and increase it in EG.

STC:
LLR: 2.93 (-2.94,2.94) {-0.50,1.50}
Total: 17264 W: 3424 L: 3206 D: 10634
Ptnml(0-2): 279, 2004, 3893, 2132, 324
https://tests.stockfishchess.org/tests/view/5ec8f9c1526edcbe9091eba1

LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 175016 W: 22071 L: 21404 D: 131541
Ptnml(0-2): 1195, 15796, 52914, 16353, 1250
https://tests.stockfishchess.org/tests/view/5ec9057c404591b2793007df

closes https://github.com/official-stockfish/Stockfish/pull/2697

Bench: 4487054

3 years agosmall cleanups
Joost VandeVondele [Sat, 23 May 2020 11:26:13 +0000 (13:26 +0200)]
small cleanups

closes https://github.com/official-stockfish/Stockfish/pull/2653

No functional change

3 years agoKeep low ply history from previous move
xoto10 [Thu, 21 May 2020 20:17:21 +0000 (21:17 +0100)]
Keep low ply history from previous move

This patch keeps the low-ply history from the previous move, shifting the data down by 2 ply.

Tested with closedpos book:

STC:
LLR: 2.93 (-2.94,2.94) {-0.50,1.50}
Total: 71584 W: 14175 L: 13891 D: 43518
Ptnml(0-2): 1069, 8228, 16993, 8354, 1148
https://tests.stockfishchess.org/tests/view/5ec0eaafe9d85f94dc429974

LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 96552 W: 13946 L: 13498 D: 69108
Ptnml(0-2): 676, 9082, 28375, 9404, 739
https://tests.stockfishchess.org/tests/view/5ec145efe9d85f94dc4299b0

closes https://github.com/official-stockfish/Stockfish/pull/2688

Bench 5148950

3 years agoImprove CI testing
Joost VandeVondele [Thu, 21 May 2020 06:25:37 +0000 (08:25 +0200)]
Improve CI testing

also enable CXXFLAGS="-D_GLIBCXX_DEBUG" in CI.

closes https://github.com/official-stockfish/Stockfish/pull/2692

No functional change.

3 years agoAdd doubled isolated pawn penalty.
Stefan Geschwentner [Fri, 22 May 2020 09:08:44 +0000 (11:08 +0200)]
Add doubled isolated pawn penalty.

This patch gives an additional penalty if a doubled isolated pawn is stopped
only by a single opponent pawn on the same file. Thanks to NKONSTANTAKIS,
who shared this idea on the forum!

https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/vC4Qn-PMlS4.

STC:
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 84872 W: 16688 L: 16370 D: 51814
Ptnml(0-2): 1507, 9940, 19274, 10158, 1557
https://tests.stockfishchess.org/tests/view/5ec65bd955202b947dc5d4ac

LTC:
LLR: 2.93 (-2.94,2.94) {0.25,1.75}
Total: 58104 W: 7614 L: 7278 D: 43212
Ptnml(0-2): 411, 5369, 17196, 5625, 451
https://tests.stockfishchess.org/tests/view/5ec6e9f2c23f5b0710632b19

Closes https://github.com/official-stockfish/Stockfish/pull/2694

Bench: 5148950

3 years agoTweak knight mobility
Stefan Geschwentner [Thu, 21 May 2020 10:29:36 +0000 (12:29 +0200)]
Tweak knight mobility

New tuned values for knight mobility in endgames.

STC:
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 112576 W: 21999 L: 21644 D: 68933
Ptnml(0-2): 2009, 13084, 25735, 13463, 1997
https://tests.stockfishchess.org/tests/view/5ec58379377121ac09e10272

LTC:
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 125192 W: 16200 L: 15671 D: 93321
Ptnml(0-2): 891, 11584, 37182, 11983, 956
https://tests.stockfishchess.org/tests/view/5ec5c0b8377121ac09e1028b

Closes https://github.com/official-stockfish/Stockfish/pull/2693

Bench: 4778956

3 years agoA combo of parameters tweaks
Stéphane Nicolet [Wed, 20 May 2020 15:06:42 +0000 (17:06 +0200)]
A combo of parameters tweaks

This patch is a combinaison of two recent parameters tweaks which had
failed narrowly (yellow) at long time control:

• improvement in move ordering during search by softening the distinction
  between bad captures and good captures during move generation, leading
  to improved awareness of Stockfish of potential piece sacrifices (idea
  by Rahul Dsilva)
• increase in the weight of pawns in the "initiative" part of the evaluation
  function. With this change Stockfish should have more incentive to exchange
  pawns when losing, and to keep pawns when winning.

STC:
LLR: 2.93 (-2.94,2.94) {-0.50,1.50}
Total: 10704 W: 2178 L: 1974 D: 6552
Ptnml(0-2): 168, 1185, 2464, 1345, 190
https://tests.stockfishchess.org/tests/view/5ec5553b377121ac09e1023d

LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 60592 W: 7835 L: 7494 D: 45263
Ptnml(0-2): 430, 5514, 18086, 5817, 449
https://tests.stockfishchess.org/tests/view/5ec55ca2377121ac09e10249

Closes https://github.com/official-stockfish/Stockfish/pull/2691

Bench: 4519117

3 years agoSimplify evaluation for blocked passers.
protonspring [Wed, 20 May 2020 14:33:59 +0000 (08:33 -0600)]
Simplify evaluation for blocked passers.

This is a functional simplification of the evaluation code for blocked passers.
I've also changed a few variable names for clarity.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 141984 W: 27450 L: 27466 D: 87068
Ptnml(0-2): 2414, 16511, 33175, 16461, 2431
https://tests.stockfishchess.org/tests/view/5ec4001b05aa4bc72d9759e7

LTC
LLR: 2.93 (-2.94,2.94) {-1.50,0.50}
Total: 30536 W: 3966 L: 3885 D: 22685
Ptnml(0-2): 216, 2841, 9073, 2922, 216
https://tests.stockfishchess.org/tests/view/5ec4bd0d377121ac09e101b7

Closes https://github.com/official-stockfish/Stockfish/pull/2690

Bench: 4704681

3 years agoAvoid sending info strings before 'uci' has been received
Sami Kiminki [Tue, 19 May 2020 09:08:01 +0000 (12:08 +0300)]
Avoid sending info strings before 'uci' has been received

Do not send the following info string on the first call to
aligned_ttmem_alloc() on Windows:

  info string Hash table allocation: Windows large pages [not] used.

The first call occurs before the 'uci' command has been received. This
confuses some GUIs, which expect the first engine-sent command to be
'id' as the response to the 'uci' command. (see https://github.com/official-stockfish/Stockfish/issues/2681)

closes https://github.com/official-stockfish/Stockfish/pull/2689

No functional change.

3 years agoIncrease base time use and limit max used.
xoto10 [Sun, 17 May 2020 19:46:25 +0000 (20:46 +0100)]
Increase base time use and limit max used.

This change increases the base part of optimumTime at all depths. It also reduces the size of max_scale and thus maximumTime by using a linear scale instead of pow(x, 0.3) and by limiting max_scale to no more than 7 (previously as high as 8 or 9 at very high depths).

Tested using the closedpos book:

STC 10+0.1:
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 83696 W: 16813 L: 16508 D: 50375
Ptnml(0-2): 1315, 9649, 19686, 9812, 1386
https://tests.stockfishchess.org/tests/view/5ebfa92de9d85f94dc42989b

LTC 60+0.6:
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 39384 W: 5868 L: 5582 D: 27934
Ptnml(0-2): 276, 3697, 11489, 3925, 305
https://tests.stockfishchess.org/tests/view/5ec0a6dce9d85f94dc42995a

Test for non-regression:

STC Sudden Death 10+0 :
LLR: 2.94 (-2.94,2.94) {-2.00,0.00}
Total: 111976 W: 25661 L: 25768 D: 60547
Ptnml(0-2): 2567, 13420, 24118, 13319, 2564
https://tests.stockfishchess.org/tests/view/5ec23b3be9d85f94dc429a58

closes  https://github.com/official-stockfish/Stockfish/pull/2685

Bench 4395562

3 years agoDon't adjust MoveOverhead by increment
protonspring [Fri, 15 May 2020 23:23:49 +0000 (17:23 -0600)]
Don't adjust MoveOverhead by increment

This is a change to address a potential timing issue for slow networks.

Move Overhead was limited by TC increment,
which might be problematic if small increments (or sudden death)
on slow networks (needing high Move Overhead) are used.

STC, sudden death.
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 169368 W: 38023 L: 38054 D: 93291
Ptnml(0-2): 3767, 20250, 36595, 20391, 3681
https://tests.stockfishchess.org/tests/view/5ebf25efe9d85f94dc42986f

STC, 10+0.1
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 83896 W: 16092 L: 16026 D: 51778
Ptnml(0-2): 1401, 9697, 19670, 9795, 1385
https://tests.stockfishchess.org/tests/view/5ec0239de9d85f94dc42991e

closes https://github.com/official-stockfish/Stockfish/pull/2684

No functional change.

3 years agoWorkaround for older compiler
Joost VandeVondele [Fri, 15 May 2020 17:37:56 +0000 (19:37 +0200)]
Workaround for older compiler

gcc < 5 doesn't fully support the c++11 `std::is_trivially_copyable<Entry>::value`
Remove it, as it is not essential.

fixes https://github.com/official-stockfish/Stockfish/issues/2681

closes https://github.com/official-stockfish/Stockfish/pull/2682

No functional change.

3 years agoSimplify Time Management
protonspring [Wed, 13 May 2020 17:52:41 +0000 (11:52 -0600)]
Simplify Time Management

This is a functional simplification of the time management system.

With this patch, there is a simple equation for each of two distinct
time controls: basetime + increment, and x moves in y seconds (+increment).
These equations are easy to plot and understand making future modifications
or adding additional time controls much easier.

SlowMover is reset to 100 so that is has no effect unless a user changes it.

There are two scaling variables:
* Opt_scale is a scale factor (or percentage) of time to use for this current move.
* Max_scale is a scale factor to apply to the resulting optimumTime.

There seems to be some elo gain in most scenarios.
Better performance is attributable to one of two things:
* minThinkingTime was not allowing reasonable time calculations for very short games like 10+0 or 10+0.01. This is because adding almost no increment and substracting move overhead for 50 moves quickly results in almost 0 time very early in the game. Master depended on minThinkingTime to handle these short games instead of good time management. This patch addresses this issue by lowering minThinkingTime to 0 and adjusting moverOverhead if there are very low increments.
* Notice that the time distribution curves tail downward for the first 10 moves or so. This causes less time to attribute for very early moves leaving more time available for middle moves where more important decisions happen.

Here is a summary of tests for this version at different time controls:

SMP 5+0.05
LLR: 2.97 (-2.94,2.94) {-1.50,0.50}
Total: 46544 W: 7175 L: 7089 D: 32280
Ptnml(0-2): 508, 4826, 12517, 4914, 507
https://tests.stockfishchess.org/tests/user/protonspring

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 20480 W: 3872 L: 3718 D: 12890
Ptnml(0-2): 295, 2364, 4824, 2406, 351
https://tests.stockfishchess.org/tests/view/5ebc343e7dd5693aad4e6873

STC, sudden death
LLR: 2.93 (-2.94,2.94) {-1.50,0.50}
Total: 7024 W: 1706 L: 1489 D: 3829
Ptnml(0-2): 149, 813, 1417, 938, 195
https://tests.stockfishchess.org/tests/view/5ebc346f7dd5693aad4e6875

STC, TCEC style
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 4192 W: 1014 L: 811 D: 2367
Ptnml(0-2): 66, 446, 912, 563, 109
https://tests.stockfishchess.org/tests/view/5ebc34857dd5693aad4e6877

40/10
LLR: 2.93 (-2.94,2.94) {-1.50,0.50}
Total: 54032 W: 10592 L: 10480 D: 32960
Ptnml(0-2): 967, 6148, 12677, 6254, 970
https://tests.stockfishchess.org/tests/view/5ebc50597dd5693aad4e688d

LTC, sudden death
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 9152 W: 1391 L: 1263 D: 6498
Ptnml(0-2): 75, 888, 2526, 1008, 79
https://tests.stockfishchess.org/tests/view/5ebc6f5c7dd5693aad4e689b

LTC
LLR: 2.98 (-2.94,2.94) {-1.50,0.50}
Total: 12344 W: 1563 L: 1459 D: 9322
Ptnml(0-2): 70, 1103, 3740, 1171, 88
https://tests.stockfishchess.org/tests/view/5ebc6f4c7dd5693aad4e6899

closes https://github.com/official-stockfish/Stockfish/pull/2678

Bench: 4395562

3 years agoFix a Windows-only crash on exit without 'quit'
Sami Kiminki [Thu, 14 May 2020 09:00:35 +0000 (12:00 +0300)]
Fix a Windows-only crash on exit without 'quit'

There was a bug in commit d4763424d2728fe2dfd0a6fe747666feb6a2fdbb
(Add support for Windows large pages) that could result in trying to
free memory allocated with VirtualAlloc incorrectly with free().

Fix this by reverting the TT.resize(0) logic in the previous commit,
and instead, just call aligned_ttmem_free() in
TranspositionTable::~TranspositionTable().

fixes https://github.com/official-stockfish/Stockfish/issues/2677

closes https://github.com/official-stockfish/Stockfish/pull/2679

No functional change

3 years agoMove 50 moves counter to initiative.
Stéphane Nicolet [Fri, 8 May 2020 08:32:52 +0000 (10:32 +0200)]
Move 50 moves counter to initiative.

simplify the usage of the 50 moves counter,
moving it frome the scale factor to initiative.

This patch was inspired by recent games where a blocked or semi-blocked position
was 'blundered', by moving a pawn, into a lost endgame. This patch improves this situation,
finding a more robust move more often.

for example (1s searches with many threads):
```
FEN 8/p3kp2/Pp2p3/1n2PpP1/5P2/1Kp5/8/R7 b - - 68 143

master:
      6 bestmove b5c7
      6 bestmove e7e8
     12 bestmove e7d8
    176 bestmove e7d7
patch:
      3 bestmove b5c7
      5 bestmove e7d8
    192 bestmove e7d7
```

fixes https://github.com/official-stockfish/Stockfish/issues/2620

the patch also tests well

passed STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 50168 W: 9508 L: 9392 D: 31268
Ptnml(0-2): 818, 5873, 11616, 5929, 848
https://tests.stockfishchess.org/tests/view/5ebb07287dd5693aad4e680b

passed LTC
LLR: 2.93 (-2.94,2.94) {-1.50,0.50}
Total: 7520 W: 981 L: 870 D: 5669
Ptnml(0-2): 49, 647, 2256, 760, 48
https://tests.stockfishchess.org/tests/view/5ebbff747dd5693aad4e6858

closes https://github.com/official-stockfish/Stockfish/pull/2666

Bench: 4395562

3 years agoAdd support for Windows large pages
Sami Kiminki [Mon, 4 May 2020 17:49:27 +0000 (20:49 +0300)]
Add support for Windows large pages

for users that set the needed privilige "Lock Pages in Memory"
large pages will be automatically enabled (see Readme.md).

This expert setting might improve speed, 5% - 30%, depending
on the hardware, the number of threads and hash size. More for
large hashes, large number of threads and NUMA. If the operating
system can not allocate large pages (easier after a reboot), default
allocation is used automatically. The engine log provides details.

closes https://github.com/official-stockfish/Stockfish/pull/2656

fixes https://github.com/official-stockfish/Stockfish/issues/2619

No functional change

3 years agoUse a trivially copyable struct for TBTables::Entry instead of a tuple.
Tomasz Sobczyk [Tue, 12 May 2020 19:41:55 +0000 (21:41 +0200)]
Use a trivially copyable struct for TBTables::Entry instead of a tuple.

fixes https://github.com/official-stockfish/Stockfish/issues/2673
which is a warning issued by recent gcc (10.1)

closes https://github.com/official-stockfish/Stockfish/pull/2674

No functional change

3 years agoTune pawn value
Moez Jellouli [Fri, 8 May 2020 14:59:06 +0000 (16:59 +0200)]
Tune pawn value

Small tune of PawnValue parameters -4 / -7 with "closedpos.epd" opening book.

STC:
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 58776 W: 11787 L: 11511 D: 35478
Ptnml(0-2): 975, 6876, 13443, 7086, 1008
https://tests.stockfishchess.org/tests/view/5eb5aa712326444a3b6d3e33

LTC:
LLR: 2.98 (-2.94,2.94) {0.25,1.75}
Total: 137544 W: 19687 L: 19115 D: 98742
Ptnml(0-2): 988, 13219, 39901, 13561, 1103
https://tests.stockfishchess.org/tests/view/5eb67a392326444a3b6d3e9a

Non regression STC with "noob_3moves.epd" opening book
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 98168 W: 18545 L: 18499 D: 61124
Ptnml(0-2): 1647, 11396, 22951, 11444, 1646
https://tests.stockfishchess.org/tests/view/5eb7e489e0300e8e8c896203

closes https://github.com/official-stockfish/Stockfish/pull/2670

Bench 4696646

3 years agoUse posix_memalign instead of aligned_alloc
Joost VandeVondele [Sat, 9 May 2020 17:45:07 +0000 (19:45 +0200)]
Use posix_memalign instead of aligned_alloc

should be a little more portable to older linux systems (before glibc-2.16).

fixes https://github.com/official-stockfish/Stockfish/issues/2665

closes https://github.com/official-stockfish/Stockfish/pull/2668

No functional change.

3 years agoFix syzygy dependencies issue
xoto10 [Fri, 8 May 2020 11:07:42 +0000 (12:07 +0100)]
Fix syzygy dependencies issue

fixes https://github.com/official-stockfish/Stockfish/issues/2660

The problem was caused by .depend being created with a rule for tbprobe.o not for syzygy/tbprobe.o.
This patch keeps an explicit list of sources (SRCS), generates OBJS,
and compiles all object files to the src/ directory, consistent with .depend.
VPATH is used to search the syzygy directory as needed.

joint work with @gvreuls

closes https://github.com/official-stockfish/Stockfish/pull/2664

No functional change

3 years agoPenalty for all enemy pawns xrayed by our bishop.
xoto10 [Wed, 6 May 2020 07:44:39 +0000 (08:44 +0100)]
Penalty for all enemy pawns xrayed by our bishop.

STC:
LLR: 2.93 (-2.94,2.94) {-0.50,1.50}
Total: 159760 W: 30229 L: 29813 D: 99718
Ptnml(0-2): 2659, 18309, 37534, 18713, 2665
https://tests.stockfishchess.org/tests/view/5eb1d5032326444a3b6d33ce

LTC:
LLR: 2.93 (-2.94,2.94) {0.25,1.75}
Total: 26496 W: 3908 L: 3656 D: 18932
Ptnml(0-2): 192, 2512, 7610, 2720, 214
https://tests.stockfishchess.org/tests/view/5eb1e2dd2326444a3b6d33f9

closes https://github.com/official-stockfish/Stockfish/pull/2662

Bench 5185517

3 years agoFishtest Tuning Framework
Marco Costalba [Sat, 4 Apr 2015 06:54:15 +0000 (08:54 +0200)]
Fishtest Tuning Framework

The purpose of the code is to allow developers to easily and flexibly
setup SF for a tuning session. Mainly you have just to remove 'const'
qualifiers from the variables you want to tune and flag them for
tuning, so if you have:

int myKing = 10;
Score myBonus = S(5, 15);
Value myValue[][2] = { { V(100), V(20) }, { V(7), V(78) } };

and at the end of the update you may want to call
a post update function:

void my_post_update();

If instead of default Option's min-max values,
you prefer your custom ones, returned by:

std::pair<int, int> my_range(int value)

Or you jus want to set the range directly, you can
simply add below:

TUNE(SetRange(my_range), myKing, SetRange(-200, 200), myBonus, myValue, my_post_update);

And all the magic happens :-)

At startup all the parameters are printed in a
format suitable to be copy-pasted in fishtest.

In case the post update function is slow and you have many
parameters to tune, you can add:

UPDATE_ON_LAST();

And the values update, including post update function call, will
be done only once, after the engine receives the last UCI option.
The last option is the one defined and created as the last one, so
this assumes that the GUI sends the options in the same order in
which have been defined.

closes https://github.com/official-stockfish/Stockfish/pull/2654

No functional change.

3 years agoRefine scale factor of opposite colored bishops endgames.
Vizvezdenec [Sat, 2 May 2020 13:45:20 +0000 (16:45 +0300)]
Refine scale factor of opposite colored bishops endgames.

This patch makes it dependant on the count of passed pawns of
the strong side instead of 22/64 in every case.

passed STC
https://tests.stockfishchess.org/tests/view/5ead60966ffeed51f6e32591
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 50336 W: 9473 L: 9241 D: 31622
Ptnml(0-2): 570, 5371, 13098, 5515, 614

passed LTC
https://tests.stockfishchess.org/tests/view/5ead6d3b6ffeed51f6e325b0
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 21952 W: 2810 L: 2603 D: 16539
Ptnml(0-2): 101, 1791, 7005, 1958, 121

closes https://github.com/official-stockfish/Stockfish/pull/2658

bench 4247490

3 years agoTuned safe checks and minor piece king protectors
Linmiao Xu [Sat, 25 Apr 2020 19:55:35 +0000 (15:55 -0400)]
Tuned safe checks and minor piece king protectors

A combination of terms related to king safety one tuned safe check weights,
the other tuned knight and bishop king protector weights separately with
some compensation in the high outpost bonuses given to the minor pieces.

passed STC
LLR: 2.95 (-2.94,2.94) {-0.50,1.50}
Total: 39892 W: 7594 L: 7350 D: 24948
Ptnml(0-2): 643, 4559, 9314, 4771, 659
https://tests.stockfishchess.org/tests/view/5ea49635b908f6dd28f34b82

passed LTC
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 104934 W: 13300 L: 12834 D: 78800
Ptnml(0-2): 697, 9571, 31514, 9939, 746
https://tests.stockfishchess.org/tests/view/5ea4abf6b908f6dd28f34bcb

closes https://github.com/official-stockfish/Stockfish/pull/2649

Bench 4800754

3 years agoSmall cleanups
Joost VandeVondele [Wed, 29 Apr 2020 15:39:25 +0000 (17:39 +0200)]
Small cleanups

closes https://github.com/official-stockfish/Stockfish/pull/2628

No functional change

3 years agoIntroduce futility pruning for captures
Vizvezdenec [Tue, 28 Apr 2020 23:40:16 +0000 (02:40 +0300)]
Introduce futility pruning for captures

The idea is somewhat similar to futility pruning for quiet moves -
if a late enough capture doesn't give check and the static eval is
much lower than alpha we can almost safely assume that this capture
wouldn't be a good move.

passed STC
https://tests.stockfishchess.org/tests/view/5ea8544b53a4548a0348ee5b
LLR: 2.95 (-2.94,2.94) {-0.50,1.50}
Total: 236040 W: 44420 L: 43894 D: 147726
Ptnml(0-2): 3830, 27202, 55496, 27596, 3896

passed LTC
https://tests.stockfishchess.org/tests/view/5ea87c842141237a731f0c7d
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 81336 W: 10429 L: 10028 D: 60879
Ptnml(0-2): 589, 7356, 24404, 7703, 616

closes https://github.com/official-stockfish/Stockfish/pull/2651

bench 4405247

3 years agocontinuation histories when in check
pb00067 [Tue, 21 Apr 2020 18:55:41 +0000 (20:55 +0200)]
continuation histories when in check

If in check, don't write to continuation histories ss-4, ss-6.
Adding inCheck to the stack was needed, and might be useful for
future patches.

Passed STC:
https://tests.stockfishchess.org/tests/view/5e9ee24acaaff5d60a50b812
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 61774 W: 11725 L: 11449 D: 38600
Ptnml(0-2): 971, 7211, 14322, 7337, 1046

Passed LTC:
https://tests.stockfishchess.org/tests/view/5e9eecb7caaff5d60a50b831
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 250822 W: 32067 L: 31179 D: 187576
Ptnml(0-2): 1745, 23126, 74824, 23928, 1788

closes https://github.com/official-stockfish/Stockfish/pull/2645

bench: 4808463

3 years agoApply multicut pruning more often
Vizvezdenec [Sat, 18 Apr 2020 00:28:47 +0000 (03:28 +0300)]
Apply multicut pruning more often

This patch increases number of nodes where we produce multicut cutoffs.

The idea is that if our ttMove failed to produce a singular extension
but ttValue is greater than beta we can afford to do one more reduced search
near beta excluding ttMove to see if it will produce a fail high -
and if it does so produce muticut by analogy to existing logic.

passed STC
https://tests.stockfishchess.org/tests/view/5e9a162b5b664cdba0ce6e28
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 58238 W: 11192 L: 10917 D: 36129
Ptnml(0-2): 1007, 6704, 13442, 6939, 1027

passed LTC
https://tests.stockfishchess.org/tests/view/5e9a1e845b664cdba0ce7411
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 137852 W: 17460 L: 16899 D: 103493
Ptnml(0-2): 916, 12610, 41383, 13031, 986

closes https://github.com/official-stockfish/Stockfish/pull/2640

bench 4881443

3 years agoSimplify minPawnDistance
protonspring [Fri, 17 Apr 2020 05:12:43 +0000 (23:12 -0600)]
Simplify minPawnDistance

This is a functional simplification which fixes an awkward numerical cliff.

With master king_safety, no pawns is scored higher than pawn(s) that is/are far from the king. This may motivate SF to throw away pawns to increase king safety. With this patch, there is a consistent value for minPawnDistance where losing a pawn never increases king safety.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 45548 W: 8624 L: 8525 D: 28399
Ptnml(0-2): 592, 4937, 11587, 5096, 562
https://tests.stockfishchess.org/tests/view/5e98ced630be947a14e9ddc5

LTC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 42084 W: 5292 L: 5242 D: 31550
Ptnml(0-2): 193, 3703, 13252, 3649, 245
https://tests.stockfishchess.org/tests/view/5e98e22e30be947a14e9de07

closes https://github.com/official-stockfish/Stockfish/pull/2639

bench 4600292

4 years agoRemove one condition in probcut TTmove skipping
Joost VandeVondele [Wed, 15 Apr 2020 21:34:18 +0000 (23:34 +0200)]
Remove one condition in probcut TTmove skipping

the removed condition appears illogical and is not needed.

passed STC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 80418 W: 15217 L: 15144 D: 50057
Ptnml(0-2): 1341, 9399, 18679, 9426, 1364
https://tests.stockfishchess.org/tests/view/5e977eb5c9ada107a0370d6b

passed LTC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 49878 W: 6299 L: 6247 D: 37332
Ptnml(0-2): 327, 4677, 14897, 4693, 345
https://tests.stockfishchess.org/tests/view/5e97e07dc9ada107a0370e53

closes https://github.com/official-stockfish/Stockfish/pull/2638

Bench: 4958027

4 years agoScale factor in opposite-color bishop endings
xoto10 [Thu, 16 Apr 2020 17:10:44 +0000 (18:10 +0100)]
Scale factor in opposite-color bishop endings

This change varies the scale factor with the total number of pieces and pawns on the strongSide.

STC :
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 150920 W: 28828 L: 28422 D: 93670 +0.65 Elo
Ptnml(0-2): 2507, 17548, 35030, 17782, 2593
https://tests.stockfishchess.org/tests/view/5e983eb2c00499c5410f4951

LTC :
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 69238 W: 8810 L: 8446 D: 51982 +1.58 Elo
Ptnml(0-2): 451, 6276, 20879, 6484, 529
https://tests.stockfishchess.org/tests/view/5e985b27c00499c5410f4987

closes https://github.com/official-stockfish/Stockfish/pull/2637

Bench 4821332

4 years agoIncrease safe check bonus if multiple safe checks
Lolligerhans [Thu, 16 Apr 2020 01:56:43 +0000 (03:56 +0200)]
Increase safe check bonus if multiple safe checks

Add 50% "safe checks" bonus when there are multiple safe checks from the
same piece type.

LTC
LLR: 2.97 (-2.94,2.94) {0.25,1.75}
Total: 128184 W: 16491 L: 15954 D: 95739
Ptnml(0-2): 884, 11793, 38267, 12198, 950
https://tests.stockfishchess.org/tests/view/5e97d1b6c9ada107a0370e03

STC
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 19022 W: 3733 L: 3514 D: 11775
Ptnml(0-2): 338, 2103, 4414, 2314, 342
https://tests.stockfishchess.org/tests/view/5e97c377c9ada107a0370ddf

closes https://github.com/official-stockfish/Stockfish/pull/2636

Bench: 5057329

4 years agoQueen and Rook Tuning
FauziAkram [Wed, 15 Apr 2020 22:33:48 +0000 (01:33 +0300)]
Queen and Rook Tuning

Tuning for multiple parameters for Queen and Rook.

passed STC
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 62790 W: 12033 L: 11754 D: 39003
Ptnml(0-2): 1058, 7186, 14666, 7389, 1096
https://tests.stockfishchess.org/tests/view/5e978c66c9ada107a0370d87

passed LTC
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 89780 W: 11460 L: 11036 D: 67284
Ptnml(0-2): 624, 8151, 26951, 8505, 659
https://tests.stockfishchess.org/tests/view/5e979aaec9ada107a0370d93

closes https://github.com/official-stockfish/Stockfish/pull/2634

Bench: 5111578

4 years agoDon't attempt probcut if ttMove is not good enough.
Vizvezdenec [Wed, 15 Apr 2020 15:22:02 +0000 (18:22 +0300)]
Don't attempt probcut if ttMove is not good enough.

This idea is loosely based on xoroshiro idea about raisedBeta and ttmoves.
If our ttmove have low enough ttvalue and is deep enough (deeper than our probcut depth) it makes little sense to try probcut moves, since the ttMove already more or less failed to produce one according to transposition table.

passed STC
https://tests.stockfishchess.org/tests/view/5e9673ddc2718dee3c822920
LLR: 2.95 (-2.94,2.94) {-0.50,1.50}
Total: 72148 W: 14038 L: 13741 D: 44369
Ptnml(0-2): 1274, 8326, 16615, 8547, 1312

passed LTC
https://tests.stockfishchess.org/tests/view/5e96b378c2718dee3c8229bf
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 89054 W: 11418 L: 10996 D: 66640
Ptnml(0-2): 623, 8113, 26643, 8515, 633

closes https://github.com/official-stockfish/Stockfish/pull/2632

bench 4952731

4 years agoSpace bonus and number of blocked pawns
Vizvezdenec [Wed, 15 Apr 2020 01:13:50 +0000 (04:13 +0300)]
Space bonus and number of blocked pawns

This patch refines the recently introduced interaction between
the space bonus and the number of blocked pawns in a position.

* pawns count as blocked also if their push square is attacked by 2 enemy pawns;
* overall dependence is stronger as well as offset;
* bonus increase is capped at 9 blocked pawns in position;

passed STC
https://tests.stockfishchess.org/tests/view/5e94560663d105aebbab243d
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 29500 W: 5842 L: 5603 D: 18055
Ptnml(0-2): 504, 3443, 6677, 3562, 564

passed LTC
https://tests.stockfishchess.org/tests/view/5e95b383c2aaa99f75d1a14d
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 63504 W: 8329 L: 7974 D: 47201
Ptnml(0-2): 492, 5848, 18720, 6197, 495

closes https://github.com/official-stockfish/Stockfish/pull/2631

bench 4956028

4 years agoless bonus for blocked connected pawn
Stefan Geschwentner [Mon, 13 Apr 2020 21:01:38 +0000 (23:01 +0200)]
less bonus for blocked connected pawn

Use less bonus for blocked connected pawns so closed positions are less worth.

STC:
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 60004 W: 11904 L: 11619 D: 36481
Ptnml(0-2): 1066, 7083, 13535, 7136, 1182
https://tests.stockfishchess.org/tests/view/5e941a8063d105aebbab23e3

LTC:
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 36606 W: 4831 L: 4556 D: 27219
Ptnml(0-2): 252, 3353, 10872, 3520, 306
https://tests.stockfishchess.org/tests/view/5e9444b963d105aebbab2427

closes https://github.com/official-stockfish/Stockfish/pull/2629

Bench: 4961260

4 years agoRemoves evasionPrunable
silversolver1 [Mon, 13 Apr 2020 03:23:04 +0000 (22:23 -0500)]
Removes evasionPrunable

STC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 25656 W: 4979 L: 4826 D: 15851
Ptnml(0-2): 414, 2971, 5964, 3006, 473
https://tests.stockfishchess.org/tests/view/5e93dbd72cb65b3059c33819

LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 43732 W: 5656 L: 5593 D: 32483
Ptnml(0-2): 324, 4072, 13009, 4139, 322
https://tests.stockfishchess.org/tests/view/5e93e37c2cb65b3059c33825

closes https://github.com/official-stockfish/Stockfish/pull/2627

Bench: 4702195

4 years agoScale up space weight with number of blocked pawns
Vizvezdenec [Mon, 13 Apr 2020 00:48:52 +0000 (03:48 +0300)]
Scale up space weight with number of blocked pawns

This idea is loosely based on stockfish losses in closed positions in different tournaments. Space weight symmetrically increases for both sides the more blocked position is.

passed STC
https://tests.stockfishchess.org/tests/view/5e919eefaf0a0143109dc8ce
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 16994 W: 3389 L: 3172 D: 10433
Ptnml(0-2): 277, 1931, 3918, 2040, 331

passed LTC
https://tests.stockfishchess.org/tests/view/5e91d04faf0a0143109dc8ea
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 133386 W: 17316 L: 16763 D: 99307
Ptnml(0-2): 945, 12407, 39524, 12784, 1033

closes https://github.com/official-stockfish/Stockfish/pull/2626

Bench: 4966867

4 years agoRemove candidate passers w/o feasible lever
Lolligerhans [Sat, 11 Apr 2020 15:28:45 +0000 (17:28 +0200)]
Remove candidate passers w/o feasible lever

+-------+
| o . . | o  their pawns
| x . . | x  our pawns
| . x . | <- Can sacrifice to create passer?
+-------+
   yes

    1         2         3         4         5
+-------+ +-------+ +-------+ +-------+ +-------+
| o . . | | o r . | | o r . | | o . b | | o . b |  lowercase: theirs
| x b . | | x . . | | x . R | | x . R | | x . . |  uppercase: ours
| . x . | | . x . | | . x . | | . x . | | . x B |
+-------+ +-------+ +-------+ +-------+ +-------+
   no        no        yes       no        yes

The value of our top pawn depends on our ability to advance our bottom
pawn, levering their blocker. Previously, this pawn configuration was
always scored as passer (although a blocked one).

Add requirements for the square s above our (possibly) sacrificed pawn:
- s must not be occupied by them (1).
- If they attack s (2), we must attack s (3).
- If they attack s with a minor (4), we must attack s with a minor (5).
The attack from their blocker is ignored because it is inherent in the
structure; we are ok with sacrificing our bottom pawn.

LTC
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 37030 W: 4962 L: 4682 D: 27386
Ptnml(0-2): 266, 3445, 10863, 3625, 316
https://tests.stockfishchess.org/tests/view/5e92a2b4be6ede5b954bf239

STC
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 40874 W: 8066 L: 7813 D: 24995
Ptnml(0-2): 706, 4753, 9324, 4890, 764
https://tests.stockfishchess.org/tests/view/5e922199af0a0143109dc90e

closes https://github.com/official-stockfish/Stockfish/pull/2624

Bench: 4828294

4 years agoExtend irreversible moves
Joost VandeVondele [Fri, 10 Apr 2020 19:53:00 +0000 (21:53 +0200)]
Extend irreversible moves

if these are ttMoves and played in positions with a high value of the rule50 counter. The unusual extension of 2 is safe in this context as awarding it will reset the rule50 counter, making sure it is awarded very rarely in a search path.

This patch partially addresses https://github.com/official-stockfish/Stockfish/issues/2620 as it should make it less likely to play a move that resets the counter, but that is worse than alternative moves after a slightly deeper search.

passed STC:
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 71658 W: 13840 L: 13560 D: 44258
Ptnml(0-2): 1058, 7921, 17643, 8097, 1110
https://tests.stockfishchess.org/tests/view/5e90d0f6754c3424c4cf9f41

passed LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 85082 W: 11069 L: 10680 D: 63333
Ptnml(0-2): 459, 6982, 27259, 7393, 448
https://tests.stockfishchess.org/tests/view/5e917470af0a0143109dc341

closes https://github.com/official-stockfish/Stockfish/pull/2623

Bench: 4432822

4 years agoAlways remember the ttMove
protonspring [Fri, 3 Apr 2020 21:10:50 +0000 (15:10 -0600)]
Always remember the ttMove

In master, if the received ttMove meets the prescribed conditions in the various MovePicker constructors, it is returned as the first move, otherwise we set it to MOVE_NONE. If set to MOVE_NONE, we no longer track what the ttMove was, and it will might be returned later in a list of generated moves. This may be a waste. With this patch, if the ttMove fails to meet the prescribed conditions, we simply skip the TT stages, but still store the move and make sure it's never returned.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 66424 W: 12903 L: 12806 D: 40715
Ptnml(0-2): 1195, 7730, 15230, 7897, 1160

LTC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 45682 W: 5989 L: 5926 D: 33767
Ptnml(0-2): 329, 4361, 13443, 4334, 374

closes https://github.com/official-stockfish/Stockfish/pull/2616

Bench 4928928

4 years agoSmall cleanups
Joost VandeVondele [Sun, 12 Apr 2020 18:30:08 +0000 (20:30 +0200)]
Small cleanups

closes https://github.com/official-stockfish/Stockfish/pull/2606

No functional change

4 years agoIntroduce capture history pruning
Vizvezdenec [Tue, 7 Apr 2020 13:53:24 +0000 (16:53 +0300)]
Introduce capture history pruning

This patch introduces a heuristic that is similar to countermove based pruning but for captures - capture history pruning. The idea is that we can (almost) safely prune really late captures with negative history if they don't give check so will most likely not produce some king-attacking tactic.

passed STC
https://tests.stockfishchess.org/tests/view/5e8c60d40ffd2be7f15e5470
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 23748 W: 4758 L: 4529 D: 14461
Ptnml(0-2): 421, 2712, 5400, 2899, 442

passed LTC
https://tests.stockfishchess.org/tests/view/5e8c72bf0ffd2be7f15e547f
LLR: 2.96 (-2.94,2.94) {0.25,1.75}
Total: 17330 W: 2415 L: 2190 D: 12725
Ptnml(0-2): 126, 1561, 5107, 1704, 167

closes https://github.com/official-stockfish/Stockfish/pull/2618

bench 4417023

4 years agoFurther increase reductions with increasing number of threads
Vizvezdenec [Sat, 4 Apr 2020 15:06:13 +0000 (18:06 +0300)]
Further increase reductions with increasing number of threads

This patch doubles the reduction increase with thread count.

passed STC
https://tests.stockfishchess.org/tests/view/5e874f5a4411759d9d098696
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 9162 W: 1558 L: 1385 D: 6219
Ptnml(0-2): 90, 958, 2343, 1069, 121

passed LTC
https://tests.stockfishchess.org/tests/view/5e8762804411759d9d09869f
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 79364 W: 9541 L: 9159 D: 60664
Ptnml(0-2): 462, 6880, 24661, 7172, 507

closes https://github.com/official-stockfish/Stockfish/pull/2615

bench 4831963

4 years agoRetire candidate passed pawns
31m059 [Fri, 3 Apr 2020 03:57:15 +0000 (23:57 -0400)]
Retire candidate passed pawns

Before this commit, some pawns were considered "candidate" passed pawns and given half bonus. After this commit, all of these pawns are scored as passed pawns, and they do not receive less bonus.

STC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 21806 W: 4320 L: 4158 D: 13328
Ptnml(0-2): 367, 2526, 5001, 2596, 413
https://tests.stockfishchess.org/tests/view/5e86b4724411759d9d098639

LTC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 12590 W: 1734 L: 1617 D: 9239
Ptnml(0-2): 96, 1187, 3645, 1238, 129
https://tests.stockfishchess.org/tests/view/5e86d2874411759d9d098640

This PR and commit are dedicated to our colleague Stefan Geschwentner (@locutus2), one of the most respected and accomplished members of the Stockfish developer community. Stockfish is a volunteer project and has always thrived because of Stefan's talent, insight, generosity, and dedication. Welcome back, Stefan!

closes https://github.com/official-stockfish/Stockfish/pull/2613

Bench: 4831963

4 years agoremove KNPK endgame code
protonspring [Tue, 31 Mar 2020 21:08:55 +0000 (15:08 -0600)]
remove KNPK endgame code

In more than 100k local KNPK games, there is no discernible difference between master and master with this endgame removed: master:42971, patch:42973, draws: 3969. Removal does not seem to regress in normal games.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 46390 W: 8998 L: 8884 D: 28508
Ptnml(0-2): 707, 5274, 11163, 5300, 751
https://tests.stockfishchess.org/tests/view/5e83b18ee42a5c3b3ca2ef02

LTC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 44768 W: 5863 L: 5814 D: 33091
Ptnml(0-2): 251, 3918, 14028, 3905, 282
https://tests.stockfishchess.org/tests/view/5e84a82a4411759d9d0984f4

In tests with a book of endgames that can convert into KNPK, no significant difference can be seen either

```
TC 1.0+0.01
Score of patch vs master: 6131 - 6188 - 27681  [0.499] 40000
Elo difference: -0.5 +/- 1.9, LOS: 30.4 %, DrawRatio: 69.2 %

TC 2.0+0.02
Score of patch vs master: 5740 - 5741 - 28519 [0.500] 40000
Elo difference: -0.0 +/- 1.8, LOS: 49.6 %, DrawRatio: 71.3 %
``

closes https://github.com/official-stockfish/Stockfish/pull/2611

Bench 4512059

4 years agoIncrease reduction for captures.
Vizvezdenec [Thu, 2 Apr 2020 03:33:53 +0000 (06:33 +0300)]
Increase reduction for captures.

The idea behind this patch is that if static eval is really bad so capturing of current piece on spot will still produce a position with an eval much lower than alpha then our best chance is to create some kind of king attack. So captures without check are mostly worse than captures with check and can be reduced more.

passed STC
https://tests.stockfishchess.org/tests/view/5e8514b44411759d9d098543
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 46196 W: 9039 L: 8781 D: 28376
Ptnml(0-2): 750, 5412, 10628, 5446, 862

passed LTC
https://tests.stockfishchess.org/tests/view/5e8530134411759d9d09854c
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 23462 W: 3228 L: 2988 D: 17246
Ptnml(0-2): 186, 2125, 6849, 2405, 166

close https://github.com/official-stockfish/Stockfish/pull/2612

bench 4742598

4 years agoSimplify a candidate passer condition.
31m059 [Tue, 31 Mar 2020 01:53:02 +0000 (21:53 -0400)]
Simplify a candidate passer condition.

STC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 31528 W: 6208 L: 6061 D: 19259
Ptnml(0-2): 541, 3673, 7205, 3788, 557
https://tests.stockfishchess.org/tests/view/5e825db0e42a5c3b3ca2ee21

LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 38546 W: 5083 L: 5009 D: 28454
Ptnml(0-2): 299, 3628, 11362, 3668, 316
https://tests.stockfishchess.org/tests/view/5e826ec7e42a5c3b3ca2ee2a

closes https://github.com/official-stockfish/Stockfish/pull/2607

Bench: 5139561

4 years agoNo voting for TB loss / mate.
mstembera [Sun, 29 Mar 2020 21:09:19 +0000 (14:09 -0700)]
No voting for TB loss / mate.

Just as we pick the shortest mate also make sure we stave off mate as long as possible.

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

bench: 5138771

4 years agoLimit array access in Position
protonspring [Thu, 26 Mar 2020 01:57:36 +0000 (19:57 -0600)]
Limit array access in Position

This is a non-functional code style change that routes all position array accesses to single methods, and adds an assert to check correctness.

Passed STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 37312 W: 7378 L: 7246 D: 22688
Ptnml(0-2): 606, 4280, 8762, 4392, 616
https://tests.stockfishchess.org/tests/view/5e7c0c69e42a5c3b3ca2eb3d

closes https://github.com/official-stockfish/Stockfish/pull/2595

No functional change.

4 years agoSmall cleanups
Joost VandeVondele [Mon, 30 Mar 2020 20:45:35 +0000 (22:45 +0200)]
Small cleanups

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

No functional change.

4 years agoMovecount pruning reduction logic
Praveen tummala [Mon, 30 Mar 2020 04:52:42 +0000 (10:22 +0530)]
Movecount pruning reduction logic

This patch refines search reduction logic in case the position is not a former PV node and is pruned based on move count.

passed STC
https://tests.stockfishchess.org/tests/view/5e8092bde42a5c3b3ca2ed35
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 78848 W: 15480 L: 15170 D: 48198
Ptnml(0-2): 1406, 9310, 17773, 9438, 1497

passed LTC
https://tests.stockfishchess.org/tests/view/5e80bb13e42a5c3b3ca2ed4b
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 86596 W: 11451 L: 11033 D: 64112
Ptnml(0-2): 624, 7993, 25687, 8329, 665

closes https://github.com/official-stockfish/Stockfish/pull/2605

Bench: 5138771

4 years agoCount only the most advanced passed pawn for each file.
Vizvezdenec [Sun, 29 Mar 2020 17:04:20 +0000 (20:04 +0300)]
Count only the most advanced passed pawn for each file.

This patch adjusts definition of passed pawns - if there is a pawn of our color in the same file in front of a current pawn it's no longer counts as passed.

passed STC
https://tests.stockfishchess.org/tests/view/5e802037e42a5c3b3ca2ed07
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 215296 W: 41843 L: 41341 D: 132112
Ptnml(0-2): 3688, 25313, 49304, 25495, 3848

passed LTC
https://tests.stockfishchess.org/tests/view/5e806441e42a5c3b3ca2ed2b
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 74050 W: 9761 L: 9379 D: 54910
Ptnml(0-2): 510, 6838, 22025, 7064, 588

closes https://github.com/official-stockfish/Stockfish/pull/2602

bench: 4902237

4 years agoRemove previousScore adjustment of delta.
xoto10 [Thu, 26 Mar 2020 19:47:48 +0000 (19:47 +0000)]
Remove previousScore adjustment of delta.

STC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 14580 W: 2904 L: 2731 D: 8945
Ptnml(0-2): 243, 1665, 3339, 1762, 281
https://tests.stockfishchess.org/tests/view/5e7d080ae42a5c3b3ca2ebc6

LTC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 60338 W: 7870 L: 7831 D: 44637
Ptnml(0-2): 451, 5596, 18018, 5671, 433
https://tests.stockfishchess.org/tests/view/5e7d11b3e42a5c3b3ca2ebd3

closes https://github.com/official-stockfish/Stockfish/pull/2598

Bench 5247262

4 years agoTuned history reduction
Lyudmil Antonov [Mon, 17 Feb 2020 09:13:03 +0000 (11:13 +0200)]
Tuned history reduction

Value after a long Bayesian tuning, using a home-made classification approach.

STC
https://tests.stockfishchess.org/tests/view/5e7c7b16e42a5c3b3ca2eb66
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 45472 W: 8992 L: 8732 D: 27748
Ptnml(0-2): 795, 5276, 10352, 5500, 813

LTC
https://tests.stockfishchess.org/tests/view/5e7c8be7e42a5c3b3ca2eb75
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 22744 W: 3085 L: 2849 D: 16810
Ptnml(0-2): 156, 2090, 6658, 2298, 170

closes https://github.com/official-stockfish/Stockfish/pull/2597

Bench 5030855

4 years agoRemove passed_count from almostUnwinnable.
xoto10 [Wed, 25 Mar 2020 16:06:25 +0000 (16:06 +0000)]
Remove passed_count from almostUnwinnable.

This simplification allows the almostUnwinnable flag to match endgames where the pawns are all on the same flank but are not symmetrical.

STC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 23356 W: 4543 L: 4395 D: 14418
Ptnml(0-2): 346, 2651, 5582, 2707, 392
https://tests.stockfishchess.org/tests/view/5e7b8f57e42a5c3b3ca2eb09

LTC:
LLR: 2.96 (-2.94,2.94) {-1.50,0.50}
Total: 31778 W: 4097 L: 4023 D: 23658
Ptnml(0-2): 199, 2853, 9729, 2891, 217
https://tests.stockfishchess.org/tests/view/5e7ba5ade42a5c3b3ca2eb16

closes https://github.com/official-stockfish/Stockfish/pull/2596

Bench 4777139

4 years agoRemove KNPKB endgame.
protonspring [Mon, 23 Mar 2020 04:21:49 +0000 (22:21 -0600)]
Remove KNPKB endgame.

This is a functional simplification that removes the KNPKB endgame.

Testing on only KNPKB positions suggests that this removal actually gains Elo:

Score of patch vs master: 3380 - 3035 - 33585  [0.504] 40000
Elo difference: 3.0 +/- 1.4, LOS: 100.0 %, DrawRatio: 84.0 %

Score of patch vs master: 290 - 36 - 39674  [0.503] 40000
Elo difference: 2.2 +/- 0.3, LOS: 100.0 %, DrawRatio: 99.2 %

removal also doesn't cause a regression with the standard book:

STC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 71376 W: 13794 L: 13719 D: 43863
Ptnml(0-2): 1066, 8092, 17290, 8181, 1059
https://tests.stockfishchess.org/tests/view/5e76c3d5e42a5c3b3ca2e8be

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 28394 W: 3731 L: 3662 D: 21001
Ptnml(0-2): 167, 2339, 9116, 2408, 167
https://tests.stockfishchess.org/tests/view/5e76e5eae42a5c3b3ca2e8d3

closes https://github.com/official-stockfish/Stockfish/pull/2594

Bench 5480811

4 years agoAdjust singular extension search depth
Vizvezdenec [Fri, 20 Mar 2020 09:12:56 +0000 (12:12 +0300)]
Adjust singular extension search depth

This patch applies a different singular extension search logic in case the position is ttPv && !PvNode.
It changes the depth of this search, higher for this types of nodes, and lower for other nodes.

passed STC
http://tests.stockfishchess.org/tests/view/5e72bbaae42a5c3b3ca2e75e
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 12692 W: 2608 L: 2389 D: 7695
Ptnml(0-2): 238, 1414, 2839, 1601, 254

passed LTC
http://tests.stockfishchess.org/tests/view/5e731c07e42a5c3b3ca2e770
LLR: 2.96 (-2.94,2.94) {0.25,1.75}
Total: 145716 W: 19218 L: 18626 D: 107872
Ptnml(0-2): 1100, 13605, 42899, 14111, 1143

closes https://github.com/official-stockfish/Stockfish/pull/2590

Bench: 5398277

4 years agoAdjust singular LMR for positions seen in PV
Vizvezdenec [Tue, 17 Mar 2020 16:38:21 +0000 (19:38 +0300)]
Adjust singular LMR for positions seen in PV

This patch continues work on altering search for ttPv nodes, using recent idea to alter it more in not PvNodes. Previous tweak based on this idea adjusted singularBeta - this one adjusts value of singularLMR, so they are both related to singular extension search.

passed STC
http://tests.stockfishchess.org/tests/view/5e700737e42a5c3b3ca2e659
LLR: 2.95 (-2.94,2.94) {-0.50,1.50}
Total: 140608 W: 27053 L: 26659 D: 86896
Ptnml(0-2): 2425, 16337, 32439, 16625, 2478

passed LTC
http://tests.stockfishchess.org/tests/view/5e7068eae42a5c3b3ca2e687
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 79318 W: 10463 L: 10064 D: 58791
Ptnml(0-2): 567, 7416, 23359, 7685, 632

closes https://github.com/official-stockfish/Stockfish/pull/2588

Bench: 4952322

4 years agoAnchored bishops
Stéphane Nicolet [Tue, 17 Mar 2020 07:26:27 +0000 (08:26 +0100)]
Anchored bishops

Reduce the "bad bishop" penalty when the bishop is protected by
one of our pawns, as it may indicate that the bishop has found
a safe spot outside the pawn chain.

STC:
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 176942 W: 34142 L: 33696 D: 109104
Ptnml(0-2): 3129, 20422, 40919, 20876, 3125
http://tests.stockfishchess.org/tests/view/5e6f61aae42a5c3b3ca2e62d

LTC:
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 42252 W: 5615 L: 5322 D: 31315
Ptnml(0-2): 308, 3881, 12500, 4084, 353
http://tests.stockfishchess.org/tests/view/5e701382e42a5c3b3ca2e661

closes https://github.com/official-stockfish/Stockfish/pull/2587

Bench: 4963440

4 years agoSmall cleanups
Joost VandeVondele [Sat, 14 Mar 2020 16:04:50 +0000 (17:04 +0100)]
Small cleanups

closes https://github.com/official-stockfish/Stockfish/pull/2567

No functional change.

4 years agoSimplify futility pruning parent node
pb00067 [Fri, 13 Mar 2020 18:29:36 +0000 (19:29 +0100)]
Simplify futility pruning parent node

only continuation histories seem needed for this purpose.

STC:
http://tests.stockfishchess.org/tests/view/5e6b88dfe42a5c3b3ca2e4ab
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 113356 W: 21725 L: 21696 D: 69935
Ptnml(0-2): 1999, 13255, 26163, 13240, 2021

LTC:
http://tests.stockfishchess.org/tests/view/5e6babbfe42a5c3b3ca2e4c2
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 22164 W: 2917 L: 2821 D: 16426
Ptnml(0-2): 173, 2040, 6548, 2160, 161

closes https://github.com/official-stockfish/Stockfish/pull/2583

bench: 4839496

4 years agosimplify castling part of generate_all.
protonspring [Wed, 11 Mar 2020 22:27:51 +0000 (16:27 -0600)]
simplify castling part of generate_all.

somewhat more compact, generates same code.

close https://github.com/official-stockfish/Stockfish/pull/2580

No functional change.

4 years agoRemove set statScore to zero
silversolver1 [Sun, 8 Mar 2020 19:52:05 +0000 (14:52 -0500)]
Remove set statScore to zero

Simplification. Removes setting statScore to zero if negative.

STC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 84820 W: 16100 L: 16033 D: 52687
Ptnml(0-2): 1442, 9865, 19723, 9944, 1436
https://tests.stockfishchess.org/tests/view/5e654fdae42a5c3b3ca2e2f8

LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 57658 W: 7435 L: 7391 D: 42832
Ptnml(0-2): 441, 5397, 17104, 5451, 436
https://tests.stockfishchess.org/tests/view/5e657ce9e42a5c3b3ca2e307

closes https://github.com/official-stockfish/Stockfish/pull/2578

Bench: 5168890

4 years agoEquations for edges and corners.
protonspring [Mon, 9 Mar 2020 21:11:08 +0000 (22:11 +0100)]
Equations for edges and corners.

This is a functional simplification that removes the large arrays in endgames.cpp.
It also fixes a recently introduced bug (960d59d54143d84aab26deae65279a611fc989f4) in KNBvK,
now using flip_file() instead of ~.

One fen added to bench to increase endgame coverage.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 174724 W: 33325 L: 33404 D: 107995
Ptnml(0-2): 2503, 19607, 43181, 19608, 2463
http://tests.stockfishchess.org/tests/view/5e6448ffe42a5c3b3ca2e287

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 35640 W: 4679 L: 4621 D: 26340
Ptnml(0-2): 189, 2991, 11424, 3005, 211
http://tests.stockfishchess.org/tests/view/5e650b24e42a5c3b3ca2e2d8

closes https://github.com/official-stockfish/Stockfish/pull/2577

Bench: 5527957

4 years agoFix ambiguity between clamp implementations
Gary Heckman [Thu, 5 Mar 2020 17:37:08 +0000 (12:37 -0500)]
Fix ambiguity between clamp implementations

There is an ambiguity between global and std clamp implementations when compiling in c++17,
and on certain toolchains that are not strictly conforming to c++11.
This is solved by putting our clamp implementation in a namespace.

closes https://github.com/official-stockfish/Stockfish/pull/2572

No functional change.

4 years agoRemove KRPPKRPScaleFactors array
protonspring [Wed, 4 Mar 2020 18:32:17 +0000 (11:32 -0700)]
Remove KRPPKRPScaleFactors array

Fucntional simplification that removes the KRPPKRPScaleFactors array.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 47374 W: 9159 L: 9049 D: 29166
Ptnml(0-2): 707, 5325, 11560, 5341, 754
http://tests.stockfishchess.org/tests/view/5e5ff464e42a5c3b3ca2e156

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 31268 W: 4064 L: 3995 D: 23209
Ptnml(0-2): 173, 2734, 9764, 2777, 186
http://tests.stockfishchess.org/tests/view/5e61be6ce42a5c3b3ca2e1c1

closes https://github.com/official-stockfish/Stockfish/pull/2575

Bench 5123316

4 years agoCleanup KBPsK endgame
protonspring [Thu, 5 Mar 2020 19:07:48 +0000 (12:07 -0700)]
Cleanup KBPsK endgame

* Clarify distinction between strong side pawns and all pawns.
* Simplify and speed-up determination of pawns on the same file.
* Clarify comments.
* more_than_one() is probably faster than pos.count.

Passed STC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 40696 W: 7856 L: 7740 D: 25100
Ptnml(0-2): 584, 4519, 10054, 4579, 612
http://tests.stockfishchess.org/tests/view/5e6153b1e42a5c3b3ca2e1a9

closes https://github.com/official-stockfish/Stockfish/pull/2574

No functional change.

4 years agoSmall speed-up in BetweenBB
protonspring [Tue, 3 Mar 2020 23:35:45 +0000 (16:35 -0700)]
Small speed-up in BetweenBB

A speed-up removing some comparisons.

closes https://github.com/official-stockfish/Stockfish/pull/2571

No functional change.

4 years agoUse equations for PushAway and PushClose
protonspring [Tue, 3 Mar 2020 00:32:02 +0000 (17:32 -0700)]
Use equations for PushAway and PushClose

A functional simplification replacing the corresponding arrays. Tested in two variants,
also the simpler one performs well, even though differences to master should be minimal.

STC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 57864 W: 11092 L: 11001 D: 35771
Ptnml(0-2): 826, 6458, 14320, 6455, 873
http://tests.stockfishchess.org/tests/view/5e5da5b6e42a5c3b3ca2e05c

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 7198 W: 982 L: 883 D: 5333
Ptnml(0-2): 33, 575, 2296, 650, 45
http://tests.stockfishchess.org/tests/view/5e5df13ae42a5c3b3ca2e077

LTC (This exact version. . . more simplified)
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 5392 W: 729 L: 631 D: 4032
Ptnml(0-2): 23, 405, 1751, 485, 32
http://tests.stockfishchess.org/tests/view/5e5ead99e42a5c3b3ca2e0e4

closes https://github.com/official-stockfish/Stockfish/pull/2570

Bench 5123316

4 years agoConsolidate Square Flipping
protonspring [Sun, 1 Mar 2020 09:03:36 +0000 (02:03 -0700)]
Consolidate Square Flipping

Add a flip_rank() and flip_file() so that all of the square flipping can be consolidated.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 57234 W: 11064 L: 10969 D: 35201
Ptnml(0-2): 822, 6562, 13801, 6563, 869
http://tests.stockfishchess.org/tests/view/5e5d2f2aafe6254521f2ffaa

closes https://github.com/official-stockfish/Stockfish/pull/2568

No functional change.

4 years agoSmall cleanups
Joost VandeVondele [Sun, 1 Mar 2020 08:31:17 +0000 (09:31 +0100)]
Small cleanups

closes https://github.com/official-stockfish/Stockfish/pull/2546

No functional change.

4 years agoSimplify lowply-history logic
Guenther Demetz [Thu, 27 Feb 2020 14:58:22 +0000 (15:58 +0100)]
Simplify lowply-history logic

Don't restrict usage to ttPv nodes exclusively

STC:
http://tests.stockfishchess.org/tests/view/5e5634f284a82b4acd41499a
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 152796 W: 29146 L: 29178 D: 94472
Ptnml(0-2): 2590, 17792, 35628, 17836, 2552

LTC:
http://tests.stockfishchess.org/tests/view/5e575d4984a82b4acd4149e8
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 20078 W: 2688 L: 2587 D: 14803
Ptnml(0-2): 139, 1914, 5853, 1973, 160

closes https://github.com/official-stockfish/Stockfish/pull/2565

bench: 4923286

4 years agoWeak queen protection
Moez Jellouli [Sat, 22 Feb 2020 13:57:01 +0000 (14:57 +0100)]
Weak queen protection

Extra penalty if weak piece is only protected by a queen.

STC:
http://tests.stockfishchess.org/tests/view/5e53c6ab84a82b4acd4148fa
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 44630 W: 8615 L: 8359 D: 27656
Ptnml(0-2): 746, 5156, 10323, 5276, 814

LTC:
http://tests.stockfishchess.org/tests/view/5e54e05d84a82b4acd414947
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 175480 W: 23085 L: 22409 D: 129986
Ptnml(0-2): 1264, 16494, 51678, 16910, 1394

closes https://github.com/official-stockfish/Stockfish/pull/2564

Bench: 4923286

4 years agoFix TT write in MultiPV case.
AndyGrant [Mon, 24 Feb 2020 22:32:17 +0000 (23:32 +0100)]
Fix TT write in MultiPV case.

fixes an error reported earlier as https://github.com/official-stockfish/Stockfish/issues/2404 by @AndyGrant.

MultiPV at root shouldn't write to the TT for later lines, as that is neither the eval nor the bestmove for that position.
Fixing this error doesn't matter for playing games (http://tests.stockfishchess.org/tests/view/5dcdbd810ebc590256324a11).

However, it can lead to wrong mate announcements as reported by @uriblass. In particular the following testcase gives
wrong results for the second search, prior to this patch:

```
setoption name MultiPV value 2
position fen 5R2/2kB2p1/p2bR3/8/3p1B2/8/PPP5/2K5 b - - 0 49
go depth 40
position fen 2B2R2/3r2p1/p1kbR3/8/3p1B2/8/PPP5/2K5 b - - 8 48
go depth 40
```

fixes https://github.com/official-stockfish/Stockfish/issues/2561
closes https://github.com/official-stockfish/Stockfish/pull/2562

Only affects MultiPV search.

Bench: 4697493

4 years agoUse single param for Outpost and ReachableOutpost.
31m059 [Sun, 23 Feb 2020 02:27:32 +0000 (21:27 -0500)]
Use single param for Outpost and ReachableOutpost.

In November 2019, as a result of the simplification of rank-based outposts by 37698b0,
separate bonuses were introduced for outposts that are currently occupied and outposts
that are reachable on the next move. However, the values of these two bonuses are
quite similar, and they have remained that way for three months of development.

It appears that we can safely retire the separate ReachableOutpost parameter and
use the same Outpost bonus in both cases, restoring the basic principles of Stockfish
outpost evaluation to their pre-November state, while also reducing
the size of the parameter space.

STC:
LLR: 2.96 (-2.94,2.94) {-1.50,0.50}
Total: 47680 W: 9213 L: 9092 D: 29375
Ptnml(0-2): 776, 5573, 11071, 5594, 826
https://tests.stockfishchess.org/tests/view/5e51e33190a0a02810d09802

LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 14690 W: 1960 L: 1854 D: 10876
Ptnml(0-2): 93, 1381, 4317, 1435, 119
https://tests.stockfishchess.org/tests/view/5e52197990a0a02810d0980f

closes https://github.com/official-stockfish/Stockfish/pull/2559

Bench: 4697493

4 years agoImprove move order near the root
Günther Demetz [Fri, 21 Feb 2020 13:01:59 +0000 (14:01 +0100)]
Improve move order near the root

Current move histories are known to work well near the leaves, whilst at
higher depths they aren't very helpful. To address this problem this
patch introduces a table dedicated for what's happening at plies 0-3.
It's structured like mainHistory with ply index instead of color.
It get cleared with each new search and is filled during iterative
deepening at higher depths when recording successful quiet moves near
the root or traversing nodes which were in the principal variation
(ttPv).

Medium TC (20+0.2):
https://tests.stockfishchess.org/tests/view/5e4d358790a0a02810d096dc
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 100910 W: 16682 L: 16376 D: 67852
Ptnml(0-2): 1177, 10983, 25883, 11181, 1231

LTC:
https://tests.stockfishchess.org/tests/view/5e4e2cb790a0a02810d09714
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 80444 W: 10495 L: 10095 D: 59854
Ptnml(0-2): 551, 7479, 23803, 7797, 592

closes https://github.com/official-stockfish/Stockfish/pull/2557

Bench: 4705960