"Waiting for other games(s)"

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

"Waiting for other games(s)"

Postby Betsemes » 28 Mar 2012, 12:39

While running my tourney, it stopped and now it's displaying the "Waiting for other games(s)" message. I had two winboard windows running concurrently the same tourney. Both of them displayed the same message when I closed them yesterday. Today, I run one of them and it's still displaying the same message and doing nothing. What's happening? What should I do? I suppose the tourney has not finished yet; there were much more games to play. The contents of my tourney file follows:

-participants {Fruit 2.1
Fairy-Max 4.8
Ace 0.1
Alaric 707
Bright 0.4a
Chronos 199
Crafty 20.14
Cyclone 3.4
Deuterium v11.01.28.159
Fruit 2.3
Glaurung 2.2
GNUchess 5.07
Grapefruit 1.0 beta
Gull 1.2
Houdini 1.5a x64
Jabba 1.0
Komodo 3
Naum 2.0
N.E.G. 0.3d
Phalanx-Scid
Pos 1.20
Ram 2.0
Rybka v2.2n2.mp
Rybka 2.3.2a
Scidlet
Scorpio 2.7
Spike 1.2
Spike 1.4
Stockfish 2.2.2 x64 ja intel
Toga II 1.2.1
Toga II 1.4.1SE
WildCat 8
Zappa 1.1}
-seedBase 150755452
-tourneyType 0
-tourneyCycles 2
-defaultMatchGames 10
-syncAfterRound true
-syncAfterCycle true
-saveGameFile "C:\Users\Efrain\Documents\Res\Projects\Chess\XBoard\WinBoard\Tourney_Result.pgn"
-loadGameFile ""
-loadGameIndex 0
-loadPositionFile ""
-loadPositionIndex 1
-rewindIndex 0
-discourageOwnBooks false
-mps 40
-tc 5
-inc -1.00
-results "---+-+-++++---+-+----+-=-+-++++-+++++-++-+-+-+-+-++--+-+-+-++-+-+-+-+-=-+-++--+++-+-+++++--++*-+++-+-+-+-+-+-+++++-+-+--+-+--=+-+-+-+-+++-+--+-+-+-+-+----++++--* "


Thank you very much. I'm waiting for your advice....

Efrain Caro
Betsemes
 
Posts: 15
Joined: 22 Mar 2012, 18:54

Re: "Waiting for other games(s)"

Postby H.G.Muller » 29 Mar 2012, 08:47

The cullprit is the * somewhere in the middle of the -result string. This tells WinBoard that game is still being played, and with -syncAfterRound and -syncAfterCycle both true it will wait for that game to finish. But apparently no other instance is playing it. Replacing it by a space should make the probem go away: the next WinBoard instance you will start will then pick that game, and finally deliver a result, after which the others will be able to pick new games as well without violating the sync conditions.

The question of course is why that * is still there. It must have been written when a WinBoard instance started to play it, but it should have been removed when the game finished one way or the other: either by the gae result +-= when the game finished normally, or by a space when it was aborted (e.g. by closing WinBoard).

Did you suffer some crash during the tourney? How does that game appear in the PGN? Are there any games there that have * as a result? Or was this game not saved at all? (It is a bit hard to figure out which game this is, from such a large string. But if you replace the * by a space, and start playing again, you will see which game WinBoard starts playing. And then you can look for an earlier game between the same players.)

It is a bit suspect there is also a * near the end of the string. Did you take this 'snapshot' of the tourney file when there was a WinBoard running, that could have reserved the game? If there is, it should replace it by a space as soon as you close that, and there would be no problem. But if not, you would get the same problem in the next round again. Perhaps there still are some situations where closing a WinBoad instance that is playing (or has reserved) a game will fail to make it seset the * to a space. (A sudden power interruption would unavoidably have that effect.)
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "Waiting for other games(s)"

Postby Betsemes » 29 Mar 2012, 13:25

H.G.Muller wrote:The cullprit is the * somewhere in the middle of the -result string. This tells WinBoard that game is still being played, and with -syncAfterRound and -syncAfterCycle both true it will wait for that game to finish. But apparently no other instance is playing it. Replacing it by a space should make the probem go away: the next WinBoard instance you will start will then pick that game, and finally deliver a result, after which the others will be able to pick new games as well without violating the sync conditions.

The question of course is why that * is still there. It must have been written when a WinBoard instance started to play it, but it should have been removed when the game finished one way or the other: either by the gae result +-= when the game finished normally, or by a space when it was aborted (e.g. by closing WinBoard).

Did you suffer some crash during the tourney? How does that game appear in the PGN? Are there any games there that have * as a result?

Okay, given that information about how to interpret that results string and by looking up the tourney_results.pgn file, I don't find any unfinished game within it. If I open MS Word, copy/paste the results string into Word, highlight the string until the "*" and do a word count, word says there are 94 characters within that portion of the string. If I look up the 94th game, it says black won on time; Crafty 20.14 was playing black while Scorpio 2.7 was playing white. I clearly remember that Crafty crashed once during a game when two instances of Winboard were running. Actually, Crafty is the only one that has given me that kind of problem. Apparently, it does not behave very well when the system is busy with other tasks. At that particular time, I closed the offending winboard instance and run it again; but Crafty kept crashing on the second window, this time not running games at all (Crafty still was running on the other window). So I settled for keeping one winboard window open while Crafty was running. When Crafty finished its games, I reopened the second winboard window without problems.

