1
0
Fork 0
Commit Graph

2143 Commits (83eac08e7562d93787f75eccd4b7781c4bd45dd3)

Author SHA1 Message Date
Stéphane Nicolet 83eac08e75 Small cleanups (march 2021)
With help of @BM123499, @mstembera, @gvreuls, @noobpwnftw and @Fanael
Thanks!

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

No functional change
2021-03-24 17:11:06 +01:00
Vizvezdenec d58e83695f Remove advanced_pawn_push()
Continuation of work by @topologist: we now do futility pruning and movecount
pruning in qsearch() for pawn pushes up to the 7th rank. So the condition to
avoid the pruning is if the move is a promotion or not. This allows to get rid
of the advanced_pawn_push() function in position.h alltogether.

Passed STC
https://tests.stockfishchess.org/tests/view/6048c5842433018de7a387e6
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 34424 W: 3081 L: 3015 D: 28328
Ptnml(0-2): 110, 2442, 12052, 2488, 120

Passed LTC
https://tests.stockfishchess.org/tests/view/6048f7d22433018de7a387f0
LLR: 2.94 (-2.94,2.94) {-0.75,0.25}
Total: 142024 W: 5170 L: 5202 D: 131652
Ptnml(0-2): 50, 4678, 61613, 4596, 75

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

Bench: 4339126
2021-03-17 10:34:02 +01:00
Topologist f3b296c2e2 Change advanced pawn push threshold
A pawn push is now considered to be "advanced" if the relative destination
rank is > 6 (previously it was > 5). This affects the search heuristic.

Also remove an assert concerning en passant moves in qsearch().

STC:
LLR: 2.97 (-2.94,2.94) {-0.25,1.25}
Total: 46744 W: 4224 L: 4040 D: 38480
Ptnml(0-2): 165, 3206, 16451, 3380, 170
https://tests.stockfishchess.org/tests/view/604746082433018de7a3872e

LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 107840 W: 4198 L: 3892 D: 99750
Ptnml(0-2): 58, 3472, 46557, 3772, 61
https://tests.stockfishchess.org/tests/view/60475eae2433018de7a38737

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

Bench: 4796780
2021-03-10 12:32:53 +01:00
Dieter Dobbelaere 7ffae17f85 Add Stockfish namespace.
fixes #3350 and is a small cleanup that might make it easier to use SF
in separate projects, like a NNUE trainer or similar.

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

No functional change.
2021-03-07 14:26:54 +01:00
Stéphane Nicolet 0f3f5d85fb Introduce DistanceFromPV
We introduce a metric for each internal node in search, called DistanceFromPV.
This distance indicated how far the current node is from the principal variation.

We then use this distance to search the nodes which are close to the PV a little
deeper (up to 4 plies deeper than the PV): this improves the quality of the search
at these nodes and bring better updates for the PV during search.

STC:
LLR: 2.96 (-2.94,2.94) {-0.25,1.25}
Total: 54936 W: 5047 L: 4850 D: 45039
Ptnml(0-2): 183, 3907, 19075, 4136, 167
https://tests.stockfishchess.org/tests/view/6037b88e7f517a561bc4a392

LTC:
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 49608 W: 1880 L: 1703 D: 46025
Ptnml(0-2): 22, 1514, 21555, 1691, 22
https://tests.stockfishchess.org/tests/view/6038271b7f517a561bc4a3cb

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

Bench: 5037279
2021-02-26 19:45:29 +01:00
Vizvezdenec 7c30091a92 Introduce ProbCut for check evasions
The idea of this patch can be described as follows: if we are in check
and the transposition table move is a capture that returns a value
far above beta, we can assume that the opponent just blundered a piece
by giving check, and we return the transposition table value. This is
similar to the usual probCut logic for quiet moves, but with a different
threshold.

Passed STC
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 33440 W: 3056 L: 2891 D: 27493
Ptnml(0-2): 110, 2338, 11672, 2477, 123
https://tests.stockfishchess.org/tests/view/602cd1087f517a561bc49bda

Passed LTC
LLR: 2.98 (-2.94,2.94) {0.25,1.25}
Total: 10072 W: 401 L: 309 D: 9362
Ptnml(0-2): 2, 288, 4365, 378, 3
https://tests.stockfishchess.org/tests/view/602ceea57f517a561bc49bf0

The committed version has an additional fix to never return unproven wins
in the tablebase range or the mate range. This fix passed tests for non-
regression at STC and LTC:

STC:
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 26240 W: 2354 L: 2280 D: 21606
Ptnml(0-2): 85, 1763, 9372, 1793, 107
https://tests.stockfishchess.org/tests/view/602d86a87f517a561bc49c7a

LTC:
LLR: 2.95 (-2.94,2.94) {-0.75,0.25}
Total: 35304 W: 1299 L: 1256 D: 32749
Ptnml(0-2): 14, 1095, 15395, 1130, 18
https://tests.stockfishchess.org/tests/view/602d98d17f517a561bc49c83

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

Bench: 3830215
2021-02-20 22:49:39 +01:00
Vizvezdenec 6294db7514 Tune search parameters (with Unai Corzo)
The values used in this patch are taken from a SPSA parameter tuning session
originated by Unai Corzo (@unaiic), but the final difference of his tune was
multiplied x2 by hand. Most of the credits should go to him :-)

STC:
https://tests.stockfishchess.org/tests/view/602f03d07f517a561bc49d40
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 67664 W: 6252 L: 6035 D: 55377
Ptnml(0-2): 256, 4799, 23527, 4972, 278

LTC:
https://tests.stockfishchess.org/tests/view/602f41697f517a561bc49d5a
LLR: 2.96 (-2.94,2.94) {0.25,1.25}
Total: 26256 W: 1034 L: 906 D: 24316
Ptnml(0-2): 10, 804, 11377, 922, 15

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

Bench: 3957653
2021-02-20 22:22:07 +01:00
Lolligerhans 40cb0f076a Small trivial clean-ups, February 2021
Closes https://github.com/official-stockfish/Stockfish/pull/3329

No functional change
2021-02-16 01:31:42 +01:00
Vizvezdenec 76daa88cf8 PV-Nodes likely to fail low
Do not decrease reduction at pv-nodes which are likely to fail low.

The idea of this patch can be described as following: during the search, if a node
on the principal variation was re-searched in non-pv search and this re-search got
a value which was much lower than alpha, then we can assume that this pv-node is
likely to fail low again, and we can reduce more aggressively at this node.

Passed STC
https://tests.stockfishchess.org/tests/view/6023a5fa7f517a561bc49638
LLR: 2.95 (-2.94,2.94) {-0.25,1.25}
Total: 70288 W: 6443 L: 6223 D: 57622
Ptnml(0-2): 239, 5022, 24436, 5174, 273

Passed LTC
https://tests.stockfishchess.org/tests/view/6023f2617f517a561bc49661
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 105656 W: 4048 L: 3748 D: 97860
Ptnml(0-2): 67, 3312, 45761, 3630, 58

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

Bench: 3766422
2021-02-11 23:39:06 +01:00
bmc4 29ed22de8c Search Parameters Tuning
A simple tuning on search.cpp.

based SPSA test:
https://tests.stockfishchess.org/tests/view/601f2a787f517a561bc493cd

passed STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 117840 W: 10796 L: 10508 D: 96536
Ptnml(0-2): 422, 8381, 41041, 8639, 437
https://tests.stockfishchess.org/tests/view/602144c37f517a561bc494ae

passed LTC:
LLR: 2.96 (-2.94,2.94) {0.25,1.25}
Total: 25024 W: 972 L: 847 D: 23205
Ptnml(0-2): 7, 767, 10847, 876, 15
https://tests.stockfishchess.org/tests/view/602156877f517a561bc494be

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

Bench: 3974098
2021-02-08 21:42:03 +01:00
FauziAkram ee3f7b6b6e Bad Outpost Pawn Scale
Changed name from Bad Outpost to Uncontested Outpost
Scale Uncontested Outpost with number of pawns + Decrease Bishop PSQT values and general tuning

Credits for the decrease of the Bishop PSQT values: Fauzi
Credits for scaling Uncontested Outpost with number of pawns: Lolligerhans
Credits for the tunings: Fauzi

Passed STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 32040 W: 6593 L: 6281 D: 19166
Ptnml(0-2): 596, 3713, 7095, 4015, 601
https://tests.stockfishchess.org/tests/view/5ffa43026019e097de3ef0f2

Passed LTC:
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 84376 W: 11395 L: 10950 D: 62031
Ptnml(0-2): 652, 7930, 24623, 8287, 696
https://tests.stockfishchess.org/tests/view/5ffa6e7b6019e097de3ef0fd

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

Bench: 4287509
2021-01-11 19:42:31 +01:00
Vizvezdenec 37c2b5685e Refine stat based reductions
This patch separates stat based reductions for quiet moves in case of being in check and in case of not being in check.
We will be using sum of first continuation history and main history (similar to movepicker) instead of statScore for the first case.

