[Top][All Lists]

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

Re: [Bug-gnubg] Idea for encoding 2-sided database

From: Joern Thyssen
Subject: Re: [Bug-gnubg] Idea for encoding 2-sided database
Date: Tue, 29 Mar 2005 11:25:31 +0000
User-agent: Mutt/

On Tue, Mar 29, 2005 at 10:11:39AM +0200, Jim Segrave wrote
> I'm not at all sure what the structure of the bearoff files is. You
> might be right that there's a separate index with pointers, 

Only for the one-sided databases.

> in which
> case it would be possible to have a value indicating no data (or
> pointing to a common entry). I think it might be time for a bit of
> scripting to see how many duplicate entries there are (gin being just
> one possibility).

For the two-sided databases the structure is straightforward:

(1) a header with some information about the database (number of
chequers, number of points, etc)
(2) bearoff equities

The positions have a defined ordering and four two-bytes values are
stored for each position: cubeless, centered, owned, and unavailable.

You may be able to save some storage by not storing gin-positions and/or
reusing positions with identical equities, e.g., -----5 vs 5----- and
-----6 vs 6-----. Also note that due to lazy programming the files even
contain positions where one side has zero chequers.

Still, I tend to agree with Joseph: I don't think we'll be able to save
much storage. 

For completeness:

the structure for the one-sided databases:

(1) a header
(2) index with pointers (one-dimensional indexed by PositionID)
(3) one sided bearoff distributions (offset and length determinted by

Note that bearoff.c understands several encodings. For example, you can
use two-sided bearoff databases with only cubeless equities, and you can
use one-sided bearoff databases without the index, and other variants.
The structures described above are for the default encodings used by
gnubg_ts.bd and gnubg_os.bd.


Attachment: pgpG76vT8mQjv.pgp
Description: PGP signature

reply via email to

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