UCI2WB 4.0

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27772
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

UCI2WB 4.0

Post by hgm »

I released a new version (4.0) of UCI2WB (the default UCI adapter packaged with WinBoard in the WinBoard-AA beta distro). The previous version turned out to have some problems, which were just made worse by my earlier attempts to fix those; in particular it had become insensitive to 'quit' commands while the engine was thinking, which could lead to hanging engine processes after an opponent out-of-turn resign.

I now completely redesigned the master logic of UCI2WB: instead of having threads for all engine->GUI and all GUI->engine traffic, which would now and then block waiting for each other when there is a need to synchronize, it now has one of threads always listenining to the GUI, and instantly handling any incoming command, either processing it (if that can be done during search), or queueing it for execution by the 'engine thread'. The latter listens to the engine for as long as it is searching. (UCI engines always tell you when they are done searching!) But if the engine is idle or merely pondering it first processes all queued commands, before it starts listening to any ponder output. Only when the engine is idle and the queue empty it blocks waiting for a command to appear in the queue.

This way the GUI thread can examine all incoming commands immediately, and judge whether these should abort the search that is currently running, or be ignored until that search terminates for other reasons. If the search is to be aborted, it sends 'stop' to the engine, which will then focus the attention of the engine thread on the queued command.

I tested the new UCI2WB with Stockfish, and everything seems to work as intended. The source code can be found in my on-line git repository. I uploaded a Windows executable at http://hgm.nubati.net/UCI2WB.zip . The WinBoard-AA beta package now also contains this new UCI2WB version.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: UCI2WB 4.0

Post by Joost Buijs »

Does UCI2WB also support reading Polyglot books (like Polyglot does) or is it just an adapter only?
User avatar
hgm
Posts: 27772
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI2WB 4.0

Post by hgm »

It is only an adapter. I see handling books more as a GUI task. Why should engines that run through an adapter have more right / facilties to use a book than native engines?
D Sceviour
Posts: 570
Joined: Mon Jul 20, 2015 5:06 pm

Re: UCI2WB 4.0

Post by D Sceviour »

May it be suggested to include a "readme" file in the executable zip folder for:

(1) a summary description,
(2) a short start-up example or "usage <>"
(3) GNU license, build date and authorship
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: UCI2WB 4.0

Post by Joost Buijs »

I was just wondering, books can get very large given enough games and depth, and I don't think Winboard supports binary books larger than 2GB.
User avatar
hgm
Posts: 27772
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI2WB 4.0

Post by hgm »

D Sceviour wrote: Sun Dec 09, 2018 2:10 pm May it be suggested to include a "readme" file in the executable zip folder for:

(1) a summary description,
(2) a short start-up example or "usage <>"
(3) GNU license, build date and authorship
All that is in the source repository. The zip file is just a service to Windows users that are not able to compile programs themselves. GPL info is not very relevant for a binary anyway, as people would not be able to modify it easily. It would be really stupid to try to hack a binary if the source code is available, and it would be forbidden by default. Only to those that acquire the source code the GPL would be important.
User avatar
hgm
Posts: 27772
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI2WB 4.0

Post by hgm »

Joost Buijs wrote: Sun Dec 09, 2018 2:13 pm I was just wondering, books can get very large given enough games and depth, and I don't think Winboard supports binary books larger than 2GB.
I wasn't aware this was a problem; WinBoard uses the book directly from file, doing bisection with fseek calls to find the requested position. It is true that the offset in these fseek calls is given as a normal int, and that would indeed limit it to 2GB. It should not be very difficult to make that a long long int, though, and find a seek call that can handle larger files.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: UCI2WB 4.0

Post by Sven »

hgm wrote: Sun Dec 09, 2018 2:25 pm
D Sceviour wrote: Sun Dec 09, 2018 2:10 pm May it be suggested to include a "readme" file in the executable zip folder for:

(1) a summary description,
(2) a short start-up example or "usage <>"
(3) GNU license, build date and authorship
All that is in the source repository. The zip file is just a service to Windows users that are not able to compile programs themselves. GPL info is not very relevant for a binary anyway, as people would not be able to modify it easily. It would be really stupid to try to hack a binary if the source code is available, and it would be forbidden by default. Only to those that acquire the source code the GPL would be important.
I think even a binary-only distribution of software whose source code is put under GPL needs to include the correct license information.
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)
D Sceviour
Posts: 570
Joined: Mon Jul 20, 2015 5:06 pm

Re: UCI2WB 4.0

Post by D Sceviour »

Sven wrote: Sun Dec 09, 2018 9:28 pm I think even a binary-only distribution of software whose source code is put under GPL needs to include the correct license information.
No, HGM already directed the information to the source repository. However, a "readme" should at least include a message stating "All that is in the source repository". I have never used uci2wb so I still do not know what to do with it. A description other than "look somewhere else" would be handy. It seems courteous and common sense to include a description with every zip file.
User avatar
hgm
Posts: 27772
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI2WB 4.0

Post by hgm »

Sven wrote: Sun Dec 09, 2018 9:28 pm I think even a binary-only distribution of software whose source code is put under GPL needs to include the correct license information.
Why? What would be the legal consequence if it doesn't?

IMHO it would mean that whoever downloads it cannot distribute it, or distribute any modified version of it. Which is fine with me. The binary package is only meant for people who already use UCI2WB, and want to replace their previous, now obsolete version by a newer one.

I guess the package would only be interesting for people who already have the WinBoard-AA beta package, which includes UCI2WB for all UCI dialects, or for people that want to run Shogi or Xiangqi engines under other WinBoard versions. Other people should just download the WinBoard-AA package, which also includes it, in a transparent way so that they would never even have to know it exists. (It is automatically invoked through WinBoard's -fUCI / -sUCI option, or by ticking the UCI checkbox in the menu.)