gammonview 3.6.2__tar.gz → 3.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gammonview-3.6.2 → gammonview-3.7.0}/CHANGELOG.md +17 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/PKG-INFO +12 -2
- {gammonview-3.6.2 → gammonview-3.7.0}/README.md +11 -1
- gammonview-3.7.0/gvanalysis/dicemap.py +322 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/position.py +32 -2
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/run_all.py +1 -0
- gammonview-3.7.0/tests/test_dicemap.py +130 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/.gitattributes +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/.github/workflows/ci.yml +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/.github/workflows/engine.yml +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/.github/workflows/publish.yml +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/.gitignore +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/.python-version +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/CLAUDE.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/CONTRIBUTING.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/LICENSE +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/THIRD-PARTY-NOTICES.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/assets/logo.png +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/docs/CLI.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/docs/METHODOLOGY.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/docs/OGXM_COMPUTED_FIELDS.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/docs/OGXM_JSON_SPEC_GAMMONVIEW.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/docs/OGXM_V2_PROFILE.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/docs/PRESET_ACCURACY.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/docs/upstream-bgsage.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/docs/v1/OGXM_FORMAT_SPEC_GAMMONVIEW.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/experiments/2026-09-16-checker-mid-tier.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/experiments/2026-09-17-checker-mid-tier-followup.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/experiments/2026-09-19-cross-machine-costs.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/experiments/2026-09-20-corpus-rerun.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/experiments/2026-10-21-wc2-corpus.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/experiments/bench.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/__init__.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/batch.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/checker_eval.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/compare_gva.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/game_eval.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/loader.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/luck.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/match.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/ogxm_reconstructor.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/parentwatch.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/positionmove.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/presets.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/progress.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/reconstruct_mat.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvanalysis/share.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvengine-js/.gitignore +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvengine-js/README.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvengine-js/bgsage.version +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvengine-js/build.sh +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvengine-js/package.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvengine-js/scripts/assets.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvengine-js/scripts/fixtures.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvengine-js/src/engine.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvengine-js/src/entry.cpp +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvengine-js/test/fixtures/parity.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvengine-js/test/parity.test.mjs +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/__init__.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/basefill.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/bgf.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/binary.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/export.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/game_reconstructor.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/legality.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/mat.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/mat_parser.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/merge.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/met.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/notation.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/ogid.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/ogxm2.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/ogxm2_passthrough.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/ogxm2_writer.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/place.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/reader.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/share.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/stats.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat/xg.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/.gitignore +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/LICENSE +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/README.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/THIRD-PARTY-NOTICES.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/cli/README.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/cli/bgf2gva.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/cli/mat2gva.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/cli/xg2gva.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/package-lock.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/package.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/basefill.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/bgf2gva.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/binary.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/constants.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/export.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/index.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/legality.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/mat2gva.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/merge.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/met.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/notation.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/og2gva.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/ogid.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/ogxm2.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/ogxm2_passthrough.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/ogxm2_writer.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/place.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/reader.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/sha256.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/share.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/stats.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/src/xg2gva.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/3WNK_g1Z-PLsh_HyvQ5j4a.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/5nqfGw9bWG3deTaU.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/B4_SrGcsKAQmoTyHlgJCbM.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/C07OQCKyw4Pe-CnjFiAMYO.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/MYdvw1qGuyaRUH__.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/Sz-2PgKnvb6aFls69-qFXg.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/UL-CV6F9jMM-E1Pu.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/XCu3RJ0UvDg_Tldl.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/baR-U643iUDpvzTC.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/eXBNG5wZHS5Alu3P.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/hQ8sVn2LbTdF4wRm.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/rK7pXm4TqLb9NzWd.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/mat/uwvEbd63UvdX7SDin5o_Iw.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/annos-docs.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/annos-edits-sha256.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/annos-sha256.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/annos.expected.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/annos.ogxm +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/bgf-writer-sha256.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/blocks-docs.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/blocks-sha256.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/blocks.expected.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/blocks.ogxm +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/cube-on-two.expected.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/cube-on-two.ogxm +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/fields-docs.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/fields-sha256.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/fields.expected.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/fields.ogxm +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/foreign.ogxm +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/gen.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/match.expected.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/match.ogxm +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/passthrough-sha256.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/resign.expected.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/resign.ogxm +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/set-up.expected.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/set-up.ogxm +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/two-blocks.expected.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/two-blocks.ogxm +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/v1-chunks.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/v23-foreign.anchors.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/v23-foreign.ogxm +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/fixtures/ogxm2/writer-sha256.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-alternative-move-steps.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-basefill.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-bearoff-excess-steps.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-bgf-alternatives.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-bgf-embedded-cube.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-bgf-move-steps.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-chunk-passthrough.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-cube-action-counting.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-equity-loss.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-illegal-move.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-illegal-play-steps.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-legality.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-mat.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-merge.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-met.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-og.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-ogid.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-ogxm2-annos.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-ogxm2-blocks.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-ogxm2-fields.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-ogxm2-limits.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-ogxm2-passthrough.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-ogxm2-writer.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-ogxm2.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-ogxm23.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-place.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-robustness.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-roundtrip.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-share.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-stats.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-xg-cube.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-xg-eval-levels.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-xg-move-steps.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/gvformat-js/test/test-xg-zero-win-eval.js +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/pyproject.toml +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/README.md +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/bgf/3WNK_g1Z-PLsh_HyvQ5j4a.bgf +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/bgf/5nqfGw9bWG3deTaU.bgf +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/bgf/B4_SrGcsKAQmoTyHlgJCbM.bgf +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/bgf/C07OQCKyw4Pe-CnjFiAMYO.bgf +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/bgf/MYdvw1qGuyaRUH__.bgf +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/bgf/Sz-2PgKnvb6aFls69-qFXg.bgf +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/bgf/UL-CV6F9jMM-E1Pu.bgf +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/bgf/XCu3RJ0UvDg_Tldl.bgf +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/bgf/baR-U643iUDpvzTC.bgf +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/bgf/eXBNG5wZHS5Alu3P.bgf +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/bgf/uwvEbd63UvdX7SDin5o_Iw.bgf +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/3WNK_g1Z-PLsh_HyvQ5j4a.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/5nqfGw9bWG3deTaU.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/B4_SrGcsKAQmoTyHlgJCbM.gva +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/B4_SrGcsKAQmoTyHlgJCbM.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/C07OQCKyw4Pe-CnjFiAMYO.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/MYdvw1qGuyaRUH__.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/Sz-2PgKnvb6aFls69-qFXg.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/UL-CV6F9jMM-E1Pu.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/XCu3RJ0UvDg_Tldl.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/baR-U643iUDpvzTC.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/eXBNG5wZHS5Alu3P.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/gv/uwvEbd63UvdX7SDin5o_Iw.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/3WNK_g1Z-PLsh_HyvQ5j4a.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/5nqfGw9bWG3deTaU.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/B4_SrGcsKAQmoTyHlgJCbM.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/C07OQCKyw4Pe-CnjFiAMYO.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/MYdvw1qGuyaRUH__.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/Sz-2PgKnvb6aFls69-qFXg.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/UL-CV6F9jMM-E1Pu.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/XCu3RJ0UvDg_Tldl.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/baR-U643iUDpvzTC.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/eXBNG5wZHS5Alu3P.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/hQ8sVn2LbTdF4wRm.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/rK7pXm4TqLb9NzWd.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/mat/uwvEbd63UvdX7SDin5o_Iw.mat +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/3WNK_g1Z-PLsh_HyvQ5j4a.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/5nqfGw9bWG3deTaU.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/B4_SrGcsKAQmoTyHlgJCbM.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/C07OQCKyw4Pe-CnjFiAMYO.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/MYdvw1qGuyaRUH__.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/Sz-2PgKnvb6aFls69-qFXg.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/UL-CV6F9jMM-E1Pu.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/XCu3RJ0UvDg_Tldl.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/baR-U643iUDpvzTC.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/eXBNG5wZHS5Alu3P.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/hQ8sVn2LbTdF4wRm.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/rK7pXm4TqLb9NzWd.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/samples/xg/uwvEbd63UvdX7SDin5o_Iw.xg +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/audit_corpus.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/fixtures.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/gen_js_v2_fixtures.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/gen_ogxm23_fixtures.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/gen_ogxm2_annos_fixtures.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/gen_ogxm2_blocks_fixtures.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/gen_ogxm2_fields_fixtures.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/gen_ogxm2_passthrough_fixtures.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/golden/3WNK_g1Z-PLsh_HyvQ5j4a.fast.gva +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/golden/3WNK_g1Z-PLsh_HyvQ5j4a.fast.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/golden/5nqfGw9bWG3deTaU.fast.gva +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/golden/5nqfGw9bWG3deTaU.fast.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/golden/B4_SrGcsKAQmoTyHlgJCbM.fast.gva +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/golden/B4_SrGcsKAQmoTyHlgJCbM.fast.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/golden/MYdvw1qGuyaRUH__.fast.gva +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/golden/MYdvw1qGuyaRUH__.fast.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/golden/PROVENANCE.json +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/golden/baR-U643iUDpvzTC.fast.gva +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/golden/baR-U643iUDpvzTC.fast.gvab +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/ogxm2_annos_cases.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/ogxm2_blocks_cases.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/ogxm2_fields_cases.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/ogxm2_oracle.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/passthrough_cases.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/regen_golden.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_alternative_move_steps.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_analysis_orientation.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_analyze_position.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_basefill.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_bearoff_excess_steps.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_bgf_alternatives.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_bgf_cube_response.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_bgf_move_steps.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_chunk_passthrough.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_count_illegal.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_cube_action_counting.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_cube_tiers.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_docs_presets.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_equity_loss.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_gvab_writer.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_illegal_move.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_illegal_play_branches.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_illegal_play_steps.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_legality.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_loader_formats.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_luck_fill.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_merge_resign.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_met.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_money_rules.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm2.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm23.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm2_annos.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm2_blocks.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm2_blocks_analysis.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm2_fields.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm2_fields_analysis.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm2_limits.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm2_passthrough.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm2_reference.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm2_writer.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm_conformance.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm_export.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm_pipeline.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_ogxm_stats.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_parent_watch.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_position_id.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_position_moves.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_presets.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_read_gvab.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_reconstruct_mat.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_resign_actor.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_resign_errors.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_restated_play_analysis.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_screened_checker.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_share_link.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_xg_cube.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_xg_eval_levels.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_xg_move_steps.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/tests/test_xg_zero_win_eval.py +0 -0
- {gammonview-3.6.2 → gammonview-3.7.0}/uv.lock +0 -0
|
@@ -13,6 +13,23 @@ when the repository was opened; they are kept because they record why things
|
|
|
13
13
|
are the way they are — particularly the breaking changes and the measurements
|
|
14
14
|
behind several design decisions. Dates are the tag dates.
|
|
15
15
|
|
|
16
|
+
## 3.7.0 — 2026-11-21
|
|
17
|
+
|
|
18
|
+
**The dice distribution of a position** *(added)*
|
|
19
|
+
|
|
20
|
+
`gvanalysis.dicemap.dice_distribution` is XG's Dice Distribution as a library
|
|
21
|
+
call. At a cube decision it gives the side on roll's equity after each of the
|
|
22
|
+
36 rolls' best plays, with each die's average; `doubled=True` gives the rolls
|
|
23
|
+
after a double and a take, in the cube before the double, so the average sits
|
|
24
|
+
beside `double_take_equity` at money and at a match score alike. At a checker
|
|
25
|
+
play it gives the opponent's replies to one play, in the mover's equity, and
|
|
26
|
+
marks each with the cube decision it leaves when the cube is the mover's to
|
|
27
|
+
turn: double/take, double/pass or too good. That is a map XG does not draw, and
|
|
28
|
+
the one that shows why one play beats another. Any n-ply level, 2-ply by
|
|
29
|
+
default: about 0.3s a map, 3s at 3-ply. `gvan-position --dice` prints it, with
|
|
30
|
+
`--play` and `--after-take`. GammonView's position analyser draws the same map
|
|
31
|
+
in the browser and is held to these numbers roll for roll.
|
|
32
|
+
|
|
16
33
|
## 3.6.2 — 2026-11-21
|
|
17
34
|
|
|
18
35
|
**An illegal play is flagged wherever it lands** *(fixed)*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: gammonview
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.7.0
|
|
4
4
|
Summary: Backgammon match analysis — the pure-Python OGXM/GVA codec (`gvformat`) plus bgsage-powered match and position analysis (`gvanalysis`).
|
|
5
5
|
Project-URL: Homepage, https://github.com/gammonview/gammonview-analysis
|
|
6
6
|
Project-URL: Repository, https://github.com/gammonview/gammonview-analysis
|
|
@@ -189,7 +189,7 @@ Entry points are defined in `pyproject.toml` and run with `uv run`:
|
|
|
189
189
|
|---|---|
|
|
190
190
|
| `gvan-match` | Analyze a match (`.xg`, `.bgf`, `.mat`, `.gva`/`.ogxm`, `.gvab`), compute per-move PR → `.gva`/`.gvab` |
|
|
191
191
|
| `gvan-batch` | The same over many files or a directory, one output each |
|
|
192
|
-
| `gvan-position` | Analyze a single position from an **XGID or OGID
|
|
192
|
+
| `gvan-position` | Analyze a single position from an **XGID or OGID**; `--dice` prints its dice map |
|
|
193
193
|
| `xg2gva` | Convert an eXtreme Gammon `.xg` file to `.gva` JSON (no engine) |
|
|
194
194
|
| `bgf2gva` | Convert a BGBlitz `.bgf` file to `.gva` JSON (no engine) |
|
|
195
195
|
|
|
@@ -200,8 +200,18 @@ uv run gvan-match match.mat --link # print a shareable UR
|
|
|
200
200
|
uv run gvan-batch matches/ --preset fast # a dir -> its match files
|
|
201
201
|
uv run gvan-position "XGID=-b----E-C---eE---c-e----B-:0:-1:1:31:0:0:0:0"
|
|
202
202
|
uv run gvan-position "11ccccchhhjjjjj:66666888dddddoo:N0N:13:B:R:0:0:0:0"
|
|
203
|
+
uv run gvan-position "<id>" --dice # the equity after each of the 36 rolls
|
|
204
|
+
uv run gvan-position "<id>" --dice --play "13/7 8/7" # a checker play: the replies to that play
|
|
203
205
|
```
|
|
204
206
|
|
|
207
|
+
`--dice` is XG's Dice Distribution, as `gvanalysis.dicemap.dice_distribution`
|
|
208
|
+
returns it: at a cube decision the side on roll's equity after each roll's best
|
|
209
|
+
play (`--after-take` for the rolls after a double and a take, in the cube
|
|
210
|
+
before the double as D/T is), with each die's average; at a checker play the
|
|
211
|
+
opponent's replies to one play, in your equity, each marked with the cube
|
|
212
|
+
decision it leaves you (D/T, D/P, TG). Read at 2-ply by default, any n-ply
|
|
213
|
+
level with `--level`.
|
|
214
|
+
|
|
205
215
|
An input keeps any analysis it already carries — ours is appended as a new
|
|
206
216
|
block rather than replacing it. (`xg2gva`/`bgf2gva` exist for conversion on its
|
|
207
217
|
own; analysis does not need them.) `--link` encodes the whole match into a
|
|
@@ -160,7 +160,7 @@ Entry points are defined in `pyproject.toml` and run with `uv run`:
|
|
|
160
160
|
|---|---|
|
|
161
161
|
| `gvan-match` | Analyze a match (`.xg`, `.bgf`, `.mat`, `.gva`/`.ogxm`, `.gvab`), compute per-move PR → `.gva`/`.gvab` |
|
|
162
162
|
| `gvan-batch` | The same over many files or a directory, one output each |
|
|
163
|
-
| `gvan-position` | Analyze a single position from an **XGID or OGID
|
|
163
|
+
| `gvan-position` | Analyze a single position from an **XGID or OGID**; `--dice` prints its dice map |
|
|
164
164
|
| `xg2gva` | Convert an eXtreme Gammon `.xg` file to `.gva` JSON (no engine) |
|
|
165
165
|
| `bgf2gva` | Convert a BGBlitz `.bgf` file to `.gva` JSON (no engine) |
|
|
166
166
|
|
|
@@ -171,8 +171,18 @@ uv run gvan-match match.mat --link # print a shareable UR
|
|
|
171
171
|
uv run gvan-batch matches/ --preset fast # a dir -> its match files
|
|
172
172
|
uv run gvan-position "XGID=-b----E-C---eE---c-e----B-:0:-1:1:31:0:0:0:0"
|
|
173
173
|
uv run gvan-position "11ccccchhhjjjjj:66666888dddddoo:N0N:13:B:R:0:0:0:0"
|
|
174
|
+
uv run gvan-position "<id>" --dice # the equity after each of the 36 rolls
|
|
175
|
+
uv run gvan-position "<id>" --dice --play "13/7 8/7" # a checker play: the replies to that play
|
|
174
176
|
```
|
|
175
177
|
|
|
178
|
+
`--dice` is XG's Dice Distribution, as `gvanalysis.dicemap.dice_distribution`
|
|
179
|
+
returns it: at a cube decision the side on roll's equity after each roll's best
|
|
180
|
+
play (`--after-take` for the rolls after a double and a take, in the cube
|
|
181
|
+
before the double as D/T is), with each die's average; at a checker play the
|
|
182
|
+
opponent's replies to one play, in your equity, each marked with the cube
|
|
183
|
+
decision it leaves you (D/T, D/P, TG). Read at 2-ply by default, any n-ply
|
|
184
|
+
level with `--level`.
|
|
185
|
+
|
|
176
186
|
An input keeps any analysis it already carries — ours is appended as a new
|
|
177
187
|
block rather than replacing it. (`xg2gva`/`bgf2gva` exist for conversion on its
|
|
178
188
|
own; analysis does not need them.) `--link` encodes the whole match into a
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (C) 2026 Nicholas Vlamis
|
|
3
|
+
|
|
4
|
+
"""The dice distribution of a position: how each of the 36 rolls would go.
|
|
5
|
+
|
|
6
|
+
XG calls this the Dice Distribution, and its dice map is a 6x6 grid of the
|
|
7
|
+
equity after each roll. Which rolls depends on the decision:
|
|
8
|
+
|
|
9
|
+
- a **cube decision** is about the roll to come, so it is the side on roll's
|
|
10
|
+
own rolls from the board as it stands -- or, with ``doubled``, from the
|
|
11
|
+
board after a double and a take;
|
|
12
|
+
- a **checker play** is judged by what it leaves, so it is the opponent's
|
|
13
|
+
replies to one play (``play``, or the best one). That is the map XG does
|
|
14
|
+
not draw, and the one that shows *why* one play beats another: the rolls
|
|
15
|
+
that hit, or fail to. Each reply also says what it leaves us at the cube,
|
|
16
|
+
when the cube is ours to turn: double/take, double/pass, too good.
|
|
17
|
+
|
|
18
|
+
Every equity is the analysed player's, whoever rolls, so a number means the
|
|
19
|
+
same thing in both maps; a reply map's are the opponent's negated. And they
|
|
20
|
+
are on ``analyze_position``'s scale: an after-take map is in the cube *before*
|
|
21
|
+
the double, as a cube analysis's ``double_take_equity`` is, so its average sits
|
|
22
|
+
beside that number rather than half of it.
|
|
23
|
+
|
|
24
|
+
Each roll is its best play at ``level``, an n-ply search of every legal play,
|
|
25
|
+
so the weighted average is the decision's own equity one ply deeper: a 2-ply
|
|
26
|
+
map averages, to within a few hundredths, the 3-ply read. The opponent's cube
|
|
27
|
+
is not consulted before a reply: it is the rolls, as if they roll.
|
|
28
|
+
|
|
29
|
+
GammonView's position analyser draws the same map in the browser
|
|
30
|
+
(``gva/dicemap.js``), on the WASM engine's trimmed search. The two agree roll
|
|
31
|
+
for roll except where that search's cuts miss a play the full search finds
|
|
32
|
+
best, which its own tuning puts at a tie (``tests/test_dicemap.py``).
|
|
33
|
+
|
|
34
|
+
Cost is 21 checker searches, and at a checker play 21 cube decisions more: on
|
|
35
|
+
an M-series Mac about 0.3s at 2-ply and 3s at 3-ply.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
from __future__ import annotations
|
|
39
|
+
|
|
40
|
+
from typing import TYPE_CHECKING
|
|
41
|
+
|
|
42
|
+
from gvformat.met import mwc_anchors
|
|
43
|
+
from gvformat.ogid import flip_board
|
|
44
|
+
|
|
45
|
+
from .position import PositionState, parse_position_id
|
|
46
|
+
from .positionmove import _key, candidate_boards
|
|
47
|
+
|
|
48
|
+
if TYPE_CHECKING:
|
|
49
|
+
from collections.abc import Iterable
|
|
50
|
+
|
|
51
|
+
#: The levels a map can be read at: n-ply only. Rolling out each of 21 rolls
|
|
52
|
+
#: is a feature of its own, not a level of this one.
|
|
53
|
+
DICE_LEVELS = ("1ply", "2ply", "3ply", "4ply")
|
|
54
|
+
|
|
55
|
+
#: The 21 rolls, and their weight out of 36.
|
|
56
|
+
ROLLS = [(d1, d2, 1 if d1 == d2 else 2) for d1 in range(1, 7) for d2 in range(d1, 7)]
|
|
57
|
+
|
|
58
|
+
_SWAP_OWNER = {"player": "opponent", "opponent": "player"}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class DiceMapError(ValueError):
|
|
62
|
+
"""A dice map that cannot be drawn: an unknown play, or a double that
|
|
63
|
+
cannot be made."""
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _round4(x: float) -> float:
|
|
67
|
+
return round(float(x), 4)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _other_side(side: dict, board: list[int]) -> dict:
|
|
71
|
+
"""`side` (a board and its cube and score) from the other player's chair."""
|
|
72
|
+
return {
|
|
73
|
+
**side,
|
|
74
|
+
"board": flip_board(board),
|
|
75
|
+
"cube_owner": _SWAP_OWNER.get(side["cube_owner"], side["cube_owner"]),
|
|
76
|
+
"away1": side["away2"],
|
|
77
|
+
"away2": side["away1"],
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _engine_kwargs(side: dict) -> dict:
|
|
82
|
+
return {k: v for k, v in side.items() if k != "board"}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _borne_off(board: Iterable[int]) -> bool:
|
|
86
|
+
"""Whether the side on roll has no checker left: none on a point, none on
|
|
87
|
+
its bar (index 25)."""
|
|
88
|
+
board = list(board)
|
|
89
|
+
return board[25] == 0 and all(n <= 0 for n in board[:25])
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def can_double(state: PositionState) -> bool:
|
|
93
|
+
"""Whether `state` is a cube decision whose side on roll may double, and so
|
|
94
|
+
whether an after-take map means anything: not at a checker play, not with
|
|
95
|
+
the cube on the other side, not in the Crawford game."""
|
|
96
|
+
cube_decision = state.force_cube or not (state.die1 and state.die2)
|
|
97
|
+
return cube_decision and state.cube_owner in ("centered", "player") and not state.is_crawford
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _rescale(equity: float, away1: int, away2: int, frm: int, to: int) -> float:
|
|
101
|
+
"""An equity read with the cube at `frm`, restated with it at `to`, through
|
|
102
|
+
the match winning chances it stands for. Money's anchors are fixed, so
|
|
103
|
+
there it is a plain ratio; at a match score a cube level moves both."""
|
|
104
|
+
if not away1 or not away2:
|
|
105
|
+
return equity * frm / to
|
|
106
|
+
win_f, loss_f = mwc_anchors(away1, away2, frm)
|
|
107
|
+
win_t, loss_t = mwc_anchors(away1, away2, to)
|
|
108
|
+
mwc = (win_f + loss_f) / 2 + equity * (win_f - loss_f) / 2
|
|
109
|
+
return (2 * mwc - (win_t + loss_t)) / (win_t - loss_t)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def _sweep(analyzer, side: dict) -> list[dict]:
|
|
113
|
+
"""The 21 rolls of whoever is on roll in `side`, each at the roller's own
|
|
114
|
+
equity after their best play, with the board that play leaves.
|
|
115
|
+
|
|
116
|
+
A roll with no play leaves the board as it is, so it is worth the other
|
|
117
|
+
side's turn from there, negated: their no-double equity at the same depth.
|
|
118
|
+
A result reading the roller's last checker off as a loss -- 1-ply's
|
|
119
|
+
terminal misread, which luck guards against too -- is taken as a single
|
|
120
|
+
win.
|
|
121
|
+
"""
|
|
122
|
+
kwargs = _engine_kwargs(side)
|
|
123
|
+
dance = None
|
|
124
|
+
out = []
|
|
125
|
+
for d1, d2, weight in ROLLS:
|
|
126
|
+
moves = analyzer.checker_play(side["board"], d1, d2, **kwargs).moves
|
|
127
|
+
if not moves:
|
|
128
|
+
if dance is None:
|
|
129
|
+
other = _other_side(side, side["board"])
|
|
130
|
+
dance = -float(analyzer.cube_action(other["board"], **_engine_kwargs(other)).equity_nd)
|
|
131
|
+
out.append({"dice": [d1, d2], "weight": weight, "equity": dance, "board": list(side["board"])})
|
|
132
|
+
continue
|
|
133
|
+
best = moves[0]
|
|
134
|
+
equity = float(best.equity)
|
|
135
|
+
if equity < -0.9 and _borne_off(best.board):
|
|
136
|
+
equity = 1.0
|
|
137
|
+
out.append({"dice": [d1, d2], "weight": weight, "equity": equity, "board": list(best.board)})
|
|
138
|
+
return out
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def _our_cube(analyzer, ours: dict) -> str | None:
|
|
142
|
+
"""The cube decision a reply leaves us, at the rolls' own depth:
|
|
143
|
+
"double_take" or "double_pass" for a correct double, "too_good" for a
|
|
144
|
+
position that would be a pass but is better played on, None for no
|
|
145
|
+
double."""
|
|
146
|
+
action = analyzer.cube_action(ours["board"], **_engine_kwargs(ours))
|
|
147
|
+
if action.should_double:
|
|
148
|
+
return "double_take" if action.should_take else "double_pass"
|
|
149
|
+
return None if action.should_take else "too_good"
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def die_averages(rolls: list[dict]) -> list[float]:
|
|
153
|
+
"""Each die's average over the 6x6 grid: the mean of the six cells in its
|
|
154
|
+
column, so of the 11 rolls showing that number with the double counted
|
|
155
|
+
once. The six together average to the map's own average."""
|
|
156
|
+
equity = {tuple(r["dice"]): r["equity"] for r in rolls}
|
|
157
|
+
return [
|
|
158
|
+
_round4(sum(equity[(min(d, e), max(d, e))] for e in range(1, 7)) / 6)
|
|
159
|
+
for d in range(1, 7)
|
|
160
|
+
]
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def dice_distribution(
|
|
164
|
+
position_id: str,
|
|
165
|
+
*,
|
|
166
|
+
level: str = "2ply",
|
|
167
|
+
play: str | None = None,
|
|
168
|
+
doubled: bool = False,
|
|
169
|
+
analyzer=None,
|
|
170
|
+
jacoby: bool | None = None,
|
|
171
|
+
beaver: bool | None = None,
|
|
172
|
+
) -> dict:
|
|
173
|
+
"""The dice map of a position, as a dict.
|
|
174
|
+
|
|
175
|
+
``position_id`` is an XGID or an OGID, and which decision it poses is read
|
|
176
|
+
as ``analyze_position`` reads it. At a checker play ``play`` names the play
|
|
177
|
+
whose replies to map, in the notation ``analyze_position`` gives it; left
|
|
178
|
+
as None it is the best play at ``level``. At a cube decision ``doubled``
|
|
179
|
+
maps the rolls after a double and a take.
|
|
180
|
+
|
|
181
|
+
``analyzer`` is a prebuilt ``BgBotAnalyzer`` at ``level``, as for
|
|
182
|
+
``analyze_position``. ``jacoby`` and ``beaver`` are the money rules, read
|
|
183
|
+
from the id when None exactly as there.
|
|
184
|
+
|
|
185
|
+
Returns ``{"position_id", "eval_level", "roller", "doubled", "play",
|
|
186
|
+
"average", "won", "rolls", "die_averages", "elapsed"}``. ``roller`` is
|
|
187
|
+
"mover" for a cube decision and "opponent" for a checker play; ``play`` is
|
|
188
|
+
the play mapped, or None. Each of the 21 ``rolls`` is ``{"dice": [a, b]
|
|
189
|
+
(a <= b), "weight": 1 or 2 (out of 36), "equity"}``, and at a checker play
|
|
190
|
+
where the cube is ours after their roll, ``"cube"`` too (``_our_cube``).
|
|
191
|
+
A play that bears off the last checker has no replies: ``won`` is True,
|
|
192
|
+
``rolls`` is empty and ``average`` None.
|
|
193
|
+
|
|
194
|
+
Raises ``DiceMapError`` for a ``play`` that is not one (or is given at a
|
|
195
|
+
cube decision), or ``doubled`` where the side on roll cannot double;
|
|
196
|
+
``ValueError`` for another level.
|
|
197
|
+
"""
|
|
198
|
+
import time
|
|
199
|
+
|
|
200
|
+
if level not in DICE_LEVELS:
|
|
201
|
+
raise ValueError(f"level must be one of {list(DICE_LEVELS)}, got {level!r}")
|
|
202
|
+
state = parse_position_id(position_id)
|
|
203
|
+
checker = bool(state.die1 and state.die2) and not state.force_cube
|
|
204
|
+
if doubled and not can_double(state):
|
|
205
|
+
raise DiceMapError("the side on roll cannot double here")
|
|
206
|
+
if play is not None and not checker:
|
|
207
|
+
raise DiceMapError("a cube decision has no play to map the replies to")
|
|
208
|
+
|
|
209
|
+
if analyzer is None:
|
|
210
|
+
from bgsage import BgBotAnalyzer
|
|
211
|
+
analyzer = BgBotAnalyzer(eval_level=level, cubeful=True)
|
|
212
|
+
money = not state.away1 and not state.away2
|
|
213
|
+
if jacoby is None:
|
|
214
|
+
jacoby = state.jacoby if state.jacoby is not None else True
|
|
215
|
+
if beaver is None:
|
|
216
|
+
beaver = state.beaver if state.beaver is not None else True
|
|
217
|
+
ours = {
|
|
218
|
+
"board": list(state.board), "cube_value": state.cube_value, "cube_owner": state.cube_owner,
|
|
219
|
+
"away1": state.away1, "away2": state.away2, "is_crawford": state.is_crawford,
|
|
220
|
+
"jacoby": bool(jacoby) and money, "beaver": bool(beaver) and money,
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
started = time.perf_counter()
|
|
224
|
+
result = {
|
|
225
|
+
"position_id": position_id.strip(),
|
|
226
|
+
"eval_level": level,
|
|
227
|
+
"roller": "opponent" if checker else "mover",
|
|
228
|
+
"doubled": bool(doubled),
|
|
229
|
+
"play": None,
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if checker:
|
|
233
|
+
boards = candidate_boards(state)
|
|
234
|
+
if play is None:
|
|
235
|
+
from bgsage.text_export import compute_move_notation
|
|
236
|
+
best = analyzer.checker_play(state.board, state.die1, state.die2, **_engine_kwargs(ours)).moves[0]
|
|
237
|
+
after = list(best.board)
|
|
238
|
+
play = compute_move_notation(state.board, after, state.die1, state.die2)
|
|
239
|
+
else:
|
|
240
|
+
after = boards.get(_key(play))
|
|
241
|
+
if after is None:
|
|
242
|
+
raise DiceMapError(f"{play!r} is not a legal play of {state.die1}{state.die2} here")
|
|
243
|
+
result["play"] = " ".join(str(play).split())
|
|
244
|
+
roller = _other_side(ours, after)
|
|
245
|
+
# The mover's checkers, seen from the replying side, are its negatives
|
|
246
|
+
# and its bar (index 0): none left is a game already over.
|
|
247
|
+
if roller["board"][0] == 0 and all(n >= 0 for n in roller["board"]):
|
|
248
|
+
result.update(average=None, won=True, rolls=[], die_averages=[])
|
|
249
|
+
result["elapsed"] = round(time.perf_counter() - started, 3)
|
|
250
|
+
return result
|
|
251
|
+
else:
|
|
252
|
+
roller = dict(ours)
|
|
253
|
+
if doubled:
|
|
254
|
+
roller["cube_value"] = state.cube_value * 2
|
|
255
|
+
roller["cube_owner"] = "opponent"
|
|
256
|
+
|
|
257
|
+
# Our cube after their reply: ours to turn unless they own it, and not in
|
|
258
|
+
# the Crawford game. The play moved no cube, so it is as the decision had it.
|
|
259
|
+
ours_to_turn = checker and state.cube_owner in ("centered", "player") and not state.is_crawford
|
|
260
|
+
sign = -1 if checker else 1
|
|
261
|
+
rolls = []
|
|
262
|
+
for r in _sweep(analyzer, roller):
|
|
263
|
+
equity = r["equity"]
|
|
264
|
+
if doubled:
|
|
265
|
+
equity = _rescale(equity, state.away1, state.away2, roller["cube_value"], state.cube_value)
|
|
266
|
+
row = {"dice": r["dice"], "weight": r["weight"], "equity": _round4(sign * equity)}
|
|
267
|
+
if ours_to_turn:
|
|
268
|
+
row["cube"] = _our_cube(analyzer, {**ours, "board": flip_board(r["board"])})
|
|
269
|
+
rolls.append(row)
|
|
270
|
+
|
|
271
|
+
result.update(
|
|
272
|
+
average=_round4(sum(r["weight"] * r["equity"] for r in rolls) / 36),
|
|
273
|
+
won=False,
|
|
274
|
+
rolls=rolls,
|
|
275
|
+
die_averages=die_averages(rolls),
|
|
276
|
+
)
|
|
277
|
+
result["elapsed"] = round(time.perf_counter() - started, 3)
|
|
278
|
+
return result
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
_CUBE_TAG = {"double_take": "D/T", "double_pass": "D/P", "too_good": "TG"}
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
def print_dice_map(result: dict) -> None:
|
|
285
|
+
"""The map as XG lays it out: a 6x6 grid, each die's average beneath."""
|
|
286
|
+
if result["roller"] == "opponent":
|
|
287
|
+
print(f"Replies to {result['play']}, at {result['eval_level']} (your equity):")
|
|
288
|
+
else:
|
|
289
|
+
after = ", after a double and a take" if result["doubled"] else ""
|
|
290
|
+
print(f"Rolls for the side on roll{after}, at {result['eval_level']}:")
|
|
291
|
+
if result["won"]:
|
|
292
|
+
print(" The play bears off the last checker: there are no replies.")
|
|
293
|
+
return
|
|
294
|
+
by_dice = {tuple(r["dice"]): r for r in result["rolls"]}
|
|
295
|
+
tagged = any("cube" in r for r in result["rolls"])
|
|
296
|
+
width = 11 if tagged else 8
|
|
297
|
+
|
|
298
|
+
def cell(text: str) -> str:
|
|
299
|
+
return text.ljust(width)
|
|
300
|
+
|
|
301
|
+
print(" " + "".join(cell(str(d)) for d in range(1, 7)))
|
|
302
|
+
for a in range(1, 7):
|
|
303
|
+
row = []
|
|
304
|
+
for b in range(1, 7):
|
|
305
|
+
r = by_dice[(min(a, b), max(a, b))]
|
|
306
|
+
tag = _CUBE_TAG.get(r.get("cube"), "")
|
|
307
|
+
row.append(cell(f"{r['equity']:+.3f}" + (f" {tag}" if tag else "")))
|
|
308
|
+
print(f" {a} " + "".join(row))
|
|
309
|
+
print(" Avg " + "".join(cell(f"{x:+.3f}") for x in result["die_averages"]))
|
|
310
|
+
print(f" Average {result['average']:+.4f}")
|
|
311
|
+
if tagged:
|
|
312
|
+
counts = {k: 0 for k in _CUBE_TAG}
|
|
313
|
+
for r in result["rolls"]:
|
|
314
|
+
if r.get("cube"):
|
|
315
|
+
counts[r["cube"]] += r["weight"]
|
|
316
|
+
doubles = counts["double_take"] + counts["double_pass"]
|
|
317
|
+
line = f" After their reply you have a double on {doubles} of 36 rolls"
|
|
318
|
+
if counts["double_pass"]:
|
|
319
|
+
line += f", {counts['double_pass']} of them a pass (D/P)"
|
|
320
|
+
if counts["too_good"]:
|
|
321
|
+
line += f"; {counts['too_good']} are too good to double (TG)"
|
|
322
|
+
print(line + ".")
|
|
@@ -7,6 +7,7 @@ Usage:
|
|
|
7
7
|
uv run gvan-position "XGID=-b----E-C---eE---c-e----B-:0:0:1:31:0:0:0:0"
|
|
8
8
|
uv run gvan-position "11ccccchhhjjjjj:66666888dddddoo:N0N:13:B:R:0:0:0:0"
|
|
9
9
|
uv run gvan-position "<id>" --level 3ply
|
|
10
|
+
uv run gvan-position "<id>" --dice [--play "13/7 8/7"] [--after-take]
|
|
10
11
|
|
|
11
12
|
Which format was given is detected from the string itself (an explicit
|
|
12
13
|
``XGID=``/``OGID=`` label wins); see ``gvformat.ogid.looks_like_ogid``.
|
|
@@ -494,8 +495,8 @@ def main() -> None:
|
|
|
494
495
|
"position_id",
|
|
495
496
|
help="XGID or OGID string (format detected; XGID=/OGID= prefix optional)")
|
|
496
497
|
parser.add_argument(
|
|
497
|
-
"--level", default=
|
|
498
|
-
help="Eval level (default: 3ply)")
|
|
498
|
+
"--level", default=None, choices=EVAL_LEVELS,
|
|
499
|
+
help="Eval level (default: 3ply; 2ply with --dice)")
|
|
499
500
|
parser.add_argument(
|
|
500
501
|
"--jacoby", action=argparse.BooleanOptionalAction, default=None,
|
|
501
502
|
help="Money games: analyse with or without the Jacoby rule, gammons "
|
|
@@ -507,11 +508,27 @@ def main() -> None:
|
|
|
507
508
|
help="Money games: allow or forbid beavers. Default: what the id says "
|
|
508
509
|
"-- an XGID's rules field -- and allowed for an OGID. Ignored at a "
|
|
509
510
|
"match score")
|
|
511
|
+
parser.add_argument(
|
|
512
|
+
"--dice", action="store_true",
|
|
513
|
+
help="Print the dice map instead (gvanalysis.dicemap): at a cube "
|
|
514
|
+
"decision the equity after each of the 36 rolls, at a checker play "
|
|
515
|
+
"the opponent's replies to a play. n-ply levels only")
|
|
516
|
+
parser.add_argument(
|
|
517
|
+
"--play", default=None,
|
|
518
|
+
help="With --dice at a checker play: the play whose replies to map, as "
|
|
519
|
+
"the analysis names it (default: the best play)")
|
|
520
|
+
parser.add_argument(
|
|
521
|
+
"--after-take", action="store_true",
|
|
522
|
+
help="With --dice at a cube decision: the rolls after a double and a take")
|
|
510
523
|
parser.add_argument(
|
|
511
524
|
"--no-progress", action="store_true",
|
|
512
525
|
help="Suppress the rollout progress bar (it is stderr-only and already "
|
|
513
526
|
"a no-op when stderr is not a TTY)")
|
|
514
527
|
args = parser.parse_args()
|
|
528
|
+
if args.level is None:
|
|
529
|
+
args.level = "2ply" if args.dice else "3ply"
|
|
530
|
+
if (args.play or args.after_take) and not args.dice:
|
|
531
|
+
parser.error("--play and --after-take go with --dice")
|
|
515
532
|
|
|
516
533
|
fmt = "OGID" if looks_like_ogid(args.position_id) else "XGID"
|
|
517
534
|
state = parse_position_id(args.position_id)
|
|
@@ -525,6 +542,19 @@ def main() -> None:
|
|
|
525
542
|
print(f"Position ({fmt}): cube={state.cube_value} ({state.cube_owner}) {context}"
|
|
526
543
|
+ (" [Crawford]" if state.is_crawford else ""))
|
|
527
544
|
|
|
545
|
+
if args.dice:
|
|
546
|
+
from .dicemap import DICE_LEVELS, DiceMapError, dice_distribution, print_dice_map
|
|
547
|
+
if args.level not in DICE_LEVELS:
|
|
548
|
+
parser.error(f"--dice reads at {', '.join(DICE_LEVELS)}; rolling out each roll is not supported")
|
|
549
|
+
try:
|
|
550
|
+
result = dice_distribution(args.position_id, level=args.level, play=args.play,
|
|
551
|
+
doubled=args.after_take, jacoby=jacoby, beaver=beaver)
|
|
552
|
+
except DiceMapError as e:
|
|
553
|
+
parser.error(str(e))
|
|
554
|
+
print_dice_map(result)
|
|
555
|
+
print(f"\nAnalysis time: {time.perf_counter() - t0:.2f}s")
|
|
556
|
+
return
|
|
557
|
+
|
|
528
558
|
# A rollout at this CLI is a deliberate minutes-long run, and until now it
|
|
529
559
|
# printed nothing at all until it finished. The bar lives on stderr, so
|
|
530
560
|
# piping the report somewhere stays clean.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (C) 2026 Nicholas Vlamis
|
|
3
|
+
|
|
4
|
+
"""``dice_distribution`` -- the equity after each of the 36 rolls.
|
|
5
|
+
|
|
6
|
+
What is worth pinning is that the map agrees with the analysis it explains,
|
|
7
|
+
not the engine's numbers, which other tests own:
|
|
8
|
+
|
|
9
|
+
1. **A cube map averages the decision.** Each roll read at 2-ply makes the
|
|
10
|
+
weighted average the no-double equity at 3-ply, to a few hundredths.
|
|
11
|
+
2. **An after-take map is in the cube before the double.** Its average sits
|
|
12
|
+
beside ``double_take_equity`` (beavers off: a beavered D/T is a cube at
|
|
13
|
+
four), at money and at a match score, where cube levels do not scale.
|
|
14
|
+
3. **A reply map is the mover's equity.** Its average sits near the play's
|
|
15
|
+
own 3-ply equity -- above it where the opponent would double first, which
|
|
16
|
+
the map does not consult.
|
|
17
|
+
4. **The cube marks appear only where the cube is ours to turn.**
|
|
18
|
+
5. **A bad request is a ``DiceMapError``**, an unknown level a ``ValueError``.
|
|
19
|
+
|
|
20
|
+
Requires the bgsage engine (the ``[engine]`` extra).
|
|
21
|
+
|
|
22
|
+
Run directly:
|
|
23
|
+
uv run python tests/test_dicemap.py (exit 0 = all passed)
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
from __future__ import annotations
|
|
27
|
+
|
|
28
|
+
import sys
|
|
29
|
+
from pathlib import Path
|
|
30
|
+
|
|
31
|
+
_REPO_ROOT = Path(__file__).resolve().parent.parent
|
|
32
|
+
sys.path.insert(0, str(_REPO_ROOT))
|
|
33
|
+
|
|
34
|
+
from gvanalysis.dicemap import DiceMapError, dice_distribution
|
|
35
|
+
from gvanalysis.position import analyze_position
|
|
36
|
+
|
|
37
|
+
_checks = 0
|
|
38
|
+
_failures: list[str] = []
|
|
39
|
+
|
|
40
|
+
NEAR = 0.04
|
|
41
|
+
|
|
42
|
+
#: Cube decisions: money, centred; money, ours; a match score.
|
|
43
|
+
CUBE_MONEY = "3cccccehhhjjjjj:1666677888dddlo:N0N::W:C:0:0:0:0"
|
|
44
|
+
CUBE_OURS = "00ccccchhhjjjjj:22446677888abfm:W1N::B:C:1:1:1:0"
|
|
45
|
+
CUBE_MATCH = "ccccchiijjjllnn:33444566688ddoo:N0N::B:C:5:3:9:0"
|
|
46
|
+
#: Checker plays: a match score, cube centred; money, their cube; a last roll.
|
|
47
|
+
CHECKER_MATCH = "cceeeehhjjjkkkm:1123344666ggllo:N0N:43:B:R:2:1:7:0"
|
|
48
|
+
CHECKER_THEIRS = "33ccjjjkkmmnooo:22244555666677e:B1N:11:B:R:1:3:4:0"
|
|
49
|
+
CHECKER_LAST = "jjkln:25:W1N:54:W:R:0:0:0:0"
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def check(cond: bool, label: str) -> None:
|
|
53
|
+
global _checks
|
|
54
|
+
_checks += 1
|
|
55
|
+
if not cond:
|
|
56
|
+
_failures.append(label)
|
|
57
|
+
print(f" FAIL: {label}")
|
|
58
|
+
else:
|
|
59
|
+
print(f" ok: {label}")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def raises(fn, error, label: str) -> None:
|
|
63
|
+
try:
|
|
64
|
+
fn()
|
|
65
|
+
except error:
|
|
66
|
+
check(True, label)
|
|
67
|
+
else:
|
|
68
|
+
check(False, f"{label} (no {error.__name__})")
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def main() -> int:
|
|
72
|
+
print("1. a cube map averages the 3-ply no-double equity")
|
|
73
|
+
for ogid in (CUBE_MONEY, CUBE_OURS, CUBE_MATCH):
|
|
74
|
+
dice = dice_distribution(ogid)
|
|
75
|
+
read = analyze_position(ogid)
|
|
76
|
+
check(dice["roller"] == "mover" and len(dice["rolls"]) == 21, f"21 rolls for the mover: {ogid}")
|
|
77
|
+
check(sum(r["weight"] for r in dice["rolls"]) == 36, "weights out of 36")
|
|
78
|
+
gap = dice["average"] - read["cube"]["no_double_equity"]
|
|
79
|
+
check(abs(gap) < NEAR, f"average within {NEAR} of ND ({gap:+.4f})")
|
|
80
|
+
check(abs(sum(dice["die_averages"]) / 6 - dice["average"]) < 1e-3, "die averages make the average")
|
|
81
|
+
|
|
82
|
+
print("2. an after-take map is in the cube before the double")
|
|
83
|
+
for ogid in (CUBE_MONEY, CUBE_OURS, CUBE_MATCH):
|
|
84
|
+
dice = dice_distribution(ogid, doubled=True, beaver=False)
|
|
85
|
+
read = analyze_position(ogid, beaver=False)
|
|
86
|
+
gap = dice["average"] - read["cube"]["double_take_equity"]
|
|
87
|
+
check(dice["doubled"] and abs(gap) < NEAR, f"average within {NEAR} of D/T ({gap:+.4f}): {ogid}")
|
|
88
|
+
|
|
89
|
+
print("3. a reply map is the mover's equity after the play")
|
|
90
|
+
read = analyze_position(CHECKER_MATCH)
|
|
91
|
+
best = read["alternatives"][0]
|
|
92
|
+
dice = dice_distribution(CHECKER_MATCH, play=best["notation"])
|
|
93
|
+
check(dice["roller"] == "opponent" and dice["play"] == best["notation"], "the replies to the play named")
|
|
94
|
+
gap = dice["average"] - best["equity"]
|
|
95
|
+
# Above, by up to their cube's worth; below, only by depth.
|
|
96
|
+
check(-NEAR < gap < 0.25, f"average near the play's 3-ply equity ({gap:+.4f})")
|
|
97
|
+
default = dice_distribution(CHECKER_MATCH)
|
|
98
|
+
check(default["play"] is not None and default["rolls"], "no play named maps the best play's replies")
|
|
99
|
+
last = dice_distribution(CHECKER_LAST, play="5/off 2/off")
|
|
100
|
+
check(last["won"] and last["rolls"] == [] and last["average"] is None,
|
|
101
|
+
"a play bearing off the last checker has no replies")
|
|
102
|
+
|
|
103
|
+
print("4. cube marks only where the cube is ours to turn")
|
|
104
|
+
marks = [r.get("cube") for r in dice["rolls"]]
|
|
105
|
+
check(all("cube" in r for r in dice["rolls"]), "a centred cube: every reply says")
|
|
106
|
+
check(set(marks) <= {None, "double_take", "double_pass", "too_good"}, "in the four values")
|
|
107
|
+
check(any(marks), "this position leaves doubles after some replies")
|
|
108
|
+
theirs = dice_distribution(CHECKER_THEIRS)
|
|
109
|
+
check(not any("cube" in r for r in theirs["rolls"]), "their cube: no marks")
|
|
110
|
+
check(not any("cube" in r for r in dice_distribution(CUBE_MONEY)["rolls"]), "a cube map: no marks")
|
|
111
|
+
|
|
112
|
+
print("5. a request the position cannot satisfy is a DiceMapError")
|
|
113
|
+
raises(lambda: dice_distribution(CHECKER_MATCH, play="24/1"), DiceMapError, "a play the position does not offer")
|
|
114
|
+
raises(lambda: dice_distribution(CUBE_MONEY, play="8/5 6/5"), DiceMapError, "a play at a cube decision")
|
|
115
|
+
raises(lambda: dice_distribution(CHECKER_MATCH, doubled=True), DiceMapError, "after a take, at a checker play")
|
|
116
|
+
raises(lambda: dice_distribution("3cccccehhhjjjjj:1666677888dddlo:W1N::W:C:0:0:0:0", doubled=True),
|
|
117
|
+
DiceMapError, "after a take, with their cube")
|
|
118
|
+
raises(lambda: dice_distribution(CUBE_MONEY, level="truncated2"), ValueError, "a rollout level")
|
|
119
|
+
|
|
120
|
+
print(f"\n{_checks - len(_failures)}/{_checks} checks passed.")
|
|
121
|
+
if _failures:
|
|
122
|
+
print("FAILURES:")
|
|
123
|
+
for f in _failures:
|
|
124
|
+
print(f" - {f}")
|
|
125
|
+
return 1
|
|
126
|
+
return 0
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
if __name__ == "__main__":
|
|
130
|
+
raise SystemExit(main())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|