Repository navigation
release: v0.5.0 — exact-NFP construction mode (strategy="nfp") + multi-start order diversification + evaluator early-terminate - #3
Merged
Conversation
…i-start order diversification + evaluator early-terminate Optimizer round 3 (docs/02 §11.2): - Deterministic early-terminate in the separation evaluator (strict-greater bailout on canonically-ordered partial sums) — ~13-15% faster separation, provably output-identical (goldens byte-frozen). - Multi-start order diversification: contiguous block split (leading half canonical largest-first, trailing half seeded-jittered insertion order). Doubling n_starts keeps every canonical stream the smaller run explored, so the old best-of-K is a floor for the new best-of-2K. +1.0pp mean on diameter-misleading mixes; consumer corpus 82.76% -> 83.44% at restarts=16. - Compression phase (sparrow compress loop) implemented, measured (zero gain, 2-3.5x cost), reverted with mechanism analysis: fixed-bin insertion-driven separation subsumes untargeted wall squeezes. - N1a import hoist: items/container imported once per call (Problem), shared read-only across the K multi-start threads. Feature #4 — exact-NFP construction mode (docs/03), opt-in, default-off: - Integer geometry substrate (crates/optimizer/src/nfp/): 2^20 fixed grid, i64 coords + i128 predicates, orientation-normalized convolution union-fill (winding-cancellation fix), convex edge-merge fast path, quads-only face-classified frame IFP (correct for concave containers), □E=16 contact backoff, Booth-canonicalized shapes, eager mirror-derived pair cache with domain gate. i_overlay = 7.0.2 exact-pinned (integer i64 API only; MIT/Apache-2.0; source-audited for determinism hazards). MSRV 1.87 -> 1.88. - Placer: exact (cost, rot_idx, x, y) candidate walk over IFP-minus-NFPs region vertices (exact for the linear LBF loss), CDE-verified, placed directly (no slide); per-part sampling fallback; separation tail unchanged. - Public API: PlacementStrategy / NestConfig / NestError + nest_with_config + nest_multi_with_config (Sampling configs are test-locked frozen wrappers of the existing entry points). PartsGeometry shared across sheets in multi. - Wheel: strategy="sampling"|"nfp" kwarg on nest() and nest_multi(). - 7 new golden cases incl. nfp-contact-columns (100% util contact grid — the exact-fit artifact killed by construction), nfp-concave-pocket (part nested inside a C-part pocket), and jittered-winner multistart cases pinning both diversification paths cross-platform. - Acceptance (consumer 13-shape corpus, paired seeds, K=16): NFP 83.88% vs sampling 83.27% mean (+0.61pp, floor held on every seed, 1.02x wall-clock; 84.03% = all-time best on this corpus) -> SHIP OPT-IN per docs/03 §10. 88 tests / 14 suites green (release + parallel + debug legs); clippy -D warnings clean on both feature sets; all pre-existing goldens byte-identical (sampling behavior frozen for n_starts=1; n_starts>1 layouts changed vs v0.4.x per the order-diversification note in nest_multistart docs). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Clears the supply-chain gate: the advisory flags unsoundness in Error::downcast_mut on 1.0.102 (a jagua-fork import-path dependency; not on any placement path — goldens unaffected, lock-only change). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
The largest release since the engine's inception: an opt-in second placement engine built on exact no-fit-polygon geometry in scaled integer arithmetic (
strategy="nfp"), plus two improvements to the sampling engine. Every determinism guarantee holds — 16 cross-platform golden cases (7 new) prove byte-identity on all three shipped platforms.Exact-NFP construction mode (feature #4, docs/03) — opt-in, default-off
crates/optimizer/src/nfp/): 2^20 fixed grid, i64 coords + i128 predicates, orientation-normalized convolution union-fill, convex edge-merge fast path, quads-only face-classified frame IFP (correct for concave containers), □E contact backoff, eager mirror-derived pair cache, hard input-domain gate.PlacementStrategy/NestConfig/NestError+nest_with_config+nest_multi_with_config; wheel gainsstrategy="sampling"|"nfp"on both pyfunctions.i_overlay = 7.0.2exact-pinned (MIT/Apache-2.0, pure Rust, source-audited). MSRV 1.87 → 1.88.Sampling engine (docs/02 §11.2)
restarts>1layouts change vs v0.4.x (deterministically);restarts=1byte-identical.Test plan
-D warningsclean on the full workspace (both feature configurations); fmt clean🤖 Generated with Claude Code