Commit Graph

5161 Commits

Author SHA1 Message Date
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
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
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
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
Tomasz Sobczyk
327e92aefe Remove trailing whitespaces. 2020-09-03 19:22:52 +09:00
Tomasz Sobczyk
2688194d44 Fix #91 2020-09-03 19:22:03 +09:00
Tomasz Sobczyk
9d5dc3d33f Fix compilation issues. 2020-09-03 19:21:27 +09:00
Tomasz Sobczyk
c17f2b15fd General cleanup of learner.cpp. 2020-09-02 23:08:22 +09:00
nodchip
7d6668515c Added -static link option to the learn and profile-learn targets. 2020-08-30 14:54:07 +09:00
nodchip
9f2f31632c Fixed build errors. 2020-08-29 08:17:24 +09:00
nodchip
f7bc4e6e45 Fixed compilation errors. 2020-08-29 00:56:05 +09:00
nodchip
906c18eb46 Merge branch 'master' of github.com:official-stockfish/Stockfish into nnue-player-merge-2020-08-28
# Conflicts:
#	README.md
#	src/Makefile
#	src/search.cpp
#	src/types.h
#	src/uci.cpp
#	src/ucioption.cpp
2020-08-28 11:26:11 +09:00
hero2017
5637996f79 Resolve #92
If we're defining something in a header then we should declare it.
2020-08-28 11:20:03 +09:00
tttak
03b43079eb Merge branch 'nodchip_master' into wdl_20200824 2020-08-28 09:16:07 +09:00
nodchip
763e72cc9f Changed the default value of use_raw_nnue_eval. Updated a source code comment. 2020-08-27 23:49:58 +09:00
nodchip
9fc3ff4c30 Added use_raw_nnue_eval option to return raw NNUE eval value in evaluate(). 2020-08-27 23:48:28 +09: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
tttak
4ce30d9522 Use winning_percentage_wdl in learn 2020-08-24 22:56:08 +09: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