- make clean && make -j2 ARCH=x86-64 nnue=yes debug=yes build && ./stockfish bench > /dev/null 2>&1
# Check perft of large-board version
- - make clean && make -j2 ARCH=x86-64 largeboards=yes all=yes debug=yes build && ../tests/perft.sh largeboard
+ - make clean && make -j2 ARCH=x86-64 largeboards=yes all=yes debug=yes build
+ - ../tests/perft.sh largeboard
+ - ../tests/protocol.sh
- ./stockfish bench xiangqi > /dev/null 2>&1
- ./stockfish bench shogi > /dev/null 2>&1
- ./stockfish bench capablanca > /dev/null 2>&1
- make clean && make -j2 ARCH=x86-64-modern build
- ../tests/perft.sh
- ../tests/reprosearch.sh
- - ../tests/protocol.sh
#
# Valgrind
else if (token == "uci" || token == "usi" || token == "ucci" || token == "xboard")
{
Options["Protocol"].set_default(token);
- string defaultVariant = string( token == "usi" ? "shogi"
+ string defaultVariant = string(
+#ifdef LARGEBOARDS
+ token == "usi" ? "shogi"
: token == "ucci" ? "xiangqi"
+#else
+ token == "usi" ? "minishogi"
+ : token == "ucci" ? "minixiangqi"
+#endif
: "chess");
Options["UCI_Variant"].set_default(defaultVariant);
- if (token != "xboard")
+ if (token == "uci" || token == "usi" || token == "ucci")
sync_cout << "id name " << engine_info(true)
<< "\n" << Options
<< "\n" << token << "ok" << sync_endl;
else if (token == "compiler") sync_cout << compiler_info() << sync_endl;
else if (token == "load") { load(is); argc = 1; } // continue reading stdin
else if (token == "check") check(is);
+ // UCI-Cyclone omits the "position" keyword
+ else if (token == "fen" || token == "startpos")
+ {
+#ifdef LARGEBOARDS
+ if (Options["Protocol"] == "uci" && Options["UCI_Variant"] == "chess")
+ {
+ Options["Protocol"].set_default("ucicyclone");
+ Options["UCI_Variant"].set_default("xiangqi");
+ }
+#endif
+ is.seekg(0);
+ position(pos, is, states);
+ }
else
sync_cout << "Unknown command: " << cmd << sync_endl;
: std::string{ char('0' + (pos.max_file() - file_of(s) + 1) / 10),
char('0' + (pos.max_file() - file_of(s) + 1) % 10),
char('a' + pos.max_rank() - rank_of(s)) };
- else if ((Options["Protocol"] == "xboard" || Options["Protocol"] == "ucci") && pos.max_rank() == RANK_10)
+ else if (pos.max_rank() == RANK_10 && Options["Protocol"] != "uci")
return std::string{ char('a' + file_of(s)), char('0' + rank_of(s)) };
else
return rank_of(s) < RANK_10 ? std::string{ char('a' + file_of(s)), char('1' + (rank_of(s) % 10)) }
constexpr int MaxHashMB = Is64Bit ? 33554432 : 2048;
- o["Protocol"] << Option("uci", {"uci", "usi", "ucci", "xboard"});
+ o["Protocol"] << Option("uci", {"uci", "usi", "ucci", "ucicyclone", "xboard"});
o["Debug Log File"] << Option("", on_logger);
o["Contempt"] << Option(24, -100, 100);
o["Analysis Contempt"] << Option("Both", {"Both", "Off", "White", "Black"});
echo "protocol testing started"
cat << EOF > uci.exp
- set timeout 5
spawn ./stockfish
send "uci\\n"
expect "default chess"
expect "uciok"
- send "usi\\n"
- expect "default shogi"
- expect "usiok"
+ send "quit\\n"
+ expect eof
+EOF
+
+cat << EOF > ucci.exp
+ spawn ./stockfish
send "ucci\\n"
expect "option UCI_Variant"
expect "default xiangqi"
expect eof
EOF
+cat << EOF > usi.exp
+ spawn ./stockfish
+ send "usi\\n"
+ expect "default shogi"
+ expect "usiok"
+ send "quit\\n"
+ expect eof
+EOF
+
+cat << EOF > ucicyclone.exp
+ spawn ./stockfish
+ send "uci\\n"
+ expect "uciok"
+ send "startpos\\n"
+ send "d\\n"
+ expect "rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w - - 0 1"
+ send "quit\\n"
+ expect eof
+EOF
+
cat << EOF > xboard.exp
- set timeout 5
spawn ./stockfish
send "xboard\\n"
send "protover 2\\n"
expect eof
EOF
-for exp in uci.exp xboard.exp
+for exp in uci.exp ucci.exp usi.exp ucicyclone.exp xboard.exp
do
- expect $exp > /dev/null
+ echo "Testing $exp"
+ timeout 5 expect $exp > /dev/null
rm $exp
done