From 89b5f7a646f53630e4f1c773e9a3fa9dc6f0ebbc707c30d0b8c846d9061c86ec Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Tue, 6 Dec 2022 15:18:36 +0000 Subject: [PATCH 1/2] - Update to 15.1: * Elo gain and competition results: With this release, version 5 of the NNUE neural net architecture has been introduced, and the training data has been extended to include Fischer random chess (FRC) positions. As a result, Elo gains are largest for FRC, reaching up to 50 Elo for doubly randomized FRC (DFRC). More importantly, also for standard chess this release progressed and will win two times more game pairs than it loses against Stockfish 15. * New evaluation: This release also introduces a new convention for the evaluation that is reported by search. An evaluation of +1 is now no longer tied to the value of one pawn, but to the likelihood of winning the game. With a +1 evaluation, Stockfish has now a 50% chance of winning the game against an equally strong opponent. This convention scales down evaluations a bit compared to Stockfish 15 and allows for consistent evaluations in the future. - Refresh: * date.patch * stockfish-remove-net.patch - Remove nn-6877cd24400e.nnue - Add nn-ad9b42354671.nnue OBS-URL: https://build.opensuse.org/package/show/games/stockfish?expand=0&rev=29 --- .gitattributes | 2 +- Stockfish-sf_15.1.tar.gz | 3 ++ Stockfish-sf_15.tar.gz | 3 -- date.patch | 36 ++++++++++-------------- nn-6877cd24400e.nnue | 3 -- nn-ad9b42354671.nnue | 3 ++ stockfish-remove-net.patch | 57 +++++++++++++++++++++++--------------- stockfish.changes | 26 +++++++++++++++++ stockfish.spec | 8 +++--- 9 files changed, 86 insertions(+), 55 deletions(-) create mode 100644 Stockfish-sf_15.1.tar.gz delete mode 100644 Stockfish-sf_15.tar.gz delete mode 100644 nn-6877cd24400e.nnue create mode 100644 nn-ad9b42354671.nnue diff --git a/.gitattributes b/.gitattributes index e02cb9b..d45a817 100644 --- a/.gitattributes +++ b/.gitattributes @@ -22,4 +22,4 @@ *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text ## Specific LFS patterns -nn-6877cd24400e.nnue filter=lfs diff=lfs merge=lfs -text +nn-ad9b42354671.nnue filter=lfs diff=lfs merge=lfs -text diff --git a/Stockfish-sf_15.1.tar.gz b/Stockfish-sf_15.1.tar.gz new file mode 100644 index 0000000..ccbe52d --- /dev/null +++ b/Stockfish-sf_15.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4272657905319328294355973faee40a8c28e3eecb0e7b266ed34ff33383b76 +size 193408 diff --git a/Stockfish-sf_15.tar.gz b/Stockfish-sf_15.tar.gz deleted file mode 100644 index f392ad3..0000000 --- a/Stockfish-sf_15.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0553fe53ea57ce6641048049d1a17d4807db67eecd3531a3749401362a27c983 -size 189578 diff --git a/date.patch b/date.patch index b119afe..0558931 100644 --- a/date.patch +++ b/date.patch @@ -1,24 +1,18 @@ -Index: Stockfish-sf_14/src/misc.cpp +Index: Stockfish-sf_15.1/src/misc.cpp =================================================================== ---- Stockfish-sf_14.orig/src/misc.cpp -+++ Stockfish-sf_14/src/misc.cpp -@@ -142,18 +142,10 @@ public: - - string engine_info(bool to_uci) { - -- const string months("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"); -- string month, day, year; -- stringstream ss, date(__DATE__); // From compiler, format is "Sep 21 2008" -+ stringstream ss; - - ss << "Stockfish " << Version << setfill('0'); - -- if (Version.empty()) -- { -- date >> month >> day >> year; -- ss << setw(2) << day << setw(2) << (1 + months.find(month) / 4) << year.substr(2); -- } +--- Stockfish-sf_15.1.orig/src/misc.cpp ++++ Stockfish-sf_15.1/src/misc.cpp +@@ -156,13 +156,6 @@ string engine_info(bool to_uci) { + ss << "-"; + #ifdef GIT_DATE + ss << GIT_DATE; +- #else +- const string months("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"); +- string month, day, year; +- stringstream date(__DATE__); // From compiler, format is "Sep 21 2008" - - ss << (to_uci ? "\nid author ": " by ") - << "the Stockfish developers (see AUTHORS file)"; +- date >> month >> day >> year; +- ss << year << setw(2) << setfill('0') << (1 + months.find(month) / 4) << setw(2) << setfill('0') << day; + #endif + ss << "-"; diff --git a/nn-6877cd24400e.nnue b/nn-6877cd24400e.nnue deleted file mode 100644 index ebb54f0..0000000 --- a/nn-6877cd24400e.nnue +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6877cd24400e01b19ff12ae3068ae242152802bdd330e66f7b6703865251d6e3 -size 47001499 diff --git a/nn-ad9b42354671.nnue b/nn-ad9b42354671.nnue new file mode 100644 index 0000000..b199747 --- /dev/null +++ b/nn-ad9b42354671.nnue @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad9b423546714137916bd38978af6fd68d7b8951bef25ff76bf43da72d6cb786 +size 47001499 diff --git a/stockfish-remove-net.patch b/stockfish-remove-net.patch index 2bc3f11..dcb1367 100644 --- a/stockfish-remove-net.patch +++ b/stockfish-remove-net.patch @@ -1,7 +1,8 @@ -diff -urEbw Stockfish-sf_15/src/Makefile Stockfish-sf_15.new/src/Makefile ---- Stockfish-sf_15/src/Makefile 2022-04-18 22:03:20.000000000 +0200 -+++ Stockfish-sf_15.new/src/Makefile 2022-04-20 21:20:19.092144400 +0200 -@@ -722,7 +722,6 @@ +Index: Stockfish-sf_15.1/src/Makefile +=================================================================== +--- Stockfish-sf_15.1.orig/src/Makefile ++++ Stockfish-sf_15.1/src/Makefile +@@ -748,7 +748,6 @@ help: @echo "" @echo "help > Display architecture details" @echo "build > Standard build" @@ -9,14 +10,14 @@ diff -urEbw Stockfish-sf_15/src/Makefile Stockfish-sf_15.new/src/Makefile @echo "profile-build > Faster build (with profile-guided optimization)" @echo "strip > Strip executable" @echo "install > Install executable" -@@ -783,14 +782,14 @@ +@@ -810,14 +809,14 @@ else endif -.PHONY: help build profile-build strip install clean net objclean profileclean \ +.PHONY: help build profile-build strip install clean objclean profileclean \ config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \ - clang-profile-use clang-profile-make + clang-profile-use clang-profile-make FORCE -build: net config-sanity +build: config-sanity @@ -27,7 +28,7 @@ diff -urEbw Stockfish-sf_15/src/Makefile Stockfish-sf_15.new/src/Makefile @echo "" @echo "Step 1/4. Building instrumented executable ..." $(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_make) -@@ -817,30 +816,6 @@ +@@ -844,40 +843,6 @@ install: clean: objclean profileclean @rm -f .depend *~ core @@ -35,30 +36,40 @@ diff -urEbw Stockfish-sf_15/src/Makefile Stockfish-sf_15.new/src/Makefile -net: - $(eval nnuenet := $(shell grep EvalFileDefaultName evaluate.h | grep define | sed 's/.*\(nn-[a-z0-9]\{12\}.nnue\).*/\1/')) - @echo "Default net: $(nnuenet)" -- $(eval nnuedownloadurl := https://tests.stockfishchess.org/api/nn/$(nnuenet)) +- $(eval nnuedownloadurl1 := https://tests.stockfishchess.org/api/nn/$(nnuenet)) +- $(eval nnuedownloadurl2 := https://github.com/official-stockfish/networks/raw/master/$(nnuenet)) - $(eval curl_or_wget := $(shell if hash curl 2>/dev/null; then echo "curl -skL"; elif hash wget 2>/dev/null; then echo "wget -qO-"; fi)) -- @if test -f "$(nnuenet)"; then \ -- echo "Already available."; \ -- else \ -- if [ "x$(curl_or_wget)" = "x" ]; then \ -- echo "Automatic download failed: neither curl nor wget is installed. Install one of these tools or download the net manually"; exit 1; \ -- else \ -- echo "Downloading $(nnuedownloadurl)"; $(curl_or_wget) $(nnuedownloadurl) > $(nnuenet);\ -- fi; \ -- fi; +- @if [ "x$(curl_or_wget)" = "x" ]; then \ +- echo "Automatic download failed: neither curl nor wget is installed. Install one of these tools or download the net manually"; exit 1; \ +- fi - $(eval shasum_command := $(shell if hash shasum 2>/dev/null; then echo "shasum -a 256 "; elif hash sha256sum 2>/dev/null; then echo "sha256sum "; fi)) -- @if [ "x$(shasum_command)" != "x" ]; then \ -- if [ "$(nnuenet)" != "nn-"`$(shasum_command) $(nnuenet) | cut -c1-12`".nnue" ]; then \ -- echo "Failed download or $(nnuenet) corrupted, please delete!"; exit 1; \ -- fi \ -- else \ +- @if [ "x$(shasum_command)" = "x" ]; then \ - echo "shasum / sha256sum not found, skipping net validation"; \ - fi +- @for nnuedownloadurl in "$(nnuedownloadurl1)" "$(nnuedownloadurl2)"; do \ +- if test -f "$(nnuenet)"; then \ +- echo "$(nnuenet) available."; \ +- else \ +- if [ "x$(curl_or_wget)" != "x" ]; then \ +- echo "Downloading $${nnuedownloadurl}"; $(curl_or_wget) $${nnuedownloadurl} > $(nnuenet);\ +- fi; \ +- fi; \ +- if [ "x$(shasum_command)" != "x" ]; then \ +- if [ "$(nnuenet)" != "nn-"`$(shasum_command) $(nnuenet) | cut -c1-12`".nnue" ]; then \ +- echo "Removing failed download"; rm -f $(nnuenet); \ +- else \ +- echo "Network validated"; break; \ +- fi; \ +- fi; \ +- done +- @if ! test -f "$(nnuenet)"; then \ +- echo "Failed to download $(nnuenet)."; \ +- fi - # clean binaries and objects objclean: @rm -f stockfish stockfish.exe *.o ./syzygy/*.o ./nnue/*.o ./nnue/features/*.o -@@ -864,7 +839,7 @@ +@@ -901,7 +866,7 @@ default: all: $(EXE) .depend diff --git a/stockfish.changes b/stockfish.changes index 9bc3472..f028f09 100644 --- a/stockfish.changes +++ b/stockfish.changes @@ -1,3 +1,29 @@ +------------------------------------------------------------------- +Tue Dec 6 15:15:03 UTC 2022 - Michael Vetter + +- Update to 15.1: + * Elo gain and competition results: + With this release, version 5 of the NNUE neural net architecture + has been introduced, and the training data has been extended to + include Fischer random chess (FRC) positions. As a result, Elo + gains are largest for FRC, reaching up to 50 Elo for doubly + randomized FRC (DFRC). More importantly, also for standard chess + this release progressed and will win two times more game pairs than + it loses against Stockfish 15. + * New evaluation: + This release also introduces a new convention for the evaluation + that is reported by search. An evaluation of +1 is now no longer + tied to the value of one pawn, but to the likelihood of winning the + game. With a +1 evaluation, Stockfish has now a 50% chance of winning + the game against an equally strong opponent. This convention scales + down evaluations a bit compared to Stockfish 15 and allows for + consistent evaluations in the future. +- Refresh: + * date.patch + * stockfish-remove-net.patch +- Remove nn-6877cd24400e.nnue +- Add nn-ad9b42354671.nnue + ------------------------------------------------------------------- Wed Apr 20 19:17:58 UTC 2022 - Michael Vetter diff --git a/stockfish.spec b/stockfish.spec index 526d6f2..3120fc0 100644 --- a/stockfish.spec +++ b/stockfish.spec @@ -17,9 +17,9 @@ # See evaluate.h > EvalFileDefaultName -%define nnuenet nn-6877cd24400e.nnue +%define nnuenet nn-ad9b42354671.nnue Name: stockfish -Version: 15 +Version: 15.1 Release: 0 Summary: Chess engine License: GPL-3.0-or-later @@ -27,8 +27,8 @@ URL: https://stockfishchess.org Source0: https://github.com/official-stockfish/Stockfish/archive/sf_%{version}.tar.gz#/Stockfish-sf_%{version}.tar.gz Source1: https://tests.stockfishchess.org/api/nn/%{nnuenet} # steal some documentation from ubuntu -Source10: https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/%{name}/vivid/download/head:/engineinterface.txt-20091204230329-yljoyxocuxhxg1ot-78/engine-interface.txt#/%{name}-interface.txt -Source11: https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/%{name}/vivid/download/head:/%{name}.6-20091204230329-yljoyxocuxhxg1ot-76/%{name}.6 +Source10: %{name}-interface.txt +Source11: %{name}.6-20091204230329-yljoyxocuxhxg1ot-76/%{name}.6 # If 'Version' is not set it will display the date as version number. We dont want __DATE__ and Version is set anyways. Patch0: date.patch # Don't try to download file. We already have it. From 088fc8a730ebb161e73ddcebb059619d151226636c4e30899ffe77f927c08185 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Tue, 6 Dec 2022 15:20:06 +0000 Subject: [PATCH 2/2] - Keep man page and stockfish-interface.txt but remove URL from Source. Because not available anymore. OBS-URL: https://build.opensuse.org/package/show/games/stockfish?expand=0&rev=30 --- stockfish.changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stockfish.changes b/stockfish.changes index f028f09..c5a59f9 100644 --- a/stockfish.changes +++ b/stockfish.changes @@ -23,6 +23,8 @@ Tue Dec 6 15:15:03 UTC 2022 - Michael Vetter * stockfish-remove-net.patch - Remove nn-6877cd24400e.nnue - Add nn-ad9b42354671.nnue +- Keep man page and stockfish-interface.txt but remove URL from + Source. Because not available anymore. ------------------------------------------------------------------- Wed Apr 20 19:17:58 UTC 2022 - Michael Vetter