Commit Graph

328 Commits

Author SHA1 Message Date
Tomasz Sobczyk
89294e2e4f Add transform command. Add transform nudged_static subcommand. 2020-11-27 09:16:22 +09:00
noobpwnftw
c29554a120 Merge remote-tracking branch 'remotes/official/master' into master
Bench: 3597730
2020-11-23 04:27:12 +08:00
Tomasz Sobczyk
d4350a16f3 Add representation of an opening book. 2020-11-17 09:43:23 +09:00
Tomasz Sobczyk
c56a4a36eb Add our own blas-like routines that use stockfish's thread pool for parallelization. 2020-10-29 23:57:51 +09:00
Tomasz Sobczyk
ec9e49e875 Add a HalfKA architecture (a product of K - king, and A - any piece) along with all required infrastructure. HalfKA doesn't discriminate kings compared to HalfKP. Keep old architecture as the default one. 2020-10-29 09:10:01 +09:00
Tomasz Sobczyk
e01397c674 Remove multi_think 2020-10-26 19:40:40 +09:00
Joost VandeVondele
258af8ae44 Add net as dependency of config
cleaner output and error message if the server is down and the net is not available.

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

No functional change
2020-10-22 20:18:12 +02:00
Tomasz Sobczyk
9f87282c6d Fix net not being downloaded on build. Make PGO build faster by reverting gensfen command change. 2020-09-24 21:59:25 +02:00
noobpwnftw
9827411b7c Merge remote-tracking branch 'remotes/nodchip/master' into trainer 2020-09-24 21:45:28 +08:00
noobpwnftw
411adab149 Merge remote-tracking branch 'remotes/nodchip/master' into trainer 2020-09-23 18:29:30 +08:00
noobpwnftw
26f63fe741 Merge remote-tracking branch 'remotes/origin/master' into trainer 2020-09-19 03:38:37 +08: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
Tomasz Sobczyk
89f38c938b Don't prompt when the training data file doesn't exist when trying to delete it 2020-09-13 13:52:42 +02:00
Tomasz Sobczyk
2e2de7607b Add extension to the PGO_TRAINING_DATA_FILE so that the generated file name matches the one we try to delete. 2020-09-13 13:47:19 +02:00
Tomasz Sobczyk
e4a4f4001f parametrize the name of the training data file generated during pgo 2020-09-13 13:44:19 +02:00
Tomasz Sobczyk
9ee8ce67bf Move removal of generate training data file to profileclean. 2020-09-13 13:42:13 +02:00
Tomasz Sobczyk
4b70f4bf23 Add extra ld flags to the proper variable. 2020-09-13 02:07:29 +02:00
Tomasz Sobczyk
72164ba59c Add missing -fopenmp LDFLAG 2020-09-13 02:06:33 +02:00
Tomasz Sobczyk
fbae6604b1 Remove LEARNCXXFLAGS, LEARNLDFLAGS, BLASDEFINE, BLASCXXFLAGS, BLASLDFLAGS in favor of directly modifying CXXFLAGS and LDFLAGS. 2020-09-13 00:18:01 +02:00
Tomasz Sobczyk
8d1ad6fbf6 Add a makefile option to enable use of BLAS. Default to "no" 2020-09-12 21:16:27 +02:00
Tomasz Sobczyk
1e2fca4040 Move learn target to build target and profile-learn to profile-build. 2020-09-12 16:23:49 +02:00
Joost VandeVondele
8d499e6efa Fix flags for dependency generation (98f24570ab) 2020-09-12 22:25:36 +09:00
Tomasz Sobczyk
98f24570ab Add src to include paths, remove non-standard ".." in includes in learn directory. 2020-09-11 21:53:17 +09:00
Tomasz Sobczyk
a059fa86c4 Move sfen_packer to learn. 2020-09-11 21:53:17 +09:00
Tomasz Sobczyk
683c6146ce Move declarations around and split them. 2020-09-11 21:53:17 +09:00
noobpwnftw
84ba591118 Merge branch 'master' into trainer 2020-09-09 20:19:13 +08:00
noobpwnftw
675d336ebb Merge branch 'master' into trainer 2020-09-09 16:08:49 +08:00
nodchip
1d00d00241 Removed ENABLE_TEST_CMD 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
Tomasz Sobczyk
1482e5215a A second batch of code reorganization. 2020-09-08 20:07:30 +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
Joost VandeVondele
e9e52faae7 Typo fix 2020-09-07 15:21:50 +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
Tomasz Sobczyk
c17f2b15fd General cleanup of learner.cpp. 2020-09-02 23:08:22 +09: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
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
nodchip
7d6668515c Added -static link option to the learn and profile-learn targets. 2020-08-30 14:54:07 +09: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
nodchip
9f2f31632c Fixed build errors. 2020-08-29 08:17:24 +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
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
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
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