FEN: 8/8/8/1p6/8/2K5/8/8 w - - 0 11

The problem seems to be that the engine doesn't completely load to evaluate the checkmate?

Same issue (engine does not load) on the analysis board. Maybe there is an issue with processing the mate in 0 score? On the command line Stockfish works fine for this position.
setoption name UCI_Variant value giveaway
position fen 8/8/8/1p6/8/2K5/8/8 w - - 0 11 moves c3c4
go depth 10
info string variant giveaway startpos rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
info depth 1 seldepth 2 multipv 1 score mate 0 nodes 1 nps 333 tbhits 0 time 3 pv b5c4
info depth 2 seldepth 2 multipv 1 score mate 0 nodes 2 nps 666 tbhits 0 time 3 pv b5c4
info depth 3 seldepth 2 multipv 1 score mate 0 nodes 3 nps 1000 tbhits 0 time 3 pv b5c4
info depth 4 seldepth 2 multipv 1 score mate 0 nodes 4 nps 1333 tbhits 0 time 3 pv b5c4
info depth 5 seldepth 2 multipv 1 score mate 0 nodes 5 nps 1666 tbhits 0 time 3 pv b5c4
info depth 6 seldepth 2 multipv 1 score mate 0 nodes 6 nps 2000 tbhits 0 time 3 pv b5c4
info depth 7 seldepth 2 multipv 1 score mate 0 nodes 7 nps 2333 tbhits 0 time 3 pv b5c4
info depth 8 seldepth 2 multipv 1 score mate 0 nodes 8 nps 2666 tbhits 0 time 3 pv b5c4
info depth 9 seldepth 2 multipv 1 score mate 0 nodes 9 nps 3000 tbhits 0 time 3 pv b5c4
info depth 10 seldepth 2 multipv 1 score mate 0 nodes 10 nps 3333 tbhits 0 time 3 pv b5c4
bestmove b5c4
Probably fixed via #4307.
@ianfab @ddugovic Btw, how come that the evaluation is mate 0 even though one more ply has to be played?
@niklasf @ianfab Looks like a bug I'd expect mate 1 unless the game has already ended (is already checkmate or equivalent).
Yup, mate 0 looks like a bug (evidenced by adding to Position::variant_result() an assert gamePly - ply == 20; the half-move count minus the ply should equal the root ply, I think).
$ cat test.fen
8/8/8/1p6/8/2K5/8/8 w - - 0 11
8/8/8/1p6/8/2K5/8/8 w - - 0 11 moves c3c4
$ ./stockfish bench giveaway 16 1 6 test.fen
EDIT: this is confusing. Now I'm thinking the bug is in uci.cpp because antichess has the unusual distinction that the lost player must play a losing move or resign:
ss << "mate " << (v > 0 ? VALUE_MATE - v + 1 : -VALUE_MATE - v) / 2;
So I wonder if mate 0 is actually correct since even without playing the move, the lost player is lost?
I think the issue is in the upstream code. The proper way of calculating the mate distance should be https://github.com/ianfab/Stockfish/commit/8260ebc77d726763a40c040cb986654f82ed44a8#diff-9e544a2ba018bea83f86711c6b8f1871R324. However, since in chess you can not lose directly after making a move, they do not have to care about odd ply counts in official stockfish. I only tested a few positions so far, but the fix looks good to me:
setoption name UCI_Variant value giveaway
info string variant giveaway startpos rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
position fen 8/8/1p6/8/8/2K5/8/8 b - - 0 10
go depth 2
info depth 1 seldepth 1 multipv 1 score mate -2 nodes 2 nps 666 tbhits 0 time 3 pv b6b5
info depth 2 seldepth 2 multipv 1 score mate -2 nodes 11 nps 3666 tbhits 0 time 3 pv b6b5 c3c4
info depth 3 seldepth 4 multipv 1 score mate -2 nodes 21 nps 7000 tbhits 0 time 3 pv b6b5 c3c4 b5c4
bestmove b6b5 ponder c3c4
position fen 8/8/8/1p6/8/2K5/8/8 w - - 0 11
go depth 2
info depth 1 seldepth 1 multipv 1 score cp 245 nodes 8 nps 4000 tbhits 0 time 2 pv c3d4
info depth 2 seldepth 3 multipv 1 score mate 1 nodes 24 nps 12000 tbhits 0 time 2 pv c3c4 b5c4
bestmove c3c4 ponder b5c4
position fen 8/8/8/1p6/8/2K5/8/8 w - - 0 11 moves c3c4
go depth 2
info depth 1 seldepth 2 multipv 1 score mate -1 nodes 1 nps 333 tbhits 0 time 3 pv b5c4
info depth 2 seldepth 2 multipv 1 score mate -1 nodes 2 nps 666 tbhits 0 time 3 pv b5c4
bestmove b5c4
position fen 8/8/8/1p6/8/2K5/8/8 w - - 0 11 moves c3c4 b5c4
go depth 2
info depth 0 score mate 0
bestmove (none)
setoption name UCI_Variant value chess
info string variant chess startpos rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
position startpos moves f2f3 e7e5 h2h3 d8h4
go depth 2
info depth 1 seldepth 1 multipv 1 score mate -1 nodes 2 nps 1000 tbhits 0 time 2 pv g2g3 h4g3
info depth 2 seldepth 3 multipv 1 score mate -1 nodes 4 nps 2000 tbhits 0 time 2 pv g2g3 h4g3
bestmove g2g3 ponder h4g3
Ah, that makes sense. Surely this antichess rule is strange but popularly accepted (that a player may move although his only legal moves immediately lose).
In shogi, a player can lose by illegal move, but faces a similar dilemma (that if there are no legal moves, they are expected to resign instead of playing a move, as they are already checkmated; but they could also play an illegal move).
The same can actually also occur in other variants such as racing kings, losers and extinction chess. An example for racing kings underlines that the issue is not specific to giveaway chess:
setoption name multipv value 2
setoption name UCI_Variant value racingkings
position fen 1nb4K/1k6/8/8/8/8/8/8 b - - 0 1
go depth 1
master
info depth 1 seldepth 1 multipv 1 score cp 0 nodes 27 nps 9000 tbhits 0 time 3 pv b7a8
info depth 1 seldepth 1 multipv 2 score mate 0 nodes 27 nps 9000 tbhits 0 time 3 pv b8a6
bestmove b7a8
fix
info depth 1 seldepth 1 multipv 1 score cp 0 nodes 27 nps 9000 tbhits 0 time 3 pv b7a8
info depth 1 seldepth 1 multipv 2 score mate -1 nodes 27 nps 9000 tbhits 0 time 3 pv b8a6
bestmove b7a8
I opened https://github.com/ddugovic/Stockfish/pull/527 to fix this.
Thanks. Fishnet, stockfish.js, stockfish.wasm and stockfish.pexe have this now, so it will be fixed on lichess.org with the next asset deploy.
Most helpful comment
The same can actually also occur in other variants such as racing kings, losers and extinction chess. An example for racing kings underlines that the issue is not specific to giveaway chess:
master
fix
I opened https://github.com/ddugovic/Stockfish/pull/527 to fix this.