Closed drbeco closed 2 years ago
So, after reading some issues that may be related with this problem, I see that maybe an older version, not sure, lichess support for XBOARD protocol is lacking the option to resign
and offer draw
.
I'm still trying to figure out what is happening on this issue, but I would like an update if this is still the case.
Thanks!
Also I need to note that the current usage of Xboard protocol is not natural. It looks like someone is trying to speak russian with french accent, if that analogy makes any sense.
UCI protocol do set the position for each move. Yes, that is the way it is invented.
Xboard protocol does not, or should not, do that. setboard
is to be used to analise a position, not to play. Xboard issues a new
command and a sequence of moves
. Not even go
is strictly necessary during a normal game.
Basically: after a first go
to tell it to play (and the header mumbo-jumbo), just send a move
or draw
, get back another move or resign
or offer draw
. That is it. If one don't want to implement anything else, send a SIGINT
or SIGQUIT
to the engine after the game. It is really not that complicated.
By setting the board all over again and again, old engines using Xboard protocol loses the history of the game. I mean, of course you can tell an engine author to deal with it, but to be fair, the protocol should be precise.
I also noted that lichess-bot doesn't respect "time=0" and many other features. For example, what if the engine says "feature setboard=0" or "analyze=0"? The use of the "UCI Logic" under Xboard protocol should not be possible. Other important features: draw=1|0, ping=1|0, reuse=1|0
Refs:
Not sure if this is the same problem, but here a different error message:
# scanf: setboard 2k1R3/7p/1pPB4/5p2/5Pn1/3N3p/P6P/1K6 b - - 5 37
# xboard: setboard. Xadreco will set a board position.
# scanf: time 12000.0 otim 12000.0
# xadreco time: meu: 168.0s opo:168.0s, para 24 lances: ajustado para st 7.000000 s por lance
# scanf: go
# xboard: go. Xadreco is now black.
# xadreco : I really don't know what to play... resigning!
# resign
# 1-0 {Black resigns}
# scanf: result 1-0
ERROR:backoff:Giving up api_post(...) after 1 tries (requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://lichess.org/api/bot/game/dmSjdbdh/move/-1)
# scanf: quit
# xadreco : # Thanks for playing Xadreco.
# xadreco : exit with status ( 0 )
The position given as setboard
followed by a go
command is actually already mate.
The loop for Xboard is different of that for UCI engines. This position would come to the engine by a human playing (in this case move e7e8
) and the engine would return the result. By setting a position and asking "go", it misuses those commands. It makes no sense to Xboard protocol to set a mate position and say "go".
I have a fall back for error cases, and it tried to find a move and returned empty-handed (of course) and the it resigned as a default workaround (if you can't find a move in a given chess position, well, you better resign and go play checkers instead - kind of).
But, ok, nothing that I couldn't figure out. So, the engine is working under these strange circumstances of the Xboard protocol.
Still, the question is: what is that ERROR message above? About a bad request
?
If you guys want to address anything here, it is ok by me. Otherwise, we can just close this issue, because I guess I already solved the problem as stated above (workarounds...)
Thanks!
@drbeco you can read about this in https://github.com/careless25/lichess-bot/issues/125
Exact!! Thank you @gbtami
@drbeco This might be solved from the recent code changes. Can you test?
@drbeco This might be solved from the recent code changes. Can you test?
@careless25 I'll be able to test after the hollidays, on january, as I'm on a trip. Thanks for bringing it up!
The Xboard protocol, including offer draw
and resign
commands should be naturally handled with all the work done since this issue was opened. Please reopen if there are still problems.
Hi guys,
I'm getting this error:
I'm not sure what is this about. At first I thought that it has something to do with the command issued by the engine to lichess "
offer draw
".Xboard protocol says you can offer anytime, but it looks like lichess-bot implementation wants it just after the move. So I changed it, but I guess that didn't solve the problem yet.
Maybe I'm missing something. This bug can be anywhere. I know Xadreco plays without problem at FICS since 2007, so it is just a matter of the Xboard protocol interpretation.
Thanks any guidance.