passed STC
https://tests.stockfishchess.org/tests/view/5ff87b2f6019e097de3ef09b
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 63992 W: 5887 L: 5678 D: 52427
Ptnml(0-2): 201, 4561, 22305, 4686, 243

passed LTC
https://tests.stockfishchess.org/tests/view/5ff8b6206019e097de3ef0b2
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 81216 W: 3127 L: 2880 D: 75209
Ptnml(0-2): 46, 2544, 35176, 2801, 41

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

bench 4395984
2021-01-11 19:36:07 +01:00
Dieter Dobbelaere 87586b3d0c Use correct chess terms + fix spelling.
- "discovered check" (instead of "discovery check")
  - "en passant" (instead of "en-passant")
  - "pseudo-legal" before a noun (instead of "pseudo legal")
  - "3-fold" (instead of "3fold")

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

No functional change.
2021-01-11 19:19:39 +01:00
Vizvezdenec b1bb376c3c Small code cleanup in LMR
In a recent patch we added comparing capture history to a number for LMR of captures.
Calling it via thisThread-> is not needed since capture history was already declared by this time -
so removing makes code slightly shorter and easier to follow.

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

No functional change.
2021-01-11 19:17:03 +01:00
Joost VandeVondele c4d67d77c9 Update copyright years
No functional change
2021-01-08 17:04:23 +01:00
Vizvezdenec 2c1be0be8e Reorder conditions in LMR and pruning
Make code logic somewhat easier to follow.

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

No functional change.
2021-01-08 16:57:26 +01:00
Unai Corzo 8ec97d161e Remove razoring
has become ineffective now.

STC https://tests.stockfishchess.org/tests/view/5fe653403932f79192d3981a
LLR: 2.95 (-2.94,2.94) {-1.25,0.25}
Total: 63448 W: 5965 L: 5934 D: 51549
Ptnml(0-2): 230, 4738, 21769, 4745, 242

LTC https://tests.stockfishchess.org/tests/view/5fe6f0f03932f79192d39856
LLR: 2.93 (-2.94,2.94) {-0.75,0.25}
Total: 65368 W: 2485 L: 2459 D: 60424
Ptnml(0-2): 33, 2186, 28230, 2192, 43

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

bench: 4493379
2020-12-31 17:51:14 +01:00
Unai Corzo 8985c210a1 Simplify away late irreversible move extension
Late irreversible move extension seems to be useless now.

STC https://tests.stockfishchess.org/tests/view/5fe75c5c3932f79192d398ca
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 196192 W: 18111 L: 18278 D: 159803
Ptnml(0-2): 681, 14097, 68652, 14040, 626

LTC https://tests.stockfishchess.org/tests/view/5fe875e23932f79192d39952
LLR: 2.96 (-2.94,2.94) {-0.75,0.25}
Total: 28080 W: 1105 L: 1053 D: 25922
Ptnml(0-2): 13, 904, 12158, 948, 17

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

bench: 4144640
2020-12-31 17:48:47 +01:00
Unai Corzo c57c71bf5c Assorted parameter tweak
Parameter tweak from various tunes and patches.

STC https://tests.stockfishchess.org/tests/view/5fec2ae36019e097de3ee94a
LLR: 2.97 (-2.94,2.94) {-0.25,1.25}
Total: 41976 W: 4032 L: 3848 D: 34096
Ptnml(0-2): 147, 3086, 14341, 3264, 150

LTC https://tests.stockfishchess.org/tests/view/5fec5c3c6019e097de3ee973
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 23936 W: 970 L: 844 D: 22122
Ptnml(0-2): 14, 749, 10319, 869, 17

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

bench: 4354546
2020-12-31 17:44:15 +01:00
Stefan Geschwentner 4262461457 Tweak capture LMR.
Apply the recently added LMR condition for captures at nodes which are not PV or former PV nodes only if capture history is not too good.

STC:
LLR: 2.96 (-2.94,2.94) {-0.25,1.25}
Total: 95296 W: 8917 L: 8660 D: 77719
Ptnml(0-2): 323, 6871, 33045, 7044, 365
https://tests.stockfishchess.org/tests/view/5feca7f46019e097de3ee9ae

LTC:
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 29216 W: 1172 L: 1034 D: 27010
Ptnml(0-2): 11, 946, 12568, 1060, 23
https://tests.stockfishchess.org/tests/view/5fecf1786019e097de3ee9d5

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

