1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00
Commit graph

5162 commits

Author SHA1 Message Date
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
Sami Kiminki
485d517c68 Add large page support for NNUE weights and simplify TT mem management
Use TT memory functions to allocate memory for the NNUE weights. This
should provide a small speed-up on systems where large pages are not
automatically used, including Windows and some Linux distributions.

Further, since we now have a wrapper for std::aligned_alloc(), we can
simplify the TT memory management a bit:

- We no longer need to store separate pointers to the hash table and
  its underlying memory allocation.
- We also get to merge the Linux-specific and default implementations
  of aligned_ttmem_alloc().

Finally, we'll enable the VirtualAlloc code path with large page
support also for Win32.

STC: https://tests.stockfishchess.org/tests/view/5f66595823a84a47b9036fba
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 14896 W: 1854 L: 1686 D: 11356
Ptnml(0-2): 65, 1224, 4742, 1312, 105

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

No functional change.
2020-09-21 08:43:48 +02:00
Stefan Geschwentner
16b4578cc1 Tweak hybrid treshold.
Increase the first hybrid threshold with more material.
Rewrite the hybrid rules for clarity.

STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 24416 W: 3039 L: 2848 D: 18529
Ptnml(0-2): 135, 2136, 7503, 2271, 163
https://tests.stockfishchess.org/tests/view/5f6451efbb0cae038ca8f4dc

LTC;
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 65016 W: 3702 L: 3455 D: 57859
Ptnml(0-2): 66, 2991, 26157, 3218, 76
https://tests.stockfishchess.org/tests/view/5f64b143bb0cae038ca8f51f

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

Bench: 3973739
2020-09-21 08:19: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
syzygy1
8b8a510fd6 Use tiling to speed up accumulator refreshes and updates
Perform the update and refresh operations tile by tile in a local
array of vectors. By selecting the array size carefully, we
achieve that the compiler keeps the whole array in vector registers.

Idea and original implementation by @sf-x.

STC: https://tests.stockfishchess.org/tests/view/5f623eec912c15f19854b855
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 4872 W: 623 L: 477 D: 3772
Ptnml(0-2): 14, 350, 1585, 450, 37

LTC: https://tests.stockfishchess.org/tests/view/5f62434e912c15f19854b860
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 25808 W: 1565 L: 1401 D: 22842
Ptnml(0-2): 23, 1186, 10332, 1330, 33

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

No functional change
2020-09-17 17:24:52 +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
GoldenRare
df43805953 Added FEN string to bench output
fixes https://github.com/official-stockfish/Stockfish/pull/3117

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

No functional change
2020-09-17 07:06:21 +02:00
syzygy1
d86663af14 Improve NDK section in Makefile
This PR sets the "comp" variable simply to "clang",
which seems to be more consistent and allows a small simplification.

The PR also moves the section that sets "profile_make" and "profile_use" to after the NDK section,
which ensures that these variables are now set correctly for NDK/clang.

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

No functional change
2020-09-16 21:00:14 +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
Sergio Vieri
7135678f71 Update default net to nn-03744f8d56d8.nnue
Equivalent to 20200914-1520

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

Bench: 4222126
2020-09-15 07:21:04 +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
SFisGOD
0405f35403 Double probability of using classical eval
This patch doubles the moderate imbalance threshold and probability of using classical eval.
So now if imbalance is greater than PawnValueMg / 4 then there is a 1/8 chance of using classical eval.

STC:
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 10984 W: 1303 L: 1140 D: 8541
Ptnml(0-2): 58, 867, 3489, 1010, 68
https://tests.stockfishchess.org/tests/view/5f554c9f97da2d5437d3813e

LTC:
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 43064 W: 2476 L: 2276 D: 38312
Ptnml(0-2): 37, 1985, 17308, 2145, 57
https://tests.stockfishchess.org/tests/view/5f55690a00a0aa2ca79f0a43

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

Bench: 4161067
2020-09-08 22:56:08 +02:00
Gian-Carlo Pascutto
d2562cde12 Always re-enable NNUE after "bench".
Restore the default NNUE setting (enabled) after a bench command.
This also makes the resulting program settings independent of the
number of FENs that are being benched.

Fixes issue #3112.

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

No functional change.
2020-09-08 22:53:50 +02:00
syzygy1
fc27d158c0 Bug fix in do_null_move() and NNUE simplification.
This fixes #3108 and removes some NNUE code that is currently not used.

At the moment, do_null_move() copies the accumulator from the previous
state into the new state, which is correct. It then clears the "computed_score"
flag because the side to move has changed, and with the other side to move
NNUE will return a completely different evaluation (normally with changed
sign but also with different NNUE-internal tempo bonus).

The problem is that do_null_move() clears the wrong flag. It clears the
computed_score flag of the old state, not of the new state. It turns out
that this almost never affects the search. For example, fixing it does not
change the current bench (but it does change the previous bench). This is
because the search code usually avoids calling evaluate() after a null move.

This PR corrects do_null_move() by removing the computed_score flag altogether.
The flag is not needed because nnue_evaluate() is never called twice on a position.

This PR also removes some unnecessary {}s and inserts a few blank lines
in the modified NNUE files in line with SF coding style.

Resulf ot STC non-regression test:
LLR: 2.95 (-2.94,2.94) {-1.25,0.25}
Total: 26328 W: 3118 L: 3012 D: 20198
Ptnml(0-2): 126, 2208, 8397, 2300, 133
https://tests.stockfishchess.org/tests/view/5f553ccc2d02727c56b36db1

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

bench: 4109324
2020-09-08 22:53:17 +02:00
SFisGOD
d539da19d2 Use classical eval more often
If there is a moderate imbalance, use classical eval with small probability (1/16),
as derived from the node counter.

STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 32320 W: 3562 L: 3377 D: 25381
Ptnml(0-2): 144, 2609, 10478, 2776, 153
https://tests.stockfishchess.org/tests/view/5f520615ba100690c5cc5f80

LTC:
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 21032 W: 1116 L: 974 D: 18942
Ptnml(0-2): 20, 837, 8664, 971, 24
https://tests.stockfishchess.org/tests/view/5f522eaaba100690c5cc5f8c

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

Bench: 4109324
2020-09-04 18:58:34 +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
Sergio Vieri
9cc482c788 Update default net to nn-308d71810dff.nnue
equivalent to 20200903-1739

Net trained from scratch, so it has quite different features extracted compared to the previous net (82215d0fd0df).

STC:
LLR: 2.98 (-2.94,2.94) {-0.25,1.25}
Total: 108328 W: 14048 L: 13719 D: 80561
Ptnml(0-2): 842, 10039, 32062, 10390, 831
https://tests.stockfishchess.org/tests/view/5f50e053ba100690c5cc5f00

LTC:
LLR: 2.96 (-2.94,2.94) {0.25,1.25}
Total: 13872 W: 1059 L: 890 D: 11923
Ptnml(0-2): 30, 724, 5270, 871, 41
https://tests.stockfishchess.org/tests/view/5f51821fba100690c5cc5f36

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

Bench: 3832716
2020-09-04 08:03:43 +02:00
VoyagerOne
2a69611509 LMR Simplification
remove reduction at non-check cut nodes for second move at low depths

STC:
LLR: 2.95 (-2.94,2.94) {-1.25,0.25}
Total: 61712 W: 6594 L: 6543 D: 48575
Ptnml(0-2): 293, 5085, 20082, 5070, 326
https://tests.stockfishchess.org/tests/view/5f5007d6ba100690c5cc5ea9

LTC:
LLR: 2.94 (-2.94,2.94) {-0.75,0.25}
Total: 57544 W: 2983 L: 2925 D: 51636
Ptnml(0-2): 47, 2568, 23495, 2604, 58
https://tests.stockfishchess.org/tests/view/5f50c597ba100690c5cc5ef7

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

Bench: 3952302
2020-09-04 08:00:45 +02:00
Unai Corzo
d6530f7d49 Simplify singularQuietLMR
remove formerPV dependence

STC https://tests.stockfishchess.org/tests/view/5f4cb922ba100690c5cc5d35
LLR: 2.96 (-2.94,2.94) {-1.25,0.25}
Total: 113672 W: 12347 L: 12368 D: 88957
Ptnml(0-2): 566, 9537, 36699, 9420, 614

LTC https://tests.stockfishchess.org/tests/view/5f4e8474ba100690c5cc5e12
LLR: 2.93 (-2.94,2.94) {-0.75,0.25}
Total: 43032 W: 2298 L: 2227 D: 38507
Ptnml(0-2): 45, 1940, 17475, 2011, 45

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

