Hi,

I am currently implementing and testing related changes to makehyper
locally, so I will mainly comment on point 3.

Recent changes to makehyper do not alter the .bd file format
itself. Fixes such as nearest rounding in WriteProb(), clearing
HYPER_ILLEGAL, and checkpoint-related fixes also maintain the current
format. On the other hand, I would like to improve the numerical values
of the generated hypergammon database a bit further.

Currently, I have implemented and am testing the following two changes locally:

 1. Compiling makehyper with -fno-fast-math
 2. Changing the iterative calculations in makehyper from float to double

While gnubg uses -ffast-math for standard builds with GCC, makehyper is
a program that converges iterative calculations to generate a database,
so I believe prioritizing floating-point calculation stability and
reproducibility over calculation speed is better here. In fact, in my
local tests, I confirmed that even with the 1-checker database, there is
a difference in the generated results between -ffast-math and
-fno-fast-math.

Also, while .bd stores probabilities in 24 bits, currently the iterative
calculations leading up to writing to the database are also performed
using float. By using double for internal calculations, we can avoid the
issue where single-precision arithmetic itself limits convergence
accuracy, independently of the precision of the storage format.

These two changes will not alter the .bd file format. Furthermore,
existing databases can still be loaded for restarts. However, if the
calculation method is improved and allowed to fully converge, the
content of the generated data will not necessarily be identical to what
is currently distributed.

Therefore, in the sense of writing code that assumes the .bd file
format, I don't think you need to wait at least for the changes I am
currently making. On the other hand, in terms of which hyper1-3.bd to
bundle with the Android port, it might be better to wait a little
longer.

If I can confirm that sufficiently reproducible convergence results can
be obtained with -fno-fast-math and internal double calculations, I
think there is a possibility of using the database generated by this
method as the official future distribution of hyper1-3.bd.

For reference, I have already created a hyper3.bd calculated to
convergence using makehyper with internal double calculations, and I am
currently distributing it personally mainly for Japanese hypergammon
players. It is NON-OFFICIAL gnubg database, but it was generated using
the current .bd format.

  <https://pub-2a02dacc60224822915d27e72e3e59ff.r2.dev/hyper3.bd>

hyper1.bd and hyper2.bd are also located in the same place.
  <https://pub-2a02dacc60224822915d27e72e3e59ff.r2.dev/hyper2.bd>
  <https://pub-2a02dacc60224822915d27e72e3e59ff.r2.dev/hyper1.bd>

Feel free to use them for testing on Android as well.


If you are interested in norm of delta, please check out the following
article (Japanese).
  
<https://note.com/kaoru6/n/n8d8616db1745?hl-en#08b9d1eb-b3be-43ae-a453-f1cfb5d67b67>


The two changes (-no-fast-math and internal double calculations) are
already implemented locally and are currently under testing. I have
prepared them as separate patches and was planning to post them to the
mailing list before pushing.

Since the MET selection method and the hypergammon MET itself are
separate issues, I have only commented on the parts related to makehyper
and .bd here.


"Peter Lemken (clavierhaus GmbH)" <[email protected]> writes:
> Hello, A user of the Android port has asked for hypergammon as a
> playable variant and has offered something that belongs here rather
> than downstream: match equity tables for hypergammon for matches up to
> 9 points, prepared with the stated goal of having gnubg evaluate
> hypergammon match play more accurately. His name is Valeriy
> (valera7890ok-cpu on the port's tracker); I have asked him to bring
> the tables and their derivation to this list himself, since the data
> is his. The design question underneath the offer is gnubg's own. MET
> selection is global -- InitMatchEquity() installs one table into
> aafMET/miCurrent -- while the variation is chosen separately by "set
> variation". A hypergammon match is therefore cubed against a table
> built for the standard game, whose gammon and backgammon rates do not
> apply. I am willing to do the work rather than only ask for it, in
> whichever shape the project prefers:   - a patch making MET selection
> variation-aware, the table following     "set variation" and falling
> back to the current global choice when no     variant table is
> installed, with the standard game unchanged.     Confined to
> matchequity.c and set.c, in the style of the timecontrol     patch I
> sent in July -- nothing in matchstate or any file format      touched;
> or   - a documentation patch stating the mismatch plainly, which is
> cheaper     and may well be the right answer. Before writing either I
> need three rulings:   1. Whether a hypergammon MET is wanted in met/
> at all, and under what      validation and provenance standard.  
> 2. Whether per-variation selection is welcome in principle, or whether
>      MET is deliberately a user choice and should stay one.  
> 3. Whether the .bd format is stable enough to build against now. This
>      month's makehyper.c work (rounding on write, HYPER_ILLEGAL
> clearing,      checkpoint handling) and e6efa104's refusal of a
> hypergammon      variation without its database suggest the area is
> moving; I will      wait if it is. One piece of downstream context,
> because it is why I cannot answer this locally: the port ships no
> bearoff database today (pbc1 falls back to the heuristic), so
> hypergammon there would mean bundling hyper1-3.bd -- whether those are
> redistributable, and their size in the current format, I could not
> establish from the tree. I can also offer ARM64/Android testing for
> anything in this area. Best regards, Peter

-- 
TAKAHASHI Kaoru

Reply via email to