New WinBoard beta

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

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

New WinBoard beta

Post by hgm »

I just uploaded a new WinBoad beta version to

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

This download contains a bare winboard.exe file. Sources are available from my on-line source repository. Compared to the current stable version (4.6.2) the most important novelties are:

* exclusion of moves from analysis
* analysis with two engines simultaneously
* starting WinBoard by dragging PGN, FEN/EPD, TRN, or INI/XOP files on top of its icon
* possibility to use extenal (full-color) piece bitmaps (e.g. from the 'WinBoard Zeta' distro)
* optional border around board, (e.g. for board coordinates) from external bitmap
* storing of graphics settings as easily recallable 'themes' in the winboard.ini file
* conversion of PGN file(s) to Polyglot book (in all variants)
* Monte-Carlo book mode for building opening tree from scratch

Most features are already described in the news file. I still have to update that for the themes and book features, though, so some words about those here:

Image

A new menu dialog (View -> Themes) is added, which allows interactive setting of options associated with board textures and piece fonts, which could not be controlled interactively before. It also contains controls for the new border and external piece bitmaps. With the aid of a 'Theme name' field it allows you to define a name for the current combination of piece & board settings. This combination of settings can then late be recalled by clicking it in the listbox, similar to the way you can recall engines with appropriate settings in the Load Engine dialog.

For creation of books there is a new menu item 'Create Opening Book'. Clicking it will cause positions from all games from the currently loaded PGN file to be stored in an internal memory buffer, which is then written to disk in Polyglot format (on the file specified as GUI book, so be careful not to overwrite an existing book!). The buffer is never cleared, so repeating the operation with another PGN file will add to it.

A second book novelty is the command-line option -mcBookMode. With this option book probing is done not from the external GUI-book file, but from the memory buffer. Moves are selected based on their merit, i.e. the better they score, the more frequently they will be played. If all moves are played approximately as often as they should, a book miss is reported, so that the engine will pick a move (possibly a new one, which was not in the book yet). All games are added to the memory buffer as soon as they finish. So you can build a book (starting from an arbitrary position) by playing a long match (with a mildly randomizing engine) or tourney of fast games (with many equally strong engines) in this mode. To actually write the book you have to create it from the resulting PGN file; the MC probing mode is just to make sure the PGN has a sensible distribution of opening moves.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: New WinBoard beta

Post by hgm »

I uploaded a new version to the same link, which has improved file- and folder-browsing for the browse buttons in the Themes / Tournament dialogs: Browsing now starts at the location currently specified by the file or folder name in the text-edit for which you are browsing.

This works quite nicely. Especially when you are choosing bitmaps, hitting the browse button immediately pops up in the textures folder, and modern Windows systems display the bitmap files as a thumbnail of the image they contain, so you really know what you are selecting:

Image
User avatar
F.Huber
Posts: 853
Joined: Thu Mar 09, 2006 4:50 pm
Location: Austria

Re: New WinBoard beta

Post by F.Huber »

hgm wrote:I just uploaded a new WinBoad beta version to

http://hgm.nubati.net/WinBoard-4.7.beta.zip
This new 'winboard.exe' is now 18 MB (!!) whereas previous releases have just been 1.3 MB.
What's this? Any wrong compiler switch? :shock:
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: New WinBoard beta

Post by mar »

F.Huber wrote:
hgm wrote:I just uploaded a new WinBoad beta version to

http://hgm.nubati.net/WinBoard-4.7.beta.zip
This new 'winboard.exe' is now 18 MB (!!) whereas previous releases have just been 1.3 MB.
What's this? Any wrong compiler switch? :shock:
I guess a huge chunk of (zero) data went into idata section instead of bss => looks like some huge array is initialized (like the first entry is zeroed in code => forces zeroing of the whole array).
Of course you can use UPX to compress it, but... some AV programs don't like compressed executables.
Just my two cents.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: New WinBoard beta

Post by hgm »

Oops! :oops: I guess it puts the hash table for creating the book in the .exe, because I declared it statically as:

entry_t bookHash[1024*1024] = { {0xFFFFFFFFFFFFFFFFLL, 0, 0, 0, 0} };

I will make sure it it will allocate it at run time in the next version.
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: New WinBoard beta

Post by mar »

hgm wrote:I will make sure it it will allocate it at run time in the next version.
Or perhaps you can keep it static but initialize the first entry manually somewhere in the init code.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: New WinBoard beta

Post by hgm »

Indeed. I had not realized that initializing a single entry would put an image of the entire array in the exe. Of course after compression it all disappears, so I had not noticed the size increase in the upload...

More serious is that I discovered during the first round of the Leiden tourney that the computer move is no longer highlighted (the highlights of the previously entered move stay on, which is extremely confusing!). I must have broken this while working on the XBoard GTK version. I will trace back where exactly I broke this.
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: New WinBoard beta

Post by mar »

hgm wrote:More serious is that I discovered during the first round of the Leiden tourney that the computer move is no longer highlighted (the highlights of the previously entered move stay on, which is extremely confusing!). I must have broken this while working on the XBoard GTK version. I will trace back where exactly I broke this.
Yes I guess these are the pitfalls of developing cross-platform apps. Another thing is different compilers. And one usually wants to keep one common backend at least.
Ideally the frontend would be the same for all platforms too, but that would require a common GUI framework/wrapper.
Such frameworks are mostly C++ and I see that XBoard is written in plain C. Gtk is also plain C, right?
It should work on Windows too, but I have seen some apps (perhaps poorly written?) having problems with some localized paths like "Application data"
as it may contain non-ansi characters. Multibyte strings on Windows are always asking for trouble.
I would prefer to have utf-8 everywhere instead of other multibyte encodings, but that's for historical reasons.
Of course utf-8 is bad for certain scripts as they would require
3 bytes per character so ucs-2 (who needs anything outside bmp anyway?)/utf-16 is probably the way to go.
For mixed scripts however (like webpages), utf-8 usually performs better than utf-16 anyway, but I'm a bit OT already, sorry :)

Anyway plain WinAPI will always have much smaller footprint on Windows that anything else. Plus you don't have to depend on large libraries.
I really don't like apps which take forever to startup just because they depend on X huge libraries.
The only drawback is that you have to manage different frontends.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: New WinBoard beta

Post by hgm »

The situation in WinBoard/XBoard is now such that WinBoard has its own, quite large front-end, containing lots of code duplication with the XBoard front-end. The coded for latter has now been refactored to have very strict separation of all platform-dependent code from 'business logic'. One could say that there now also is a 'middle-end', containing all platform-independent code that should have been in the back-end, but for historic reasons is not used by WinBoard, because it was duplicated in the original port to Windows.

The XBoard platform-dependent code is now shrunk to very little, and what is left is all of very general nature (basically a table-driven dialog creator). This makes porting to other platforms quite easy. The GTK version was the first such port.

I am toying with the idea to make a fresh port of this minimal front-end to Window API, to create an XBoard that natively runs on Windows. It should not be too much work, as much of the needed code already exists in WinBoard. (Which does have a table-drive dialog creator, for the Engine Settings dialogs, which would only have to be made slightly more general.)
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: New WinBoard beta

Post by mar »

I see. Duplicated code is hard to maintain, I know very well myself.
I think a fresh port is a good idea - it will take some time in the beginning
but I'm sure it pays off as you add new stuff later.
Primarily it will save time and reduce probability of bugs.