gammonview 3.6.2__tar.gz → 3.8.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.
Files changed (329) hide show
  1. {gammonview-3.6.2 → gammonview-3.8.0}/CHANGELOG.md +40 -0
  2. {gammonview-3.6.2 → gammonview-3.8.0}/CLAUDE.md +17 -2
  3. {gammonview-3.6.2 → gammonview-3.8.0}/PKG-INFO +14 -2
  4. {gammonview-3.6.2 → gammonview-3.8.0}/README.md +13 -1
  5. gammonview-3.8.0/gvanalysis/dicemap.py +476 -0
  6. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/position.py +39 -2
  7. {gammonview-3.6.2 → gammonview-3.8.0}/gvengine-js/README.md +50 -2
  8. gammonview-3.8.0/gvengine-js/THIRD-PARTY-NOTICES.md +95 -0
  9. gammonview-3.8.0/gvengine-js/package-lock.json +38 -0
  10. gammonview-3.8.0/gvengine-js/package.json +48 -0
  11. gammonview-3.8.0/gvengine-js/scripts/dicemap_fixtures.py +70 -0
  12. gammonview-3.8.0/gvengine-js/scripts/prepublish.mjs +29 -0
  13. gammonview-3.8.0/gvengine-js/src/dicemap.js +300 -0
  14. gammonview-3.8.0/gvengine-js/test/dicemap.test.mjs +104 -0
  15. gammonview-3.8.0/gvengine-js/test/fixtures/dicemap.json +1 -0
  16. gammonview-3.8.0/gvformat-js/LICENSE +21 -0
  17. {gammonview-3.6.2 → gammonview-3.8.0}/tests/run_all.py +1 -0
  18. gammonview-3.8.0/tests/test_dicemap.py +187 -0
  19. gammonview-3.6.2/gvengine-js/package.json +0 -19
  20. {gammonview-3.6.2 → gammonview-3.8.0}/.gitattributes +0 -0
  21. {gammonview-3.6.2 → gammonview-3.8.0}/.github/workflows/ci.yml +0 -0
  22. {gammonview-3.6.2 → gammonview-3.8.0}/.github/workflows/engine.yml +0 -0
  23. {gammonview-3.6.2 → gammonview-3.8.0}/.github/workflows/publish.yml +0 -0
  24. {gammonview-3.6.2 → gammonview-3.8.0}/.gitignore +0 -0
  25. {gammonview-3.6.2 → gammonview-3.8.0}/.python-version +0 -0
  26. {gammonview-3.6.2 → gammonview-3.8.0}/CONTRIBUTING.md +0 -0
  27. {gammonview-3.6.2 → gammonview-3.8.0}/LICENSE +0 -0
  28. {gammonview-3.6.2 → gammonview-3.8.0}/THIRD-PARTY-NOTICES.md +0 -0
  29. {gammonview-3.6.2 → gammonview-3.8.0}/assets/logo.png +0 -0
  30. {gammonview-3.6.2 → gammonview-3.8.0}/docs/CLI.md +0 -0
  31. {gammonview-3.6.2 → gammonview-3.8.0}/docs/METHODOLOGY.md +0 -0
  32. {gammonview-3.6.2 → gammonview-3.8.0}/docs/OGXM_COMPUTED_FIELDS.md +0 -0
  33. {gammonview-3.6.2 → gammonview-3.8.0}/docs/OGXM_JSON_SPEC_GAMMONVIEW.md +0 -0
  34. {gammonview-3.6.2 → gammonview-3.8.0}/docs/OGXM_V2_PROFILE.md +0 -0
  35. {gammonview-3.6.2 → gammonview-3.8.0}/docs/PRESET_ACCURACY.md +0 -0
  36. {gammonview-3.6.2 → gammonview-3.8.0}/docs/upstream-bgsage.md +0 -0
  37. {gammonview-3.6.2 → gammonview-3.8.0}/docs/v1/OGXM_FORMAT_SPEC_GAMMONVIEW.md +0 -0
  38. {gammonview-3.6.2 → gammonview-3.8.0}/experiments/2026-09-16-checker-mid-tier.md +0 -0
  39. {gammonview-3.6.2 → gammonview-3.8.0}/experiments/2026-09-17-checker-mid-tier-followup.md +0 -0
  40. {gammonview-3.6.2 → gammonview-3.8.0}/experiments/2026-09-19-cross-machine-costs.md +0 -0
  41. {gammonview-3.6.2 → gammonview-3.8.0}/experiments/2026-09-20-corpus-rerun.md +0 -0
  42. {gammonview-3.6.2 → gammonview-3.8.0}/experiments/2026-10-21-wc2-corpus.md +0 -0
  43. {gammonview-3.6.2 → gammonview-3.8.0}/experiments/bench.py +0 -0
  44. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/__init__.py +0 -0
  45. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/batch.py +0 -0
  46. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/checker_eval.py +0 -0
  47. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/compare_gva.py +0 -0
  48. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/game_eval.py +0 -0
  49. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/loader.py +0 -0
  50. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/luck.py +0 -0
  51. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/match.py +0 -0
  52. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/ogxm_reconstructor.py +0 -0
  53. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/parentwatch.py +0 -0
  54. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/positionmove.py +0 -0
  55. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/presets.py +0 -0
  56. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/progress.py +0 -0
  57. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/reconstruct_mat.py +0 -0
  58. {gammonview-3.6.2 → gammonview-3.8.0}/gvanalysis/share.py +0 -0
  59. {gammonview-3.6.2 → gammonview-3.8.0}/gvengine-js/.gitignore +0 -0
  60. {gammonview-3.6.2/gvformat-js → gammonview-3.8.0/gvengine-js}/LICENSE +0 -0
  61. {gammonview-3.6.2 → gammonview-3.8.0}/gvengine-js/bgsage.version +0 -0
  62. {gammonview-3.6.2 → gammonview-3.8.0}/gvengine-js/build.sh +0 -0
  63. {gammonview-3.6.2 → gammonview-3.8.0}/gvengine-js/scripts/assets.py +0 -0
  64. {gammonview-3.6.2 → gammonview-3.8.0}/gvengine-js/scripts/fixtures.py +0 -0
  65. {gammonview-3.6.2 → gammonview-3.8.0}/gvengine-js/src/engine.js +0 -0
  66. {gammonview-3.6.2 → gammonview-3.8.0}/gvengine-js/src/entry.cpp +0 -0
  67. {gammonview-3.6.2 → gammonview-3.8.0}/gvengine-js/test/fixtures/parity.json +0 -0
  68. {gammonview-3.6.2 → gammonview-3.8.0}/gvengine-js/test/parity.test.mjs +0 -0
  69. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/__init__.py +0 -0
  70. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/basefill.py +0 -0
  71. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/bgf.py +0 -0
  72. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/binary.py +0 -0
  73. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/export.py +0 -0
  74. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/game_reconstructor.py +0 -0
  75. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/legality.py +0 -0
  76. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/mat.py +0 -0
  77. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/mat_parser.py +0 -0
  78. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/merge.py +0 -0
  79. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/met.py +0 -0
  80. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/notation.py +0 -0
  81. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/ogid.py +0 -0
  82. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/ogxm2.py +0 -0
  83. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/ogxm2_passthrough.py +0 -0
  84. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/ogxm2_writer.py +0 -0
  85. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/place.py +0 -0
  86. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/reader.py +0 -0
  87. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/share.py +0 -0
  88. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/stats.py +0 -0
  89. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat/xg.py +0 -0
  90. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/.gitignore +0 -0
  91. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/README.md +0 -0
  92. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/THIRD-PARTY-NOTICES.md +0 -0
  93. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/cli/README.md +0 -0
  94. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/cli/bgf2gva.js +0 -0
  95. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/cli/mat2gva.js +0 -0
  96. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/cli/xg2gva.js +0 -0
  97. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/package-lock.json +0 -0
  98. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/package.json +0 -0
  99. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/basefill.js +0 -0
  100. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/bgf2gva.js +0 -0
  101. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/binary.js +0 -0
  102. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/constants.js +0 -0
  103. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/export.js +0 -0
  104. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/index.js +0 -0
  105. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/legality.js +0 -0
  106. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/mat2gva.js +0 -0
  107. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/merge.js +0 -0
  108. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/met.js +0 -0
  109. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/notation.js +0 -0
  110. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/og2gva.js +0 -0
  111. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/ogid.js +0 -0
  112. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/ogxm2.js +0 -0
  113. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/ogxm2_passthrough.js +0 -0
  114. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/ogxm2_writer.js +0 -0
  115. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/place.js +0 -0
  116. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/reader.js +0 -0
  117. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/sha256.js +0 -0
  118. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/share.js +0 -0
  119. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/stats.js +0 -0
  120. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/src/xg2gva.js +0 -0
  121. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/3WNK_g1Z-PLsh_HyvQ5j4a.json +0 -0
  122. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/5nqfGw9bWG3deTaU.json +0 -0
  123. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/B4_SrGcsKAQmoTyHlgJCbM.json +0 -0
  124. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/C07OQCKyw4Pe-CnjFiAMYO.json +0 -0
  125. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/MYdvw1qGuyaRUH__.json +0 -0
  126. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/Sz-2PgKnvb6aFls69-qFXg.json +0 -0
  127. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/UL-CV6F9jMM-E1Pu.json +0 -0
  128. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/XCu3RJ0UvDg_Tldl.json +0 -0
  129. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/baR-U643iUDpvzTC.json +0 -0
  130. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/eXBNG5wZHS5Alu3P.json +0 -0
  131. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/hQ8sVn2LbTdF4wRm.json +0 -0
  132. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/rK7pXm4TqLb9NzWd.json +0 -0
  133. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/mat/uwvEbd63UvdX7SDin5o_Iw.json +0 -0
  134. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/annos-docs.json +0 -0
  135. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/annos-edits-sha256.json +0 -0
  136. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/annos-sha256.json +0 -0
  137. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/annos.expected.json +0 -0
  138. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/annos.ogxm +0 -0
  139. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/bgf-writer-sha256.json +0 -0
  140. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/blocks-docs.json +0 -0
  141. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/blocks-sha256.json +0 -0
  142. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/blocks.expected.json +0 -0
  143. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/blocks.ogxm +0 -0
  144. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/cube-on-two.expected.json +0 -0
  145. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/cube-on-two.ogxm +0 -0
  146. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/fields-docs.json +0 -0
  147. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/fields-sha256.json +0 -0
  148. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/fields.expected.json +0 -0
  149. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/fields.ogxm +0 -0
  150. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/foreign.ogxm +0 -0
  151. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/gen.py +0 -0
  152. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/match.expected.json +0 -0
  153. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/match.ogxm +0 -0
  154. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/passthrough-sha256.json +0 -0
  155. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/resign.expected.json +0 -0
  156. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/resign.ogxm +0 -0
  157. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/set-up.expected.json +0 -0
  158. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/set-up.ogxm +0 -0
  159. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/two-blocks.expected.json +0 -0
  160. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/two-blocks.ogxm +0 -0
  161. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/v1-chunks.gvab +0 -0
  162. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/v23-foreign.anchors.json +0 -0
  163. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/v23-foreign.ogxm +0 -0
  164. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/fixtures/ogxm2/writer-sha256.json +0 -0
  165. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-alternative-move-steps.js +0 -0
  166. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-basefill.js +0 -0
  167. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-bearoff-excess-steps.js +0 -0
  168. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-bgf-alternatives.js +0 -0
  169. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-bgf-embedded-cube.js +0 -0
  170. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-bgf-move-steps.js +0 -0
  171. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-chunk-passthrough.js +0 -0
  172. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-cube-action-counting.js +0 -0
  173. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-equity-loss.js +0 -0
  174. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-illegal-move.js +0 -0
  175. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-illegal-play-steps.js +0 -0
  176. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-legality.js +0 -0
  177. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-mat.js +0 -0
  178. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-merge.js +0 -0
  179. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-met.js +0 -0
  180. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-og.js +0 -0
  181. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-ogid.js +0 -0
  182. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-ogxm2-annos.js +0 -0
  183. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-ogxm2-blocks.js +0 -0
  184. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-ogxm2-fields.js +0 -0
  185. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-ogxm2-limits.js +0 -0
  186. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-ogxm2-passthrough.js +0 -0
  187. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-ogxm2-writer.js +0 -0
  188. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-ogxm2.js +0 -0
  189. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-ogxm23.js +0 -0
  190. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-place.js +0 -0
  191. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-robustness.js +0 -0
  192. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-roundtrip.js +0 -0
  193. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-share.js +0 -0
  194. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-stats.js +0 -0
  195. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-xg-cube.js +0 -0
  196. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-xg-eval-levels.js +0 -0
  197. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-xg-move-steps.js +0 -0
  198. {gammonview-3.6.2 → gammonview-3.8.0}/gvformat-js/test/test-xg-zero-win-eval.js +0 -0
  199. {gammonview-3.6.2 → gammonview-3.8.0}/pyproject.toml +0 -0
  200. {gammonview-3.6.2 → gammonview-3.8.0}/samples/README.md +0 -0
  201. {gammonview-3.6.2 → gammonview-3.8.0}/samples/bgf/3WNK_g1Z-PLsh_HyvQ5j4a.bgf +0 -0
  202. {gammonview-3.6.2 → gammonview-3.8.0}/samples/bgf/5nqfGw9bWG3deTaU.bgf +0 -0
  203. {gammonview-3.6.2 → gammonview-3.8.0}/samples/bgf/B4_SrGcsKAQmoTyHlgJCbM.bgf +0 -0
  204. {gammonview-3.6.2 → gammonview-3.8.0}/samples/bgf/C07OQCKyw4Pe-CnjFiAMYO.bgf +0 -0
  205. {gammonview-3.6.2 → gammonview-3.8.0}/samples/bgf/MYdvw1qGuyaRUH__.bgf +0 -0
  206. {gammonview-3.6.2 → gammonview-3.8.0}/samples/bgf/Sz-2PgKnvb6aFls69-qFXg.bgf +0 -0
  207. {gammonview-3.6.2 → gammonview-3.8.0}/samples/bgf/UL-CV6F9jMM-E1Pu.bgf +0 -0
  208. {gammonview-3.6.2 → gammonview-3.8.0}/samples/bgf/XCu3RJ0UvDg_Tldl.bgf +0 -0
  209. {gammonview-3.6.2 → gammonview-3.8.0}/samples/bgf/baR-U643iUDpvzTC.bgf +0 -0
  210. {gammonview-3.6.2 → gammonview-3.8.0}/samples/bgf/eXBNG5wZHS5Alu3P.bgf +0 -0
  211. {gammonview-3.6.2 → gammonview-3.8.0}/samples/bgf/uwvEbd63UvdX7SDin5o_Iw.bgf +0 -0
  212. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/3WNK_g1Z-PLsh_HyvQ5j4a.gvab +0 -0
  213. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/5nqfGw9bWG3deTaU.gvab +0 -0
  214. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/B4_SrGcsKAQmoTyHlgJCbM.gva +0 -0
  215. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/B4_SrGcsKAQmoTyHlgJCbM.gvab +0 -0
  216. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/C07OQCKyw4Pe-CnjFiAMYO.gvab +0 -0
  217. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/MYdvw1qGuyaRUH__.gvab +0 -0
  218. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/Sz-2PgKnvb6aFls69-qFXg.gvab +0 -0
  219. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/UL-CV6F9jMM-E1Pu.gvab +0 -0
  220. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/XCu3RJ0UvDg_Tldl.gvab +0 -0
  221. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/baR-U643iUDpvzTC.gvab +0 -0
  222. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/eXBNG5wZHS5Alu3P.gvab +0 -0
  223. {gammonview-3.6.2 → gammonview-3.8.0}/samples/gv/uwvEbd63UvdX7SDin5o_Iw.gvab +0 -0
  224. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/3WNK_g1Z-PLsh_HyvQ5j4a.mat +0 -0
  225. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/5nqfGw9bWG3deTaU.mat +0 -0
  226. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/B4_SrGcsKAQmoTyHlgJCbM.mat +0 -0
  227. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/C07OQCKyw4Pe-CnjFiAMYO.mat +0 -0
  228. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/MYdvw1qGuyaRUH__.mat +0 -0
  229. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/Sz-2PgKnvb6aFls69-qFXg.mat +0 -0
  230. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/UL-CV6F9jMM-E1Pu.mat +0 -0
  231. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/XCu3RJ0UvDg_Tldl.mat +0 -0
  232. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/baR-U643iUDpvzTC.mat +0 -0
  233. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/eXBNG5wZHS5Alu3P.mat +0 -0
  234. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/hQ8sVn2LbTdF4wRm.mat +0 -0
  235. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/rK7pXm4TqLb9NzWd.mat +0 -0
  236. {gammonview-3.6.2 → gammonview-3.8.0}/samples/mat/uwvEbd63UvdX7SDin5o_Iw.mat +0 -0
  237. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/3WNK_g1Z-PLsh_HyvQ5j4a.xg +0 -0
  238. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/5nqfGw9bWG3deTaU.xg +0 -0
  239. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/B4_SrGcsKAQmoTyHlgJCbM.xg +0 -0
  240. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/C07OQCKyw4Pe-CnjFiAMYO.xg +0 -0
  241. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/MYdvw1qGuyaRUH__.xg +0 -0
  242. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/Sz-2PgKnvb6aFls69-qFXg.xg +0 -0
  243. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/UL-CV6F9jMM-E1Pu.xg +0 -0
  244. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/XCu3RJ0UvDg_Tldl.xg +0 -0
  245. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/baR-U643iUDpvzTC.xg +0 -0
  246. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/eXBNG5wZHS5Alu3P.xg +0 -0
  247. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/hQ8sVn2LbTdF4wRm.xg +0 -0
  248. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/rK7pXm4TqLb9NzWd.xg +0 -0
  249. {gammonview-3.6.2 → gammonview-3.8.0}/samples/xg/uwvEbd63UvdX7SDin5o_Iw.xg +0 -0
  250. {gammonview-3.6.2 → gammonview-3.8.0}/tests/audit_corpus.py +0 -0
  251. {gammonview-3.6.2 → gammonview-3.8.0}/tests/fixtures.py +0 -0
  252. {gammonview-3.6.2 → gammonview-3.8.0}/tests/gen_js_v2_fixtures.py +0 -0
  253. {gammonview-3.6.2 → gammonview-3.8.0}/tests/gen_ogxm23_fixtures.py +0 -0
  254. {gammonview-3.6.2 → gammonview-3.8.0}/tests/gen_ogxm2_annos_fixtures.py +0 -0
  255. {gammonview-3.6.2 → gammonview-3.8.0}/tests/gen_ogxm2_blocks_fixtures.py +0 -0
  256. {gammonview-3.6.2 → gammonview-3.8.0}/tests/gen_ogxm2_fields_fixtures.py +0 -0
  257. {gammonview-3.6.2 → gammonview-3.8.0}/tests/gen_ogxm2_passthrough_fixtures.py +0 -0
  258. {gammonview-3.6.2 → gammonview-3.8.0}/tests/golden/3WNK_g1Z-PLsh_HyvQ5j4a.fast.gva +0 -0
  259. {gammonview-3.6.2 → gammonview-3.8.0}/tests/golden/3WNK_g1Z-PLsh_HyvQ5j4a.fast.gvab +0 -0
  260. {gammonview-3.6.2 → gammonview-3.8.0}/tests/golden/5nqfGw9bWG3deTaU.fast.gva +0 -0
  261. {gammonview-3.6.2 → gammonview-3.8.0}/tests/golden/5nqfGw9bWG3deTaU.fast.gvab +0 -0
  262. {gammonview-3.6.2 → gammonview-3.8.0}/tests/golden/B4_SrGcsKAQmoTyHlgJCbM.fast.gva +0 -0
  263. {gammonview-3.6.2 → gammonview-3.8.0}/tests/golden/B4_SrGcsKAQmoTyHlgJCbM.fast.gvab +0 -0
  264. {gammonview-3.6.2 → gammonview-3.8.0}/tests/golden/MYdvw1qGuyaRUH__.fast.gva +0 -0
  265. {gammonview-3.6.2 → gammonview-3.8.0}/tests/golden/MYdvw1qGuyaRUH__.fast.gvab +0 -0
  266. {gammonview-3.6.2 → gammonview-3.8.0}/tests/golden/PROVENANCE.json +0 -0
  267. {gammonview-3.6.2 → gammonview-3.8.0}/tests/golden/baR-U643iUDpvzTC.fast.gva +0 -0
  268. {gammonview-3.6.2 → gammonview-3.8.0}/tests/golden/baR-U643iUDpvzTC.fast.gvab +0 -0
  269. {gammonview-3.6.2 → gammonview-3.8.0}/tests/ogxm2_annos_cases.py +0 -0
  270. {gammonview-3.6.2 → gammonview-3.8.0}/tests/ogxm2_blocks_cases.py +0 -0
  271. {gammonview-3.6.2 → gammonview-3.8.0}/tests/ogxm2_fields_cases.py +0 -0
  272. {gammonview-3.6.2 → gammonview-3.8.0}/tests/ogxm2_oracle.py +0 -0
  273. {gammonview-3.6.2 → gammonview-3.8.0}/tests/passthrough_cases.py +0 -0
  274. {gammonview-3.6.2 → gammonview-3.8.0}/tests/regen_golden.py +0 -0
  275. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_alternative_move_steps.py +0 -0
  276. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_analysis_orientation.py +0 -0
  277. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_analyze_position.py +0 -0
  278. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_basefill.py +0 -0
  279. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_bearoff_excess_steps.py +0 -0
  280. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_bgf_alternatives.py +0 -0
  281. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_bgf_cube_response.py +0 -0
  282. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_bgf_move_steps.py +0 -0
  283. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_chunk_passthrough.py +0 -0
  284. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_count_illegal.py +0 -0
  285. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_cube_action_counting.py +0 -0
  286. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_cube_tiers.py +0 -0
  287. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_docs_presets.py +0 -0
  288. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_equity_loss.py +0 -0
  289. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_gvab_writer.py +0 -0
  290. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_illegal_move.py +0 -0
  291. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_illegal_play_branches.py +0 -0
  292. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_illegal_play_steps.py +0 -0
  293. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_legality.py +0 -0
  294. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_loader_formats.py +0 -0
  295. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_luck_fill.py +0 -0
  296. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_merge_resign.py +0 -0
  297. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_met.py +0 -0
  298. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_money_rules.py +0 -0
  299. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm2.py +0 -0
  300. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm23.py +0 -0
  301. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm2_annos.py +0 -0
  302. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm2_blocks.py +0 -0
  303. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm2_blocks_analysis.py +0 -0
  304. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm2_fields.py +0 -0
  305. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm2_fields_analysis.py +0 -0
  306. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm2_limits.py +0 -0
  307. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm2_passthrough.py +0 -0
  308. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm2_reference.py +0 -0
  309. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm2_writer.py +0 -0
  310. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm_conformance.py +0 -0
  311. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm_export.py +0 -0
  312. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm_pipeline.py +0 -0
  313. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_ogxm_stats.py +0 -0
  314. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_parent_watch.py +0 -0
  315. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_position_id.py +0 -0
  316. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_position_moves.py +0 -0
  317. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_presets.py +0 -0
  318. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_read_gvab.py +0 -0
  319. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_reconstruct_mat.py +0 -0
  320. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_resign_actor.py +0 -0
  321. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_resign_errors.py +0 -0
  322. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_restated_play_analysis.py +0 -0
  323. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_screened_checker.py +0 -0
  324. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_share_link.py +0 -0
  325. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_xg_cube.py +0 -0
  326. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_xg_eval_levels.py +0 -0
  327. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_xg_move_steps.py +0 -0
  328. {gammonview-3.6.2 → gammonview-3.8.0}/tests/test_xg_zero_win_eval.py +0 -0
  329. {gammonview-3.6.2 → gammonview-3.8.0}/uv.lock +0 -0
@@ -13,6 +13,46 @@ 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.8.0 — 2026-11-23
17
+
18
+ **Market losers** *(added)*
19
+
20
+ `gvanalysis.dicemap.market_losers` counts the sequences, our roll and then
21
+ their reply, after which a cube decision's side on roll would double and be
22
+ passed: the market lost by not doubling now. It gives the total out of 1296
23
+ and each roll's count out of its 36 replies, with too good counted separately.
24
+ Our roll is played at the map's level and the reply one ply below, as XG's
25
+ "1st roll 2-ply, 2nd roll 1-ply". It is None where there is no market to lose:
26
+ a checker play, the opponent's cube, the Crawford game. `gvan-position --dice`
27
+ prints it under a cube map. Under a second at 2-ply: the 1-ply cube decisions
28
+ go to bgsage as one batch, since `BgBotAnalyzer.cube_action` at 1-ply reloads
29
+ the networks on every call. `@gammonview/engine` 1.1.0 has the same count in
30
+ the browser and is held to these numbers roll for roll.
31
+
32
+ At a position already past its market -- a double/pass, or too good -- the
33
+ count is of **market gainers** instead: the sequences that bring the opponent
34
+ back in, at no double or a double they would take, or win them the game. That
35
+ is what waiting costs, and a too-good position that falls only to a pass has
36
+ lost nothing. The result carries the position's own `decision` at the map's
37
+ level, which says which count to read, and `--dice` prints that one.
38
+
39
+ ## 3.7.0 — 2026-11-21
40
+
41
+ **The dice distribution of a position** *(added)*
42
+
43
+ `gvanalysis.dicemap.dice_distribution` is XG's Dice Distribution as a library
44
+ call. At a cube decision it gives the side on roll's equity after each of the
45
+ 36 rolls' best plays, with each die's average; `doubled=True` gives the rolls
46
+ after a double and a take, in the cube before the double, so the average sits
47
+ beside `double_take_equity` at money and at a match score alike. At a checker
48
+ play it gives the opponent's replies to one play, in the mover's equity, and
49
+ marks each with the cube decision it leaves when the cube is the mover's to
50
+ turn: double/take, double/pass or too good. That is a map XG does not draw, and
51
+ the one that shows why one play beats another. Any n-ply level, 2-ply by
52
+ default: about 0.3s a map, 3s at 3-ply. `gvan-position --dice` prints it, with
53
+ `--play` and `--after-take`. GammonView's position analyser draws the same map
54
+ in the browser and is held to these numbers roll for roll.
55
+
16
56
  ## 3.6.2 — 2026-11-21
