Skip to content

Commit

Permalink
Switch to Stockfish 16 (#41)
Browse files Browse the repository at this point in the history
As this plugin is used by mobile devices, SF16 is a good trade-off
considering its network file size (38M) which is significantly smaller
than the next one (SF16.1: 62M).
  • Loading branch information
veloce authored Jun 11, 2024
1 parent f7abbbd commit bc5346d
Show file tree
Hide file tree
Showing 73 changed files with 11,690 additions and 9,081 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@
## [1.5.0] - 17 April 2024

* Update to Stockfish 16.1

## [1.6.0] - 18 April 2024

* Switch to Stockfish 16 for smaller app size
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ iOS project must have `IPHONEOS_DEPLOYMENT_TARGET` >=12.0.
Update `dependencies` section inside `pubspec.yaml`:

```yaml
stockfish: ^1.5.0
stockfish: ^1.6.0
```
### Init engine
Expand Down
15 changes: 11 additions & 4 deletions android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ add_library(
)

if(ANDROID_ABI STREQUAL arm64-v8a)
target_compile_options(stockfish PRIVATE -DUSE_PTHREADS -DNDEBUG -O3 -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(stockfish PRIVATE -DUSE_PTHREADS -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8)
else()
target_compile_options(stockfish PRIVATE -fno-exceptions -DUSE_PTHREADS -DNDEBUG -O3 -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8)
endif()
else()
target_compile_options(stockfish PRIVATE -DUSE_PTHREADS -DNDEBUG -O3)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(stockfish PRIVATE -DUSE_PTHREADS)
else()
target_compile_options(stockfish PRIVATE -fno-exceptions -DUSE_PTHREADS -DNDEBUG -O3)
endif()
endif()

file(DOWNLOAD https://tests.stockfishchess.org/api/nn/nn-b1a57edbea57.nnue ${CMAKE_BINARY_DIR}/nn-b1a57edbea57.nnue)
file(DOWNLOAD https://tests.stockfishchess.org/api/nn/nn-baff1ede1f90.nnue ${CMAKE_BINARY_DIR}/nn-baff1ede1f90.nnue)
file(DOWNLOAD https://tests.stockfishchess.org/api/nn/nn-5af11540bbfe.nnue ${CMAKE_BINARY_DIR}/nn-5af11540bbfe.nnue)
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PODS:
- Flutter (1.0.0)
- integration_test (0.0.1):
- Flutter
- stockfish (1.5.0):
- stockfish (1.6.0):
- Flutter

DEPENDENCIES:
Expand All @@ -21,7 +21,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
stockfish: 819bf4544d1e76a01da13af56324c69b3bf7928f
stockfish: 1cee686b12e2541a977d062746d2eb3f794d891c

PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.5.0"
version: "1.6.0"
stream_channel:
dependency: transitive
description:
Expand Down
11 changes: 6 additions & 5 deletions ios/FlutterStockfish/ffi.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#include <iostream>
#include <unordered_map>
#include <stdio.h>
#include <unistd.h>

#include "../Stockfish/src/bitboard.h"
#include "../Stockfish/src/evaluate.h"
#include "../Stockfish/src/misc.h"
#include "../Stockfish/src/endgame.h"
#include "../Stockfish/src/position.h"
#include "../Stockfish/src/tune.h"
#include "../Stockfish/src/types.h"
#include "../Stockfish/src/psqt.h"
#include "../Stockfish/src/search.h"
#include "../Stockfish/src/syzygy/tbprobe.h"
#include "../Stockfish/src/thread.h"
#include "../Stockfish/src/tt.h"
#include "../Stockfish/src/uci.h"

#include "ffi.h"
Expand Down
19 changes: 2 additions & 17 deletions ios/Stockfish/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Hisayori Noda (nodchip)
# All other authors of Stockfish code (in alphabetical order)
Aditya (absimaldata)
Adrian Petrescu (apetresc)
Ahmed Kerimov (wcdbmv)
Ajith Chandy Jose (ajithcj)
Alain Savard (Rocky640)
Alayan Feh (Alayan-stk-2)
Expand All @@ -30,7 +29,6 @@ Aram Tumanian (atumanian)
Arjun Temurnikar
Artem Solopiy (EntityFX)
Auguste Pop
Balazs Szilagyi
Balint Pfliegel
Ben Chaney (Chaneybenjamini)
Ben Koshy (BKSpurgeon)
Expand All @@ -47,12 +45,9 @@ candirufish
Chess13234
Chris Cain (ceebo)
clefrks
Clemens L. (rn5f107s2)
Cody Ho (aesrentai)
Dale Weiler (graphitemaster)
Daniel Axtens (daxtens)
Daniel Dugovic (ddugovic)
Daniel Monroe (Ergodice)
Dan Schmidt (dfannius)
Dariusz Orzechowski (dorzechowski)
David (dav1312)
Expand All @@ -74,11 +69,9 @@ Fabian Beuke (madnight)
Fabian Fichter (ianfab)
Fanael Linithien (Fanael)
fanon
Fauzi Akram Dabat (fauzi2)
Fauzi Akram Dabat (FauziAkram)
Felix Wittmann
gamander
Gabriele Lombardo (gabe)
Gahtan Nahdi
Gary Heckman (gheckman)
George Sobala (gsobala)
gguliash
Expand All @@ -101,7 +94,6 @@ Jake Senne (w1wwwwww)
Jan Ondruš (hxim)
Jared Kish (Kurtbusch, kurt22i)
Jarrod Torriero (DU-jdto)
Jasper Shovelton (Beanie496)
Jean-Francois Romang (jromang)
Jean Gauthier (OuaisBla)
Jekaa
Expand Down Expand Up @@ -186,7 +178,6 @@ Raminder Singh
renouve
Reuven Peleg (R-Peleg)
Richard Lloyd (Richard-Lloyd)
Robert Nürnberg (robertnurnberg)
Rodrigo Exterckötter Tjäder
Rodrigo Roim (roim)
Ronald de Man (syzygy1, syzygy)
Expand All @@ -210,15 +201,10 @@ Stefano Cardanobile (Stefano80)
Stefano Di Martino (StefanoD)
Steinar Gunderson (sesse)
Stéphane Nicolet (snicolet)
Stephen Touset (stouset)
Syine Mineta (MinetaS)
Taras Vuk (TarasVuk)
Thanar2
thaspel
theo77186
TierynnB
Ting-Hsuan Huang (fffelix-huang)
Tobias Steinmann
Tomasz Sobczyk (Sopel97)
Tom Truscott
Tom Vijlbrief (tomtor)
Expand All @@ -232,10 +218,9 @@ Vince Negri (cuddlestmonkey)
Viren
windfishballad
xefoci7612
Xiang Wang (KatyushaScarlet)
zz4032

# Additionally, we acknowledge the authors and maintainers of fishtest,
# an amazing and essential framework for Stockfish development!
#
# https://github.com/official-stockfish/fishtest/blob/master/AUTHORS
# https://github.com/glinscott/fishtest/blob/master/AUTHORS
97 changes: 0 additions & 97 deletions ios/Stockfish/CONTRIBUTING.md

This file was deleted.

8 changes: 4 additions & 4 deletions ios/Stockfish/Copying.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

Expand All @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
<http://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
60 changes: 35 additions & 25 deletions ios/Stockfish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,38 @@ This distribution of Stockfish consists of the following files:
* a file with the .nnue extension, storing the neural network for the NNUE
evaluation. Binary distributions will have this file embedded.

## Contributing
## The UCI protocol

The [Universal Chess Interface][uci-link] (UCI) is a standard text-based protocol
used to communicate with a chess engine and is the recommended way to do so for
typical graphical user interfaces (GUI) or chess tools. Stockfish implements the
majority of its options.

Developers can see the default values for the UCI options available in Stockfish
by typing `./stockfish uci` in a terminal, but most users should typically use a
chess GUI to interact with Stockfish.

For more information on UCI or debug commands, see our [documentation][wiki-commands-link].

## Compiling Stockfish

__See [Contributing Guide](CONTRIBUTING.md).__
Stockfish has support for 32 or 64-bit CPUs, certain hardware instructions,
big-endian machines such as Power PC, and other platforms.

On Unix-like systems, it should be easy to compile Stockfish directly from the
source code with the included Makefile in the folder `src`. In general, it is
recommended to run `make help` to see a list of make targets with corresponding
descriptions.

```
cd src
make -j build ARCH=x86-64-modern
```

Detailed compilation instructions for all platforms can be found in our
[documentation][wiki-compile-link].

## Contributing

### Donating hardware

Expand All @@ -85,25 +114,6 @@ Discussions about Stockfish take place these days mainly in the Stockfish
[Discord server][discord-link]. This is also the best place to ask questions
about the codebase and how to improve it.

## Compiling Stockfish

Stockfish has support for 32 or 64-bit CPUs, certain hardware instructions,
big-endian machines such as Power PC, and other platforms.

On Unix-like systems, it should be easy to compile Stockfish directly from the
source code with the included Makefile in the folder `src`. In general, it is
recommended to run `make help` to see a list of make targets with corresponding
descriptions. An example suitable for most Intel and AMD chips:

```
cd src
make -j profile-build ARCH=x86-64-avx2
```

Detailed compilation instructions for all platforms can be found in our
[documentation][wiki-compile-link]. Our wiki also has information about
the [UCI commands][wiki-uci-link] supported by Stockfish.

## Terms of use

Stockfish is free and distributed under the
Expand All @@ -128,7 +138,7 @@ also be made available under GPL v3.
[issue-link]: https://github.com/official-stockfish/Stockfish/issues/new?assignees=&labels=&template=BUG-REPORT.yml
[discussions-link]: https://github.com/official-stockfish/Stockfish/discussions/new
[fishtest-link]: https://tests.stockfishchess.org/tests
[guideline-link]: https://github.com/official-stockfish/fishtest/wiki/Creating-my-first-test
[guideline-link]: https://github.com/glinscott/fishtest/wiki/Creating-my-first-test
[license-link]: https://github.com/official-stockfish/Stockfish/blob/master/Copying.txt
[programming-link]: https://www.chessprogramming.org/Main_Page
[programmingsf-link]: https://www.chessprogramming.org/Stockfish
Expand All @@ -140,10 +150,10 @@ also be made available under GPL v3.
[website-link]: https://stockfishchess.org
[website-blog-link]: https://stockfishchess.org/blog/
[wiki-link]: https://github.com/official-stockfish/Stockfish/wiki
[wiki-compile-link]: https://github.com/official-stockfish/Stockfish/wiki/Compiling-from-source
[wiki-uci-link]: https://github.com/official-stockfish/Stockfish/wiki/UCI-&-Commands
[wiki-usage-link]: https://github.com/official-stockfish/Stockfish/wiki/Download-and-usage
[worker-link]: https://github.com/official-stockfish/fishtest/wiki/Running-the-worker
[wiki-compile-link]: https://github.com/official-stockfish/Stockfish/wiki/Compiling-from-source
[wiki-commands-link]: https://github.com/official-stockfish/Stockfish/wiki/Commands
[worker-link]: https://github.com/glinscott/fishtest/wiki/Running-the-worker

[build-badge]: https://img.shields.io/github/actions/workflow/status/official-stockfish/Stockfish/stockfish.yml?branch=master&style=for-the-badge&label=stockfish&logo=github
[commits-badge]: https://img.shields.io/github/commits-since/official-stockfish/Stockfish/latest?style=for-the-badge
Expand Down
Loading

0 comments on commit bc5346d

Please sign in to comment.