Well, then I think we might as well allow the commands in any mode. Because I can also see applications of exclude during a game, where the GUI could exclude moves that cause forbidden repetitions (i.e. perpetual chases) from the next search. So the engine should clear its list of excluded moves only when moving to another position (i.e. receiving usermove, undo, new, setboard).michiguel wrote:I think that the exclude/include commands should also be accepted both in force and analyze mode. I figure that many users will set a position, exclude/include, and then go to analyze.
Implementation of the feature is for a large part up to the engine. If the move it is now searching is excluded (which does seem a rather usual situation: engine gets a fail high on a non-PV move, starts a re-search with open window, user thinks "Oh no, not that!" and excludes it), the user would probably not be very happy if the engine spent another 15 minutes to finish the search of that move at a large depth. So the choice is between the simple implementation of aborting the search, restarting at d=1 (which you would also have to do whan the PV move gets excluded), or a "selective abort" which forces return from all levels but continues in the root.
I thought about the case where a user would exclude all moves, but I did not foresee a problem there. The engine would simply report a (stale)mate. That doesn't seem to need any special provisions; positions with zero moves could also occur without excluding any moves, and the engine should know how to handle those. Note this situation can only occur when the user excludes the current-best move from a situation where only a single move was left, which should start a new search at d=1.