bench: 3290084
2020-09-04 07:58:13 +02:00
Unai Corzo
0e1f734b05 Less pruning in qsearch
do not prune moves that give discovery checks, even if with negative SSE.

STC https://tests.stockfishchess.org/tests/view/5f4cb5e8ba100690c5cc5d25
LLR: 2.96 (-2.94,2.94) {-0.25,1.25}
Total: 91328 W: 9940 L: 9667 D: 71721
Ptnml(0-2): 491, 7345, 29693, 7670, 465

LTC https://tests.stockfishchess.org/tests/view/5f4dbc2eba100690c5cc5dac
LLR: 2.97 (-2.94,2.94) {0.25,1.25}
Total: 52448 W: 2799 L: 2586 D: 47063
Ptnml(0-2): 53, 2220, 21459, 2445, 47

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

bench: 4031192
2020-09-04 07:55:41 +02:00
Joost VandeVondele
571c2d6d8d Restore development version
have fun!

No functional change
2020-09-04 07:46:06 +02:00
Joost VandeVondele
c306d83869 Stockfish 12
Official release version of Stockfish 12

Bench: 3624569

-----------------------

It is our pleasure to release Stockfish 12 to users world-wide

Downloads will be freely available at

https://stockfishchess.org/download/

This version 12 of Stockfish plays significantly stronger than
any of its predecessors. In a match against Stockfish 11,
Stockfish 12 will typically win at least ten times more game pairs
than it loses.

This jump in strength, visible in regular progression tests during
development[1], results from the introduction of an efficiently
updatable neural network (NNUE) for the evaluation in Stockfish[2],
and associated tuning of the engine as a whole. The concept of the
NNUE evaluation was first introduced in shogi, and ported to
Stockfish afterward. Stockfish remains a CPU-only engine, since the
NNUE networks can be very efficiently evaluated on CPUs. The
recommended parameters of the NNUE network are embedded in
distributed binaries, and Stockfish will use NNUE by default.

Both the NNUE and the classical evaluations are available, and
can be used to assign values to positions that are later used in
alpha-beta (PVS) search to find the best move. The classical
evaluation computes this value as a function of various chess
concepts, handcrafted by experts, tested and tuned using fishtest.
The NNUE evaluation computes this value with a neural network based
on basic inputs. The network is optimized and trained on the
evaluations of millions of positions.

The Stockfish project builds on a thriving community of enthusiasts
that contribute their expertise, time, and resources to build a free
and open source chess engine that is robust, widely available, and
very strong. We invite chess fans to join the fishtest testing
framework and programmers to contribute on github[3].

Stay safe and enjoy chess!

The Stockfish team

[1] https://github.com/glinscott/fishtest/wiki/Regression-Tests
[2] 84f3e86790
[3] https://stockfishchess.org/get-involved/
2020-09-02 16:19:30 +02:00
Joost VandeVondele
aa2de71230 Update CPU contributors list
with fishtest data of Sept. 2 2020

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

No functional change
2020-09-02 16:18:58 +02:00
Joost VandeVondele
be87517734 Only use MADV_RANDOM if defined
needed to compile on Haiku.

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

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

No functional change
2020-09-02 07:32:10 +02:00
VoyagerOne
a8bbaa1795 LMR Root Node Simplification
Simplify LMR at Root node

STC:
LLR: 2.94 (-2.94,2.94) {-1.25,0.25}
Total: 71520 W: 7649 L: 7614 D: 56257
Ptnml(0-2): 346, 5845, 23349, 5868, 352
https://tests.stockfishchess.org/tests/view/5f4be8c0ba100690c5cc5cbb

LTC:
LLR: 2.95 (-2.94,2.94) {-0.75,0.25}
Total: 74832 W: 3997 L: 3948 D: 66887
Ptnml(0-2): 77, 3422, 30362, 3485, 70
https://tests.stockfishchess.org/tests/view/5f4c603eba100690c5cc5d0e

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

Bench: 3624569
2020-09-01 09:31:40 +02:00
Joost VandeVondele
61381372ec Always print an info line before a bestmove
if very few nodes are being searched before a bestmove is reported,
an info line might be missing.

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

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

