gammonview 3.2.0__tar.gz → 3.4.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.2.0 → gammonview-3.4.0}/CHANGELOG.md +44 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/PKG-INFO +1 -1
- {gammonview-3.2.0 → gammonview-3.4.0}/docs/OGXM_V2_PROFILE.md +27 -1
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/game_eval.py +34 -2
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/luck.py +4 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/match.py +4 -1
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/basefill.py +15 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/met.py +102 -3
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/ogxm2.py +42 -5
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/ogxm2_passthrough.py +16 -6
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/ogxm2_writer.py +76 -8
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/package-lock.json +2 -2
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/package.json +2 -2
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/basefill.js +15 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/met.js +80 -3
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/ogxm2.js +43 -7
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/ogxm2_passthrough.js +11 -5
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/ogxm2_writer.js +70 -10
- gammonview-3.4.0/gvformat-js/test/fixtures/ogxm2/annos-docs.json +1 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/annos-sha256.json +4 -4
- gammonview-3.4.0/gvformat-js/test/fixtures/ogxm2/blocks-docs.json +1 -0
- gammonview-3.4.0/gvformat-js/test/fixtures/ogxm2/blocks-sha256.json +42 -0
- gammonview-3.4.0/gvformat-js/test/fixtures/ogxm2/blocks.expected.json +1 -0
- gammonview-3.4.0/gvformat-js/test/fixtures/ogxm2/blocks.ogxm +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/passthrough-sha256.json +2 -2
- gammonview-3.4.0/gvformat-js/test/fixtures/ogxm2/v23-foreign.anchors.json +2447 -0
- gammonview-3.4.0/gvformat-js/test/fixtures/ogxm2/v23-foreign.ogxm +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/writer-sha256.json +14 -14
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2.js +2 -2
- gammonview-3.4.0/gvformat-js/test/test-ogxm23.js +131 -0
- gammonview-3.4.0/tests/gen_ogxm23_fixtures.py +119 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/golden/3WNK_g1Z-PLsh_HyvQ5j4a.fast.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/golden/5nqfGw9bWG3deTaU.fast.gvab +0 -0
- gammonview-3.4.0/tests/golden/B4_SrGcsKAQmoTyHlgJCbM.fast.gva +1 -0
- gammonview-3.4.0/tests/golden/B4_SrGcsKAQmoTyHlgJCbM.fast.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/golden/MYdvw1qGuyaRUH__.fast.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/golden/PROVENANCE.json +1 -1
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/golden/baR-U643iUDpvzTC.fast.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/ogxm2_blocks_cases.py +31 -0
- gammonview-3.4.0/tests/test_money_rules.py +157 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm2.py +2 -2
- gammonview-3.4.0/tests/test_ogxm23.py +250 -0
- gammonview-3.2.0/gvformat-js/test/fixtures/ogxm2/annos-docs.json +0 -1
- gammonview-3.2.0/gvformat-js/test/fixtures/ogxm2/blocks-docs.json +0 -1
- gammonview-3.2.0/gvformat-js/test/fixtures/ogxm2/blocks-sha256.json +0 -42
- gammonview-3.2.0/gvformat-js/test/fixtures/ogxm2/blocks.expected.json +0 -1
- gammonview-3.2.0/gvformat-js/test/fixtures/ogxm2/blocks.ogxm +0 -0
- gammonview-3.2.0/tests/golden/B4_SrGcsKAQmoTyHlgJCbM.fast.gva +0 -1
- gammonview-3.2.0/tests/golden/B4_SrGcsKAQmoTyHlgJCbM.fast.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/.gitattributes +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/.github/workflows/ci.yml +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/.github/workflows/engine.yml +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/.github/workflows/publish.yml +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/.gitignore +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/.python-version +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/CLAUDE.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/CONTRIBUTING.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/LICENSE +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/README.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/THIRD-PARTY-NOTICES.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/assets/logo.png +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/docs/CLI.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/docs/METHODOLOGY.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/docs/OGXM_COMPUTED_FIELDS.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/docs/OGXM_JSON_SPEC_GAMMONVIEW.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/docs/PRESET_ACCURACY.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/docs/upstream-bgsage.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/docs/v1/OGXM_FORMAT_SPEC_GAMMONVIEW.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/experiments/2026-09-16-checker-mid-tier.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/experiments/2026-09-17-checker-mid-tier-followup.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/experiments/2026-09-19-cross-machine-costs.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/experiments/2026-09-20-corpus-rerun.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/experiments/2026-10-21-wc2-corpus.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/experiments/bench.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/__init__.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/batch.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/checker_eval.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/compare_gva.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/loader.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/ogxm_reconstructor.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/parentwatch.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/position.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/presets.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/progress.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/reconstruct_mat.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvanalysis/share.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/__init__.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/bgf.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/binary.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/export.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/game_reconstructor.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/legality.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/mat.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/mat_parser.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/merge.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/notation.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/ogid.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/place.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/reader.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/share.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/stats.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat/xg.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/.gitignore +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/LICENSE +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/README.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/THIRD-PARTY-NOTICES.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/cli/README.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/cli/bgf2gva.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/cli/mat2gva.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/cli/xg2gva.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/bgf2gva.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/binary.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/constants.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/export.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/index.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/legality.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/mat2gva.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/merge.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/notation.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/og2gva.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/ogid.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/place.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/reader.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/sha256.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/share.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/stats.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/src/xg2gva.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/3WNK_g1Z-PLsh_HyvQ5j4a.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/5nqfGw9bWG3deTaU.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/B4_SrGcsKAQmoTyHlgJCbM.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/C07OQCKyw4Pe-CnjFiAMYO.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/MYdvw1qGuyaRUH__.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/Sz-2PgKnvb6aFls69-qFXg.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/UL-CV6F9jMM-E1Pu.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/XCu3RJ0UvDg_Tldl.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/baR-U643iUDpvzTC.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/eXBNG5wZHS5Alu3P.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/hQ8sVn2LbTdF4wRm.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/rK7pXm4TqLb9NzWd.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/uwvEbd63UvdX7SDin5o_Iw.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/annos-edits-sha256.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/annos.expected.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/annos.ogxm +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/bgf-writer-sha256.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/cube-on-two.expected.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/cube-on-two.ogxm +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/fields-docs.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/fields-sha256.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/fields.expected.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/fields.ogxm +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/foreign.ogxm +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/gen.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/match.expected.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/match.ogxm +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/resign.expected.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/resign.ogxm +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/set-up.expected.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/set-up.ogxm +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/two-blocks.expected.json +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/two-blocks.ogxm +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/v1-chunks.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-alternative-move-steps.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-basefill.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-bgf-alternatives.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-bgf-embedded-cube.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-bgf-move-steps.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-chunk-passthrough.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-equity-loss.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-illegal-move.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-illegal-play-steps.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-legality.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-mat.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-merge.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-met.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-og.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-ogid.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-annos.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-blocks.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-fields.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-limits.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-passthrough.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-writer.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-place.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-robustness.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-roundtrip.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-share.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-stats.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-xg-cube.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-xg-eval-levels.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-xg-move-steps.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/gvformat-js/test/test-xg-zero-win-eval.js +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/pyproject.toml +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/README.md +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/bgf/3WNK_g1Z-PLsh_HyvQ5j4a.bgf +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/bgf/5nqfGw9bWG3deTaU.bgf +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/bgf/B4_SrGcsKAQmoTyHlgJCbM.bgf +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/bgf/C07OQCKyw4Pe-CnjFiAMYO.bgf +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/bgf/MYdvw1qGuyaRUH__.bgf +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/bgf/Sz-2PgKnvb6aFls69-qFXg.bgf +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/bgf/UL-CV6F9jMM-E1Pu.bgf +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/bgf/XCu3RJ0UvDg_Tldl.bgf +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/bgf/baR-U643iUDpvzTC.bgf +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/bgf/eXBNG5wZHS5Alu3P.bgf +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/bgf/uwvEbd63UvdX7SDin5o_Iw.bgf +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/3WNK_g1Z-PLsh_HyvQ5j4a.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/5nqfGw9bWG3deTaU.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/B4_SrGcsKAQmoTyHlgJCbM.gva +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/B4_SrGcsKAQmoTyHlgJCbM.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/C07OQCKyw4Pe-CnjFiAMYO.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/MYdvw1qGuyaRUH__.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/Sz-2PgKnvb6aFls69-qFXg.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/UL-CV6F9jMM-E1Pu.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/XCu3RJ0UvDg_Tldl.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/baR-U643iUDpvzTC.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/eXBNG5wZHS5Alu3P.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/gv/uwvEbd63UvdX7SDin5o_Iw.gvab +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/3WNK_g1Z-PLsh_HyvQ5j4a.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/5nqfGw9bWG3deTaU.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/B4_SrGcsKAQmoTyHlgJCbM.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/C07OQCKyw4Pe-CnjFiAMYO.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/MYdvw1qGuyaRUH__.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/Sz-2PgKnvb6aFls69-qFXg.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/UL-CV6F9jMM-E1Pu.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/XCu3RJ0UvDg_Tldl.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/baR-U643iUDpvzTC.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/eXBNG5wZHS5Alu3P.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/hQ8sVn2LbTdF4wRm.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/rK7pXm4TqLb9NzWd.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/mat/uwvEbd63UvdX7SDin5o_Iw.mat +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/3WNK_g1Z-PLsh_HyvQ5j4a.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/5nqfGw9bWG3deTaU.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/B4_SrGcsKAQmoTyHlgJCbM.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/C07OQCKyw4Pe-CnjFiAMYO.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/MYdvw1qGuyaRUH__.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/Sz-2PgKnvb6aFls69-qFXg.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/UL-CV6F9jMM-E1Pu.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/XCu3RJ0UvDg_Tldl.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/baR-U643iUDpvzTC.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/eXBNG5wZHS5Alu3P.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/hQ8sVn2LbTdF4wRm.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/rK7pXm4TqLb9NzWd.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/samples/xg/uwvEbd63UvdX7SDin5o_Iw.xg +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/audit_corpus.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/fixtures.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/gen_js_v2_fixtures.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/gen_ogxm2_annos_fixtures.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/gen_ogxm2_blocks_fixtures.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/gen_ogxm2_fields_fixtures.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/gen_ogxm2_passthrough_fixtures.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/golden/3WNK_g1Z-PLsh_HyvQ5j4a.fast.gva +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/golden/5nqfGw9bWG3deTaU.fast.gva +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/golden/MYdvw1qGuyaRUH__.fast.gva +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/golden/baR-U643iUDpvzTC.fast.gva +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/ogxm2_annos_cases.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/ogxm2_fields_cases.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/ogxm2_oracle.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/passthrough_cases.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/regen_golden.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/run_all.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_alternative_move_steps.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_analysis_orientation.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_analyze_position.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_basefill.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_bgf_alternatives.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_bgf_cube_response.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_bgf_move_steps.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_chunk_passthrough.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_count_illegal.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_cube_tiers.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_docs_presets.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_equity_loss.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_gvab_writer.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_illegal_move.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_illegal_play_steps.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_legality.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_loader_formats.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_luck_fill.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_merge_resign.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_met.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm2_annos.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm2_blocks.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm2_blocks_analysis.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm2_fields.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm2_fields_analysis.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm2_limits.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm2_passthrough.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm2_reference.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm2_writer.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm_conformance.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm_export.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm_pipeline.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_ogxm_stats.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_parent_watch.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_position_id.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_presets.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_read_gvab.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_reconstruct_mat.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_resign_actor.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_resign_errors.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_restated_play_analysis.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_screened_checker.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_share_link.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_xg_cube.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_xg_eval_levels.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_xg_move_steps.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/tests/test_xg_zero_win_eval.py +0 -0
- {gammonview-3.2.0 → gammonview-3.4.0}/uv.lock +0 -0
|
@@ -13,6 +13,50 @@ 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.4.0 — 2026-11-13
|
|
17
|
+
|
|
18
|
+
**OGXM 2.3: files with a priced forfeit load** *(fixed)*
|
|
19
|
+
|
|
20
|
+
HedgeHog's 2.3 places a `RESIGN` decision on a forfeit, and a file holding one
|
|
21
|
+
names 2.3 as its minimum reader. OpenGammon writes one for every forfeited match
|
|
22
|
+
it analyses, and `read_gvab` refused all of them ("file requires an OGXM 2.3
|
|
23
|
+
reader"). The reader is now 2.3. A forfeit's price is read past rather than
|
|
24
|
+
kept: it counts in no rating here, as a forfeit never has.
|
|
25
|
+
|
|
26
|
+
**A match block's equity table travels with it** *(added)*
|
|
27
|
+
|
|
28
|
+
2.3 lets a match block state the match equity table its MWCs were computed on
|
|
29
|
+
(`ANAL.met`), and has a reader that finds none assume Rockwell-Kazaross. We
|
|
30
|
+
convert on Kazaross-XG2, so every match-play file we wrote was read by other
|
|
31
|
+
programs on a table that was not the one its numbers came from (by up to
|
|
32
|
+
0.0007 MWC, at short scores). Every match block we write now states ours, cut at
|
|
33
|
+
the match length; such a file has `version_minor` 3 and is still loaded by a 2.2
|
|
34
|
+
reader. Another producer's block that states its table -- OpenGammon's, since
|
|
35
|
+
October 2026, on Rockwell-Kazaross -- is now converted on that table rather than
|
|
36
|
+
ours, and keeps it when rewritten. The clock's rule and extra-time grants (also
|
|
37
|
+
2.3) are read and written.
|
|
38
|
+
|
|
39
|
+
Behaviour change: the bytes of every match-play file we write change, and the
|
|
40
|
+
goldens are regenerated for it; no equity in them moves.
|
|
41
|
+
|
|
42
|
+
## 3.3.0 — 2026-11-05
|
|
43
|
+
|
|
44
|
+
**A money session is analysed under the rules it was played under** *(fixed)*
|
|
45
|
+
|
|
46
|
+
`analyze_file` read a session's Jacoby and beaver rules and wrote them into the
|
|
47
|
+
summary, but passed neither to the engine, so every money session was judged
|
|
48
|
+
under bgsage's defaults, both on, whatever the file said. A session played
|
|
49
|
+
without Jacoby had its gammons counted with the cube centred, which moves cube
|
|
50
|
+
verdicts, checker equities, error sizes and PR across the whole session; one
|
|
51
|
+
played without beavers had a wrong double answered with a beaver. Every engine
|
|
52
|
+
call a decision makes now gets the session's rules, and so does `fill_luck`.
|
|
53
|
+
Match play is unaffected: it has neither rule.
|
|
54
|
+
|
|
55
|
+
Behaviour change: a money session whose file says Jacoby or beavers are off is
|
|
56
|
+
now analysed that way. The money golden, a session with neither, is
|
|
57
|
+
regenerated; its first game no longer has a missed double, which the v2 format
|
|
58
|
+
cases now write in rather than find.
|
|
59
|
+
|
|
16
60
|
## 3.2.0 — 2026-11-04
|
|
17
61
|
|
|
18
62
|
**`analyze_position` takes the money rules: Jacoby and beavers** *(added)*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: gammonview
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.4.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
|
|
@@ -8,6 +8,13 @@ and finds every decision v2 has a field for. This document says how our
|
|
|
8
8
|
document maps onto v2, what travels outside v2's fields, and where reading a
|
|
9
9
|
file back gives something other than what was written.
|
|
10
10
|
|
|
11
|
+
Both read and write **2.3**. Of 2.3's additions we write two -- a match block's
|
|
12
|
+
table (`ANAL.met`) and the clock's rule and grants -- and each raises
|
|
13
|
+
`version_minor` to 3 but not `min_reader_minor`, so a 2.2 reader still loads
|
|
14
|
+
everything we write. A file that also holds a decision only 2.3 places (a
|
|
15
|
+
forfeit's `RESIGN`, a decision on an illegal play) has `min_reader_minor` 3, and
|
|
16
|
+
before 2.3 our reader refused it; OpenGammon writes priced forfeits.
|
|
17
|
+
|
|
11
18
|
`read_gvab` reads v1 and v2 alike. v1 stays readable for good — files and share
|
|
12
19
|
links written before 2.0.0 are v1 — and `write_gvab_v1` keeps the old writer for
|
|
13
20
|
tests and comparison. The GVAN chunk and the rest of
|
|
@@ -97,6 +104,7 @@ One `ANAL` + `DECS` per analysis block, primary first.
|
|
|
97
104
|
| `analysis_info.ply` | the block level's `checker_ply` |
|
|
98
105
|
| `analysis_info.eval_level` | see Levels |
|
|
99
106
|
| `analysis_info.met_id` | `met_id`. A match block without one is written as `kazaross-xg2`, the table we convert with |
|
|
107
|
+
| `analysis_info.met` | `met` (6.6, 2.3): `{pre_crawford, post_crawford?}`, the leader's match winning chances at six places. Present only on another producer's block; ours is cut from our table on write (see Units) |
|
|
100
108
|
| (no `currency` key) | `cubeful match` (MWC) in a match, `cubeful money` in a money session |
|
|
101
109
|
| `level` (block, decision, alternative) | the full level record (6.4) — preset, depths, the rollout's trials, truncation, seed (a decimal string), ... — kept only where the labels below do not already give it |
|
|
102
110
|
|
|
@@ -122,6 +130,22 @@ worst over the samples), and our reader gives back BGBlitz's normalized
|
|
|
122
130
|
equities exactly. XG needs nothing of this: it stores normalized equities only,
|
|
123
131
|
and its default table is ours.
|
|
124
132
|
|
|
133
|
+
**A stored table (2.3).** A block may state the table its MWCs were computed
|
|
134
|
+
on, cut at the match length (`met`, spec 6.6). Without one, the spec has a
|
|
135
|
+
reader assume OGX's own, Rockwell-Kazaross, which is not ours -- so every match
|
|
136
|
+
block we write now states ours, Kazaross-XG2 cut at K (the most points either
|
|
137
|
+
side needed at the start; a 2- to 25-point match), unless a source's frame stood
|
|
138
|
+
in for our table on any of its plies or the block names another table (BGBlitz's
|
|
139
|
+
does both). The document does not carry it: our own block reads back without
|
|
140
|
+
`met`, and the writer cuts it again. Another producer's block that stores a
|
|
141
|
+
table -- OpenGammon's, on Rockwell-Kazaross -- converts on that table instead of
|
|
142
|
+
ours: each ply's frame is read off it and put on the ply as `mwc_frame`, exactly
|
|
143
|
+
as a `.bgf`'s are, so a rewrite converts back through the same frames, states
|
|
144
|
+
them in `frame=`, and writes the table back with them. A foreign block without
|
|
145
|
+
a table still converts on ours; the spec's Rockwell-Kazaross default is not
|
|
146
|
+
applied, because our own files written before 2.3 carry no table either and
|
|
147
|
+
were converted on ours.
|
|
148
|
+
|
|
125
149
|
**Levels.** v2 states a level at three tiers — block, decision, alternative —
|
|
126
150
|
each overriding only what differs (L1). Our labels (`2ply`, `truncated2`,
|
|
127
151
|
`rollout`, `database`, ...) are v2's `preset`, which is a free label (L3). The
|
|
@@ -178,7 +202,7 @@ there. **Resignations** are `RESIGN` records. **Luck** is a `ROLL` record on
|
|
|
178
202
|
every dice ply that has it. A beaver is analyzed as the take it answers, at the
|
|
179
203
|
cube before the double; the raccoon after it carries no decision.
|
|
180
204
|
|
|
181
|
-
**Clock, video and annotations.** `CLCK` is `clock_info` (its settings: the four numbers, `flags` as the header byte stores it when not 0, and `precision` when not 10) with
|
|
205
|
+
**Clock, video and annotations.** `CLCK` is `clock_info` (its settings: the four numbers, `flags` as the header byte stores it when not 0, `rule` (`opengammon`, or the id of a rule we do not know) and `grants` (`[white, black]`) when stated (2.3, 8.2), and `precision` when not 10) with
|
|
182
206
|
`timestamp_ms` on each ply; `VIDO` is `video_info` with `video_ms`, `wall_ms`,
|
|
183
207
|
`behind_live_ms` and `video_hand_anchored` on each marked ply (the spec's
|
|
184
208
|
Appendix A.3 names); `ANNO` records other than ours are `annotations` lists —
|
|
@@ -244,6 +268,8 @@ decisions where the document says otherwise, each as its `ply_ref` and a letter:
|
|
|
244
268
|
| no-first-move | a game with no play has no first mover to derive |
|
|
245
269
|
| luck-level | a block with no luck has no luck level |
|
|
246
270
|
| met-id | a match block names its table: `kazaross-xg2` when the document named none |
|
|
271
|
+
| met-ours | a match block on our table stores it (`met`, 2.3) and reads back without it in the document; a foreign block's table reads back as it was |
|
|
272
|
+
| forfeit-resign | another producer's `RESIGN` on a forfeit is read past rather than kept; a rewrite that re-encodes its block drops it |
|
|
247
273
|
| mwc-frame | a source's frame (`mwc_frame`, §2) is carried by v2 only; v1 loses it |
|
|
248
274
|
| default-omitted | a value equal to v2's default is not written, so it reads back absent: `variant` 0, a 0-0 `score_start`, `initial_cube_value` 1, `initial_cube_owner` 2 (centred), `auto_doubles` 0 or false, `rules_other` 0, a false flag, an empty string |
|
|
249
275
|
| site-is-stated | `site` reads back exactly as written, and a document with none reads back with none, whatever its `city` or `platform` |
|
|
@@ -140,6 +140,8 @@ def _compute_luck(
|
|
|
140
140
|
verbose: bool = False,
|
|
141
141
|
postroll_eq: float | None = None,
|
|
142
142
|
hint_eq: float | None = None,
|
|
143
|
+
jacoby: bool = True,
|
|
144
|
+
beaver: bool = True,
|
|
143
145
|
) -> tuple[float, float] | tuple[None, None]:
|
|
144
146
|
"""Return (luck, preroll_equity).
|
|
145
147
|
|
|
@@ -170,6 +172,9 @@ def _compute_luck(
|
|
|
170
172
|
roll, given I am the one on roll", which silently discards the roll-off that
|
|
171
173
|
decided *who* is on roll. Positive luck means the actual dice were above
|
|
172
174
|
average for the mover.
|
|
175
|
+
|
|
176
|
+
`jacoby` and `beaver` are the session's money rules, as for every other
|
|
177
|
+
engine call in a match; bgsage ignores them at a match score.
|
|
173
178
|
"""
|
|
174
179
|
if list(board) == list(STARTING_BOARD):
|
|
175
180
|
preroll = _opening_baseline(away1, away2, cube_value, is_crawford)
|
|
@@ -179,6 +184,7 @@ def _compute_luck(
|
|
|
179
184
|
board, die1, die2,
|
|
180
185
|
cube_value=cube_value, cube_owner=cube_owner,
|
|
181
186
|
away1=away1, away2=away2, is_crawford=is_crawford,
|
|
187
|
+
jacoby=jacoby, beaver=beaver,
|
|
182
188
|
)
|
|
183
189
|
moves = list(result.moves)
|
|
184
190
|
postroll_eq = float(moves[0].equity) if moves else 0.0
|
|
@@ -197,6 +203,7 @@ def _compute_luck(
|
|
|
197
203
|
board, d1, d2,
|
|
198
204
|
cube_value=cube_value, cube_owner=cube_owner,
|
|
199
205
|
away1=away1, away2=away2, is_crawford=is_crawford,
|
|
206
|
+
jacoby=jacoby, beaver=beaver,
|
|
200
207
|
)
|
|
201
208
|
moves = list(result.moves)
|
|
202
209
|
except Exception as e:
|
|
@@ -273,6 +280,18 @@ class _EvalCtx:
|
|
|
273
280
|
# pass's 2T.
|
|
274
281
|
analyzer_cube: "BgBotAnalyzer | None" = None
|
|
275
282
|
level_display_cube: str | None = None
|
|
283
|
+
# The session's money rules. Defaulted to bgsage's own, both on, but a
|
|
284
|
+
# match passes what its file states: until 3.3.0 nothing did, and every
|
|
285
|
+
# money session was judged under Jacoby and beavers whatever it was played
|
|
286
|
+
# under.
|
|
287
|
+
jacoby: bool = True
|
|
288
|
+
beaver: bool = True
|
|
289
|
+
|
|
290
|
+
def rules(self, dec: dict) -> dict:
|
|
291
|
+
"""The money rules for one decision's engine calls, as keywords.
|
|
292
|
+
Match play has neither, as `checker_eval.checker_play` also says."""
|
|
293
|
+
money = not dec["away1"] and not dec["away2"]
|
|
294
|
+
return {"jacoby": self.jacoby and money, "beaver": self.beaver and money}
|
|
276
295
|
|
|
277
296
|
@property
|
|
278
297
|
def cube_analyzer(self) -> "BgBotAnalyzer":
|
|
@@ -397,6 +416,7 @@ def _eval_cube_decision(dec: dict, ctx: _EvalCtx) -> _DecResult:
|
|
|
397
416
|
away1=dec["away1"],
|
|
398
417
|
away2=dec["away2"],
|
|
399
418
|
is_crawford=dec["is_crawford"],
|
|
419
|
+
**ctx.rules(dec),
|
|
400
420
|
)
|
|
401
421
|
|
|
402
422
|
top = ctx.cube_analyzer
|
|
@@ -693,14 +713,15 @@ def _eval_resign_decision(dec: dict, ctx: _EvalCtx) -> _DecResult:
|
|
|
693
713
|
analyzer, dec["board"], dice[0], dice[1],
|
|
694
714
|
cube_value=dec["cube_value"], cube_owner=dec["cube_owner"],
|
|
695
715
|
away1=dec["away1"], away2=dec["away2"], is_crawford=dec["is_crawford"],
|
|
696
|
-
seed=seen[-1] if seen else None)
|
|
716
|
+
seed=seen[-1] if seen else None, **ctx.rules(dec))
|
|
697
717
|
seen.append(r)
|
|
698
718
|
best = list(r.moves)[0]
|
|
699
719
|
e_roll, level, probs = float(best.equity), best.eval_level, best.probs
|
|
700
720
|
else:
|
|
701
721
|
r = analyzer.cube_action(
|
|
702
722
|
dec["board"], cube_value=dec["cube_value"], cube_owner=dec["cube_owner"],
|
|
703
|
-
away1=dec["away1"], away2=dec["away2"], is_crawford=dec["is_crawford"]
|
|
723
|
+
away1=dec["away1"], away2=dec["away2"], is_crawford=dec["is_crawford"],
|
|
724
|
+
**ctx.rules(dec))
|
|
704
725
|
nd = float(r.equity_nd)
|
|
705
726
|
e_roll = max(nd, min(float(r.equity_dt), float(r.equity_dp))) if can_double else nd
|
|
706
727
|
level, probs = r.eval_level, r.probs
|
|
@@ -811,6 +832,7 @@ def _eval_checker_decision(dec: dict, ctx: _EvalCtx) -> _DecResult:
|
|
|
811
832
|
away1=dec["away1"],
|
|
812
833
|
away2=dec["away2"],
|
|
813
834
|
is_crawford=dec["is_crawford"],
|
|
835
|
+
**ctx.rules(dec),
|
|
814
836
|
)
|
|
815
837
|
forced_moves = list(forced_result.moves)
|
|
816
838
|
if forced_moves:
|
|
@@ -849,6 +871,7 @@ def _eval_checker_decision(dec: dict, ctx: _EvalCtx) -> _DecResult:
|
|
|
849
871
|
away2=dec["away2"],
|
|
850
872
|
is_crawford=dec["is_crawford"],
|
|
851
873
|
force_boards=[dec["board_played"]],
|
|
874
|
+
**ctx.rules(dec),
|
|
852
875
|
)
|
|
853
876
|
cheap_moves = list(cheap_result.moves)
|
|
854
877
|
if len(cheap_moves) >= 2:
|
|
@@ -887,6 +910,7 @@ def _eval_checker_decision(dec: dict, ctx: _EvalCtx) -> _DecResult:
|
|
|
887
910
|
force_boards=[dec["board_played"]],
|
|
888
911
|
seed=seed,
|
|
889
912
|
seed_window=window,
|
|
913
|
+
**ctx.rules(dec),
|
|
890
914
|
)
|
|
891
915
|
|
|
892
916
|
def played_error(move_list) -> float | None:
|
|
@@ -999,6 +1023,8 @@ def _eval_checker_decision(dec: dict, ctx: _EvalCtx) -> _DecResult:
|
|
|
999
1023
|
away1=dec["away1"],
|
|
1000
1024
|
away2=dec["away2"],
|
|
1001
1025
|
is_crawford=dec["is_crawford"],
|
|
1026
|
+
# bgsage takes no beaver rule here.
|
|
1027
|
+
jacoby=ctx.rules(dec)["jacoby"],
|
|
1002
1028
|
)
|
|
1003
1029
|
played_eq = post.cubeful_equity
|
|
1004
1030
|
checker_err = max(0.0, best_eq - played_eq)
|
|
@@ -1028,6 +1054,8 @@ def _eval_checker_decision(dec: dict, ctx: _EvalCtx) -> _DecResult:
|
|
|
1028
1054
|
away1=dec["away1"],
|
|
1029
1055
|
away2=dec["away2"],
|
|
1030
1056
|
is_crawford=dec["is_crawford"],
|
|
1057
|
+
# bgsage takes no beaver rule here.
|
|
1058
|
+
jacoby=ctx.rules(dec)["jacoby"],
|
|
1031
1059
|
)
|
|
1032
1060
|
played_eq = float(post.cubeful_equity)
|
|
1033
1061
|
checker_err = max(0.0, best_eq - played_eq)
|
|
@@ -1138,6 +1166,7 @@ def _eval_checker_decision(dec: dict, ctx: _EvalCtx) -> _DecResult:
|
|
|
1138
1166
|
dec["cube_value"], dec["cube_owner"],
|
|
1139
1167
|
dec["away1"], dec["away2"], dec["is_crawford"],
|
|
1140
1168
|
_luck_az, verbose=ctx.verbose,
|
|
1169
|
+
**ctx.rules(dec),
|
|
1141
1170
|
postroll_eq=None, # use the 1-ply (luck-level) post-roll, not the preset best_eq,
|
|
1142
1171
|
hint_eq=_hint, # so luck is preset-independent (hint_eq still guards sign errors)
|
|
1143
1172
|
)
|
|
@@ -1255,6 +1284,7 @@ def evaluate_game(game: dict, analyzer: BgBotAnalyzer, recon: dict,
|
|
|
1255
1284
|
level: str = "3ply", level_cube: str | None = None,
|
|
1256
1285
|
all_moves: bool = False,
|
|
1257
1286
|
count_illegal: bool = False,
|
|
1287
|
+
jacoby: bool = True, beaver: bool = True,
|
|
1258
1288
|
progress: "Callable[[], None] | None" = None) -> dict:
|
|
1259
1289
|
"""Evaluate all decisions in one game. Returns per-player error/decision counts and move log.
|
|
1260
1290
|
|
|
@@ -1262,6 +1292,7 @@ def evaluate_game(game: dict, analyzer: BgBotAnalyzer, recon: dict,
|
|
|
1262
1292
|
entry) supplying the decisions and game result; `game` carries only the
|
|
1263
1293
|
per-game metadata (number, starting scores) used for reporting.
|
|
1264
1294
|
`progress`, if given, is called once per decision processed (for a bar).
|
|
1295
|
+
`jacoby` and `beaver` are the session's money rules (`_EvalCtx.rules`).
|
|
1265
1296
|
"""
|
|
1266
1297
|
level_display = _LEVEL_DISPLAY.get(level, level)
|
|
1267
1298
|
decisions = recon["decisions"]
|
|
@@ -1281,6 +1312,7 @@ def evaluate_game(game: dict, analyzer: BgBotAnalyzer, recon: dict,
|
|
|
1281
1312
|
analyzer_cube=analyzer_cube,
|
|
1282
1313
|
level_display_cube=(None if level_cube is None
|
|
1283
1314
|
else _LEVEL_DISPLAY.get(level_cube, level_cube)),
|
|
1315
|
+
jacoby=jacoby, beaver=beaver,
|
|
1284
1316
|
)
|
|
1285
1317
|
|
|
1286
1318
|
results: "list[_DecResult]" = []
|
|
@@ -101,6 +101,8 @@ def fill_luck(ogxm: dict, *, analyzer=None, on_progress=None, verbose: bool = Fa
|
|
|
101
101
|
from bgsage import BgBotAnalyzer
|
|
102
102
|
analyzer = BgBotAnalyzer(eval_level=LUCK_LEVEL, cubeful=True)
|
|
103
103
|
|
|
104
|
+
jacoby = bool(ogxm.get("jacoby"))
|
|
105
|
+
beaver = bool(ogxm.get("beaver"))
|
|
104
106
|
filled = 0
|
|
105
107
|
for done, (ply, wanting) in enumerate(todo, start=1):
|
|
106
108
|
try:
|
|
@@ -121,6 +123,8 @@ def fill_luck(ogxm: dict, *, analyzer=None, on_progress=None, verbose: bool = Fa
|
|
|
121
123
|
state.cube_value, cube_owner,
|
|
122
124
|
state.away1, state.away2, state.crawford,
|
|
123
125
|
analyzer, verbose=verbose, hint_eq=hint,
|
|
126
|
+
# An OGID carries no money rules; the match states them.
|
|
127
|
+
jacoby=jacoby, beaver=beaver,
|
|
124
128
|
)
|
|
125
129
|
if luck is not None:
|
|
126
130
|
for analysis in wanting:
|
|
@@ -221,7 +221,7 @@ _WORKER: dict = {}
|
|
|
221
221
|
|
|
222
222
|
def _worker_init(base_level, base_level_cube, mid_level_checker, mid_level_cube, level,
|
|
223
223
|
level_cube, thresholds, resign_errors, all_moves, count_illegal,
|
|
224
|
-
level_display, engine_threads, verbose) -> None:
|
|
224
|
+
level_display, engine_threads, verbose, rules) -> None:
|
|
225
225
|
# First, before any weights are loaded: from here on this process holds
|
|
226
226
|
# hundreds of megabytes, and if the parent dies hard nothing else will ever
|
|
227
227
|
# tell it to let go. See `parentwatch`.
|
|
@@ -260,6 +260,7 @@ def _worker_init(base_level, base_level_cube, mid_level_checker, mid_level_cube,
|
|
|
260
260
|
level_display=level_display,
|
|
261
261
|
level_display_cube=(None if level_cube is None
|
|
262
262
|
else _LEVEL_DISPLAY.get(level_cube, level_cube)),
|
|
263
|
+
jacoby=rules[0], beaver=rules[1],
|
|
263
264
|
)
|
|
264
265
|
|
|
265
266
|
|
|
@@ -606,6 +607,7 @@ def analyze_ogxm(
|
|
|
606
607
|
level=level, level_cube=level_cube,
|
|
607
608
|
all_moves=all_moves,
|
|
608
609
|
count_illegal=count_illegal,
|
|
610
|
+
jacoby=jacoby_rule, beaver=beaver_rule,
|
|
609
611
|
progress=advance)
|
|
610
612
|
game_results.append(r)
|
|
611
613
|
if not quiet:
|
|
@@ -625,6 +627,7 @@ def analyze_ogxm(
|
|
|
625
627
|
base_level_r, base_level_cube, mid_level_checker, mid_level_cube, level,
|
|
626
628
|
level_cube, (close_checker, close_cube, err_checker, err_cube), p.resign_errors, all_moves,
|
|
627
629
|
count_illegal, _LEVEL_DISPLAY.get(level, level), worker_threads, verbose,
|
|
630
|
+
(jacoby_rule, beaver_rule),
|
|
628
631
|
)
|
|
629
632
|
buckets: "list[list[tuple[int, object]]]" = [[] for _ in recons]
|
|
630
633
|
with ProcessPoolExecutor(max_workers=n_jobs, initializer=_worker_init,
|
|
@@ -190,6 +190,21 @@ def frame_perspective_is_white(ply: dict) -> bool:
|
|
|
190
190
|
return ply.get("color") != 1 if answering else ply.get("color") == 1
|
|
191
191
|
|
|
192
192
|
|
|
193
|
+
def met_frame(ply: dict, table) -> list[float] | None:
|
|
194
|
+
"""The source frame ``[mid, half]`` a block's stored table (``met_table``)
|
|
195
|
+
gives this ply, at the eight places a ``frame=`` item carries -- the form
|
|
196
|
+
``mwc_frame``'s ``frame`` and a ply's ``mwc_frame`` take -- or None where
|
|
197
|
+
there is no match-play frame or the table does not reach the score."""
|
|
198
|
+
key = frame_key(ply)
|
|
199
|
+
if key is None:
|
|
200
|
+
return None
|
|
201
|
+
anchors = mwc_anchors(key[0], key[1], key[2], key[3], table)
|
|
202
|
+
if anchors is None or anchors[0] == anchors[1]:
|
|
203
|
+
return None
|
|
204
|
+
mwc_win, mwc_lose = anchors
|
|
205
|
+
return [round((mwc_win + mwc_lose) / 2, 8), round((mwc_win - mwc_lose) / 2, 8)]
|
|
206
|
+
|
|
207
|
+
|
|
193
208
|
def _frame_anchors(ply: dict, frame=None) -> tuple[float, float] | None:
|
|
194
209
|
"""``(mid, span)`` of the MWC interval this ply's equities normalize over.
|
|
195
210
|
A source's ``frame`` (``[mid, half]``) replaces the table's anchors."""
|
|
@@ -127,7 +127,8 @@ def _me_post(x: int, y: int) -> float:
|
|
|
127
127
|
return KR_XG2_MET[x - 1][y - 1]
|
|
128
128
|
|
|
129
129
|
|
|
130
|
-
def mwc_anchors(away1: int, away2: int, cube_value: int, is_crawford: bool = False
|
|
130
|
+
def mwc_anchors(away1: int, away2: int, cube_value: int, is_crawford: bool = False,
|
|
131
|
+
table: "MetTable | None" = None) -> tuple[float, float] | None:
|
|
131
132
|
"""Return ``(mwc_on_win, mwc_on_loss)`` for the mover (``away1``-away) at
|
|
132
133
|
this score/cube.
|
|
133
134
|
|
|
@@ -145,20 +146,118 @@ def mwc_anchors(away1: int, away2: int, cube_value: int, is_crawford: bool = Fal
|
|
|
145
146
|
|
|
146
147
|
Money game (either side already home / non-positive away count) degenerates
|
|
147
148
|
to the trivial (1.0, 0.0) anchors.
|
|
149
|
+
|
|
150
|
+
``table`` is another producer's table, as :func:`met_table` reads it from a
|
|
151
|
+
block that stores one; ``None`` is ours. Returns ``None`` where ``table``
|
|
152
|
+
does not reach the score.
|
|
148
153
|
"""
|
|
149
154
|
if away1 <= 0 or away2 <= 0:
|
|
150
155
|
return (1.0, 0.0)
|
|
151
156
|
if is_crawford or away1 == 1 or away2 == 1:
|
|
152
157
|
cube = 1 if is_crawford else cube_value # Crawford game: dead cube
|
|
153
|
-
me = _me_post
|
|
158
|
+
me = _me_post if table is None else table.post
|
|
154
159
|
else:
|
|
155
160
|
cube = cube_value
|
|
156
|
-
me = _me_pre
|
|
161
|
+
me = _me_pre if table is None else table.pre
|
|
162
|
+
if table is not None and max(away1, away2) > table.K:
|
|
163
|
+
return None
|
|
157
164
|
mwc_win = me(away1 - cube, away2) # mover scored `cube`
|
|
158
165
|
mwc_lose = 1.0 - me(away2 - cube, away1) # opponent scored `cube`
|
|
159
166
|
return (mwc_win, mwc_lose)
|
|
160
167
|
|
|
161
168
|
|
|
169
|
+
# ---------------------------------------------------------------------------
|
|
170
|
+
# The table a block stores (OGXM 2.3, spec 6.6)
|
|
171
|
+
# ---------------------------------------------------------------------------
|
|
172
|
+
#
|
|
173
|
+
# A match block may carry the table its numbers were computed on (``ANAL.met``),
|
|
174
|
+
# cut at K, the most points either side needed at the start. Only the leader's
|
|
175
|
+
# side is stored: ``pre_crawford`` holds P(i, j) for 1 <= i < j <= K at index
|
|
176
|
+
# (j-1)(j-2)/2 + i - 1, its 1-away row being the Crawford game's (or any game's
|
|
177
|
+
# without the rule), and ``post_crawford`` P(1, j) after the Crawford game for
|
|
178
|
+
# j = 2..K. Values are match winning chances, read and written at six places.
|
|
179
|
+
|
|
180
|
+
#: The largest K our own table can be cut at.
|
|
181
|
+
MET_MAX_AWAY = _N
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def stored_met(K: int, crawford: bool = True) -> dict | None:
|
|
185
|
+
"""Ours cut at ``K``, as a block stores it: ``{pre_crawford, post_crawford}``
|
|
186
|
+
(the second only for a match played with the Crawford rule), or ``None``
|
|
187
|
+
where there is nothing a block may store (K < 2) or our table stops short."""
|
|
188
|
+
if not isinstance(K, int) or isinstance(K, bool) or K < 2 or K > _N:
|
|
189
|
+
return None
|
|
190
|
+
pre = [round(KR_XG2_MET[i - 1][j - 1], 6) for j in range(2, K + 1) for i in range(1, j)]
|
|
191
|
+
out = {"pre_crawford": pre}
|
|
192
|
+
if crawford:
|
|
193
|
+
out["post_crawford"] = [round(1.0 - POST_CRAWFORD[j - 1], 6) for j in range(2, K + 1)]
|
|
194
|
+
return out
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def _probs(vals) -> bool:
|
|
198
|
+
return isinstance(vals, list) and all(
|
|
199
|
+
isinstance(v, (int, float)) and not isinstance(v, bool) and 0.5 <= v <= 1 for v in vals)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
class MetTable:
|
|
203
|
+
"""A block's stored table, as the resolvers :func:`mwc_anchors` takes.
|
|
204
|
+
Without ``post_crawford`` a 1-away score reads the 1-away row, as a match
|
|
205
|
+
without the Crawford rule plays every game at it."""
|
|
206
|
+
|
|
207
|
+
def __init__(self, K: int, pre: list, post: list | None):
|
|
208
|
+
self.K = K
|
|
209
|
+
self._pre = pre
|
|
210
|
+
self._post_vals = post
|
|
211
|
+
|
|
212
|
+
def _p(self, x: int, y: int) -> float:
|
|
213
|
+
if x == y:
|
|
214
|
+
return 0.5
|
|
215
|
+
if x < y:
|
|
216
|
+
return self._pre[(y - 1) * (y - 2) // 2 + x - 1]
|
|
217
|
+
return 1.0 - self._pre[(x - 1) * (x - 2) // 2 + y - 1]
|
|
218
|
+
|
|
219
|
+
def _leader_after(self, y: int) -> float:
|
|
220
|
+
return self._post_vals[y - 2] if self._post_vals is not None else self._p(1, y)
|
|
221
|
+
|
|
222
|
+
def pre(self, x: int, y: int) -> float:
|
|
223
|
+
if x <= 0:
|
|
224
|
+
return 1.0
|
|
225
|
+
if y <= 0:
|
|
226
|
+
return 0.0
|
|
227
|
+
return self._p(x, y)
|
|
228
|
+
|
|
229
|
+
def post(self, x: int, y: int) -> float:
|
|
230
|
+
if x <= 0:
|
|
231
|
+
return 1.0
|
|
232
|
+
if y <= 0:
|
|
233
|
+
return 0.0
|
|
234
|
+
if x == 1 and y == 1:
|
|
235
|
+
return 0.5
|
|
236
|
+
if x == 1:
|
|
237
|
+
return self._leader_after(y)
|
|
238
|
+
if y == 1:
|
|
239
|
+
return 1.0 - self._leader_after(x)
|
|
240
|
+
return self._p(x, y)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def met_table(stored) -> MetTable | None:
|
|
244
|
+
"""A block's stored table, or ``None`` when it is not one: a count that is
|
|
245
|
+
no K's, or a value outside [1/2, 1]."""
|
|
246
|
+
if not isinstance(stored, dict):
|
|
247
|
+
return None
|
|
248
|
+
pre = stored.get("pre_crawford")
|
|
249
|
+
if not _probs(pre) or not pre:
|
|
250
|
+
return None
|
|
251
|
+
root = (1 + 8 * len(pre)) ** 0.5
|
|
252
|
+
K = (1 + round(root)) // 2
|
|
253
|
+
if K * (K - 1) // 2 != len(pre):
|
|
254
|
+
return None
|
|
255
|
+
post = stored.get("post_crawford")
|
|
256
|
+
if post is not None and (not _probs(post) or len(post) != K - 1):
|
|
257
|
+
return None
|
|
258
|
+
return MetTable(K, pre, post)
|
|
259
|
+
|
|
260
|
+
|
|
162
261
|
def eq2mwc(equity: float, away1: int, away2: int, cube_value: int, is_crawford: bool = False) -> float:
|
|
163
262
|
"""Convert a cubeful equity to match-winning chance via the shipped MET."""
|
|
164
263
|
mwc_win, mwc_lose = mwc_anchors(away1, away2, cube_value, is_crawford)
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
Mirrors ``gvformat-js/src/ogxm2.js``; keep the two in step. The reasoning lives
|
|
8
8
|
there in full and is summarised here.
|
|
9
9
|
|
|
10
|
-
v2 (HedgeHog's ``docs/OGXM_FORMAT_SPEC.md``, 2.
|
|
10
|
+
v2 (HedgeHog's ``docs/OGXM_FORMAT_SPEC.md``, 2.3 at the time of writing) keeps
|
|
11
11
|
v1's magic and changes nearly every byte: a 16-byte header, sections with a
|
|
12
12
|
9-byte header, varint-framed records with a presence mask, plies addressed by
|
|
13
13
|
one match-wide ordinal (``ply_ref``), and one ``DECS`` section holding every
|
|
@@ -65,8 +65,9 @@ from urllib.parse import unquote
|
|
|
65
65
|
|
|
66
66
|
from .basefill import (
|
|
67
67
|
_checker_is_decision, _cube_ply_is_decision, _trivial_cube, complete_base_block,
|
|
68
|
-
frame_perspective_is_white, mwc_frame,
|
|
68
|
+
frame_perspective_is_white, met_frame, mwc_frame,
|
|
69
69
|
)
|
|
70
|
+
from .met import met_table
|
|
70
71
|
from .binary import DICE_TABLE
|
|
71
72
|
from .reader import (
|
|
72
73
|
GvabError, _attach_blocks, _cube_action_label, _derive_ogids, _eval_from_probs,
|
|
@@ -76,7 +77,7 @@ HEADER_SIZE = 16
|
|
|
76
77
|
SECTION_HEADER_SIZE = 9
|
|
77
78
|
END_MARKER = b"END!"
|
|
78
79
|
READER_MAJOR = 2
|
|
79
|
-
READER_MINOR =
|
|
80
|
+
READER_MINOR = 3
|
|
80
81
|
MAX_FILE_SIZE = 64 * 1024 * 1024
|
|
81
82
|
|
|
82
83
|
KNOWN_SECTIONS = {
|
|
@@ -113,6 +114,9 @@ KIND_ROLL = 3
|
|
|
113
114
|
|
|
114
115
|
CURRENCY_CUBEFUL_MONEY = 1
|
|
115
116
|
CURRENCY_CUBEFUL_MATCH = 2
|
|
117
|
+
CURRENCY_CUBELESS_MATCH = 3 # 9.10, 2.3
|
|
118
|
+
#: The currencies quoted in match winning chance, which a match block converts.
|
|
119
|
+
MWC_CURRENCIES = (CURRENCY_CUBEFUL_MATCH, CURRENCY_CUBELESS_MATCH)
|
|
116
120
|
|
|
117
121
|
# What v2 has no field for, carried in ANNO under the `x-` namespace the spec
|
|
118
122
|
# reserves for producers outside it (N6). See ogxm2_writer.py for what each
|
|
@@ -686,9 +690,24 @@ def _decode_anal(payload: bytes) -> dict:
|
|
|
686
690
|
a["duration_ms"] = body.varint()
|
|
687
691
|
if has(17):
|
|
688
692
|
a["sources"] = [str(uuid.UUID(bytes=body.bytes(16))) for _ in range(body.varint())]
|
|
693
|
+
if has(18):
|
|
694
|
+
a["met"] = _decode_met(body)
|
|
689
695
|
return a
|
|
690
696
|
|
|
691
697
|
|
|
698
|
+
def _decode_met(cur: _Cursor) -> dict:
|
|
699
|
+
"""[6.6] A ``met`` record: the table as six-place match winning chances."""
|
|
700
|
+
body, has = cur.record()
|
|
701
|
+
|
|
702
|
+
def table() -> list:
|
|
703
|
+
return [body.varint() / 1e6 for _ in range(body.varint())]
|
|
704
|
+
|
|
705
|
+
met: dict = {"pre_crawford": table()}
|
|
706
|
+
if has(0):
|
|
707
|
+
met["post_crawford"] = table()
|
|
708
|
+
return met
|
|
709
|
+
|
|
710
|
+
|
|
692
711
|
def _decode_alternative(cur: _Cursor) -> dict:
|
|
693
712
|
body, has = cur.record()
|
|
694
713
|
steps = [_step(body.u8()) for _ in range(body.varint())]
|
|
@@ -1587,8 +1606,12 @@ def _v1_block(anal: dict, decisions: list[dict], ply_at: list, match_length: int
|
|
|
1587
1606
|
records, which stand in for ``DECS``'s at their ply and kind, the flags to
|
|
1588
1607
|
flip, and the source frames its values were converted through."""
|
|
1589
1608
|
block_level = _resolve({}, anal.get("level"))
|
|
1590
|
-
block_mwc = match_length > 0 and anal.get("currency")
|
|
1609
|
+
block_mwc = match_length > 0 and anal.get("currency") in MWC_CURRENCIES
|
|
1591
1610
|
block_obj: dict = {}
|
|
1611
|
+
# Another producer's block that stores its table (2.3) converts on that table,
|
|
1612
|
+
# and each ply states the frame it gave, so a rewrite converts back through it.
|
|
1613
|
+
# A block of ours states its frames itself, in `frame=`.
|
|
1614
|
+
table = met_table(anal.get("met")) if ours is None and match_length > 0 else None
|
|
1592
1615
|
luck_levels: set = set()
|
|
1593
1616
|
mine = ours is not None
|
|
1594
1617
|
|
|
@@ -1606,7 +1629,7 @@ def _v1_block(anal: dict, decisions: list[dict], ply_at: list, match_length: int
|
|
|
1606
1629
|
key, ply = ply_at[d["ply_ref"]]
|
|
1607
1630
|
kind = d["kind"]
|
|
1608
1631
|
currency = d.get("currency", anal.get("currency"))
|
|
1609
|
-
mwc = (match_length > 0 and currency
|
|
1632
|
+
mwc = (match_length > 0 and currency in MWC_CURRENCIES
|
|
1610
1633
|
if kind == KIND_CUBE else block_mwc)
|
|
1611
1634
|
# A ply with no frame cannot be converted; its decision is dropped
|
|
1612
1635
|
# rather than shown in the wrong unit. A block that states the source's
|
|
@@ -1614,6 +1637,8 @@ def _v1_block(anal: dict, decisions: list[dict], ply_at: list, match_length: int
|
|
|
1614
1637
|
wire = _frame_in_force(ours["frames"], d["ply_ref"]) if mine and mwc else None
|
|
1615
1638
|
source = (frame_from_wire(*wire, frame_perspective_is_white(ply))
|
|
1616
1639
|
if wire is not None else None)
|
|
1640
|
+
if table is not None and mwc:
|
|
1641
|
+
source = met_frame(ply, table)
|
|
1617
1642
|
frame = mwc_frame(ply, source) if mwc else _IDENTITY
|
|
1618
1643
|
if frame is None:
|
|
1619
1644
|
continue
|
|
@@ -1655,6 +1680,13 @@ def _v1_block(anal: dict, decisions: list[dict], ply_at: list, match_length: int
|
|
|
1655
1680
|
if wire is not None:
|
|
1656
1681
|
obj["mwc_frame"] = frame_from_wire(*wire, frame_perspective_is_white(ply_at[ref][1]))
|
|
1657
1682
|
|
|
1683
|
+
if table is not None and block_mwc:
|
|
1684
|
+
ref_of = {k: i for i, (k, _p) in enumerate(ply_at)}
|
|
1685
|
+
for key, obj in block_obj.items():
|
|
1686
|
+
frame = met_frame(ply_at[ref_of[key]][1], table)
|
|
1687
|
+
if frame is not None:
|
|
1688
|
+
obj["mwc_frame"] = frame
|
|
1689
|
+
|
|
1658
1690
|
info: dict = {"ply": block_level.get("checker_ply") or 0}
|
|
1659
1691
|
if mine:
|
|
1660
1692
|
# The block's own label travels in its annotation when it is not the
|
|
@@ -1672,6 +1704,11 @@ def _v1_block(anal: dict, decisions: list[dict], ply_at: list, match_length: int
|
|
|
1672
1704
|
info["model_id"] = anal["model_id"]
|
|
1673
1705
|
if anal.get("met_id"):
|
|
1674
1706
|
info["met_id"] = anal["met_id"]
|
|
1707
|
+
# The table is kept where it is another producer's: a block of ours stores
|
|
1708
|
+
# our own, which the writer cuts again, unless its frames say it came from
|
|
1709
|
+
# one that was not (a foreign block we rewrote).
|
|
1710
|
+
if "met" in anal and (not mine or ours["frames"]):
|
|
1711
|
+
info["met"] = anal["met"]
|
|
1675
1712
|
info["timestamp"] = anal["started_at"] // 1000 if "started_at" in anal else 0
|
|
1676
1713
|
if anal.get("duration_ms"):
|
|
1677
1714
|
info["duration_ms"] = anal["duration_ms"]
|
|
@@ -216,9 +216,9 @@ def decode_clock(payload: bytes, ply_count: int):
|
|
|
216
216
|
else None. ``precision`` is the canonical 10 when the series is empty."""
|
|
217
217
|
if len(payload) < 29:
|
|
218
218
|
return None
|
|
219
|
-
reserve, delay, incr, start, flags = struct.unpack_from("<
|
|
219
|
+
reserve, delay, incr, start, flags, rule, white, black = struct.unpack_from("<IIIIBBBB", payload, 0)
|
|
220
220
|
length, small_bits, precision = struct.unpack_from("<IBI", payload, 20)
|
|
221
|
-
header = (reserve, delay, incr, start, flags)
|
|
221
|
+
header = (reserve, delay, incr, start, flags, rule, white, black)
|
|
222
222
|
if length == 0:
|
|
223
223
|
return (header, [0], CLOCK_PRECISION) if len(payload) == 29 else None
|
|
224
224
|
if not 1 <= small_bits <= 31 or precision == 0 or length + 1 > ply_count:
|
|
@@ -292,7 +292,8 @@ def encode_clock(header, ts: list[int], ply_count: int,
|
|
|
292
292
|
s = size(b)
|
|
293
293
|
if s < best_size:
|
|
294
294
|
best_size, best = s, b
|
|
295
|
-
|
|
295
|
+
head = tuple(header) + (0, 0, 0, 0) # a header with no rule or grants has none
|
|
296
|
+
out = bytearray(struct.pack("<IIIIBBBBIBI", *head[:8], length, best, precision))
|
|
296
297
|
per_word = 64 // best
|
|
297
298
|
for i in range(0, length, per_word):
|
|
298
299
|
word = 0
|
|
@@ -349,15 +350,24 @@ def decode_video(payload: bytes, plies_per_game: list[int]):
|
|
|
349
350
|
return (kind, flags & 1, offset, url), marks
|
|
350
351
|
|
|
351
352
|
|
|
353
|
+
#: [9.29] The clock rules 2.3 names, by id. One it does not know is kept as its id.
|
|
354
|
+
CLOCK_RULES = {1: "opengammon"}
|
|
355
|
+
|
|
356
|
+
|
|
352
357
|
def clock_doc(header, precision: int) -> dict:
|
|
353
358
|
"""The document's ``clock_info`` for a decoded header: its four numbers, the
|
|
354
|
-
``flags`` byte as stored when it is not 0,
|
|
355
|
-
|
|
356
|
-
|
|
359
|
+
``flags`` byte as stored when it is not 0, the rule the series is charged by
|
|
360
|
+
and each side's extra-time grants (2.3) when stated, and ``precision`` only
|
|
361
|
+
when it is not the canonical 10."""
|
|
362
|
+
reserve, delay, incr, start, flags, rule, white, black = header
|
|
357
363
|
out: dict = {"reserve_ms": reserve, "delay_ms": delay, "increment_ms": incr,
|
|
358
364
|
"start_timestamp": start}
|
|
359
365
|
if flags:
|
|
360
366
|
out["flags"] = flags
|
|
367
|
+
if rule:
|
|
368
|
+
out["rule"] = CLOCK_RULES.get(rule, rule)
|
|
369
|
+
if white or black:
|
|
370
|
+
out["grants"] = [white, black]
|
|
361
371
|
if precision != CLOCK_PRECISION:
|
|
362
372
|
out["precision"] = precision
|
|
363
373
|
return out
|