Always the same opening

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

Always the same opening

Postby Gábor Szots » 10 Aug 2011, 17:31

Playing a tourney with the latest (Aug 9) WBTM, all games start with the same opening. Same if cycles are set to 32 and match games to 1 and if cycles are set to 1 and match games to 32.
I don't remember ever having this problem before. To check this, I replaced WB with the verion from Jun 4 but it did not start, probably because of the new commands of the latest WB.

P.S. Shall I post such problems here or would you prefer CCC forum?
Gábor Szőts

CCRL testing group
User avatar
Gábor Szots
 
Posts: 327
Joined: 26 Sep 2004, 21:26
Location: Szentendre, Hungary

Re: Always the same opening

Postby Olivier Deville » 10 Aug 2011, 18:50

Hi Gabor

As far as I am concerned, such posts are very welcome in this forum :)

Olivier
User avatar
Olivier Deville
 
Posts: 1176
Joined: 26 Sep 2004, 19:54
Location: Aurec, France

Re: Always the same opening

Postby H.G.Muller » 11 Aug 2011, 08:26

Can you post the tournament (.trn) file WinBoard made for this tourney?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Always the same opening

Postby Gábor Szots » 11 Aug 2011, 09:36

Later in the afternoon I'm going to post the file you requested.
Gábor Szőts

CCRL testing group
User avatar
Gábor Szots
 
Posts: 327
Joined: 26 Sep 2004, 21:26
Location: Szentendre, Hungary

Re: Always the same opening

Postby Gábor Szots » 11 Aug 2011, 15:14

This is my trn file:

-participants {Dorky 4.3 64-bit
Amy 0.8.7b
Cheng3 1.03 64-bit
Comet B.68
Der Bringer 1.9
Dragon 4.6
Djinn 0.925x
Francesca MAD 0.15
Gosu 0.16
GreKo 0.80
Leila 0.53h
Muse 0.899b
Nejmet 3.07
Pawny 0.2.1 64-bit
Quark 2.35
RomiChess P3k 64-bit
SpiderChess 070603
The Crazy Bishop 0052
Ufim 8.02
}
-tourneyType 1
-tourneyCycles 1
-defaultMatchGames 32
-syncAfterRound false
-syncAfterCycle true
-saveGameFile "C:\Sakk\WinBoard-TM\WinBoard\games.pgn"
-loadGameFile "C:\Sakk\PGN-books\HS-Grand_10-moves[48617].pgn"
-loadGameIndex 0
-loadPositionFile ""
-loadPositionIndex 1
-rewindIndex 0
-mps 40
-tc 2:35
-inc -1.00
-results "=+*"
Gábor Szőts

CCRL testing group
User avatar
Gábor Szots
 
Posts: 327
Joined: 26 Sep 2004, 21:26
Location: Szentendre, Hungary

Re: Always the same opening

Postby H.G.Muller » 11 Aug 2011, 15:56

Hmm, it says -loadGameIndex 0, and to get automatic stepping through the opening lines you would need -loadGameIndex -1 (or -2,if you want to do two games per opening).

Are you sure you did tick "Step through lines/positions in file", when you specified the tourney parameters?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Always the same opening

Postby Gábor Szots » 11 Aug 2011, 16:11

H.G.Muller wrote:Hmm, it says -loadGameIndex 0, and to get automatic stepping through the opening lines you would need -loadGameIndex -1 (or -2,if you want to do two games per opening).

Are you sure you did tick "Step through lines/positions in file", when you specified the tourney parameters?


Actually, I am sure I did not tick it.

However, I played a tourney in June, where I did not tick it either, nevertheless all games were different. Here is the tourney file:

-participants {Dorky 4.3 64-bit
Amyan 1.72
AnMon 5.75
Arasan 12.0 64-bit
Cerebro 3.03d
Counter 1.2
Danasah 4.24
Gaia 3.5 64-bit
Glass 1.7 64-bit
Green Light Chess 3.01.2.2
LambChop 10.99
LittleThought 1.052 64-bit
Matacz 1.4
nanoSzachy 3.8
Petir 4.999999
Little Goliath Evolution
Rotor 0.6
SpiderChess 070603
Philou 3.6
The Baron 2.23 64-bit
Trace 1.37a
Yace 0.99.87
}
-tourneyType 1
-tourneyCycles 1
-defaultMatchGames 32
-syncAfterRound false
-syncAfterCycle false
-saveGameFile "C:\Sakk\WinBoard-TM\WinBoard\games.pgn"
-loadGameFile ""
-loadGameIndex 0
-loadPositionFile ""
-loadPositionIndex 1
-rewindIndex 0
-mps 40
-tc 2:35
-inc -1.00
-results "=----+-+++-=+--+-+-+=-++-+-+++=++++--+-=+-+-+--+-+=-=++-+-+-+---=--+==-+===+=-=++++++++=-+--+==+-+--++=-+--+------+-=----+---++-++--=-=-=+=+--++++=+-----+=-++-+=+=+-+----++==+--=-===+=+++=--+==-+---++++-+++++++++--++-+-+--+-+-+-+---=++-+=---===+-+++-+-++++-++-=-+--+=+-=+++--==+-++==+==-+-=+=-+---+=+----=+=++++--=++-+-+++--+-+++-+-+----=+=-=--++--+-+-+-++--++=+-++----+-+-+-=-----+--+=+=+==+-+++-++++++--+=+--=-+=-++-++-++=-+--+-+-+-++++=-++==+-+++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-=++=+++--+=+-+--++++--++---+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-=-+==++-----++=-+=+-+-+++=+-+=++=+-++=-+-+=++-=+-+=-+++++=-+-+===--=+-++==+-=+-=--+++--==+=++++--+=+++=+++==-š --=-+---+-+-+-+++"

I can see that loadPositionindex is 1 there and it was played withthe default bin book, that cannot be the difference can it?
Gábor Szőts

CCRL testing group
User avatar
Gábor Szots
 
Posts: 327
Joined: 26 Sep 2004, 21:26
Location: Szentendre, Hungary

Re: Always the same opening

Postby H.G.Muller » 11 Aug 2011, 16:53

Yes, that makes all the difference. In the June edition you did not specify a -loadGameFile. (So the -loadGameIndex is not relevant.) In that case the games start from the default opening position. And when you specified the engines should use GUI book, WinBoard would (randomly) probe the book for them. (And even if not, the engines might play randomly from their own book.) Because the opening position is definitely in the default GUI book.

But now you specified a -loadGameFile, and that overrules any GUI book. So first the moves from the game file are forced into the engines, and only then the game starts. If the position at the end of the line in the game file would still be in the GUI book, WinBoard would now randomly probe the book on behalf of the engines that use it. But most likely the lines in the game file end outside the GUI book, so the engines start playing for themselves after being fed the moves from the game file.

And now that you specified a game file, the -loadGameFile setting becomes relevant. By default it is 0, which is the same as 1. (I guess it would be more logical if the default is 1, as it is for the -loadPositionIndex, and even more logical if there was only one index used for both games and positions, as you never use a position and a game file at the same time. So some day I will change it to be like that.) But that means you request it to play game 1 always. Auto-stepping requires -1 or -2; positive values mean you want to always use the game of that number. (This was the original function of the load indexes,before we invented auto-stepping.) because Windows does not allow you to type -1 or -2 in a numeric input box, I put two checkboxes in the Tournament dialog to specify auto-stepping.

So in summary: The GUI book is something completely different from a -loadGameFile. The latter is a list of games, that can be identified by their sequence number in the file. But a Polyglot book is just a large pool of (position, move) pairs, not grouped into lines. The only way to use that is by randomly jumping from position to position. But the upside is that you can get many more games out of a file of the same size. (And that you can play it one-sidedly, while a -loadGameFile would always force both engines to play the line.)

