Skip to content

smooth leaves by sample support, not cube root#98

Merged
andy-k merged 2 commits into
mainfrom
census-smooth-sample-floor
Jul 17, 2026
Merged

smooth leaves by sample support, not cube root#98
andy-k merged 2 commits into
mainfrom
census-smooth-sample-floor

Conversation

@andy-k

@andy-k andy-k commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

When a leave has too few samples to trust its mean, the generator borrows a value from its
one-tile-swap neighbors. The old rule smoothed a leave when its draw-weighted count fell
below the cube root of the total -- a weight that counts how often the leave can be drawn,
not how many racks were actually sampled. It smoothed about 80% of leaves even when every
one was well covered, replacing measured values with borrowed ones for no reason.

Gate on the raw sample support instead: the total sampled count of the racks feeding a
leave, against a floor (WOLGES_GENERATE_SMOOTH_MIN, default 50).

Changes

  • Smooth on raw sample support rather than the cube root of the draw-weighted total.
  • Report how many leaves were smoothed and what share of the table that is, so a run that
    smooths nearly everything says so instead of doing it silently.
  • Document the new knob, and re-measure the section's figures against the rule that ships.

Correctness

The old "smoothed and unsmoothed play the same" figures were measured under the cube-root
rule and describe a table nobody builds now. Re-measured across the game count, each table
against its unsmoothed twin over a million game pairs:

games        leaves smoothed   smoothed side won
50,000            89%               51.61   certain
200,000           76%               50.32   certain
1,000,000         52%               50.03   not resolved
5,000,000         26%               50.00   dead level
20,000,000         0%               identical file

Every row at or above 50, none below.

Test plan

  • 20,000,000-game summary: english-generate and english-generate-no-smooth produce a
    byte-identical klv2 (nothing is thin, so nothing is smoothed).

andy-k and others added 2 commits July 16, 2026 01:33
When a leave has too few samples to trust its mean, the generator
borrows a value from its one-tile-swap neighbors -- smoothing. The old
rule smoothed a leave when its draw-weighted count fell below the cube
root of the total. That weight counts how often the leave can be drawn,
not how many racks were actually sampled, so the rule smoothed about
80% of leaves even when every one was well covered -- pulling them
toward their neighbors for no reason.

Gate on the raw sample support instead: the total sampled count of the
racks that feed the leave, against a fixed floor
(WOLGES_GENERATE_SMOOTH_MIN, default 50). A well-sampled leave is now
never smoothed; only a genuinely thin tail is filled in. The no-smooth
path is untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The smoothing section still reported that smoothed and unsmoothed
tables are a tie, at about 49.99 with 57 percent confidence. Those
numbers were measured against the cube-root rule, which the previous
commit replaced. They describe a table nobody builds any more:
cube-root smoothed most of the table whether or not it needed it, so
the comparison was between two heavily-altered tables, not between
smoothing and its absence.

Measured again against the rule that ships. The answer is sharper
than a tie and points the other way: smoothing either wins outright
or does nothing at all, and never costs anything. At 50000 games,
where four leaves in five are too thin to trust, smoothed beats
unsmoothed 51.6144 to 48.3856 over a million game pairs at 100
percent confidence. At 200000 games the lead narrows to 50.3209,
still at 100 percent. At 20000000 games nothing is thin, nothing is
smoothed, and the two commands write a byte-identical klv2. The
advantage fades exactly as the thin leaves do -- 89 percent of
leaves smoothed at 50000, 76 percent at 200000, none at 20000000 --
which is what a rule that only touches what it should looks like.

Say so, and say why the choice barely is one. Below some volume the
unsmoothed table does not merely carry noisier values -- for a leave
no game ever dealt it has no value to report, and one has to be
invented either way. The old figures are kept in parentheses,
labelled as belonging to the rule they measured, rather than dropped
outright.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@andy-k
andy-k merged commit 2b5dc11 into main Jul 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant