How to suspend a Winboard tournament?

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

How to suspend a Winboard tournament?

Postby cnchang » 03 Dec 2012, 10:07

Hi there,

I tried to suspend/pause an ongoing Winboard tournament by using "PAUSE" botton, but it didn't work. I read the HELP content, and it says chess engine will not be paused, but only human player will get a breath when PAUSE is pressed.
Then, I tried to use Windows Explorer to SUSPEND the Winboard process and two playing engines. They are all stopped with the running clock kept frozen. But, once those processes are RESUMED, the next player's remaining time will be deducted for the timeout period. In another word, the next up engine player will get timeout penalty. I am running out of ideas on how to call a timeout and just to resume it later at a more convenient time in a Winboard chess tourney. Any suggestions?

Dan
Last edited by cnchang on 03 Dec 2012, 16:46, edited 1 time in total.
cnchang
 
Posts: 49
Joined: 03 Dec 2012, 09:08

Re: How to suspend a Winboard tournament?

Postby H.G.Muller » 03 Dec 2012, 11:15

To be honest, I never studied what exactly the Pause button is supposed to do in various modes. (I only use it to stop auto-play after loading a game.) I am not sure if it is possible to pause ongoing games in TwoMachines mode without undesired side effects. (e.g. whether engines will continue pondering etc.) I know WB protocol defines a command to suspend engines, but I don't think any engine implements it.

To pause a tourney I just kill WinBoard. If you don't want to abort an on-going game, (because an unfinished game looks ugly in the PGN save file) you can hit the Mode -> Machine Match menu item to make it stop after the current game, and kill it then (if it doesn't quit by itself). When I want to resume the tourney, I just double-click the tourney file.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: How to suspend a Winboard tournament?

Postby cnchang » 03 Dec 2012, 15:40

I appreciate your speedy response and your effort to provide us this great board. With it, I can have UCCI and UCI engines play with one another. I am so much impressed.

However, it seems impossible to call a timeout at will in the middle of a game in WinBoard without messing up timers and/or chess engines flow.
But, if a tourney can be resumed after killing WinBoard and then restarting it, is it possible to erase the aborted game from the tourney schedule/record somehow so that particular match in the tourney can be replayed?

Regarding if chess engines will take STOP command from the chess board, my test on BHWS chess board's(2012 test version) tourney management menu's PAUSE TOURNEY switch will stop both the board timers and chess engines all at once. No pondering; actually no nothing is taking up any CPU resources from task manager. The same engines are used.
cnchang
 
Posts: 49
Joined: 03 Dec 2012, 09:08

Re: How to suspend a Winboard tournament?

Postby H.G.Muller » 03 Dec 2012, 18:15

cnchang wrote:However, it seems impossible to call a timeout at will in the middle of a game in WinBoard without messing up timers and/or chess engines flow.

This could very well be a correct summary of the current state of affairs. I was not the original author of WinBoard, and despite the fact that I added many features, this is just one aspect I never looked at. (Also because no one complained about this before.)

Pausing an engine-engine game is tricky, because one of the engines will always be thinking. I suppose the best approach would be to pause the game only after the thinking engine produces its move; interrupting a thinking engine (if the engine would allow this at all; many WB engines do not) is likely to disadvantage the interrupted engine if you start it thinking again on resuming the game, but probably does advantage it when you give it back the time that it has been thinking so far (because it did use the time to fill its hash table).

I must do some thinking on what would be the best way to do this, and actually check out how the pause button is handled now in TwoMachines mode.

But, if a tourney can be resumed after killing WinBoard and then restarting it, is it possible to erase the aborted game from the tourney schedule/record somehow so that particular match in the tourney can be replayed?

WinBoard should automatically replay the game on restarting the tourney, as it will not have a Win/Draw/Loss result yet. When WinBoard is closed through the quit menu or window-close button it will still update the tourney file to unmark the aborted game as no longer 'in progress'. The only drawback is that in the PGN file the aborted game will be stored with an 'unfinished' result. The only way to remove that is currently by editing the PGN file.

It would be nice if WinBoard had the general capability to continue aborted games. Perhaps I should store the clock settings in the result message (which now only says 'XBoard exit'), so that on reloading the game the clocks could be put back in the state they were in when the game was aborted, so it could be continued from there. That would not solve the problem of the aborted game appearing in the PGN file, though.

