Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid fen detection and crash prevention #4720

Closed
wants to merge 7 commits into from
Closed

Invalid fen detection and crash prevention #4720

wants to merge 7 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 3, 2023

This regex can detect all valid fen and prevent Stockfish from crashing.

\s*([rnbqkpRNBQKP1-8]+\/){7}([rnbqkpRNBQKP1-8]+)\\s[bw-]\\s(([a-hkqA-HKQ]{1,4})|(-))\\s(([a-h][3-6])|(-))\\s\\d+\\s\\d+ \s*

src/uci.cpp Outdated Show resolved Hide resolved
@ddobbelaere
Copy link
Contributor

It does not seem nice to impersonate "Kasparov Chess" (unless we have the honor of meeting the Boss from Baku himself in this PR).

Anyway, assuming this is not some troll account/PR and this is meant to make some sense: C++ raw string literals can be used here to limit the number of escape backslashes in the regex string. See (6) of this link.

@ghost
Copy link
Author

ghost commented Aug 4, 2023

C++ raw string literals can be used here to limit the number of escape backslashes in the regex string. See (6) of this link.

I compiled the source code on my local system via clang and mingw compiler but there is no error on my pc!

Click to view
$ make profile-build ARCH=x86-64-avx2 COMP=clang
Default net: nn-5af11540bbfe.nnue
nn-5af11540bbfe.nnue available.
Network validated

Config:
debug: 'no'
sanitize: 'none'
optimize: 'yes'
arch: 'x86_64'
bits: '64'
kernel: 'MINGW64_NT-10.0-19044'
os: 'Windows_NT'
prefetch: 'yes'
popcnt: 'yes'
pext: 'no'
sse: 'yes'
mmx: 'no'
sse2: 'yes'
ssse3: 'yes'
sse41: 'yes'
avx2: 'yes'
avxvnni: 'no'
avx512: 'no'
vnni256: 'no'
vnni512: 'no'
neon: 'no'
dotprod: 'no'
arm_version: '0'
target_windows: 'yes'

Flags:
CXX: x86_64-w64-mingw32-clang++
CXXFLAGS:  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld
LDFLAGS:   -static -m64 -lpthread  -Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld

Testing config sanity. If this fails, try 'make help' ...


Step 1/4. Building instrumented executable ...
make ARCH=x86-64-avx2 COMP=clang clang-profile-make
make[1]: Entering directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'
make ARCH=x86-64-avx2 COMP=clang \
EXTRACXXFLAGS='-fprofile-instr-generate ' \
EXTRALDFLAGS=' -fprofile-instr-generate' \
all
make[2]: Entering directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o benchmark.o benchmark.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o bitbase.o bitbase.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o bitboard.o bitboard.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o endgame.o endgame.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o evaluate.o evaluate.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o main.o main.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o material.o material.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o misc.o misc.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o movegen.o movegen.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o movepick.o movepick.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o pawns.o pawns.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o position.o position.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o psqt.o psqt.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o search.o search.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o thread.o thread.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o timeman.o timeman.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o tt.o tt.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o uci.o uci.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o ucioption.o ucioption.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o tune.o tune.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o tbprobe.o syzygy/tbprobe.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o evaluate_nnue.o nnue/evaluate_nnue.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o half_ka_v2_hm.o nnue/features/half_ka_v2_hm.cpp
x86_64-w64-mingw32-clang++ -o stockfish.exe benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o search.o thread.o timeman.o tt.o uci.o ucioption.o tune.o tbprobe.o evaluate_nnue.o half_ka_v2_hm.o  -fprofile-instr-generate -static -m64 -lpthread  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld
make[2]: Leaving directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'
make[1]: Leaving directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'

Step 2/4. Running benchmark for pgo-build ...
./stockfish.exe bench 2>&1 | tail -n 4
===========================
Total time (ms) : 2662
Nodes searched  : 2608273
Nodes/second    : 979817

