bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hyper gammon


From: Russ Allbery
Subject: Re: Hyper gammon
Date: Mon, 27 Jun 2022 14:14:46 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Philippe Michel <philippe.michel7@free.fr> writes:

> I don't have a Mint distribution installed, but on Ubuntu (it should be
> very similar), makehyper in present in /usr/games and can create an
> hypergammon database.

> It creates it in the current directory and then you have to copy it in 
> the expected place. This is where it gets awkward.

For the record, I'm happy to try to fix all of this, I'm just not sure
what the best solution is.  I haven't spent much time thinking about
makehyper because it almost never comes up.

> A few years ago the Debian package had no two-sided database. I had an
> exchange of mails with Russ Allbery, who maintains the package, where I
> convinced him that it was a serious shortcoming, that the TS default
> database was not that big and quick to build at install time on current
> hardware and that he really should either include it or build it at
> install.

This happened in 2006, so my memory is hazy.  My recollection is that the
prior maintainer of the package shipped the bearoffs database in a
separate package (gnubg-bearoffs).  I replaced that setup with the current
approach, where the largest bearoff database is optionally built during
package installation.

I don't think we ever had a time where the TS default database was both
not included and not generated on installation, but it's been a while and
I'm not sure of the details.  Before I adopted the package, it was hiding
in another package, which may have been optional.

We've subsequently had 16 years of improvements to storage and network
bandwidth, so adding 6.6MB (maybe less compressed; I don't remember how
well the database compresses) to gnubg-data may not be as big of a deal.
On the other hand, building it during installation seems to work okay,
other than the confusion about paths because building it during
installation arguably requires it go into /var/lib, since in general
packages should not create new files in /usr via maintainer scripts
(although that rule isn't always honored).

> Apparently he chose to build it but cannot write in /usr so he put it in
> /var/lib, and other additional databases (larger bearoff databases,
> hypergammon databases) are expected to be there as well.

Yeah, ideally it should search both locations.  I kept meaning to write
the code to do that, but haven't gotten around to it.

However, the deeper problem is that files that are generated by the user
shouldn't be put into /usr/share *or* /var/lib.  Both of those paths are
intended to only be written to by privileged users.  The best place to
load additional user-supplied bearoff databases and hypergammon databases
would be using XDG paths in the user's home directory, and gnubg should
ideally use a search path that looks in the user's home directory first,
and then in /var/lib and /usr/share if the file cannot be found there.

> What is confusing is that the Evaluation Engine help does not expect the
> data files to be split between two places and that this setup does not
> seem to be well documented.

It's documented in /usr/share/doc/gnubg/README.Debian, which is the
standard path for Debian-specific modifications, but which indeed most
users don't know about and certainly won't prefer over the in-program
help.  For the record, here's what that file says:

| gnubg needs a pre-computed two-sided bearoff database for maximum
| strength.  Since this database takes some time to build, particularly on
| slow systems, and takes over 6MB of disk space, the default is not to
| build it.  If you weren't asked whether you wanted to build the bearoff
| database at installation time, or if you've changed your mind, run:
| 
|     dpkg-reconfigure gnubg
| 
| to be asked again.  (The one-sided bearoff database is much smaller and is
| therefore included in the gnubg-data package.)
| 
| The Debian version of gnubg has been modified to search in /var/lib/gnubg
| as well as /usr/share/gnubg for its data files.  This is where the
| automatically built bearoff databases are put.  If you want particularly
| strong play and don't mind the disk space and computation time, you can
| build even larger databases with:
| 
|     makebearoff -t 6x8 -f /var/lib/gnubg/gnubg_ts.bd
|     makebearoff -o 10 -f /var/lib/gnubg/gnubg_os.bd
| 
| These two databases combined will take 190MB of disk space and may take
| several hours to compute.  Alternately, you can download prebuilt bearoff
| database from <ftp://ftp.demon.nl/pub/games/gnubg/databases/>.  Save
| two-sided databases as gnubg_ts.bd and one-sided databases as gnubg_os.bd
| in /var/lib/gnubg.
| 
| If you want gnubg to use pre-built hypergammon databases, save them in the
| same /var/lib/gnubg directory as hyperN.bd where N is the number of
| chequers.  See the man page for makehyper for more details.

(The note about the default being not to build it is incorrect, and I just
now noticed that.  It will correctly note that the default is to build the
database in the next package release.  It also looks like ftp.demon.nl
doesn't have these files any more, so I will remove that bit.)

-- 
Russ Allbery (eagle@eyrie.org)             <https://www.eyrie.org/~eagle/>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]