One problem that makes it tricky to let WinBoard remove the aborted game automatically is that you might have had multiple instances of WinBoard working on the same tourney, and aborted one (or several) of them just before another one completed a game, and wrote it to the PGN file. So aborted games don't have to be the last games in the file.

I guess a much easier way to solve the problem is prevent that unfinished games are written in the tourney PGN in the first place. In general you want such games to be saved (e.g. if you accidentally closed WinBoard in a human-engine game, so you can easily restart the game), but in a tournament it just corrupts the file. So when an exit event happens when a tournament is in progress, I probably should not save it in the regular saveGameFile, but in a reserved 'DeadGame.pgn' file.

Regarding if chess engines will take STOP command from the chess board, my test on BHWS chess board's(2012 test version) tourney management menu's PAUSE TOURNEY switch will stop both the board timers and chess engines all at once. No pondering; actually no nothing is taking up any CPU resources from task manager. The same engines are used.


Well, both UCI and UCCI protocols have a 'stop' command to stop the engine immediately, and it is an essential part of the protocol. (You could not implement pondering without it). In WB protocol there is a move-now command ('?'), but not any engines implement it, as it is not needed in normal game play. BHWS really does not wait until the thinking engine produces its move? I don't know very well how the BHWS GUI works, because it is all in Chinese... I suppose one could just send 'stop' commands to the thinking and pondering engine, and add the clock time the thinking engine has been using so far on the current move back to the clock. Or does it just leave the time as it is?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: How to suspend a Winboard tournament?

Postby cnchang » 04 Dec 2012, 08:18

H.G.Muller wrote:Pausing an engine-engine game is tricky, because one of the engines will always be thinking. I suppose the best approach would be to pause the game only after the thinking engine produces its move; interrupting a thinking engine (if the engine would allow this at all; many WB engines do not) is likely to disadvantage the interrupted engine if you start it thinking again on resuming the game, but probably does advantage it when you give it back the time that it has been thinking so far (because it did use the time to fill its hash table).
...

It would be nice if WinBoard had the general capability to continue aborted games. Perhaps I should store the clock settings in the result message (which now only says 'XBoard exit'), so that on reloading the game the clocks could be put back in the state they were in when the game was aborted, so it could be continued from there. That would not solve the problem of the aborted game appearing in the PGN file, though.
...
Well, both UCI and UCCI protocols have a 'stop' command to stop the engine immediately, and it is an essential part of the protocol. (You could not implement pondering without it). In WB protocol there is a move-now command ('?'), but not any engines implement it, as it is not needed in normal game play. BHWS really does not wait until the thinking engine produces its move? I don't know very well how the BHWS GUI works, because it is all in Chinese... I suppose one could just send 'stop' commands to the thinking and pondering engine, and add the clock time the thinking engine has been using so far on the current move back to the clock. Or does it just leave the time as it is?


Based on my observation, I think BHGUI playing-time-preservation task is accomplished by registering the beginning time of each move. Thus, when TOURNEY PAUSE is pressed anytime in the middle of ENGINE A's thinking process, both engines will be suspended immediately, hash cleared, and ENGINE A's remaining time rolled(or added) back to the very beginning of this paused step as if ENGINE A is just about to start thinking. Once you resume the tourney, with all evidences cleared up ENGINE A will freshly start thinking from that paused step. No deja vu!
cnchang
 
Posts: 49
Joined: 03 Dec 2012, 09:08

Re: How to suspend a Winboard tournament?

Postby H.G.Muller » 04 Dec 2012, 09:38

One problem with this is that there are almost no engines that support clearing of the hash table. But this is probably just as well, as clearing it would rob the interrupted engine of its ponder time, in case it had a ponder hit on the previous move. By not clearing the hash table, one could hope that it can recover most of the ponder search from it when you restart. (Assuming all engines have hash tables...) But it would also recover most of the search results obtained in its own turn, just before the interruption.

Taking all this into account, I think the least-disturbing way to implement this is to not clear the hash, and assume that engines will be able to pick up the search where it was aborted. So that you don't have to re-imburse them for any time, and can leave the clocks exactly as they were. This would disadvantage engines that do not use hash tables, or had a poor implementation that overwrite important entries quickly, especially when they had a ponder hit. But there aren't many of those, and if people are using them, they can simply refrain from pausing the games.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: How to suspend a Winboard tournament?