You can easily recover from this without losing the two games that had already been played: just edit the tourney file to change the -loadGameIndex to -2, (assuming you want to play each line twice), and remove the * at the end of the -results "=+*" string at the bottom, and then restart the tourney by double-clicking the tourney file.

I am a bit worried about the * left in the -results, actually. How did you abort the tourney? The * means the game is currently being played, but I programmed WinBoard to remove it when you quit it during a game, to make sure the game will get replayed when you restart the tourney. Apparently this did not work in this case. (And that is bad; it means the game would never be played, because any WinBoard you would now set to work on this tourney would not touch the game, assuming there is another WinBoard instance playing it. So you would have to edit the tourney file to replace it by a space (or just delete it when it is at the end), to make the game eligible for playing again. And editing files is something I would like to avoid as much as possible...)
Last edited by H.G.Muller on 11 Aug 2011, 17:02, edited 1 time in total.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Always the same opening

Postby Gábor Szots » 11 Aug 2011, 17:02

H.G.Muller wrote:I am a bit worried about the * left in the -results, actually. How did you abort the tourney? The * means the game is currently being played, but I programmed WinBoard to remove it when you quit it during a game, to make sure the game will get replayed when you restart the tourney. Apparently this did not work in this case. (And that is bad; it means the game would never be played, because any WinBoard you would now set to work on this tourney would not touch the game, assuming there is another WinBoard instance playing it. So you would have to edit the tourney file to replace it by a space (or just delete it when it is at the end), to make the game eligible for playing again. And editing files is something I would like to avoid as much as possible...)


Thanks for all this. As for the *, I probably simply quit WB out of frustration...
Gábor Szőts

CCRL testing group
User avatar
Gábor Szots
 
Posts: 327
Joined: 26 Sep 2004, 21:26
Location: Szentendre, Hungary

Re: Always the same opening

Postby Gábor Szots » 11 Aug 2011, 18:10

H.G.Muller wrote:You can easily recover from this without losing the two games that had already been played: just edit the tourney file to change the -loadGameIndex to -2, (assuming you want to play each line twice), and remove the * at the end of the -results "=+*" string at the bottom, and then restart the tourney by double-clicking the tourney file.


I did that and the tournament is playing as intended. :D
Gábor Szőts

CCRL testing group
User avatar
Gábor Szots
 
Posts: 327
Joined: 26 Sep 2004, 21:26
Location: Szentendre, Hungary

Re: Always the same opening

Postby H.G.Muller » 11 Aug 2011, 18:56

Gábor Szots wrote:Thanks for all this. As for the *, I probably simply quit WB out of frustration...


Well, this is what I also do, even when not frustrated, :wink: simply because it is the quickest and most obvious way. But this is exactly why I programmed it to handle the case (at least, I thought so...). Even hitting the cross in the upper-right window corner should not cause 'sudden-death', but sends a signal to WinBoard so it can orchestrate an organized exit, saving the (incomplete) game in the PGN (with result * and result message {XBoard exit}), sending quit commands to the engine (so no hanging processes are left), before it really terminates. But I programmed it also to replace the * for the interrupted game by a space. So this is why I am a bit shocked to see that it did not work. Normally I only see this when WB test versions really crash.

I guess I should test this some more...
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Always the same opening

Postby Gábor Szots » 11 Aug 2011, 19:26

H.G.Muller wrote:
Gábor Szots wrote:Thanks for all this. As for the *, I probably simply quit WB out of frustration...


Well, this is what I also do, even when not frustrated, :wink: simply because it is the quickest and most obvious way. But this is exactly why I programmed it to handle the case (at least, I thought so...). Even hitting the cross in the upper-right window corner should not cause 'sudden-death', but sends a signal to WinBoard so it can orchestrate an organized exit, saving the (incomplete) game in the PGN (with result * and result message {XBoard exit}), sending quit commands to the engine (so no hanging processes are left), before it really terminates. But I programmed it also to replace the * for the interrupted game by a space. So this is why I am a bit shocked to see that it did not work. Normally I only see this when WB test versions really crash.