Bench: 4006138
2020-12-31 17:41:34 +01:00
Vizvezdenec 51deae8998 Do more LMR for captures
This patch enables LMR for all captures at allNodes that were not in PV.
Currently we do LMR for all captures at cutNodes so this is an expansion of this logic:
now we do LMR for all captures almost at all non-pv nodes,
excluding only allNodes that were in PV.

passed STC
https://tests.stockfishchess.org/tests/view/5fe50b9d3932f79192d3973c
LLR: 2.95 (-2.94,2.94) {-0.25,1.25}
Total: 83128 W: 7606 L: 7368 D: 68154
Ptnml(0-2): 292, 5905, 28939, 6129, 299

passed LTC
https://tests.stockfishchess.org/tests/view/5fe552e43932f79192d39744
LLR: 2.92 (-2.94,2.94) {0.25,1.25}
Total: 13968 W: 568 L: 466 D: 12934
Ptnml(0-2): 5, 418, 6043, 506, 12

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

Bench: 4194835
2020-12-25 10:21:00 +01:00
pb00067 1f3b5b8b54 Simplify condition for assigning static-eval based bonus
for quiet move ordering and simplify bonus formula.

Due to clamping the bonus to relative low values the impact on high
depths is minimal, thus the restriction to low depths seems not
necessary.
Also the condition of movecount in previous node seems to be not
determinant.

Passed STC:
LLR: 2.95 (-2.94,2.94) {-1.25,0.25}
Total: 14600 W: 1424 L: 1323 D: 11853
Ptnml(0-2): 55, 1033, 5020, 1140, 52
https://tests.stockfishchess.org/tests/view/5fd67b381ac16912018885ec

Passed LTC:
LLR: 2.95 (-2.94,2.94) {-0.75,0.25}
Total: 85008 W: 3218 L: 3206 D: 78584
Ptnml(0-2): 49, 2840, 36700, 2880, 35
https://tests.stockfishchess.org/tests/view/5fd6af041ac16912018885f8

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

bench: 4524994
2020-12-18 21:19:46 +01:00
Vizvezdenec a88a38c3a9 Increase reduction in case of stable best move
The idea of this patch is pretty simple - we already do more reductions
for non-PV and root nodes in case of stable best move for depth > 10.
This patch makes us do so if root depth if > 10 instead, which
is logical since best move changes (thus instability of it) is
counted at root, so it makes a lot of sense to use depth of the root.

passed STC
https://tests.stockfishchess.org/tests/view/5fd643271ac16912018885c5
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 13232 W: 1308 L: 1169 D: 10755
Ptnml(0-2): 39, 935, 4535, 1062, 45

passed LTC
https://tests.stockfishchess.org/tests/view/5fd68db11ac16912018885f0
LLR: 2.96 (-2.94,2.94) {0.25,1.25}
Total: 14024 W: 565 L: 463 D: 12996
Ptnml(0-2): 3, 423, 6062, 517, 7

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

Bench: 4050630
2020-12-14 07:52:02 +01:00
pb00067 16adcb5374 Merge static history into main history,
thus simplifying and reducing the memory footprint.
I believe using static diff for better move ordering is more suited for
low depths, so restrict writing to low depths.

Todo: probably the condition for writing can be simplified

LTC:
LLR: 2.95 (-2.94,2.94) {-0.75,0.25}
Total: 18752 W: 768 L: 705 D: 17279
Ptnml(0-2): 7, 635, 8034, 688, 12
https://tests.stockfishchess.org/tests/view/5fd631791ac169120188859e

STC:
LLR: 2.95 (-2.94,2.94) {-1.25,0.25}
Total: 36504 W: 3380 L: 3313 D: 29811
Ptnml(0-2): 116, 2667, 12645, 2682, 142
https://tests.stockfishchess.org/tests/view/5fd5ed861ac1691201888569

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

bench: 4018036
2020-12-14 07:48:48 +01:00
Vizvezdenec 8630d03dd4 Add comments to uncommented parts of code
https://github.com/official-stockfish/Stockfish/pull/3250

No functional change
2020-12-05 16:58:42 +01:00
Vizvezdenec be7a03a957 Introduce static history
The idea of this patch can be described as following: we update static
history stats based on comparison of the static evaluations of the
position before and after the move. If the move increases static evaluation
it's assigned positive bonus, if it decreases static evaluation
it's assigned negative bonus. These stats are used in movepicker
to sort quiet moves.

passed STC
https://tests.stockfishchess.org/tests/view/5fca4c0842a050a89f02cd66
LLR: 3.00 (-2.94,2.94) {-0.25,1.25}
Total: 78152 W: 7409 L: 7171 D: 63572
Ptnml(0-2): 303, 5695, 26873, 5871, 334

