Not sure what you mean. "Force mode" does not include any color assignment. It is just one of the engine modes. In fact it is the mode that excludes color assignment...sje wrote:Force mode should not include color assignment nor rely upon an implied color assignment.
That depends on how the program is written. For one, CECP engines are not supposed to be aware of PGN tags. As for the Elo it could store ownRating and oppoRating rather than whiteRating and blackRating. Doing the latter is just asking for trouble.Every time a program gets its color re-assigned, implicitly or explicitly, it also has to adjust various secondary items. These include PGN tags for White, Black, WhiteElo, BlackElo, and maybe some others.
The protocol does not support that. It would have to be emulated by the GUI by sending a 'go' command after every move. Note that 'playing' means the program will eventually make moves as a result of the search process, and that you would not want this when analyzing games. In analyze mode it does think for both colors, but never makes a move for them. Instead it allows the GUI to feed it moves.Further there may be the case where the program is playing both colors for some interpretations of analysis.
Again I am not sure what you mean. There are no 'combinations' of force, analysis or normal play. You are always doing one or the other. One could view analysis mode as force mode with pondering on, but that would only be true if you always pondered on the opponent's position. And most programs ponder on a speculative opponnent move, while analysis should always use the current position. There are sub-states of PlayWhite and PlayBlack, namely Thinking and Pondering.It seems like there is some kind of super-mode enumeration type which combines the various combinations of force, analysis, edit, and normal play. Maybe a few other things as well. I think that this can be cleaned up, but that and other improvements can't be made if there isn't a willingness to drop support for prior protocol version directives; at least when a program requests such.
Perhaps you mean that Analyzing as searchState is superfluous, and could be combined with Idle to some Neither (Pondering nor Thinking) state. What commands should be processed during search is different in the 3 cases, however.
The edit command does define a new mode, but it should be considered deprecated. The replacement setboard is an atomic action.
I would not call turning the above pseudo-code into a real program even close to complex, so what is there to simplify? Note that you would probably only need half of what is written, because many commands are not given unless you explicitly enable them. Which you most likely would not, as many commands seem completely without interest, unless you are doing very advanced and specific things. Why would an engine be interested in the name of the opponent, the ICS, whether it plays a computer, the opponent time. And it might not implement NPS timing, SMP, EGTs, move exclusion...There is a real opportunity here to greatly simplify the task of interfacing a program to XBoard.
Perhaps, but what is the gain. Instead of distinguishing separate commands, the program would now have to distinguish separate state-variable names. "set mode force" is hardly an improvement over "force". The crux of the 'white'/'black' commands is that they are atomic: they allow you to change the side to move without triggering an engine search, by changing stm and side the engine played at the same time. And they are deprecated anyway; engines supporting setboard do not need them and would suppress them with colors=0, so they won't have to parse them either.A separate section of the documentation -- a rather short section -- could be made with a description of the state variables and the directive semantics. The number of directives could be drastically cut just by introducing a single set directive:Code: Select all
set <StateVariableName> <new-value>
Yes, that would be nice.Further ideas:
1) Combine move, draw offers, and draw claims in a single, atomic response.
This seems to go in the opposite direction as using a universal 'set' command that would be used for any variable...2) Combine all opponent information into a single directive.
That is an implementation issue. Unless you would declare it a protocol violation to send anything unneeded. Which might make life harder on the GUI designer for no good reason I can see.3) Avoid sending unneeded state variable updates.
Well, that is the type of interface I usually preferred for my programs as well. Instead of a 'go' command I then use an empty line, for minimal typing effort. (E.g. the stand-alone version of micro-Max has that.) This way the engine does not need any notion of which side it is playing for.4) When the interface wants a move from the program, indicate this with an explicit go directive (which also causes the program to play the move); use a separate search/hint directive when just an unplayed move is wanted. Thus, the need for force and analyze is dropped for a big gain in clarity -- just like setboard eliminates the need for edit and its sub-directives.
But have you thought of the ramifications this has for pondering? If it is black's turn to move, what should the engine do? Already start a search from the current position, in the hope that it will receive a 'go' command? Or speculate on a move for black, hoping that it will receive a 'usermove' command next that provides a ponder hit? For pondering it makes a real difference which side the engine is playing. So you would now need a separate command goponder.
I don't see much advantage in redesigning the protocol in such a drastic way. We might as well design an entirely new protocol from scratch (and be sure no one ever would use it...). Having a variable mode that holds White/Black/None/Analyze and making a move when mode==stm rather than when command=="make1move" does not seem a very relevant change, complexity-wise.
The program can already send queries with the tellics command, but it will not see the replies. This would of course be easy to implement: with a new feature chatter=1 the engine could instruct the GUI to forward all text it receives from the ICS to the engine as a new "chat" command. But you might as well connect the engine to the ICS directly in that case. Why would you still want to use an interface if you want to interact with the ICS that intimately?5) Allow a program to query an ICS to retrieve opponent information and perhaps other ICS data (seek ads, resume games, etc.).
I think zippy mode intentionally does the opposite to give an engine more time to initialize. Some engines need large startup time.6) Issue a new directive if and only if a new game is about to start.
The level command already specifies 3 parameters in a single command, and it could be made to take over the function of the st command by adopting the convention that negative increment values mean the increment is the corresponding absolute value, but limited to the time you actually used. In combination with a base time this would then specify a Bronstein TC, of which fixed maximum time per move is a special case. This would also be useful for specifying multi-session time controls (such as byoyomi) in an extended level command. But I don't really see what would be gained by always forcing the node rate and depth limit to be present in the same command that sets the times. Peoplemight not even want to implement playing by nodes.7) Replace sd, sd, nps, and level with a unified limit directive. Use decimal seconds for all time values, not a mixture of hours, minutes, and integer seconds.
How do you imagine that? Shouldn't there be a "setclock white T" and "setclock black T"? How is that simpler from time and otim? In the latter case you can process time and simply ignore otim, if you haven't any advanced time management that takes opponent time into account (as most engines won't).8) Replace otim and time with a single setclock directive, and use decimal seconds instead of centiseconds.
The accuracy limit caused by the use of integer centiseconds is a concern, and indeed introducing a feature decimal=1 that would relay all timing info in seconds with an optional decimal fraction could be used to lift it. It hardly makes life easier for the engine programmer, however, who would have to also handle the case where the interface would reject the feature, so that you are still stuck with the old method. Symbolic mate scores also require extra work for the engine programmer, to convert his internal numeric scores to the symbolic ones.9) Formalize analysis response formats; in particular use decimal seconds, decimal pawns, and symbolic scores for forced mate/loses.
This seems to hopelessly complicate things for the engine programmer, who now is suddenly required to implement every directive in existence, rather than just being able to cherry-pick those that seem relevant to his engine. Currently the use of directives for 'advanced' tasks that the engine is not likely to support are off by default.10) Have all of the above activated by a program sending something like:in response to the xboard directive. This would inform XBoard to send only directives in force at the given date -- and no directives which were superseded at that date.Code: Select all
feature version="2015.08.31"
(And note that feature commands are send in response to "protover 2", not in response to "xboard".)