H.G.Muller wrote:Sven Schüle wrote:It is the other way round. There is no such special handling of intra-game "level" commands, the handling is always the same: the first of three numbers determines the number of moves per session counted from the beginning of the game. WB engines subtract the number of moves already played from that number to get the number of moves left until next time control. So if they always count the number of moves from ply 0 then this means that they do *not* read the first argument of "level" as number of moves counted from the *current position*.
So basically you are saying that some engines might nor reset their move counter on receipt of a level command, but do it on a new command. (They must reset it somewhere...) Well, for such engines there is no fix unless WinBoard would explicitly count how many of the moves were forced into it, as the number of moves they will assume they have to do in the remaining time will depend on their own internal idea of the number of moves they have already done.
Nowhere is stated that after receiving "level", an engine shall reset some move counter. "level" informs an engine about the overall time control conditions of the game that is being played, and this is done once at the beginning of the game, everywhere on the world, even in human-human games (although not always with a "level" statement but it is similar). I would be glad if the WB protocol spec would contain a sentence that explicity states that "level" is sent only once in the beginning, unfortunately it does not. But that is still not enough justification for me to do something that has not been "forbidden" explicitly, if it obviously modifies the original intention of the WB spec.
I am pretty sure that this has always been the only intent of the WB protocol specifiers for "level". As an example, I also checked the source code of three native WB engines: Delfi, Crafty, Romichess to verify that they handle it as I expected.
But these are engines that work correctly. So it is not very relevant how they would react to a command that would only be sent to broken engines.
[...]
But I don't understand the logic behind your objections. They seem to be based on the hilosophy: "because it does not work always, we should not do it". This is contrary of my philosophy: "even if it works only once, it might be worth it". The cases for which it doesn't work can perhaps be fixed in another way.
I consider it a bad idea to create a new option "/chocolate" which tastes well for a few children whose names are explicitly listed somewhere but which, according to the package insert, has toxic effect for everyone else. It would be o.k. for me if using that new option would be neutral to all other engines that are working correctly w.r.t. the move counter problem.
The multi-session topic may be related to what we discuss here but at least your proposal to optionally send intra-game "level" commands to some engines is something different from the multi-session feature which is definitely desired to have, so I would prefer to leave it out of this discussion.
But we can't, as it is identically the same problem: You have to make the engine aware that it has to last on the current time on its clock for a different number of moves than it is currently thinking. Discuss one, and you are discussing the other. Anyway, for the engines you describe the /%sAccumulateTC would result in the desired effect: By sending the sum of all earlier sessions including the immediately following one would reset their internal MPS notion in such a way that they expect the next time quota at the move where it will indeed come.
I don't think that sending multiple level commands is the only way of implementing a multi-session time control feature. Another way would be to stay with the concept of specifying the whole time control once in the beginning, by using a special string format for "level", or even a new command, in case an engine reports to understand that new feature with an appropriate "feature xxx" message. So again, I don't see a close connection of this with the move counter problem.
I think we are at a point where someone out there with testing capacity (I'm afraid I don't have it) should find out roughly how many, and which, WB engines are really affected, so that we know better if we are talking about a huge crowd of "misbehaving" engines that have created some "de facto standard", or a small handful of poor sinners
Perhaps playing a sequence like the following could be a possible quick test in console mode (I hope to bypass any opening book with 1.a4 g5 ...):
new
level 2 1 0
force
easy
a2a4
g7g5
go
<wait for engine move, then enter a legal answer>
<wait again for next engine move>
Correct behaviour would be that the engine takes all (or most) of the available one minute for its second move (the first after the "book move" 1.a4) and then adds another minute for the next two moves.
Presence of a problem would be indicated if the engine thinks up to half a minute twice and only then adds another minute, i.e. it does not count 1.a4 as part of the game.
Sven