passed LTC
https://tests.stockfishchess.org/tests/view/5fca6be442a050a89f02cd75
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 40240 W: 1602 L: 1441 D: 37197
Ptnml(0-2): 19, 1306, 17305, 1475, 15

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

bench 3845156
2020-12-05 16:48:33 +01:00
Unai Corzo 2442ba2b0e Reductions simplification
Simplify increase reduction for captures/promotions if late move and at low depth.

STC https://tests.stockfishchess.org/tests/view/5fbff65067cbf42301d6b3ae
LLR: 2.97 (-2.94,2.94) {-1.25,0.25}
Total: 49088 W: 4607 L: 4555 D: 39926
Ptnml(0-2): 177, 3615, 16932, 3619, 201

LTC https://tests.stockfishchess.org/tests/view/5fc0902967cbf42301d6b3fc
LLR: 2.99 (-2.94,2.94) {-0.75,0.25}
Total: 160944 W: 6153 L: 6193 D: 148598
Ptnml(0-2): 90, 5525, 69294, 5461, 102

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

bench: 3834568
2020-11-29 16:52:51 +01:00
Unai Corzo 6c429c4d65 Search simplification
STC https://tests.stockfishchess.org/tests/view/5fc2083942a050a89f02c8bb
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 23200 W: 2251 L: 2160 D: 18789
Ptnml(0-2): 86, 1726, 7895, 1797, 96

LTC https://tests.stockfishchess.org/tests/view/5fc22d7b42a050a89f02c8d0
LLR: 2.92 (-2.94,2.94) {-0.75,0.25}
Total: 15832 W: 653 L: 590 D: 14589
Ptnml(0-2): 7, 521, 6795, 588, 5

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

bench: 3827317

Simplify search.
2020-11-29 16:42:40 +01:00
lonfom169 66da1e802c Remove bonus for killers.
Passed non-regression STC:
LLR: 2.94 (-2.94,2.94) {-1.25,0.25}
Total: 14712 W: 1416 L: 1315 D: 11981
Ptnml(0-2): 59, 1029, 5082, 1124, 62
https://tests.stockfishchess.org/tests/view/5fbfa31f67cbf42301d6b36e

Passed non-regression LTC:
LLR: 2.95 (-2.94,2.94) {-0.75,0.25}
Total: 27536 W: 1099 L: 1044 D: 25393
Ptnml(0-2): 11, 929, 11838, 974, 16
https://tests.stockfishchess.org/tests/view/5fbfac9167cbf42301d6b371

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

Bench: 3887644
2020-11-29 16:40:06 +01:00
Unai Corzo 9fb6383ed8 Assorted search and eval parameter tune
Search and eval parameter tune.

STC https://tests.stockfishchess.org/tests/view/5fba850a67cbf42301d6b07d
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 24312 W: 2388 L: 2228 D: 19696
Ptnml(0-2): 85, 1800, 8241, 1930, 100

LTC https://tests.stockfishchess.org/tests/view/5fbad5ea67cbf42301d6b0fa
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 88376 W: 3619 L: 3351 D: 81406
Ptnml(0-2): 56, 2977, 37849, 3255, 51

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

bench: 3600361
2020-11-25 21:05:08 +01:00
Stéphane Nicolet 027626db1e Small cleanups 13
No functional change
2020-11-23 22:20:32 +01:00
SFisGOD 285bf7041a Increase reduction at root
when the best move does not change frequently

STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 51320 W: 5159 L: 4956 D: 41205
Ptnml(0-2): 215, 3897, 17242, 4082, 224
https://tests.stockfishchess.org/tests/view/5faa072367cbf42301d6a767

LTC:
LLR: 2.98 (-2.94,2.94) {0.25,1.25}
Total: 15952 W: 762 L: 642 D: 14548
Ptnml(0-2): 8, 561, 6725, 667, 15
https://tests.stockfishchess.org/tests/view/5faa4c3567cbf42301d6a794

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

Bench: 3954692
2020-11-12 12:49:03 +01:00
lonfom169 b5781150ea Increase reduction based on the number of best move changes.
Thanks to Vizvezdenec for the PvNode idea and also to vondele the !PvNode idea.

Passed STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 19120 W: 1998 L: 1839 D: 15283
Ptnml(0-2): 76, 1445, 6375, 1572, 92
https://tests.stockfishchess.org/tests/view/5fa8af3e67cbf42301d6a6c9