Step 3/4. Building optimized executable ...
make ARCH=x86-64-avx2 COMP=clang objclean
make[1]: Entering directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'
make[1]: Leaving directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'
make ARCH=x86-64-avx2 COMP=clang clang-profile-use
make[1]: Entering directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'
llvm-profdata merge -output=stockfish.profdata *.profraw
make ARCH=x86-64-avx2 COMP=clang \
EXTRACXXFLAGS='-fprofile-instr-use=stockfish.profdata' \
EXTRALDFLAGS='-fprofile-use ' \
all
make[2]: Entering directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o benchmark.o benchmark.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o bitbase.o bitbase.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o bitboard.o bitboard.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o endgame.o endgame.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o evaluate.o evaluate.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o main.o main.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o material.o material.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o misc.o misc.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o movegen.o movegen.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o movepick.o movepick.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o pawns.o pawns.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o position.o position.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o psqt.o psqt.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o search.o search.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o thread.o thread.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o timeman.o timeman.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o tt.o tt.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o uci.o uci.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o ucioption.o ucioption.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o tune.o tune.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o tbprobe.o syzygy/tbprobe.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o evaluate_nnue.o nnue/evaluate_nnue.cpp
x86_64-w64-mingw32-clang++  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld   -c -o half_ka_v2_hm.o nnue/features/half_ka_v2_hm.cpp
x86_64-w64-mingw32-clang++ -o stockfish.exe benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o search.o thread.o timeman.o tt.o uci.o ucioption.o tune.o tbprobe.o evaluate_nnue.o half_ka_v2_hm.o  -fprofile-use  -static -m64 -lpthread  -Wall -Wcast-qual -fno-exceptions -std=c++17 -fprofile-instr-use=stockfish.profdata -pedantic -Wextra -Wshadow -Wmissing-prototypes -Wconditional-uninitialized -m64 -DUSE_PTHREADS -DNDEBUG -O3 -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_AVX2 -mavx2 -mbmi -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto=full -fuse-ld=lld
make[2]: Leaving directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'
make[1]: Leaving directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'

Step 4/4. Deleting profile data ...
make ARCH=x86-64-avx2 COMP=clang profileclean
make[1]: Entering directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'
make[1]: Leaving directory '/c/Users/admin/Downloads/stockfish-windows-x86-64-avx2/stockfish/src'

@ppigazzini
Copy link
Contributor

ppigazzini commented Aug 5, 2023

https://github.com/official-stockfish/Stockfish/actions/runs/5766936758/job/15635825086#step:17:72

signature mismatch: reference 1350831 obtained: 1355344 .
Error: Process completed with exit code 1.

The CI stops because the PR changes the bench, so you should add in the last line of the commit message:

bench 1355344

You can update the commit message with:

git commit --amend
# update the commit message
git push -f origin HEAD

By the way, in your previous post Nodes searched : 2608273 so it seems that the PR is outputting random bench signatures.

@cj5716
Copy link
Contributor

cj5716 commented Aug 5, 2023

just a question: why should bench change? considering how the regex only detects illegal fens and all the fens in bench command is legal

@ppigazzini
Copy link
Contributor

ppigazzini commented Aug 5, 2023

mmm, master does nothing on positions 45 and 46, I don't know if this is expected:

Click to view
Position: 44/48 (r2r1n2/pp2bk2/2p1p2p/3q4/3PN1QP/2P3R1/P4PP1/5RK1 w - - 0 1)
info string NNUE evaluation using nn-c38c3d8d3920.nnue
info depth 1 seldepth 1 multipv 1 score cp 563 nodes 59 nps 59000 hashfull 24 tbhits 0 time 1 pv g4f4 e7f6
info depth 2 seldepth 2 multipv 1 score cp 236 nodes 185 nps 185000 hashfull 24 tbhits 0 time 1 pv g3f3 f7e8
info depth 3 seldepth 3 multipv 1 score cp 236 nodes 268 nps 268000 hashfull 24 tbhits 0 time 1 pv g3f3 f7e8
info depth 4 seldepth 3 multipv 1 score cp 236 nodes 303 nps 303000 hashfull 24 tbhits 0 time 1 pv g3f3 f7e8
info depth 5 seldepth 3 multipv 1 score cp 265 nodes 458 nps 229000 hashfull 24 tbhits 0 time 2 pv c3c4 d5d4
info depth 6 seldepth 4 multipv 1 score cp 328 nodes 775 nps 387500 hashfull 24 tbhits 0 time 2 pv f1b1 d5f5 g4g7 f7e8 b1b7
info depth 7 seldepth 6 multipv 1 score cp 292 nodes 1043 nps 347666 hashfull 24 tbhits 0 time 3 pv c3c4 d5f5 g3f3
info depth 8 seldepth 6 multipv 1 score cp 310 nodes 1949 nps 389800 hashfull 24 tbhits 0 time 5 pv c3c4 d5a5 g4g7 f7e8 g3f3
info depth 9 seldepth 7 multipv 1 score cp 399 nodes 2339 nps 467800 hashfull 24 tbhits 0 time 5 pv c3c4 d5a5 g3f3 f7e8 g4g7
info depth 10 seldepth 11 multipv 1 score cp 421 nodes 2848 nps 474666 hashfull 24 tbhits 0 time 6 pv c3c4 d5a5 g4g7 f7e8 g3f3 d8b8
info depth 11 seldepth 13 multipv 1 score cp 542 nodes 4712 nps 523555 hashfull 25 tbhits 0 time 9 pv c3c4 d5f5 g3f3 d8d4 f3f5 e6f5 g4f5 f7g8
info depth 12 seldepth 9 multipv 1 score cp 528 nodes 5566 nps 506000 hashfull 25 tbhits 0 time 11 pv c3c4 d5a5 g3f3 f7e8 g4g7 f8g6 g7g6 e8d7
info depth 13 seldepth 17 multipv 1 score cp 536 nodes 10613 nps 530650 hashfull 27 tbhits 0 time 20 pv c3c4 d5a5 g3f3 f7e8 g4g7 f8g6 e4c5 g6f4 f3f4
bestmove c3c4 ponder d5a5

Position: 45/48 (8/8/8/8/8/6k1/6p1/6K1 w - - 0 1)
info string NNUE evaluation using nn-c38c3d8d3920.nnue
info depth 0 score cp 0
bestmove (none)

Position: 46/48 (7k/7P/6K1/8/3B4/8/8/8 b - - 0 1)
info string NNUE evaluation using nn-c38c3d8d3920.nnue
info depth 0 score mate 0
bestmove (none)

Position: 47/48 (bb1n1rkr/ppp1Q1pp/3n1p2/3p4/3P4/6Pq/PPP1PP1P/BB1NNRKR w HFhf - 0 5)
info string NNUE evaluation using nn-c38c3d8d3920.nnue
info depth 1 seldepth 1 multipv 1 score cp 6 nodes 38 nps 38000 hashfull 16 tbhits 0 time 1 pv e1g2
info depth 2 seldepth 2 multipv 1 score cp 6 nodes 69 nps 69000 hashfull 16 tbhits 0 time 1 pv e1g2
info depth 3 seldepth 2 multipv 1 score cp 6 nodes 98 nps 98000 hashfull 16 tbhits 0 time 1 pv e1g2
info depth 4 seldepth 2 multipv 1 score cp 64 nodes 131 nps 131000 hashfull 16 tbhits 0 time 1 pv e1g2
info depth 5 seldepth 3 multipv 1 score cp 37 nodes 242 nps 121000 hashfull 16 tbhits 0 time 2 pv b2b3
info depth 6 seldepth 4 multipv 1 score cp 80 nodes 321 nps 160500 hashfull 16 tbhits 0 time 2 pv b2b3
info depth 7 seldepth 10 multipv 1 score cp -221 nodes 2764 nps 552800 hashfull 16 tbhits 0 time 5 pv e1g2 f8e8 g2f4 h3f5 d1e3 e8e7 e3f5 d6f5 c2c4
info depth 8 seldepth 10 multipv 1 score cp -221 nodes 2846 nps 569200 hashfull 16 tbhits 0 time 5 pv e1g2 f8e8 g2f4 h3f5 d1e3 e8e7 e3f5 d6f5 c2c4
info depth 9 seldepth 11 multipv 1 score cp -56 nodes 3576 nps 596000 hashfull 17 tbhits 0 time 6 pv e7e3 b7b5 e1g2 f8e8
info depth 10 seldepth 17 multipv 1 score cp -61 nodes 16071 nps 487000 hashfull 22 tbhits 0 time 33 pv e7e3 b7b6 e1g2 d8e6 c2c3 c7c5 b2b3 f8e8 e3d3 g8h8 f2f3 f6f5
info depth 11 seldepth 14 multipv 1 score cp -64 nodes 19550 nps 488750 hashfull 25 tbhits 0 time 40 pv e7e3 b7b6 e1g2 c7c5 g2f4 h3d7 e3f3 c5c4
info depth 12 seldepth 13 multipv 1 score cp -59 nodes 33628 nps 494529 hashfull 31 tbhits 0 time 68 pv e7e3 b7b6 b2b3 c7c5 f2f3 c5d4
info depth 13 seldepth 11 multipv 1 score cp -48 nodes 51399 nps 529886 hashfull 37 tbhits 0 time 97 pv e7e3 b7b6 b2b3 f8e8 e3d3 c7c5
bestmove e7e3 ponder b7b6

Position: 48/48 (nqbnrkrb/pppppppp/8/8/8/8/PPPPPPPP/NQBNRKRB w GEge - 0 1)
info string NNUE evaluation using nn-c38c3d8d3920.nnue
info depth 1 seldepth 1 multipv 1 score cp 39 nodes 20 nps 20000 hashfull 2 tbhits 0 time 1 pv g2g3
info depth 2 seldepth 2 multipv 1 score cp 76 nodes 52 nps 52000 hashfull 2 tbhits 0 time 1 pv c2c4
info depth 3 seldepth 2 multipv 1 score cp 76 nodes 73 nps 73000 hashfull 2 tbhits 0 time 1 pv c2c4
info depth 4 seldepth 2 multipv 1 score cp 122 nodes 97 nps 97000 hashfull 2 tbhits 0 time 1 pv c2c4
info depth 5 seldepth 5 multipv 1 score cp 78 nodes 340 nps 170000 hashfull 2 tbhits 0 time 2 pv c2c4 b7b5 b1h7 b5c4
info depth 6 seldepth 6 multipv 1 score cp 28 nodes 3265 nps 466428 hashfull 3 tbhits 0 time 7 pv g2g3 f8g8 f1g1 g7g6 c2c3 d7d6 d2d4
info depth 7 seldepth 8 multipv 1 score cp 35 nodes 3881 nps 485125 hashfull 3 tbhits 0 time 8 pv f1g1 f8g8 g2g3 g7g6 c2c3 d7d6
info depth 8 seldepth 8 multipv 1 score cp 35 nodes 5197 nps 472454 hashfull 3 tbhits 0 time 11 pv f1g1 f8g8 g2g3 g7g6 c2c3 d7d6 h1g2
info depth 9 seldepth 10 multipv 1 score cp 40 nodes 7062 nps 504428 hashfull 4 tbhits 0 time 14 pv c2c3 f8g8 f1g1 g7g6 d2d4 h8g7 g2g3 d7d6
info depth 10 seldepth 13 multipv 1 score cp 22 nodes 18315 nps 538676 hashfull 7 tbhits 0 time 34 pv c2c3 g7g6 f1g1 f8g8 d2d4 h8g7 g2g3 d7d6
info depth 11 seldepth 14 multipv 1 score cp 14 nodes 31276 nps 539241 hashfull 11 tbhits 0 time 58 pv c2c3 f8g8 f1g1 g7g6 d2d4 d7d6 c1h6 h8g7 h6g7 g8g7
info depth 12 seldepth 13 multipv 1 score cp 20 nodes 36519 nps 553318 hashfull 12 tbhits 0 time 66 pv f1g1 g7g6 g2g3 f8g8 c2c3 d7d6 d2d4 h8g7 f2f4 e7e5 f4e5 d6e5
info depth 13 seldepth 15 multipv 1 score cp 20 nodes 51277 nps 557358 hashfull 19 tbhits 0 time 92 pv c2c3 f8g8 d2d4 g7g6 c1h6 h8g7 h6g7 g8g7 f1g1 d7d6 e2e4
bestmove c2c3 ponder f8g8

===========================
Total time (ms) : 2343
Nodes searched  : 1350831
Nodes/second    : 576539

PR computes positions 45 and 46:

Click to view
Position: 44/48 (r2r1n2/pp2bk2/2p1p2p/3q4/3PN1QP/2P3R1/P4PP1/5RK1 w - - 0 1)
info string NNUE evaluation using nn-c38c3d8d3920.nnue
info depth 1 seldepth 1 multipv 1 score cp 563 nodes 59 nps 29500 hashfull 24 tbhits 0 time 2 pv g4f4 e7f6
info depth 2 seldepth 2 multipv 1 score cp 236 nodes 185 nps 92500 hashfull 24 tbhits 0 time 2 pv g3f3 f7e8
info depth 3 seldepth 3 multipv 1 score cp 236 nodes 268 nps 134000 hashfull 24 tbhits 0 time 2 pv g3f3 f7e8
info depth 4 seldepth 3 multipv 1 score cp 236 nodes 303 nps 151500 hashfull 24 tbhits 0 time 2 pv g3f3 f7e8
info depth 5 seldepth 3 multipv 1 score cp 265 nodes 458 nps 229000 hashfull 24 tbhits 0 time 2 pv c3c4 d5d4
info depth 6 seldepth 4 multipv 1 score cp 328 nodes 775 nps 258333 hashfull 24 tbhits 0 time 3 pv f1b1 d5f5 g4g7 f7e8 b1b7
info depth 7 seldepth 6 multipv 1 score cp 292 nodes 1043 nps 347666 hashfull 24 tbhits 0 time 3 pv c3c4 d5f5 g3f3
info depth 8 seldepth 6 multipv 1 score cp 310 nodes 1949 nps 389800 hashfull 24 tbhits 0 time 5 pv c3c4 d5a5 g4g7 f7e8 g3f3
info depth 9 seldepth 7 multipv 1 score cp 399 nodes 2339 nps 389833 hashfull 24 tbhits 0 time 6 pv c3c4 d5a5 g3f3 f7e8 g4g7
info depth 10 seldepth 11 multipv 1 score cp 421 nodes 2848 nps 474666 hashfull 24 tbhits 0 time 6 pv c3c4 d5a5 g4g7 f7e8 g3f3 d8b8
info depth 11 seldepth 13 multipv 1 score cp 542 nodes 4712 nps 471200 hashfull 25 tbhits 0 time 10 pv c3c4 d5f5 g3f3 d8d4 f3f5 e6f5 g4f5 f7g8
info depth 12 seldepth 9 multipv 1 score cp 528 nodes 5566 nps 506000 hashfull 25 tbhits 0 time 11 pv c3c4 d5a5 g3f3 f7e8 g4g7 f8g6 g7g6 e8d7
info depth 13 seldepth 17 multipv 1 score cp 536 nodes 10613 nps 505380 hashfull 27 tbhits 0 time 21 pv c3c4 d5a5 g3f3 f7e8 g4g7 f8g6 e4c5 g6f4 f3f4
bestmove c3c4 ponder d5a5
Invalid fen

Position: 45/48 (r2r1n2/pp2bk2/2p1p2p/3q4/3PN1QP/2P3R1/P4PP1/5RK1 w - - 0 1)
info string NNUE evaluation using nn-c38c3d8d3920.nnue
info depth 1 seldepth 1 multipv 1 score cp 536 nodes 46 nps 46000 hashfull 6 tbhits 0 time 1 pv c3c4
info depth 2 seldepth 2 multipv 1 score cp 536 nodes 91 nps 91000 hashfull 6 tbhits 0 time 1 pv c3c4 d5a5
info depth 3 seldepth 3 multipv 1 score cp 536 nodes 134 nps 134000 hashfull 6 tbhits 0 time 1 pv c3c4 d5a5 g3f3 f7e8
info depth 4 seldepth 5 multipv 1 score cp 536 nodes 228 nps 228000 hashfull 6 tbhits 0 time 1 pv c3c4 d5a5 g3f3 f7e8
info depth 5 seldepth 6 multipv 1 score cp 453 nodes 415 nps 207500 hashfull 6 tbhits 0 time 2 pv c3c4 d5a5 g4g7 f7e8 g3f3 d8c8
info depth 6 seldepth 6 multipv 1 score cp 453 nodes 494 nps 247000 hashfull 6 tbhits 0 time 2 pv c3c4 d5a5 g3f3 f7e8 g4g7
info depth 7 seldepth 9 multipv 1 score cp 539 nodes 705 nps 352500 hashfull 7 tbhits 0 time 2 pv c3c4 d5f5 g3f3 f7e8
info depth 8 seldepth 6 multipv 1 score cp 539 nodes 801 nps 400500 hashfull 7 tbhits 0 time 2 pv c3c4 d5f5 g3f3 f7e8 f3f5
info depth 9 seldepth 10 multipv 1 score cp 543 nodes 1379 nps 459666 hashfull 7 tbhits 0 time 3 pv c3c4 d5f5 g3f3 d8d4 f3f5 e6f5 g4f5 f7g8 f1e1 d4c4
info depth 10 seldepth 11 multipv 1 score cp 543 nodes 1990 nps 497500 hashfull 8 tbhits 0 time 4 pv c3c4 d5f5 g3f3 d8d4 f3f5 e6f5 g4f5 f7g8 f1e1 d4c4
info depth 11 seldepth 12 multipv 1 score cp 543 nodes 2327 nps 581750 hashfull 8 tbhits 0 time 4 pv c3c4 d5f5 g3f3 f8g6 f3f5 e6f5 g4f5 f7g7 g2g3
info depth 12 seldepth 12 multipv 1 score mate 4 nodes 3128 nps 521333 hashfull 8 tbhits 0 time 6 pv g4g7 f7e8 g7e7 e8e7 g3g7 e7e8 e4f6
info depth 13 seldepth 8 multipv 1 score mate 4 nodes 3758 nps 536857 hashfull 9 tbhits 0 time 7 pv g4g7 f7e8 g7e7 e8e7 g3g7 e7e8 e4f6
bestmove g4g7 ponder f7e8
Invalid fen