Postby H.G.Muller » 04 Dec 2012, 10:03

WB protocol already specifies dedicated commands for pausing an engine:

WB protocol specs wrote:pause
resume
(These commands are new in protocol version 2 and will not be sent unless feature pause=1 is set. At this writing, xboard actually does not use the commands at all, but it or other interfaces may use them in the future.) The "pause" command puts the engine into a special state where it does not think, ponder, or otherwise consume significant CPU time. The current thinking or pondering (if any) is suspended and both player's clocks are stopped. The only command that the interface may send to the engine while it is in the paused state is "resume". The paused thinking or pondering (if any) resumes from exactly where it left off, and the clock of the player on move resumes running from where it stopped.


So the UCCI2WB abd UCI2WB adapters can tell WinBoard they support 'pause', and then it is upto those how they implement it through controlling the engine. As WinBoard would stop the clocks when sending 'pause', without any time adjustment, the preferred implementation should be to simply send the engines a 'stop' command on receiving 'pause', and ignore the 'bestmove' reply. And then on 'resume' simply repeat the last 'go' command that the 'stop' interrupted (be it a ponder search or a regular search) with the new clock times.

It would be a bit more tricky how to let WinBoard handle engines that do not support 'pause'. I guess it would be acceptable to have those finish their turn first, and then simply not relay the move to the opponent, and switch ponder off in both engines in ase they were pondering.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: How to suspend a Winboard tournament?

Postby H.G.Muller » 05 Dec 2012, 21:46

OK, I made a new beta version which implements pausing while the engine is thinking. (So also in engine-engine games.) I uploaded the winboard.exe to

http://hgm.nubati.net/WinBoard-4.7.beta.zip .

It also contains a UCI2WB.exe that supports the 'pause' command of WB protocol, and aborts a search of the UCI engine as soon as it receives it. I don't have a UCCI2WB yet that does that. (UCCI2WB is mostly Morning Yellow's code, so it will require some time to study it before I would know how to do implement 'pause' there.)

However, the new WB will even pause games with engines that do not support the 'pause' command! The only drawback is that it does not pause them immediately, but only after the engine that was thinking produces its move.

Perhaps you can test it to see if it works like you expected.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: How to suspend a Winboard tournament?

Postby H.G.Muller » 06 Dec 2012, 14:36

I also prepared a new UCCI2WB, implementing the pause command. (And fixed an apparent bug in it that I noticed: it did not correct the timeLeft for the previous thinking when it started a ponder search, with as a result that on a ponder hit it could exceed the time.) I uploaded it to

http://hgm.nubati.net/ucci2wb.zip .
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: How to suspend a Winboard tournament?

Postby cnchang » 06 Dec 2012, 16:41

There are 5 files in these two zip files. They are winboard.exe, UCI2WB.exe, ucci2wb.exe, ucci2wb3.cpp, and LGPL.TXT. How would you recommend to test this new setup? Should these 5 files put into one folder and run as one standalone test release? Or, they are supposed to replace the respective old files and merged with the existing version WinBoard. For example, I was using WinBoard 4.6.2, by installing WinBoardPortable_4.6.2_English.paf.exe. (SHA256:1947adda8f8442ba4ff9d5f40c3b63baf29067105da2cfea76f91d2102cd2492)
cnchang
 
Posts: 49
Joined: 03 Dec 2012, 09:08

Re: How to suspend a Winboard tournament?

Postby cnchang » 06 Dec 2012, 18:15

I tried to run some tests with 3 beta files merged into 4.6.2. Pause can now stop and restart the clock in two machines match at will. But, games can't seem to run stably. Did you get beta run PAUSE/RESUME smoothly with any particular UCI or UCCI engine?
cnchang
 
Posts: 49
Joined: 03 Dec 2012, 09:08

Re: How to suspend a Winboard tournament?

Postby H.G.Muller » 06 Dec 2012, 18:54