Passed LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 75584 W: 3454 L: 3205 D: 68925
Ptnml(0-2): 54, 2832, 31771, 3081, 54

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

Bench: 3595418
2020-11-10 18:21:05 +01:00
Stéphane Nicolet 392b529c3f Qsearch pruning: follow-up
This is a follow-up of the recent qsearch pruning patch in
a260c9a8a2

We now use the same guard condition (testing that we already have a defense with
a score better  score than a TB loss) for all pruning heuristics in qsearch().
This allows some pruning when in check, but  in a controlled way to ensure that
no wrong mate scores appear.

Tested with Elo-gaining bounds:

STC:
LLR: 2.97 (-2.94,2.94) {-0.25,1.25}
Total: 22632 W: 2433 L: 2264 D: 17935
Ptnml(0-2): 98, 1744, 7487, 1865, 122
https://tests.stockfishchess.org/tests/view/5fa59405936c54e11ec99515

LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 105432 W: 4965 L: 4648 D: 95819
Ptnml(0-2): 85, 4110, 44011, 4423, 87
https://tests.stockfishchess.org/tests/view/5fa5b609936c54e11ec9952a

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

Bench: 3578092
2020-11-08 09:15:34 +01:00
Joost VandeVondele 04a320666e Change handling the special case of a single legal move.
Using no searching time in case of a single legal move is not beneficial from
a strength point of view, and this special case can be easily removed:

STC:
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 22472 W: 2458 L: 2357 D: 17657
Ptnml(0-2): 106, 1733, 7453, 1842, 102
https://tests.stockfishchess.org/tests/view/5f926cbc81eda81bd78cb6df

LTC:
LLR: 2.94 (-2.94,2.94) {-0.75,0.25}
Total: 37880 W: 1736 L: 1682 D: 34462
Ptnml(0-2): 22, 1392, 16057, 1448, 21
https://tests.stockfishchess.org/tests/view/5f92a26081eda81bd78cb6fe

