UCI2WB 4.0

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
User avatar
hgm
Posts: 23772
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

UCI2WB 4.0

Post by hgm » Sun Dec 09, 2018 9:47 am

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: 987
Joined: Thu Jul 16, 2009 8:47 am
Location: Almere, The Netherlands

Re: UCI2WB 4.0

Post by Joost Buijs » Sun Dec 09, 2018 12:04 pm

Does UCI2WB also support reading Polyglot books (like Polyglot does) or is it just an adapter only?

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

Re: UCI2WB 4.0

Post by hgm » Sun Dec 09, 2018 12:08 pm

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: 463
Joined: Mon Jul 20, 2015 3:06 pm
Contact:

Re: UCI2WB 4.0

Post by D Sceviour » Sun Dec 09, 2018 1: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

Joost Buijs
Posts: 987
Joined: Thu Jul 16, 2009 8:47 am
Location: Almere, The Netherlands

Re: UCI2WB 4.0

Post by Joost Buijs » Sun Dec 09, 2018 1: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.

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

Re: UCI2WB 4.0

Post by hgm » Sun Dec 09, 2018 1:25 pm

D Sceviour wrote:
Sun Dec 09, 2018 1: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: 23772
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: UCI2WB 4.0

Post by hgm » Sun Dec 09, 2018 1:36 pm

Joost Buijs wrote:
Sun Dec 09, 2018 1: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: 3830
Joined: Thu May 15, 2008 7:57 pm
Location: Berlin, Germany
Full name: Sven Schüle
Contact:

Re: UCI2WB 4.0

Post by Sven » Sun Dec 09, 2018 8:28 pm

hgm wrote:
Sun Dec 09, 2018 1:25 pm
D Sceviour wrote:
Sun Dec 09, 2018 1: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: 463
Joined: Mon Jul 20, 2015 3:06 pm
Contact:

Re: UCI2WB 4.0

Post by D Sceviour » Sun Dec 09, 2018 9:16 pm

Sven wrote:
Sun Dec 09, 2018 8: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: 23772
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: UCI2WB 4.0

Post by hgm » Sun Dec 09, 2018 9:38 pm

Sven wrote:
Sun Dec 09, 2018 8: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.)

Post Reply