Moderator: Andres Valverde
Sven Schüle wrote:It may be a good idea to read that thread first before voting, although it is not recommended.
H.G.Muller wrote:Well, arguments would do better than votes in having any impact. Most importantly, it would be very inteersting to know why people prefer to have two different commands meaning exactly the same thing:
level 40 5 0
and
mlevel 40 5 0
(say).
If they could not explain that in a convincing way, a large vote in favor of this would only convince me that they are on average so misguided that it is not worth paying attention to them at all. People voting that the Earth is flat in general meet with contempt, nowadays, and the more massively they vote for it, the more contempt they generally reap as a group...
If they could not explain that in a convincing way, a large vote in favor of this would only convince me that they are on average so misguided that it is not worth paying attention to them at all.
Zach Wegner wrote: I have zero interest in multi-session time controls, and will probably not implement this part of the protocol
H.G.Muller wrote:Well, arguments would do better than votes in having any impact. Most importantly, it would be very inteersting to know why people prefer to have two different commands meaning exactly the same thing:
level 40 5 0
and
mlevel 40 5 0
(say).
If they could not explain that in a convincing way, a large vote in favor of this would only convince me that they are on average so misguided that it is not worth paying attention to them at all. People voting that the Earth is flat in general meet with contempt, nowadays, and the more massively they vote for it, the more contempt they generally reap as a group...
H.G.Muller wrote:Let me rephrase the question then:
Why would you define two commands that mean the same, and then arbitrarily use only one of them, by adding an extra superfluous rule on top of an extra superfluous definition?
Apparently you do not only want to have two commands that the engine would understand the same, you also want to bother the GUI with figuring out which of the two to send when.
This gets pretty close to an "over-my-dead-body" kind of thing...
This approach complicates the issue more than it needs to be. Having a space at the end of the line puts the engine in a "special mode" where it needs to expect more lines. Also it makes it harder to read by a human for debugging (is there a whitespace there?). If you propose arbitrary inputs for each line, parsing the input becomes more complicated. Also I bet many engines (using sscanf, although there are probably many that use tokens instead) are setup in a way where they first get a line, then scan the line for a command, then match the command with an operation with if elseif elseif comparisons and then parse a pre-determined number of arguments of the command and do whatever other operations necessary. I indeed do this for every command received by the engine from the GUI in the original Winboard Protocol with the exception of some hacks to get it to read possible variable arguments from the level command (seconds may be specified or not, and even here a command is present at the beginning of the line). Summary of some reasons why having level with multiple mlevels is better than a single level command:H.G.Muller wrote:I have my doubts on Pradu's proposal: if you can handle an arbitrary number of lines, using 'mlevel' as a continuation symbol, surely it would not be so much more difficult to use a space at the end of the line as a character indicating that the line continues in stead?
To give an example so that you can see the point... lets say you had a TC 40 moves in 40 minutes first then a second TC with 10 minutes for all moves. I'm sure you could use information about the second TC to formulate a better time-management during the first TC. In this example you could assume a "compiled TC" such that the TC game in 50 minutes with the constraint that 40 moves must be played in the first TC and modify your time management appropriately. If your 50 minute time management satisfies the 40-move constraint, you may simply use your 50-minute time management. If it doesn't satisfy the 40-move constraint then use a time control suitable for staying within the constraint.I think a very good defence against users specifying a ridiculous number of sessions, is to have the engine simply ignore the later ones. If you have parameters for 100 sessions, how would you use them anyway to determine how long you would think on your first move? What will happen after 50 moves will hardly be relevant, then.
So you just gave an example yourself of when knowing subsequent TCs will be useful... Regardless, I think it is a bad idea to build an avoidable limitation into the protocol, such as not being able except what all the new time controls will be. The engine programmer should decide how he will use all of his available information.This is why I think that re-sending the level commands with shifted arguments is much easier for the engines. They would not have to worry about remembering an arbitrary long list of session parameters, they would all be re-sent in due time when they become relevant. The only sensible way I can think of to use the parameters for future sessions is to check if there will be a ridiculous speed up in the next session (it is usually best to allocate your time such that there is a moderate speed-up during the game anyway), and if there is (say 40/40+20/1) consider the current+next session like they were one (so play o a schedule for 60/41 until move 40).
Miguel A. Ballicora wrote:As I already said, they mean the same according to your interpretation.
if(strcmp(inbuf, "level ") == 0) {
char *p = inbuf + 7; // position after the word "level "
int n, mps, min, inc, sec;
while(sscanf(p, "%d %d:%d %d", &mps, &min, &sec, &inc) == 4 ||
(sec = 0) || sscanf(p, "%d %d %d", &mps, &min, &sec, &inc) == 3) {
for(n=0; n<3; n++) while(*p && *++p != ' ');
tc = 60*min + sec;
// process next (mps, tc, inc) triplet.
}
}
H.G.Muller wrote:Pradu, I really think this is a bit of a non-issue. The code to parse a multisession level command on a single line that was already read into a buffer is:
- Code: Select all
if(strcmp(inbuf, "level ") == 0) {
char *p = inbuf + 7; // position after the word "level "
int n, mps, min, inc, sec;
while(sscanf(p, "%d %d:%d %d", &mps, &min, &sec, &inc) == 4 ||
(sec = 0) || sscanf(p, "%d %d %d", &mps, &min, &sec, &inc) == 3) {
for(n=0; n<3; n++) while(*p && *++p != ' ');
tc = 60*min + sec;
// process next (mps, tc, inc) triplet.
}
}
I seriously doubt if that could be simplified by use of 'continuation' mlevel commands. On the contrary, any code that could handle that scheme is likely to be two times as long.
if(!strcmp(command,"level"))
{
resetLevel();
addLevel(line+6);
}
else if(!strcmp(command,"mlevel")) addLevel(line+7);
if(strcmp(inbuf, "level ") == 0) {
char *p = inbuf + 6; // position after the word "level "
resetLeveL(...)
addLevel(...)
while(some condition and new mode of operation to handle newlines)
{
with some hack to skip three numbers
addLevel(...)
}
// What if you receive another command while in the new mode of operation? Make a goto jump to the command parsing loop?
}
It should as people read raw log files often and things may go wrong. Even though it may not carry much weight, it is a problem that can clearly be avoided using level and mlevel and I see no reason why not to avoid it.Human readibility does not carry much weight here, and more so for the GUI developer than for the engine author or tester: you know what TC you entered, and the only thing you would have to read is how the engine understood it, for which purpose you can have the engine print it in any format you like. Note furthermore that the readability is not as bad as it seems, as the INC parameters of all sessions but the last must always be zero. These redundant zeros function as punctuation.
You should be as an interface designer. A lot of effort will be replicated by many people when implementing the protocol. Also taking into account that engines far exceed the number of GUIs, the protocol must be made to make engine programming the simplest.Look, I am not crazy about this format
There are really good reasons to abandon it. Creating a design that avoids problems when it is possible to do so is a really good reason. TC tag is not one of the required standard tags in a PGN so we don't need to consider the implications on how to store games like this yet (a possible option for large TC games, add multiple PGN TC tags -- although this differs from the framework described in the PGN standard-- for not as many TCs use PGN method). We are not discussing an existing design for PGN tags but a new framework for the Winboard Protocol. The protocol should work regardless of game storage format for a particular GUI. GUIs who can only give a limited number of TCs can enforce this rule by only allowing the user to specify a certain number of TCs.If it were upto me I would prefer something like the Crafty 'time' command, which would use 40/40+25/15 to indicate multi-session, like it would appear in the PGN tags. Especially the redundant INC parameters make it a really ugly command. But it was defined before, and people did implement it this way. So I think there should be really good reasons to abandon it.
Return to Winboard and related Topics
Users browsing this forum: Google [Bot] and 34 guests