Thursday 5 November 2020

A Nasty Problem

I hit a nasty problem when an engine recaptured with the king. Here is a simple example:

1. e4 e5 2. Bc4 Bc5 3. Bxf7+ Kxf7

This created a baffling problem when I had set a long time limit to avoid being timed out. The Novag Citrine would not accept moves and showed a strange rotating display on its LCD. I had a suspicion that the Citrine might be calculating a move. In order to diagnose the problem, I set a shorter time limit. I entered the initial moves for both sides manually on the Citrine board in "referee mode". These moves were acknowledged by the Novag Citrine.

Novag> M   1   e2-e4
Novag> M   1,  e7-e5
Novag> M   2   f1-c4
Novag> M   2,  f8-c5
Novag> M   3   c4xf7


I selected the Stockfish engine, and pressed Start Engine. Stockfish's move was automatically sent to the Novag and acknowledged by Novag (captures have be sent twice with a delay in between).

Novag> M   3,  e8xf7
Novag> M   3,  e8xf7


Making the move on the board involved lifting the black king. Novag took that as an instruction to use its internal engine to make a move for white. (That does not usually happen for engine king moves.) The Citrine flashed this move on the board and sent the move to the Citrine Interface.

Novag> M   4   d1-h5

Stockfish replied before I had a chance to make Novag's reply on the board. Stockfish's move was acknowledged by Novag.

Novag> M   4,  f7-f8

Both moves showed on the Citrine Interface board, which is driven by the Novag acknowledgements. I used the command button to send the "p" command to get Novag's view of the board position:

Novag> Position Board
Novag> .  aa bb cc dd ee ff gg hh
Novag> .8 br bn bb bq    bk bn br 8
Novag> .7 bp bp bp bp ::    bp bp 7
Novag> .6    ::    ::    ::    :: 6
Novag> .5 ::    bb    bp    :: WQ 5
Novag> .4    ::    :: WP ::    :: 4
Novag> .3 ::    ::    ::    ::    3
Novag> .2 WP WP WP WP    WP WP WP 2
Novag> .1 WR WN WB    WK    WN WR 1+
Novag> .  aa bb cc dd ee ff gg hh


That matched the position on the Citrine Interface's board. I turned off the Stockfish engine, and was able to take back the last two moves.

Novag> T   4,  f7-f8
Novag> T   4   d1-h5


Novag then signalled that the time limit had been exceeded, but I was able to continue making moves for both sides. (I could have turned Stockfish back on again to make it move and respond to subsequent moves.)

Novag> M   4   g1-f3
Novag> M   4,  b8-c6


This is a tricky one. I have set the time limit to "ea1", the lowest novice level. That ensures ensures that the Citrine's spurious move happens almost instantly, and it turns off the internal clock. The response is also not likely to be much good, so it does not give much away. There does not appear to be anything that can be done to stop the Citrine's spurious move. If I could be sure that this problem occurred if and only if the Stockfish move was a king capture, I could suppress the spurious Stockfish move. The workaround is to turn off the engine, take back the two spurious moves, make your reply and turn Stockfish back on again. The same applies to any other engine, of course - except for the Citrine engine, where this problem does not occur. Here is the latest Python code.

No comments:

Post a Comment