I tried UCI2WB with Glaurung (on Linux). I did not observe any trouble, neither when pausing during thinking or pondering. I tried UCCI2WB with Elephant Eye on Windows. I could also pause that during both thinking and pondering. However, it seemed that Elephant Eye clears its hash table spontaneously before every search: If I set it thinking, and it reached a certain depth in X sec before I paused it, after resuming it took almost the same time as before to reach that same depth. While Glaurung would reach the same depth almost instantly, as is expected for an engine that retains its hash table.

What exactly do you mean by "games can't seem to run stably"? Are these only games that you pause, or just any games? What games (time control, ponder on/off) are you playing anyway? And with which type of engines?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: How to suspend a Winboard tournament?

Postby H.G.Muller » 06 Dec 2012, 22:16

Oh, I think I know what you mean. In the new UCCI2WB I correct the time used in thinking before it starts pondering. But I subtract millisec, while the time is kept in centisec. This must give weird effects on ponder hits.

[edit] I uploaded a new ucci2wb.zip (to the same URL as before), which now consistently calculates in millisec. This should solve the stability problem. (Which really had nothing to do with the pause stuff, but with a faulty fix of the ponder-time calculation.)
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: How to suspend a Winboard tournament?

Postby cnchang » 07 Dec 2012, 02:12

