Repository navigation
feat(shipyard): add bounded exact tiny polygon packing oracle - #2724
Draft
Tristan-Stoltz-ERC wants to merge 11 commits into
Draft
Tristan-Stoltz-ERC wants to merge 11 commits into
Tristan-Stoltz-ERC wants to merge 11 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a bounded exact packing solver stacked on PR #2718 and PR #2717.
Paradigm shift: proof-carrying outcome semantics
The solver deliberately distinguishes:
It uses deterministic minimum-remaining-values (MRV) branching rather than relying only on request order, with y-major/x-major candidate order and stable tie breaks. The search is limited to four requests and yards no larger than 5x5 integer placement units. Out-of-scope inputs and geometry errors fail closed.
Frozen greedy-failure benchmark
In a 4x4 yard, two 1x1 squares followed by a 1x3 bar are a constructed counterexample for the first-fit ordering. Exact-polygon first-fit places the squares at (0,0) and (2,0), then leaves the bar unplaced. MRV exact search can fit all three by placing the bar at (0,0) and the squares at (2,0) and (2,2). A separate integer-cell and boundary-contact oracle checks the returned layout.
This is a deterministic completeness demonstration, not a runtime or industrial-quality claim. An independent finite-grid reference calculation reproduced the intended positions. The exact-head Rust suite remains the authoritative confirmation.
Other conformance targets
Engineering
Dependency-only links to the polygon geometry and first-fit baseline prototypes; no third-party runtime. Rust 1.96 formatting, offline tests and Clippy-with-warnings-denied gates are included.
Verification boundary
No local Rust toolchain was available for this authoring session. Keep this draft until the exact-head format/test/Clippy workflows pass. The mathematical proof, if confirmed by implementation, applies only to fixed-orientation polygon footprints on the finite integer translation grid, with the declared yard bounds and boundary-contact policy.