Skip to content

tools: cross the DEEPEST showcase with a database of published helpmates - #30

Merged
osick merged 1 commit into
mainfrom
tools/published-problems
Sep 13, 2026
Merged

osick merged 1 commit into
mainfrom
tools/published-problems

Conversation

@osick

@osick osick commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Summary

tools/published_problems.py --published FILE --data docs/DEEPEST.json --tables ~/tb --binary ./build/helpmate

  • Parses the plain-text database (one block per problem: No. N (id: …), author, source k: lines, board in German piece letters K D T L S B, stipulation:, solution:).
  • Matches every showcase position under every mirroring: all eight board symmetries when pawnless, the two that keep pawns moving up otherwise.
  • For a published showcase entry: writes published (author, sources, stipulation, id) into DEEPEST.json and asks the tablebase for an unpublished position of the same material and depth with a unique solution (mine --dtm D --count 1, first hit not in the database under any mirroring), stored as alternative with solution and themes.
  • DEEPEST.md shows a Published line on the card and a sibling card No. N b; the booklet renders the sibling as its own entry. The JSON is rewritten only when something changed.
  • Result with the database on hand (8,952 problems, 8,878 of them h#2): none of the 234 showcase problems (h#6..h#17) is in it, so the shipped documents change only by one header sentence. sampledata/ is git-ignored.

Test plan

  • tests/repo/test_published_problems.py: parsing and German-letter conversion, symmetry invariants (8 vs 2 mirrorings), index lookup of a mirrored German-letter block, annotate adds publication + alternative and skips the entry itself and published candidates, no-op without matches, the real database parses and matches nothing today (skipped when the file is absent)
  • tests/repo/test_deepest_render.py: 86 pass incl. the staleness checks after regeneration
  • End to end against the real tablebase with a synthetic published block: KQvk got its Published line and an unpublished h#6 sibling; the synthetic booklet compiles (132 pages)
  • make lint clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01DFQB6YogM3gaauunTfMuxW

tools/published_problems.py parses the plain-text database format (one block
per problem: No./id, author, sources, board in German piece letters,
stipulation, solution), matches showcase positions under every mirroring
(all eight symmetries pawnless, the two that keep pawns moving up otherwise),
writes `published` into DEEPEST.json for every entry the database contains,
and for each such entry asks the tablebase (mine --dtm D --count 1) for an
unpublished position of the same material and depth, stored as `alternative`
with its solution and themes. DEEPEST.md renders a Published line and a
sibling card "No. N b"; the booklet renders the same as its own entry. JSON
is rewritten only when something changed.

The database on hand (sampledata/hmatt_lower7.fen: 8,952 problems, 8,878 of
them h#2) contains none of the 234 showcase problems (h#6..h#17), so the
shipped documents change only by a header sentence. The matching path is
covered by tests with a synthetic block built from a real showcase position,
mirrored and written in German letters, and was exercised end to end against
the real tablebase. sampledata/ is git-ignored.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DFQB6YogM3gaauunTfMuxW
@osick
osick merged commit a334cc8 into main Sep 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant