mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-22 12:17:43 -05:00
BlockCatalog keeps the Lattice (Fill) patterns the frontier packer takes as blocks and the banded fill takes as bands, and decides when each one is charged to the solve's work meter. Its rules were hard to see. Get and Band each threaded (type, quantity, rectangle, token) through four methods and repeated the same four-part guard, both caches were keyed by an anonymous four-part tuple, Propose answered with a (members, poses) tuple in which exactly one half was ever set, and the limits lived in the code as bare numbers: three copies in four places, eight attempts, two rectangles, two unrelated 0.001 margins and the rounding digits of a certified pose. Band did its lookup, proposal, deferred charge and binding in one body, and the certification ran quantizing, the rotation check and the pair test together. A request is now a Request (type, quantity, rectangle) that knows its PatternKey, whether anything can come of it and what its Fill costs. Get reads as its rules: kept block, CannotPrepare (too small, the type's preparations spent, the budget spent), count, Prepare. Band finds or proposes its entry in BandFor and keeps only the charge and the binding; its two overloads are one method with an optional prefetch drawing, so no call site changes. Propose returns the certified poses or null, and a BandEntry without poses is an empty pattern. Certify is QuantizedPoses, IsAllowed and KeepSpacing, Bind takes its orientation from OrientationAt, Rectangles ranks what FreeRegion leaves, and Footprint is a type built from HullWidth and Perimeter. The limits and margins are named constants, the band's wider fill spacing is computed once, and the exceptions that make a proposal empty have one definition. No layout changes, and nothing about the meter moves: a block is still charged before its rectangle is tested, a band on its first ordinary request whichever request built it, a prefetch charges and binds nothing, and the attempt count, cache keys, locks and floating-point expressions are as they were. Drawing ownership and release are untouched. Traced before and after: every progress report, plan, alternative, repeat batch, tail re-plan (with its work-meter reading) and final result of 73 solves (one, few and seven part types in quantity with automatic, fixed and swept rotations, one to three stocks, two and three spacings in one job, finite stock, clamp rails, outlined sheets, three quadrants, priorities, costs with salvage, both offcut axes, a sheet cap, work budgets of 20,000 and zero, grouped and banded passes on and off, five searches until cancelled); 1,735 direct catalog calls on 13 catalogs (Get, Band, single and parallel prefetches followed by their ordinary requests, repeated calls, cancelled calls, Rectangles, Resolve; with and without pairs, shared and owned drawings, a budget that runs out), each with its members' orientations and poses as raw bits, the meter reading and the preparation count; and 72 frontier and banded fills over one catalog on eight jobs, with and without a clamp rail. The 94 traces (81,689 lines) are byte-identical. Engine suite (3,692 passed, 2 skipped) and the problem-nest corpus's auto-nest area pass, both nests at their baseline sheet counts and ends. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>