Regarding the stability problem, after I pressed PAUSE and waited for a while and then RESUMEed the two-machine game, I saw these problems:
1. both engines come back thinking and consume CPU resource even in no-ponder-next-move mode (while before pressing PAUSE, they were taking turns using CPU).
2. After the resumed engine completed the new thinking and moved, the other engine did not finish its thinking and make the next move and just let time keep running until its time ran out.
3. I also observed some engine's hash cleared after PAUSE/RESUME as you did.
I tried on multiple UCI and UCCI engines on Windows; just to name a few, 3DChess, cyclone62, ggchess, eleeye, ....
Strangely enough, the first time I tried to run the new setup, I remembered it was cool (i.e., no problem #2). But, then I encountered problems in the later batch of tests.
When you tried on Elephant Eye, are both engines eleeye played in the two machines match? If you can run it stable, why do you need another UCCI2WB?
cnchang
 
Posts: 49
Joined: 03 Dec 2012, 09:08

Re: How to suspend a Winboard tournament?

Postby H.G.Muller » 07 Dec 2012, 15:05

OK, I am very sorry that in my haste I only fixed the known problem, and did not test if everything still worked. I must have somehow leaned on the keyboard, because an = sign was suddenly missing, which completely wrecked the operation.

The UCCI2WB version I uploaded now has this fixed. I tested it by playing Elephant Eye against itself. Both with ponder on and off this seems to work now. That is, the game is resumed correctly, and with ponder off only the engine that is on move starts using CPU when you resume.

I can't help it that some engines clear their hash on starting a new search. In the current implementation no order is given to do so, it is their own choice. This is in general detrimental, and in this case it makes them waste some time when they are paused. But there is no way to do this that guarantees the engines won't notice it. The current implementation seems the best way to do it, as it at least does not hurt engines with a good implementation. People that want to do strictly accurate engine testing should not use this feature.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: How to suspend a Winboard tournament?

Postby cnchang » 08 Dec 2012, 12:22

Downloaded your new beta, i.e., UCCI2WB, and ran tests on UCCI chess engines, they all worked great on PAUSE/RESUME in two-machine-match with ponder off!
Here is the list of engines I tested:
============
3D
Anita
BHWS
Bitstrong
BLCX
Bugcchess
Cyclone0.56
ElephantEye
EyeChessU
HICE
Jupiter
KING
KOU
NymphChess
Qstar
Swallow
THT(Thought)
TLXJ
UFX
Xqspirit
YSSY

Most engines seem to clear their hash after the resumption of the game, except Anita and Swallow. These two look like not throwing everything away. Not sure if they keep 100% hash table though.
BTW, UCI engines(e.g., Shiga, ggchess, and cyclone6.2) and the pre-packed MaxQi and HaQiki engines, neither UCI nor UCCI, are not yet working in the PAUSE/RESUME tests.
All in all, two thumbs up for this UCCI beta's PAUSE/RESUME feature!
cnchang
 
Posts: 49
Joined: 03 Dec 2012, 09:08

Re: How to suspend a Winboard tournament?

Postby H.G.Muller » 08 Dec 2012, 12:58

OK, then there still must be a problem with the UCI2WB adapter. Which is strange, as it seemed to work quite well with Glaurung, and I have not touched it since. But I do have Cyclone, and I will test it on that. Perhaps there is a difference between Chess and Xiangqi engines...

You have Shiga? I understood this was commercial some 5 years ago, but not anymore. Is this the commercial version? Shiga seems to be the only publicly available engine from Taiwan.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: How to suspend a Winboard tournament?

Postby cnchang » 08 Dec 2012, 14:42

Yes, Shiga team is from Taiwan and they made commercial Chess packages.
Nevertheless, you can download the latest 2012 Shiga/Shijia Chinese Chess naked engine(Shijia.rar) here:
http://down.qiannao.com/space/file/5454 ... .rar/.page

Another top Chinese Chess engine Cyclone 6.2(Cyclone V6.2.rar) can be downloaded here:
http://rapidlibrary.com/files/cyclone-v ... wiyon.html
AFAIK, this one may be only as updated as 20091218. Not sure if it is the same one you got.
I can't find a 2012 Cyclone other than a test version, but which is not suited for a PAUSE test because its nagging prompt.
I heard the same Cyclone team is developing the commercial Deluge now, and I don't think they give away free engine for download anymore. But, if you are interested, we can try to find them and contact them for a shot.

The latest 2012 BHWS can be downloaded here:
http://www.qz777.com/read-htm-tid-10652.html
But, I can only run it on BHGUI. I can't make it run on Winboard.

These three top engines are all UCI engines you can play with. Have fun!
cnchang
 
Posts: 49
Joined: 03 Dec 2012, 09:08

Re: How to suspend a Winboard tournament?

Postby H.G.Muller » 08 Dec 2012, 15:54

hmm, the links do not seem to work for me. The Shiga link brings me to a page that Google says cannot be translated, and when I randomly click links on it, they bring me to all kind of places, but none starts a download...

The BingHe link seems to some forum, and one might have to be registered to download something, because I also don't see a download button.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: How to suspend a Winboard tournament?

Postby cnchang » 08 Dec 2012, 17:11

When you entered that Shijia download page, at the upper right corner, did you see Shijia.rar; 545400720; 2012/06/05 16:14:43; 10.045 MB?
Then, at the down lower half there is a list of downloadable addresses, you should be able to download it from any link from the third address on (with a number attached at the address end, e.g., XXX1, XXX2, XXX3 ...).
Be aware, this version is a user uploaded version. I can't guarrante the safety of this RAR file.
In addition, I noticed they already changed the RAR and the included Shiga.exe to different ones.

When I previously downloaded Shijia.rar, its SHA256 was 142440dcee92da74d8c71f8a4cc03af4f3be9ab40a256639b059a620908c1add.
Now, the new version Shijia.rar SHA256 is 7654bebb9d4d4613054946323c4337dd057d8825ed6ab75e558ae35c317c4527.
I scanned the RAR file, the result is here: https://www.virustotal.com/file/7654beb ... 354981011/
Also, here is the engine scan result: https://www.virustotal.com/file/a17b188 ... /analysis/ (engine last modified on 2011/12/27)
My previously downloaded engine scan result: https://www.virustotal.com/file/19c0514 ... /analysis/ (engine last modified on 2012/5/11) even newer!!
Things are quite fluid there. Some of the AVs suspect it may contain virus.
But, I wonder how dangerous a chess engine, running inside a chess board, can be.

Then, on BHWS v2.6 download page, there are multiple links pointing to different versions or add-ons.
For example, this link -- http://www.searqu.com/bh/bhbig1.zip will lead you to download a Chinese BIG5 version, easier for the chess players from Taiwan.
I am sorry no English version is available to download.
Be aware, there is a file fkwin.dll MAY trigger your AV. Kaspersky will let it pass, but Avira will try to quarantine it and render BHGUI useless unless you set it to "Always Ignore".
Maybe I would rate this BHGUI board more risky than a chess engine. But, this board is the only one to test 2012 BHWS engine.

Wait a minute, as the Winboard platform provider, don't you have connections with those chess engine makers? May I know your Cyclone's version? Is it a UCCI or a UCI engine?
cnchang
 
Posts: 49
Joined: 03 Dec 2012, 09:08

Next

Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 19 guests