From 08da3441a41652b39d0bddbb67d5297b2ea8c051 Mon Sep 17 00:00:00 2001 From: Igor Kuvychko Date: Mon, 16 Nov 2026 12:21:31 -0800 Subject: [PATCH 1/2] Check new assemblies against earlier ones by bisection, not one by one 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 Claude-Session: https://claude.ai/code/session_01Jfg9ffdDE7wGdk3wwUWE5H --- crates/tiling-search/src/canonical.rs | 53 ++++++++++++++++++++++++- crates/tiling-search/src/contact_dfs.rs | 27 ++++++++++--- 2 files changed, 74 insertions(+), 6 deletions(-) diff --git a/crates/tiling-search/src/canonical.rs b/crates/tiling-search/src/canonical.rs index bfaacae..9792338 100644 --- a/crates/tiling-search/src/canonical.rs +++ b/crates/tiling-search/src/canonical.rs @@ -49,6 +49,13 @@ pub struct Placement { pub turn: f64, } +/// The canonical form of an assembly, kept so that later assemblies can be +/// compared with it without working it out again. [`Symmetry::compare_forms`] +/// orders forms; under the gap argument above, that order is total on forms +/// that differ, so a sorted list of forms can be searched by bisection. +#[derive(Debug, Clone)] +pub struct Form(Vec); + /// The symmetries of one puzzle: of its tray, and of and among its pieces. #[derive(Debug, Clone)] pub struct Symmetry { @@ -243,13 +250,30 @@ impl Symmetry { /// every assembly that differs from this one only by exchanging congruent /// pieces, turning pieces onto themselves, or turning the tray. pub fn canonical(&self, poses: &[Pose]) -> Vec { - self.canonical_seats(poses) + self.poses(&self.form(poses)) + } + + /// The canonical form of an assembly, for comparing with others. + pub fn form(&self, poses: &[Pose]) -> Form { + Form(self.canonical_seats(poses)) + } + + /// The poses a form stands for: [`Symmetry::canonical`] of any assembly with this form. + pub fn poses(&self, form: &Form) -> Vec { + form.0 .iter() .enumerate() .map(|(piece, seat)| self.pose(piece, seat)) .collect() } + /// The tolerant order on forms: `Equal` exactly when [`Symmetry::same`] would say so. + pub fn compare_forms(&self, a: &Form, b: &Form) -> Ordering { + a.0.len() + .cmp(&b.0.len()) + .then_with(|| self.compare_all(&a.0, &b.0)) + } + /// Whether two assemblies have the same canonical form. pub fn same(&self, a: &[Pose], b: &[Pose]) -> bool { a.len() == b.len() @@ -304,6 +328,33 @@ mod tests { ) } + #[test] + fn forms_compare_equal_exactly_when_assemblies_are_the_same() { + let (tray, pieces) = strips(); + let symmetry = symmetry_of(&tray, &pieces); + // Strip on the left, and the same turned a quarter with the tray: one assembly. + let left = [at(0.5, 2.0, 0.0), at(2.5, 2.0, 0.0)]; + let bottom = [at(2.0, 0.5, FRAC_PI_2), at(2.0, 2.5, FRAC_PI_2)]; + // Not a tiling, but a different arrangement: the strip moved 1 mm in. + let inside = [at(1.5, 2.0, 0.0), at(2.5, 2.0, 0.0)]; + let form = |poses: &[Pose]| symmetry.form(poses); + assert!(symmetry.compare_forms(&form(&left), &form(&bottom)).is_eq()); + let (a, b) = (form(&left), form(&inside)); + assert!(!symmetry.same(&left, &inside)); + assert!(symmetry.compare_forms(&a, &b).is_ne()); + // Antisymmetric, so a sorted list of forms can be bisected. + assert_eq!( + symmetry.compare_forms(&a, &b), + symmetry.compare_forms(&b, &a).reverse() + ); + // The poses of a form are the canonical form of the assembly. + let canonical = symmetry.canonical(&bottom); + for (p, q) in symmetry.poses(&form(&bottom)).iter().zip(&canonical) { + assert!((p.x - q.x).abs() <= 1e-12 && (p.y - q.y).abs() <= 1e-12); + assert!((p.theta - q.theta).abs() <= 1e-12); + } + } + #[test] fn the_four_turns_of_an_assembly_have_one_form() { let (tray, pieces) = strips(); diff --git a/crates/tiling-search/src/contact_dfs.rs b/crates/tiling-search/src/contact_dfs.rs index a8c4bd5..0e1fb66 100644 --- a/crates/tiling-search/src/contact_dfs.rs +++ b/crates/tiling-search/src/contact_dfs.rs @@ -57,7 +57,7 @@ use tiling_geometry::{ Meeting, Shape, centroid, least_width, signed_area, transform, }; -use crate::canonical::{Placement, Symmetry}; +use crate::canonical::{Form, Placement, Symmetry}; /// What to do about assemblies that are turns of one another. #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -458,6 +458,11 @@ struct Search<'a> { angle_slack: f64, stats: Stats, solutions: Vec>, + /// The forms of the solutions found, in the order of `Symmetry::compare_forms`, + /// so that a new assembly is checked against all of them by bisection. Comparing + /// it with each in turn costs the square of the number found, hours for a + /// footprint with tens of thousands of assemblies. + forms: Vec
, started: Instant, first_solution: Option, stopped: bool, @@ -683,11 +688,22 @@ impl Search<'_> { let poses = match self.options.tray_rotations { TrayRotations::All => poses, TrayRotations::Once => { - if self.solutions.iter().any(|s| self.symmetry.same(s, &poses)) { - self.stats.duplicates += 1; - return; + let form = self.symmetry.form(&poses); + let symmetry = &self.symmetry; + match self + .forms + .binary_search_by(|f| symmetry.compare_forms(f, &form)) + { + Ok(_) => { + self.stats.duplicates += 1; + return; + } + Err(at) => { + let canonical = self.symmetry.poses(&form); + self.forms.insert(at, form); + canonical + } } - self.symmetry.canonical(&poses) } }; self.solutions.push(poses); @@ -857,6 +873,7 @@ pub fn solve( angle_slack: tolerance.angle * (count + 1) as f64, stats: Stats::default(), solutions: Vec::new(), + forms: Vec::new(), started, first_solution: None, stopped: false, From f27f2465d10dc85ae986e6cbb5b2cbfb1a0215c3 Mon Sep 17 00:00:00 2001 From: Igor Kuvychko Date: Mon, 16 Nov 2026 15:10:43 -0800 Subject: [PATCH 2/2] Add the Pleat puzzles to the corpus, and fix a lost piece in the validator'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 Claude-Session: https://claude.ai/code/session_01Jfg9ffdDE7wGdk3wwUWE5H --- CLAUDE.md | 2 +- README.md | 4 +- benchmarks/fixtures/cor1-flat.json | 2 +- benchmarks/fixtures/cor1.json | 2 +- benchmarks/fixtures/index.json | 200 +++++++- benchmarks/fixtures/new1-flat.json | 2 +- benchmarks/fixtures/new1.json | 2 +- benchmarks/fixtures/new2-flat.json | 2 +- benchmarks/fixtures/new2.json | 2 +- benchmarks/fixtures/new3-flat.json | 2 +- benchmarks/fixtures/new3.json | 2 +- benchmarks/fixtures/new4-flat.json | 2 +- benchmarks/fixtures/new4.json | 2 +- benchmarks/fixtures/new5-flat.json | 2 +- benchmarks/fixtures/new5.json | 2 +- benchmarks/fixtures/plt1-flat.json | 292 +++++++++++ benchmarks/fixtures/plt1.json | 454 ++++++++++++++++++ benchmarks/fixtures/plt2-flat.json | 292 +++++++++++ benchmarks/fixtures/plt2.json | 454 ++++++++++++++++++ benchmarks/fixtures/plt3-flat.json | 292 +++++++++++ benchmarks/fixtures/plt3.json | 454 ++++++++++++++++++ benchmarks/fixtures/plt4-flat.json | 292 +++++++++++ benchmarks/fixtures/plt4.json | 454 ++++++++++++++++++ benchmarks/fixtures/plt5-flat.json | 228 +++++++++ benchmarks/fixtures/plt5.json | 350 ++++++++++++++ benchmarks/fixtures/rat1-flat.json | 2 +- benchmarks/fixtures/rat1.json | 2 +- benchmarks/fixtures/rat2-flat.json | 2 +- benchmarks/fixtures/rat2.json | 2 +- benchmarks/fixtures/rev2-flat.json | 2 +- benchmarks/fixtures/rev2.json | 2 +- benchmarks/manifests/corpus.toml | 9 +- benchmarks/results/corpus.md | 15 + benchmarks/results/edge_to_edge.md | 50 ++ docs/algorithms.md | 14 +- docs/experiments.md | 14 +- docs/roadmap.md | 14 + python/maxplus_solvers/validation.py | 12 +- tests/corpus/test_benchmark.py | 55 ++- .../test_candidates_agree_with_shapely.py | 5 +- tests/corpus/test_cp_sat.py | 17 +- tests/corpus/test_edge_to_edge.py | 37 +- tests/corpus/test_fixtures.py | 11 +- tests/corpus/test_hard_relief.py | 96 ++++ tests/corpus/test_keys_validate.py | 29 +- ...est_placement_model_agrees_with_shapely.py | 5 +- tests/corpus/test_rust_contact_dfs.py | 20 +- ...est_search_geometry_agrees_with_shapely.py | 9 +- tests/keys/cor1-flat.json | 2 +- tests/keys/cor1.json | 2 +- tests/keys/new1-flat.json | 2 +- tests/keys/new1.json | 2 +- tests/keys/new2-flat.json | 2 +- tests/keys/new2.json | 2 +- tests/keys/new3-flat.json | 2 +- tests/keys/new3.json | 2 +- tests/keys/new4-flat.json | 2 +- tests/keys/new4.json | 2 +- tests/keys/new5-flat.json | 2 +- tests/keys/new5.json | 2 +- tests/keys/plt1-flat.json | 204 ++++++++ tests/keys/plt1.json | 204 ++++++++ tests/keys/plt2-flat.json | 204 ++++++++ tests/keys/plt2.json | 204 ++++++++ tests/keys/plt3-flat.json | 204 ++++++++ tests/keys/plt3.json | 204 ++++++++ tests/keys/plt4-flat.json | 204 ++++++++ tests/keys/plt4.json | 204 ++++++++ tests/keys/plt5-flat.json | 156 ++++++ tests/keys/plt5.json | 156 ++++++ tests/keys/rat1-flat.json | 2 +- tests/keys/rat1.json | 2 +- tests/keys/rat2-flat.json | 2 +- tests/keys/rat2.json | 2 +- tests/keys/rev2-flat.json | 2 +- tests/keys/rev2.json | 2 +- tests/support/corpus.py | 15 +- 77 files changed, 6090 insertions(+), 121 deletions(-) create mode 100644 benchmarks/fixtures/plt1-flat.json create mode 100644 benchmarks/fixtures/plt1.json create mode 100644 benchmarks/fixtures/plt2-flat.json create mode 100644 benchmarks/fixtures/plt2.json create mode 100644 benchmarks/fixtures/plt3-flat.json create mode 100644 benchmarks/fixtures/plt3.json create mode 100644 benchmarks/fixtures/plt4-flat.json create mode 100644 benchmarks/fixtures/plt4.json create mode 100644 benchmarks/fixtures/plt5-flat.json create mode 100644 benchmarks/fixtures/plt5.json create mode 100644 tests/corpus/test_hard_relief.py create mode 100644 tests/keys/plt1-flat.json create mode 100644 tests/keys/plt1.json create mode 100644 tests/keys/plt2-flat.json create mode 100644 tests/keys/plt2.json create mode 100644 tests/keys/plt3-flat.json create mode 100644 tests/keys/plt3.json create mode 100644 tests/keys/plt4-flat.json create mode 100644 tests/keys/plt4.json create mode 100644 tests/keys/plt5-flat.json create mode 100644 tests/keys/plt5.json diff --git a/CLAUDE.md b/CLAUDE.md index 694d1f6..e27f500 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -93,7 +93,7 @@ Rules: - **Search rules are switches, and the measurement is the product.** The question is what makes a puzzle hard and what helps, not how fast a solver is. A pruning rule, an ordering or a symmetry reduction added to a solver is an option that can be turned off, is tested not to change what the whole search finds, and gets its row in the ablation table of `docs/algorithms.md`. A rule that costs more than it saves stays, switched off, with its numbers. - **Experiments are callers.** `experiments/` goes through `api.solve` like any user, and nothing outside it imports it. Only `experiments/plotting.py` imports matplotlib; running a manifest needs no plotting stack. - **A committed table has no times.** `benchmarks/results/*.md` are written with `--no-times`: statuses and counts, which a deterministic solver reproduces exactly and a test compares. Times, CP-SAT's own counts and the `.jsonl` records belong to a machine and are not committed. When a solver change moves a count, regenerate the table with the command and say why in the commit. -- **The suite does not run million-node searches.** The footprints in `corpus.EXPENSIVE` (`tests/support/corpus.py`: `cor1-flat`, `new1-flat`, `new2-flat`) are left out of the per-fixture tests, and the table tests reproduce every other row with `maxplus-bench run --only`. Their rows are checked against a search only by running the full command, so a solver change that could move them means running it by hand. There is no `slow` marker; a test that needs one is a test to make smaller. +- **The suite does not run million-node searches.** The fixtures in `corpus.EXPENSIVE` (`tests/support/corpus.py`: `cor1-flat`, `new1-flat`, `new2-flat`, and all ten Pleat fixtures, `plt1` to `plt5` with their footprints) are left out of the per-fixture tests, and the table tests reproduce every other row with `maxplus-bench run --only`. Their rows are checked against a search only by running the full command, so a solver change that could move them means running it by hand. There is no `slow` marker; a test that needs one is a test to make smaller. - **Completeness and uniqueness are explicit claims.** A result says whether the search was exhaustive and over which candidate set. "No solution found" and CP-SAT `INFEASIBLE` are relative to the candidates generated unless completeness is proven. - **Layering is one-way:** core ← geometry ← search ← py. Python reaches Rust only through `_native`. - **Production solvers cross the Python/Rust boundary once per solve.** Prototypes may call individual geometry primitives; a Rust solver receives the instance and runs to completion. `cp_sat.placements` makes its one call for the list of placements and their conflicts; everything it then needs, down to which placement a tray rotation turns each into, is in that answer. diff --git a/README.md b/README.md index 967a1fe..e928af6 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,13 @@ Three findings from the corpus so far, in plain terms. The details and the cavea - **Knowing the structure can matter more than a better search.** Tropical cuts never leave a T-junction between pieces. Searching only for assemblies whose pieces meet edge to edge takes flat `new1` from 1 064 878 nodes to 49, which is fewer than the roofs alone need. Finding the right structure did more here than any improvement to the search algorithm. This is an assumption, though, and not a shortcut: it narrows which assemblies count. For example, `rat1` laid flat has 101 assemblies, and only the intended one has no T. ([algorithms](docs/algorithms.md#assuming-the-pieces-meet-edge-to-edge)) - **Difficulty has more than one dimension.** The number of pieces is not a reliable guide. Two nine-piece flat puzzles cost 45 and 6 104 nodes, more than two orders of magnitude apart. Ambiguity varies as well: the 11-piece `rat1` has 101 assemblies without its roofs and one with them. ([difficulty proxies](docs/experiments.md#difficulty-proxies)) +- **Roofs can be made to help less.** The Pleat puzzles, built for this in Tropical Puzzle Lab, stand every corner of a grid of triangles at one of just two heights, so many edges look alike even with their roofs. The hardest, `plt1` with 32 pieces, takes 21 973 nodes with its roofs on and still has one assembly, against 1 529 for `cor1` and at most 94 for the rest. Without roofs the same triangles fit together in tens of thousands of ways. Assuming edge to edge brings it down to 749 nodes, and CP-SAT settles it without a single conflict, so it is hard for this search, not for every method. ([experiments](docs/experiments.md#the-corpus-table)) + One question is still open. `cor1`, with 27 pieces, was built to be hard, and its flat search has not been seen to finish. Everything above is computational evidence, not proof. It is relative to the placements the solvers generate and to floating-point arithmetic with stated tolerances. [docs/solver-contract.md](docs/solver-contract.md) says exactly what a result claims. ## Status -**Contracts and fixtures.** The instance format, the sanitizing importer and the benchmark corpus exist: 18 puzzles from Tropical Puzzle Lab (nine constructions, each with its roofs and without) and 4 synthetic ones with known solution counts, each with an answer key that only tests read. An independent validator checks an assembly against the browser player's completion rules. The Rust geometry kernel (separating-axis depth, convex clipping, containment, edge signatures, roof continuity) is in place and agrees with the validator on random poses of every fixture's pieces. Three solvers exist. `python.contact_dfs` is a Python prototype of the contact search. `rust.contact_dfs` is that search in Rust with roofs, pruning and symmetry handling: it runs the search to its end on 17 of the 18 corpus puzzles, and every assembly it returns passes the validator. The eighteenth, `cor1-flat`, was built to be hard and has not been seen to end without roofs. `cp_sat.placements` hands the placements that search reaches to OR-Tools CP-SAT as a plain choice problem, and returns the same assemblies by other means. It is a second formulation over the same candidate set, not an independent enumeration of every possible placement. It checks the search's bookkeeping and pruning, but it cannot find an assembly that uses a placement the search never generated. `maxplus-bench` runs experiment manifests over the corpus and writes the results table; [docs/experiments.md](docs/experiments.md) has what the first experiments found about tolerance, heuristics and difficulty proxies. Each rule of either can be switched off, because the question here is what makes a puzzle hard and what helps, not how fast one solver is; [docs/algorithms.md](docs/algorithms.md) has the measurements. `rust.contact_dfs` can also be told to assume that the pieces meet edge to edge, as every tropical cut does (`--assume edge-to-edge`); then the footprint puzzles that took a million nodes take about fifty. The work is laid out in [docs/roadmap.md](docs/roadmap.md), and the design in [docs/architecture.md](docs/architecture.md). +**Contracts and fixtures.** The instance format, the sanitizing importer and the benchmark corpus exist: 28 puzzles from Tropical Puzzle Lab (fourteen constructions, each with its roofs and without) and 4 synthetic ones with known solution counts, each with an answer key that only tests read. An independent validator checks an assembly against the browser player's completion rules. The Rust geometry kernel (separating-axis depth, convex clipping, containment, edge signatures, roof continuity) is in place and agrees with the validator on random poses of every fixture's pieces. Three solvers exist. `python.contact_dfs` is a Python prototype of the contact search. `rust.contact_dfs` is that search in Rust with roofs, pruning and symmetry handling: it runs the search to its end on 22 of the 28 corpus puzzles, and every assembly it returns passes the validator. The other six are footprints it stops at 1 500 000 nodes: `cor1-flat`, built to be hard, and the five Pleat footprints, which have tens of thousands of assemblies each. `cp_sat.placements` hands the placements that search reaches to OR-Tools CP-SAT as a plain choice problem, and returns the same assemblies by other means. It is a second formulation over the same candidate set, not an independent enumeration of every possible placement. It checks the search's bookkeeping and pruning, but it cannot find an assembly that uses a placement the search never generated. `maxplus-bench` runs experiment manifests over the corpus and writes the results table; [docs/experiments.md](docs/experiments.md) has what the first experiments found about tolerance, heuristics and difficulty proxies. Each rule of either can be switched off, because the question here is what makes a puzzle hard and what helps, not how fast one solver is; [docs/algorithms.md](docs/algorithms.md) has the measurements. `rust.contact_dfs` can also be told to assume that the pieces meet edge to edge, as every tropical cut does (`--assume edge-to-edge`); then the footprint puzzles that took a million nodes take about fifty. The work is laid out in [docs/roadmap.md](docs/roadmap.md), and the design in [docs/architecture.md](docs/architecture.md). ```python from maxplus_solvers import load_puzzle diff --git a/benchmarks/fixtures/cor1-flat.json b/benchmarks/fixtures/cor1-flat.json index 5a35871..74d6078 100644 --- a/benchmarks/fixtures/cor1-flat.json +++ b/benchmarks/fixtures/cor1-flat.json @@ -273,7 +273,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "cor1-flat", "geometryHash": "049804fdb45e2f37430c7616cd461063ac9d71eedc67e963f2c77ac1ce95bcf5" } diff --git a/benchmarks/fixtures/cor1.json b/benchmarks/fixtures/cor1.json index 542b956..e6e2ba3 100644 --- a/benchmarks/fixtures/cor1.json +++ b/benchmarks/fixtures/cor1.json @@ -410,7 +410,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "cor1", "geometryHash": "78efff393692b812602735262414c51f99283649055de578ec070a3c7497c0e1" } diff --git a/benchmarks/fixtures/index.json b/benchmarks/fixtures/index.json index b3c2e7b..22c0c42 100644 --- a/benchmarks/fixtures/index.json +++ b/benchmarks/fixtures/index.json @@ -2,7 +2,7 @@ "formatVersion": 1, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1" + "commit": "d3153f5b6a84aab7242bad12b443687c19375691" }, "sanitizerVersion": 1, "sourceDifficulty": { @@ -11,7 +11,7 @@ "id": "rust.contact_dfs", "version": "0.1.0", "repository": "https://github.com/maxpluslab/tiling-solvers", - "commit": "2c2cd7c5d491e1f454d429435d40b1e635ab256a", + "commit": "5b482e0d72830f51751ebc45d6b1a376ea366023", "nodeLimit": 1500000 }, "thresholds": [2.0, 3.0, 4.0, 5.5], @@ -27,7 +27,7 @@ "kind": "corpus", "regime": "relief", "pieceCount": 27, - "instanceHash": "d7db7ec43404c993a80075212dc825debff5b264fbcf8fa8b87e72e89bd0662c", + "instanceHash": "bbc718fe3d7ea9d4493459a8e9adb1981dd5abed7b02d475a0013fe9ac590894", "construction": "cor1", "sourceDifficulty": { "rating": 3, @@ -43,7 +43,7 @@ "kind": "corpus", "regime": "footprint", "pieceCount": 27, - "instanceHash": "693a018dbc1ebd466e760261c4e9fc190d04436f011a6291fa254d61d494da20", + "instanceHash": "545fea6fc867a300a0da7b63b7a2228381bd1c339d3ab51bcc209851af6aaef5", "construction": "cor1", "sourceDifficulty": { "rating": 5, @@ -59,7 +59,7 @@ "kind": "corpus", "regime": "relief", "pieceCount": 16, - "instanceHash": "f3f11247194bc8ed62792482ca64a1980e282abeb9fec1ef839b6e220ed9be6c", + "instanceHash": "d16d29e39c7691c84cbebc25b2ac913f71c7b4255207097f9739d7bd129ab7cb", "construction": "new1", "sourceDifficulty": { "rating": 1, @@ -75,7 +75,7 @@ "kind": "corpus", "regime": "footprint", "pieceCount": 16, - "instanceHash": "3b68bf1e0e105e254fdd45dadaa62cca711621f9a730d2489794c299b53260e8", + "instanceHash": "47878f9665e34eb76d37bbb49e175e4b59ec149bef358ca7c48ee301c37042fc", "construction": "new1", "sourceDifficulty": { "rating": 5, @@ -91,7 +91,7 @@ "kind": "corpus", "regime": "relief", "pieceCount": 16, - "instanceHash": "ceae2892b1d366acf3784aab3bde4272fdacab2da6b20468e7fc5325b53a463e", + "instanceHash": "f392dfd7dceb7f52a52582be80db4bc809fd04244e653e9e7b55f8a48711246c", "construction": "new2", "sourceDifficulty": { "rating": 1, @@ -107,7 +107,7 @@ "kind": "corpus", "regime": "footprint", "pieceCount": 16, - "instanceHash": "7d16d1a433da1c2fd2a1da8952a1cbd6febf303c422a4b8fb93ffe7e0a0fe73c", + "instanceHash": "19e6af7d1a722438618915bde4baa4146ada61aeb97ba60b13039c5aace388bb", "construction": "new2", "sourceDifficulty": { "rating": 5, @@ -123,7 +123,7 @@ "kind": "corpus", "regime": "relief", "pieceCount": 9, - "instanceHash": "fa1f3fbf05c4807a42682d33a9848fa90b61699f3bf0741d0f180a4ae2fc675a", + "instanceHash": "fd85c03021372563446302f92bdd358a2e7f365341cea21b578cc7792104c370", "construction": "new3", "sourceDifficulty": { "rating": 1, @@ -139,7 +139,7 @@ "kind": "corpus", "regime": "footprint", "pieceCount": 9, - "instanceHash": "96da3741917645494972765eaf1e0af3553766b9db5ab4d8304ee0837c105b38", + "instanceHash": "c32d2ae44835c6efb27d8f16196d8553391ef043848487a59ab049a726a7c220", "construction": "new3", "sourceDifficulty": { "rating": 3, @@ -155,7 +155,7 @@ "kind": "corpus", "regime": "relief", "pieceCount": 9, - "instanceHash": "f7c565210160817404ceaf63beb8e8b645174c8429d75894a813a53c3cd2af00", + "instanceHash": "470743ee57b6b93146ce250d84ff1fcce2675faff7a1dbba6749b014973c4d1a", "construction": "new4", "sourceDifficulty": { "rating": 1, @@ -171,7 +171,7 @@ "kind": "corpus", "regime": "footprint", "pieceCount": 9, - "instanceHash": "be1f76117815ed4c2b3d3f7e97826daea73c798689b0d70f72ebf3bf9d8a9829", + "instanceHash": "0f002a815257e9a770ce886fb3aee972b48ca411206ff9943fa8e8cb97ca0b93", "construction": "new4", "sourceDifficulty": { "rating": 2, @@ -187,7 +187,7 @@ "kind": "corpus", "regime": "relief", "pieceCount": 6, - "instanceHash": "43c648b7900770edc285c9ecc6d8e631e370d7c50bffaa61108bcd138cb08d49", + "instanceHash": "95fc448dfa619d251d08c43e078d90101d2f64d105dfbb9b59c10b7a8f8b5825", "construction": "new5", "sourceDifficulty": { "rating": 1, @@ -203,7 +203,7 @@ "kind": "corpus", "regime": "footprint", "pieceCount": 6, - "instanceHash": "c6bbab15d33416d43d35300ad9ee20937445f93438a1cd4befde048ce4fa7bb1", + "instanceHash": "9352aafe3966d134aef305bd884fc266f2d96ac4a727b8434e4850c552f150ac", "construction": "new5", "sourceDifficulty": { "rating": 1, @@ -214,12 +214,172 @@ "diversity": 4.186563 } }, + { + "id": "plt1", + "kind": "corpus", + "regime": "relief", + "pieceCount": 32, + "instanceHash": "28ad41c0b48f4f953ea28a69d47a4630d274b9b3fbd3543f82a10bf1ce558ee8", + "construction": "plt1", + "sourceDifficulty": { + "rating": 4, + "x": 4.341889, + "nodes": 21973, + "exhaustive": true, + "solutions": 1, + "diversity": 4.023287 + } + }, + { + "id": "plt1-flat", + "kind": "corpus", + "regime": "footprint", + "pieceCount": 32, + "instanceHash": "f73a6f5e3ef758635e0bb3b241d71f86a4566ad100add3deb5b81624470d707f", + "construction": "plt1", + "sourceDifficulty": { + "rating": 5, + "x": 6.176091, + "nodes": 1500000, + "exhaustive": false, + "solutions": 54725, + "diversity": 3.756232 + } + }, + { + "id": "plt2", + "kind": "corpus", + "regime": "relief", + "pieceCount": 32, + "instanceHash": "7b978ccf2df18996b795a64ed57126f552df4293ada7377644a5e55710fe9451", + "construction": "plt2", + "sourceDifficulty": { + "rating": 4, + "x": 4.266937, + "nodes": 18490, + "exhaustive": true, + "solutions": 1, + "diversity": 4.212717 + } + }, + { + "id": "plt2-flat", + "kind": "corpus", + "regime": "footprint", + "pieceCount": 32, + "instanceHash": "d8e415eb0af0a528707b0c02506612e1c2d9cd4d2571b82c41747a90c1588c09", + "construction": "plt2", + "sourceDifficulty": { + "rating": 5, + "x": 6.176091, + "nodes": 1500000, + "exhaustive": false, + "solutions": 59724, + "diversity": 3.525808 + } + }, + { + "id": "plt3", + "kind": "corpus", + "regime": "relief", + "pieceCount": 32, + "instanceHash": "e73daacb28ff962473a0d4f007eafdfda67324d30313ffe95b8d09df47c0b671", + "construction": "plt3", + "sourceDifficulty": { + "rating": 4, + "x": 4.06487, + "nodes": 11611, + "exhaustive": true, + "solutions": 1, + "diversity": 3.805769 + } + }, + { + "id": "plt3-flat", + "kind": "corpus", + "regime": "footprint", + "pieceCount": 32, + "instanceHash": "15a9d47300bbe0d46a0df3250e89ba6d24395445e864e693599f2aa20a50f708", + "construction": "plt3", + "sourceDifficulty": { + "rating": 5, + "x": 6.176091, + "nodes": 1500000, + "exhaustive": false, + "solutions": 26998, + "diversity": 3.681403 + } + }, + { + "id": "plt4", + "kind": "corpus", + "regime": "relief", + "pieceCount": 32, + "instanceHash": "37fe028252b9a4e5087d5ec6c5f1c1513320eda1c57167689944c9e28bc73c1d", + "construction": "plt4", + "sourceDifficulty": { + "rating": 4, + "x": 4.032901, + "nodes": 10787, + "exhaustive": true, + "solutions": 1, + "diversity": 3.675652 + } + }, + { + "id": "plt4-flat", + "kind": "corpus", + "regime": "footprint", + "pieceCount": 32, + "instanceHash": "a48fa48c9bea34aaebf870c1944f02ce116c9093e8cb4fcf80170decbe1fa5d7", + "construction": "plt4", + "sourceDifficulty": { + "rating": 5, + "x": 6.176091, + "nodes": 1500000, + "exhaustive": false, + "solutions": 81443, + "diversity": 3.694665 + } + }, + { + "id": "plt5", + "kind": "corpus", + "regime": "relief", + "pieceCount": 24, + "instanceHash": "5cbf55990ad0d4854af21ffb07a5a56dd1960945b73055b20b642fd9e51ebb03", + "construction": "plt5", + "sourceDifficulty": { + "rating": 3, + "x": 3.874366, + "nodes": 7488, + "exhaustive": true, + "solutions": 1, + "diversity": 4.077608 + } + }, + { + "id": "plt5-flat", + "kind": "corpus", + "regime": "footprint", + "pieceCount": 24, + "instanceHash": "d628c564608b9e86416f44720cbc758cec58f3103515fd052f19f8797cd653e4", + "construction": "plt5", + "sourceDifficulty": { + "rating": 5, + "x": 6.176091, + "nodes": 1500000, + "exhaustive": false, + "solutions": 95344, + "diversity": 3.636675 + } + }, { "id": "rat1", "kind": "corpus", "regime": "relief", "pieceCount": 11, - "instanceHash": "b79a18190749853d0a5b50d03b52d558d499140dd86e91e113658c56a19217b8", + "instanceHash": "b18060830cdb0dddcca427532b6eb105ac4630c10a8c6c77acde122ce3687024", "construction": "rat1", "sourceDifficulty": { "rating": 1, @@ -235,7 +395,7 @@ "kind": "corpus", "regime": "footprint", "pieceCount": 11, - "instanceHash": "b57c9992f73665a1b6966e3875de691e4c217a3fe6891b1b36a201423a4180d9", + "instanceHash": "174074422b12292efdefe1d1fd0a10b924ed6d671448e3e57baeb4395f4dd599", "construction": "rat1", "sourceDifficulty": { "rating": 4, @@ -251,7 +411,7 @@ "kind": "corpus", "regime": "relief", "pieceCount": 20, - "instanceHash": "fc22d29e662b8d9dc55e6a20bb36bbaeb04d638bbc76fa8b1a1e79b6d9e06d9b", + "instanceHash": "406e2d4eeff8260dc70d111e975351554637b79cfc6b3aa08ad21ec98b543e56", "construction": "rat2", "sourceDifficulty": { "rating": 1, @@ -267,7 +427,7 @@ "kind": "corpus", "regime": "footprint", "pieceCount": 20, - "instanceHash": "ef6bb1d52337553f2299a4bc72b9e8a71031d9e8b52febb2041b8fc40c9d8201", + "instanceHash": "b546ae43877e7b5b15dba702230f4afbbaeb5d726b988901e432828498b19e7b", "construction": "rat2", "sourceDifficulty": { "rating": 4, @@ -283,7 +443,7 @@ "kind": "corpus", "regime": "relief", "pieceCount": 9, - "instanceHash": "08af73dcc5d42e622630d0618149fd81314afd398313a07aa9a7a9a2e9faf923", + "instanceHash": "0e4516ee9f95d91725b35005667013a02d0e10e06d8acb978ab1e26215f1e2ec", "construction": "rev2", "sourceDifficulty": { "rating": 1, @@ -299,7 +459,7 @@ "kind": "corpus", "regime": "footprint", "pieceCount": 9, - "instanceHash": "6308c5517ad6a362e2b0f9ab0269a3f6e85d2e1118ae69a6a672586d2d809522", + "instanceHash": "c1cb071c776421802523175ade60c251318583f7b65319ac385a6e1cf5b6ff32", "construction": "rev2", "sourceDifficulty": { "rating": 1, diff --git a/benchmarks/fixtures/new1-flat.json b/benchmarks/fixtures/new1-flat.json index 24b15ec..a6cae78 100644 --- a/benchmarks/fixtures/new1-flat.json +++ b/benchmarks/fixtures/new1-flat.json @@ -191,7 +191,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "new1-flat", "geometryHash": "ae39042ff2d2f2a108aed7d0e08138b84171d5f6d7dd8af38a922402fb24eded" } diff --git a/benchmarks/fixtures/new1.json b/benchmarks/fixtures/new1.json index 577856c..3f85336 100644 --- a/benchmarks/fixtures/new1.json +++ b/benchmarks/fixtures/new1.json @@ -273,7 +273,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "new1", "geometryHash": "aca54e06186bcecf28e618580f22ee080a3019f32322121d3848305200d83437" } diff --git a/benchmarks/fixtures/new2-flat.json b/benchmarks/fixtures/new2-flat.json index 404b740..9ca099d 100644 --- a/benchmarks/fixtures/new2-flat.json +++ b/benchmarks/fixtures/new2-flat.json @@ -191,7 +191,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "new2-flat", "geometryHash": "8213c7bbd3d6f0f31ef393013f4a55c0b7f741b64318c80c308a29a8ecb3cc09" } diff --git a/benchmarks/fixtures/new2.json b/benchmarks/fixtures/new2.json index 0b7667e..097ef06 100644 --- a/benchmarks/fixtures/new2.json +++ b/benchmarks/fixtures/new2.json @@ -273,7 +273,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "new2", "geometryHash": "27f66cb4de8390c31be5e78d64d3ca4bd4db2dd37187acf7a9f39c630cd0236d" } diff --git a/benchmarks/fixtures/new3-flat.json b/benchmarks/fixtures/new3-flat.json index f3ecb4f..8f89a10 100644 --- a/benchmarks/fixtures/new3-flat.json +++ b/benchmarks/fixtures/new3-flat.json @@ -118,7 +118,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "new3-flat", "geometryHash": "60679aece595a9cbae5e0d888f153b0fc674f5a0e05cdf2f6c5be531064d1c1b" } diff --git a/benchmarks/fixtures/new3.json b/benchmarks/fixtures/new3.json index 6496b9f..129c32c 100644 --- a/benchmarks/fixtures/new3.json +++ b/benchmarks/fixtures/new3.json @@ -165,7 +165,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "new3", "geometryHash": "adad00a1e9896ab0c87e5fdac0eab3eb4554f56f73cda103c0558087cfd56212" } diff --git a/benchmarks/fixtures/new4-flat.json b/benchmarks/fixtures/new4-flat.json index 96aec0c..8dfe813 100644 --- a/benchmarks/fixtures/new4-flat.json +++ b/benchmarks/fixtures/new4-flat.json @@ -118,7 +118,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "new4-flat", "geometryHash": "cdef8a3777943864f1225d3d9c4778d7bd5fd8c4e18bcebf55c4336ef62aefef" } diff --git a/benchmarks/fixtures/new4.json b/benchmarks/fixtures/new4.json index f1f88b7..6735d89 100644 --- a/benchmarks/fixtures/new4.json +++ b/benchmarks/fixtures/new4.json @@ -165,7 +165,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "new4", "geometryHash": "232a0c31a6b15fbb06565d36dc0a6b97611815b1b77561d86671ebbd7695a25d" } diff --git a/benchmarks/fixtures/new5-flat.json b/benchmarks/fixtures/new5-flat.json index 47325fe..a971b3e 100644 --- a/benchmarks/fixtures/new5-flat.json +++ b/benchmarks/fixtures/new5-flat.json @@ -87,7 +87,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "new5-flat", "geometryHash": "7e0a0b140e6b303e7f104fac7d8a67f74b7bd1b364a8a5131512ba649c996101" } diff --git a/benchmarks/fixtures/new5.json b/benchmarks/fixtures/new5.json index 5eca974..9fee086 100644 --- a/benchmarks/fixtures/new5.json +++ b/benchmarks/fixtures/new5.json @@ -119,7 +119,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "new5", "geometryHash": "754f8fc1f37b130d44fde65fc85c66f0913264f64f6bfe8ac6f15e17ec05f9bc" } diff --git a/benchmarks/fixtures/plt1-flat.json b/benchmarks/fixtures/plt1-flat.json new file mode 100644 index 0000000..7f5b1d2 --- /dev/null +++ b/benchmarks/fixtures/plt1-flat.json @@ -0,0 +1,292 @@ +{ + "formatVersion": 1, + "id": "plt1-flat", + "regime": "footprint", + "units": "mm", + "spanMm": 144.0, + "target": { + "vertices": [ + [-72.0, -72.0], + [72.0, -72.0], + [72.0, 72.0], + [-72.0, 72.0] + ] + }, + "pieces": [ + { + "id": "p00", + "polygon": [ + [-14.111784012943694, 4.113399077651815], + [-1.6106871083123586, -22.330599791297956], + [15.722471121256053, 18.217200713646143] + ] + }, + { + "id": "p01", + "polygon": [ + [6.395191633164502, -19.49619255072905], + [26.638014974396263, 17.303645807281207], + [-33.033206607560764, 2.192546743447842] + ] + }, + { + "id": "p02", + "polygon": [ + [-25.96780172585703, 3.5687215535225896], + [22.053583455693026, -21.139760092365826], + [3.914218270164005, 17.57103853884324] + ] + }, + { + "id": "p03", + "polygon": [ + [33.06477367425177, -1.6494671474471012], + [-6.714679024058644, 19.38847816626841], + [-26.35009465019312, -17.73901101882131] + ] + }, + { + "id": "p04", + "polygon": [ + [-12.55084557508456, -16.9551253416299], + [22.710592896175825, 7.016335960041269], + [-10.159747321091265, 9.938789381588629] + ] + }, + { + "id": "p05", + "polygon": [ + [28.379097456912312, -7.475080436428295], + [-9.170353972364172, 12.960212499089074], + [-19.20874348454814, -5.485132062660779] + ] + }, + { + "id": "p06", + "polygon": [ + [-15.68950564018232, -6.7008889534663325], + [25.43376974868319, -15.237646024598675], + [-9.744264108500868, 21.938534978065007] + ] + }, + { + "id": "p07", + "polygon": [ + [9.834828692414522, -16.621556623579515], + [1.566806278361268, 16.569403069697103], + [-11.40163497077579, 0.05215355388241427] + ] + }, + { + "id": "p08", + "polygon": [ + [16.97832357515929, 7.598455670541893], + [-11.70481808582643, 23.91646365116947], + [-5.273505489332861, -31.51491932171136] + ] + }, + { + "id": "p09", + "polygon": [ + [6.315622973500254, 15.398470912937942], + [-10.894139325251896, 3.364183164157411], + [4.578516351751641, -18.762654077095352] + ] + }, + { + "id": "p10", + "polygon": [ + [-12.049897031824724, 16.85378240996429], + [-4.077507815547872, -11.28877451338922], + [16.127404847372595, -5.565007896575068] + ] + }, + { + "id": "p11", + "polygon": [ + [21.626322372781956, -27.95178313862124], + [11.143738461824558, 18.889602777571902], + [-32.77006083460651, 9.06218036104934] + ] + }, + { + "id": "p12", + "polygon": [ + [16.51756179036881, -11.235330547044367], + [8.15309045877477, 30.688387314602178], + [-24.67065224914358, -19.45305676755781] + ] + }, + { + "id": "p13", + "polygon": [ + [18.3646456926606, -2.956313343176352], + [3.3270986361186825, 26.418372672546226], + [-21.691744328779283, -23.462059329369872] + ] + }, + { + "id": "p14", + "polygon": [ + [-17.439313760605295, 4.46462042722143], + [-4.383242357098734, -25.84278789989454], + [21.822556117704025, 21.378167472673105] + ] + }, + { + "id": "p15", + "polygon": [ + [11.621987535758658, -27.017205734839983], + [7.627821553928983, 14.792441933008101], + [-19.24980908968764, 12.224763801831882] + ] + }, + { + "id": "p16", + "polygon": [ + [-22.22272091754774, -24.721461830174736], + [23.219715302319152, 6.390995327744026], + [-0.9969943847714129, 18.33046650243071] + ] + }, + { + "id": "p17", + "polygon": [ + [20.026319935823643, 4.466151567964579], + [-29.40917118465606, 9.17064066636546], + [9.382851248832413, -13.636792234330038] + ] + }, + { + "id": "p18", + "polygon": [ + [4.95734063176327, 33.08303604357782], + [-15.682557567651688, -10.252799039154663], + [10.725216935888419, -22.830237004423154] + ] + }, + { + "id": "p19", + "polygon": [ + [16.81926403960655, -2.859170712986174], + [-13.136147077664877, 26.580145596929235], + [-3.6831169619416766, -23.72097488394306] + ] + }, + { + "id": "p20", + "polygon": [ + [-29.401796653749802, 9.194256551323058], + [9.371896358784939, -13.644323311919635], + [20.02990029496486, 4.450066760596577] + ] + }, + { + "id": "p21", + "polygon": [ + [-1.3613222032374468, -20.673577384162922], + [10.308751462642384, 6.147531478688701], + [-8.947429259404938, 14.526045905474222] + ] + }, + { + "id": "p22", + "polygon": [ + [-22.107295280827923, 19.397615713439716], + [-0.5282426674482421, -16.63493191102047], + [22.635537948276166, -2.7626838024192466] + ] + }, + { + "id": "p23", + "polygon": [ + [-4.547736531753655, 19.45200741408848], + [-26.778846167197415, -17.06292466002169], + [31.32658269895107, -2.3890827540667914] + ] + }, + { + "id": "p24", + "polygon": [ + [20.480555724746214, 12.06427939023152], + [-12.177806107226376, 7.3280992361457535], + [-8.30274961751984, -19.392378626377273] + ] + }, + { + "id": "p25", + "polygon": [ + [-14.482091178949155, 11.888294035924712], + [-18.56572366808201, -17.075242448657043], + [33.04781484703116, 5.186948412732333] + ] + }, + { + "id": "p26", + "polygon": [ + [14.311290736002153, -3.3540210896204803], + [0.41602922052295455, 22.38474747875595], + [-14.727319956525108, -19.030726389135474] + ] + }, + { + "id": "p27", + "polygon": [ + [-2.2905918398115617, -23.974010699576084], + [17.48527067116307, -5.591539104411632], + [-15.19467883135151, 29.565549803987718] + ] + }, + { + "id": "p28", + "polygon": [ + [-21.744863803364268, -2.8567285788360213], + [13.04646185990562, -31.397290216482503], + [8.698401943458647, 34.25401879531852] + ] + }, + { + "id": "p29", + "polygon": [ + [34.68217139520125, 4.920313741407567], + [-11.474654245018296, 18.094054547206483], + [-23.20751715018296, -23.01436828861405] + ] + }, + { + "id": "p30", + "polygon": [ + [28.821947801538087, 19.908737401588624], + [-18.35420517017209, 11.053761919420378], + [-10.467742631365997, -30.962499321009] + ] + }, + { + "id": "p31", + "polygon": [ + [-0.23037989125544822, -15.874804726537747], + [18.75063139932118, -6.890306388455501], + [-18.520251508065734, 22.765111114993246] + ] + } + ], + "rules": { + "translate": true, + "rotate": "continuous-z", + "flip": false + }, + "validation": { + "contactNoise": 1e-06, + "overlapDepth": 0.006, + "outsideDepth": 0.006, + "areaError": 0.012, + "edgeAngleDeg": 3.0, + "edgeMinOverlap": 0.02 + }, + "source": { + "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", + "puzzleId": "plt1-flat", + "geometryHash": "64342514b40766c9e376475df38414363056395dd11c21d9518befca5cd2706b" + } +} diff --git a/benchmarks/fixtures/plt1.json b/benchmarks/fixtures/plt1.json new file mode 100644 index 0000000..28cddbf --- /dev/null +++ b/benchmarks/fixtures/plt1.json @@ -0,0 +1,454 @@ +{ + "formatVersion": 1, + "id": "plt1", + "regime": "relief", + "units": "mm", + "spanMm": 144.0, + "reliefMm": 12.0, + "target": { + "vertices": [ + [-72.0, -72.0], + [72.0, -72.0], + [72.0, 72.0], + [-72.0, 72.0] + ] + }, + "pieces": [ + { + "id": "p00", + "polygon": [ + [-14.76642198411199, -7.678071488800695], + [6.145071065390741, -9.604066930279979], + [8.621350918721248, 17.282138419080674] + ], + "roof": { + "z0": 16.0, + "gx": 0.5690202190340878, + "gy": -0.05240803922392607 + } + }, + { + "id": "p01", + "polygon": [ + [2.024876021238419, -23.978373112006864], + [12.8095176745472, 7.209629459650676], + [-14.83439369578562, 16.768743652356186] + ], + "roof": { + "z0": 12.0, + "gx": -0.38772963570048224, + "gy": 0.13407479910873388 + } + }, + { + "id": "p02", + "polygon": [ + [-22.9155549854792, -7.150338433072901], + [4.84760902872653, -16.357358793662534], + [18.067945956752673, 23.507697226735434] + ], + "roof": { + "z0": 12.0, + "gx": -0.38940225660950395, + "gy": 0.1291363802493396 + } + }, + { + "id": "p03", + "polygon": [ + [4.677747443848302, -31.06736517395015], + [17.942142619071312, 8.783052899584794], + [-22.619890062919612, 22.284312274365355] + ], + "roof": { + "z0": 16.0, + "gx": -0.35656927283753054, + "gy": -0.1824403509224255 + } + }, + { + "id": "p04", + "polygon": [ + [-10.57334071956494, -11.843435566928624], + [9.653504523894272, -17.48920668318471], + [0.9198361956706673, 29.332642250113338] + ], + "roof": { + "z0": 16.0, + "gx": -0.07546561224736624, + "gy": -0.2703671878824957 + } + }, + { + "id": "p05", + "polygon": [ + [-20.869462911084803, 11.980317934130785], + [-1.3610976169395474, -14.635911767879769], + [22.230560528024352, 2.6555938337489824] + ], + "roof": { + "z0": 12.0, + "gx": -0.21496821260766125, + "gy": 0.29329178734997857 + } + }, + { + "id": "p06", + "polygon": [ + [-3.177793321314314, 16.761984655971087], + [-20.340740261189232, -21.571202693100712], + [23.518533582503547, 4.809218037129625] + ], + "roof": { + "z0": 12.0, + "gx": -0.11675474108758448, + "gy": -0.26076998196647483 + } + }, + { + "id": "p07", + "polygon": [ + [-13.46946406512329, -10.470722888050872], + [20.699230732547353, 0.8898578991991899], + [-7.229766667424064, 9.580864988851683] + ], + "roof": { + "z0": 16.0, + "gx": 0.16978768429113536, + "gy": 0.5456214388272804 + } + }, + { + "id": "p08", + "polygon": [ + [5.387575186481936, 33.01570131937233], + [-15.814693412369786, -10.047784445973534], + [10.42711822588785, -22.9679168733988] + ], + "roof": { + "z0": 12.0, + "gx": 0.368063980900392, + "gy": -0.1812159709303566 + } + }, + { + "id": "p09", + "polygon": [ + [14.958658849798951, 11.056153282915876], + [-16.552292125693466, 20.857172037112463], + [1.5936332758945149, -31.913325320028335] + ], + "roof": { + "z0": 12.0, + "gx": -0.3472281099227815, + "gy": 0.10800020665781362 + } + }, + { + "id": "p10", + "polygon": [ + [-20.374393672513772, -2.425712777191638], + [28.33555168017319, -12.087038966605276], + [-7.961158007659417, 14.512751743796914] + ], + "roof": { + "z0": 16.0, + "gx": 0.33777512013209127, + "gy": 0.46091059921057276 + } + }, + { + "id": "p11", + "polygon": [ + [-14.494331585559635, -10.675994187327394], + [17.233587047879453, -19.750088036845845], + [-2.7392554623198198, 30.426082224173243] + ], + "roof": { + "z0": 16.0, + "gx": 0.4268042127465739, + "gy": 0.16989127068750046 + } + }, + { + "id": "p12", + "polygon": [ + [-31.238962280036716, 6.717680824990362], + [6.809369815633546, -17.309895514240942], + [24.42959246440317, 10.592214689250582] + ], + "roof": { + "z0": 16.0, + "gx": -0.1941622330442934, + "gy": -0.3074612694599617 + } + }, + { + "id": "p13", + "polygon": [ + [-14.293735120272581, -16.633975361034], + [30.664130713674346, -14.687106167475388], + [-16.370395593401767, 31.32108152850939] + ], + "roof": { + "z0": 12.0, + "gx": -0.255601042755471, + "gy": -0.26130292392820065 + } + }, + { + "id": "p14", + "polygon": [ + [-11.068139199307861, 4.643144911021488], + [-6.373423074246823, -15.82535871052085], + [17.441562273554684, 11.182213799499362] + ], + "roof": { + "z0": 12.0, + "gx": 0.1277473775526813, + "gy": -0.5569660849399276 + } + }, + { + "id": "p15", + "polygon": [ + [0.052520863461229084, -11.401633284705367], + [16.530567947986118, 9.987007725891377], + [-16.583088811447347, 1.4146255588139907] + ], + "roof": { + "z0": 12.0, + "gx": -0.45266965101792045, + "gy": 0.34874173723862195 + } + }, + { + "id": "p16", + "polygon": [ + [17.127614064508286, -5.541420075870259], + [5.983248040242847, 25.51985977408438], + [-23.110862104751135, -19.978439698214125] + ], + "roof": { + "z0": 16.0, + "gx": -0.38701371161976394, + "gy": 0.2474778109090397 + } + }, + { + "id": "p17", + "polygon": [ + [-14.12338131552295, 1.5906288744824337], + [0.5279299911641502, -21.088416012693543], + [13.5954513243588, 19.49778713821111] + ], + "roof": { + "z0": 16.0, + "gx": 0.5466155306519145, + "gy": -0.1759935533090188 + } + }, + { + "id": "p18", + "polygon": [ + [-22.24050689627822, -21.315718448989728], + [16.47301852143238, 1.624703293695723], + [5.767488374845838, 19.691015155294004] + ], + "roof": { + "z0": 16.0, + "gx": 0.22941348395680355, + "gy": 0.13594323995665453 + } + }, + { + "id": "p19", + "polygon": [ + [-20.848140640224443, -26.161374808014617], + [18.708423388626123, 1.028296801466901], + [2.139717251598322, 25.133078006547716] + ], + "roof": { + "z0": 16.0, + "gx": 0.23239035563659416, + "gy": -0.33809029084487663 + } + }, + { + "id": "p20", + "polygon": [ + [8.374156113330542, -11.483619176442968], + [15.184626211668364, 14.64333045491749], + [-23.55878232499891, -3.1597112784745214] + ], + "roof": { + "z0": 20.0, + "gx": 0.0, + "gy": 0.0 + } + }, + { + "id": "p21", + "polygon": [ + [16.630540788237294, 0.6520069714164398], + [1.151551449836294, 22.77441391690201], + [-17.782092238073588, -23.42642088831845] + ], + "roof": { + "z0": 8.0, + "gx": 0.0, + "gy": 0.0 + } + }, + { + "id": "p22", + "polygon": [ + [-19.939270695089046, 29.179196084675862], + [-12.238951554424391, -18.19912263952449], + [32.17822224951344, -10.980073445151373] + ], + "roof": { + "z0": 8.0, + "gx": 0.0, + "gy": 0.0 + } + }, + { + "id": "p23", + "polygon": [ + [-14.072774058971854, 28.464135860502225], + [-5.756461707605924, -30.88568679192462], + [19.829235766577778, 2.4215509314223915] + ], + "roof": { + "z0": 20.0, + "gx": -0.0, + "gy": 0.0 + } + }, + { + "id": "p24", + "polygon": [ + [-32.65197345425489, 5.463389931410159], + [4.42670219032148, -20.035076933174054], + [28.225271263933415, 14.571687001763893] + ], + "roof": { + "z0": 12.0, + "gx": -0.21972548530119332, + "gy": 0.15110202586420274 + } + }, + { + "id": "p25", + "polygon": [ + [-10.968804540781981, 21.440273481141062], + [-17.747009949459386, -4.695065266190615], + [28.715814490241367, -16.745208214950445] + ], + "roof": { + "z0": 12.0, + "gx": 0.11157539767370214, + "gy": 0.4302113374046366 + } + }, + { + "id": "p26", + "polygon": [ + [29.04212855096794, 4.219569791940026], + [-13.50870992046732, 8.341298237364963], + [-15.533418630500622, -12.56086802930499] + ], + "roof": { + "z0": 16.0, + "gx": 0.0550941145587293, + "gy": 0.5687664290250326 + } + }, + { + "id": "p27", + "polygon": [ + [12.720172963549262, -26.517865671606955], + [7.014773910061973, 15.09281110299582], + [-19.734946873611236, 11.425054568611134] + ], + "roof": { + "z0": 8.0, + "gx": 0.0, + "gy": -0.0 + } + }, + { + "id": "p28", + "polygon": [ + [-17.516626965794792, -5.492520345086644], + [29.44342733333824, -15.42998985308904], + [-11.926800367543446, 20.922510198175683] + ], + "roof": { + "z0": 12.0, + "gx": 0.24458361614131788, + "gy": -0.05175765368751247 + } + }, + { + "id": "p29", + "polygon": [ + [-32.92874250514045, -3.4202217808436046], + [9.597299560435353, -18.135375406846904], + [23.331442944705095, 21.55559718769051] + ], + "roof": { + "z0": 16.0, + "gx": 0.2520061752034121, + "gy": -0.08720091037631583 + } + }, + { + "id": "p30", + "polygon": [ + [34.615227234060775, -5.371084018551311], + [-5.721078017569239, 20.647802941642144], + [-28.894149216491535, -15.276718923090833] + ], + "roof": { + "z0": 16.0, + "gx": 0.05792768950023114, + "gy": -0.3713998622839316 + } + }, + { + "id": "p31", + "polygon": [ + [-33.475478122944466, -10.317696663512955], + [14.179501892079676, -16.062509956183963], + [19.29597623086479, 26.380206619696917] + ], + "roof": { + "z0": 20.0, + "gx": 0.0, + "gy": -0.0 + } + } + ], + "rules": { + "translate": true, + "rotate": "continuous-z", + "flip": false + }, + "validation": { + "contactNoise": 1e-06, + "overlapDepth": 0.006, + "outsideDepth": 0.006, + "areaError": 0.012, + "edgeAngleDeg": 3.0, + "edgeMinOverlap": 0.02, + "roofMismatch": 0.05 + }, + "source": { + "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", + "puzzleId": "plt1", + "geometryHash": "92ce0a714cda54a221b7aab75486e1b7009bbf02e0458c10362ee593251b76da" + } +} diff --git a/benchmarks/fixtures/plt2-flat.json b/benchmarks/fixtures/plt2-flat.json new file mode 100644 index 0000000..b0e9f33 --- /dev/null +++ b/benchmarks/fixtures/plt2-flat.json @@ -0,0 +1,292 @@ +{ + "formatVersion": 1, + "id": "plt2-flat", + "regime": "footprint", + "units": "mm", + "spanMm": 144.0, + "target": { + "vertices": [ + [-72.0, -72.0], + [72.0, -72.0], + [72.0, 72.0], + [-72.0, 72.0] + ] + }, + "pieces": [ + { + "id": "p00", + "polygon": [ + [-25.850769888926923, 16.970200238940876], + [-2.0178610880436096, -18.520009088263414], + [27.868630976970532, 1.5498088493225346] + ] + }, + { + "id": "p01", + "polygon": [ + [-24.387524525646008, 18.398332737262216], + [-1.8197943094805682, -17.909518381887942], + [26.207318835126575, -0.48881435537427187] + ] + }, + { + "id": "p02", + "polygon": [ + [-25.23565608198294, 5.693124108244751], + [-7.958283837027665, -17.90888657536543], + [33.1939399190106, 12.21576246712068] + ] + }, + { + "id": "p03", + "polygon": [ + [1.5010528367685962, -14.133182245383697], + [19.58359217900601, 13.471559574391328], + [-21.084645015774605, 0.6616226709923687] + ] + }, + { + "id": "p04", + "polygon": [ + [-14.8270692419416, -12.213026557519203], + [20.40417263767667, -19.61299923448443], + [-5.577103395735068, 31.826025792003634] + ] + }, + { + "id": "p05", + "polygon": [ + [-17.16422567406935, -7.242365429168748], + [14.905729899815835, -23.59834138565116], + [2.2584957742535146, 30.84070681481991] + ] + }, + { + "id": "p06", + "polygon": [ + [1.5914186060729243, 24.011036771040207], + [-14.52907561140887, -17.03396494882985], + [12.937657005335947, -6.9770718222103545] + ] + }, + { + "id": "p07", + "polygon": [ + [11.238949445485897, -17.830760369704155], + [6.201205239614774, 10.982147038542795], + [-17.440154685100673, 6.84861333116136] + ] + }, + { + "id": "p08", + "polygon": [ + [-17.87997202153108, -5.128996052763724], + [8.216221301977086, -25.32772606289278], + [9.663750719553994, 30.4567221156565] + ] + }, + { + "id": "p09", + "polygon": [ + [-29.93434677233671, 12.162848486826386], + [2.4827317331884924, -19.04825564562327], + [27.451615039148216, 6.8854071587968875] + ] + }, + { + "id": "p10", + "polygon": [ + [-21.15867727005179, 12.857308279021463], + [-14.010858912508038, -13.179371477190937], + [35.169536182559824, 0.3220631981694755] + ] + }, + { + "id": "p11", + "polygon": [ + [4.409402026686715, 16.418196422477443], + [-18.971760261256982, 11.003286444939548], + [14.562358234570269, -27.42148286741699] + ] + }, + { + "id": "p12", + "polygon": [ + [17.838179886232584, 13.18566791430784], + [-33.06670743618454, 16.298937368116317], + [15.228527549951952, -29.484605282424155] + ] + }, + { + "id": "p13", + "polygon": [ + [-2.5031539377429883, -25.7836521921151], + [15.26963940902042, 17.06130453155592], + [-12.766485471277434, 8.722347660559182] + ] + }, + { + "id": "p14", + "polygon": [ + [10.742407496687838, -23.534032403629958], + [19.072772736555855, 4.5046465055197835], + [-29.815180233243694, 19.029385898110174] + ] + }, + { + "id": "p15", + "polygon": [ + [12.375069105223602, 17.083842209554042], + [-12.542199931576896, 6.685298862156614], + [0.16713082635329357, -23.769141071710656] + ] + }, + { + "id": "p16", + "polygon": [ + [14.942491480451961, -10.664049341437828], + [-6.023406147123139, 18.7541616284706], + [-8.919085333328821, -8.090112287032776] + ] + }, + { + "id": "p17", + "polygon": [ + [-18.041429032353037, -11.557220187855252], + [29.601519588622597, 0.006168013665782901], + [-11.560090556269563, 11.55105217418947] + ] + }, + { + "id": "p18", + "polygon": [ + [24.708967675376886, 1.570642039797784], + [3.9430900465019283, 18.826896740705237], + [-28.652057721878815, -20.39753878050302] + ] + }, + { + "id": "p19", + "polygon": [ + [24.606815918059617, -9.031451177675034], + [-17.03084166373613, 25.3613964959493], + [-7.575974254323487, -16.329945318274266] + ] + }, + { + "id": "p20", + "polygon": [ + [17.689055105555088, 13.38505993533968], + [-33.24756998683535, 15.92675704500087], + [15.558514881280265, -29.31181698034055] + ] + }, + { + "id": "p21", + "polygon": [ + [21.657115791689638, 3.4596727569738874], + [-28.613919168622058, 12.051706510347948], + [6.95680337693242, -15.511379267321836] + ] + }, + { + "id": "p22", + "polygon": [ + [-20.890152611116417, -8.809172712818492], + [27.45766730939736, -25.041495680698702], + [-6.567514698280942, 33.850668393517196] + ] + }, + { + "id": "p23", + "polygon": [ + [8.222302588406226, -20.009841082444613], + [13.536724495984492, 6.461972602836795], + [-21.75902708439072, 13.547868479607818] + ] + }, + { + "id": "p24", + "polygon": [ + [-15.784261427325092, 25.042106364957746], + [-3.6110812393631404, -15.938086217696263], + [19.395342666688233, -9.104020147261483] + ] + }, + { + "id": "p25", + "polygon": [ + [-30.843621620146916, 8.346915918661574], + [5.89209415601455, -17.64322041058999], + [24.951527464132365, 9.296304491928415] + ] + }, + { + "id": "p26", + "polygon": [ + [-6.91085517903497, 33.782245051127155], + [-20.799638166768418, -9.020812165847957], + [27.710493345803386, -24.7614328852792] + ] + }, + { + "id": "p27", + "polygon": [ + [19.662228472047083, 11.732296088704082], + [-9.585038083754515, 12.13216983614125], + [-10.077190388292568, -23.864465924845334] + ] + }, + { + "id": "p28", + "polygon": [ + [5.432554803451417, -11.381996674902735], + [15.619347414309214, 10.348839855322533], + [-21.05190221776063, 1.0331568195802028] + ] + }, + { + "id": "p29", + "polygon": [ + [3.52887164664512, 19.37903673822577], + [-11.679642672237083, -2.930178671831907], + [8.150771025591965, -16.448858066393868] + ] + }, + { + "id": "p30", + "polygon": [ + [-5.215237757944639, -14.064184836957619], + [25.05044490252804, 5.4291076785607295], + [-19.8352071445834, 8.63507715839689] + ] + }, + { + "id": "p31", + "polygon": [ + [21.001554123937517, -7.7578814362764685], + [2.0835230390120163, 14.550650560916722], + [-23.08507716294953, -6.792769124640254] + ] + } + ], + "rules": { + "translate": true, + "rotate": "continuous-z", + "flip": false + }, + "validation": { + "contactNoise": 1e-06, + "overlapDepth": 0.006, + "outsideDepth": 0.006, + "areaError": 0.012, + "edgeAngleDeg": 3.0, + "edgeMinOverlap": 0.02 + }, + "source": { + "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", + "puzzleId": "plt2-flat", + "geometryHash": "af59624c1881366053bd874428d31a022ed0f2222b0d74f2ec12651660ceeb93" + } +} diff --git a/benchmarks/fixtures/plt2.json b/benchmarks/fixtures/plt2.json new file mode 100644 index 0000000..484d0fb --- /dev/null +++ b/benchmarks/fixtures/plt2.json @@ -0,0 +1,454 @@ +{ + "formatVersion": 1, + "id": "plt2", + "regime": "relief", + "units": "mm", + "spanMm": 144.0, + "reliefMm": 13.75, + "target": { + "vertices": [ + [-72.0, -72.0], + [72.0, -72.0], + [72.0, 72.0], + [-72.0, 72.0] + ] + }, + "pieces": [ + { + "id": "p00", + "polygon": [ + [25.861464223126127, -0.659293740276274], + [4.31062545747325, 19.117557588912437], + [-30.172089680599377, -18.458263848636165] + ], + "roof": { + "z0": 12.583333333333334, + "gx": -0.1822904010567084, + "gy": -0.19864188572329614 + } + }, + { + "id": "p01", + "polygon": [ + [-4.42092104119058, -21.947789345343153], + [14.697850152292187, 0.18894681993770845], + [-10.276929111101607, 21.758842525405445] + ], + "roof": { + "z0": 21.75, + "gx": 0.0, + "gy": 0.0 + } + }, + { + "id": "p02", + "polygon": [ + [-34.619700081071635, -6.202932072548329], + [23.011902895143646, -9.135224416755147], + [11.607797185927986, 15.338156489303476] + ], + "roof": { + "z0": 21.75, + "gx": -0.0, + "gy": 0.0 + } + }, + { + "id": "p03", + "polygon": [ + [12.973239845752728, 8.41175058501937], + [-22.820596781518287, 12.258991089618963], + [9.847356935765559, -20.670741674638332] + ], + "roof": { + "z0": 8.0, + "gx": 0.0, + "gy": 0.0 + } + }, + { + "id": "p04", + "polygon": [ + [2.210246405314747, -21.311436151226253], + [13.305297867895197, 26.44275039867418], + [-15.515544273209944, -5.131314247447926] + ], + "roof": { + "z0": 12.583333333333334, + "gx": 0.21683886566954383, + "gy": 0.23755323765079384 + } + }, + { + "id": "p05", + "polygon": [ + [-30.258436865617867, 4.2044022701708315], + [7.125975508986296, -16.531272577915093], + [23.13246135663157, 12.326870307744262] + ], + "roof": { + "z0": 12.583333333333334, + "gx": 0.2021020940359252, + "gy": 0.3643704909805474 + } + }, + { + "id": "p06", + "polygon": [ + [-9.543878047780353, -14.068204995986385], + [14.321099058548112, -16.6104220823931], + [-4.77722101076776, 30.678627078379485] + ], + "roof": { + "z0": 12.583333333333334, + "gx": 0.5696934639097506, + "gy": -0.06068660579529921 + } + }, + { + "id": "p07", + "polygon": [ + [-22.50922501279711, -23.180482939819626], + [18.58743643814034, -4.848423110465167], + [3.9217885746567713, 28.028906050284796] + ], + "roof": { + "z0": 12.583333333333334, + "gx": -0.15559618682322457, + "gy": 0.348814256142216 + } + }, + { + "id": "p08", + "polygon": [ + [3.4758862328410203, 18.27342920462238], + [-26.31340324348664, 4.074899967565678], + [22.83751701064562, -22.34832917218806] + ], + "roof": { + "z0": 17.166666666666668, + "gx": 0.3761273923778745, + "gy": 0.17927435905374628 + } + }, + { + "id": "p09", + "polygon": [ + [-11.590681896830255, 9.039833691307125], + [-5.579222072143811, -23.408006772677236], + [17.169903968974065, 14.368173081370111] + ], + "roof": { + "z0": 21.75, + "gx": 0.0, + "gy": 0.0 + } + }, + { + "id": "p10", + "polygon": [ + [-22.46908960876365, 7.75499917171816], + [11.989871589274728, -17.35635270650786], + [10.479218019488922, 9.6013535347897] + ], + "roof": { + "z0": 12.583333333333334, + "gx": -0.41601398520520927, + "gy": -0.02331255508928712 + } + }, + { + "id": "p11", + "polygon": [ + [-19.0106685778252, -29.827118201799006], + [23.52728526927035, 10.757176574658164], + [-4.516616691445148, 19.069941627140842] + ], + "roof": { + "z0": 12.583333333333334, + "gx": 0.45070190893106943, + "gy": -0.13359692538141493 + } + }, + { + "id": "p12", + "polygon": [ + [18.626047258102616, 2.0329445489063502], + [-18.23356327841333, 10.572945198576264], + [-0.39248397968928295, -12.605889747482614] + ], + "roof": { + "z0": 12.583333333333334, + "gx": 0.4540013967354836, + "gy": 0.34945133954053514 + } + }, + { + "id": "p13", + "polygon": [ + [12.611004448155409, 0.15832500940941774], + [-2.8443096972128723, 18.519514095848756], + [-9.766694750942536, -18.677839105258176] + ], + "roof": { + "z0": 17.166666666666668, + "gx": 0.3689419609354407, + "gy": -0.43830963530996686 + } + }, + { + "id": "p14", + "polygon": [ + [-13.663709114454281, 16.071809270756635], + [-9.467674785892351, -10.600147836166165], + [23.131383900346634, -5.471661434590471] + ], + "roof": { + "z0": 17.166666666666668, + "gx": -0.4116042763414013, + "gy": -0.0647536161815113 + } + }, + { + "id": "p15", + "polygon": [ + [-10.55739511893907, -18.882304104706115], + [13.478418038601891, -6.582723386007584], + [-2.9210229196628195, 25.465027490713698] + ], + "roof": { + "z0": 17.166666666666668, + "gx": 0.1739909823889967, + "gy": -0.3400127890084241 + } + }, + { + "id": "p16", + "polygon": [ + [-0.53729973866837, -18.349695065336288], + [12.223593644885653, 15.446156751914408], + [-11.686293906217283, 2.9035383134218797] + ], + "roof": { + "z0": 8.0, + "gx": 0.0, + "gy": 0.0 + } + }, + { + "id": "p17", + "polygon": [ + [21.587794859590446, -6.925829416051203], + [-4.517961249331243, 36.88614951644507], + [-17.069833610259202, -29.960320100393872] + ], + "roof": { + "z0": 17.166666666666668, + "gx": 0.13800620780379594, + "gy": -0.23160888516794453 + } + }, + { + "id": "p18", + "polygon": [ + [-27.847589469844323, 10.038015775989564], + [6.955041542918184, -14.78816747052461], + [20.89254792692614, 4.750151694535045] + ], + "roof": { + "z0": 12.583333333333334, + "gx": 0.33270957079880104, + "gy": 0.46640952867980945 + } + }, + { + "id": "p19", + "polygon": [ + [9.200061300814612, 16.86294375431684], + [-26.248220838163725, 10.584465165089242], + [17.048159537349115, -27.447408919406083] + ], + "roof": { + "z0": 12.583333333333334, + "gx": 0.05328955592708612, + "gy": -0.300872765068489 + } + }, + { + "id": "p20", + "polygon": [ + [-14.198701350276693, -17.96237400695272], + [13.275552458220158, -7.926046109444778], + [0.9231488920565347, 25.8884201163975] + ], + "roof": { + "z0": 8.0, + "gx": 0.0, + "gy": -0.0 + } + }, + { + "id": "p21", + "polygon": [ + [-21.35975965110633, 4.976009208891188], + [21.94298911255433, -21.96600165725028], + [-0.5832294614479965, 16.989992448359093] + ], + "roof": { + "z0": 12.583333333333334, + "gx": 0.15295580513211454, + "gy": -0.26451600935907604 + } + }, + { + "id": "p22", + "polygon": [ + [-32.249725853779836, 17.861066103568533], + [13.801596074560699, -30.178899015614714], + [18.448129779219137, 12.317832912046185] + ], + "roof": { + "z0": 17.166666666666668, + "gx": 0.03495904432217968, + "gy": 0.3197319183367668 + } + }, + { + "id": "p23", + "polygon": [ + [14.572206719091549, 20.016263171133197], + [-11.96866972630589, 15.058251723975426], + [-2.603536992785658, -35.07451489510862] + ], + "roof": { + "z0": 21.75, + "gx": 0.0, + "gy": 0.0 + } + }, + { + "id": "p24", + "polygon": [ + [15.216977432534536, 16.806058366486017], + [-35.46347798452626, 11.105932164434542], + [20.24650055199172, -27.911990530920562] + ], + "roof": { + "z0": 17.166666666666668, + "gx": -0.034151082909894465, + "gy": 0.30364107276016816 + } + }, + { + "id": "p25", + "polygon": [ + [-14.390728799255847, 16.152613554043455], + [-10.62908904513563, -10.584066613101873], + [25.01981784439148, -5.568546940941583] + ], + "roof": { + "z0": 12.583333333333334, + "gx": 0.3782194982492266, + "gy": 0.053212496521762326 + } + }, + { + "id": "p26", + "polygon": [ + [3.16331190469616, -30.761070491671898], + [15.635289965186093, 10.129176062471767], + [-18.798601869882255, 20.63189442920013] + ], + "roof": { + "z0": 17.166666666666668, + "gx": 0.36532871352792423, + "gy": -0.111429303659348 + } + }, + { + "id": "p27", + "polygon": [ + [16.625869217843515, 8.404937403167462], + [-16.492397347784596, 22.518066740348463], + [-0.13347187005891925, -30.923004143515925] + ], + "roof": { + "z0": 17.166666666666668, + "gx": 0.12609196126461256, + "gy": 0.2958909455993415 + } + }, + { + "id": "p28", + "polygon": [ + [23.343221756523064, -28.53342773004653], + [-1.645236704218492, 33.14427848342896], + [-21.69798505230457, -4.610850753382435] + ], + "roof": { + "z0": 17.166666666666668, + "gx": -0.238107110196609, + "gy": 0.12646498786202665 + } + }, + { + "id": "p29", + "polygon": [ + [12.387992017418071, 13.875793807072307], + [-20.459866470511272, 17.04094668757721], + [8.071874453093201, -30.91674049464952] + ], + "roof": { + "z0": 17.166666666666668, + "gx": 0.02930697111578615, + "gy": 0.3041468378511976 + } + }, + { + "id": "p30", + "polygon": [ + [10.722674365775031, -16.523445598468587], + [6.490314849029026, 10.142771473343629], + [-17.212989214804058, 6.380674125124958] + ], + "roof": { + "z0": 8.0, + "gx": -0.0, + "gy": 0.0 + } + }, + { + "id": "p31", + "polygon": [ + [30.53227435214886, -1.0149989581831207], + [-8.816728062760065, 15.694833744495003], + [-21.715546289388794, -14.679834786311883] + ], + "roof": { + "z0": 12.583333333333334, + "gx": 0.2960494008850574, + "gy": -0.1257194758930675 + } + } + ], + "rules": { + "translate": true, + "rotate": "continuous-z", + "flip": false + }, + "validation": { + "contactNoise": 1e-06, + "overlapDepth": 0.006, + "outsideDepth": 0.006, + "areaError": 0.012, + "edgeAngleDeg": 3.0, + "edgeMinOverlap": 0.02, + "roofMismatch": 0.05 + }, + "source": { + "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", + "puzzleId": "plt2", + "geometryHash": "921417de793eed6e68bc437b4a45a9fa5faf720c390612765f4a7e06e379d78a" + } +} diff --git a/benchmarks/fixtures/plt3-flat.json b/benchmarks/fixtures/plt3-flat.json new file mode 100644 index 0000000..914c0c4 --- /dev/null +++ b/benchmarks/fixtures/plt3-flat.json @@ -0,0 +1,292 @@ +{ + "formatVersion": 1, + "id": "plt3-flat", + "regime": "footprint", + "units": "mm", + "spanMm": 144.0, + "target": { + "vertices": [ + [-72.0, -72.0], + [72.0, -72.0], + [72.0, 72.0], + [-72.0, 72.0] + ] + }, + "pieces": [ + { + "id": "p00", + "polygon": [ + [-13.065276174683465, 4.456574747409559], + [6.6523853052748025, -22.934597658344998], + [6.412890869408663, 18.478022910935437] + ] + }, + { + "id": "p01", + "polygon": [ + [19.778360495035642, -22.024224302535913], + [0.873738233498675, 16.31867278608535], + [-20.652098728534316, 5.705551516450563] + ] + }, + { + "id": "p02", + "polygon": [ + [12.467573985467093, 26.67976009856356], + [-33.74556269332082, -20.779785814852715], + [21.277988707853726, -5.8999742837108435] + ] + }, + { + "id": "p03", + "polygon": [ + [-0.6191045329618348, 27.21886679450976], + [-20.54998274282449, 5.810396653380528], + [21.169087275786325, -33.02926344789029] + ] + }, + { + "id": "p04", + "polygon": [ + [-12.607059056221281, -27.09819296471536], + [16.260733074534766, 4.432951598961035], + [-3.6536740183134846, 22.665241365754326] + ] + }, + { + "id": "p05", + "polygon": [ + [6.168643606664913, -39.604423187996964], + [13.89499233005115, 28.60383170394868], + [-20.06363593671606, 11.000591484048286] + ] + }, + { + "id": "p06", + "polygon": [ + [18.31399775348102, 10.432999869907606], + [-18.609932481450826, 2.175525921666182], + [0.29593472796980613, -12.608525791573788] + ] + }, + { + "id": "p07", + "polygon": [ + [-6.708326976215202, -27.09355733712691], + [23.81761716975401, 19.722350578849344], + [-17.109290193538808, 7.371206758277564] + ] + }, + { + "id": "p08", + "polygon": [ + [-17.553361841663225, 15.998187024023732], + [-21.633120367261114, -26.556696013916945], + [39.18648220892434, 10.558508989893213] + ] + }, + { + "id": "p09", + "polygon": [ + [26.528664928841867, 3.2372730952509263], + [-18.21688045226217, 9.311700520742086], + [-8.311784476579698, -12.548973615993013] + ] + }, + { + "id": "p10", + "polygon": [ + [8.813809323221328, -11.396458450496665], + [9.368731464396946, 22.348979188052834], + [-18.182540787618272, -10.95252073755617] + ] + }, + { + "id": "p11", + "polygon": [ + [22.956618931384313, -0.2369540867074491], + [-24.57215424267904, 17.013501575924646], + [1.6155353112947282, -16.776547489217197] + ] + }, + { + "id": "p12", + "polygon": [ + [-14.999719248176241, 18.4138785288676], + [-25.316007541715244, -23.072705999683194], + [40.315726789891485, 4.658827470815595] + ] + }, + { + "id": "p13", + "polygon": [ + [-12.171425485035218, -22.407730845898595], + [15.998981620366626, -3.8203516999316864], + [-3.827556135331408, 26.228082545830283] + ] + }, + { + "id": "p14", + "polygon": [ + [-22.4466063204684, -9.132352637404452], + [20.591059280367897, -5.154685025525336], + [1.8555470401005048, 14.287037662929787] + ] + }, + { + "id": "p15", + "polygon": [ + [-20.80031530532999, -9.570626060966699], + [25.378045784950334, -5.197816093030276], + [-4.577730479620346, 14.768442153996975] + ] + }, + { + "id": "p16", + "polygon": [ + [-14.366789115118369, 24.245522690214713], + [-2.9210668411729355, -27.01906490812367], + [17.287855956291303, 2.7735422179089584] + ] + }, + { + "id": "p17", + "polygon": [ + [4.450167534622456, -12.500340351918116], + [16.998688013027493, 11.406450185564104], + [-21.44885554764995, 1.0938901663540097] + ] + }, + { + "id": "p18", + "polygon": [ + [-20.522197172997586, -15.1357002874862], + [12.871116313625947, -10.241917049122785], + [7.651080859371639, 25.377617336608985] + ] + }, + { + "id": "p19", + "polygon": [ + [11.606588862588833, -16.862668678914048], + [0.8402742466458601, 21.460287490861436], + [-12.446863109234693, -4.5976188119473855] + ] + }, + { + "id": "p20", + "polygon": [ + [21.941978275074717, -2.2609930066564097], + [-20.367659498428882, 17.78787358163026], + [-1.5743187766458355, -15.526880574973852] + ] + }, + { + "id": "p21", + "polygon": [ + [-13.603222708003688, -26.290727109695023], + [15.57253208615288, 4.955677998593036], + [-1.9693093781491893, 21.335049111101988] + ] + }, + { + "id": "p22", + "polygon": [ + [-28.236689983723387, 8.362974277318758], + [25.565344554681598, -30.281605931661083], + [2.671345429041791, 21.918631654342327] + ] + }, + { + "id": "p23", + "polygon": [ + [21.335403166348964, 0.9290165387907043], + [-30.46131892895346, 24.721863787113254], + [9.125915762604498, -25.65088032590396] + ] + }, + { + "id": "p24", + "polygon": [ + [-17.016988425018205, -22.46490830034248], + [26.11889699458166, 7.50771068878077], + [-9.101908569563456, 14.95719761156171] + ] + }, + { + "id": "p25", + "polygon": [ + [-12.897651293519145, -4.920679943949207], + [19.772263093489507, -13.390579231752183], + [-6.874611799970361, 18.311259175701387] + ] + }, + { + "id": "p26", + "polygon": [ + [2.7195907059444355, -18.430038697521518], + [26.57623516295302, 8.530312102345338], + [-29.295825868897456, 9.89972659517618] + ] + }, + { + "id": "p27", + "polygon": [ + [17.447041800545428, 20.660366221585246], + [-15.55089251465145, 1.3161466475121575], + [-1.8961492858939764, -21.9765128690974] + ] + }, + { + "id": "p28", + "polygon": [ + [-5.073473161976873, -31.392831507761457], + [22.380943830486743, -4.75981651501373], + [-17.307470668509872, 36.15264802277518] + ] + }, + { + "id": "p29", + "polygon": [ + [-1.2718944311366194, -21.038828022398103], + [11.992587896784453, 14.395844384331857], + [-10.720693465647834, 6.642983638066246] + ] + }, + { + "id": "p30", + "polygon": [ + [15.686602101696817, 16.678744392280883], + [-25.473335072130435, -4.7086834999784735], + [9.786732970433619, -11.97006089230241] + ] + }, + { + "id": "p31", + "polygon": [ + [23.193273892614375, 13.27863118480864], + [-20.402818866142574, 1.5124424998580093], + [-2.790455026471802, -14.79107368466665] + ] + } + ], + "rules": { + "translate": true, + "rotate": "continuous-z", + "flip": false + }, + "validation": { + "contactNoise": 1e-06, + "overlapDepth": 0.006, + "outsideDepth": 0.006, + "areaError": 0.012, + "edgeAngleDeg": 3.0, + "edgeMinOverlap": 0.02 + }, + "source": { + "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", + "puzzleId": "plt3-flat", + "geometryHash": "8786ba1570b1d31f5cdeb933ee42ffb894bac9015c325943909b869dde6bf01b" + } +} diff --git a/benchmarks/fixtures/plt3.json b/benchmarks/fixtures/plt3.json new file mode 100644 index 0000000..4e0f89b --- /dev/null +++ b/benchmarks/fixtures/plt3.json @@ -0,0 +1,454 @@ +{ + "formatVersion": 1, + "id": "plt3", + "regime": "relief", + "units": "mm", + "spanMm": 144.0, + "reliefMm": 12.0, + "target": { + "vertices": [ + [-72.0, -72.0], + [72.0, -72.0], + [72.0, 72.0], + [-72.0, 72.0] + ] + }, + "pieces": [ + { + "id": "p00", + "polygon": [ + [-18.77822179394525, -13.207607135942517], + [29.882611838707987, 0.5286867665351007], + [-11.104390044762736, 12.678920369407415] + ], + "roof": { + "z0": 12.0, + "gx": -0.14280747396987775, + "gy": 0.5058956063173826 + } + }, + { + "id": "p01", + "polygon": [ + [-15.282089913735618, -2.3495165180309208], + [6.39818748277086, -21.984385298099973], + [8.883902430964756, 24.333901816130894] + ], + "roof": { + "z0": 16.0, + "gx": 0.5278437277975028, + "gy": -0.028327235876853485 + } + }, + { + "id": "p02", + "polygon": [ + [19.658554477493894, 7.6020547127342315], + [-18.081617210878008, 4.910969256601], + [-1.5769372666158858, -12.513023969335231] + ], + "roof": { + "z0": 16.0, + "gx": 0.34384749883879423, + "gy": -0.3629998588736715 + } + }, + { + "id": "p03", + "polygon": [ + [7.166311463906446, -19.98015215162995], + [12.906123020791597, 6.402693852761757], + [-20.072434484698043, 13.577458298868196] + ], + "roof": { + "z0": 16.0, + "gx": -0.44191091951273287, + "gy": -0.3586995351256558 + } + }, + { + "id": "p04", + "polygon": [ + [-15.758722817722855, -21.312558625237397], + [24.423485637165985, 7.3309855634250765], + [-8.664762819443128, 13.981573061812322] + ], + "roof": { + "z0": 16.0, + "gx": 0.28289920186333306, + "gy": -0.3968613180729762 + } + }, + { + "id": "p05", + "polygon": [ + [-21.089039483745665, -6.466445209929206], + [25.688523307977363, -8.446879320524456], + [-4.599483824231699, 14.91332453045366] + ], + "roof": { + "z0": 16.0, + "gx": -0.02301158007953813, + "gy": -0.5435301413707831 + } + }, + { + "id": "p06", + "polygon": [ + [26.880984992729374, 12.396073806680002], + [-15.33365390302094, 5.651686295467105], + [-11.547331089708436, -18.04776010214711] + ], + "roof": { + "z0": 12.0, + "gx": -0.356068232851779, + "gy": 0.4494539892682785 + } + }, + { + "id": "p07", + "polygon": [ + [6.885541588510134, -16.09819297414767], + [20.034827661292173, 19.8205872915593], + [-26.920369249802306, -3.7223943174116325] + ], + "roof": { + "z0": 20.0, + "gx": 0.0, + "gy": 0.0 + } + }, + { + "id": "p08", + "polygon": [ + [-6.19328472556554, -33.688176328024596], + [29.277665078599277, 28.104818582324427], + [-23.084380353033737, 5.583357745700166] + ], + "roof": { + "z0": 12.0, + "gx": -0.3043052996508416, + "gy": 0.17467996210115022 + } + }, + { + "id": "p09", + "polygon": [ + [-13.665389746754027, -1.9543855989312648], + [16.33139231258142, -17.422273822109343], + [-2.6660025658273936, 19.376659421040607] + ], + "roof": { + "z0": 16.0, + "gx": -0.3160154817773611, + "gy": 0.16295388416187606 + } + }, + { + "id": "p10", + "polygon": [ + [1.3892503115124182, 28.148179045401193], + [-17.339374603821465, -20.926265513663715], + [15.950124292309045, -7.221913531737476] + ], + "roof": { + "z0": 16.0, + "gx": -0.42766400487202527, + "gy": 0.16321241756282245 + } + }, + { + "id": "p11", + "polygon": [ + [-3.5397783463575143, 20.150247374626904], + [-15.0236088654187, -0.9239462424365703], + [18.563387211776213, -19.226301132190336] + ], + "roof": { + "z0": 16.0, + "gx": -0.27547965512501277, + "gy": 0.15011543162171484 + } + }, + { + "id": "p12", + "polygon": [ + [19.8165810627868, 24.87072807502827], + [-17.170711280988204, 15.123794963729983], + [-2.6458697817985968, -39.99452303875825] + ], + "roof": { + "z0": 16.0, + "gx": -0.05364669067106041, + "gy": 0.20357642844871002 + } + }, + { + "id": "p13", + "polygon": [ + [-26.64989195127384, -2.0082975340894427], + [17.767268233604938, -10.143307129094179], + [8.8826237176689, 12.15160466318362] + ], + "roof": { + "z0": 12.0, + "gx": -0.29143675545461173, + "gy": -0.11613914399916392 + } + }, + { + "id": "p14", + "polygon": [ + [-8.766755236935884, -12.736031666718533], + [20.390959269320255, -10.414354520416637], + [-11.624204032384371, 23.15038618713517] + ], + "roof": { + "z0": 20.0, + "gx": 0.0, + "gy": -0.0 + } + }, + { + "id": "p15", + "polygon": [ + [2.4708565210880433, 22.824490532149817], + [-19.3249910462, -22.799007019260507], + [16.854134525111956, -0.025483512889311832] + ], + "roof": { + "z0": 8.0, + "gx": 0.0, + "gy": -0.0 + } + }, + { + "id": "p16", + "polygon": [ + [-3.8513026221990643, -12.697636319892085], + [20.449836452879183, -0.9309613582172656], + [-16.59853383068012, 13.628597678109351] + ], + "roof": { + "z0": 12.0, + "gx": 0.4000187502070493, + "gy": 0.19369012282592293 + } + }, + { + "id": "p17", + "polygon": [ + [-25.520125011363437, 9.485421414169341], + [-12.99463650892592, -16.947032837664814], + [38.514761520289355, 7.461611423495475] + ], + "roof": { + "z0": 16.0, + "gx": 0.014566333716051205, + "gy": 0.46088987157284966 + } + }, + { + "id": "p18", + "polygon": [ + [-7.343610005658632, -22.586143807316695], + [33.11153588298874, -8.767906903563091], + [-25.767925877330107, 31.35405071087979] + ], + "roof": { + "z0": 12.0, + "gx": -0.19758427880304286, + "gy": -0.2899573370775935 + } + }, + { + "id": "p19", + "polygon": [ + [28.4114660070251, -8.308946944809382], + [-7.850057577778778, 14.333146759367184], + [-20.561408429246324, -6.024199814557802] + ], + "roof": { + "z0": 8.0, + "gx": -0.0, + "gy": 0.0 + } + }, + { + "id": "p20", + "polygon": [ + [-15.594934907517896, -0.6004208776182338], + [0.8126158018356602, -22.043188416347736], + [14.782319105682234, 22.64360929396597] + ], + "roof": { + "z0": 16.0, + "gx": 0.5192365747022653, + "gy": -0.16232044507011265 + } + }, + { + "id": "p21", + "polygon": [ + [13.358165969061016, -28.85843727479054], + [21.21344226807821, 8.576267669500107], + [-34.57160823713922, 20.282169605290434] + ], + "roof": { + "z0": 12.0, + "gx": -0.2060389677016341, + "gy": 0.04323509486903168 + } + }, + { + "id": "p22", + "polygon": [ + [15.144907920332669, 14.872601120336846], + [-11.217645198455498, 9.040295139074184], + [-3.9272627218771703, -23.912896259411028] + ], + "roof": { + "z0": 16.0, + "gx": 0.5107555210501777, + "gy": -0.2511561566052325 + } + }, + { + "id": "p23", + "polygon": [ + [-25.427529337655077, -1.9211329424821901], + [5.463803122917182, -15.514810841064108], + [19.963726214737896, 17.4359437835463] + ], + "roof": { + "z0": 16.0, + "gx": -0.19118100470151597, + "gy": 0.44830869681375773 + } + }, + { + "id": "p24", + "polygon": [ + [-9.64352914491197, 25.460800176570125], + [-21.312212803731104, -1.3609134463587296], + [30.955741948643073, -24.099886730211395] + ], + "roof": { + "z0": 20.0, + "gx": 0.0, + "gy": -0.0 + } + }, + { + "id": "p25", + "polygon": [ + [10.062783515043112, 15.805153840737415], + [-11.479007102038205, 5.224451736915221], + [1.4162235869950939, -21.029605577652635] + ], + "roof": { + "z0": 12.0, + "gx": 0.4487873045225274, + "gy": 0.22043129382962903 + } + }, + { + "id": "p26", + "polygon": [ + [1.3627732410448221, 18.579702610469635], + [-27.79654382519623, -2.532716204778019], + [26.43377058415141, -16.046986405691616] + ], + "roof": { + "z0": 16.0, + "gx": -0.1646192500214242, + "gy": 0.22736309603306865 + } + }, + { + "id": "p27", + "polygon": [ + [-23.55836955000148, -3.905537625674989], + [17.59435116821843, -8.544080229574782], + [5.964018381783047, 12.449617855249771] + ], + "roof": { + "z0": 16.0, + "gx": -0.24229859971740386, + "gy": 0.43736871010051154 + } + }, + { + "id": "p28", + "polygon": [ + [5.261193533821745, 27.41135426424007], + [-22.737521956478684, -20.958413472365933], + [17.476328422656938, -6.452940791874139] + ], + "roof": { + "z0": 12.0, + "gx": -0.26404908425820045, + "gy": -0.09524471648214576 + } + }, + { + "id": "p29", + "polygon": [ + [-13.754022779328182, -15.162102670333077], + [21.081721220906473, 4.10012565221868], + [-7.32769844157829, 11.061977018114396] + ], + "roof": { + "z0": 16.0, + "gx": 0.10578311667078011, + "gy": 0.43167209363699544 + } + }, + { + "id": "p30", + "polygon": [ + [-35.78895907215759, 17.020954982944662], + [6.618903058435796, -21.06543667487169], + [29.170056013721794, 4.044481691927027] + ], + "roof": { + "z0": 16.0, + "gx": 0.08094486263402817, + "gy": 0.4052024332842379 + } + }, + { + "id": "p31", + "polygon": [ + [11.226569045183307, -19.013854093100957], + [27.49124486183851, 10.558477918073127], + [-38.71781390702182, 8.45537617502783] + ], + "roof": { + "z0": 16.0, + "gx": -0.013118763309444337, + "gy": 0.41299997672583433 + } + } + ], + "rules": { + "translate": true, + "rotate": "continuous-z", + "flip": false + }, + "validation": { + "contactNoise": 1e-06, + "overlapDepth": 0.006, + "outsideDepth": 0.006, + "areaError": 0.012, + "edgeAngleDeg": 3.0, + "edgeMinOverlap": 0.02, + "roofMismatch": 0.05 + }, + "source": { + "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", + "puzzleId": "plt3", + "geometryHash": "5d4d8605b04149e41a7e8f74a06f9c186810e229ea9bdf52f93ca4b7a3190bab" + } +} diff --git a/benchmarks/fixtures/plt4-flat.json b/benchmarks/fixtures/plt4-flat.json new file mode 100644 index 0000000..5301400 --- /dev/null +++ b/benchmarks/fixtures/plt4-flat.json @@ -0,0 +1,292 @@ +{ + "formatVersion": 1, + "id": "plt4-flat", + "regime": "footprint", + "units": "mm", + "spanMm": 144.0, + "target": { + "vertices": [ + [-72.0, -72.0], + [72.0, -72.0], + [72.0, 72.0], + [-72.0, 72.0] + ] + }, + "pieces": [ + { + "id": "p00", + "polygon": [ + [16.797311375643837, -7.286997361716698], + [-6.752513904441026, 31.0588724194928], + [-10.044797471202813, -23.7718750577761] + ] + }, + { + "id": "p01", + "polygon": [ + [11.059305731533943, 8.529610585276476], + [-18.739875636763664, 11.994980663537216], + [7.680569905229722, -20.524591248813692] + ] + }, + { + "id": "p02", + "polygon": [ + [-13.294752005896536, 13.088623651924216], + [-19.603817400086463, -16.240469307999298], + [32.898569405983, 3.1518456560750803] + ] + }, + { + "id": "p03", + "polygon": [ + [-1.6780966124271028, 13.790721219695534], + [-18.406498401735345, 1.0958177708516317], + [20.084595014162446, -14.886538990547166] + ] + }, + { + "id": "p04", + "polygon": [ + [25.333289693836342, -2.5073757772151577], + [-25.383973356563082, 21.16374013810639], + [0.05068366272673863, -18.656364360891235] + ] + }, + { + "id": "p05", + "polygon": [ + [19.573416437429934, -10.997448293442783], + [6.245083315835991, 35.114974503454604], + [-25.818499753265925, -24.11752621001182] + ] + }, + { + "id": "p06", + "polygon": [ + [9.60945650652634, -18.355063215613797], + [5.595957236839591, 10.618274935386756], + [-15.20541374336593, 7.73678828022704] + ] + }, + { + "id": "p07", + "polygon": [ + [22.358490091120032, -10.26391352483483], + [8.728697895000566, 15.616412297893925], + [-31.087187986120597, -5.352498773059095] + ] + }, + { + "id": "p08", + "polygon": [ + [-12.843051557918058, 6.73097516565457], + [-4.602108441655384, -22.114940603384948], + [17.44515999957344, 15.383965437730378] + ] + }, + { + "id": "p09", + "polygon": [ + [4.192727389428713, -22.943867089876854], + [11.422318357195692, 23.356597426570296], + [-15.615045746624407, -0.4127303366934427] + ] + }, + { + "id": "p10", + "polygon": [ + [13.56670855535669, 13.49794128650779], + [-33.45634831539789, 3.8629984984171086], + [19.8896397600412, -17.3609397849249] + ] + }, + { + "id": "p11", + "polygon": [ + [27.51850031398343, 22.158116807826744], + [-18.71373218074287, 12.403980323566653], + [-8.804768133240557, -34.562097131393394] + ] + }, + { + "id": "p12", + "polygon": [ + [3.372273885697714, 16.90237465091344], + [-17.115618988654266, 12.29300966546507], + [13.74334510295655, -29.195384316378508] + ] + }, + { + "id": "p13", + "polygon": [ + [-19.809507030408696, -25.526132319883253], + [27.20644410074576, 7.798038175912975], + [-7.3969370703370645, 17.72809414397028] + ] + }, + { + "id": "p14", + "polygon": [ + [-23.444616652605035, 23.862364719624807], + [4.730267325038502, -24.77649230689593], + [18.71434932756653, 0.9141275872711185] + ] + }, + { + "id": "p15", + "polygon": [ + [4.039604421852024, 17.858656055676576], + [-29.263745230817023, -12.404967354484818], + [25.224140808964997, -5.4536887011917585] + ] + }, + { + "id": "p16", + "polygon": [ + [-8.677078774353255, 10.943984829287192], + [-11.742721479950319, -18.898968020617247], + [20.419800254303574, 7.954983191330055] + ] + }, + { + "id": "p17", + "polygon": [ + [-2.31069881471951, 17.346776962526896], + [-10.086552645711077, -19.70435118762602], + [12.397251460430585, 2.357574225099123] + ] + }, + { + "id": "p18", + "polygon": [ + [-30.84080995472824, -9.491809170876508], + [16.258451893661725, -5.720598047537295], + [14.582358061066518, 15.212407218413803] + ] + }, + { + "id": "p19", + "polygon": [ + [-23.816283889058724, 23.812488776181333], + [4.799588808058298, -25.960815612641326], + [19.016695081000428, 2.148326836459992] + ] + }, + { + "id": "p20", + "polygon": [ + [-22.152526859856874, -11.587301399520072], + [13.143126195495762, -4.500914774717814], + [9.009400664361111, 16.088216174237886] + ] + }, + { + "id": "p21", + "polygon": [ + [-25.762814764246826, 12.972176973164743], + [-7.9898604135661, -18.334724720369525], + [33.752675177812925, 5.362547747204781] + ] + }, + { + "id": "p22", + "polygon": [ + [-21.360167035211013, 4.099483409880413], + [2.9761603676473634, -33.75211059276212], + [18.38400666756365, 29.65262718288171] + ] + }, + { + "id": "p23", + "polygon": [ + [-32.26183483156192, -1.78157607219514], + [23.727284659653325, -15.427765965290636], + [8.534550171908593, 17.209342037485776] + ] + }, + { + "id": "p24", + "polygon": [ + [-8.471945654503434, 9.352867839713142], + [-13.601812828410768, -11.010934918565281], + [22.073758482914204, 1.6580670788521399] + ] + }, + { + "id": "p25", + "polygon": [ + [18.362414313733144, 22.244589017799544], + [-16.10634679362019, 11.856879562669118], + [-2.2560675201129534, -34.10146858046866] + ] + }, + { + "id": "p26", + "polygon": [ + [34.60445543785931, 4.447658243301685], + [-10.297318349172047, 19.157967919792657], + [-24.30713708868726, -23.605626163094342] + ] + }, + { + "id": "p27", + "polygon": [ + [-8.098167272888364, -15.016064291961454], + [18.57959582316536, 9.167803392733525], + [-10.481428550276997, 5.848260899227929] + ] + }, + { + "id": "p28", + "polygon": [ + [21.951709884505696, -13.932782677788914], + [1.3149116948475434, 15.565057251252021], + [-23.26662157935324, -1.6322745734631052] + ] + }, + { + "id": "p29", + "polygon": [ + [7.209185393952965, -12.580844405508529], + [15.771422585626196, 16.171339759760166], + [-22.980607979579162, -3.5904953542516367] + ] + }, + { + "id": "p30", + "polygon": [ + [-3.1658133713291914, -18.467271744843995], + [28.378506645100384, 17.712223479676215], + [-25.212693273771194, 0.7550482651677797] + ] + }, + { + "id": "p31", + "polygon": [ + [-8.623019927957806, -23.041126867452526], + [16.205810149702216, -7.578536626012217], + [-7.5827902217444105, 30.619663493464742] + ] + } + ], + "rules": { + "translate": true, + "rotate": "continuous-z", + "flip": false + }, + "validation": { + "contactNoise": 1e-06, + "overlapDepth": 0.006, + "outsideDepth": 0.006, + "areaError": 0.012, + "edgeAngleDeg": 3.0, + "edgeMinOverlap": 0.02 + }, + "source": { + "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", + "puzzleId": "plt4-flat", + "geometryHash": "23d0e692697cc2e381affe075b2cec934fc5c366f9d94957ea44d6b9b95a0050" + } +} diff --git a/benchmarks/fixtures/plt4.json b/benchmarks/fixtures/plt4.json new file mode 100644 index 0000000..a44675d --- /dev/null +++ b/benchmarks/fixtures/plt4.json @@ -0,0 +1,454 @@ +{ + "formatVersion": 1, + "id": "plt4", + "regime": "relief", + "units": "mm", + "spanMm": 144.0, + "reliefMm": 12.0, + "target": { + "vertices": [ + [-72.0, -72.0], + [72.0, -72.0], + [72.0, 72.0], + [-72.0, 72.0] + ] + }, + "pieces": [ + { + "id": "p00", + "polygon": [ + [12.03555569640579, 6.9386885705235475], + [-6.191264029726773, 17.368599532323017], + [-5.844291666679017, -24.307288102846567] + ], + "roof": { + "z0": 16.0, + "gx": 0.49596788370428746, + "gy": -0.28380710100134615 + } + }, + { + "id": "p01", + "polygon": [ + [9.023674041801037, 23.804113232534544], + [-27.048392083666805, -18.990378766318248], + [18.024718041865768, -4.813734466216297] + ], + "roof": { + "z0": 12.0, + "gx": -0.24226749374603884, + "gy": -0.07619931428626227 + } + }, + { + "id": "p02", + "polygon": [ + [-7.602062399348308, -22.050139393582405], + [21.411501162815515, 14.749495515262542], + [-13.809438763467206, 7.300643878319864] + ], + "roof": { + "z0": 12.0, + "gx": 0.082765018188252, + "gy": -0.39134377695869693 + } + }, + { + "id": "p03", + "polygon": [ + [-6.123573382378993, -33.32513089292553], + [25.619556763472627, 23.68308069578795], + [-19.495983381093634, 9.642050197137577] + ], + "roof": { + "z0": 16.0, + "gx": 0.3217394657564076, + "gy": -0.17914994085842184 + } + }, + { + "id": "p04", + "polygon": [ + [-14.491194078025135, -0.5052664574353685], + [6.94289466156907, -21.49526026170318], + [7.548299416456064, 22.00052671913855] + ], + "roof": { + "z0": 12.0, + "gx": 0.2665396038637182, + "gy": 0.2721789046297676 + } + }, + { + "id": "p05", + "polygon": [ + [-21.901365916900627, -3.923349458565159], + [19.577023294960064, -9.848358183402501], + [2.3243426219405645, 13.77170764196766] + ], + "roof": { + "z0": 16.0, + "gx": -0.24198368684489324, + "gy": 0.33129174070210177 + } + }, + { + "id": "p06", + "polygon": [ + [6.454468615248373, 16.68539286006697], + [-30.030538008917325, -9.655531414426232], + [23.576069393668952, -7.029861445640735] + ], + "roof": { + "z0": 16.0, + "gx": 0.21620744666172265, + "gy": 0.1560943660710708 + } + }, + { + "id": "p07", + "polygon": [ + [-12.973308565699327, -4.969231817811735], + [3.3962395029346535, -18.12361876774907], + [9.577069062764673, 23.092850585560804] + ], + "roof": { + "z0": 12.0, + "gx": 0.4454298794186117, + "gy": -0.35794250203911104 + } + }, + { + "id": "p08", + "polygon": [ + [-20.761558559323042, 26.23013888998303], + [2.0566360707758786, -25.14001288926447], + [18.70492248854716, -1.0901260007185627] + ], + "roof": { + "z0": 20.0, + "gx": 0.0, + "gy": -0.0 + } + }, + { + "id": "p09", + "polygon": [ + [-30.990479740169313, -9.142765745339615], + [26.63608002943328, -9.56656890769233], + [4.354399710736033, 18.709334653031945] + ], + "roof": { + "z0": 16.0, + "gx": 0.2094511374868465, + "gy": 0.16504948384220183 + } + }, + { + "id": "p10", + "polygon": [ + [11.347131304842696, 5.522011513086416], + [-6.7730058408240605, 16.136182692327303], + [-4.5741254640186355, -21.658194205413718] + ], + "roof": { + "z0": 16.0, + "gx": 0.4930649563446736, + "gy": -0.2888209844691398 + } + }, + { + "id": "p11", + "polygon": [ + [-8.168988307041023, -20.15763205437154], + [33.68761378208784, -3.6341680848422158], + [-25.518625475046814, 23.791800139213755] + ], + "roof": { + "z0": 20.0, + "gx": -0.0, + "gy": 0.0 + } + }, + { + "id": "p12", + "polygon": [ + [-35.64064920415906, -1.3441072524453332], + [29.044464844920377, -20.11638789326216], + [6.596184359238686, 21.460495145707494] + ], + "roof": { + "z0": 12.0, + "gx": 0.09932423619479805, + "gy": 0.34224928068295996 + } + }, + { + "id": "p13", + "polygon": [ + [16.6414992867093, -12.34141407985543], + [0.4155455935085586, 11.995408365692082], + [-17.05704488021786, 0.34600571416334525] + ], + "roof": { + "z0": 12.0, + "gx": 0.2275829577832232, + "gy": -0.34134486883958814 + } + }, + { + "id": "p14", + "polygon": [ + [13.08727202235487, 16.061547590842153], + [-11.963990992148544, 0.9619872867083545], + [-1.1232810302063276, -17.02353487755051] + ], + "roof": { + "z0": 12.0, + "gx": 0.294985305086863, + "gy": -0.48940196365330235 + } + }, + { + "id": "p15", + "polygon": [ + [-16.5558074748591, -4.79246688620793], + [-3.02730043873855, -20.854207058855373], + [19.58310791359765, 25.646673945063306] + ], + "roof": { + "z0": 20.0, + "gx": 0.0, + "gy": -0.0 + } + }, + { + "id": "p16", + "polygon": [ + [-33.40392182246056, -1.8001407942000114], + [21.711204245768872, -12.840311919829198], + [11.692717576691692, 14.640452714029209] + ], + "roof": { + "z0": 20.0, + "gx": -0.0, + "gy": 0.0 + } + }, + { + "id": "p17", + "polygon": [ + [3.45979919000232, 19.698471757089663], + [-31.548814585011254, -13.140483182919152], + [28.089015395008936, -6.557988574170514] + ], + "roof": { + "z0": 16.0, + "gx": -0.22804829819450567, + "gy": 0.24311537343759426 + } + }, + { + "id": "p18", + "polygon": [ + [16.160248357094936, -27.36962500724134], + [2.0754281539117834, 25.723386207456247], + [-18.23567651100672, 1.6462387997850918] + ], + "roof": { + "z0": 16.0, + "gx": -0.20382770292208385, + "gy": 0.17194585959719366 + } + }, + { + "id": "p19", + "polygon": [ + [-14.741640794721885, -17.115315558861063], + [22.714717011703648, 5.004161376116968], + [-7.973076216981763, 12.111154182744094] + ], + "roof": { + "z0": 16.0, + "gx": -0.37112977449657336, + "gy": 0.08595002638400154 + } + }, + { + "id": "p20", + "polygon": [ + [4.103930009951529, -16.739780717602585], + [20.71122564936808, -3.886853753482079], + [-24.81515565931961, 20.626634471084664] + ], + "roof": { + "z0": 20.0, + "gx": -0.0, + "gy": 0.0 + } + }, + { + "id": "p21", + "polygon": [ + [26.09257923733228, -4.022102527725565], + [4.237340368578165, 18.662661830532585], + [-30.329919605910447, -14.64055930280702] + ], + "roof": { + "z0": 12.0, + "gx": -0.18003781236712818, + "gy": -0.17345427673614378 + } + }, + { + "id": "p22", + "polygon": [ + [16.67567074042904, -14.21872024328486], + [5.530621229942018, 12.824770127020392], + [-22.206291970371062, 1.3939501162644685] + ], + "roof": { + "z0": 16.0, + "gx": 0.36982550933750774, + "gy": 0.15241093347674564 + } + }, + { + "id": "p23", + "polygon": [ + [-15.558794257048648, -11.266051715966423], + [29.389319699942423, -13.426387733660016], + [-13.830525442893773, 24.692439449626438] + ], + "roof": { + "z0": 16.0, + "gx": -0.016002489019952548, + "gy": -0.3329489922740079 + } + }, + { + "id": "p24", + "polygon": [ + [-11.544900571836209, 5.095612896052442], + [-7.943533284675396, -15.593276722846102], + [19.488433856511605, 10.497663826793662] + ], + "roof": { + "z0": 16.0, + "gx": -0.37530865521811413, + "gy": -0.06533092584418708 + } + }, + { + "id": "p25", + "polygon": [ + [17.253369305382694, 4.731146543077937], + [-25.61892853303563, 18.404700508816035], + [8.365559227652934, -23.13584705189397] + ], + "roof": { + "z0": 16.0, + "gx": 0.12465918145402252, + "gy": 0.3908585557918479 + } + }, + { + "id": "p26", + "polygon": [ + [30.69613206923603, 15.02489520722256], + [-28.434285355093337, 4.84679444015574], + [-2.261846714142692, -19.8716896473783] + ], + "roof": { + "z0": 12.0, + "gx": -0.24233739482361707, + "gy": 0.22887485266235222 + } + }, + { + "id": "p27", + "polygon": [ + [-18.43664257712185, -30.138682958673854], + [21.800074596906725, -5.368356132868065], + [-3.36343201978487, 35.50703909154192] + ], + "roof": { + "z0": 12.0, + "gx": 0.3473318626995543, + "gy": -0.07975243681130681 + } + }, + { + "id": "p28", + "polygon": [ + [5.189082105427227, -25.279901639506726], + [17.970126717929958, 3.51063323939427], + [-23.159208823357183, 21.76926840011246] + ], + "roof": { + "z0": 12.0, + "gx": -0.2437293958002201, + "gy": 0.10819931947092258 + } + }, + { + "id": "p29", + "polygon": [ + [30.718764273960705, -13.806068284665098], + [-13.703536623500115, 22.565750242533284], + [-17.015227650460588, -8.759681957868187] + ], + "roof": { + "z0": 12.0, + "gx": 0.04005068513330882, + "gy": 0.3788412057493753 + } + }, + { + "id": "p30", + "polygon": [ + [-9.279044182220053, 21.398582641483713], + [-5.836978290460941, -25.336331313682486], + [15.116022472680994, 3.9377486721987696] + ], + "roof": { + "z0": 12.0, + "gx": -0.19400926632538829, + "gy": -0.27105629616556715 + } + }, + { + "id": "p31", + "polygon": [ + [12.336288463360855, -13.995659575337987], + [20.70278186709996, 14.814092039786882], + [-33.03907033046082, -0.818432464448895] + ], + "roof": { + "z0": 16.0, + "gx": 0.24389207716507824, + "gy": -0.07082745738615115 + } + } + ], + "rules": { + "translate": true, + "rotate": "continuous-z", + "flip": false + }, + "validation": { + "contactNoise": 1e-06, + "overlapDepth": 0.006, + "outsideDepth": 0.006, + "areaError": 0.012, + "edgeAngleDeg": 3.0, + "edgeMinOverlap": 0.02, + "roofMismatch": 0.05 + }, + "source": { + "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", + "puzzleId": "plt4", + "geometryHash": "3b19adeafecc09ee3bdb6086c9351bfaf5fc9b95a179ec03c067265d5af0e6bb" + } +} diff --git a/benchmarks/fixtures/plt5-flat.json b/benchmarks/fixtures/plt5-flat.json new file mode 100644 index 0000000..632497e --- /dev/null +++ b/benchmarks/fixtures/plt5-flat.json @@ -0,0 +1,228 @@ +{ + "formatVersion": 1, + "id": "plt5-flat", + "regime": "footprint", + "units": "mm", + "spanMm": 144.0, + "target": { + "vertices": [ + [-72.0, -72.0], + [72.0, -72.0], + [72.0, 72.0], + [-72.0, 72.0] + ] + }, + "pieces": [ + { + "id": "p00", + "polygon": [ + [-19.138436954541376, 4.21695754508449], + [18.605791394475023, -30.08134017269309], + [0.5326455600663529, 25.8643826276086] + ] + }, + { + "id": "p01", + "polygon": [ + [36.20279409739337, 10.579234355176148], + [-27.450553280986327, 8.758831232974558], + [-8.752240816407046, -19.338065588150705] + ] + }, + { + "id": "p02", + "polygon": [ + [10.414057263226981, 35.81354368556998], + [-19.82952778483692, -17.636321266930373], + [9.41547052160994, -18.177222418639605] + ] + }, + { + "id": "p03", + "polygon": [ + [-23.947652586339785, 28.593223595879735], + [3.6064476619097636, -26.29151070710669], + [20.34120492443002, -2.3017128887730456] + ] + }, + { + "id": "p04", + "polygon": [ + [-39.48846426114325, -9.392746685417015], + [38.15576483066464, -16.564649413344547], + [1.3326994304786162, 25.957396098761564] + ] + }, + { + "id": "p05", + "polygon": [ + [-25.523179306330647, 11.992385838393256], + [-9.803552885750069, -17.873243992524174], + [35.32673219208071, 5.8808581541309195] + ] + }, + { + "id": "p06", + "polygon": [ + [-6.823854162063672, 15.779655077817331], + [-18.54262635145195, -21.41806499174096], + [25.366480513515622, 5.638409913923629] + ] + }, + { + "id": "p07", + "polygon": [ + [15.487772188583826, -16.7538476964108], + [23.938151592379526, 21.319648175808574], + [-39.42592378096335, -4.5658004793977724] + ] + }, + { + "id": "p08", + "polygon": [ + [-25.734481455706785, -2.643192048619154], + [-1.838131651486191, -19.511119189626324], + [27.57261310719298, 22.15431123824548] + ] + }, + { + "id": "p09", + "polygon": [ + [7.136375740025022, -24.986439148009513], + [15.346097840887921, 7.749824582395082], + [-22.482473580912945, 17.23661456561443] + ] + }, + { + "id": "p10", + "polygon": [ + [40.19212159613625, -10.716499503167906], + [-2.5356927341006514, 25.867600630097666], + [-37.656428862035604, -15.15110112692976] + ] + }, + { + "id": "p11", + "polygon": [ + [28.180469669357084, -6.009253632061586], + [6.802664702551155, 20.106870789475536], + [-34.983134371908235, -14.09761715741395] + ] + }, + { + "id": "p12", + "polygon": [ + [-9.881607301549181, -20.564929786847557], + [28.630732347422292, -14.416784150782965], + [-18.74912504587311, 34.98171393763052] + ] + }, + { + "id": "p13", + "polygon": [ + [28.192486263077733, 0.6585729315524311], + [0.7966667402825607, 20.36977717366902], + [-28.989153003360293, -21.028350105221456] + ] + }, + { + "id": "p14", + "polygon": [ + [-11.157960499338074, -37.189547153672244], + [33.0714292843007, 24.526120057879073], + [-21.913468784962625, 12.663427095793171] + ] + }, + { + "id": "p15", + "polygon": [ + [-23.911810232123006, 33.518283539330255], + [-13.065553884150784, -21.6761113140792], + [36.97736411627379, -11.842172225251053] + ] + }, + { + "id": "p16", + "polygon": [ + [19.754070240628746, 1.3561743723820205], + [-30.761171479217786, 20.440470376832288], + [11.00710123858904, -21.79664474921431] + ] + }, + { + "id": "p17", + "polygon": [ + [7.984905749123278, 14.152871799660238], + [-27.726248680704156, -1.522377776949897], + [19.741342931580878, -12.63049402271034] + ] + }, + { + "id": "p18", + "polygon": [ + [-32.48127111716765, 13.00113558936491], + [14.480845493855142, -18.749803033181315], + [18.000425623312506, 5.748667443816403] + ] + }, + { + "id": "p19", + "polygon": [ + [-16.138239476430265, 13.446457771524356], + [-11.007234925270497, -10.76583853213048], + [27.14547440170076, -2.6806192393938764] + ] + }, + { + "id": "p20", + "polygon": [ + [-9.37352606328567, 21.75745870134893], + [-18.86401522586612, -1.1006496074097596], + [28.23754128915179, -20.65680909393917] + ] + }, + { + "id": "p21", + "polygon": [ + [8.559122383222284, 22.869005750775944], + [-14.390099696809724, 13.60101212101058], + [5.830977313587439, -36.470017871786524] + ] + }, + { + "id": "p22", + "polygon": [ + [26.22381096081996, 7.508278011047458], + [-19.95686225532571, 6.555428965518282], + [-6.266948705494254, -14.06370697656574] + ] + }, + { + "id": "p23", + "polygon": [ + [-27.750398747556027, -0.9888727681764244], + [19.494785712769215, -13.007818034290352], + [8.255613034786814, 13.996690802466777] + ] + } + ], + "rules": { + "translate": true, + "rotate": "continuous-z", + "flip": false + }, + "validation": { + "contactNoise": 1e-06, + "overlapDepth": 0.006, + "outsideDepth": 0.006, + "areaError": 0.012, + "edgeAngleDeg": 3.0, + "edgeMinOverlap": 0.02 + }, + "source": { + "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", + "puzzleId": "plt5-flat", + "geometryHash": "da08bd0e075304d78b958ad939120ed824196104cf8c56dd716d45f8f98310cf" + } +} diff --git a/benchmarks/fixtures/plt5.json b/benchmarks/fixtures/plt5.json new file mode 100644 index 0000000..e92e175 --- /dev/null +++ b/benchmarks/fixtures/plt5.json @@ -0,0 +1,350 @@ +{ + "formatVersion": 1, + "id": "plt5", + "regime": "relief", + "units": "mm", + "spanMm": 144.0, + "reliefMm": 12.0, + "target": { + "vertices": [ + [-72.0, -72.0], + [72.0, -72.0], + [72.0, 72.0], + [-72.0, 72.0] + ] + }, + "pieces": [ + { + "id": "p00", + "polygon": [ + [-16.05962135026286, -20.281483231908396], + [12.696410124855003, -14.928619157225475], + [3.363211225407854, 35.21010238913387] + ], + "roof": { + "z0": 8.0, + "gx": 0.0, + "gy": -0.0 + } + }, + { + "id": "p01", + "polygon": [ + [14.086078477976411, -14.73583703466789], + [5.04304995214733, 35.456031182016794], + [-19.129128430123743, -20.720194147348902] + ], + "roof": { + "z0": 16.0, + "gx": -0.39164252952934686, + "gy": 0.16852063360188982 + } + }, + { + "id": "p02", + "polygon": [ + [13.741280866320468, 22.703021828666227], + [-14.360705739175172, 14.58878441381671], + [0.6194248728547045, -37.291806242482934] + ], + "roof": { + "z0": 16.0, + "gx": -0.39415453490066205, + "gy": -0.11380915944562109 + } + }, + { + "id": "p03", + "polygon": [ + [27.11797428267964, 25.073451513581563], + [-23.777579277860625, -5.556682795072341], + [-3.3403950048190145, -19.516768718509223] + ], + "roof": { + "z0": 12.0, + "gx": -0.4003611244183236, + "gy": 0.27347581851850644 + } + }, + { + "id": "p04", + "polygon": [ + [-33.62141833781444, -9.677950658774556], + [22.941551685613383, -5.910601175542952], + [10.679866652201058, 15.58855183431751] + ], + "roof": { + "z0": 20.0, + "gx": -0.0, + "gy": 0.0 + } + }, + { + "id": "p05", + "polygon": [ + [9.705198211946357, 18.877807808822325], + [-36.68508261673207, -8.761690099720642], + [26.97988440478571, -10.116117709101685] + ], + "roof": { + "z0": 12.0, + "gx": 0.00891804187246778, + "gy": 0.41919319849559034 + } + }, + { + "id": "p06", + "polygon": [ + [-8.370708539463607, -38.79666530189613], + [20.848161371625167, 9.269124415103956], + [-12.477452832161559, 29.527540886792174] + ], + "roof": { + "z0": 12.0, + "gx": -0.2629239779391458, + "gy": 0.15982971575296423 + } + }, + { + "id": "p07", + "polygon": [ + [-1.1269079826111987, -16.210878396889143], + [24.38042023552267, 13.291260630177886], + [-23.25351225291147, 2.9196177667112586] + ], + "roof": { + "z0": 12.0, + "gx": -0.3103446577469247, + "gy": 0.2683216643590676 + } + }, + { + "id": "p08", + "polygon": [ + [-5.8455284461915955, -41.183489376020155], + [25.380418416635052, 5.603290193853287], + [-19.534889970443455, 35.580199182166865] + ], + "roof": { + "z0": 12.0, + "gx": -0.11842729476864625, + "gy": -0.17744319362796449 + } + }, + { + "id": "p09", + "polygon": [ + [6.992413869198558, -22.63528546941345], + [18.87351738353575, -0.923494219458866], + [-25.865931252734306, 23.558779688872317] + ], + "roof": { + "z0": 16.0, + "gx": -0.43915926472523603, + "gy": -0.31237880092152454 + } + }, + { + "id": "p10", + "polygon": [ + [5.338315321467531, -16.342120105071587], + [20.440296554256264, 19.615217989460614], + [-25.778611875723797, -3.2730978843890277] + ], + "roof": { + "z0": 8.0, + "gx": -0.0, + "gy": 0.0 + } + }, + { + "id": "p11", + "polygon": [ + [11.075042635398022, 17.21644361138839], + [-36.24343373269233, -8.802045856727835], + [25.16839109729431, -8.414397754660554] + ], + "roof": { + "z0": 16.0, + "gx": 0.19472624019790266, + "gy": 0.10707197311981985 + } + }, + { + "id": "p12", + "polygon": [ + [8.632017822989773, -17.819954217213546], + [7.480334812813017, 36.16776314742477], + [-16.11235263580279, -18.347808930211226] + ], + "roof": { + "z0": 16.0, + "gx": 0.4847382030495023, + "gy": 0.010340588194628565 + } + }, + { + "id": "p13", + "polygon": [ + [-20.805847581012777, 4.204664842251374], + [18.409466514316307, -32.91890099408342], + [2.3963810666964704, 28.71423615183205] + ], + "roof": { + "z0": 8.0, + "gx": 0.0, + "gy": -0.0 + } + }, + { + "id": "p14", + "polygon": [ + [8.239255174236646, 18.646103458197764], + [-34.69444576173361, -8.880198944062272], + [26.455190587496965, -9.765904514135492] + ], + "roof": { + "z0": 16.0, + "gx": -0.006174853647569312, + "gy": -0.4263155475327622 + } + }, + { + "id": "p15", + "polygon": [ + [-5.630042183576029, -39.28807229950529], + [20.146992001470107, 10.707997632269983], + [-14.516949817894078, 28.5800746672353] + ], + "roof": { + "z0": 12.0, + "gx": -0.09776178890921201, + "gy": -0.18961472448199213 + } + }, + { + "id": "p16", + "polygon": [ + [-17.726840697862507, 8.355933153909588], + [11.472008771339123, -33.45826526809658], + [6.254831926523385, 25.102332114186996] + ], + "roof": { + "z0": 12.0, + "gx": -0.47107569538287447, + "gy": -0.04196824007896019 + } + }, + { + "id": "p17", + "polygon": [ + [-16.34291893581504, -37.79099099861471], + [25.309332810334595, 0.013141374386188787], + [-8.966413874519557, 37.77784962422852] + ], + "roof": { + "z0": 12.0, + "gx": 0.31610495423934426, + "gy": -0.030855968883850365 + } + }, + { + "id": "p18", + "polygon": [ + [18.603749736036683, 18.151115551362544], + [-35.367347296706, 19.917661639715213], + [16.763597560669318, -38.06877719107776] + ], + "roof": { + "z0": 12.0, + "gx": -0.2221032799701345, + "gy": 0.007269736989105634 + } + }, + { + "id": "p19", + "polygon": [ + [-3.884689138146463, -26.999475741205917], + [14.150571433658726, 15.524539545536339], + [-10.265882295512263, 11.47493619566958] + ], + "roof": { + "z0": 12.0, + "gx": -0.5286590867038664, + "gy": 0.22421458364326574 + } + }, + { + "id": "p20", + "polygon": [ + [14.58509428157376, 21.50639497446293], + [-15.791043097346172, 6.797459665033384], + [1.2059488157724143, -28.303854639496315] + ], + "roof": { + "z0": 12.0, + "gx": -0.45411053779108146, + "gy": 0.12197511535773306 + } + }, + { + "id": "p21", + "polygon": [ + [-28.93713683917295, -29.28979534839702], + [23.59059642850739, -9.167674740483243], + [5.346540410665561, 38.457470088880264] + ], + "roof": { + "z0": 8.0, + "gx": 0.0, + "gy": 0.0 + } + }, + { + "id": "p22", + "polygon": [ + [21.84454786995095, -8.489153571318017], + [5.036931400529745, 15.44965443193981], + [-26.881479270480696, -6.960500860621793] + ], + "roof": { + "z0": 12.0, + "gx": -0.25182178044189696, + "gy": -0.1768059589156734 + } + }, + { + "id": "p23", + "polygon": [ + [-15.323160789636672, 1.5044079948409124], + [15.406285023200573, -22.510195063213153], + [-0.08312423356390042, 21.005787068372243] + ], + "roof": { + "z0": 12.0, + "gx": -0.5409912308511005, + "gy": -0.19256452844462435 + } + } + ], + "rules": { + "translate": true, + "rotate": "continuous-z", + "flip": false + }, + "validation": { + "contactNoise": 1e-06, + "overlapDepth": 0.006, + "outsideDepth": 0.006, + "areaError": 0.012, + "edgeAngleDeg": 3.0, + "edgeMinOverlap": 0.02, + "roofMismatch": 0.05 + }, + "source": { + "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", + "puzzleId": "plt5", + "geometryHash": "38f74ab7259c2d46ff31c63a37966ad2e15e7f84a4f199ac6544ac103d0eb734" + } +} diff --git a/benchmarks/fixtures/rat1-flat.json b/benchmarks/fixtures/rat1-flat.json index 6e19816..8bc752c 100644 --- a/benchmarks/fixtures/rat1-flat.json +++ b/benchmarks/fixtures/rat1-flat.json @@ -131,7 +131,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "rat1-flat", "geometryHash": "fac3e2c7d4d285e0061bf9aa317b8cafb52299a7e06b7a2e1976535a8b479b1d" } diff --git a/benchmarks/fixtures/rat1.json b/benchmarks/fixtures/rat1.json index d5b02ea..8768529 100644 --- a/benchmarks/fixtures/rat1.json +++ b/benchmarks/fixtures/rat1.json @@ -188,7 +188,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "rat1", "geometryHash": "e91d5fba6e065bd5063286f3b2b3d22511aa0ffe7ce62706494f55972e8cd04a" } diff --git a/benchmarks/fixtures/rat2-flat.json b/benchmarks/fixtures/rat2-flat.json index a663106..02fb10b 100644 --- a/benchmarks/fixtures/rat2-flat.json +++ b/benchmarks/fixtures/rat2-flat.json @@ -218,7 +218,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "rat2-flat", "geometryHash": "fa6e7a9ae160b7887e911042f1260e942790d2537ef75912c86751abc88b46fa" } diff --git a/benchmarks/fixtures/rat2.json b/benchmarks/fixtures/rat2.json index 1808f8c..cd6868b 100644 --- a/benchmarks/fixtures/rat2.json +++ b/benchmarks/fixtures/rat2.json @@ -320,7 +320,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "rat2", "geometryHash": "e04fdc109a7c76ccd7b966af949ff7218bae47a4140cfd61013504fa8d4e013b" } diff --git a/benchmarks/fixtures/rev2-flat.json b/benchmarks/fixtures/rev2-flat.json index e6ed505..7a0e531 100644 --- a/benchmarks/fixtures/rev2-flat.json +++ b/benchmarks/fixtures/rev2-flat.json @@ -121,7 +121,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "rev2-flat", "geometryHash": "c5b5216b0fcc1031c9a09243d60eb99d4fc3a29c754e906214c8b875f4693cc4" } diff --git a/benchmarks/fixtures/rev2.json b/benchmarks/fixtures/rev2.json index 3f047de..5f08ed4 100644 --- a/benchmarks/fixtures/rev2.json +++ b/benchmarks/fixtures/rev2.json @@ -168,7 +168,7 @@ }, "source": { "repository": "https://github.com/maxpluslab/tropical-puzzle-lab", - "commit": "cfe2c8be097132aa378b2cf397b93524fb869fe1", + "commit": "d3153f5b6a84aab7242bad12b443687c19375691", "puzzleId": "rev2", "geometryHash": "96192e2a2eaacbd09c73761150a0373c7aa46bdbbbe876fa01d7761b04b5fcbc" } diff --git a/benchmarks/manifests/corpus.toml b/benchmarks/manifests/corpus.toml index 3679c08..562312b 100644 --- a/benchmarks/manifests/corpus.toml +++ b/benchmarks/manifests/corpus.toml @@ -17,9 +17,16 @@ solver = "rust.contact_dfs" [runs.options] node_limit = 1500000 -# CP-SAT choosing among the placements that search reaches. +# CP-SAT choosing among the placements that search reaches. Not the Pleat footprints: +# their listing stops at the node limit, and CP-SAT would then enumerate every assembly of +# the placements listed, far more than the 26 998 to 95 344 the search finds by the limit. [[runs]] solver = "cp_sat.placements" +fixtures = [ + "cor1", "cor1-flat", "new1", "new1-flat", "new2", "new2-flat", "new3", "new3-flat", + "new4", "new4-flat", "new5", "new5-flat", "plt1", "plt2", "plt3", "plt4", "plt5", + "rat1", "rat1-flat", "rat2", "rat2-flat", "rev2", "rev2-flat", +] [runs.options] node_limit = 1500000 diff --git a/benchmarks/results/corpus.md b/benchmarks/results/corpus.md index 4d6605a..458905d 100644 --- a/benchmarks/results/corpus.md +++ b/benchmarks/results/corpus.md @@ -12,6 +12,16 @@ | `new4-flat` | 9 | `rust.contact_dfs` | footprint | 1500000 | solved | yes | 1 | 1 | 510 | 462 | 2.88 | 9.10 | | `new5` | 6 | `rust.contact_dfs` | relief | 1500000 | solved | yes | 1 | 1 | 26 | 16 | 1.19 | 37.85 | | `new5-flat` | 6 | `rust.contact_dfs` | footprint | 1500000 | solved | yes | 1 | 1 | 90 | 70 | 2.13 | 10.76 | +| `plt1` | 32 | `rust.contact_dfs` | relief | 1500000 | solved | yes | 1 | 1 | 21 973 | 14 739 | 8.28 | 141.64 | +| `plt1-flat` | 32 | `rust.contact_dfs` | footprint | 1500000 | solved | no | 54 725 | 54 725 | 1 500 000 | 940 579 | 22.72 | 23.35 | +| `plt2` | 32 | `rust.contact_dfs` | relief | 1500000 | solved | yes | 1 | 1 | 18 490 | 11 670 | 8.00 | 149.38 | +| `plt2-flat` | 32 | `rust.contact_dfs` | footprint | 1500000 | solved | no | 59 724 | 59 724 | 1 500 000 | 932 151 | 22.39 | 20.80 | +| `plt3` | 32 | `rust.contact_dfs` | relief | 1500000 | solved | yes | 1 | 1 | 11 611 | 7 949 | 7.28 | 127.50 | +| `plt3-flat` | 32 | `rust.contact_dfs` | footprint | 1500000 | solved | no | 26 998 | 26 998 | 1 500 000 | 1 110 831 | 19.92 | 23.66 | +| `plt4` | 32 | `rust.contact_dfs` | relief | 1500000 | solved | yes | 1 | 1 | 10 787 | 6 319 | 8.14 | 158.72 | +| `plt4-flat` | 32 | `rust.contact_dfs` | footprint | 1500000 | solved | no | 81 443 | 81 443 | 1 500 000 | 853 249 | 23.88 | 16.74 | +| `plt5` | 24 | `rust.contact_dfs` | relief | 1500000 | solved | yes | 1 | 1 | 7 488 | 5 049 | 6.85 | 89.27 | +| `plt5-flat` | 24 | `rust.contact_dfs` | footprint | 1500000 | solved | no | 95 344 | 95 344 | 1 500 000 | 777 380 | 16.96 | 16.25 | | `rat1` | 11 | `rust.contact_dfs` | relief | 1500000 | solved | yes | 1 | 1 | 90 | 52 | 1.90 | 72.24 | | `rat1-flat` | 11 | `rust.contact_dfs` | footprint | 1500000 | solved | yes | 101 | 101 | 17 425 | 13 436 | 5.29 | 21.70 | | `rat2` | 20 | `rust.contact_dfs` | relief | 1500000 | solved | yes | 1 | 1 | 94 | 49 | 1.49 | 118.35 | @@ -30,6 +40,11 @@ | `new4-flat` | 9 | `cp_sat.placements` | footprint | 1500000 | solved | yes | 1 | 1 | 510 | 462 | 2.88 | 9.10 | | `new5` | 6 | `cp_sat.placements` | relief | 1500000 | solved | yes | 1 | 1 | 26 | 16 | 1.19 | 37.85 | | `new5-flat` | 6 | `cp_sat.placements` | footprint | 1500000 | solved | yes | 1 | 1 | 90 | 70 | 2.13 | 10.76 | +| `plt1` | 32 | `cp_sat.placements` | relief | 1500000 | solved | yes | 1 | 1 | 21 973 | 14 739 | 8.28 | 141.64 | +| `plt2` | 32 | `cp_sat.placements` | relief | 1500000 | solved | yes | 1 | 1 | 18 490 | 11 670 | 8.00 | 149.38 | +| `plt3` | 32 | `cp_sat.placements` | relief | 1500000 | solved | yes | 1 | 1 | 11 611 | 7 949 | 7.28 | 127.50 | +| `plt4` | 32 | `cp_sat.placements` | relief | 1500000 | solved | yes | 1 | 1 | 10 787 | 6 319 | 8.14 | 158.72 | +| `plt5` | 24 | `cp_sat.placements` | relief | 1500000 | solved | yes | 1 | 1 | 7 488 | 5 049 | 6.85 | 89.27 | | `rat1` | 11 | `cp_sat.placements` | relief | 1500000 | solved | yes | 1 | 1 | 90 | 52 | 1.90 | 72.24 | | `rat1-flat` | 11 | `cp_sat.placements` | footprint | 1500000 | solved | yes | 101 | 101 | 17 425 | 13 436 | 5.29 | 21.70 | | `rat2` | 20 | `cp_sat.placements` | relief | 1500000 | solved | yes | 1 | 1 | 94 | 49 | 1.49 | 118.35 | diff --git a/benchmarks/results/edge_to_edge.md b/benchmarks/results/edge_to_edge.md index df422f2..7814a3f 100644 --- a/benchmarks/results/edge_to_edge.md +++ b/benchmarks/results/edge_to_edge.md @@ -12,6 +12,16 @@ | `new4-flat` | 9 | `rust.contact_dfs` | footprint | nothing | | 1500000 | | solved | yes | 1 | 1 | 510 | 462 | 2.88 | 9.10 | | `new5` | 6 | `rust.contact_dfs` | relief | nothing | | 1500000 | | solved | yes | 1 | 1 | 26 | 16 | 1.19 | 37.85 | | `new5-flat` | 6 | `rust.contact_dfs` | footprint | nothing | | 1500000 | | solved | yes | 1 | 1 | 90 | 70 | 2.13 | 10.76 | +| `plt1` | 32 | `rust.contact_dfs` | relief | nothing | | 1500000 | | solved | yes | 1 | 1 | 21 973 | 14 739 | 8.28 | 141.64 | +| `plt1-flat` | 32 | `rust.contact_dfs` | footprint | nothing | | 1500000 | | solved | no | 54 725 | 54 725 | 1 500 000 | 940 579 | 22.72 | 23.35 | +| `plt2` | 32 | `rust.contact_dfs` | relief | nothing | | 1500000 | | solved | yes | 1 | 1 | 18 490 | 11 670 | 8.00 | 149.38 | +| `plt2-flat` | 32 | `rust.contact_dfs` | footprint | nothing | | 1500000 | | solved | no | 59 724 | 59 724 | 1 500 000 | 932 151 | 22.39 | 20.80 | +| `plt3` | 32 | `rust.contact_dfs` | relief | nothing | | 1500000 | | solved | yes | 1 | 1 | 11 611 | 7 949 | 7.28 | 127.50 | +| `plt3-flat` | 32 | `rust.contact_dfs` | footprint | nothing | | 1500000 | | solved | no | 26 998 | 26 998 | 1 500 000 | 1 110 831 | 19.92 | 23.66 | +| `plt4` | 32 | `rust.contact_dfs` | relief | nothing | | 1500000 | | solved | yes | 1 | 1 | 10 787 | 6 319 | 8.14 | 158.72 | +| `plt4-flat` | 32 | `rust.contact_dfs` | footprint | nothing | | 1500000 | | solved | no | 81 443 | 81 443 | 1 500 000 | 853 249 | 23.88 | 16.74 | +| `plt5` | 24 | `rust.contact_dfs` | relief | nothing | | 1500000 | | solved | yes | 1 | 1 | 7 488 | 5 049 | 6.85 | 89.27 | +| `plt5-flat` | 24 | `rust.contact_dfs` | footprint | nothing | | 1500000 | | solved | no | 95 344 | 95 344 | 1 500 000 | 777 380 | 16.96 | 16.25 | | `rat1` | 11 | `rust.contact_dfs` | relief | nothing | | 1500000 | | solved | yes | 1 | 1 | 90 | 52 | 1.90 | 72.24 | | `rat1-flat` | 11 | `rust.contact_dfs` | footprint | nothing | | 1500000 | | solved | yes | 101 | 101 | 17 425 | 13 436 | 5.29 | 21.70 | | `rat2` | 20 | `rust.contact_dfs` | relief | nothing | | 1500000 | | solved | yes | 1 | 1 | 94 | 49 | 1.49 | 118.35 | @@ -66,6 +76,46 @@ | `new5-flat` | 6 | `rust.contact_dfs` | footprint | edge-to-edge | true | | false | solved | yes | 1 | 1 | 24 | 14 | 1.36 | 28.25 | | `new5-flat` | 6 | `rust.contact_dfs` | footprint | edge-to-edge | false | | true | solved | yes | 1 | 1 | 14 | 6 | 1.17 | 48.50 | | `new5-flat` | 6 | `rust.contact_dfs` | footprint | edge-to-edge | false | | false | solved | yes | 1 | 1 | 24 | 14 | 1.36 | 36.54 | +| `plt1` | 32 | `rust.contact_dfs` | relief | edge-to-edge | true | | true | solved | yes | 1 | 1 | 749 | 165 | 6.94 | 239.93 | +| `plt1` | 32 | `rust.contact_dfs` | relief | edge-to-edge | true | | false | solved | yes | 1 | 1 | 882 | 175 | 7.54 | 240.81 | +| `plt1` | 32 | `rust.contact_dfs` | relief | edge-to-edge | false | | true | solved | yes | 1 | 1 | 749 | 165 | 6.94 | 254.21 | +| `plt1` | 32 | `rust.contact_dfs` | relief | edge-to-edge | false | | false | solved | yes | 1 | 1 | 882 | 175 | 7.54 | 256.10 | +| `plt1-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | true | | true | solved | yes | 288 | 288 | 31 835 | 3 057 | 18.89 | 47.20 | +| `plt1-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | true | | false | solved | yes | 288 | 288 | 31 835 | 3 057 | 18.89 | 47.20 | +| `plt1-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | false | | true | solved | yes | 288 | 288 | 31 835 | 3 057 | 18.89 | 83.66 | +| `plt1-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | false | | false | solved | yes | 288 | 288 | 31 835 | 3 057 | 18.89 | 83.66 | +| `plt2` | 32 | `rust.contact_dfs` | relief | edge-to-edge | true | | true | solved | yes | 1 | 1 | 639 | 163 | 6.44 | 211.29 | +| `plt2` | 32 | `rust.contact_dfs` | relief | edge-to-edge | true | | false | solved | yes | 1 | 1 | 808 | 191 | 7.24 | 210.39 | +| `plt2` | 32 | `rust.contact_dfs` | relief | edge-to-edge | false | | true | solved | yes | 1 | 1 | 639 | 163 | 6.44 | 223.60 | +| `plt2` | 32 | `rust.contact_dfs` | relief | edge-to-edge | false | | false | solved | yes | 1 | 1 | 808 | 191 | 7.24 | 223.70 | +| `plt2-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | true | | true | solved | yes | 288 | 288 | 41 068 | 6 007 | 18.53 | 45.26 | +| `plt2-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | true | | false | solved | yes | 288 | 288 | 41 068 | 6 007 | 18.53 | 45.26 | +| `plt2-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | false | | true | solved | yes | 288 | 288 | 41 068 | 6 007 | 18.53 | 82.26 | +| `plt2-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | false | | false | solved | yes | 288 | 288 | 41 068 | 6 007 | 18.53 | 82.26 | +| `plt3` | 32 | `rust.contact_dfs` | relief | edge-to-edge | true | | true | solved | yes | 1 | 1 | 615 | 127 | 6.80 | 218.07 | +| `plt3` | 32 | `rust.contact_dfs` | relief | edge-to-edge | true | | false | solved | yes | 1 | 1 | 866 | 168 | 8.04 | 212.74 | +| `plt3` | 32 | `rust.contact_dfs` | relief | edge-to-edge | false | | true | solved | yes | 1 | 1 | 615 | 127 | 6.80 | 230.79 | +| `plt3` | 32 | `rust.contact_dfs` | relief | edge-to-edge | false | | false | solved | yes | 1 | 1 | 866 | 168 | 8.04 | 226.29 | +| `plt3-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | true | | true | solved | yes | 288 | 288 | 31 598 | 2 925 | 18.80 | 46.84 | +| `plt3-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | true | | false | solved | yes | 288 | 288 | 31 598 | 2 925 | 18.80 | 46.84 | +| `plt3-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | false | | true | solved | yes | 288 | 288 | 31 598 | 2 925 | 18.80 | 82.78 | +| `plt3-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | false | | false | solved | yes | 288 | 288 | 31 598 | 2 925 | 18.80 | 82.78 | +| `plt4` | 32 | `rust.contact_dfs` | relief | edge-to-edge | true | | true | solved | yes | 1 | 1 | 678 | 133 | 7.06 | 226.14 | +| `plt4` | 32 | `rust.contact_dfs` | relief | edge-to-edge | true | | false | solved | yes | 1 | 1 | 735 | 139 | 7.36 | 226.46 | +| `plt4` | 32 | `rust.contact_dfs` | relief | edge-to-edge | false | | true | solved | yes | 1 | 1 | 678 | 133 | 7.06 | 237.34 | +| `plt4` | 32 | `rust.contact_dfs` | relief | edge-to-edge | false | | false | solved | yes | 1 | 1 | 735 | 139 | 7.36 | 238.34 | +| `plt4-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | true | | true | solved | yes | 288 | 288 | 38 066 | 2 614 | 20.13 | 45.25 | +| `plt4-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | true | | false | solved | yes | 288 | 288 | 38 066 | 2 614 | 20.13 | 45.25 | +| `plt4-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | false | | true | solved | yes | 288 | 288 | 38 066 | 2 614 | 20.13 | 85.79 | +| `plt4-flat` | 32 | `rust.contact_dfs` | footprint | edge-to-edge | false | | false | solved | yes | 288 | 288 | 38 066 | 2 614 | 20.13 | 85.79 | +| `plt5` | 24 | `rust.contact_dfs` | relief | edge-to-edge | true | | true | solved | yes | 1 | 1 | 436 | 103 | 6.17 | 165.58 | +| `plt5` | 24 | `rust.contact_dfs` | relief | edge-to-edge | true | | false | solved | yes | 1 | 1 | 480 | 109 | 6.36 | 166.82 | +| `plt5` | 24 | `rust.contact_dfs` | relief | edge-to-edge | false | | true | solved | yes | 1 | 1 | 436 | 103 | 6.17 | 175.97 | +| `plt5` | 24 | `rust.contact_dfs` | relief | edge-to-edge | false | | false | solved | yes | 1 | 1 | 480 | 109 | 6.36 | 177.60 | +| `plt5-flat` | 24 | `rust.contact_dfs` | footprint | edge-to-edge | true | | true | solved | yes | 72 | 72 | 5 566 | 300 | 14.71 | 40.13 | +| `plt5-flat` | 24 | `rust.contact_dfs` | footprint | edge-to-edge | true | | false | solved | yes | 72 | 72 | 5 566 | 300 | 14.71 | 40.13 | +| `plt5-flat` | 24 | `rust.contact_dfs` | footprint | edge-to-edge | false | | true | solved | yes | 72 | 72 | 5 566 | 300 | 14.71 | 63.91 | +| `plt5-flat` | 24 | `rust.contact_dfs` | footprint | edge-to-edge | false | | false | solved | yes | 72 | 72 | 5 566 | 300 | 14.71 | 63.91 | | `rat1` | 11 | `rust.contact_dfs` | relief | edge-to-edge | true | | true | solved | yes | 1 | 1 | 48 | 18 | 2.39 | 67.67 | | `rat1` | 11 | `rust.contact_dfs` | relief | edge-to-edge | true | | false | solved | yes | 1 | 1 | 83 | 42 | 1.95 | 78.01 | | `rat1` | 11 | `rust.contact_dfs` | relief | edge-to-edge | false | | true | solved | yes | 1 | 1 | 48 | 18 | 2.39 | 71.83 | diff --git a/docs/algorithms.md b/docs/algorithms.md index 5f742af..d137fae 100644 --- a/docs/algorithms.md +++ b/docs/algorithms.md @@ -303,6 +303,11 @@ Whole searches with `rust.contact_dfs`, default rules, from `benchmarks/results/ | `new2-flat` | 16 | 1 | 909 750 | 59 | 65 | 59 | | `rat2-flat` | 20 | 2 → 1 | 128 230 | 80 | 94 | 80 | | `cor1-flat` | 27 | ? → 48 | stopped at 1 500 000 | 44 539 | 50 470 | 44 539 | +| `plt5-flat` | 24 | ≥ 95 344 → 72 | stopped at 1 500 000 | 5 566 | 5 566 | 5 566 | +| `plt1-flat` | 32 | ≥ 54 725 → 288 | stopped at 1 500 000 | 31 835 | 31 835 | 31 835 | +| `plt2-flat` | 32 | ≥ 59 724 → 288 | stopped at 1 500 000 | 41 068 | 41 068 | 41 068 | +| `plt3-flat` | 32 | ≥ 26 998 → 288 | stopped at 1 500 000 | 31 598 | 31 598 | 31 598 | +| `plt4-flat` | 32 | ≥ 81 443 → 288 | stopped at 1 500 000 | 38 066 | 38 066 | 38 066 | | `new5` | 6 | 1 | 26 | 14 | 26 | 14 | | `new3` | 9 | 1 | 44 | 24 | 40 | 24 | | `new4` | 9 | 1 | 45 | 24 | 39 | 24 | @@ -312,8 +317,13 @@ Whole searches with `rust.contact_dfs`, default rules, from `benchmarks/results/ | `new2` | 16 | 1 | 68 | 48 | 65 | 48 | | `rat2` | 20 | 1 | 94 | 67 | 92 | 67 | | `cor1` | 27 | 1 | 1 529 | 967 | 1 378 | 967 | +| `plt5` | 24 | 1 | 7 488 | 436 | 480 | 436 | +| `plt1` | 32 | 1 | 21 973 | 749 | 882 | 749 | +| `plt2` | 32 | 1 | 18 490 | 639 | 808 | 639 | +| `plt3` | 32 | 1 | 11 611 | 615 | 866 | 615 | +| `plt4` | 32 | 1 | 10 787 | 678 | 735 | 678 | -"No `wall_edges`" and "no `equal_edges`" are the assumption with that rule off. `cor1` and `cor1-flat` were built to be hard (below) and joined the corpus in this phase; the findings that follow are about the other eight constructions, and the last paragraph about `cor1`. +"No `wall_edges`" and "no `equal_edges`" are the assumption with that rule off. `cor1` and `cor1-flat` were built to be hard (below) and joined the corpus in this phase; the findings that follow are about the other eight constructions, and the last paragraphs about `cor1` and about the Pleat puzzles `plt1` to `plt5`, added later to be harder still. - **Without roofs, it is worth more than the roofs.** The two 16-piece footprints that are hard for every configuration in the previous section take 49 and 59 nodes, against a million, and their dead ends come 1.3 and 1.6 pieces deep instead of six. On all eight constructions the footprint search under the assumption visits fewer nodes than the relief search of the same pieces that assumes nothing: 49 against 68 on `new1`, 80 against 94 on `rat2`. - **Most of what the roofs did was this.** A roof refuses a wrong neighbour because two planes rarely agree in height along an edge by accident. Under the assumption a wrong neighbour is already refused for meeting in a T or for a length that does not match, and adding the roofs saves at most a third of the nodes (72 to 48 on `rat1`), on four of the eight none or one. The mean degree of the edge graph says the same without a search: 0.8 to 2.4 for the footprints under the assumption, against 23 to 84 without it, and 1.2 to 6.7 for the relief puzzles without it. @@ -324,6 +334,8 @@ The obvious consequence for the question this laboratory asks: in this corpus, a `cor1`, a 27-piece puzzle built in Tropical Puzzle Lab for exactly this, bears it out. With its roofs it takes 1 529 nodes assuming nothing and 967 assuming edge to edge, against 48 to 67 for the other relief puzzles under the assumption, and its dead ends stay almost six pieces deep. Without its roofs, assuming edge to edge, it has 48 assemblies and takes 44 539 nodes, with dead ends almost sixteen pieces deep; assuming nothing, the search has not been seen to end (stopped at 1 500 000 nodes in the table, and at 3 000 000 by hand), so how many of its assemblies have a T is not known. Its level creases give many walls of one length and one height profile, which neither the lengths nor the roofs can tell apart, and its columns change places without making a T. `wall_edges` still pays on it: without it, 1 378 nodes with the roofs and 50 470 without. +The Pleat puzzles, built later to be harder than `cor1` with their roofs on, say where that difficulty lives. Each is a grid of rectangles cut along a diagonal, with every grid corner at one of two heights, so that an edge has one of four height profiles. With roofs, assuming nothing, they take 7 488 to 21 973 nodes, five to fourteen times `cor1`. Assuming edge to edge, 436 to 749, below `cor1`'s 967. What made them hard is the T's the search must try: a short edge against part of a long one of the same height, which the roofs cannot refuse and the assumption does. Without roofs the plain search finds tens of thousands of assemblies before it stops; under the assumption it ends, with 288 on each 4 × 4 grid and 72 on the 4 × 3 `plt5`. Those are the counts of orders of the grid's columns and rows, 4! 4! / 2 and 4! 3! / 2, counted once with the half turn. `wall_edges` makes no difference to the node counts of the footprints, and saves 8 to 29 % of them with roofs. + Not built, and noted for later: a counting bound during the search (every exposed edge needs an unplaced edge of its length), and the further consequences of a tropical construction, such as edge directions with small rational slopes and, for polynomials, a convex roof. ## Choosing from a list (CP-SAT) diff --git a/docs/experiments.md b/docs/experiments.md index 9f8e7ee..f29c289 100644 --- a/docs/experiments.md +++ b/docs/experiments.md @@ -78,12 +78,14 @@ One metric was added for this. `backtrack_depth` is the sum, over dead ends, of ## The corpus table -[`benchmarks/results/corpus.md`](../benchmarks/results/corpus.md) has all 44 rows. What it shows: +[`benchmarks/results/corpus.md`](../benchmarks/results/corpus.md) has all 59 rows. CP-SAT is not given the five Pleat footprints: their listing stops at the node limit, and it would then enumerate every assembly of the placements listed. What it shows: -- Both production solvers finish every corpus puzzle but `cor1-flat` and agree on the assemblies; every assembly passes the validator. `cp_sat.placements` shows the search counts of the listing search it starts from, which is `rust.contact_dfs` taking candidates in the order they are generated. A whole search visits the same nodes in any order, so where both finish the counts are the same; stopped at the limit on `cor1-flat` they are not, since the two have gone down different branches by then. +- Both production solvers finish every corpus puzzle but `cor1-flat` and the five Pleat footprints, and agree on the assemblies; every assembly passes the validator. `cp_sat.placements` shows the search counts of the listing search it starts from, which is `rust.contact_dfs` taking candidates in the order they are generated. A whole search visits the same nodes in any order, so where both finish the counts are the same; stopped at the limit on `cor1-flat` they are not, since the two have gone down different branches by then. - `cor1-flat`, 27 pieces without their roofs, is stopped at the manifest's node limit of 1 500 000 without an assembly, by both. The limit is there so that the table is the same on any machine; by hand the search was stopped at 3 000 000 nodes, also without one. -- With roofs a whole search takes 26 to 94 nodes, except on `cor1`, built to be hard with its roofs on: 1 529. Without roofs, 45 to 1 064 878 where it ends. -- The footprints have one assembly each, except `rat1-flat` (101) and `rat2-flat` (2). +- With roofs a whole search takes 26 to 94 nodes, except on the puzzles built to be hard with their roofs on: `cor1`, 1 529, and the five Pleat puzzles, 7 488 to 21 973 (below). Without roofs, 45 to 1 064 878 where it ends. +- The footprints have one assembly each, except `rat1-flat` (101), `rat2-flat` (2) and the Pleat footprints, stopped at the limit with 26 998 to 95 344 assemblies found and still finding more. +- **Pleat**, the hardest relief puzzles. Tropical Puzzle Lab's `plt1` to `plt5` are a grid of rectangles, each cut along a diagonal, with every grid corner at one of two heights. An edge then has one of four height profiles, so the roofs leave it many possible mates: a mean degree of 16 to 24 in the edge graph, against at most 6.7 for every other relief puzzle (`test_benchmark.py`). The roofs still single out one assembly, but only late: the four 4 x 4 puzzles (32 pieces) take 10 787 to 21 973 nodes, the 4 x 3 one 7 488. What makes them hard is specific to this search. Assuming edge to edge, they take 436 to 749 nodes, fewer than `cor1`'s 967, because most wrong matches are a short edge part way along a long one. Without roofs, under the same assumption, the search ends: 288 assemblies on each 4 x 4 grid and 72 on the 4 x 3 one, in 5 566 to 41 068 nodes ([edge_to_edge.md](../benchmarks/results/edge_to_edge.md)). CP-SAT, choosing among the same placements, settles each without a conflict: propagation alone decides it once the placements are listed. Designs that failed on the way (breaking a symmetric roof at one place, fans of triangles, three heights) are in each puzzle's `provenance.md` in Tropical Puzzle Lab. +- Listing tens of thousands of assemblies exposed a cost in the search itself: each new assembly was compared with every earlier one, so the cost grew with the square of the number found, about nine hours for one Pleat footprint. It now bisects a sorted list of canonical forms (`canonical::Form`), with the same assemblies found and counted. - The prototype, without tray symmetry or pruning, finishes five of the eight footprints it is given within 50 000 nodes and returns each assembly in the tray's four orientations. It is not given `cor1-flat`. ## Tolerance @@ -252,7 +254,7 @@ Correlations are taken within a regime only. Across both, any number that differ ## Edge to edge -`maxplus-bench run benchmarks/manifests/edge_to_edge.toml --no-times` reproduces `benchmarks/results/edge_to_edge.md` (the test reproduces all but the rows of `cor1-flat`, `new1-flat` and `new2-flat`, as for the corpus table): every corpus puzzle in its own regime, assuming nothing and assuming that the pieces meet edge to edge, with the assumption's two rules crossed. A manifest says `assume = "edge-to-edge"`, or a list with `"none"` to cross it with the other factors; the table then shows an `assumes` column on every row. What the numbers say is in [algorithms.md](algorithms.md#assuming-the-pieces-meet-edge-to-edge): the footprints that took up to a million nodes take 14 to 80, fewer than their relief twins took assuming nothing, and of `rat1-flat`'s 101 assemblies and `rat2-flat`'s 2 only the answer has no T. `cor1` stays hard under it: 967 nodes with its roofs, and 44 539 and 48 assemblies without them, where the search that assumes nothing does not end. +`maxplus-bench run benchmarks/manifests/edge_to_edge.toml --no-times` reproduces `benchmarks/results/edge_to_edge.md` (the test reproduces all but the rows of the expensive fixtures, `support.corpus.EXPENSIVE`, as for the corpus table): every corpus puzzle in its own regime, assuming nothing and assuming that the pieces meet edge to edge, with the assumption's two rules crossed. A manifest says `assume = "edge-to-edge"`, or a list with `"none"` to cross it with the other factors; the table then shows an `assumes` column on every row. What the numbers say is in [algorithms.md](algorithms.md#assuming-the-pieces-meet-edge-to-edge): the footprints that took up to a million nodes take 14 to 80, fewer than their relief twins took assuming nothing, and of `rat1-flat`'s 101 assemblies and `rat2-flat`'s 2 only the answer has no T. `cor1` stays hard under it: 967 nodes with its roofs, and 44 539 and 48 assemblies without them, where the search that assumes nothing does not end. `proxies.static(instance, edge_to_edge=True)` gives the edge-graph proxies under the assumption: mean degree 0.8 to 2.4 on the footprints, against 23 to 84 without it. @@ -262,6 +264,6 @@ Correlations are taken within a regime only. Across both, any number that differ ## What this leaves open -- The corpus is 18 puzzles from four kinds of construction. Every statement about what predicts difficulty rests on nine points a regime, and the proxy correlations above were measured on eight, before `cor1` joined. Generated families of graded size are the next thing these tools should be pointed at. +- The corpus is 28 puzzles from five kinds of construction. Every statement about what predicts difficulty rests on fourteen points a regime, and the proxy correlations above were measured on eight, before `cor1` and Pleat joined. Generated families of graded size are the next thing these tools should be pointed at. - Assuming nothing, the 16-piece footprints are where the search is hard, and they sit at the time limit; `cor1-flat` does not finish at all. Remembering dead ends is the lead from phase 6; the manifests here are what to measure it with. - Nothing here measures a person. In the hand these puzzles are simple with wall matching, which is the unique-mate structure above; the footprint regime removes exactly that. diff --git a/docs/roadmap.md b/docs/roadmap.md index 7c3d4dc..481dba2 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -212,6 +212,20 @@ Done, with these decisions: - The exit criterion of phase 7 and the table test of phase 8 run their manifest with `maxplus-bench run --only` on the other fixtures and compare those rows of the committed table exactly. The rows they leave out are read, not reproduced: a test holds them to what the documents claim of them (where `cor1-flat` stops, the margin under the node limit, one assembly where one is claimed). - What is given up: no automated test searches `new1-flat` and `new2-flat` to the end. Their results stand in the committed tables, checked against a search only when the full command is run by hand. The `slow` marker is gone. +## Later addition: a relief puzzle harder than `cor1` + +2026-11-16. `cor1` was the one relief puzzle this search found hard. The question was whether one could be made harder still, with one assembly, by design rather than by luck. Tropical Puzzle Lab gained a family of lifted puzzles for it: a subdivision with an affine roof on each cell, not necessarily tropical. Its Pleat puzzles, `plt1` to `plt5`, put every corner of a grid of triangles at one of two heights. + +**Exit:** a Pleat relief puzzle that a whole search of `rust.contact_dfs` finishes with one assembly in at least 10 000 nodes, more than `cor1`'s, in the committed corpus table. It is `tests/corpus/test_hard_relief.py`: `plt1` takes 21 973 nodes. + +Done, with these decisions: + +- The corpus is 28 fixtures. All ten Pleat fixtures are in `support.corpus.EXPENSIVE`: the suite reads their rows from the committed tables and does not search them. The five footprints are also in `UNFINISHED`; they stop at the node limit with tens of thousands of assemblies. +- The exit criterion was first to be the median whole-search count over eight random orders. A whole search visits the same nodes in any order, so that median is the count itself; the order matters only to the first assembly. +- Pleat is hard for this search and not beyond others. Under the edge-to-edge assumption it takes under 750 nodes, and CP-SAT finds no conflict in it ([experiments](experiments.md#the-corpus-table)). +- Two corpus tests had been relying on Shapely without a margin, and the Pleat footprints broke them. GEOS 3.14 dropped a piece when forming a union of pieces whose vertices lie 1e-7 mm off a shared line, and the deepest of two overlapping pieces can be a tie. Both oracles were corrected, and the Rust geometry was right in both cases. The validator had the same union in it: it called 810 mm² of one CP-SAT assembly of `plt4` uncovered, and up to 7 % of the edge-to-edge assemblies of a Pleat footprint (20 of 288 on `plt3-flat`). A turn of `cor1`'s answer key with the tray, which a solver may return as well, showed the same error on a puzzle already in the corpus (`test_keys_validate.py`). The validator now snap-rounds that union to a 1e-9 mm grid. +- Recording assemblies cost the square of their number. It now uses bisection, with the same counts. + ## Backlog Unordered, to be scheduled once phase 7 shows where the interesting questions are: diff --git a/python/maxplus_solvers/validation.py b/python/maxplus_solvers/validation.py index cbd3c0f..05e925f 100644 --- a/python/maxplus_solvers/validation.py +++ b/python/maxplus_solvers/validation.py @@ -15,7 +15,8 @@ Where it differs from the browser, it is the stricter or the more exact of the two: -* uncovered area comes from an exact union of the pieces; the browser uses +* uncovered area comes from a union of the pieces, snap-rounded to a 1e-9 mm + grid (``GRID_MM``); the browser uses first-order inclusion-exclusion, which is exact only when no three pieces share area; * outside depth is the Euclidean distance from a vertex to the target; the @@ -46,6 +47,12 @@ Vec2 = tuple[float, float] +# The union of the pieces is snap-rounded to this grid. GEOS's floating-point overlay can lose +# a whole piece from the union of many that meet along edges without sharing vertices +# (GEOS 3.14: 806.4 mm² of cor1's key turned half round); snap rounding is robust, and +# moves no vertex by more than half the grid. +GRID_MM = 1e-9 + @dataclass(frozen=True, slots=True) class PairOverlap: @@ -269,7 +276,8 @@ def validate_solution( worst = max(shapely.Point(vertex).distance(target) for vertex in world[pid]) outside_mm[pid] = worst if worst > noise else 0.0 outside_area += shapes[pid].difference(target).area - uncovered = target.difference(shapely.union_all(list(shapes.values()))).area + covered = shapely.union_all(list(shapes.values()), grid_size=GRID_MM) + uncovered = shapely.difference(target, covered, grid_size=GRID_MM).area return ValidationReport( worst_overlap_depth_mm=max((o.depth_mm for o in overlaps), default=0.0), diff --git a/tests/corpus/test_benchmark.py b/tests/corpus/test_benchmark.py index b1ed02a..7bd3454 100644 --- a/tests/corpus/test_benchmark.py +++ b/tests/corpus/test_benchmark.py @@ -51,8 +51,9 @@ def test_one_command_reproduces_the_corpus_table( ``maxplus-bench run benchmarks/manifests/corpus.toml --no-times`` reproduces the whole table; this runs the same manifest ``--only`` on the - rest and compares those rows exactly. Left out are the three footprints of a - million nodes, and ``rat2-flat``, where CP-SAT takes over a minute. + rest and compares those rows exactly. Left out are the expensive fixtures + (``corpus.EXPENSIVE``: three footprints of a million nodes, and Pleat), and + ``rat2-flat``, where CP-SAT takes over a minute. """ cheap = [f for f in CORPUS if f not in corpus.EXPENSIVE_FOR_CP_SAT] committed = (RESULTS / "corpus.md").read_text(encoding="utf-8") @@ -92,13 +93,19 @@ def test_the_rows_the_suite_does_not_reproduce_say_what_the_documents_say() -> N nodes = {(r["Solver"], r["Fixture"]): int(r["Nodes"].replace(" ", "")) for r in rows} for row in rows: assert row["Solutions"] == row["Valid"], (row["Solver"], row["Fixture"]) - # The two production solvers finish everything but cor1-flat, stopped at the node - # limit before it found anything; the prototype is stopped on the largest. - for solver in ("`rust.contact_dfs`", "`cp_sat.placements`"): + # The two production solvers finish everything but cor1-flat and the Pleat footprints, + # stopped at the node limit; the prototype is stopped on the largest. + # CP-SAT is not given the Pleat footprints: it would enumerate every assembly of a + # listing stopped at the limit (benchmarks/manifests/corpus.toml). + given = { + "`rust.contact_dfs`": set(CORPUS), + "`cp_sat.placements`": set(CORPUS) - corpus.PLEAT_FLAT, + } + for solver, fixtures in given.items(): mine = [row for row in rows if row["Solver"] == solver] - assert sorted(row["Fixture"] for row in mine) == sorted(CORPUS) + assert sorted(row["Fixture"] for row in mine) == sorted(fixtures) unfinished = sorted(row["Fixture"] for row in mine if row["Whole search"] == "no") - assert unfinished == sorted(corpus.UNFINISHED), solver + assert unfinished == sorted(corpus.UNFINISHED & fixtures), solver for fixture in unfinished: assert nodes[solver, fixture] == NODE_LIMIT # The limit is far above what any finished search needed. @@ -117,8 +124,8 @@ def test_the_committed_table_is_the_reproducible_kind() -> None: header = [cell.strip() for cell in lines[0].strip("|").split("|")] assert header[:4] == ["Fixture", "Pieces", "Solver", "Mode"] assert not [title for title in header if title.endswith(", s") or "SAT" in title] - # 18 + 18 + 8 runs, a header and a rule. - assert len(lines) == 44 + 2 + # 28 + 23 + 8 runs, a header and a rule. + assert len(lines) == 59 + 2 # --- the committed manifests -------------------------------------------------------------- @@ -190,8 +197,10 @@ def test_the_tolerance_manifest_is_a_grid_in_two_tolerances() -> None: roofs = sorted({roof for _, roof in grid}) assert len(scales) >= 4 and len(roofs) >= 4 assert len(grid) == len(scales) * len(roofs) - # Only puzzles with roofs have a roof tolerance to vary. - assert {run.fixture for run in runs if "roof_tolerance_mm" in run.options} == set(RELIEF) + # Only puzzles with roofs have a roof tolerance to vary. The grid was measured before + # Pleat joined; its one assembly at 1.75 mm is in each puzzle's provenance instead. + roofed = {run.fixture for run in runs if "roof_tolerance_mm" in run.options} + assert roofed == set(RELIEF) - corpus.PLEAT # Geometric spacing: each step of the contact axis multiplies the tolerance. single = sorted({run.contact_scale for run in runs if not run.options}) assert len(single) >= 6 @@ -201,6 +210,12 @@ def test_the_tolerance_manifest_is_a_grid_in_two_tolerances() -> None: # --- difficulty proxies ------------------------------------------------------------------- +def static_pair(fixture_id: str) -> tuple[proxies.StaticProxies, proxies.StaticProxies]: + roofed = proxies.static(PuzzleInstance.from_dict(corpus.fixture(fixture_id))) + flat = proxies.static(PuzzleInstance.from_dict(corpus.fixture(f"{fixture_id}-flat"))) + return roofed, flat + + @pytest.mark.parametrize("fixture_id", RELIEF) def test_roofs_thin_the_edge_graph(fixture_id: str) -> None: """A finding the proxies can state without a search. @@ -208,18 +223,28 @@ def test_roofs_thin_the_edge_graph(fixture_id: str) -> None: As footprints almost every edge could lie against almost every other; a roof leaves an edge a handful of mates. The polygons of a relief puzzle and its flat twin are the same up to rotation, so the counts of pieces and - edges agree. + edges agree. Pleat was designed against this (the next test), and its + roofs thin the graph 3.9 to 5 times where every other puzzle's do 6.5 + times or more. """ - roofed = proxies.static(PuzzleInstance.from_dict(corpus.fixture(fixture_id))) - flat = proxies.static(PuzzleInstance.from_dict(corpus.fixture(f"{fixture_id}-flat"))) + roofed, flat = static_pair(fixture_id) assert (roofed.pieces, roofed.edges) == (flat.pieces, flat.edges) - assert roofed.mean_degree < flat.mean_degree / 4 + assert roofed.mean_degree < flat.mean_degree / (3 if fixture_id in corpus.PLEAT else 6) assert flat.unique_mate_fraction == 0.0 assert roofed.symmetry_count <= flat.symmetry_count # The tray is a square in both. assert roofed.tray_turns == flat.tray_turns == 4 +def test_pleat_roofs_leave_each_edge_many_mates() -> None: + """The design of Pleat, seen by the proxies: two corner heights give every edge one of + four height profiles, so a roof still leaves an edge many mates. Every Pleat puzzle has + more than twice the mean degree of any other relief puzzle (16 to 24 against at most 6.7).""" + degree = {f: static_pair(f)[0].mean_degree for f in RELIEF} + others = max(d for f, d in degree.items() if f not in corpus.PLEAT) + assert min(degree[f] for f in corpus.PLEAT) > 2 * others + + def test_the_proxy_table_has_a_row_for_every_corpus_puzzle() -> None: table, correlations = proxy_table(corpus.FIXTURES) lines = table.splitlines() diff --git a/tests/corpus/test_candidates_agree_with_shapely.py b/tests/corpus/test_candidates_agree_with_shapely.py index aaa0657..265fb05 100644 --- a/tests/corpus/test_candidates_agree_with_shapely.py +++ b/tests/corpus/test_candidates_agree_with_shapely.py @@ -206,7 +206,10 @@ def test_check_placement_agrees_with_shapely_and_the_validator(fixture_id: str) deepest = max(depths, key=lambda other: depths[other]) assert check.overlap_mm == pytest.approx(max(0.0, depths[deepest]), abs=LENGTH_TOL) if depths[deepest] > 1e-6: - assert check.blocker == deepest + # Any piece as deep as the deepest, to the length tolerance: on plt1-flat two + # pieces of the grid overlap a nudged triangle equally, 7e-15 mm apart. + assert check.blocker is not None + assert depths[check.blocker] == pytest.approx(depths[deepest], abs=LENGTH_TOL) elif depths[deepest] < -1e-6: assert check.blocker is None assert check.fits == (check.outside_mm <= fit and check.overlap_mm <= fit) diff --git a/tests/corpus/test_cp_sat.py b/tests/corpus/test_cp_sat.py index 260d1af..b91352d 100644 --- a/tests/corpus/test_cp_sat.py +++ b/tests/corpus/test_cp_sat.py @@ -34,7 +34,11 @@ EVERY = corpus.fixture_ids(kind="corpus") CORPUS = [f for f in EVERY if f not in corpus.UNFINISHED] FLAT = [f for f in corpus.fixture_ids(kind="corpus", regime="footprint") if f in CORPUS] -RELIEF = corpus.fixture_ids(kind="corpus", regime="relief") +# Without the Pleat puzzles: listing their placements is a whole relief search of up to +# 21 973 nodes. Measured by hand, CP-SAT settles each of them too with no conflict. +RELIEF = [ + f for f in corpus.fixture_ids(kind="corpus", regime="relief") if f not in corpus.EXPENSIVE +] SYNTHETIC = corpus.fixture_ids(kind="synthetic") SMALL = [f for f in FLAT if PIECES[f] <= 11] # Listing the placements of these is a whole search of up to a million nodes, and the @@ -81,10 +85,13 @@ def alike(x: Any, y: Any) -> bool: def test_the_exit_criterion_covers_every_fixture() -> None: - assert len(EVERY) == 18 and len(CORPUS) == 17 and len(SYNTHETIC) == 4 - assert sorted(set(EVERY) - set(CORPUS)) == ["cor1-flat"] - # Only footprints are left out, only those named, and all of the relief puzzles stay. - assert sorted(set(CORPUS) - set(CHECKED)) == ["new1-flat", "new2-flat", "rat2-flat"] + pleat = [f"plt{n}" for n in range(1, 6)] + assert len(EVERY) == 28 and len(CORPUS) == 22 and len(SYNTHETIC) == 4 + assert sorted(set(EVERY) - set(CORPUS)) == sorted(["cor1-flat", *(f"{p}-flat" for p in pleat)]) + # Only the named footprints and Pleat are left out, and every other relief puzzle stays. + assert sorted(set(CORPUS) - set(CHECKED)) == sorted( + ["new1-flat", "new2-flat", "rat2-flat", *pleat] + ) assert set(CHECKED) >= set(RELIEF) | set(ASSEMBLIES) diff --git a/tests/corpus/test_edge_to_edge.py b/tests/corpus/test_edge_to_edge.py index c112c63..e512852 100644 --- a/tests/corpus/test_edge_to_edge.py +++ b/tests/corpus/test_edge_to_edge.py @@ -14,10 +14,11 @@ plain search has not been seen to end, is tested apart: everything the assumed search returns is valid and edge to edge by the oracle, and the key is among it. ``new1-flat`` and ``new2-flat``, whose plain searches take a million nodes, are -not compared here; their rows of the committed table, which only the full -command reproduces, record one assembly with and without the assumption. The -counts are relative to the candidates the search generates, in ``f64`` with -tolerances. +not compared here, nor are the Pleat puzzles (``corpus.PLEAT``), whose relief +searches take up to 22 000 nodes and whose footprints have tens of thousands of +assemblies; their rows of the committed table, which only the full command +reproduces, say what the searches found. The counts are relative to the +candidates the search generates, in ``f64`` with tolerances. """ from pathlib import Path @@ -51,7 +52,14 @@ # Assemblies found assuming nothing, up to turning the tray, where not one (phase 5). ASSEMBLIES = {"rat1-flat": 101, "rat2-flat": 2} # Assemblies found assuming edge to edge, where not one. -EDGE_TO_EDGE_ASSEMBLIES = {"cor1-flat": 48} +# Pleat: 288 = 4! 4! / 2, as many as there are orders of the grid's columns and of its rows, +# counted once with the tray's half turn (72 = 4! 3! / 2 for the 4 x 3 plt5). A count that +# matches, not a check of which assemblies they are; read from the committed table, not run. +EDGE_TO_EDGE_ASSEMBLIES = { + "cor1-flat": 48, + **{f"plt{n}-flat": 288 for n in range(1, 5)}, + "plt5-flat": 72, +} # Where a search assuming nothing stops in the committed table (benchmarks/manifests). NODE_LIMIT = 1_500_000 # Whole plain searches of these are a million nodes each: not run here (support/corpus.py). @@ -89,8 +97,10 @@ def test_every_answer_key_meets_edge_to_edge() -> None: assert geometry.is_edge_to_edge(world, target, TWIN_MM), fixture_id -def test_only_the_million_node_footprints_are_left_out() -> None: - assert sorted(set(EVERY) - set(CHECKED)) == ["cor1-flat", "new1-flat", "new2-flat"] +def test_only_the_expensive_fixtures_are_left_out() -> None: + assert sorted(set(EVERY) - set(CHECKED)) == sorted( + {"cor1-flat", "new1-flat", "new2-flat"} | corpus.PLEAT | corpus.PLEAT_FLAT + ) @pytest.mark.parametrize("fixture_id", CHECKED) @@ -207,12 +217,15 @@ def test_the_rows_the_suite_does_not_reproduce_say_what_the_documents_say() -> N for row in rows: fixture, assumed = row["Fixture"], row["assumes"] == "edge-to-edge" if fixture in corpus.UNFINISHED and not assumed: - assert (row["Status"], row["Whole search"], row["Solutions"]) == ( - "interrupted", - "no", - "0", - ) + assert row["Whole search"] == "no", fixture assert int(row["Nodes"].replace(" ", "")) == NODE_LIMIT + if fixture in corpus.PLEAT_FLAT: + # Stopped still finding more: a lower bound, every one of them valid. + assert row["Status"] == "solved", fixture + assert row["Solutions"] == row["Valid"], fixture + assert int(row["Solutions"].replace(" ", "")) > 10_000, fixture + else: + assert (row["Status"], row["Solutions"]) == ("interrupted", "0"), fixture continue assert (row["Status"], row["Whole search"]) == ("solved", "yes"), fixture expected = (EDGE_TO_EDGE_ASSEMBLIES if assumed else ASSEMBLIES).get(fixture, 1) diff --git a/tests/corpus/test_fixtures.py b/tests/corpus/test_fixtures.py index 6225523..7c7a039 100644 --- a/tests/corpus/test_fixtures.py +++ b/tests/corpus/test_fixtures.py @@ -53,16 +53,19 @@ def placed(fixture: dict[str, Any], key: dict[str, Any]) -> dict[str, list[tuple def test_the_corpus_is_complete() -> None: - """Nine constructions in two variants, and the four synthetics.""" - constructions = ["cor1", "new1", "new2", "new3", "new4", "new5", "rat1", "rat2", "rev2"] + """Fourteen constructions in two variants, and the four synthetics.""" + constructions = [ + "cor1", "new1", "new2", "new3", "new4", "new5", "plt1", "plt2", "plt3", "plt4", "plt5", + "rat1", "rat2", "rev2", + ] # fmt: skip assert sorted(CORPUS) == sorted(constructions + [f"{c}-flat" for c in constructions]) assert sorted(SYNTHETIC) == [ "syn-four-squares", "syn-four-triangles", "syn-two-rectangles", "syn-two-rectangles-ridge", ] # fmt: skip counts = {entry["id"]: entry["pieceCount"] for entry in corpus.index()["fixtures"]} assert {c: counts[c] for c in constructions} == { - "cor1": 27, "new1": 16, "new2": 16, "new3": 9, "new4": 9, "new5": 6, "rat1": 11, "rat2": 20, - "rev2": 9, + "cor1": 27, "new1": 16, "new2": 16, "new3": 9, "new4": 9, "new5": 6, "plt1": 32, "plt2": 32, + "plt3": 32, "plt4": 32, "plt5": 24, "rat1": 11, "rat2": 20, "rev2": 9, } # fmt: skip # Every flat twin has its relief puzzle's pieces. assert all(counts[f"{c}-flat"] == counts[c] for c in constructions) diff --git a/tests/corpus/test_hard_relief.py b/tests/corpus/test_hard_relief.py new file mode 100644 index 0000000..7480f7f --- /dev/null +++ b/tests/corpus/test_hard_relief.py @@ -0,0 +1,96 @@ +"""A relief puzzle harder than ``cor1`` for the contact search: the Pleat puzzles. + +``plt1`` to ``plt5`` were built in Tropical Puzzle Lab to be hard with their roofs on: a +grid of rectangles, each cut along a diagonal, with every grid corner at one of two +heights, so that many edges share a height profile. Their searches are in +``corpus.EXPENSIVE``, so this reads what the committed tables say rather than searching: +``maxplus-bench run benchmarks/manifests/corpus.toml --no-times`` (and ``edge_to_edge.toml``) +is what checks those rows against a search. ``cor1``'s rows are reproduced by a search in +``test_benchmark.py``, so the comparison is with a number the suite does check. + +A whole search visits the same nodes in any order, so its count is the measure; the number +of nodes to the first assembly is the one that depends on luck, and is not asserted here. +""" + +from pathlib import Path + +from support import corpus + +RESULTS = Path(__file__).resolve().parents[2] / "benchmarks" / "results" +SEARCH = "`rust.contact_dfs`" +NODE_LIMIT = 1_500_000 + + +def rows(table: str) -> list[dict[str, str]]: + return corpus.table((RESULTS / table).read_text(encoding="utf-8")) + + +def count(cell: str) -> int: + return int(cell.replace(" ", "")) + + +def plain() -> dict[str, dict[str, str]]: + return {row["Fixture"]: row for row in rows("corpus.md") if row["Solver"] == SEARCH} + + +def test_every_pleat_relief_puzzle_has_one_assembly_found_by_a_whole_search() -> None: + table = plain() + for fixture in sorted(corpus.PLEAT): + row = table[fixture] + assert row["Mode"] == "relief" + assert (row["Status"], row["Whole search"], row["Solutions"], row["Valid"]) == ( + "solved", + "yes", + "1", + "1", + ), fixture + + +def test_the_hardest_pleat_is_harder_than_cor1_with_its_roofs_on() -> None: + """The exit criterion: at least 10 000 nodes, rating 4 in Tropical Puzzle Lab, and more + than ``cor1``'s 1 529. Every 4 x 4 Pleat (32 pieces) is past ``cor1`` too.""" + table = plain() + nodes = {fixture: count(table[fixture]["Nodes"]) for fixture in corpus.PLEAT} + cor1 = count(table["cor1"]["Nodes"]) + assert max(nodes.values()) >= 10_000 + assert max(nodes.values()) > cor1 + assert all(nodes[f] > cor1 for f in corpus.PLEAT if count(table[f]["Pieces"]) == 32) + # And past every other relief puzzle by more than that. + others = [ + count(row["Nodes"]) + for fixture, row in table.items() + if row["Mode"] == "relief" and fixture not in corpus.PLEAT + ] + assert max(others) == cor1 + + +def test_without_roofs_the_pleat_footprints_have_many_assemblies() -> None: + """The other side of the design: two heights make the roofs matter, and without them the + triangles fit together in tens of thousands of ways, all valid. The search stops at + its node limit still finding more, so the count is a lower bound. (A stopped search that + found something reports ``solved``; ``Whole search`` says it did not end.)""" + table = plain() + for fixture in sorted(corpus.PLEAT_FLAT): + row = table[fixture] + assert (row["Status"], row["Whole search"]) == ("solved", "no"), fixture + assert count(row["Nodes"]) == NODE_LIMIT + assert row["Solutions"] == row["Valid"] + assert count(row["Solutions"]) > 10_000, fixture + + +def test_assuming_edge_to_edge_takes_most_of_the_difficulty_away() -> None: + """Pleat is cut edge to edge, so the assumption holds of its answer. Under it the relief + search keeps its one assembly and drops below ``cor1``'s 967: the long edges that a short + one could lie against part way along are what made it hard.""" + assumed = { + row["Fixture"]: row + for row in rows("edge_to_edge.md") + if row["assumes"] == "edge-to-edge" + and row["equal_edges"] == "true" + and row["wall_edges"] == "true" + } + cor1 = count(assumed["cor1"]["Nodes"]) + for fixture in sorted(corpus.PLEAT): + row = assumed[fixture] + assert (row["Whole search"], row["Solutions"], row["Valid"]) == ("yes", "1", "1"), fixture + assert count(row["Nodes"]) < cor1, fixture diff --git a/tests/corpus/test_keys_validate.py b/tests/corpus/test_keys_validate.py index 0df6dc4..f3092da 100644 --- a/tests/corpus/test_keys_validate.py +++ b/tests/corpus/test_keys_validate.py @@ -13,7 +13,7 @@ from maxplus_solvers import Pose, PuzzleInstance from maxplus_solvers.validation import ValidationReport, validate_solution -from support import corpus, geometry +from support import assemblies, corpus, geometry ALL = corpus.fixture_ids() RELIEF = corpus.fixture_ids(regime="relief") @@ -50,6 +50,33 @@ def test_the_answer_key_validates(fixture_id: str) -> None: assert report.uncovered_area_mm2 == pytest.approx(0.0, abs=1e-6) +@pytest.mark.parametrize("fixture_id", ALL) +def test_the_answer_key_turned_with_the_tray_validates(fixture_id: str) -> None: + """A turn of the whole assembly that maps the tray onto itself is still a solution, roofs + and all. A solver may return any member of the family, so the validator must accept each. + + A regression: GEOS 3.14's floating-point union of ``cor1``'s key half turned lost a whole + piece, 806.4 mm², and the validator reported that much of the tray uncovered. + """ + instance, poses = load(fixture_id) + cx, cy = geometry.centroid(instance.target) + turns = assemblies.tray_turns(instance.target) + assert len(turns) > 1 # Squares and one triangle: there is a turn besides 0. + for turn in turns: + c, s = math.cos(turn), math.sin(turn) + moved = { + pid: Pose( + cx + c * (p.x - cx) - s * (p.y - cy), + cy + s * (p.x - cx) + c * (p.y - cy), + p.theta + turn, + ) + for pid, p in poses.items() + } + report = validate_solution(instance, moved) + assert report.solved, (turn, report.residuals()) + assert report.uncovered_area_mm2 == pytest.approx(0.0, abs=1e-6), turn + + @pytest.mark.parametrize("fixture_id", RELIEF) def test_the_keyed_roof_is_continuous_along_every_seam(fixture_id: str) -> None: instance, poses = load(fixture_id) diff --git a/tests/corpus/test_placement_model_agrees_with_shapely.py b/tests/corpus/test_placement_model_agrees_with_shapely.py index 3385458..5529a20 100644 --- a/tests/corpus/test_placement_model_agrees_with_shapely.py +++ b/tests/corpus/test_placement_model_agrees_with_shapely.py @@ -31,7 +31,10 @@ PIECES = {entry["id"]: entry["pieceCount"] for entry in corpus.index()["fixtures"]} # Lists short enough to intersect every pair: up to a few hundred placements. FLAT = ["new5-flat", "rev2-flat", "new4-flat"] -RELIEF = corpus.fixture_ids(kind="corpus", regime="relief") +# Without the Pleat puzzles (corpus.EXPENSIVE): their models take a minute to build. +RELIEF = [ + f for f in corpus.fixture_ids(kind="corpus", regime="relief") if f not in corpus.EXPENSIVE +] SYNTHETIC = corpus.fixture_ids(kind="synthetic") LENGTH_TOL = 1e-6 diff --git a/tests/corpus/test_rust_contact_dfs.py b/tests/corpus/test_rust_contact_dfs.py index 6cee5b8..64f7815 100644 --- a/tests/corpus/test_rust_contact_dfs.py +++ b/tests/corpus/test_rust_contact_dfs.py @@ -46,11 +46,13 @@ SYNTHETIC = corpus.fixture_ids(kind="synthetic") # What the prototype finishes in seconds: the footprints of up to 11 pieces. SMALL = [f for f in FLAT if PIECES[f] <= 11] -# Whole searches of these are a million nodes each: not run here (support/corpus.py). +# Whole searches of these are a million nodes each, or Pleat's relief searches of +# thousands: not run here (support/corpus.py; test_hard_relief.py reads Pleat's rows). LEFT_OUT = corpus.EXPENSIVE - corpus.UNFINISHED CHECKED = [f for f in CORPUS if f not in LEFT_OUT] -# Relief puzzles built to be hard for this search (cor1: level creases at shared heights). -HARD_RELIEF = {"cor1"} +# Relief puzzles built to be hard for this search (cor1: level creases at shared heights; +# Pleat: corners at two heights, so that edges share a few height profiles). +HARD_RELIEF = {"cor1"} | corpus.PLEAT # Assemblies found by the whole search, up to turning the tray. Not in this table: one. # rat1-flat's 101 is the prototype's 404 in four orientations each (phase 4). @@ -92,14 +94,16 @@ def same_set(a: list[Any], b: list[Any]) -> bool: def test_the_exit_criterion_covers_the_whole_corpus() -> None: - assert len(EVERY) == 18 and len(FLAT) == 8 and len(RELIEF) == 9 + assert len(EVERY) == 28 and len(FLAT) == 8 and len(RELIEF) == 14 assert sorted(CORPUS) == sorted(FLAT + RELIEF) - # Only footprints are left out, and only those named. - assert sorted(set(EVERY) - set(CORPUS)) == sorted(corpus.UNFINISHED) == ["cor1-flat"] + # Only footprints are left out as unfinished, and only those named. + unfinished = ["cor1-flat", *(f"plt{n}-flat" for n in range(1, 6))] + assert sorted(set(EVERY) - set(CORPUS)) == sorted(corpus.UNFINISHED) == unfinished assert set(RELIEF) >= HARD_RELIEF assert sorted(SMALL) == ["new3-flat", "new4-flat", "new5-flat", "rat1-flat", "rev2-flat"] - assert sorted(LEFT_OUT) == ["new1-flat", "new2-flat"] - assert set(CHECKED) >= set(RELIEF) | set(ASSEMBLIES) + # Left out as expensive: two footprints, and Pleat in relief. + assert sorted(LEFT_OUT) == ["new1-flat", "new2-flat", *(f"plt{n}" for n in range(1, 6))] + assert set(CHECKED) >= (set(RELIEF) - corpus.PLEAT) | set(ASSEMBLIES) # --- the exit criterion ------------------------------------------------------------------- diff --git a/tests/corpus/test_search_geometry_agrees_with_shapely.py b/tests/corpus/test_search_geometry_agrees_with_shapely.py index e54465a..5f744b6 100644 --- a/tests/corpus/test_search_geometry_agrees_with_shapely.py +++ b/tests/corpus/test_search_geometry_agrees_with_shapely.py @@ -116,9 +116,12 @@ def test_cavities_of_partial_assemblies(fixture_id: str) -> None: piece = instance.pieces[index] state.place(index, as_tuple(poses[piece.id])) placed.append(shapely.Polygon(piece.world_polygon(poses[piece.id]))) - covered = shapely.union_all(placed) - # Shrunk a little, so that cavities meeting at a point come apart as they do in a trace. - left = tray.difference(covered.buffer(SHRINK_MM)).buffer(-SHRINK_MM) + # Each piece grown before the union, not the union grown: the same set, but GEOS 3.14 + # unions pieces whose vertices sit 1e-7 mm off a common line (Pleat's) into a set that + # leaves one out, 897.75 mm2 short on plt1-flat. Shrunk back after the difference, so + # that cavities meeting at a point come apart as they do in a trace. + covered = shapely.union_all([piece.buffer(SHRINK_MM) for piece in placed]) + left = tray.difference(covered).buffer(-SHRINK_MM) parts = [g for g in getattr(left, "geoms", [left]) if g.area > SHRUNK_AREA_TOL] has_hole = any(len(part.interiors) > 0 for part in parts) diff --git a/tests/keys/cor1-flat.json b/tests/keys/cor1-flat.json index 8897a33..f7e90f6 100644 --- a/tests/keys/cor1-flat.json +++ b/tests/keys/cor1-flat.json @@ -1,6 +1,6 @@ { "instanceId": "cor1-flat", - "instanceHash": "693a018dbc1ebd466e760261c4e9fc190d04436f011a6291fa254d61d494da20", + "instanceHash": "545fea6fc867a300a0da7b63b7a2228381bd1c339d3ab51bcc209851af6aaef5", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/cor1.json b/tests/keys/cor1.json index 26e6f73..67e2f3c 100644 --- a/tests/keys/cor1.json +++ b/tests/keys/cor1.json @@ -1,6 +1,6 @@ { "instanceId": "cor1", - "instanceHash": "d7db7ec43404c993a80075212dc825debff5b264fbcf8fa8b87e72e89bd0662c", + "instanceHash": "bbc718fe3d7ea9d4493459a8e9adb1981dd5abed7b02d475a0013fe9ac590894", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/new1-flat.json b/tests/keys/new1-flat.json index 8835e18..2affe9a 100644 --- a/tests/keys/new1-flat.json +++ b/tests/keys/new1-flat.json @@ -1,6 +1,6 @@ { "instanceId": "new1-flat", - "instanceHash": "3b68bf1e0e105e254fdd45dadaa62cca711621f9a730d2489794c299b53260e8", + "instanceHash": "47878f9665e34eb76d37bbb49e175e4b59ec149bef358ca7c48ee301c37042fc", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/new1.json b/tests/keys/new1.json index e7c481d..6241f96 100644 --- a/tests/keys/new1.json +++ b/tests/keys/new1.json @@ -1,6 +1,6 @@ { "instanceId": "new1", - "instanceHash": "f3f11247194bc8ed62792482ca64a1980e282abeb9fec1ef839b6e220ed9be6c", + "instanceHash": "d16d29e39c7691c84cbebc25b2ac913f71c7b4255207097f9739d7bd129ab7cb", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/new2-flat.json b/tests/keys/new2-flat.json index 454db16..f560bc7 100644 --- a/tests/keys/new2-flat.json +++ b/tests/keys/new2-flat.json @@ -1,6 +1,6 @@ { "instanceId": "new2-flat", - "instanceHash": "7d16d1a433da1c2fd2a1da8952a1cbd6febf303c422a4b8fb93ffe7e0a0fe73c", + "instanceHash": "19e6af7d1a722438618915bde4baa4146ada61aeb97ba60b13039c5aace388bb", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/new2.json b/tests/keys/new2.json index 703af7d..af6b0f4 100644 --- a/tests/keys/new2.json +++ b/tests/keys/new2.json @@ -1,6 +1,6 @@ { "instanceId": "new2", - "instanceHash": "ceae2892b1d366acf3784aab3bde4272fdacab2da6b20468e7fc5325b53a463e", + "instanceHash": "f392dfd7dceb7f52a52582be80db4bc809fd04244e653e9e7b55f8a48711246c", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/new3-flat.json b/tests/keys/new3-flat.json index 5b8845d..077a235 100644 --- a/tests/keys/new3-flat.json +++ b/tests/keys/new3-flat.json @@ -1,6 +1,6 @@ { "instanceId": "new3-flat", - "instanceHash": "96da3741917645494972765eaf1e0af3553766b9db5ab4d8304ee0837c105b38", + "instanceHash": "c32d2ae44835c6efb27d8f16196d8553391ef043848487a59ab049a726a7c220", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/new3.json b/tests/keys/new3.json index ba4ba62..9c3d1a3 100644 --- a/tests/keys/new3.json +++ b/tests/keys/new3.json @@ -1,6 +1,6 @@ { "instanceId": "new3", - "instanceHash": "fa1f3fbf05c4807a42682d33a9848fa90b61699f3bf0741d0f180a4ae2fc675a", + "instanceHash": "fd85c03021372563446302f92bdd358a2e7f365341cea21b578cc7792104c370", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/new4-flat.json b/tests/keys/new4-flat.json index 536ce43..88ab406 100644 --- a/tests/keys/new4-flat.json +++ b/tests/keys/new4-flat.json @@ -1,6 +1,6 @@ { "instanceId": "new4-flat", - "instanceHash": "be1f76117815ed4c2b3d3f7e97826daea73c798689b0d70f72ebf3bf9d8a9829", + "instanceHash": "0f002a815257e9a770ce886fb3aee972b48ca411206ff9943fa8e8cb97ca0b93", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/new4.json b/tests/keys/new4.json index 0c614a7..da6cbe9 100644 --- a/tests/keys/new4.json +++ b/tests/keys/new4.json @@ -1,6 +1,6 @@ { "instanceId": "new4", - "instanceHash": "f7c565210160817404ceaf63beb8e8b645174c8429d75894a813a53c3cd2af00", + "instanceHash": "470743ee57b6b93146ce250d84ff1fcce2675faff7a1dbba6749b014973c4d1a", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/new5-flat.json b/tests/keys/new5-flat.json index ee10e58..1335158 100644 --- a/tests/keys/new5-flat.json +++ b/tests/keys/new5-flat.json @@ -1,6 +1,6 @@ { "instanceId": "new5-flat", - "instanceHash": "c6bbab15d33416d43d35300ad9ee20937445f93438a1cd4befde048ce4fa7bb1", + "instanceHash": "9352aafe3966d134aef305bd884fc266f2d96ac4a727b8434e4850c552f150ac", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/new5.json b/tests/keys/new5.json index d84e898..e5d2cd9 100644 --- a/tests/keys/new5.json +++ b/tests/keys/new5.json @@ -1,6 +1,6 @@ { "instanceId": "new5", - "instanceHash": "43c648b7900770edc285c9ecc6d8e631e370d7c50bffaa61108bcd138cb08d49", + "instanceHash": "95fc448dfa619d251d08c43e078d90101d2f64d105dfbb9b59c10b7a8f8b5825", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/plt1-flat.json b/tests/keys/plt1-flat.json new file mode 100644 index 0000000..0fa7930 --- /dev/null +++ b/tests/keys/plt1-flat.json @@ -0,0 +1,204 @@ +{ + "instanceId": "plt1-flat", + "instanceHash": "f73a6f5e3ef758635e0bb3b241d71f86a4566ad100add3deb5b81624470d707f", + "sanitizer": { + "version": 1, + "seed": 20261109 + }, + "poses": { + "p00": { + "x": 62.25, + "y": -29.0, + "theta": -2.012397882491275 + }, + "p01": { + "x": -30.0, + "y": 58.0, + "theta": -2.638688686595026 + }, + "p02": { + "x": 28.5, + "y": -40.0, + "theta": -2.008998991560701 + }, + "p03": { + "x": -15.0, + "y": 44.0, + "theta": -2.6551208793359224 + }, + "p04": { + "x": -54.0, + "y": -29.0, + "theta": -1.4821209640938744 + }, + "p05": { + "x": 14.25, + "y": -58.0, + "theta": 0.49839744379495254 + }, + "p06": { + "x": 62.25, + "y": 44.0, + "theta": 1.7754786459746308 + }, + "p07": { + "x": -54.0, + "y": -58.0, + "theta": -2.4759752995212536 + }, + "p08": { + "x": -30.0, + "y": -29.0, + "theta": 2.0880386541305542 + }, + "p09": { + "x": -63.0, + "y": -65.0, + "theta": 0.9605597895331224 + }, + "p10": { + "x": 52.5, + "y": -58.0, + "theta": -1.8468494256697112 + }, + "p11": { + "x": -30.0, + "y": -2.0, + "theta": 2.921431218005321 + }, + "p12": { + "x": 14.25, + "y": 44.0, + "theta": -1.7677268908966062 + }, + "p13": { + "x": -15.0, + "y": -40.0, + "theta": -0.47313963103745194 + }, + "p14": { + "x": 14.25, + "y": -29.0, + "theta": -0.40676300289598794 + }, + "p15": { + "x": -63.0, + "y": 44.0, + "theta": 3.046349533118737 + }, + "p16": { + "x": -54.0, + "y": -2.0, + "theta": -2.683539671757182 + }, + "p17": { + "x": -15.0, + "y": -65.0, + "theta": 0.5315056373270046 + }, + "p18": { + "x": 52.5, + "y": -2.0, + "theta": 0.4444904278258548 + }, + "p19": { + "x": 52.5, + "y": 58.0, + "theta": 2.3475054728093556 + }, + "p20": { + "x": -30.0, + "y": -58.0, + "theta": -2.6092839047155287 + }, + "p21": { + "x": 62.25, + "y": -65.0, + "theta": -1.1603955273597635 + }, + "p22": { + "x": -54.0, + "y": 58.0, + "theta": 2.601999530805481 + }, + "p23": { + "x": 28.5, + "y": 58.0, + "theta": -1.0239149878408815 + }, + "p24": { + "x": -63.0, + "y": -40.0, + "theta": 1.4267783820352884 + }, + "p25": { + "x": 62.25, + "y": 14.0, + "theta": -1.4307273995735612 + }, + "p26": { + "x": 52.5, + "y": -40.0, + "theta": -2.0658190828255374 + }, + "p27": { + "x": -63.0, + "y": 14.0, + "theta": 2.3926943038793547 + }, + "p28": { + "x": -15.0, + "y": 14.0, + "theta": -2.4545743907781192 + }, + "p29": { + "x": 14.25, + "y": -2.0, + "theta": 1.8488170704785798 + }, + "p30": { + "x": 28.5, + "y": 14.0, + "theta": -1.7563377142282266 + }, + "p31": { + "x": 28.5, + "y": -65.0, + "theta": 1.1287021338804992 + } + }, + "sourceIds": { + "p00": "D1u", + "p01": "B3u", + "p02": "C1l", + "p03": "B3l", + "p04": "A1u", + "p05": "C0u", + "p06": "D3l", + "p07": "A0u", + "p08": "B1u", + "p09": "A0l", + "p10": "D0u", + "p11": "B2l", + "p12": "C3l", + "p13": "B1l", + "p14": "C1u", + "p15": "A3l", + "p16": "A2l", + "p17": "B0l", + "p18": "D2l", + "p19": "D3u", + "p20": "B0u", + "p21": "D0l", + "p22": "A3u", + "p23": "C3u", + "p24": "A1l", + "p25": "D2u", + "p26": "D1l", + "p27": "A2u", + "p28": "B2u", + "p29": "C2l", + "p30": "C2u", + "p31": "C0l" + } +} diff --git a/tests/keys/plt1.json b/tests/keys/plt1.json new file mode 100644 index 0000000..4b0165e --- /dev/null +++ b/tests/keys/plt1.json @@ -0,0 +1,204 @@ +{ + "instanceId": "plt1", + "instanceHash": "28ad41c0b48f4f953ea28a69d47a4630d274b9b3fbd3543f82a10bf1ce558ee8", + "sanitizer": { + "version": 1, + "seed": 20261109 + }, + "poses": { + "p00": { + "x": -54.0, + "y": -58.0, + "theta": 1.6626394595935228 + }, + "p01": { + "x": 62.25, + "y": -29.0, + "theta": 0.3329234241914989 + }, + "p02": { + "x": 62.25, + "y": 44.0, + "theta": 0.3202142497625955 + }, + "p03": { + "x": 28.5, + "y": 58.0, + "theta": 0.32131963722247026 + }, + "p04": { + "x": 14.25, + "y": -58.0, + "theta": -1.2986013537028316 + }, + "p05": { + "x": 52.5, + "y": -40.0, + "theta": -0.6324995054736693 + }, + "p06": { + "x": 52.5, + "y": 58.0, + "theta": 0.4209652190377753 + }, + "p07": { + "x": 62.25, + "y": -65.0, + "theta": -2.839908785562912 + }, + "p08": { + "x": 62.25, + "y": 14.0, + "theta": -2.6840844739529355 + }, + "p09": { + "x": -30.0, + "y": -29.0, + "theta": 1.8723462699038231 + }, + "p10": { + "x": -30.0, + "y": -58.0, + "theta": 0.6324299216404086 + }, + "p11": { + "x": 28.5, + "y": -40.0, + "theta": 1.849357469034432 + }, + "p12": { + "x": -15.0, + "y": -40.0, + "theta": 0.5632608501243679 + }, + "p13": { + "x": -15.0, + "y": 14.0, + "theta": 3.098315385840841 + }, + "p14": { + "x": 52.5, + "y": -58.0, + "theta": -0.2254632491493439 + }, + "p15": { + "x": -63.0, + "y": -65.0, + "theta": -0.9143595586826333 + }, + "p16": { + "x": 14.25, + "y": -29.0, + "theta": 2.797111815310696 + }, + "p17": { + "x": -54.0, + "y": -29.0, + "theta": -2.1443746240870087 + }, + "p18": { + "x": -15.0, + "y": -65.0, + "theta": -0.5349373584144036 + }, + "p19": { + "x": 52.5, + "y": -2.0, + "theta": -2.172989832402734 + }, + "p20": { + "x": -63.0, + "y": -40.0, + "theta": -1.3158022951499433 + }, + "p21": { + "x": -54.0, + "y": 58.0, + "theta": 0.9602735174635937 + }, + "p22": { + "x": -30.0, + "y": -2.0, + "theta": -0.1611195080427204 + }, + "p23": { + "x": 14.25, + "y": 44.0, + "theta": -2.486562352590021 + }, + "p24": { + "x": -30.0, + "y": 58.0, + "theta": -2.5391793689635485 + }, + "p25": { + "x": -54.0, + "y": -2.0, + "theta": 1.8245556369394222 + }, + "p26": { + "x": 28.5, + "y": -65.0, + "theta": -3.0450279495734445 + }, + "p27": { + "x": -63.0, + "y": 44.0, + "theta": 3.0053285201856363 + }, + "p28": { + "x": -63.0, + "y": 14.0, + "theta": -1.3622574902941968 + }, + "p29": { + "x": -15.0, + "y": 44.0, + "theta": 0.3331309154518136 + }, + "p30": { + "x": 14.25, + "y": -2.0, + "theta": 2.1436830654527155 + }, + "p31": { + "x": 28.5, + "y": 14.0, + "theta": 1.6907675226787253 + } + }, + "sourceIds": { + "p00": "A0u", + "p01": "D1u", + "p02": "D3l", + "p03": "C3u", + "p04": "C0u", + "p05": "D1l", + "p06": "D3u", + "p07": "D0l", + "p08": "D2u", + "p09": "B1u", + "p10": "B0u", + "p11": "C1l", + "p12": "B1l", + "p13": "B2u", + "p14": "D0u", + "p15": "A0l", + "p16": "C1u", + "p17": "A1u", + "p18": "B0l", + "p19": "D2l", + "p20": "A1l", + "p21": "A3u", + "p22": "B2l", + "p23": "C3l", + "p24": "B3u", + "p25": "A2l", + "p26": "C0l", + "p27": "A3l", + "p28": "A2u", + "p29": "B3l", + "p30": "C2l", + "p31": "C2u" + } +} diff --git a/tests/keys/plt2-flat.json b/tests/keys/plt2-flat.json new file mode 100644 index 0000000..380537d --- /dev/null +++ b/tests/keys/plt2-flat.json @@ -0,0 +1,204 @@ +{ + "instanceId": "plt2-flat", + "instanceHash": "d8e415eb0af0a528707b0c02506612e1c2d9cd4d2571b82c41747a90c1588c09", + "sanitizer": { + "version": 1, + "seed": 20261109 + }, + "poses": { + "p00": { + "x": -43.5, + "y": -9.0, + "theta": 0.9794310805399986 + }, + "p01": { + "x": -57.75, + "y": 61.0, + "theta": -2.1269225248012567 + }, + "p02": { + "x": 52.5, + "y": -38.0, + "theta": -2.2026968809006484 + }, + "p03": { + "x": -11.25, + "y": 50.0, + "theta": 0.5799184693698232 + }, + "p04": { + "x": 12.75, + "y": 3.0, + "theta": -1.3637657508112817 + }, + "p05": { + "x": -57.75, + "y": 3.0, + "theta": -1.0991733696058552 + }, + "p06": { + "x": 62.25, + "y": 50.0, + "theta": -0.35098764415789074 + }, + "p07": { + "x": 52.5, + "y": 31.0, + "theta": 1.397702694847741 + }, + "p08": { + "x": 12.75, + "y": 61.0, + "theta": -0.9121046939828706 + }, + "p09": { + "x": 27.75, + "y": -9.0, + "theta": 0.7664469699906 + }, + "p10": { + "x": -20.25, + "y": -38.0, + "theta": -1.8387244107765335 + }, + "p11": { + "x": 12.75, + "y": 31.0, + "theta": 1.3432156457663078 + }, + "p12": { + "x": -57.75, + "y": -38.0, + "theta": 1.631878802624307 + }, + "p13": { + "x": 52.5, + "y": 3.0, + "theta": -0.28910297618598974 + }, + "p14": { + "x": 62.25, + "y": -55.0, + "theta": -1.2819997852455307 + }, + "p15": { + "x": -20.25, + "y": 61.0, + "theta": -0.39535002281936255 + }, + "p16": { + "x": -20.25, + "y": 31.0, + "theta": -1.463342284834087 + }, + "p17": { + "x": -57.75, + "y": 31.0, + "theta": 0.2734509529421354 + }, + "p18": { + "x": -11.25, + "y": -55.0, + "theta": -2.44823840879636 + }, + "p19": { + "x": -43.5, + "y": 50.0, + "theta": 1.347785908709815 + }, + "p20": { + "x": -43.5, + "y": -55.0, + "theta": -1.5209384749806776 + }, + "p21": { + "x": 27.75, + "y": 23.0, + "theta": 0.6592358712790567 + }, + "p22": { + "x": 27.75, + "y": -55.0, + "theta": 1.894711796665809 + }, + "p23": { + "x": -11.25, + "y": -9.0, + "theta": -1.3726722618811606 + }, + "p24": { + "x": -43.5, + "y": 23.0, + "theta": 1.282047833404813 + }, + "p25": { + "x": 27.75, + "y": 50.0, + "theta": 0.6157348655273553 + }, + "p26": { + "x": 12.75, + "y": -38.0, + "theta": -1.2570338287208915 + }, + "p27": { + "x": 62.25, + "y": -9.0, + "theta": -3.127921330372204 + }, + "p28": { + "x": 62.25, + "y": 23.0, + "theta": 0.4383540271913473 + }, + "p29": { + "x": -11.25, + "y": 23.0, + "theta": 2.1691443982139393 + }, + "p30": { + "x": -20.25, + "y": 3.0, + "theta": -2.1429932629381367 + }, + "p31": { + "x": 52.5, + "y": 61.0, + "theta": 0.8674541877452997 + } + }, + "sourceIds": { + "p00": "A1l", + "p01": "A3u", + "p02": "D0u", + "p03": "B3l", + "p04": "C1u", + "p05": "A1u", + "p06": "D3l", + "p07": "D2u", + "p08": "C3u", + "p09": "C1l", + "p10": "B0u", + "p11": "C2u", + "p12": "A0u", + "p13": "D1u", + "p14": "D0l", + "p15": "B3u", + "p16": "B2u", + "p17": "A2u", + "p18": "B0l", + "p19": "A3l", + "p20": "A0l", + "p21": "C2l", + "p22": "C0l", + "p23": "B1l", + "p24": "A2l", + "p25": "C3l", + "p26": "C0u", + "p27": "D1l", + "p28": "D2l", + "p29": "B2l", + "p30": "B1u", + "p31": "D3u" + } +} diff --git a/tests/keys/plt2.json b/tests/keys/plt2.json new file mode 100644 index 0000000..5522318 --- /dev/null +++ b/tests/keys/plt2.json @@ -0,0 +1,204 @@ +{ + "instanceId": "plt2", + "instanceHash": "7b978ccf2df18996b795a64ed57126f552df4293ada7377644a5e55710fe9451", + "sanitizer": { + "version": 1, + "seed": 20261109 + }, + "poses": { + "p00": { + "x": 52.5, + "y": -38.0, + "theta": 0.7424995866079467 + }, + "p01": { + "x": 62.25, + "y": 50.0, + "theta": -0.8584211117000381 + }, + "p02": { + "x": -11.25, + "y": -55.0, + "theta": -2.0068594587167006 + }, + "p03": { + "x": 62.25, + "y": -9.0, + "theta": -1.4637240644644975 + }, + "p04": { + "x": -43.5, + "y": 23.0, + "theta": 2.310639031951421 + }, + "p05": { + "x": -43.5, + "y": 50.0, + "theta": 0.5064146549297073 + }, + "p06": { + "x": 27.75, + "y": 23.0, + "theta": 1.676921131225546 + }, + "p07": { + "x": 12.75, + "y": 3.0, + "theta": 2.7220102582495516 + }, + "p08": { + "x": 12.75, + "y": 61.0, + "theta": 1.126017250473784 + }, + "p09": { + "x": 52.5, + "y": 61.0, + "theta": -0.183188302253494 + }, + "p10": { + "x": -11.25, + "y": 50.0, + "theta": -1.6267756914175286 + }, + "p11": { + "x": 62.25, + "y": -55.0, + "theta": -2.8534237645676312 + }, + "p12": { + "x": 62.25, + "y": 23.0, + "theta": 0.9147970303567217 + }, + "p13": { + "x": 52.5, + "y": 31.0, + "theta": 2.441914590765667 + }, + "p14": { + "x": -20.25, + "y": 61.0, + "theta": -1.7268374719343966 + }, + "p15": { + "x": -11.25, + "y": -9.0, + "theta": -0.4729787447719242 + }, + "p16": { + "x": -20.25, + "y": 31.0, + "theta": -0.48311669810741775 + }, + "p17": { + "x": 27.75, + "y": -55.0, + "theta": -0.5373689854634959 + }, + "p18": { + "x": -57.75, + "y": 31.0, + "theta": -2.521968246396913 + }, + "p19": { + "x": 27.75, + "y": -9.0, + "theta": -1.7460949408729172 + }, + "p20": { + "x": 52.5, + "y": 3.0, + "theta": 2.791353639170433 + }, + "p21": { + "x": 12.75, + "y": 31.0, + "theta": 1.046524651512879 + }, + "p22": { + "x": -43.5, + "y": -55.0, + "theta": -1.4618903272948733 + }, + "p23": { + "x": -20.25, + "y": -38.0, + "theta": -0.18467803568051627 + }, + "p24": { + "x": 12.75, + "y": -38.0, + "theta": 1.4587951310216667 + }, + "p25": { + "x": -20.25, + "y": 3.0, + "theta": -1.7105710020059146 + }, + "p26": { + "x": -43.5, + "y": -9.0, + "theta": -1.274748579876019 + }, + "p27": { + "x": -57.75, + "y": 3.0, + "theta": 1.9736350103204252 + }, + "p28": { + "x": -57.75, + "y": -38.0, + "theta": -1.0825587243653738 + }, + "p29": { + "x": 27.75, + "y": 50.0, + "theta": -1.4747349322063041 + }, + "p30": { + "x": -11.25, + "y": 23.0, + "theta": -1.7281995426511918 + }, + "p31": { + "x": -57.75, + "y": 61.0, + "theta": 0.40158016034969535 + } + }, + "sourceIds": { + "p00": "D0u", + "p01": "D3l", + "p02": "B0l", + "p03": "D1l", + "p04": "A2l", + "p05": "A3l", + "p06": "C2l", + "p07": "C1u", + "p08": "C3u", + "p09": "D3u", + "p10": "B3l", + "p11": "D0l", + "p12": "D2l", + "p13": "D2u", + "p14": "B3u", + "p15": "B1l", + "p16": "B2u", + "p17": "C0l", + "p18": "A2u", + "p19": "C1l", + "p20": "D1u", + "p21": "C2u", + "p22": "A0l", + "p23": "B0u", + "p24": "C0u", + "p25": "B1u", + "p26": "A1l", + "p27": "A1u", + "p28": "A0u", + "p29": "C3l", + "p30": "B2l", + "p31": "A3u" + } +} diff --git a/tests/keys/plt3-flat.json b/tests/keys/plt3-flat.json new file mode 100644 index 0000000..5c55a8e --- /dev/null +++ b/tests/keys/plt3-flat.json @@ -0,0 +1,204 @@ +{ + "instanceId": "plt3-flat", + "instanceHash": "15a9d47300bbe0d46a0df3250e89ba6d24395445e864e693599f2aa20a50f708", + "sanitizer": { + "version": 1, + "seed": 20261109 + }, + "poses": { + "p00": { + "x": 20.25, + "y": 56.0, + "theta": 0.9468690385299361 + }, + "p01": { + "x": -57.75, + "y": 64.0, + "theta": 1.112731359250196 + }, + "p02": { + "x": 20.25, + "y": -53.0, + "theta": -1.8349053871114713 + }, + "p03": { + "x": 52.5, + "y": -34.0, + "theta": -0.8211259441670059 + }, + "p04": { + "x": -57.75, + "y": 39.0, + "theta": 2.3121270226126067 + }, + "p05": { + "x": -3.75, + "y": -53.0, + "theta": 2.663354815652931 + }, + "p06": { + "x": 62.25, + "y": 64.0, + "theta": 2.234453843959886 + }, + "p07": { + "x": -57.75, + "y": 9.0, + "theta": -0.2930939860929632 + }, + "p08": { + "x": -43.5, + "y": -34.0, + "theta": -1.475217923480319 + }, + "p09": { + "x": -16.5, + "y": 56.0, + "theta": -0.4254298265956091 + }, + "p10": { + "x": 31.5, + "y": 39.0, + "theta": 1.5872392052399107 + }, + "p11": { + "x": -43.5, + "y": 30.0, + "theta": 0.9114788345050453 + }, + "p12": { + "x": -57.75, + "y": -53.0, + "theta": 1.8145187324699048 + }, + "p13": { + "x": 31.5, + "y": -3.0, + "theta": -0.5832471468168643 + }, + "p14": { + "x": 20.25, + "y": 30.0, + "theta": 2.374690589105793 + }, + "p15": { + "x": 52.5, + "y": -3.0, + "theta": 2.1587004880986385 + }, + "p16": { + "x": -3.75, + "y": 9.0, + "theta": 0.5960269991917064 + }, + "p17": { + "x": 52.5, + "y": 39.0, + "theta": -2.658229094340261 + }, + "p18": { + "x": 20.25, + "y": 9.0, + "theta": 2.9960786857256116 + }, + "p19": { + "x": 62.25, + "y": 30.0, + "theta": 2.0423389570533548 + }, + "p20": { + "x": -16.5, + "y": 39.0, + "theta": -2.0844114962512905 + }, + "p21": { + "x": -43.5, + "y": 56.0, + "theta": -0.8196544741332901 + }, + "p22": { + "x": 31.5, + "y": -34.0, + "theta": -0.4133168778517864 + }, + "p23": { + "x": 62.25, + "y": -53.0, + "theta": -1.140193833198797 + }, + "p24": { + "x": -16.5, + "y": -3.0, + "theta": 1.7792325180717476 + }, + "p25": { + "x": 31.5, + "y": 64.0, + "theta": -2.887920809405912 + }, + "p26": { + "x": -43.5, + "y": -3.0, + "theta": 0.7243977895217766 + }, + "p27": { + "x": -3.75, + "y": 30.0, + "theta": 2.6113632827412263 + }, + "p28": { + "x": -16.5, + "y": -34.0, + "theta": 2.371379882273725 + }, + "p29": { + "x": 52.5, + "y": 56.0, + "theta": 1.2418607406634274 + }, + "p30": { + "x": 62.25, + "y": 9.0, + "theta": 1.773894642015974 + }, + "p31": { + "x": -3.75, + "y": 64.0, + "theta": 2.317622632590809 + } + }, + "sourceIds": { + "p00": "C3l", + "p01": "A3u", + "p02": "C0l", + "p03": "D0u", + "p04": "A2u", + "p05": "B0l", + "p06": "D3u", + "p07": "A1u", + "p08": "A0u", + "p09": "B3l", + "p10": "C2u", + "p11": "A2l", + "p12": "A0l", + "p13": "C1l", + "p14": "C2l", + "p15": "D1l", + "p16": "B1u", + "p17": "D2u", + "p18": "C1u", + "p19": "D2l", + "p20": "B2u", + "p21": "A3l", + "p22": "C0u", + "p23": "D0l", + "p24": "B1l", + "p25": "C3u", + "p26": "A1l", + "p27": "B2l", + "p28": "B0u", + "p29": "D3l", + "p30": "D1u", + "p31": "B3u" + } +} diff --git a/tests/keys/plt3.json b/tests/keys/plt3.json new file mode 100644 index 0000000..d3eb47f --- /dev/null +++ b/tests/keys/plt3.json @@ -0,0 +1,204 @@ +{ + "instanceId": "plt3", + "instanceHash": "e73daacb28ff962473a0d4f007eafdfda67324d30313ffe95b8d09df47c0b671", + "sanitizer": { + "version": 1, + "seed": 20261109 + }, + "poses": { + "p00": { + "x": -43.5, + "y": 30.0, + "theta": -2.8534040569886545 + }, + "p01": { + "x": 52.5, + "y": -3.0, + "theta": 0.73593107525625 + }, + "p02": { + "x": 62.25, + "y": 64.0, + "theta": 2.3832833303724805 + }, + "p03": { + "x": 20.25, + "y": 30.0, + "theta": -2.9273723554473134 + }, + "p04": { + "x": 20.25, + "y": 9.0, + "theta": 0.19835254302137262 + }, + "p05": { + "x": -16.5, + "y": 39.0, + "theta": 0.6569749491907375 + }, + "p06": { + "x": -57.75, + "y": 64.0, + "theta": -0.15842532798054756 + }, + "p07": { + "x": -16.5, + "y": -3.0, + "theta": -1.2198653585398829 + }, + "p08": { + "x": -43.5, + "y": -34.0, + "theta": -1.9769875623602453 + }, + "p09": { + "x": 20.25, + "y": 56.0, + "theta": 0.4760903317233227 + }, + "p10": { + "x": -3.75, + "y": 9.0, + "theta": 1.1802686189372649 + }, + "p11": { + "x": -3.75, + "y": 64.0, + "theta": -2.642655037884528 + }, + "p12": { + "x": -16.5, + "y": -34.0, + "theta": -0.2576633951959411 + }, + "p13": { + "x": -16.5, + "y": 56.0, + "theta": 2.7623753197486214 + }, + "p14": { + "x": 62.25, + "y": 9.0, + "theta": 3.062135494323819 + }, + "p15": { + "x": -57.75, + "y": 39.0, + "theta": 2.5797883945938067 + }, + "p16": { + "x": 52.5, + "y": 39.0, + "theta": -2.021726343086859 + }, + "p17": { + "x": 52.5, + "y": -34.0, + "theta": -2.013320470699692 + }, + "p18": { + "x": -57.75, + "y": -53.0, + "theta": -0.32914454342651583 + }, + "p19": { + "x": -43.5, + "y": 56.0, + "theta": -2.5834170108338848 + }, + "p20": { + "x": -3.75, + "y": 30.0, + "theta": 2.488447689968715 + }, + "p21": { + "x": -3.75, + "y": -53.0, + "theta": -1.3639579472075982 + }, + "p22": { + "x": 31.5, + "y": 39.0, + "theta": -1.788523824848831 + }, + "p23": { + "x": 31.5, + "y": -3.0, + "theta": 0.41454732787319504 + }, + "p24": { + "x": 62.25, + "y": -53.0, + "theta": 1.9811453016989562 + }, + "p25": { + "x": 52.5, + "y": 56.0, + "theta": 1.114236859390866 + }, + "p26": { + "x": -43.5, + "y": -3.0, + "theta": -2.1974728866483786 + }, + "p27": { + "x": 31.5, + "y": 64.0, + "theta": -0.5059026272232927 + }, + "p28": { + "x": -57.75, + "y": 9.0, + "theta": 2.7954101108463036 + }, + "p29": { + "x": 62.25, + "y": 30.0, + "theta": -2.901274125792042 + }, + "p30": { + "x": 20.25, + "y": -53.0, + "theta": -0.8390333679734314 + }, + "p31": { + "x": 31.5, + "y": -34.0, + "theta": 2.073636765259039 + } + }, + "sourceIds": { + "p00": "A2l", + "p01": "D1l", + "p02": "D3u", + "p03": "C2l", + "p04": "C1u", + "p05": "B2u", + "p06": "A3u", + "p07": "B1l", + "p08": "A0u", + "p09": "C3l", + "p10": "B1u", + "p11": "B3u", + "p12": "B0u", + "p13": "B3l", + "p14": "D1u", + "p15": "A2u", + "p16": "D2u", + "p17": "D0u", + "p18": "A0l", + "p19": "A3l", + "p20": "B2l", + "p21": "B0l", + "p22": "C2u", + "p23": "C1l", + "p24": "D0l", + "p25": "D3l", + "p26": "A1l", + "p27": "C3u", + "p28": "A1u", + "p29": "D2l", + "p30": "C0l", + "p31": "C0u" + } +} diff --git a/tests/keys/plt4-flat.json b/tests/keys/plt4-flat.json new file mode 100644 index 0000000..ddc3fae --- /dev/null +++ b/tests/keys/plt4-flat.json @@ -0,0 +1,204 @@ +{ + "instanceId": "plt4-flat", + "instanceHash": "a48fa48c9bea34aaebf870c1944f02ce116c9093e8cb4fcf80170decbe1fa5d7", + "sanitizer": { + "version": 1, + "seed": 20261109 + }, + "poses": { + "p00": { + "x": -14.25, + "y": 36.0, + "theta": 2.590839161860429 + }, + "p01": { + "x": 52.5, + "y": -52.0, + "theta": 1.6865670996248294 + }, + "p02": { + "x": -56.25, + "y": -52.0, + "theta": 0.21188404169898423 + }, + "p03": { + "x": 18.75, + "y": 65.0, + "theta": 0.9216341551219935 + }, + "p04": { + "x": -40.5, + "y": -62.0, + "theta": 1.002378169235259 + }, + "p05": { + "x": -56.25, + "y": -10.0, + "theta": 2.860221017300817 + }, + "p06": { + "x": 52.5, + "y": 65.0, + "theta": 1.433148420232028 + }, + "p07": { + "x": 52.5, + "y": 36.0, + "theta": 1.0860591823996222 + }, + "p08": { + "x": -3.75, + "y": -62.0, + "theta": 2.863316939847049 + }, + "p09": { + "x": 30.75, + "y": -62.0, + "theta": 2.420428949724957 + }, + "p10": { + "x": -3.75, + "y": -26.0, + "theta": -1.7728972901232145 + }, + "p11": { + "x": -40.5, + "y": -26.0, + "theta": 2.933660793211554 + }, + "p12": { + "x": -40.5, + "y": 58.0, + "theta": -1.7920916791877124 + }, + "p13": { + "x": 18.75, + "y": 36.0, + "theta": 0.27945817899532166 + }, + "p14": { + "x": 52.5, + "y": -10.0, + "theta": 2.0692731545692293 + }, + "p15": { + "x": -3.75, + "y": 21.0, + "theta": -2.308411619515033 + }, + "p16": { + "x": 62.25, + "y": -62.0, + "theta": -3.039225874197247 + }, + "p17": { + "x": -14.25, + "y": 65.0, + "theta": 2.365664894770585 + }, + "p18": { + "x": -56.25, + "y": 65.0, + "theta": 3.0616936782294584 + }, + "p19": { + "x": -14.25, + "y": -10.0, + "theta": 2.0390590558858905 + }, + "p20": { + "x": 30.75, + "y": 58.0, + "theta": -0.19813796881701598 + }, + "p21": { + "x": 30.75, + "y": -26.0, + "theta": 1.0544648617981602 + }, + "p22": { + "x": -40.5, + "y": 21.0, + "theta": 2.5701961075171185 + }, + "p23": { + "x": 30.75, + "y": 21.0, + "theta": -2.0064690764191715 + }, + "p24": { + "x": -3.75, + "y": 58.0, + "theta": -2.894816154474799 + }, + "p25": { + "x": 18.75, + "y": -10.0, + "theta": -0.2927094486130976 + }, + "p26": { + "x": -56.25, + "y": 36.0, + "theta": 0.3165915364719716 + }, + "p27": { + "x": 62.25, + "y": 58.0, + "theta": 3.0278589824349798 + }, + "p28": { + "x": 18.75, + "y": -52.0, + "theta": 0.9603363797722837 + }, + "p29": { + "x": -14.25, + "y": -52.0, + "theta": -2.8521606432561564 + }, + "p30": { + "x": 62.25, + "y": -26.0, + "theta": 0.717062410764461 + }, + "p31": { + "x": 62.25, + "y": 21.0, + "theta": -0.5569923634583902 + } + }, + "sourceIds": { + "p00": "B2u", + "p01": "D0u", + "p02": "A0u", + "p03": "C3u", + "p04": "A0l", + "p05": "A1u", + "p06": "D3u", + "p07": "D2u", + "p08": "B0l", + "p09": "C0l", + "p10": "B1l", + "p11": "A1l", + "p12": "A3l", + "p13": "C2u", + "p14": "D1u", + "p15": "B2l", + "p16": "D0l", + "p17": "B3u", + "p18": "A3u", + "p19": "B1u", + "p20": "C3l", + "p21": "C1l", + "p22": "A2l", + "p23": "C2l", + "p24": "B3l", + "p25": "C1u", + "p26": "A2u", + "p27": "D3l", + "p28": "C0u", + "p29": "B0u", + "p30": "D1l", + "p31": "D2l" + } +} diff --git a/tests/keys/plt4.json b/tests/keys/plt4.json new file mode 100644 index 0000000..336d257 --- /dev/null +++ b/tests/keys/plt4.json @@ -0,0 +1,204 @@ +{ + "instanceId": "plt4", + "instanceHash": "37fe028252b9a4e5087d5ec6c5f1c1513320eda1c57167689944c9e28bc73c1d", + "sanitizer": { + "version": 1, + "seed": 20261109 + }, + "poses": { + "p00": { + "x": 30.75, + "y": 58.0, + "theta": -1.0510471802734296 + }, + "p01": { + "x": -56.25, + "y": -52.0, + "theta": 2.8368635190505445 + }, + "p02": { + "x": 30.75, + "y": -62.0, + "theta": 2.9331744995104536 + }, + "p03": { + "x": -40.5, + "y": 21.0, + "theta": 2.8398708530961736 + }, + "p04": { + "x": -3.75, + "y": -62.0, + "theta": 2.345726881027271 + }, + "p05": { + "x": 62.25, + "y": -62.0, + "theta": -2.2016511170752984 + }, + "p06": { + "x": 62.25, + "y": 21.0, + "theta": -2.1961127766063933 + }, + "p07": { + "x": 18.75, + "y": 65.0, + "theta": -0.8938708653400324 + }, + "p08": { + "x": 52.5, + "y": -10.0, + "theta": 2.176295024254216 + }, + "p09": { + "x": 18.75, + "y": 36.0, + "theta": 0.9034095546575314 + }, + "p10": { + "x": -3.75, + "y": 58.0, + "theta": -1.0409083045682705 + }, + "p11": { + "x": -56.25, + "y": 36.0, + "theta": -1.9467804526850176 + }, + "p12": { + "x": -56.25, + "y": -10.0, + "theta": 1.0757233318249773 + }, + "p13": { + "x": 62.25, + "y": 58.0, + "theta": -2.1588389084722572 + }, + "p14": { + "x": 52.5, + "y": 65.0, + "theta": -0.5424365154195744 + }, + "p15": { + "x": -40.5, + "y": 58.0, + "theta": 2.4415966628676795 + }, + "p16": { + "x": 62.25, + "y": -26.0, + "theta": -1.920386038263966 + }, + "p17": { + "x": 30.75, + "y": -26.0, + "theta": -2.3242269525099535 + }, + "p18": { + "x": -14.25, + "y": 36.0, + "theta": -0.8700386918071906 + }, + "p19": { + "x": -14.25, + "y": -52.0, + "theta": 0.22757818691267406 + }, + "p20": { + "x": -56.25, + "y": 65.0, + "theta": -2.229439165970036 + }, + "p21": { + "x": -14.25, + "y": -10.0, + "theta": 0.8040202904422866 + }, + "p22": { + "x": 52.5, + "y": -52.0, + "theta": 1.1798891293534348 + }, + "p23": { + "x": 30.75, + "y": 21.0, + "theta": 1.61882225360959 + }, + "p24": { + "x": -14.25, + "y": 65.0, + "theta": -0.17234561133940984 + }, + "p25": { + "x": 52.5, + "y": 36.0, + "theta": 1.879534542936332 + }, + "p26": { + "x": 18.75, + "y": -10.0, + "theta": -2.384756738119855 + }, + "p27": { + "x": -40.5, + "y": -26.0, + "theta": -0.5518220716424432 + }, + "p28": { + "x": -3.75, + "y": 21.0, + "theta": -1.1529998544426714 + }, + "p29": { + "x": -3.75, + "y": -26.0, + "theta": 1.6761240168060922 + }, + "p30": { + "x": 18.75, + "y": -52.0, + "theta": 2.192016498191455 + }, + "p31": { + "x": -40.5, + "y": -62.0, + "theta": 0.2826308827911541 + } + }, + "sourceIds": { + "p00": "C3l", + "p01": "A0u", + "p02": "C0l", + "p03": "A2l", + "p04": "B0l", + "p05": "D0l", + "p06": "D2l", + "p07": "C3u", + "p08": "D1u", + "p09": "C2u", + "p10": "B3l", + "p11": "A2u", + "p12": "A1u", + "p13": "D3l", + "p14": "D3u", + "p15": "A3l", + "p16": "D1l", + "p17": "C1l", + "p18": "B2u", + "p19": "B0u", + "p20": "A3u", + "p21": "B1u", + "p22": "D0u", + "p23": "C2l", + "p24": "B3u", + "p25": "D2u", + "p26": "C1u", + "p27": "A1l", + "p28": "B2l", + "p29": "B1l", + "p30": "C0u", + "p31": "A0l" + } +} diff --git a/tests/keys/plt5-flat.json b/tests/keys/plt5-flat.json new file mode 100644 index 0000000..2ecc3c7 --- /dev/null +++ b/tests/keys/plt5-flat.json @@ -0,0 +1,156 @@ +{ + "instanceId": "plt5-flat", + "instanceHash": "d628c564608b9e86416f44720cbc758cec58f3103515fd052f19f8797cd653e4", + "sanitizer": { + "version": 1, + "seed": 20261109 + }, + "poses": { + "p00": { + "x": 37.5, + "y": -55.0, + "theta": 2.308399022009463 + }, + "p01": { + "x": -49.5, + "y": 36.0, + "theta": 0.9836061023062861 + }, + "p02": { + "x": 27.75, + "y": 54.0, + "theta": -3.123099252398822 + }, + "p03": { + "x": 37.5, + "y": 36.0, + "theta": -0.9616976576917361 + }, + "p04": { + "x": -0.75, + "y": 36.0, + "theta": -2.2844924006128906 + }, + "p05": { + "x": -60.75, + "y": -38.0, + "theta": -2.0552971687373933 + }, + "p06": { + "x": -49.5, + "y": -8.0, + "theta": -2.8363953799872186 + }, + "p07": { + "x": -19.5, + "y": 5.0, + "theta": -2.9231839606081973 + }, + "p08": { + "x": 27.75, + "y": -38.0, + "theta": -2.5269320613920594 + }, + "p09": { + "x": -60.75, + "y": 5.0, + "theta": 1.8165124755951778 + }, + "p10": { + "x": -19.5, + "y": 54.0, + "theta": 0.7080898560135633 + }, + "p11": { + "x": -60.75, + "y": 54.0, + "theta": 0.8848359632576246 + }, + "p12": { + "x": -0.75, + "y": -8.0, + "theta": 1.4124911935371829 + }, + "p13": { + "x": -49.5, + "y": -55.0, + "theta": -2.5179010868924707 + }, + "p14": { + "x": -0.75, + "y": -55.0, + "theta": 2.92910493361521 + }, + "p15": { + "x": -19.5, + "y": -38.0, + "theta": -1.7648339777294235 + }, + "p16": { + "x": 63.75, + "y": 36.0, + "theta": -1.2095794011773202 + }, + "p17": { + "x": 27.75, + "y": 5.0, + "theta": 1.1571732798753978 + }, + "p18": { + "x": 63.75, + "y": -55.0, + "theta": -1.4281073672005085 + }, + "p19": { + "x": 63.75, + "y": -8.0, + "theta": 1.3619685205130097 + }, + "p20": { + "x": 55.5, + "y": -38.0, + "theta": -1.1772629279949554 + }, + "p21": { + "x": 55.5, + "y": 54.0, + "theta": -0.38381906787452547 + }, + "p22": { + "x": 55.5, + "y": 5.0, + "theta": -2.1569103573219497 + }, + "p23": { + "x": 37.5, + "y": -8.0, + "theta": -1.965186468053941 + } + }, + "sourceIds": { + "p00": "C0l", + "p01": "A2l", + "p02": "C2u", + "p03": "C2l", + "p04": "B2l", + "p05": "A0u", + "p06": "A1l", + "p07": "B1u", + "p08": "C0u", + "p09": "A1u", + "p10": "B2u", + "p11": "A2u", + "p12": "B1l", + "p13": "A0l", + "p14": "B0l", + "p15": "B0u", + "p16": "D2l", + "p17": "C1u", + "p18": "D0l", + "p19": "D1l", + "p20": "D0u", + "p21": "D2u", + "p22": "D1u", + "p23": "C1l" + } +} diff --git a/tests/keys/plt5.json b/tests/keys/plt5.json new file mode 100644 index 0000000..94d784a --- /dev/null +++ b/tests/keys/plt5.json @@ -0,0 +1,156 @@ +{ + "instanceId": "plt5", + "instanceHash": "5cbf55990ad0d4854af21ffb07a5a56dd1960945b73055b20b642fd9e51ebb03", + "sanitizer": { + "version": 1, + "seed": 20261109 + }, + "poses": { + "p00": { + "x": 27.75, + "y": -38.0, + "theta": 2.957551565332272 + }, + "p01": { + "x": -60.75, + "y": -38.0, + "theta": 2.96333583442239 + }, + "p02": { + "x": 37.5, + "y": 36.0, + "theta": 2.860495584618136 + }, + "p03": { + "x": 63.75, + "y": 36.0, + "theta": 0.5992749018617696 + }, + "p04": { + "x": 63.75, + "y": -55.0, + "theta": -2.0891164607966743 + }, + "p05": { + "x": -60.75, + "y": 54.0, + "theta": 1.0334681027925612 + }, + "p06": { + "x": -19.5, + "y": 5.0, + "theta": 2.1169994940729033 + }, + "p07": { + "x": 27.75, + "y": 5.0, + "theta": -2.428687656073273 + }, + "p08": { + "x": -19.5, + "y": 54.0, + "theta": 2.15931310761023 + }, + "p09": { + "x": 55.5, + "y": -38.0, + "theta": 2.071501864070612 + }, + "p10": { + "x": -60.75, + "y": 5.0, + "theta": -2.7439670442546453 + }, + "p11": { + "x": 27.75, + "y": 54.0, + "theta": 1.068061385880843 + }, + "p12": { + "x": 55.5, + "y": 54.0, + "theta": 3.1202635732699213 + }, + "p13": { + "x": -49.5, + "y": 36.0, + "theta": 2.3288005200674875 + }, + "p14": { + "x": -49.5, + "y": -55.0, + "theta": -2.1409143628591916 + }, + "p15": { + "x": -0.75, + "y": -8.0, + "theta": -1.0947615906432373 + }, + "p16": { + "x": 37.5, + "y": -55.0, + "theta": 2.532008625275369 + }, + "p17": { + "x": -19.5, + "y": -38.0, + "theta": 2.4045872660124075 + }, + "p18": { + "x": -0.75, + "y": 36.0, + "theta": -1.5380766725115407 + }, + "p19": { + "x": 63.75, + "y": -8.0, + "theta": 2.9772333147793537 + }, + "p20": { + "x": -49.5, + "y": -8.0, + "theta": 2.6906431613342137 + }, + "p21": { + "x": -0.75, + "y": -55.0, + "theta": -0.36583224284280513 + }, + "p22": { + "x": 37.5, + "y": -8.0, + "theta": -2.1829353159544773 + }, + "p23": { + "x": 55.5, + "y": 5.0, + "theta": -0.9074473774912932 + } + }, + "sourceIds": { + "p00": "C0u", + "p01": "A0u", + "p02": "C2l", + "p03": "D2l", + "p04": "D0l", + "p05": "A2u", + "p06": "B1u", + "p07": "C1u", + "p08": "B2u", + "p09": "D0u", + "p10": "A1u", + "p11": "C2u", + "p12": "D2u", + "p13": "A2l", + "p14": "A0l", + "p15": "B1l", + "p16": "C0l", + "p17": "B0u", + "p18": "B2l", + "p19": "D1l", + "p20": "A1l", + "p21": "B0l", + "p22": "C1l", + "p23": "D1u" + } +} diff --git a/tests/keys/rat1-flat.json b/tests/keys/rat1-flat.json index ed46fa0..5fa836f 100644 --- a/tests/keys/rat1-flat.json +++ b/tests/keys/rat1-flat.json @@ -1,6 +1,6 @@ { "instanceId": "rat1-flat", - "instanceHash": "b57c9992f73665a1b6966e3875de691e4c217a3fe6891b1b36a201423a4180d9", + "instanceHash": "174074422b12292efdefe1d1fd0a10b924ed6d671448e3e57baeb4395f4dd599", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/rat1.json b/tests/keys/rat1.json index 100fc04..ec60be0 100644 --- a/tests/keys/rat1.json +++ b/tests/keys/rat1.json @@ -1,6 +1,6 @@ { "instanceId": "rat1", - "instanceHash": "b79a18190749853d0a5b50d03b52d558d499140dd86e91e113658c56a19217b8", + "instanceHash": "b18060830cdb0dddcca427532b6eb105ac4630c10a8c6c77acde122ce3687024", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/rat2-flat.json b/tests/keys/rat2-flat.json index ca8e6a7..5ee5660 100644 --- a/tests/keys/rat2-flat.json +++ b/tests/keys/rat2-flat.json @@ -1,6 +1,6 @@ { "instanceId": "rat2-flat", - "instanceHash": "ef6bb1d52337553f2299a4bc72b9e8a71031d9e8b52febb2041b8fc40c9d8201", + "instanceHash": "b546ae43877e7b5b15dba702230f4afbbaeb5d726b988901e432828498b19e7b", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/rat2.json b/tests/keys/rat2.json index 9956493..02833d3 100644 --- a/tests/keys/rat2.json +++ b/tests/keys/rat2.json @@ -1,6 +1,6 @@ { "instanceId": "rat2", - "instanceHash": "fc22d29e662b8d9dc55e6a20bb36bbaeb04d638bbc76fa8b1a1e79b6d9e06d9b", + "instanceHash": "406e2d4eeff8260dc70d111e975351554637b79cfc6b3aa08ad21ec98b543e56", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/rev2-flat.json b/tests/keys/rev2-flat.json index dce2312..a2a18c4 100644 --- a/tests/keys/rev2-flat.json +++ b/tests/keys/rev2-flat.json @@ -1,6 +1,6 @@ { "instanceId": "rev2-flat", - "instanceHash": "6308c5517ad6a362e2b0f9ab0269a3f6e85d2e1118ae69a6a672586d2d809522", + "instanceHash": "c1cb071c776421802523175ade60c251318583f7b65319ac385a6e1cf5b6ff32", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/keys/rev2.json b/tests/keys/rev2.json index f4f2a63..a03d313 100644 --- a/tests/keys/rev2.json +++ b/tests/keys/rev2.json @@ -1,6 +1,6 @@ { "instanceId": "rev2", - "instanceHash": "08af73dcc5d42e622630d0618149fd81314afd398313a07aa9a7a9a2e9faf923", + "instanceHash": "0e4516ee9f95d91725b35005667013a02d0e10e06d8acb978ab1e26215f1e2ec", "sanitizer": { "version": 1, "seed": 20261109 diff --git a/tests/support/corpus.py b/tests/support/corpus.py index c3db22c..a22e1af 100644 --- a/tests/support/corpus.py +++ b/tests/support/corpus.py @@ -18,17 +18,26 @@ SOURCE_ENV = "TROPICAL_PUZZLE_LAB" +# The Pleat puzzles (tropical-puzzle-lab plt1-plt5): relief searches of 7 488 to 21 973 +# nodes, and footprints with tens of thousands of assemblies at 1 500 000 nodes. +PLEAT = frozenset({f"plt{n}" for n in range(1, 6)}) +PLEAT_FLAT = frozenset(f"{p}-flat" for p in PLEAT) + # Corpus fixtures whose whole search, assuming nothing, has not been seen to end: -# cor1-flat was stopped at 3 000 000 nodes. Tests that compare against the end of +# cor1-flat was stopped at 3 000 000 nodes, and the Pleat footprints stop at the +# corpus limit still finding assemblies. Tests that compare against the end of # that search leave these out by name, and test them separately for what can be said. -UNFINISHED = frozenset({"cor1-flat"}) +UNFINISHED = frozenset({"cor1-flat"}) | PLEAT_FLAT # Corpus fixtures whose whole search, assuming nothing, the test suite does not run: # 909 750 nodes and more (cor1-flat stops at the corpus manifest's limit of 1 500 000), # against at most 128 230 for the rest (benchmarks/results/corpus.md). Run again and # again across the tests they took over ten minutes. The suite reproduces the other rows # of the committed tables; these rows are checked by running the full command by hand. -EXPENSIVE = frozenset({"cor1-flat", "new1-flat", "new2-flat"}) +# The Pleat puzzles are left out whole: their relief searches are the corpus's hardest +# with roofs on, and the suite has no use for running them on every change beyond what +# the committed table and tests/corpus/test_hard_relief.py say about them. +EXPENSIVE = frozenset({"cor1-flat", "new1-flat", "new2-flat"}) | PLEAT | PLEAT_FLAT # CP-SAT on rat2-flat: whole, but 80 s of choosing among its listed placements. EXPENSIVE_FOR_CP_SAT = EXPENSIVE | {"rat2-flat"}