17
57
 
18
58
  **An illegal play is flagged wherever it lands** *(fixed)*
@@ -61,8 +61,23 @@ section.
61
61
  `publishConfig.registry`, and GammonView must not carry a scoped `.npmrc`
62
62
  line — either one silently routes the scope away from npmjs. (The retired
63
63
  server's details are in the author's local notes, which are not tracked here.)
64
- - **`gvengine-js/`** — bgsage compiled to WebAssembly for the browser
65
- (`@gammonview/engine`, `private` until gammonview ships it). Its whole promise
64
+ - **`gvengine-js/`** — bgsage compiled to WebAssembly for the browser, with
65
+ the dice map over it (`src/dicemap.js`, the browser half of
66
+ `gvanalysis.dicemap`). Published as **`@gammonview/engine`** from this
67
+ directory, like gvformat-js, and GammonView imports it:
68
+
69
+ ```bash
70
+ cd gvengine-js && npm publish # prepublishOnly checks dist/, then runs the suite
71
+ ```
72
+
73
+ Unlike gvformat-js, the tarball holds a **build**: `dist/` is gitignored and
74
+ made by `./build.sh` (emscripten), so `scripts/prepublish.mjs` refuses a
75
+ missing build, one from another bgsage than `bgsage.version`, or one older
76
+ than `src/entry.cpp`. Its version line is its own (1.0.0 first), as
77
+ gvformat-js's is; the tarball carries `src/entry.cpp` and `build.sh` because
78
+ the build is MPL-2.0 and its source has to travel with it. It needs
79
+ `@gammonview/gvformat` as a peer (the dice map reads OGIDs and the MET).
80
+ Its whole promise
66
81
  is **native bgsage's numbers**: `test/parity.test.mjs` holds every cubeful
67
82
  equity to 5e-6 of `BgBotAnalyzer` on fixtures `scripts/fixtures.py` writes, so
68
83
  a browser and the Studio cannot disagree about a position. A rollout's
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: gammonview
3
- Version: 3.6.2
3
+ Version: 3.8.0
4
4
  Summary: Backgammon match analysis — the pure-Python OGXM/GVA codec (`gvformat`) plus bgsage-powered match and position analysis (`gvanalysis`).
5
5
  Project-URL: Homepage, https://github.com/gammonview/gammonview-analysis
6
6
  Project-URL: Repository, https://github.com/gammonview/gammonview-analysis
@@ -189,7 +189,7 @@ Entry points are defined in `pyproject.toml` and run with `uv run`:
189
189
  |---|---|
190
190
  | `gvan-match` | Analyze a match (`.xg`, `.bgf`, `.mat`, `.gva`/`.ogxm`, `.gvab`), compute per-move PR → `.gva`/`.gvab` |
191
191
  | `gvan-batch` | The same over many files or a directory, one output each |
192
- | `gvan-position` | Analyze a single position from an **XGID or OGID** |
192
+ | `gvan-position` | Analyze a single position from an **XGID or OGID**; `--dice` prints its dice map |
193
193
  | `xg2gva` | Convert an eXtreme Gammon `.xg` file to `.gva` JSON (no engine) |
194
194
  | `bgf2gva` | Convert a BGBlitz `.bgf` file to `.gva` JSON (no engine) |
195
195
 
@@ -200,8 +200,20 @@ uv run gvan-match match.mat --link # print a shareable UR
200
200
  uv run gvan-batch matches/ --preset fast # a dir -> its match files
201
201
  uv run gvan-position "XGID=-b----E-C---eE---c-e----B-:0:-1:1:31:0:0:0:0"
202
202
  uv run gvan-position "11ccccchhhjjjjj:66666888dddddoo:N0N:13:B:R:0:0:0:0"
203
+ uv run gvan-position "<id>" --dice # the equity after each of the 36 rolls
204
+ uv run gvan-position "<id>" --dice --play "13/7 8/7" # a checker play: the replies to that play
203
205
  ```
204
206
 
207
+ `--dice` is XG's Dice Distribution, as `gvanalysis.dicemap.dice_distribution`
208
+ returns it: at a cube decision the side on roll's equity after each roll's best
209
+ play (`--after-take` for the rolls after a double and a take, in the cube
210
+ before the double as D/T is), with each die's average; at a checker play the
211
+ opponent's replies to one play, in your equity, each marked with the cube
212
+ decision it leaves you (D/T, D/P, TG). Under a cube map come its market
213
+ losers (`market_losers`): the sequences of our roll and their reply after which
214
+ we would double and they would pass. Read at 2-ply by default, any n-ply level
215
+ with `--level`.
216
+
205
217
  An input keeps any analysis it already carries — ours is appended as a new
206
218
  block rather than replacing it. (`xg2gva`/`bgf2gva` exist for conversion on its
207
219
  own; analysis does not need them.) `--link` encodes the whole match into a
@@ -160,7 +160,7 @@ Entry points are defined in `pyproject.toml` and run with `uv run`:
160
160
  |---|---|
161
161
  | `gvan-match` | Analyze a match (`.xg`, `.bgf`, `.mat`, `.gva`/`.ogxm`, `.gvab`), compute per-move PR → `.gva`/`.gvab` |
162
162
  | `gvan-batch` | The same over many files or a directory, one output each |
163
- | `gvan-position` | Analyze a single position from an **XGID or OGID** |
163
+ | `gvan-position` | Analyze a single position from an **XGID or OGID**; `--dice` prints its dice map |
164
164
  | `xg2gva` | Convert an eXtreme Gammon `.xg` file to `.gva` JSON (no engine) |
165
165
  | `bgf2gva` | Convert a BGBlitz `.bgf` file to `.gva` JSON (no engine) |
166
166
 
@@ -171,8 +171,20 @@ uv run gvan-match match.mat --link # print a shareable UR
171
171
  uv run gvan-batch matches/ --preset fast # a dir -> its match files
172
172
  uv run gvan-position "XGID=-b----E-C---eE---c-e----B-:0:-1:1:31:0:0:0:0"
173
173
  uv run gvan-position "11ccccchhhjjjjj:66666888dddddoo:N0N:13:B:R:0:0:0:0"
174
+ uv run gvan-position "<id>" --dice # the equity after each of the 36 rolls
175
+ uv run gvan-position "<id>" --dice --play "13/7 8/7" # a checker play: the replies to that play
174
176
  ```
175
177
 
178
+ `--dice` is XG's Dice Distribution, as `gvanalysis.dicemap.dice_distribution`
179
+ returns it: at a cube decision the side on roll's equity after each roll's best
180
+ play (`--after-take` for the rolls after a double and a take, in the cube
181
+ before the double as D/T is), with each die's average; at a checker play the
182
+ opponent's replies to one play, in your equity, each marked with the cube
183
+ decision it leaves you (D/T, D/P, TG). Under a cube map come its market
184
+ losers (`market_losers`): the sequences of our roll and their reply after which
185
+ we would double and they would pass. Read at 2-ply by default, any n-ply level
186
+ with `--level`.
187
+
176
188
  An input keeps any analysis it already carries — ours is appended as a new
177
189
  block rather than replacing it. (`xg2gva`/`bgf2gva` exist for conversion on its
178
190
  own; analysis does not need them.) `--link` encodes the whole match into a