no functional change
2020-09-01 09:26:56 +02:00
mstembera
a057f170c6 Use llvm linker with clang on windows for LTO.
other linkers might fail to link during the LTO phase.

The linker might have to be installed using
`pacman -Syu mingw-w64-x86_64-lld`

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

No functional change.
2020-09-01 09:26:08 +02:00
mstembera
a0afe32d16 Use stable sort to make sure bench with TB yields same results everywhere.
std::sort() is not stable so different implementations can produce different results:
use the stable version instead.

Observed for '8/6k1/5r2/8/8/8/1K6/Q7 w - - 0 1' yielding different bench results for gcc and MSVC
and 3-4-5 syzygy TB prior to this patch.

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

No functional change.
2020-09-01 09:25:44 +02:00
FauziAkram
e0bafa1911 Update parametes in classical evaluation.
Passed STC (NNUE=False):
https://tests.stockfishchess.org/tests/view/5f42edfe5089a564a10d84a0
LLR: 2.96 (-2.94,2.94) {-0.25,1.25}
Total: 13840 W: 2591 L: 2336 D: 8913
Ptnml(0-2): 194, 1453, 3387, 1676, 210

Passed LTC (NNUE=False):
https://tests.stockfishchess.org/tests/view/5f4369795089a564a10d84d8
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 159744 W: 19430 L: 18850 D: 121464
Ptnml(0-2): 960, 14185, 49030, 14709, 988

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

bench: 3736029
2020-08-30 14:22:07 +02:00
VoyagerOne
9b5b9ec9a6 QS Pruning Simplification
Remove depth dependence in QS pruning

STC:
LLR: 2.95 (-2.94,2.94) {-1.25,0.25}
Total: 40536 W: 4442 L: 4358 D: 31736
Ptnml(0-2): 209, 3330, 13118, 3390, 221
https://tests.stockfishchess.org/tests/view/5f49035b3def6407861152f9

LTC:
LLR: 2.95 (-2.94,2.94) {-0.75,0.25}
Total: 97104 W: 5164 L: 5130 D: 86810
Ptnml(0-2): 103, 4478, 39377, 4470, 124
https://tests.stockfishchess.org/tests/view/5f4939d53def640786115322

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

Bench: 3865238
2020-08-30 14:17:23 +02:00
MJZ1977
c02b3a4c7a Add / remove leaves from search tree ttPv
add if previous leaf is in search tree and we didn't find a counter move
else remove the position if the leaf is the last one in search tree.

STC : https://tests.stockfishchess.org/tests/view/5f49203c3def640786115314
LLR: 2.95 (-2.94,2.94) {-0.25,1.25}
Total: 29968 W: 3381 L: 3195 D: 23392
Ptnml(0-2): 146, 2432, 9671, 2560, 175

LTC : https://tests.stockfishchess.org/tests/view/5f494bea3def640786115336
LLR: 2.96 (-2.94,2.94) {0.25,1.25}
Total: 84952 W: 4619 L: 4333 D: 76000
Ptnml(0-2): 86, 3765, 34481, 4065, 79

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

Bench 3527337
2020-08-30 14:13:16 +02:00
Unai Corzo
d90d893b5e Reintroduce depth reduction
Reintroduce depth reduction if the position is not in TT.

STC https://tests.stockfishchess.org/tests/view/5f4652e85089a564a10d868c
LLR: 2.97 (-2.94,2.94) {-0.25,1.25}
Total: 40240 W: 4535 L: 4331 D: 31374
Ptnml(0-2): 215, 3276, 12969, 3410, 250

LTC https://tests.stockfishchess.org/tests/view/5f46ca5e5089a564a10d86f3
LLR: 2.93 (-2.94,2.94) {0.25,1.25}
Total: 63096 W: 3426 L: 3188 D: 56482
Ptnml(0-2): 51, 2798, 25645, 2970, 84

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

bench: 3611906
2020-08-30 14:04:29 +02:00
Joost VandeVondele
e4ed7d3dd7 Cleaner make help
do not print details if ARCH is an empty string. Follow up for b0b4ca17db

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

No functional change
2020-08-30 14:03:02 +02:00
Stéphane Nicolet
406979ea12 Embed default net, and simplify using non-default nets
covers the most important cases from the user perspective:

It embeds the default net in the binary, so a download of that binary will result
in a working engine with the default net. The engine will be functional in the default mode
without any additional user action.

It allows non-default nets to be used, which will be looked for in up to
three directories (working directory, location of the binary, and optionally a specific default directory).
This mechanism is also kept for those developers that use MSVC,
the one compiler that doesn't have an easy mechanism for embedding data.

It is possible to disable embedding, and instead specify a specific directory, e.g. linux distros might want to use
CXXFLAGS="-DNNUE_EMBEDDING_OFF -DDEFAULT_NNUE_DIRECTORY=/usr/share/games/stockfish/" make -j ARCH=x86-64 profile-build

passed STC non-regression:
https://tests.stockfishchess.org/tests/view/5f4a581c150f0aef5f8ae03a
LLR: 2.95 (-2.94,2.94) {-1.25,-0.25}
Total: 66928 W: 7202 L: 7147 D: 52579
Ptnml(0-2): 291, 5309, 22211, 5360, 293

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

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

No functional change.
2020-08-29 21:56:00 +02:00
VoyagerOne
242a7d9fea Simplify MCP in QS
Simplify moveCount pruning in QS by removing depth dependency.

STC
LLR: 2.94 (-2.94,2.94) {-1.25,0.25}
Total: 42960 W: 4741 L: 4661 D: 33558
Ptnml(0-2): 218, 3574, 13804, 3678, 206
https://tests.stockfishchess.org/tests/view/5f42e3f75089a564a10d8493

LTC
LLR: 2.94 (-2.94,2.94) {-0.75,0.25}
Total: 66672 W: 3563 L: 3508 D: 59601
Ptnml(0-2): 71, 3064, 26996, 3149, 56
https://tests.stockfishchess.org/tests/view/5f4353285089a564a10d84d0

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

Bench: 4074430
2020-08-26 07:19:35 +02:00
VoyagerOne
95b8f3f800 Remove Reduce Depth
Remove Reduce Depth at PV nodes.

STC:
LLR: 2.94 (-2.94,2.94) {-1.25,0.25}
Total: 56760 W: 6299 L: 6236 D: 44225
Ptnml(0-2): 286, 4843, 18076, 4872, 303
https://tests.stockfishchess.org/tests/view/5f41356087a5c3c63d8f53c9

LTC:
LLR: 2.95 (-2.94,2.94) {-0.75,0.25}
Total: 17496 W: 954 L: 865 D: 15677
Ptnml(0-2): 13, 768, 7098, 855, 14
https://tests.stockfishchess.org/tests/view/5f41bb7687a5c3c63d8f53f9

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

Bench: 3555051
2020-08-26 07:16:50 +02:00
syzygy1
9b4967071e Remove EvalList
This patch removes the EvalList structure from the Position object and generally simplifies the interface between do_move() and the NNUE code.

The NNUE evaluation function first calculates the "accumulator". The accumulator consists of two halves: one for white's perspective, one for black's perspective.

If the "friendly king" has moved or the accumulator for the parent position is not available, the accumulator for this half has to be calculated from scratch. To do this, the NNUE node needs to know the positions and types of all non-king pieces and the position of the friendly king. This information can easily be obtained from the Position object.

If the "friendly king" has not moved, its half of the accumulator can be calculated by incrementally updating the accumulator for the previous position. For this, the NNUE code needs to know which pieces have been added to which squares and which pieces have been removed from which squares. In principle this information can be derived from the Position object and StateInfo struct (in the same way as undo_move() does this). However, it is probably a bit faster to prepare this information in do_move(), so I have kept the DirtyPiece struct. Since the DirtyPiece struct now stores the squares rather than "PieceSquare" indices, there are now at most three "dirty pieces" (previously two). A promotion move that captures a piece removes the capturing pawn and the captured piece from the board (to SQ_NONE) and moves the promoted piece to the promotion square (from SQ_NONE).

An STC test has confirmed a small speedup:

https://tests.stockfishchess.org/tests/view/5f43f06b5089a564a10d850a
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 87704 W: 9763 L: 9500 D: 68441
Ptnml(0-2): 426, 6950, 28845, 7197, 434

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

No functional change
2020-08-26 07:11:26 +02:00
Joost VandeVondele
b0b4ca17db Check ARCH=.... variable
to prevent user errors or generating untested code,
check explicitly that the ARCH variable is equivalent to a supported architecture
as listed in `make help`.

To nevertheless compile for an untested target the user can override the internal
variable, passing the undocumented `SUPPORTED_ARCH=true` to make.

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

No functional change.
2020-08-26 07:07:06 +02:00
mstembera
530fccbf27 Allow for VNNI256 compilation with g++-8
explicitly pass needed -mavx512f -mavx512bw flags

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

No functional change
2020-08-24 12:43:39 +02:00
Vizvezdenec
843a961a8c Introduce countermove based pruning for qsearch
This patch continues work of previous patch in introducing pruning heuristics in qsearch by analogy to main search, now with countermove based pruning.
Idea is that if move is late enough and is quite check (we do generate them in qsearch) and has bad enough countermove history - prune it.

passed STC
https://tests.stockfishchess.org/tests/view/5f41220287a5c3c63d8f53c5
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 35944 W: 4127 L: 3929 D: 27888
Ptnml(0-2): 196, 2970, 11459, 3134, 213

passed LTC
https://tests.stockfishchess.org/tests/view/5f41862f87a5c3c63d8f53e8
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 138448 W: 7655 L: 7252 D: 123541
Ptnml(0-2): 145, 6247, 56043, 6638, 151

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

Bench: 3610676
2020-08-24 12:09:04 +02:00
Sami Kiminki
f7b3f0e842 Allow TT entries with key16==0 to be fetched
Fix the issue where a TT entry with key16==0 would always be reported
as a miss. Instead, we'll use depth8 to detect whether the TT entry is
occupied. In order to do that, we'll change DEPTH_OFFSET to -7
(depth8==0) to distinguish between an unoccupied entry and the
otherwise lowest possible depth, i.e., DEPTH_NONE (depth8==1).

To prevent a performance regression, we'll reorder the TT entry fields
by the access order of TranspositionTable::probe(). Memory in general
works fastest when accessed in sequential order. We'll also match the
store order in TTEntry::save() with the entry field order, and
re-order the 'if-or' expressions in TTEntry::save() from the cheapest
to the most expensive.

Finally, as we now have a proper TT entry occupancy test, we'll fix a
minor corner case with hashfull reporting. To reproduce:
- Use a big hash
- Either:
  a. Start 31 very quick searches (this wraparounds generation to 0); or
  b. Force generation of the first search to 0.
- go depth infinite

Before the fix, hashfull would incorrectly report nearly full hash
immediately after the search start, since
TranspositionTable::hashfull() used to consider only the entry
generation and not whether the entry was actually occupied.

STC:
LLR: 2.95 (-2.94,2.94) {-0.25,1.25}
Total: 36848 W: 4091 L: 3898 D: 28859
Ptnml(0-2): 158, 2996, 11972, 3091, 207
https://tests.stockfishchess.org/tests/view/5f3f98d5dc02a01a0c2881f7

LTC:
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 32280 W: 1828 L: 1653 D: 28799
Ptnml(0-2): 34, 1428, 13051, 1583, 44
https://tests.stockfishchess.org/tests/view/5f3fe77a87a5c3c63d8f5332

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

Bench: 3760677
2020-08-24 12:03:28 +02:00
mstembera
701b2427bd Support VNNI on 256bit vectors
due to downclocking on current chips (tested up to cascade lake)
supporting avx512 and vnni512, it is better to use avx2 or vnni256
in multithreaded (in particular hyperthreaded) engine use.
In single threaded use, the picture is different.

gcc compilation for vnni256 requires a toolchain for gcc >= 9.

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

No functional change
2020-08-24 12:03:04 +02:00
George Sobala
e453f09f06 armv8 AArch64 does not require -mfpu=neon
-mpfu is not required on AArch64 / armv8 architecture on Linux and throws an error if present.
This PR has been tested on gcc and clang on Gentoo-64 and Raspian-64 on a Raspberry Pi 4,
as well as with a cross from Ubuntu
(`make clean && make -j build ARCH=armv8         COMP=gcc COMPILER=aarch64-linux-gnu-g++`)

fixes https://github.com/official-stockfish/Stockfish/issues/3056
closes https://github.com/official-stockfish/Stockfish/pull/3059

No functional change
2020-08-24 11:30:55 +02:00
Vizvezdenec
d5f86b6359 Introduce movecount pruning for qsearch()
If in quiescence search, we assume that me can prune late moves when:

a) the move ordering count of the move is : moveCount > abs(depth) + 2
b) we are not in check
c) the late move does not give check
d) the late move is not an advanced pawn push

Modification of an original idea by @VoyagerOne.

STC
https://tests.stockfishchess.org/tests/view/5f40581787a5c3c63d8f535f
LLR: 2.96 (-2.94,2.94) {-0.25,1.25}
Total: 132848 W: 14999 L: 14661 D: 103188
Ptnml(0-2): 684, 11242, 42309, 11430, 759

LTC
https://tests.stockfishchess.org/tests/view/5f4226da87a5c3c63d8f5412
LLR: 2.98 (-2.94,2.94) {0.25,1.25}
Total: 12008 W: 678 L: 551 D: 10779
Ptnml(0-2): 8, 485, 4899, 596, 16

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

Bench: 3749974
2020-08-23 23:27:03 +02:00
syzygy1
cc9d503dde Skip the alignment bug workaround for Clang
Clang-10.0.0 poses as gcc-4.2:

$ clang++ -E -dM - </dev/null | grep GNUC

This means that Clang is using the workaround for the alignment bug of gcc-8
even though it does not have the bug (as far as I know).

This patch should speed up AVX2 and AVX512 compiles on Windows (when using Clang),
because it disables (for Clang) the gcc workaround we had introduced in this commit:
875183b310

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

No functional change.
2020-08-23 23:09:31 +02:00
Joost VandeVondele
5f1843c9cb Small trivial cleanups
closes https://github.com/official-stockfish/Stockfish/pull/2801

No functional change
2020-08-23 01:53:41 +02:00
Stéphane Nicolet
3542033342 Instructions to build on older Macintosh
In recent Macs, it is possible to use the Clang compiler provided by Apple
to compile Stockfish out of the box, and this is the method used by default
in our Makefile (the Makefile sets the macosx-version-min=10.14 flag to select
the right libc++ library for the Clang compiler with recent c++17 support).

But it is quite possible to compile and run Stockfish on older Macs! Below
we describe a method to install a recent GNU compiler on these Macs, to get
the c++17 support. We have tested the following procedure to install gcc10 on
machines running Mac OS 10.7, Mac OS 10.9 and Mac OS 10.13:

1) install XCode for your machine.

2) install Apple command-line developer tools for XCode, by typing the following
   command in a Terminal:

```
      sudo xcode-select --install
```

3) go to the Stockfish "src" directory, then try a default build and run Stockfish:

```
      make clean
      make build
      make net
      ./stockfish
```

4) if step 3 worked, congrats! You have a compiler recent enough on your Mac
to compile Stockfish. If not, continue with step 5 to install GNU gcc10 :-)

5) install the MacPorts package manager (https://www.macports.org/install.php),
for instance using the fast method in the "macOS Package (.pkg) Installer"
section of the page.

6) use the "port" command to install the gcc10 package of MacPorts by typing the
following command:

```
    sudo port install gcc10
```

With this step, MacPorts will install the gcc10 compiler under the name "g++-mp-10"
in the /opt/local/bin directory:

```
   which g++-mp-10

   /opt/local/bin/g++-mp-10       <--- answer
```

7) You can now go back to the "src" directory of Stockfish, and try to build
Stockfish by pointing at the right compiler:

```
   make clean
   make build COMP=gcc COMPCXX=/opt/local/bin/g++-mp-10
   make net
   ./stockfish
```

8) Enjoy Stockfish on Macintosh!

See this pull request for further discussion:
https://github.com/official-stockfish/Stockfish/pull/3049

No functional change
2020-08-22 22:37:50 +02:00
Joost VandeVondele
34f67c5722 Explicitly rely on pthreads if possible
allows us to set the needed stacksize on thread creation.

Useful for environments with too small a default stack size (e.g. Alpine Linux with musl).

Passed STC, no regression:

LLR: 2.96 (-2.94,2.94) {-1.25,0.25}
Total: 17816 W: 1344 L: 1275 D: 15197
Ptnml(0-2): 30, 1057, 6682, 1092, 47
https://tests.stockfishchess.org/tests/view/5f402b5587a5c3c63d8f534d

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

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

No functional change.
2020-08-22 11:00:45 +02:00