gammonview 3.3.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.3.0 → gammonview-3.4.0}/CHANGELOG.md +26 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/PKG-INFO +1 -1
- {gammonview-3.3.0 → gammonview-3.4.0}/docs/OGXM_V2_PROFILE.md +27 -1
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/basefill.py +15 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/met.py +102 -3
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/ogxm2.py +42 -5
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/ogxm2_passthrough.py +16 -6
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/ogxm2_writer.py +76 -8
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/package-lock.json +2 -2
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/package.json +2 -2
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/basefill.js +15 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/met.js +80 -3
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/ogxm2.js +43 -7
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/ogxm2_passthrough.js +11 -5
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/ogxm2_writer.js +70 -10
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/blocks-sha256.json +4 -4
- {gammonview-3.3.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.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/writer-sha256.json +14 -14
- {gammonview-3.3.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.3.0 → gammonview-3.4.0}/tests/golden/3WNK_g1Z-PLsh_HyvQ5j4a.fast.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/golden/5nqfGw9bWG3deTaU.fast.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/golden/MYdvw1qGuyaRUH__.fast.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/golden/PROVENANCE.json +1 -1
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/golden/baR-U643iUDpvzTC.fast.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm2.py +2 -2
- gammonview-3.4.0/tests/test_ogxm23.py +250 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/.gitattributes +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/.github/workflows/ci.yml +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/.github/workflows/engine.yml +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/.github/workflows/publish.yml +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/.gitignore +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/.python-version +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/CLAUDE.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/CONTRIBUTING.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/LICENSE +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/README.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/THIRD-PARTY-NOTICES.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/assets/logo.png +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/docs/CLI.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/docs/METHODOLOGY.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/docs/OGXM_COMPUTED_FIELDS.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/docs/OGXM_JSON_SPEC_GAMMONVIEW.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/docs/PRESET_ACCURACY.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/docs/upstream-bgsage.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/docs/v1/OGXM_FORMAT_SPEC_GAMMONVIEW.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/experiments/2026-09-16-checker-mid-tier.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/experiments/2026-09-17-checker-mid-tier-followup.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/experiments/2026-09-19-cross-machine-costs.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/experiments/2026-09-20-corpus-rerun.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/experiments/2026-10-21-wc2-corpus.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/experiments/bench.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/__init__.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/batch.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/checker_eval.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/compare_gva.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/game_eval.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/loader.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/luck.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/match.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/ogxm_reconstructor.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/parentwatch.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/position.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/presets.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/progress.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/reconstruct_mat.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvanalysis/share.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/__init__.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/bgf.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/binary.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/export.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/game_reconstructor.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/legality.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/mat.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/mat_parser.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/merge.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/notation.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/ogid.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/place.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/reader.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/share.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/stats.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat/xg.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/.gitignore +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/LICENSE +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/README.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/THIRD-PARTY-NOTICES.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/cli/README.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/cli/bgf2gva.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/cli/mat2gva.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/cli/xg2gva.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/bgf2gva.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/binary.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/constants.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/export.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/index.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/legality.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/mat2gva.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/merge.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/notation.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/og2gva.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/ogid.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/place.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/reader.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/sha256.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/share.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/stats.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/src/xg2gva.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/3WNK_g1Z-PLsh_HyvQ5j4a.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/5nqfGw9bWG3deTaU.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/B4_SrGcsKAQmoTyHlgJCbM.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/C07OQCKyw4Pe-CnjFiAMYO.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/MYdvw1qGuyaRUH__.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/Sz-2PgKnvb6aFls69-qFXg.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/UL-CV6F9jMM-E1Pu.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/XCu3RJ0UvDg_Tldl.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/baR-U643iUDpvzTC.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/eXBNG5wZHS5Alu3P.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/hQ8sVn2LbTdF4wRm.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/rK7pXm4TqLb9NzWd.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/mat/uwvEbd63UvdX7SDin5o_Iw.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/annos-docs.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/annos-edits-sha256.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/annos-sha256.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/annos.expected.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/annos.ogxm +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/bgf-writer-sha256.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/blocks-docs.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/blocks.expected.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/blocks.ogxm +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/cube-on-two.expected.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/cube-on-two.ogxm +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/fields-docs.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/fields-sha256.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/fields.expected.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/fields.ogxm +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/foreign.ogxm +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/gen.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/match.expected.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/match.ogxm +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/resign.expected.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/resign.ogxm +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/set-up.expected.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/set-up.ogxm +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/two-blocks.expected.json +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/two-blocks.ogxm +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/fixtures/ogxm2/v1-chunks.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-alternative-move-steps.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-basefill.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-bgf-alternatives.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-bgf-embedded-cube.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-bgf-move-steps.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-chunk-passthrough.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-equity-loss.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-illegal-move.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-illegal-play-steps.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-legality.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-mat.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-merge.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-met.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-og.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-ogid.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-annos.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-blocks.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-fields.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-limits.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-passthrough.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-ogxm2-writer.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-place.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-robustness.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-roundtrip.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-share.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-stats.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-xg-cube.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-xg-eval-levels.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-xg-move-steps.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/gvformat-js/test/test-xg-zero-win-eval.js +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/pyproject.toml +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/README.md +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/bgf/3WNK_g1Z-PLsh_HyvQ5j4a.bgf +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/bgf/5nqfGw9bWG3deTaU.bgf +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/bgf/B4_SrGcsKAQmoTyHlgJCbM.bgf +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/bgf/C07OQCKyw4Pe-CnjFiAMYO.bgf +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/bgf/MYdvw1qGuyaRUH__.bgf +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/bgf/Sz-2PgKnvb6aFls69-qFXg.bgf +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/bgf/UL-CV6F9jMM-E1Pu.bgf +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/bgf/XCu3RJ0UvDg_Tldl.bgf +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/bgf/baR-U643iUDpvzTC.bgf +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/bgf/eXBNG5wZHS5Alu3P.bgf +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/bgf/uwvEbd63UvdX7SDin5o_Iw.bgf +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/3WNK_g1Z-PLsh_HyvQ5j4a.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/5nqfGw9bWG3deTaU.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/B4_SrGcsKAQmoTyHlgJCbM.gva +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/B4_SrGcsKAQmoTyHlgJCbM.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/C07OQCKyw4Pe-CnjFiAMYO.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/MYdvw1qGuyaRUH__.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/Sz-2PgKnvb6aFls69-qFXg.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/UL-CV6F9jMM-E1Pu.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/XCu3RJ0UvDg_Tldl.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/baR-U643iUDpvzTC.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/eXBNG5wZHS5Alu3P.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/gv/uwvEbd63UvdX7SDin5o_Iw.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/3WNK_g1Z-PLsh_HyvQ5j4a.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/5nqfGw9bWG3deTaU.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/B4_SrGcsKAQmoTyHlgJCbM.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/C07OQCKyw4Pe-CnjFiAMYO.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/MYdvw1qGuyaRUH__.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/Sz-2PgKnvb6aFls69-qFXg.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/UL-CV6F9jMM-E1Pu.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/XCu3RJ0UvDg_Tldl.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/baR-U643iUDpvzTC.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/eXBNG5wZHS5Alu3P.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/hQ8sVn2LbTdF4wRm.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/rK7pXm4TqLb9NzWd.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/mat/uwvEbd63UvdX7SDin5o_Iw.mat +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/3WNK_g1Z-PLsh_HyvQ5j4a.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/5nqfGw9bWG3deTaU.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/B4_SrGcsKAQmoTyHlgJCbM.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/C07OQCKyw4Pe-CnjFiAMYO.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/MYdvw1qGuyaRUH__.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/Sz-2PgKnvb6aFls69-qFXg.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/UL-CV6F9jMM-E1Pu.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/XCu3RJ0UvDg_Tldl.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/baR-U643iUDpvzTC.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/eXBNG5wZHS5Alu3P.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/hQ8sVn2LbTdF4wRm.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/rK7pXm4TqLb9NzWd.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/samples/xg/uwvEbd63UvdX7SDin5o_Iw.xg +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/audit_corpus.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/fixtures.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/gen_js_v2_fixtures.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/gen_ogxm2_annos_fixtures.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/gen_ogxm2_blocks_fixtures.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/gen_ogxm2_fields_fixtures.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/gen_ogxm2_passthrough_fixtures.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/golden/3WNK_g1Z-PLsh_HyvQ5j4a.fast.gva +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/golden/5nqfGw9bWG3deTaU.fast.gva +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/golden/B4_SrGcsKAQmoTyHlgJCbM.fast.gva +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/golden/B4_SrGcsKAQmoTyHlgJCbM.fast.gvab +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/golden/MYdvw1qGuyaRUH__.fast.gva +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/golden/baR-U643iUDpvzTC.fast.gva +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/ogxm2_annos_cases.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/ogxm2_blocks_cases.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/ogxm2_fields_cases.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/ogxm2_oracle.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/passthrough_cases.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/regen_golden.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/run_all.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_alternative_move_steps.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_analysis_orientation.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_analyze_position.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_basefill.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_bgf_alternatives.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_bgf_cube_response.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_bgf_move_steps.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_chunk_passthrough.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_count_illegal.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_cube_tiers.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_docs_presets.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_equity_loss.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_gvab_writer.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_illegal_move.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_illegal_play_steps.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_legality.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_loader_formats.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_luck_fill.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_merge_resign.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_met.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_money_rules.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm2_annos.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm2_blocks.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm2_blocks_analysis.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm2_fields.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm2_fields_analysis.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm2_limits.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm2_passthrough.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm2_reference.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm2_writer.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm_conformance.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm_export.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm_pipeline.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_ogxm_stats.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_parent_watch.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_position_id.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_presets.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_read_gvab.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_reconstruct_mat.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_resign_actor.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_resign_errors.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_restated_play_analysis.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_screened_checker.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_share_link.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_xg_cube.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_xg_eval_levels.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_xg_move_steps.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/tests/test_xg_zero_win_eval.py +0 -0
- {gammonview-3.3.0 → gammonview-3.4.0}/uv.lock +0 -0
|
@@ -13,6 +13,32 @@ 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
|
+
|
|
16
42
|
## 3.3.0 — 2026-11-05
|
|
17
43
|
|
|
18
44
|
**A money session is analysed under the rules it was played under** *(fixed)*
|
|
@@ -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` |
|
|
@@ -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
|
|
@@ -61,6 +61,7 @@ import zlib
|
|
|
61
61
|
from datetime import datetime, timezone
|
|
62
62
|
from urllib.parse import quote
|
|
63
63
|
|
|
64
|
+
from .met import met_table, stored_met
|
|
64
65
|
from .basefill import frame_key, frame_perspective_is_white, mwc_frame_inverse
|
|
65
66
|
from .binary import DICE_TABLE, _round_c
|
|
66
67
|
from .export import (
|
|
@@ -1144,7 +1145,7 @@ class _Ctx:
|
|
|
1144
1145
|
|
|
1145
1146
|
@property
|
|
1146
1147
|
def mwc(self) -> bool:
|
|
1147
|
-
return self.currency
|
|
1148
|
+
return self.currency in R.MWC_CURRENCIES
|
|
1148
1149
|
|
|
1149
1150
|
def currency_override(self, sub: dict):
|
|
1150
1151
|
"""A cube decision's own currency, where it states one that is not the
|
|
@@ -1154,7 +1155,7 @@ class _Ctx:
|
|
|
1154
1155
|
if c is None:
|
|
1155
1156
|
return None
|
|
1156
1157
|
_uint_field(c, "currency")
|
|
1157
|
-
if c == self.currency or (c
|
|
1158
|
+
if c == self.currency or (c in R.MWC_CURRENCIES and self.match.match_length <= 0):
|
|
1158
1159
|
return None
|
|
1159
1160
|
return c
|
|
1160
1161
|
|
|
@@ -1225,7 +1226,7 @@ def _block_records(match: _Match, select, ctx: _Ctx):
|
|
|
1225
1226
|
plies = match.ply_at
|
|
1226
1227
|
|
|
1227
1228
|
def conv_for(p, currency):
|
|
1228
|
-
return _Converter(p, currency
|
|
1229
|
+
return _Converter(p, currency in R.MWC_CURRENCIES, None)
|
|
1229
1230
|
|
|
1230
1231
|
for idx, (key, p) in enumerate(plies):
|
|
1231
1232
|
a = select(p)
|
|
@@ -1325,7 +1326,44 @@ def _uuid_ok(v) -> bool:
|
|
|
1325
1326
|
return False
|
|
1326
1327
|
|
|
1327
1328
|
|
|
1328
|
-
def
|
|
1329
|
+
def _met_away(match: "_Match") -> int:
|
|
1330
|
+
"""K (6.6): the most points either side needed at the start."""
|
|
1331
|
+
ss = match.doc.get("score_start") or [0, 0]
|
|
1332
|
+
return match.match_length - min(int(ss[0] or 0), int(ss[1] or 0))
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
def _met_field(info: dict, match: "_Match", currency: int, objs: list) -> bytes | None:
|
|
1336
|
+
"""ANAL's ``met`` (6.6, 2.3): the table a match block's MWCs are quoted on, so
|
|
1337
|
+
another reader converts them on it rather than on its own. The block's own
|
|
1338
|
+
where it carries one (another producer's, its plies converted through it);
|
|
1339
|
+
else ours, where every ply was converted on our table -- not where a source's
|
|
1340
|
+
own frame (``mwc_frame``) stood in for it, or the block names another table."""
|
|
1341
|
+
if match.match_length <= 0 or currency not in R.MWC_CURRENCIES:
|
|
1342
|
+
return None
|
|
1343
|
+
K = _met_away(match)
|
|
1344
|
+
crawford = bool(match.doc.get("crawford"))
|
|
1345
|
+
met = None
|
|
1346
|
+
own = info.get("met")
|
|
1347
|
+
if own is not None:
|
|
1348
|
+
t = met_table(own)
|
|
1349
|
+
if t is not None and t.K == K and bool(own.get("post_crawford")) == crawford:
|
|
1350
|
+
met = own
|
|
1351
|
+
elif (not info.get("met_id") or info.get("met_id") == "kazaross-xg2") and not any(
|
|
1352
|
+
isinstance(a, dict) and a.get("mwc_frame") is not None for a in objs):
|
|
1353
|
+
met = stored_met(K, crawford)
|
|
1354
|
+
if met is None:
|
|
1355
|
+
return None
|
|
1356
|
+
|
|
1357
|
+
def table(vals) -> bytes:
|
|
1358
|
+
return _varint(len(vals)) + b"".join(_varint(math.floor(v * 1e6 + 0.5)) for v in vals)
|
|
1359
|
+
|
|
1360
|
+
fields = {}
|
|
1361
|
+
if met.get("post_crawford"):
|
|
1362
|
+
fields[0] = table(met["post_crawford"])
|
|
1363
|
+
return _record(table(met["pre_crawford"]), fields)
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
def _block_fields(info: dict, match: "_Match", objs: list):
|
|
1329
1367
|
"""``(fields, items, nsources, currency)`` for a block's ``ANAL`` record: the
|
|
1330
1368
|
optional fields by bit (not the level or coverage), the
|
|
1331
1369
|
``x-gammonview-analysis`` items for values v2 cannot hold (P6), how many
|
|
@@ -1375,7 +1413,7 @@ def _block_fields(info: dict, match: "_Match"):
|
|
|
1375
1413
|
if stated is not None:
|
|
1376
1414
|
_uint_field(stated, "currency")
|
|
1377
1415
|
currency = default if stated is None or (
|
|
1378
|
-
stated
|
|
1416
|
+
stated in R.MWC_CURRENCIES and match.match_length <= 0) else stated
|
|
1379
1417
|
fields[9] = _varint(currency)
|
|
1380
1418
|
|
|
1381
1419
|
if info.get("cube_efficiency") is not None:
|
|
@@ -1422,6 +1460,10 @@ def _block_fields(info: dict, match: "_Match"):
|
|
|
1422
1460
|
if info.get("duration_ms"):
|
|
1423
1461
|
fields[16] = _varint(int(info["duration_ms"]))
|
|
1424
1462
|
|
|
1463
|
+
met = _met_field(info, match, currency, objs)
|
|
1464
|
+
if met is not None:
|
|
1465
|
+
fields[18] = met
|
|
1466
|
+
|
|
1425
1467
|
sources = info.get("sources")
|
|
1426
1468
|
nsources = 0
|
|
1427
1469
|
if isinstance(sources, list) and sources:
|
|
@@ -1720,6 +1762,27 @@ def check_annos(annos: list[_Anno]) -> None:
|
|
|
1720
1762
|
seen.add(ident)
|
|
1721
1763
|
|
|
1722
1764
|
|
|
1765
|
+
def _clock_rule(clock: dict) -> tuple[int, int, int]:
|
|
1766
|
+
"""``(rule, white_grants, black_grants)``, CLCK's header bytes 17-19 (2.3): a
|
|
1767
|
+
rule by its name or as the id a source stated, the grants as two counts."""
|
|
1768
|
+
rule = clock.get("rule")
|
|
1769
|
+
if rule is None:
|
|
1770
|
+
rule = 0
|
|
1771
|
+
elif isinstance(rule, str):
|
|
1772
|
+
ids = [k for k, v in P.CLOCK_RULES.items() if v == rule]
|
|
1773
|
+
if not ids:
|
|
1774
|
+
raise ValueError(f"clock_info rule {json.dumps(rule)} is not one v2 names")
|
|
1775
|
+
rule = ids[0]
|
|
1776
|
+
if not _is_uint(rule, 8):
|
|
1777
|
+
raise ValueError(f"clock_info rule {rule!r} is not a rule id")
|
|
1778
|
+
grants = clock.get("grants")
|
|
1779
|
+
if grants is None:
|
|
1780
|
+
grants = [0, 0]
|
|
1781
|
+
if not isinstance(grants, list) or len(grants) != 2 or not all(_is_uint(g, 8) for g in grants):
|
|
1782
|
+
raise ValueError(f"clock_info grants {json.dumps(grants)} are not two counts")
|
|
1783
|
+
return rule, grants[0], grants[1]
|
|
1784
|
+
|
|
1785
|
+
|
|
1723
1786
|
def _clock_section(doc: dict, match: _Match) -> bytes | None:
|
|
1724
1787
|
"""``CLCK`` (8.2) from ``clock_info`` and each ply's ``timestamp_ms``, or None where
|
|
1725
1788
|
the document has no clock or the series cannot be written: a reading after a
|
|
@@ -1729,7 +1792,7 @@ def _clock_section(doc: dict, match: _Match) -> bytes | None:
|
|
|
1729
1792
|
return None
|
|
1730
1793
|
flags = _opt_uint(clock, "flags", "clock_info", 8)
|
|
1731
1794
|
header = tuple(_opt_uint(clock, k, "clock_info") for k in
|
|
1732
|
-
("reserve_ms", "delay_ms", "increment_ms", "start_timestamp")) + (flags,)
|
|
1795
|
+
("reserve_ms", "delay_ms", "increment_ms", "start_timestamp")) + (flags,) + _clock_rule(clock)
|
|
1733
1796
|
precision = clock.get("precision")
|
|
1734
1797
|
if precision is None:
|
|
1735
1798
|
precision = P.CLOCK_PRECISION
|
|
@@ -1863,7 +1926,7 @@ def _encode(ogxm: dict) -> _Parts:
|
|
|
1863
1926
|
stated = info.get("level")
|
|
1864
1927
|
block_eff = _check_level(stated) if stated is not None else R.block_level_of(info, objs)
|
|
1865
1928
|
luck_label = info.get("luck_eval_level") or "1ply"
|
|
1866
|
-
fields, items, nsources, written_currency = _block_fields(info, match)
|
|
1929
|
+
fields, items, nsources, written_currency = _block_fields(info, match, objs)
|
|
1867
1930
|
ctx = _Ctx(match, block_eff, written_currency, nsources, luck_label)
|
|
1868
1931
|
decs, extra, frames, places = _block_records(match, select, ctx)
|
|
1869
1932
|
|
|
@@ -2020,7 +2083,12 @@ def _assemble(parts: _Parts, plan: P.Plan) -> bytes:
|
|
|
2020
2083
|
else:
|
|
2021
2084
|
body_sections = [s for _k, s in secs]
|
|
2022
2085
|
|
|
2023
|
-
|
|
2086
|
+
# 2.3's additions this writer can make -- a stored table, a clock rule or a
|
|
2087
|
+
# grant -- each raise the minor and none the reader's (spec 2.1).
|
|
2088
|
+
uses_23 = any("met" in R._decode_anal(anal) for anal, *_rest in plan.blocks) or (
|
|
2089
|
+
plan.clck is not None and any(plan.clck[17:20]))
|
|
2090
|
+
minor = max(3 if uses_23 else (2 if match.pending_double_end else (1 if parts.uses_21 else 0)),
|
|
2091
|
+
plan.minor_floor)
|
|
2024
2092
|
min_minor = max(2 if match.pending_double_end else 0, plan.min_minor_floor)
|
|
2025
2093
|
body = bytearray(b"OGXM" + struct.pack("<HHHHI", 2, minor, 2, min_minor, 0))
|
|
2026
2094
|
for s in body_sections:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gammonview/gvformat",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@gammonview/gvformat",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "3.1.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"pako": "^3.0.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gammonview/gvformat",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
30
|
"prepublishOnly": "npm test",
|
|
31
|
-
"test": "node test/test-ogid.js && node test/test-roundtrip.js && node test/test-merge.js && node test/test-stats.js && node test/test-met.js && node test/test-xg-cube.js && node test/test-bgf-alternatives.js && node test/test-bgf-move-steps.js && node test/test-bgf-embedded-cube.js && node test/test-xg-move-steps.js && node test/test-xg-eval-levels.js && node test/test-xg-zero-win-eval.js && node test/test-alternative-move-steps.js && node test/test-legality.js && node test/test-illegal-play-steps.js && node test/test-illegal-move.js && node test/test-share.js && node test/test-place.js && node test/test-mat.js && node test/test-og.js && node test/test-equity-loss.js && node test/test-basefill.js && node test/test-ogxm2.js && node test/test-ogxm2-writer.js && node test/test-chunk-passthrough.js && node test/test-ogxm2-passthrough.js && node test/test-ogxm2-fields.js && node test/test-ogxm2-blocks.js && node test/test-ogxm2-annos.js && node test/test-ogxm2-limits.js && node test/test-robustness.js"
|
|
31
|
+
"test": "node test/test-ogid.js && node test/test-roundtrip.js && node test/test-merge.js && node test/test-stats.js && node test/test-met.js && node test/test-xg-cube.js && node test/test-bgf-alternatives.js && node test/test-bgf-move-steps.js && node test/test-bgf-embedded-cube.js && node test/test-xg-move-steps.js && node test/test-xg-eval-levels.js && node test/test-xg-zero-win-eval.js && node test/test-alternative-move-steps.js && node test/test-legality.js && node test/test-illegal-play-steps.js && node test/test-illegal-move.js && node test/test-share.js && node test/test-place.js && node test/test-mat.js && node test/test-og.js && node test/test-equity-loss.js && node test/test-basefill.js && node test/test-ogxm2.js && node test/test-ogxm2-writer.js && node test/test-chunk-passthrough.js && node test/test-ogxm2-passthrough.js && node test/test-ogxm2-fields.js && node test/test-ogxm2-blocks.js && node test/test-ogxm2-annos.js && node test/test-ogxm2-limits.js && node test/test-ogxm23.js && node test/test-robustness.js"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=18"
|
|
@@ -167,6 +167,21 @@ export function framePerspectiveIsWhite(ply) {
|
|
|
167
167
|
return answering ? ply.color !== 1 : ply.color === 1;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
/**
|
|
171
|
+
* The source frame `[mid, half]` a block's stored table (`metTable`) gives this
|
|
172
|
+
* ply, at the eight places a `frame=` item carries -- the form `mwcFrame` and
|
|
173
|
+
* `mwc_frame` take -- or null where there is no match-play frame or the table
|
|
174
|
+
* does not reach the score.
|
|
175
|
+
*/
|
|
176
|
+
export function metFrame(ply, table) {
|
|
177
|
+
const key = frameKey(ply);
|
|
178
|
+
if (key === null) return null;
|
|
179
|
+
const anchors = mwcAnchors(key[0], key[1], key[2], key[3], table);
|
|
180
|
+
if (anchors === null || anchors[0] === anchors[1]) return null;
|
|
181
|
+
const [mwcWin, mwcLose] = anchors;
|
|
182
|
+
return [Number(((mwcWin + mwcLose) / 2).toFixed(8)), Number(((mwcWin - mwcLose) / 2).toFixed(8))];
|
|
183
|
+
}
|
|
184
|
+
|
|
170
185
|
/** `[mid, span]` of the MWC interval this ply's equities normalize over. A
|
|
171
186
|
* source's `frame` (`[mid, half]`) replaces the table's anchors. */
|
|
172
187
|
function _frameAnchors(ply, frame = null) {
|