Commit Graph

5463 Commits

Author SHA1 Message Date
nodchip
cea17c92f9 Simplified evaluate_common.h. 2020-09-09 10:26:42 +09:00
nodchip
8d763fb503 Removed LEARN_GENSFEN_USE_DRAW_RESULT macro. 2020-09-09 10:26:42 +09:00
nodchip
eafa569365 Removed macros for KPP factorization. 2020-09-09 10:26:42 +09:00
nodchip
5e25702672 Removed USE_TRIANGLE_WEIGHT_ARRAY macro. 2020-09-09 10:26:42 +09:00
nodchip
f52165e1d3 Removed RESET_TO_ZERO_VECTOR macro. 2020-09-09 10:26:42 +09:00
nodchip
dbad9d96e0 Removed LOSS_FUNCTION_IS_ELMO_METHOD macro. 2020-09-09 10:26:42 +09:00
nodchip
ef1601218d Removed LOSS_FUNCTION_IS_CROSS_ENTOROPY_FOR_VALUE macro. 2020-09-09 10:26:42 +09:00
nodchip
f52fbf8006 Removed LOSS_FUNCTION_IS_CROSS_ENTOROPY macro. 2020-09-09 10:26:42 +09:00
nodchip
d37eb63581 Removed LOSS_FUNCTION_IS_WINNING_PERCENTAGE macro. 2020-09-09 10:26:42 +09:00
nodchip
f3a158725d Removed SGD_UPDATE macro. 2020-09-09 10:26:42 +09:00
nodchip
0271d70775 Removed ADA_GRAD_UPDATE macro. 2020-09-09 10:26:42 +09:00
nodchip
05d26499b4 Removed LEARN_ELMO_METHOD macro. 2020-09-09 10:26:42 +09:00
nodchip
82dc68ba9f Removed #if for USE_GLOBAL_OPTIONS. 2020-09-09 10:26:42 +09:00
nodchip
aa2452caf3 Removed #if for USE_EVAL_HASH. 2020-09-09 10:26:42 +09:00
nodchip
ec96409176 Replaced DNDEBUG macro to _DEBUG macro. 2020-09-09 10:26:42 +09:00
nodchip
04a9a951b8 Removed "#if 0" and "#if 1". 2020-09-09 10:26:42 +09:00
nodchip
458771a181 Removed GENSFEN2019 macro. 2020-09-09 10:26:42 +09:00
nodchip
1d00d00241 Removed ENABLE_TEST_CMD macro. 2020-09-09 10:26:42 +09:00
nodchip
21cfead52c Removed unused OMP_ macro. 2020-09-09 10:26:42 +09:00
nodchip
e6a6ba5221 Removed USE_BOOK macro. 2020-09-09 10:26:42 +09:00
nodchip
a6013557f2 Removed EVAL_NNUE macro. 2020-09-09 10:26:42 +09:00
noobpwnftw
d25657c439 Merge branch 'master' into trainer 2020-09-09 08:43:12 +08:00
noobpwnftw
d21424c8d3 test 2020-09-09 07:31:22 +08: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
Tomasz Sobczyk
41b7674aee Improve comments, break long lines. 2020-09-08 20:07:30 +09:00
Tomasz Sobczyk
0202218f58 fix cast 2020-09-08 20:07:30 +09:00
Tomasz Sobczyk
a0b2d6a01e Note a potential defect in sfen packer. 2020-09-08 20:07:30 +09:00
Tomasz Sobczyk
1482e5215a A second batch of code reorganization. 2020-09-08 20:07:30 +09:00
Tomasz Sobczyk
832c414b0d First batch of reorganization. 2020-09-08 20:07:30 +09:00
noobpwnftw
58863c3243 Update gensfen.cpp 2020-09-08 13:22:41 +09:00
Tomasz Sobczyk
e5f05fa2b9 Add a script to extract a contiguous range of entries from a .bin file. 2020-09-08 09:31:53 +09:00
Joost VandeVondele
6e8f82ad76 Fix small CI failures
1) Only access UCI option if defined
2) disable -Werror for now.
3) disable a few target that don't have _mm_malloc.
4) Add profile-learn target, with small speedup.
5) just test on Linux + gcc (skip macOS, unclear openblas, skip linux+clang, unclear omp/std::filesystem).
2020-09-08 09:14:49 +09:00
Tomasz Sobczyk
e638d66bbe Only add -s flag to the linker if debug=no 2020-09-08 09:10:58 +09:00
nodchip
4cc98d80f8 Replaced the utility function to create a directory to std::filesystem. 2020-09-07 18:56:41 +09:00
nodchip
e004e47e5a Commented out an unused function parameter to remove a compile warning. 2020-09-07 16:21:40 +09:00
Joost VandeVondele
bccc71afb4 fix openblas package name? 2020-09-07 16:16:08 +09:00
Joost VandeVondele
31e8be3008 First little CI step for the learner 2020-09-07 15:46:09 +09:00
Joost VandeVondele
e9e52faae7 Typo fix 2020-09-07 15:21:50 +09:00
Joost VandeVondele
edbbc1a4df Remove some warnings 2020-09-07 09:20:47 +09:00
Joost VandeVondele
3a06de298b Define BLAS variables in Makefile
makes it a little easier to change the BLAS library used,
doesn't hardcode the mingw headers. Works on Linux with openblas installed.
Should be no change on Windows.
2020-09-07 09:19:31 +09:00
Joost VandeVondele
3bf418e63f Fix some uninitialized variables with gensfen
fixes valgrind errors as seen with:

```
setoption name Use NNUE value true
isready
gensfen depth 6 loop 10 use_draw_in_training_data_generation 1 eval_limit 32000 output_file_name training_data/training_data.bin use_raw_nnue_eval 0
quit
```

the latter script now runs without valgrind errors on linux
2020-09-07 09:01:17 +09:00
Tomasz Sobczyk
e9e6e47a93 Fix write_out_draw_game_in_training_data_generation flag not being respected. 2020-09-06 22:00:51 +09:00
Tomasz Sobczyk
0612adec41 Fix incorrect early exit in evaluate_leaf. 2020-09-05 08:43:34 +09: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