tools: cross the DEEPEST showcase with a database of published helpmates - #30
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/published_problems.py --published FILE --data docs/DEEPEST.json --tables ~/tb --binary ./build/helpmateNo. N (id: …), author,source k:lines, board in German piece letters K D T L S B,stipulation:,solution:).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 asalternativewith solution and themes.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 regenerationmake lintclean🤖 Generated with Claude Code
https://claude.ai/code/session_01DFQB6YogM3gaauunTfMuxW