The funny thing is that no game seems to have finished strangely, all of them show a game result.

There is something funny here, if I assume one character on that results string represents one game played, then something doesn't add up. If I open Tourney_Results.pgn on Winboard, it says there are 149 games on it (Scid confirms this games count), but if I do a word count on the results string, it says there are 161 characters without counting the ending space (a space actually ends the string after that ending asterisk) and I confirmed it by counting them myself. It seems that there are 12 games that were not stored. If we discount the asterisks, that makes 10 lost games. Where are them? Are there any known bugs on the way the games are stored? Is it possible that some games were not stored while their results were recorded on the tourney file results string? What if both instances of Winboard attempt to access the pgn file at the same time? What would happen?

Or was this game not saved at all?

It is resonable to think that the offending game was not saved at all, along with others.

(It is a bit hard to figure out which game this is, from such a large string. But if you replace the * by a space, and start playing again, you will see which game WinBoard starts playing. And then you can look for an earlier game between the same players.)

Thank you, I may try it. But the difference between the game count on the pgn file and the character count on the string makes me doubt whether they all are being saved. So I may not run it again until having more information on the winboard workings.

It is a bit suspect there is also a * near the end of the string. Did you take this 'snapshot' of the tourney file when there was a WinBoard running, that could have reserved the game?

Maybe, I don't remember clearly, but if I did, the "Waiting for other games(s)" message was already being displayed.

If there is, it should replace it by a space as soon as you close that, and there would be no problem. But if not, you would get the same problem in the next round again. Perhaps there still are some situations where closing a WinBoad instance that is playing (or has reserved) a game will fail to make it seset the * to a space. (A sudden power interruption would unavoidably have that effect.)

No power interruption is possible in my case since I'm running it on a laptop; any power interruption is always met with battery power. Anyway, I opened the tourney file again now, and that finishing asterisc is still there. Well, it's not a "finishing asterisk" because the string is actually finished by a space. The copy/pasted 'snapshot' within my OP shows this ending space too.

EDIT:{I have an idea of what may have happened here. The ending two characters are "* ", an asterisk and a space. The last time the tourney run, both windows were displaying the "Waiting for other games(s)" message. So I find reasonable to think that by that time, two asterisks were at the ending of that string, one for one of the winboard instances, and the other one for the other. Now when I closed the first one, It replaced the last asterisk with a space, and when I closed the other one, it replaced the last character within the string with a space too without checking whether or not it was an asterisk or a space. That would have wrongly left the penultimate asterisk there since both instances only cared for the last character within the string. Just an idea, you know better than me how your program works.}

Thank you.
Efrain Caro

P.S. Sorry for using a nickname instead of my real name when registering. I read the rules after registering and I have no way to change it now. There are many forums out there where people always use nicknames. Maybe an administrator can fix it.
Betsemes
 
Posts: 15
Joined: 22 Mar 2012, 18:54

Re: "Waiting for other games(s)"

Postby Betsemes » 29 Mar 2012, 15:57

(It is a bit hard to figure out which game this is, from such a large string. But if you replace the * by a space, and start playing again, you will see which game WinBoard starts playing. And then you can look for an earlier game between the same players.)

Thank you, I may try it. But the difference between the game count on the pgn file and the character count on the string makes me doubt whether they all are being saved. So I may not run it again until having more information on the winboard workings.

I tried it anyway. Crafty 20.14 is playing white and Scorpio 2.7 is playing black. It's the 94th game as stated above, but the 94th game within the pgn file was the reverse; Crafty was playing black while Scorpio was playing white, so it's not the same game.

Thank you.
Efrain Caro
Betsemes
 
Posts: 15
Joined: 22 Mar 2012, 18:54

Re: "Waiting for other games(s)"

Postby H.G.Muller » 29 Mar 2012, 16:20

Betsemes wrote:Okay, given that information about how to interpret that results string and by looking up the tourney_results.pgn file, I don't find any unfinished game within it. If I open MS Word, copy/paste the results string into Word, highlight the string until the "*" and do a word count, word says there are 94 characters within that portion of the string. If I look up the 94th game, it says black won on time; Crafty 20.14 was playing black while Scorpio 2.7 was playing white. I clearly remember that Crafty crashed once during a game when two instances of Winboard were running. Actually, Crafty is the only one that has given me that kind of problem. Apparently, it does not behave very well when the system is busy with other tasks. At that particular time, I closed the offending winboard instance and run it again; but Crafty kept crashing on the second window, this time not running games at all (Crafty still was running on the other window). So I settled for keeping one winboard window open while Crafty was running. When Crafty finished its games, I reopened the second winboard window without problems.

The funny thing is that no game seems to have finished strangely, all of them show a game result.

There is something funny here, if I assume one character on that results string represents one game played, then something doesn't add up. If I open Tourney_Results.pgn on Winboard, it says there are 149 games on it (Scid confirms this games count), but if I do a word count on the results string, it says there are 161 characters without counting the ending space (a space actually ends the string after that ending asterisk) and I confirmed it by counting them myself. It seems that there are 12 games that were not stored. If we discount the asterisks, that makes 10 lost games. Where are them? Are there any known bugs on the way the games are stored? Is it possible that some games were not stored while their results were recorded on the tourney file results string? What if both instances of WinBoard attempt to access the pgn file at the same time? What would happen?

It should be protected against that. Even if the protection fails, the effect should be that the games get merged. If I understand correctly how writing of files in 'append' mode works, it should never be possible to lose data. But I included code to lock the first 100 bytes of the file for exclusive access before a program starts writing, and only unlock after the write completes. Attempting such a lock when another process has already locked it should simply block the program that attempts the new lock, until the other one releases the lock.

But even without all this, the chances of two programs attempting to write at the same time should be really small. Writing the file will take milliseconds, while games take seconds or minutes. So I don't think this can be the problem. The only case I know where WinBoard would not save a game is if the game has no moves (i.e. white forfeits on time). This is intentional.

It could be very illuminating (but alas a bit difficult) to figure out which games are missing. Unless you happened to have the -pgnNumberTag option switched on; in that case all games should have a [Number "N"] tag with a unique sequence number N corresponding to their position in the string. There could be another way, though: I see you played a round-robin of 33 players, with 10 games per pairing and 2 cycles. Each round then has 16 pairings, with 160 games. So the tourney blocked after the first round, meaning all participants should have 10 games. So if you run some cross-table generator on the PGN file, it will be easy to see which are the engines that have missing games. You can then look for the games of those players in the PGN (they should have been played consecutively), and see if they correspond to the sting, and which are missing.

Maybe, I don't remember clearly, but if I did, the "Waiting for other games(s)" message was already being displayed.

In an early version I had a bug there, but I am pretty sure I fixed that (and tested if the fix worked). Indeed quitting WinBoard when it was waiting then forgot to clear the asterisk. This is easy to test, though, in a two-player tournament with 1 game per pairing and many cycles, so I will test it again, just to make sure.

Anyway, I opened the tourney file again now, and that finishing asterisc is still there. Well, it's not a "finishing asterisk" because the string is actually finished by a space. The copy/pasted 'snapshot' within my OP shows this ending space too.
Well, the space at the end is normal: at some time you had two WinBoard instances playing on the tourney, and they would both reserve a next game (so the string would end with **), but they would both discover that the first available game was for round 2, while there was still a result missing from round 1. So they would start to wait for that. But then, when you quit them, they would replace the asterisk for the game they reserved by a space, so the string would end in two spaces. When you again start a WinBoard, it grabs the first of the two spaces as the game to reserve, but again it sees that it is of round 2, and round 1 is not yet finished. But it will already put the * there, to indicate it is reserved, preventing another WinBoard instance to reserve that game too.

EDIT:{I have an idea of what may have happened here. The ending two characters are "* ", an asterisk and a space. The last time the tourney run, both windows were displaying the "Waiting for other games(s)" message. So I find reasonable to think that by that time, two asterisks were at the ending of that string, one for one of the winboard instances, and the other one for the other. Now when I closed the first one, It replaced the last asterisk with a space, and when I closed the other one, it replaced the last character within the string with a space too without checking whether or not it was an asterisk or a space. That would have wrongly left the penultimate asterisk there since both instances only cared for the last character within the string. Just an idea, you know better than me how your program works.}

No, it should not work that way. When replacing the * with space or a +-= result, they count from the beginning, not from the end. They know the sequence number of the game they picked (they need that to convert it to a pairing, to know which engines to load). When a game finishes, they lock the tourney file, read it, count the number of characters in the result string (including all spaces), calculate where the beginning of that string would be w.r.t. the end of the file, seeks there, makes really sure it is at the right place by reading and checking the leading quote (there is some fuzziness there, because line endings can be CR+LF or just LF), and from that place on writes out the result string it read in its entirety (after it made the update of the game result with the reserved sequence number. Only then it unlocks the file,so other WB instances could use it to reserve the next game, or write a result.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "Waiting for other games(s)"

Postby H.G.Muller » 29 Mar 2012, 16:27

Betsemes wrote:Thank you, I may try it. But the difference between the game count on the pgn file and the character count on the string makes me doubt whether they all are being saved. So I may not run it again until having more information on the winboard workings.

I tried it anyway. Crafty 20.14 is playing white and Scorpio 2.7 is playing black. It's the 94th game as stated above, but the 94th game within the pgn file was the reverse; Crafty was playing black while Scorpio was playing white, so it's not the same game.
[/quote]

Well, when you are playing concurrently, there is no guarantee that the order of the games in the PGN corresponds exactly to that in the -results string. The playing agents reserve and start the games in order of their sequence number, but it is quite possible one game lasts so long that a game (or multiple games) that started after it did already finish, and thus was written in the PGN before it. So I guess it is really important to have Number tags in the PGN. Unfortunately I don't think I made that the default setting.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL


Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 7 guests