I guess I should test this some more...


I looked at the trn file while the tournament was running and I saw the asterisk while game 10 was playing. After finishing the game through 'Machine Match' the asterisk turned into an = (the game was drawn). Now I resumed the tournament and the asterisk appeared again. Could it be its presence simply means the tournament is running?
Gábor Szőts

CCRL testing group
User avatar
Gábor Szots
 
Posts: 327
Joined: 26 Sep 2004, 21:26
Location: Szentendre, Hungary

Re: Always the same opening

Postby H.G.Muller » 11 Aug 2011, 20:59

Indeed, it means the game is running. All games that are running get a * in the position that will later contain their result (+, - or =), so that other WinBoard instances know they must not start playing that game, because it is already playing. Normally, the * is replaced by the game result as soon as the game finishes (as you observed), but of course usually WinBoard will immediately start playing a new game, so a new * will appear, this time for that new game. But if a game ends unfinished (because you quit WinBoard), WB should change the * into a space. So that when you start a new WB to play the tourney, it will pick that game again. (WB picks the leftmost space in the -results string to play, and if there is no space, plays the game just beyond the end of the string. So if you play with a single WinBoard, you will always see a * at the end.)
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Always the same opening

Postby Gábor Szots » 17 Aug 2011, 19:30

Hello again,

A terrible thing hapened. I corrected the trn file, here is its relevant part:

Code: Select all
-tourneyType 1
-tourneyCycles 1
-defaultMatchGames 32
-syncAfterRound false
-syncAfterCycle true
-saveGameFile "C:\Sakk\WinBoard-TM\WinBoard\games.pgn"
-loadGameFile "C:\Sakk\PGN-books\HS-Grand_10-moves[48617].pgn"
-loadGameIndex -2
-loadPositionFile ""
-loadPositionIndex 1
-rewindIndex 0


And all matches are played with exactly the same set of openings (the same 16 different start positions in each match), when my intention was to play the whole tournament randomly (but each opening twice, with reversed colours). Where is the mistake?
Gábor Szőts

CCRL testing group
User avatar
Gábor Szots
 
Posts: 327
Joined: 26 Sep 2004, 21:26
Location: Szentendre, Hungary

Re: Always the same opening

Postby H.G.Muller » 17 Aug 2011, 20:40

That is intended behavior. In general there is no harm when two different engines start from the same opening. (You will get different games out-of-book anyway, because at least one of the engines is different.) The loadGameFile is intended to play each match from a carefully selected set of openings (like Nunn). For totally random selections of openings, the GUI book is provided.

Of course it would be possible (and not very difficut) to use -loadGameIndex -3 to indicate WinBoard should select lines from a given -loadGameFile totally at random. Possibly in combination with the -rewindIndex option, which could specify the maximum game number that can be selected. But currently only -1 and -2 have been assigned a special function for the game index.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Always the same opening

Postby Gábor Szots » 17 Aug 2011, 21:25

H.G.Muller wrote:That is intended behavior. In general there is no harm when two different engines start from the same opening. (You will get different games out-of-book anyway, because at least one of the engines is different.) The loadGameFile is intended to play each match from a carefully selected set of openings (like Nunn). For totally random selections of openings, the GUI book is provided.

Of course it would be possible (and not very difficut) to use -loadGameIndex -3 to indicate WinBoard should select lines from a given -loadGameFile totally at random. Possibly in combination with the -rewindIndex option, which could specify the maximum game number that can be selected. But currently only -1 and -2 have been assigned a special function for the game index.


OK, I have learned something again. I had to use a PGN because of only one engine, Francesca, as it is unable to play from a setup position.
Gábor Szőts

CCRL testing group
User avatar
Gábor Szots
 
