chessuci

Basic questions on UCI engine: ucinewgame and multiple clients


I'm reading the specifications of UCI protocol but unfortunately I can't find a decent explanation of some of its commands or use-cases.

1) I don't understand what ucinewgame is meant for. By the documentation, it "starts a new game" but what exactly does it mean if UCI engine is stateless and therefore it shouldn't matter if there was new game or not?

2) What is better for playing with client, send to engine "position startpos moves ..." every time adding one more move (i.e. keeping record of all moves from the start) or "position <fenstring>" which only reflects the current position? I understand the second case is way more compact but are there any benefits from keeping all the previous moves?

3) If I want to have several players that simultaneously play against the engine (each their own game), do I need to have an instance of engine for each of them? I understand that while the engine is busy with one player, it cannot process moves for another player, but other than that, I see no problem here, do I just need to send position from one chosen player when the engine is ready, and temporarily block the other players? Then again, does ucinewgame have something to do here?


Solution

  • OK, by the source code the ucinewgame seems to do just one thing - it clears the training data.