chess: failed to decode long algebraic notation text \"(none)\" for position <nil>
This is because when a checkmate position is supplied to an engine, the go command returns the following output (> signifies an input line, < signifies output):
> position fen 1nb5/1p1pk1p1/5n2/1p2K3/4p3/2b5/5r2/r7 w - - 6 28
> go depth 20
< info string NNUE evaluation using nn-ae6a388e4a1a.nnue (132MiB, (22528, 3072, 15, 32, 1))
< info string NNUE evaluation using nn-baff1ede1f90.nnue (6MiB, (22528, 128, 15, 32, 1))
< info depth 0 score mate 0
< bestmove (none)
It looks like the code is trying to parse the (none) in the last line of the UCI output as a valid position.
I think a good fix for this would be to simply parse the output such that engine.SearchResults() returns the zero-value uci.SearchResults struct.
When running the following code where
pos
is a checkmate position:The error encountered is:
This is because when a checkmate position is supplied to an engine, the
go
command returns the following output (>
signifies an input line,<
signifies output):It looks like the code is trying to parse the
(none)
in the last line of the UCI output as a valid position.I think a good fix for this would be to simply parse the output such that
engine.SearchResults()
returns the zero-valueuci.SearchResults
struct.