Part of #26: a read-through of core/atlas/model.py with a test for each piece, on small made-up datasets whose answers are worked out by hand in the comments. No bugs found; no code changes.
tests/core/test_model.py, 20 tests:
Back-off. Counts at every context level, stopping at the first missing step; weights (reporting bias) scale counts and 0 drops a run; each level is shrunk toward the one above (e.g. East = [7, 4, 1, 1] / 13 with alpha 12); an unseen context returns exactly its parent.
Concentration (empirical Bayes). Routes that differ get a small alpha, routes that don't get a large one; the guard (a roll seen only one way is pooled fully); no context levels keeps the default; distinct levels aren't fitted.
The shadow's gate.gate_open; runs through a closed gate don't count; a closed gate always gives otherwise; through the solver, no Black without investigating and helping.
First attempt. Each attempt is its own roll with a one-run prior (checked against the hand value); the givens and their published names; the solver's Black is much higher on a first attempt.
Bonds.can_bond (the Greens' Orange/Brown swoop-in, nothing else) and encounter odds count only possible bonds.
Random numbers. xorshift matches the JavaScript model's first value; Dirichlet draws average to the counts; lgamma matches Python's.
Part of #26: a read-through of `core/atlas/model.py` with a test for each piece, on small made-up datasets whose answers are worked out by hand in the comments. No bugs found; no code changes.
`tests/core/test_model.py`, 20 tests:
- **Back-off.** Counts at every context level, stopping at the first missing step; weights (reporting bias) scale counts and 0 drops a run; each level is shrunk toward the one above (e.g. East = [7, 4, 1, 1] / 13 with alpha 12); an unseen context returns exactly its parent.
- **Concentration (empirical Bayes).** Routes that differ get a small alpha, routes that don't get a large one; the guard (a roll seen only one way is pooled fully); no context levels keeps the default; `distinct` levels aren't fitted.
- **The shadow's gate.** `gate_open`; runs through a closed gate don't count; a closed gate always gives `otherwise`; through the solver, no Black without investigating and helping.
- **First attempt.** Each attempt is its own roll with a one-run prior (checked against the hand value); the givens and their published names; the solver's Black is much higher on a first attempt.
- **Bonds.** `can_bond` (the Greens' Orange/Brown swoop-in, nothing else) and encounter odds count only possible bonds.
- **Random numbers.** xorshift matches the JavaScript model's first value; Dirichlet draws average to the counts; `lgamma` matches Python's.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
The hierarchical back-off, the empirical-Bayes concentration and its one-outcome
guard, the shadow's gate (counting and solving), which bonds an encounter allows,
the first-attempt given with its token prior, and the reproducible random numbers.
Expected values are worked out by hand in the comments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #26: a read-through of
core/atlas/model.pywith a test for each piece, on small made-up datasets whose answers are worked out by hand in the comments. No bugs found; no code changes.tests/core/test_model.py, 20 tests:distinctlevels aren't fitted.gate_open; runs through a closed gate don't count; a closed gate always givesotherwise; through the solver, no Black without investigating and helping.can_bond(the Greens' Orange/Brown swoop-in, nothing else) and encounter odds count only possible bonds.lgammamatches Python's.🤖 Generated with Claude Code