Position: 46/48 (r2r1n2/pp2bk2/2p1p2p/3q4/3PN1QP/2P3R1/P4PP1/5RK1 w - - 0 1)
info string NNUE evaluation using nn-c38c3d8d3920.nnue
info depth 1 seldepth 1 multipv 1 score mate 4 nodes 36 nps 18000 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8
info depth 2 seldepth 2 multipv 1 score mate 4 nodes 74 nps 37000 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8
info depth 3 seldepth 3 multipv 1 score mate 4 nodes 116 nps 58000 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8 g7e7 e8e7
info depth 4 seldepth 4 multipv 1 score mate 4 nodes 158 nps 79000 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8 g7e7 e8e7
info depth 5 seldepth 5 multipv 1 score mate 4 nodes 200 nps 100000 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8 g7e7 e8e7 g3g7 e7e8
info depth 6 seldepth 7 multipv 1 score mate 4 nodes 242 nps 121000 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8 g7e7 e8e7 g3g7 e7e8 e4f6
info depth 7 seldepth 8 multipv 1 score mate 4 nodes 284 nps 142000 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8 g7e7 e8e7 g3g7 e7e8 e4f6
info depth 8 seldepth 8 multipv 1 score mate 4 nodes 326 nps 163000 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8 g7e7 e8e7 g3g7 e7e8 e4f6
info depth 9 seldepth 8 multipv 1 score mate 4 nodes 368 nps 184000 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8 g7e7 e8e7 g3g7 e7e8 e4f6
info depth 10 seldepth 8 multipv 1 score mate 4 nodes 413 nps 206500 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8 g7e7 e8e7 g3g7 e7e8 e4f6
info depth 11 seldepth 8 multipv 1 score mate 4 nodes 463 nps 231500 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8 g7e7 e8e7 g3g7 e7e8 e4f6
info depth 12 seldepth 8 multipv 1 score mate 4 nodes 520 nps 260000 hashfull 27 tbhits 0 time 2 pv g4g7 f7e8 g7e7 e8e7 g3g7 e7e8 e4f6
info depth 13 seldepth 8 multipv 1 score mate 4 nodes 697 nps 232333 hashfull 28 tbhits 0 time 3 pv g4g7 f7e8 g7e7 e8e7 g3g7 e7e8 e4f6
bestmove g4g7 ponder f7e8

Position: 47/48 (bb1n1rkr/ppp1Q1pp/3n1p2/3p4/3P4/6Pq/PPP1PP1P/BB1NNRKR w HFhf - 0 5)
info string NNUE evaluation using nn-c38c3d8d3920.nnue
info depth 1 seldepth 1 multipv 1 score cp 6 nodes 38 nps 38000 hashfull 16 tbhits 0 time 1 pv e1g2
info depth 2 seldepth 2 multipv 1 score cp 6 nodes 69 nps 69000 hashfull 16 tbhits 0 time 1 pv e1g2
info depth 3 seldepth 2 multipv 1 score cp 6 nodes 98 nps 98000 hashfull 16 tbhits 0 time 1 pv e1g2
info depth 4 seldepth 2 multipv 1 score cp 64 nodes 131 nps 131000 hashfull 16 tbhits 0 time 1 pv e1g2
info depth 5 seldepth 4 multipv 1 score cp -121 nodes 796 nps 398000 hashfull 16 tbhits 0 time 2 pv e2e4 f8e8
info depth 6 seldepth 4 multipv 1 score cp -7 nodes 876 nps 438000 hashfull 16 tbhits 0 time 2 pv e1g2 f8e8 g2f4 e8e7
info depth 7 seldepth 7 multipv 1 score cp -33 nodes 978 nps 326000 hashfull 16 tbhits 0 time 3 pv e1g2 f8e8 g2f4 h3f5
info depth 8 seldepth 9 multipv 1 score cp -96 nodes 2012 nps 670666 hashfull 16 tbhits 0 time 3 pv e1g2 f8e8 g2f4 h3f5 d1e3 e8e7 e3f5 d6f5
info depth 9 seldepth 10 multipv 1 score cp -111 nodes 3088 nps 617600 hashfull 16 tbhits 0 time 5 pv e7e3 b7b6 e1f3
info depth 10 seldepth 6 multipv 1 score cp -33 nodes 3870 nps 645000 hashfull 16 tbhits 0 time 6 pv e7e3 d8e6 b2b3 c7c5 e3d3
info depth 11 seldepth 12 multipv 1 score cp -62 nodes 16810 nps 542258 hashfull 22 tbhits 0 time 31 pv e7e3 f8e8 e3d3 b7b6 f2f3 c7c5 b2b3 g8h8 c2c3 h3h6
info depth 12 seldepth 16 multipv 1 score cp -56 nodes 41643 nps 527126 hashfull 32 tbhits 0 time 79 pv e7e3 b7b6 e1g2 c7c5 b2b3 f8e8 e3c1 g8h8 c2c3 g7g5 f2f3 e8e2 d1f2 h3d7
info depth 13 seldepth 16 multipv 1 score cp -49 nodes 55994 nps 554396 hashfull 36 tbhits 0 time 101 pv e7e3 f8e8 e3d3 b7b6 b2b4 c7c5 b4c5
bestmove e7e3 ponder f8e8

Position: 48/48 (nqbnrkrb/pppppppp/8/8/8/8/PPPPPPPP/NQBNRKRB w GEge - 0 1)
info string NNUE evaluation using nn-c38c3d8d3920.nnue
info depth 1 seldepth 1 multipv 1 score cp 39 nodes 20 nps 20000 hashfull 2 tbhits 0 time 1 pv g2g3
info depth 2 seldepth 2 multipv 1 score cp 41 nodes 57 nps 28500 hashfull 2 tbhits 0 time 2 pv f1g1
info depth 3 seldepth 2 multipv 1 score cp 41 nodes 77 nps 38500 hashfull 2 tbhits 0 time 2 pv f1g1
info depth 4 seldepth 2 multipv 1 score cp 41 nodes 119 nps 59500 hashfull 2 tbhits 0 time 2 pv f1g1 c7c5
info depth 5 seldepth 4 multipv 1 score cp 64 nodes 233 nps 116500 hashfull 2 tbhits 0 time 2 pv c2c3 d7d5 g2g3
info depth 6 seldepth 5 multipv 1 score cp 44 nodes 1628 nps 325600 hashfull 3 tbhits 0 time 5 pv f1g1 g7g6 d2d4 f8g8 c2c3
info depth 7 seldepth 7 multipv 1 score cp 44 nodes 1785 nps 357000 hashfull 3 tbhits 0 time 5 pv f1g1 g7g6 d2d4 f8g8 c2c3 h8g7 g2g3
info depth 8 seldepth 9 multipv 1 score cp 44 nodes 3179 nps 397375 hashfull 4 tbhits 0 time 8 pv f1g1 g7g6 d2d4 f8g8 c2c3 h8g7 g2g3 c7c6
info depth 9 seldepth 11 multipv 1 score cp 21 nodes 15479 nps 515966 hashfull 7 tbhits 0 time 30 pv f1g1 g7g6 g2g3 f8g8 c2c3 d7d6 d2d4 h8g7 b1d3 e7e5 f2f4
info depth 10 seldepth 14 multipv 1 score cp 13 nodes 23638 nps 537227 hashfull 9 tbhits 0 time 44 pv f1g1 f8g8 c2c3 g7g6 g2g3 d7d6
info depth 11 seldepth 11 multipv 1 score cp 12 nodes 25320 nps 550434 hashfull 9 tbhits 0 time 46 pv f1g1 f8g8 g2g3 g7g6 c2c3 d7d6 d2d4 e7e5 d4e5 d6e5 c1h6 h8g7
info depth 12 seldepth 14 multipv 1 score cp 22 nodes 30292 nps 571547 hashfull 11 tbhits 0 time 53 pv c2c3 f8g8 f1g1 d7d6 e2e4 e7e5 g2g3 g7g6 d2d3 h8g7
info depth 13 seldepth 15 multipv 1 score cp 25 nodes 46740 nps 570000 hashfull 17 tbhits 0 time 82 pv f1g1 f8g8 g2g3 e7e5 e2e4 g7g6 d2d3 d7d6 c2c3 h8g7
bestmove f1g1 ponder f8g8

===========================
Total time (ms) : 2285
Nodes searched  : 1355344
Nodes/second    : 593148

@cj5716
Copy link
Contributor

cj5716 commented Aug 5, 2023

it detects the invalid fen afterwards I think

@ppigazzini
Copy link
Contributor

The output of first 44 positions are equal, master and PR diverge after the first Invalid fen at position 44

bestmove c3c4 ponder d5a5
Invalid fen

@cj5716
Copy link
Contributor

cj5716 commented Aug 5, 2023

@ppigazzini
Copy link
Contributor

ppigazzini commented Aug 5, 2023

It got the master bench 1350831 commenting out the return;
So the PR introduces a functional change and to pass the CI the commit message must have the new signature in the last line,
I'm only helping to explain why the CI fails. I don't know the SF code so I don't know if the proposed PR makes sense.

EDIT: 45 (stalemate) and 46 (checkmate) are sanity check positions, master correctly doesn't find a bestmove, so the PR seems to be a regression.

@ghost
Copy link
Author

ghost commented Aug 5, 2023

Thanks to @ppigazzini , the problem quickly resolved. I corrected the incomplete fens.

-   8/8/8/8/8/6k1/6p1/6K1 w - -
+   8/8/8/8/8/6k1/6p1/6K1 w - - 0 1
-   7k/7P/6K1/8/3B4/8/8/8 b - -
+   7k/7P/6K1/8/3B4/8/8/8 b - - 0 1

@snicolet
Copy link
Member

snicolet commented Aug 6, 2023

hmm, I don't think this PR is necessary, so I'm inclined to close. Thanks anyway!

@ppigazzini
Copy link
Contributor

I thank you for helping to find these two ways to improve the SF project:

  1. I already updated the wiki with the information about:
    • how to run the continuous integration of the personal fork of the Stockfish repo before opening a PR
    • how to analyze the logs of the continuous integration in case of failure
  2. we are thinking to add a "contributing" file with all the information needed by a new contributor, the hard lesson is that people never read the wiki

About the FEN regex PR I have this point of view (please I'm not a SF dev so I could miss some details):

  1. Stockfish maintainers always stated that the caller has the responsibility of the FEN validity: Therefore Stockfish is written with the expectation that the input fen is correct. in https://github.com/official-stockfish/Stockfish/wiki/Stockfish-FAQ#stockfish-crashed
    To be honest, as a SF admin, I will close any PR and Issue about the FEN validity simply reminding this clear principle
  2. the Stockfish code, for practical/historical reasons (books with invalid FENs), accepts a FEN missing the last 2 mandatory fields

    Stockfish/src/position.cpp

    Lines 275 to 280 in 5c2111c

    // 5-6. Halfmove clock and fullmove number
    ss >> std::skipws >> st->rule50 >> gamePly;
    // Convert from fullmove starting from 1 to gamePly starting from 0,
    // handle also common incorrect FEN with fullmove = 0.
    gamePly = std::max(2 * (gamePly - 1), 0) + (sideToMove == BLACK);

    With that responsibility principle in place, I will drop the correction code forcing the books to have FENs and not random strings
  3. these two strings in benchmarks.cpp have invalid FENs, the only reason that I'm able to find to no fix them is to have a test of the (IMO unnecessary) FEN correction code:
  "8/8/8/8/8/6k1/6p1/6K1 w - -",
  "7k/7P/6K1/8/3B4/8/8/8 b - -",
  1. const vector<string> Default are not FENs but Stockfish command lines snippets, so the variable naming in benchmarks.cpp is confusing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants