Repository navigation
Hard relief - #13
Merged
Merged
Hard relief#13
Conversation
record() compared each new assembly with every assembly already found, and worked out both canonical forms again for each comparison. The cost grew with the square of the number found: a footprint with tens of thousands of assemblies (the flat Pleat puzzles of tropical-puzzle-lab) took about nine hours to reach 1.5 million nodes. The search now keeps the canonical form of each assembly in a list sorted by the tolerant order on forms, and bisects it. Under the module's gap argument that order is total on forms that differ, so the same assemblies are found, kept in the same order and counted as duplicates the same way: no count in any table moves. plt1-flat at 80 000 nodes: 3 593 assemblies, 89.6 s before, 2.4 s now; 1.5 million nodes in 46 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jfg9ffdDE7wGdk3wwUWE5H
…dator's union Fixtures and keys regenerated from tropical-puzzle-lab d3153f5b6a84, which adds plt1 to plt5: grids of triangles with every corner at one of two heights, built to be hard for the contact search with roofs on. Relief, a whole search takes 7 488 to 21 973 nodes with one assembly, against cor1's 1 529; flat, the search stops at the node limit with tens of thousands of assemblies found. - All ten Pleat fixtures are in corpus.EXPENSIVE: the suite reads their rows from the committed tables and does not search them. The footprints are also UNFINISHED. tests/corpus/test_hard_relief.py is the exit test. - CP-SAT is not given the Pleat footprints in the corpus manifest: it would enumerate every assembly of a listing stopped at the limit. - The Pleat rows of corpus.md and edge_to_edge.md come from the two manifests run --only on the Pleat fixtures; no other row moves. The validator's uncovered area came from GEOS's floating-point union, which lost a whole piece on some assemblies (GEOS 3.14): 810 mm^2 of CP-SAT's plt4 assembly, up to 7 % of the edge-to-edge Pleat footprint assemblies, and cor1's own answer key turned half round with the tray. The union is now snap-rounded to a 1e-9 mm grid. The new test, every key turned with the tray validates, failed on cor1 before the fix. Two test oracles had the same union and are corrected too; the Rust geometry was right throughout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jfg9ffdDE7wGdk3wwUWE5H
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.
Add the Pleat puzzles to the corpus: relief puzzles harder than
cor1Imports
plt1–plt5from maxpluslab/tropical-puzzle-lab atd3153f5. Each is a grid of rectangles cut along their diagonals, with every corner at one of two heights. They were built so that this search finds them hard with their roofs on. The corpus grows from 18 to 28 fixtures and from nine to fourteen constructions.Merge after the tropical-puzzle-lab
lifted-familyPR. CI checks that repository out atd3153f5.What the corpus table now says
cor1(for comparison)plt1plt2plt3plt4plt5plt1-flat…plt5-flatplt5-flattests/corpus/test_hard_relief.py): a Pleat relief puzzle takes at least 10 000 nodes with one assembly, more thancor1, which had been the hardest. Every 32-piece Pleat is pastcor1.cor1's 967 nodes, because most wrong matches are a short edge part way along a long one. CP-SAT, choosing among the same placements, settles each without a conflict.Keeping the suite small
The Pleat searches are not run in the suite.
corpus.EXPENSIVE: all ten Pleat fixtures are in it, so the tests read their rows fromhe fullmaxplus-bench runchecks those rows against a search.corpus.UNFINISHED: the five footprints are in it too; their searches stop at the node limit.benchmarks/manifests/corpus.toml. Thelimit, and CP-SAT would then enumerate every assembly of it. One attempt grew past 2.5 GB.--onlyon the ten Pleat fixtures. No other row moves.The whole suite takes about 2 min 40 s.
Fixes the Pleat puzzles forced
1. The duplicate check was quadratic (
08da344). Each new assembly was compared with every earlier one. That cost grows with the square of the number found, and a Pleat footprint with tens of thousands ofassemblies would have taken about nine hours.
canonical::Form,Symmetry::compare_forms). The same assemblies are found and counted.plt1-flattook 89.6 s before and 2.4 s after.2. The validator lost whole pieces (
f27f246). Uncovered area came from GEOS's floating-point union (Shapely on GEOS 3.14), which can silently drop a whole piece. It wrongly failed:plt4assembly;cor1's own answer key turned half round with the tray, a puzzle already in the corpus.The union is now snap-rounded to a 1e-9 mm grid (
validation.GRID_MM). The regression test, every answer key turned with the tray validates, failed oncor1before the fix. No row already committed had beenaffected: those runs happened to avoid the bug.
3. Two test oracles relied on Shapely with no margin. The Rust geometry was right in both
Other test changes
test_benchmark.py: the thinning test allows Pleat less thinning, and a new test pins that Pleat leaves each edge many mates. The tolerance experiment was run before Pleat existed, so its test now leaves Pleat out explicitly.test_edge_to_edge.py: adds the edge-to-edge assembly counts for the Pleat footprints.imit with assemblies found now counts as "solved, not whole".EXPENSIVE. Their bookkeeping tests list exactly what is left out.Docs
README.md: a finding, "Roofs can be made to help less".docs/experiments.md: what the corpus table shows for Pleat.docs/algorithms.md: Pleat rows in the edge-to-edge table, and a paragraph.docs/roadmap.md: a dated entry for this addition.CLAUDE.md: the list of fixtures inEXPENSIVE.Checks
uv run pytest: 2024 passed, including the comparison of the fixtures with the tropical-puruff check,ruff format --checkandpyrightare clean.cargo fmt,clippy -D warningsandcargo testare clean.🤖 Generated with Claude Code