Posts: 327
Joined: 26 Sep 2004, 21:26
Location: Szentendre, Hungary

Re: Always the same opening

Postby H.G.Muller » 18 Aug 2011, 09:05

I think I understand now what you really want: random openings in the odd (1st, 3rd, ...) games between opponents, but in the equalizing even games, the opening should be the same as in the previous game (but played with reversed colors).

I guess the best way to implement that would be through the GUI book. Because it is a bit cumbersome to require people to prepare a huge list of randomly chosenopening lines. So it would be ideal if the "Use each line/position twice" option you can tick in the tournament dialog would also apply to the GUI book, and not just to loadGameFiles.

Problem is that this is not that easy to implement, because the two games might be played by different WinBoard instances, and the second game might start before the first finishes, so it would not be possible to check in the PGN file which opening was used thatwe now have to repeat. It would only work if there was some deterministic process at work, so that twodifferent WinBoards totally independently could conclude: "this is game 5 (or 6) from the tourney, so now I have to pick exactly this opening". But in another tourney, you would still want them to pick a different opening for games 5 and 6.

Now pseudo-random number generators (as WinBoard uses for picking bookmoves) are in fact deterministic, so setting their "seed" to the same value before a game would make them travers the book in exactly the same way. So it would be a matter of re-seeding them before every game, with a number that is different for every game of the tourney, except that (in case you selected playing every line twice) the odd and even games should use the same seed. But in general the seed should be derived from the game number in a deterministic way, so that different WinBoards would always pick the same line for that game or its partner game (even if it was aborted and hastobe replayed, etc.). And it also has to depend on the tourney, because we don't want all 5th games of all tourneys to use the same opening.

I could make the seed dependent on the name of the tourney file, as well as game number, but there is no true guarantee that all tourney-file names will be unique. People could reuse the same name, after deleting the previous one. So it would be better to have the WinBoard instance that creates the original tournament file generate a truly random number (based on the msec of the clock), which is what it does now at startup anyway, and write that in the tourney file as a /seedBase=... , which other WinBoard instances working on the same tourney will read with the rest of that tourney file, and then combine with the game number to pick the opening in a deterministic way. So the only non-determinism is in the initial choice of the /seedBase.

This could also be useful for picking colors in a Swiss tourney, where so far the #1 seed always plays white(which was a bit unfair).
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Always the same opening

Postby H.G.Muller » 18 Aug 2011, 13:37

OK, done! (At the WinBoard-TM link.)

When you now tick that every opening line should be used twice without providing a loadGameFile, WinBoard will reset the random seed before every game, in such a way that two consecutive games will get the same opening line.

Note that (for the time being) this only gives a sensible result when the games per pairing is set to an even value. Otherwise the reversed opening will be played by different engines!
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Always the same opening

Postby Gábor Szots » 18 Aug 2011, 15:06

H.G.Muller wrote:OK, done! (At the WinBoard-TM link.)

When you now tick that every opening line should be used twice without providing a loadGameFile, WinBoard will reset the random seed before every game, in such a way that two consecutive games will get the same opening line.

Note that (for the time being) this only gives a sensible result when the games per pairing is set to an even value. Otherwise the reversed opening will be played by different engines!


Thank you. I shall open a thank-you account for you...
Gábor Szőts

CCRL testing group
User avatar
Gábor Szots
 
Posts: 327
Joined: 26 Sep 2004, 21:26
Location: Szentendre, Hungary

Re: Always the same opening

Postby Gábor Szots » 18 Aug 2011, 15:11

H.G.Muller wrote:I think I understand now what you really want: random openings in the odd (1st, 3rd, ...) games between opponents, but in the equalizing even games, the opening should be the same as in the previous game (but played with reversed colors).


Either that or all openings of a whole tournament shall be different.
Gábor Szőts

CCRL testing group
User avatar
Gábor Szots
 
Posts: 327
Joined: 26 Sep 2004, 21:26
Location: Szentendre, Hungary


Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 15 guests