@@ -0,0 +1,476 @@
1
+ # SPDX-License-Identifier: MIT
2
+ # Copyright (C) 2026 Nicholas Vlamis
3
+
4
+ """The dice distribution of a position: how each of the 36 rolls would go.
5
+
6
+ XG calls this the Dice Distribution, and its dice map is a 6x6 grid of the
7
+ equity after each roll. Which rolls depends on the decision:
8
+
9
+ - a **cube decision** is about the roll to come, so it is the side on roll's
10
+ own rolls from the board as it stands -- or, with ``doubled``, from the
11
+ board after a double and a take;
12
+ - a **checker play** is judged by what it leaves, so it is the opponent's
13
+ replies to one play (``play``, or the best one). That is the map XG does
14
+ not draw, and the one that shows *why* one play beats another: the rolls
15
+ that hit, or fail to. Each reply also says what it leaves us at the cube,
16
+ when the cube is ours to turn: double/take, double/pass, too good.
17
+
18
+ Every equity is the analysed player's, whoever rolls, so a number means the
19
+ same thing in both maps; a reply map's are the opponent's negated. And they
20
+ are on ``analyze_position``'s scale: an after-take map is in the cube *before*
21
+ the double, as a cube analysis's ``double_take_equity`` is, so its average sits
22
+ beside that number rather than half of it.
23
+
24
+ Each roll is its best play at ``level``, an n-ply search of every legal play,
25
+ so the weighted average is the decision's own equity one ply deeper: a 2-ply
26
+ map averages, to within a few hundredths, the 3-ply read. The opponent's cube
27
+ is not consulted before a reply: it is the rolls, as if they roll.
28
+
29
+ The same map in a browser is ``gvengine-js/src/dicemap.js``, on the WASM
30
+ engine's trimmed search, and GammonView's position analyser draws it from
31
+ there. ``gvengine-js/test/dicemap.test.mjs`` holds the two together roll for
32
+ roll on fixtures this module writes: exactly at 2-ply, and at 3-ply except
33
+ where the trimmed search's cut to five plays drops the best one.
34
+
35
+ Cost is 21 checker searches, and at a checker play 21 cube decisions more: on
36
+ an M-series Mac about 0.3s at 2-ply and 3s at 3-ply.
37
+
38
+ ``market_losers`` takes a cube map one roll further: for each of our rolls,
39
+ their 21 replies and our cube after each, counting the sequences where we
40
+ would double and they would pass. That is 441 replies and cube decisions, read
41
+ a ply below the map: under a second at 2-ply, where the cube decisions go to
42
+ bgsage as one batch (``_our_cubes`` says why).
43
+ """
44
+
45
+ from __future__ import annotations
46
+
47
+ from typing import TYPE_CHECKING
48
+
49
+ from gvformat.met import mwc_anchors
50
+ from gvformat.ogid import flip_board
51
+
52
+ from .position import PositionState, parse_position_id
53
+ from .positionmove import _key, candidate_boards
54
+
55
+ if TYPE_CHECKING:
56
+ from collections.abc import Iterable
57
+
58
+ #: The levels a map can be read at: n-ply only. Rolling out each of 21 rolls
59
+ #: is a feature of its own, not a level of this one.
60
+ DICE_LEVELS = ("1ply", "2ply", "3ply", "4ply")
61
+
62
+ #: The 21 rolls, and their weight out of 36.
63
+ ROLLS = [(d1, d2, 1 if d1 == d2 else 2) for d1 in range(1, 7) for d2 in range(d1, 7)]
64
+
65
+ _SWAP_OWNER = {"player": "opponent", "opponent": "player"}
66
+
67
+
68
+ class DiceMapError(ValueError):
69
+ """A dice map that cannot be drawn: an unknown play, or a double that
70
+ cannot be made."""
71
+
72
+
73
+ def _round4(x: float) -> float:
74
+ return round(float(x), 4)
75
+
76
+
77
+ def _other_side(side: dict, board: list[int]) -> dict:
78
+ """`side` (a board and its cube and score) from the other player's chair."""
79
+ return {
80
+ **side,
81
+ "board": flip_board(board),
82
+ "cube_owner": _SWAP_OWNER.get(side["cube_owner"], side["cube_owner"]),
83
+ "away1": side["away2"],
84
+ "away2": side["away1"],
85
+ }
86
+
87
+
88
+ def _engine_kwargs(side: dict) -> dict:
89
+ return {k: v for k, v in side.items() if k != "board"}
90
+
91
+
92
+ def _borne_off(board: Iterable[int]) -> bool:
93
+ """Whether the side on roll has no checker left: none on a point, none on
94
+ its bar (index 25)."""
95
+ board = list(board)
96
+ return board[25] == 0 and all(n <= 0 for n in board[:25])
97
+
98
+
99
+ def can_double(state: PositionState) -> bool:
100
+ """Whether `state` is a cube decision whose side on roll may double, and so
101
+ whether an after-take map means anything: not at a checker play, not with
102
+ the cube on the other side, not in the Crawford game."""
103
+ cube_decision = state.force_cube or not (state.die1 and state.die2)
104
+ return cube_decision and state.cube_owner in ("centered", "player") and not state.is_crawford
105
+
106
+
107
+ def _rescale(equity: float, away1: int, away2: int, frm: int, to: int) -> float:
108
+ """An equity read with the cube at `frm`, restated with it at `to`, through
109
+ the match winning chances it stands for. Money's anchors are fixed, so
110
+ there it is a plain ratio; at a match score a cube level moves both."""
111
+ if not away1 or not away2:
112
+ return equity * frm / to
113
+ win_f, loss_f = mwc_anchors(away1, away2, frm)
114
+ win_t, loss_t = mwc_anchors(away1, away2, to)
115
+ mwc = (win_f + loss_f) / 2 + equity * (win_f - loss_f) / 2
116
+ return (2 * mwc - (win_t + loss_t)) / (win_t - loss_t)
117
+
118
+
119
+ def _sweep(analyzer, side: dict) -> list[dict]:
120
+ """The 21 rolls of whoever is on roll in `side`, each at the roller's own
121
+ equity after their best play, with the board that play leaves.
122
+
123
+ A roll with no play leaves the board as it is, so it is worth the other
124
+ side's turn from there, negated: their no-double equity at the same depth.
125
+ A result reading the roller's last checker off as a loss -- 1-ply's
126
+ terminal misread, which luck guards against too -- is taken as a single
127
+ win.
128
+ """
129
+ kwargs = _engine_kwargs(side)
130
+ dance = None
131
+ out = []
132
+ for d1, d2, weight in ROLLS:
133
+ moves = analyzer.checker_play(side["board"], d1, d2, **kwargs).moves
134
+ if not moves:
135
+ if dance is None:
136
+ other = _other_side(side, side["board"])
137
+ dance = -float(analyzer.cube_action(other["board"], **_engine_kwargs(other)).equity_nd)
138
+ out.append({"dice": [d1, d2], "weight": weight, "equity": dance, "board": list(side["board"])})
139
+ continue
140
+ best = moves[0]
141
+ equity = float(best.equity)
142
+ if equity < -0.9 and _borne_off(best.board):
143
+ equity = 1.0
144
+ out.append({"dice": [d1, d2], "weight": weight, "equity": equity, "board": list(best.board)})
145
+ return out
146
+
147
+
148
+ def _our_cube(analyzer, ours: dict) -> str | None:
149
+ """The cube decision a reply leaves us, at the rolls' own depth:
150
+ "double_take" or "double_pass" for a correct double, "too_good" for a
151
+ position that would be a pass but is better played on, None for no
152
+ double."""
153
+ return _cube_mark(analyzer.cube_action(ours["board"], **_engine_kwargs(ours)))
154
+
155
+
156
+ def _cube_mark(action) -> str | None:
157
+ """A ``CubeActionResult`` as ``_our_cube`` names it."""
158
+ if action.should_double:
159
+ return "double_take" if action.should_take else "double_pass"
160
+ return None if action.should_take else "too_good"
161
+
162
+
163
+ def _our_side(state: PositionState, jacoby: bool | None, beaver: bool | None) -> dict:
164
+ """The side on roll's board, cube and score, with the money rules read from
165
+ the id when None, as ``analyze_position`` reads them."""
166
+ money = not state.away1 and not state.away2
167
+ if jacoby is None:
168
+ jacoby = state.jacoby if state.jacoby is not None else True
169
+ if beaver is None:
170
+ beaver = state.beaver if state.beaver is not None else True
171
+ return {
172
+ "board": list(state.board), "cube_value": state.cube_value, "cube_owner": state.cube_owner,
173
+ "away1": state.away1, "away2": state.away2, "is_crawford": state.is_crawford,
174
+ "jacoby": bool(jacoby) and money, "beaver": bool(beaver) and money,
175
+ }
176
+
177
+
178
+ def die_averages(rolls: list[dict]) -> list[float]:
179
+ """Each die's average over the 6x6 grid: the mean of the six cells in its
180
+ column, so of the 11 rolls showing that number with the double counted
181
+ once. The six together average to the map's own average."""
182
+ equity = {tuple(r["dice"]): r["equity"] for r in rolls}
183
+ return [
184
+ _round4(sum(equity[(min(d, e), max(d, e))] for e in range(1, 7)) / 6)
185
+ for d in range(1, 7)
186
+ ]
187
+
188
+
189
+ def dice_distribution(
190
+ position_id: str,
191
+ *,
192
+ level: str = "2ply",
193
+ play: str | None = None,
194
+ doubled: bool = False,
195
+ analyzer=None,
196
+ jacoby: bool | None = None,
197
+ beaver: bool | None = None,
198
+ ) -> dict:
199
+ """The dice map of a position, as a dict.
200
+
201
+ ``position_id`` is an XGID or an OGID, and which decision it poses is read
202
+ as ``analyze_position`` reads it. At a checker play ``play`` names the play
203
+ whose replies to map, in the notation ``analyze_position`` gives it; left
204
+ as None it is the best play at ``level``. At a cube decision ``doubled``
205
+ maps the rolls after a double and a take.
206
+
207
+ ``analyzer`` is a prebuilt ``BgBotAnalyzer`` at ``level``, as for
208
+ ``analyze_position``. ``jacoby`` and ``beaver`` are the money rules, read
209
+ from the id when None exactly as there.
210
+
211
+ Returns ``{"position_id", "eval_level", "roller", "doubled", "play",
212
+ "average", "won", "rolls", "die_averages", "elapsed"}``. ``roller`` is
213
+ "mover" for a cube decision and "opponent" for a checker play; ``play`` is
214
+ the play mapped, or None. Each of the 21 ``rolls`` is ``{"dice": [a, b]
215
+ (a <= b), "weight": 1 or 2 (out of 36), "equity"}``, and at a checker play
216
+ where the cube is ours after their roll, ``"cube"`` too (``_our_cube``).
217
+ A play that bears off the last checker has no replies: ``won`` is True,
218
+ ``rolls`` is empty and ``average`` None.
219
+
220
+ Raises ``DiceMapError`` for a ``play`` that is not one (or is given at a
221
+ cube decision), or ``doubled`` where the side on roll cannot double;
222
+ ``ValueError`` for another level.
223
+ """
224
+ import time
225
+
226
+ if level not in DICE_LEVELS:
227
+ raise ValueError(f"level must be one of {list(DICE_LEVELS)}, got {level!r}")
228
+ state = parse_position_id(position_id)
229
+ checker = bool(state.die1 and state.die2) and not state.force_cube
230
+ if doubled and not can_double(state):
231
+ raise DiceMapError("the side on roll cannot double here")
232
+ if play is not None and not checker:
233
+ raise DiceMapError("a cube decision has no play to map the replies to")
234
+
235
+ if analyzer is None:
236
+ from bgsage import BgBotAnalyzer
237
+ analyzer = BgBotAnalyzer(eval_level=level, cubeful=True)
238
+ ours = _our_side(state, jacoby, beaver)
239
+
240
+ started = time.perf_counter()
241
+ result = {
242
+ "position_id": position_id.strip(),
243
+ "eval_level": level,
244
+ "roller": "opponent" if checker else "mover",
245
+ "doubled": bool(doubled),
246
+ "play": None,
247
+ }
248
+
249
+ if checker:
250
+ boards = candidate_boards(state)
251
+ if play is None:
252
+ from bgsage.text_export import compute_move_notation
253
+ best = analyzer.checker_play(state.board, state.die1, state.die2, **_engine_kwargs(ours)).moves[0]
254
+ after = list(best.board)
255
+ play = compute_move_notation(state.board, after, state.die1, state.die2)
256
+ else:
257
+ after = boards.get(_key(play))
258
+ if after is None:
259
+ raise DiceMapError(f"{play!r} is not a legal play of {state.die1}{state.die2} here")
260
+ result["play"] = " ".join(str(play).split())
261
+ roller = _other_side(ours, after)
262
+ # The mover's checkers, seen from the replying side, are its negatives
263
+ # and its bar (index 0): none left is a game already over.
264
+ if roller["board"][0] == 0 and all(n >= 0 for n in roller["board"]):
265
+ result.update(average=None, won=True, rolls=[], die_averages=[])
266
+ result["elapsed"] = round(time.perf_counter() - started, 3)
267
+ return result
268
+ else:
269
+ roller = dict(ours)
270
+ if doubled:
271
+ roller["cube_value"] = state.cube_value * 2
272
+ roller["cube_owner"] = "opponent"
273
+
274
+ # Our cube after their reply: ours to turn unless they own it, and not in
275
+ # the Crawford game. The play moved no cube, so it is as the decision had it.
276
+ ours_to_turn = checker and state.cube_owner in ("centered", "player") and not state.is_crawford
277
+ sign = -1 if checker else 1
278
+ rolls = []
279
+ for r in _sweep(analyzer, roller):
280
+ equity = r["equity"]
281
+ if doubled:
282
+ equity = _rescale(equity, state.away1, state.away2, roller["cube_value"], state.cube_value)
283
+ row = {"dice": r["dice"], "weight": r["weight"], "equity": _round4(sign * equity)}
284
+ if ours_to_turn:
285
+ row["cube"] = _our_cube(analyzer, {**ours, "board": flip_board(r["board"])})
286
+ rolls.append(row)
287
+
288
+ result.update(
289
+ average=_round4(sum(r["weight"] * r["equity"] for r in rolls) / 36),
290
+ won=False,
291
+ rolls=rolls,
292
+ die_averages=die_averages(rolls),
293
+ )
294
+ result["elapsed"] = round(time.perf_counter() - started, 3)
295
+ return result
296
+
297
+
298
+ #: The levels market losers can be counted at: the map's, with one ply below
299
+ #: it for the reply and the cube after it.
300
+ MARKET_LEVELS = ("2ply", "3ply", "4ply")
301
+
302
+
303
+ def market_losers(
304
+ position_id: str,
305
+ *,
306
+ level: str = "2ply",
307
+ analyzer=None,
308
+ reply_analyzer=None,
309
+ jacoby: bool | None = None,
310
+ beaver: bool | None = None,
311
+ ) -> dict | None:
312
+ """The market losers of a cube decision: the sequences -- our roll, then
313
+ their reply -- after which we would double and they would pass. Not
314
+ doubling now loses our market on exactly these.
315
+
316
+ Our roll is played at ``level``, as ``dice_distribution`` plays it; their
317
+ reply and our cube after it one ply shallower, XG's "1st roll 2-ply, 2nd
318
+ roll 1-ply". Too good counts, separately: they would pass, and the market
319
+ is as lost. Their cube is not consulted after our roll, as in any count of
320
+ market losers.
321
+
322
+ A position already past the market has none to lose, so the same sweep
323
+ counts its market gainers: the sequences that bring the opponent back in
324
+ -- no double, or a double they would take -- or win them the game. They
325
+ are what waiting costs, at a pass and at too good alike. ``decision`` is
326
+ the position's own cube decision at ``level``, named as ``_our_cube``
327
+ names it, which says which count is the one to read.
328
+
329
+ ``analyzer`` is a ``BgBotAnalyzer`` at ``level`` and ``reply_analyzer``
330
+ one a ply below it, each built when None.
331
+
332
+ Returns ``{"position_id", "eval_level", "decision", "pass", "too_good",
333
+ "gainers", "rolls", "elapsed"}``, the counts out of 1296 sequences, and
334
+ each of the 21 ``rolls`` ``{"dice", "weight", "pass", "too_good",
335
+ "gainers"}`` out of its 36 replies. None where there is no market to lose: a checker play, the cube
336
+ theirs, the Crawford game. ``ValueError`` for another level.
337
+ """
338
+ import time
339
+
340
+ if level not in MARKET_LEVELS:
341
+ raise ValueError(f"level must be one of {list(MARKET_LEVELS)}, got {level!r}")
342
+ state = parse_position_id(position_id)
343
+ if not can_double(state):
344
+ return None
345
+ reply_level = f"{int(level[0]) - 1}ply"
346
+ if analyzer is None or reply_analyzer is None:
347
+ from bgsage import BgBotAnalyzer
348
+ analyzer = analyzer or BgBotAnalyzer(eval_level=level, cubeful=True)
349
+ reply_analyzer = reply_analyzer or BgBotAnalyzer(eval_level=reply_level, cubeful=True)
350
+
351
+ started = time.perf_counter()
352
+ ours = _our_side(state, jacoby, beaver)
353
+ decision = _our_cube(analyzer, ours)
354
+ rolls = []
355
+ # Every sequence's board, gathered first so the cube decisions can go
356
+ # to bgsage in one batch: (our roll's row, the reply's weight, our side).
357
+ sequences = []
358
+ for r in _sweep(analyzer, ours):
359
+ row = {"dice": r["dice"], "weight": r["weight"], "pass": 0, "too_good": 0, "gainers": 0}
360
+ rolls.append(row)
361
+ # Our last checker off: the game is over, with no market in it.
362
+ if _borne_off(r["board"]):
363
+ continue
364
+ theirs = _other_side(ours, r["board"])
365
+ for reply in _sweep(reply_analyzer, theirs):
366
+ # Their last checker off: a game lost -- no market, but what
367
+ # cashing would have saved.
368
+ if _borne_off(reply["board"]):
369
+ row["gainers"] += reply["weight"]
370
+ else:
371
+ sequences.append((row, reply["weight"], {**ours, "board": flip_board(reply["board"])}))
372
+ for (row, weight, _), cube in zip(sequences, _our_cubes(reply_analyzer, reply_level, [s for *_, s in sequences])):
373
+ if cube == "double_pass":
374
+ row["pass"] += weight
375
+ elif cube == "too_good":
376
+ row["too_good"] += weight
377
+ else:
378
+ row["gainers"] += weight
379
+ return {
380
+ "position_id": position_id.strip(),
381
+ "eval_level": level,
382
+ "decision": decision,
383
+ "pass": sum(r["weight"] * r["pass"] for r in rolls),
384
+ "too_good": sum(r["weight"] * r["too_good"] for r in rolls),
385
+ "gainers": sum(r["weight"] * r["gainers"] for r in rolls),
386
+ "rolls": rolls,
387
+ "elapsed": round(time.perf_counter() - started, 3),
388
+ }
389
+
390
+
391
+ def _our_cubes(analyzer, level: str, sides: list[dict]) -> list[str | None]:
392
+ """``_our_cube`` for each of `sides`, at `level`.
393
+
394
+ At 1-ply, through ``bgsage.batch_cube_action``, which loads the networks
395
+ once for the batch. ``BgBotAnalyzer.cube_action`` at 1-ply hands bgsage
396
+ the weight files to load on every call: about 23ms each, which is 10s for
397
+ a market count, where the batch takes a tenth of a second. Both read
398
+ Janowski's cube off the same 1-ply probabilities, and agree exactly.
399
+ Deeper, the batch would not be the same reading -- it puts Janowski on the
400
+ n-ply probabilities rather than searching the cube -- so each side goes to
401
+ the analyzer, which keeps its networks loaded at n-ply.
402
+ """
403
+ if level != "1ply":
404
+ return [_our_cube(analyzer, side) for side in sides]
405
+ from bgsage import batch_cube_action
406
+
407
+ if not sides:
408
+ return []
409
+ keys = ("board", "cube_value", "cube_owner", "away1", "away2", "is_crawford")
410
+ results = batch_cube_action([{k: side[k] for k in keys} for side in sides], eval_level="1ply",
411
+ jacoby=sides[0]["jacoby"], beaver=sides[0]["beaver"])
412
+ return [_cube_mark(action) for action in results]
413
+
414
+
415
+ def print_market_losers(result: dict) -> None:
416
+ """The count that matters, and the rolls it falls on: market losers below
417
+ the pass line, market gainers at a pass or too good."""
418
+ if result["decision"] in ("double_pass", "too_good"):
419
+ said = {"double_pass": "a double/pass", "too_good": "too good"}[result["decision"]]
420
+ n = result["gainers"]
421
+ print(f" Market gainers: {n} of 1296 sequences ({n / 12.96:.1f}%) -- {said} at {result['eval_level']}.")
422
+ count = lambda r: r["gainers"]
423
+ else:
424
+ n = result["pass"] + result["too_good"]
425
+ line = f" Market losers: {n} of 1296 sequences ({n / 12.96:.1f}%)"
426
+ if result["too_good"]:
427
+ line += f", {result['too_good']} of them too good"
428
+ print(line + ".")
429
+ count = lambda r: r["pass"] + r["too_good"]
430
+ for r in result["rolls"]:
431
+ if count(r):
432
+ print(f" {r['dice'][0]}-{r['dice'][1]}: {count(r)} of 36 replies")
433
+
434
+
435
+ _CUBE_TAG = {"double_take": "D/T", "double_pass": "D/P", "too_good": "TG"}
436
+
437
+
438
+ def print_dice_map(result: dict) -> None:
439
+ """The map as XG lays it out: a 6x6 grid, each die's average beneath."""
440
+ if result["roller"] == "opponent":
441
+ print(f"Replies to {result['play']}, at {result['eval_level']} (your equity):")
442
+ else:
443
+ after = ", after a double and a take" if result["doubled"] else ""
444
+ print(f"Rolls for the side on roll{after}, at {result['eval_level']}:")
445
+ if result["won"]:
446
+ print(" The play bears off the last checker: there are no replies.")
447
+ return
448
+ by_dice = {tuple(r["dice"]): r for r in result["rolls"]}
449
+ tagged = any("cube" in r for r in result["rolls"])
450
+ width = 11 if tagged else 8
451
+
452
+ def cell(text: str) -> str:
453
+ return text.ljust(width)
454
+
455
+ print(" " + "".join(cell(str(d)) for d in range(1, 7)))
456
+ for a in range(1, 7):
457
+ row = []
458
+ for b in range(1, 7):
459
+ r = by_dice[(min(a, b), max(a, b))]
460
+ tag = _CUBE_TAG.get(r.get("cube"), "")
461
+ row.append(cell(f"{r['equity']:+.3f}" + (f" {tag}" if tag else "")))
462
+ print(f" {a} " + "".join(row))
463
+ print(" Avg " + "".join(cell(f"{x:+.3f}") for x in result["die_averages"]))
464
+ print(f" Average {result['average']:+.4f}")
465
+ if tagged:
466
+ counts = {k: 0 for k in _CUBE_TAG}
467
+ for r in result["rolls"]:
468
+ if r.get("cube"):
469
+ counts[r["cube"]] += r["weight"]
470
+ doubles = counts["double_take"] + counts["double_pass"]
471
+ line = f" After their reply you have a double on {doubles} of 36 rolls"
472
+ if counts["double_pass"]:
473
+ line += f", {counts['double_pass']} of them a pass (D/P)"
474
+ if counts["too_good"]:
475
+ line += f"; {counts['too_good']} are too good to double (TG)"
476
+ print(line + ".")