The advantage of using the normal time management for a single legal move is that scores
reported for that move are reasonable, not searching leads to artifacts during games
(see e.g. https://tcec-chess.com/#div=sf&game=96&season=19)

The disadvantage of using normal time management of a single legal move is that thinking
times can be unnaturally long, making it 'painful to watch' in online tournaments.

This patch uses normal time management, but caps the used time to 500ms.
This should lead to reasonable scores, and be hardly perceptible.

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

variant of a patch suggested by SFisGOD

No functional change.
2020-11-07 16:48:02 +01:00
Tomasz Sobczyk 3f6451eff7 Manually align arrays on the stack
as a workaround to issues with overaligned alignas() on stack variables in gcc < 9.3 on windows.

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

fixes #3216

No functional change
2020-11-04 19:52:42 +01:00
J. Oster a260c9a8a2 Fix incorrect pruning in qsearch
Only do countermove based pruning in qsearch if we already have a move with a better score than a TB loss.

This patch fixes a bug (started as 843a961) that incorrectly prunes moves if in check,
and adds an assert to make sure no wrong mate scores are given in the future.
It replaces a no-op moveCount check with a check for bestValue.

Initially discussed in #3171 and later in #3199, #3198 and #3210.
This PR effectively closes #3171
It also likely fixes #3196 where this causes user visible incorrect TB scores,
which probably result from these incorrect mate scores.

Passed STC and LTC non-regression tests.
https://tests.stockfishchess.org/tests/view/5f9ef8dabca9bf35bae7f648
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 21672 W: 2339 L: 2230 D: 17103
Ptnml(0-2): 126, 1689, 7083, 1826, 112

https://tests.stockfishchess.org/tests/view/5f9f0caebca9bf35bae7f666
LLR: 2.97 (-2.94,2.94) {-0.75,0.25}
Total: 33152 W: 1551 L: 1485 D: 30116
Ptnml(0-2): 27, 1308, 13832, 1390, 19

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

Bench: 3625915
2020-11-02 19:41:17 +01:00
xoto10 f5dfad5d72 Reduce big time spikes by reducing PV re-searches.
Save time by reducing PV re-searches above original depth. Instead use 5% extra time on every move.

STC 10+0.1 th 1 :
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 90688 W: 9702 L: 9436 D: 71550
Ptnml(0-2): 408, 7252, 29792, 7450, 442
https://tests.stockfishchess.org/tests/view/5f8df807bacb75a4f9a47223

LTC 60+0.6 th 1 :
LLR: 2.97 (-2.94,2.94) {0.25,1.25}
Total: 97856 W: 4602 L: 4303 D: 88951
Ptnml(0-2): 53, 3757, 41057, 3960, 101
https://tests.stockfishchess.org/tests/view/5f8ec4872c92c7fe3a8c602d

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

Bench 3943959
2020-10-22 20:08:15 +02:00
Vizvezdenec 560c776397 Do more reductions for late quiet moves in case of consecutive fail highs.
Idea of this patch can be described as following - in case we have consecutive fail highs and we reach late enough moves at root node probability of remaining quiet moves being able to produce even bigger value than moves that produced previous cutoff (so ones that should be high in move ordering but now they fail to produce beta cutoff because we actually reached high move count) should be quiet small so we can reduce them more.

passed STC
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 53392 W: 5681 L: 5474 D: 42237
Ptnml(0-2): 214, 4104, 17894, 4229, 255
https://tests.stockfishchess.org/tests/view/5f88501adcdad978fe8c527e

passed LTC
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 59136 W: 2773 L: 2564 D: 53799
Ptnml(0-2): 30, 2117, 25078, 2300, 43
https://tests.stockfishchess.org/tests/view/5f884dbfdcdad978fe8c527a

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

Bench: 4066972
2020-10-18 13:54:28 +02:00
Unai Corzo 17fb3a8ce0 Simplify away futility pruning for captures
Remove futility pruning for captures.

STC https://tests.stockfishchess.org/tests/view/5f749bfed930428c36d34c56
LLR: 2.94 (-2.94,2.94) {-1.25,0.25}
Total: 38064 W: 4011 L: 3929 D: 30124
Ptnml(0-2): 192, 3004, 12567, 3068, 201

LTC https://tests.stockfishchess.org/tests/view/5f74d99bf18675b1ce2f7412
LLR: 2.94 (-2.94,2.94) {-0.75,0.25}
Total: 184984 W: 8567 L: 8610 D: 167807
Ptnml(0-2): 146, 7593, 77058, 7548, 147

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

bench: 3890648
2020-10-05 18:59:02 +02:00
Stefan Geschwentner 6f0aa186d8 Tweak reduction formula.
Replace log(i) with log(i + 0.25 * log(i)). This increases especially for low values the reductions. But for bigger values there are nearly no changes.

STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 49640 W: 5505 L: 5289 D: 38846
Ptnml(0-2): 270, 4074, 15924, 4274, 278
https://tests.stockfishchess.org/tests/view/5f71f04d3b22d6afa5069478

LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 43856 W: 2209 L: 2021 D: 39626
Ptnml(0-2): 32, 1776, 18128, 1956, 36
https://tests.stockfishchess.org/tests/view/5f7232ee3b22d6afa50699a2

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

Bench: 3555769
2020-09-28 22:34:25 +02:00
Vizvezdenec a5e68d9b25 Adjust null move pruning constants
Idea is that division by fraction of 2 is slightly faster than by other numbers so parameters are adjusted in a way that division in null move pruning depth reduction features dividing by 256 instead of dividing by 213.
Other than this patch is almost non-functional - difference starts to exist by depth 133.

passed STC
https://tests.stockfishchess.org/tests/view/5f70dd943b22d6afa50693c5
LLR: 2.95 (-2.94,2.94) {-0.25,1.25}
Total: 57048 W: 6616 L: 6392 D: 44040
Ptnml(0-2): 304, 4583, 18531, 4797, 309

passed LTC
https://tests.stockfishchess.org/tests/view/5f7180db3b22d6afa506941f
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 45960 W: 2419 L: 2229 D: 41312
Ptnml(0-2): 43, 1779, 19137, 1987, 34

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

bench 3789924
2020-09-28 22:22:54 +02:00
Stéphane Nicolet 3d5b2c8a51 Increase reductions with the number of threads
Passed STC with 8 threads:
LLR: 2.92 (-2.94,2.94) {-0.25,1.25}
Total: 13520 W: 1135 L: 1012 D: 11373
Ptnml(0-2): 39, 815, 4929, 938, 39
https://tests.stockfishchess.org/tests/view/5f68e274ded68c240be73f41

Passed LTC with 8 threads:
LLR: 2.96 (-2.94,2.94) {0.25,1.25}
Total: 48384 W: 2183 L: 1994 D: 44207
Ptnml(0-2): 28, 1777, 20402, 1948, 37
https://tests.stockfishchess.org/tests/view/5f68f068ded68c240be747e9

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

No functional change (for one thread)
2020-09-22 22:45:02 +02:00
Stéphane Nicolet 9a64e737cf Small cleanups 12
- Clean signature of functions in namespace NNUE
- Add comment for countermove based pruning
- Remove bestMoveCount variable
- Add const qualifier to kpp_board_index array
- Fix spaces in get_best_thread()
- Fix indention in capture LMR code in search.cpp
- Rename TtmemDeleter to LargePageDeleter

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

No functional change
2020-09-21 10:41:10 +02:00
Unai Corzo 8559c43914 Simplify reduced depth search
Simplification in reduced depth search.

STC https://tests.stockfishchess.org/tests/view/5f64c72fbb0cae038ca8f531
LLR: 2.94 (-2.94,2.94) {-1.25,0.25}
Total: 28320 W: 3475 L: 3359 D: 21486
Ptnml(0-2): 170, 2485, 8773, 2523, 209

LTC https://tests.stockfishchess.org/tests/view/5f650cfabb0cae038ca8f585
LLR: 2.95 (-2.94,2.94) {-0.75,0.25}
Total: 58392 W: 3354 L: 3285 D: 51753
Ptnml(0-2): 74, 2826, 23336, 2877, 83

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

bench: 4201295
2020-09-21 07:47:41 +02:00
Unai Corzo 64a63464d7 Simplify futility pruning for captures
STC https://tests.stockfishchess.org/tests/view/5f61f0e4b91f2ec371e429c2
LLR: 2.94 (-2.94,2.94) {-1.25,0.25}
Total: 75512 W: 8747 L: 8704 D: 58061
Ptnml(0-2): 440, 6589, 23683, 6576, 468

LTC https://tests.stockfishchess.org/tests/view/5f6215d3912c15f19854b801
LLR: 2.95 (-2.94,2.94) {-0.75,0.25}
Total: 92912 W: 5030 L: 4992 D: 82890
Ptnml(0-2): 88, 4363, 37532, 4369, 104

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

bench: 3856086
2020-09-17 07:06:21 +02:00
Unai Corzo 0ca93c5b94 Remove castling extension
STC https://tests.stockfishchess.org/tests/view/5f5fa5348fbc1c8a3f476eca
LLR: 2.94 (-2.94,2.94) {-1.25,0.25}
Total: 38520 W: 4713 L: 4610 D: 29197
Ptnml(0-2): 233, 3486, 11734, 3559, 248

LTC https://tests.stockfishchess.org/tests/view/5f62166a912c15f19854b806
LLR: 2.93 (-2.94,2.94) {-0.75,0.25}
Total: 48024 W: 2673 L: 2600 D: 42751
Ptnml(0-2): 64, 2247, 19316, 2322, 63

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

bench: 3818400
2020-09-17 07:06:21 +02:00
xoto10 5f426d8667 Use 2 * bestMoveChanges.
NNUE appears to provide a more stable eval than the classic eval,
so the time use dependencies on bestMoveChanges, fallingEval,
etc may need to change to make the best use of available time.
This change doubles the effect of totBestMoveChanges when giving
more time because the choice of best move is unstable.

STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 101928 W: 11995 L: 11698 D: 78235 Elo +0.78
Ptnml(0-2): 592, 8707, 32103, 8936, 626
https://tests.stockfishchess.org/tests/view/5f538a462d02727c56b36cec

LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 186392 W: 10383 L: 9877 D: 166132 Elo +0.81
Ptnml(0-2): 207, 8370, 75539, 8870, 210
https://tests.stockfishchess.org/tests/view/5f54a9712d02727c56b36d5a

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

Bench 4222126
2020-09-16 20:56:40 +02:00
mckx00 35ab8254b7 Simplify StatSCore Initialization
No need to initialize StatScore at rootNode. Current Logic is redundant because at subsequent levels the grandchildren statScore is initialized to zero.

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

Non functional change.
2020-09-15 07:19:02 +02:00
Vizvezdenec 9a063fc3cb Adjust penalty on refuted early quiet moves
This patch changes how previous early moves are penalized in case
search finds a best move. Here, the first quiet move that was not
a transposition table move is penalized.

passed STC
https://tests.stockfishchess.org/tests/view/5f51d839ba100690c5cc5f69
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 10088 W: 1150 L: 997 D: 7941
Ptnml(0-2): 41, 772, 3278, 899, 54

passed LTC
https://tests.stockfishchess.org/tests/view/5f51e435ba100690c5cc5f76
LLR: 2.93 (-2.94,2.94) {0.25,1.25}
Total: 30808 W: 1564 L: 1405 D: 27839
Ptnml(0-2): 19, 1245, 12717, 1404, 19

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

bench 3983758
2020-09-04 18:52:46 +02:00