Repository navigation
Phase 5: the Rust contact search, with roofs, pruning and symmetry - #6
Merged
Merged
Conversation
rust.contact_dfs runs the corner contact search in one call into Rust, in the footprint and relief regimes. It solves all 16 corpus fixtures, runs every search to its end, and every assembly it returns passes the independent validator. Every rule beyond the prototype's is an option that can be switched off, and the whole search is tested to find the same assemblies either way: roof continuity in candidate generation, cavity pruning, closure pruning, a one-placement lookahead (off by default), an anchor piece and canonical forms to take out the tray's rotations, and the order in which candidates are tried. docs/algorithms.md has the argument for each rule and the ablation tables. Also: cavities and roof steps in tiling-geometry, canonical forms in tiling-search, differential tests against Shapely and the validator, SolverSpec with a candidate set per regime, and maxplus-solve --option. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jfg9fgTR9LYn4D2rTtfifs
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jfg9fgTR9LYn4D2rTtfifs
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jfg9fgTR9LYn4D2rTtfifs
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.
Chained on #5 (phases 2 to 4 into
main); the base isphase-3-geometry, so the diff is phase 5 alone.What it adds
rust.contact_dfs: the corner contact search of the Python prototype, run in one call into Rust, in the footprint and relief regimes. It solves all 16 corpus fixtures, runs every search to its end, and every assembly it returns passes the independent validator.Every rule beyond the prototype's is an option that can be switched off, and the whole search is tested to find the same assemblies with it on and off. The point is to measure what makes a puzzle hard and what helps, not to be fast.
corner-contact-relief/1.tiling-search::canonical) to drop repeats.tray_rotations=allrestores the prototype's counting.Also
SolverSpecwith a candidate set per regime,maxplus-solve --option NAME=VALUE, andtiling-geometry's proptest strategies behind atestingfeature.Findings
Relative to the candidates generated, in
f64with tolerances. Tables and arguments are indocs/algorithms.md.rat1-flathas 101 andrat2-flathas 2.rat2-flattakes an eighth of the nodes of the 16-piecenew1-flat.Tests
tests/corpus/test_rust_contact_dfs.py. All 16 fixtures in their own regime, validated, key found once, first-solution and exhaust times separate; same assemblies as the prototype on the five fixtures it can finish, and the same node counts with the additions off._nativecall; every search rule is a documented switch.A bug this found: canonical forms ignored that congruent pieces are stored at unrelated rotations. The validator caught it on the synthetic fixtures.
The two 16-piece whole searches are marked
slowand still run in CI; they add a few minutes. The roadmap marks phase 5 as awaiting CI and is ticked in a follow-up commit once both platforms pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01Jfg9fgTR9LYn4D2rTtfifs