On a saved nest of the README sample parts (130 copies, 60 x 120, 0.3
spacing, bottom clamp rail) Auto Nest ended at 105.8 where a hand layout
of tidy bands ends at 103.1. Three things kept the banded fill from it:
- Lattice's first pattern for the 24 gussets set two columns 0.04 apart.
The band's certification rejected it and the band search stopped, so
the gussets had no band and filled the gaps as ragged columns. The
search now asks again just short of the rejected pattern
(BlockCatalog.RejectedBandLength).
- Building patterns is charged to the same work meter as the trials of
narrower and lower bands, and with the lower bands it spent the whole
budget, so the last types in the order never had a trial. Trials now
go round the types and may spend 25,000 work whatever the budget.
- A band taller than the height clear of the clamps lost members to
them. The first lower band is now asked for at that height and
searched like the full band; where such a band would stand whole in
place of one that loses members, the bands are searched a second time
with it there and the better sheet kept. A lower band no longer than
the full one stands first in its place, leaving a strip beside it.
That nest now ends at 103.1, the same parts built from the README DXFs
at 104.0 instead of 106.6, the help tutorial nest at 33.6 instead of
34.2; N26-2HH stays at 103.9 and the other benchmark jobs are unchanged.
Solves of these jobs take about a tenth longer.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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>
A free rectangle narrower than the part at every rotation (its convex-hull
width, less the outline's flattening tolerance), or smaller than three
copies, can only give Fill two members or fewer, which never form a block.
Block and band requests for such rectangles no longer run the Fill. They
still count as a preparation and are charged as before, so the work meter
and every layout stay byte-identical. On N26-2GT this skips 31 fills
(about 7.6 s of fill time across the solve, 0.4 s before the first plan).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Lattice band certification prepares each member's outline once instead of
re-inflating both parts for every pair (about 40% of each pattern's cost).
- Strip packing builds each beam level's band searches ahead in parallel,
each on its own drawing copy; prefetched patterns charge no work and bind
no orientations until requested in strip order, so the work meter and
results match building them in turn.
- FrontierPacker blocks seated parts in one parallel pass, not one per part.
Layouts and work counts are unchanged on the README, clamp-rail, 2x and
tutorial jobs and the synthetic nests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Irregular decodes the job once more in full-height strips along X when
like parts group and every part shares one priority. A sheet that can
take all the remaining parts is packed two ways and the better kept:
- Bands: each type of three or more copies as its Lattice pattern in the
narrowest strip that holds all its copies, bands side by side, the
held-back copies and one-offs filling the gaps.
- Strips: each strip holds the largest remaining part, as its band or a
column one to three copies wide, every other part filling its gaps; a
beam of the four densest partial sheets carries strip to strip.
Band patterns are filled one grid unit wider than the spacing so a stack
of rings passes the strict certification, members on a clamp go to the
gap fill, and a short band moves flush to the far edge when that keeps
it off the clamps. The plan replaces the result only by beating it.
On seven sample parts (130 copies, 60 x 120) the layout ends at 102.9"
instead of 107.7", and at 104.6" instead of 108.6" with the desktop's
edge spacing and bottom clamp rail; at about twice the quantities the
second sheet ends at 104.7" instead of 106.2". Every other benchmark job
is unchanged. Solves of these jobs take about twice as long.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A 67-drawing, 118-part job took about six minutes through the desktop
Auto Nest path and was cancelled before any layout appeared. Almost all
of it was the cutout pre-pass, the rest the Irregular engine.
Cutout pre-pass (317 s -> 8 s on that job, same bundles and poses):
- The lattice and NFP searches prepare the frame's and the occupants'
validation outlines once per search (NestLayoutCheck.Prepare) instead
of re-outlining and re-triangulating the frame at every candidate, and
test candidates against the small occupants before the frame. Answers
match the pairwise check exactly, including its leftmost-inflated rule.
- A hole's proposal is replayed for the same frame, hole and offered
inserts: automatic-rotation inserts ask the same question at every
frame angle.
Irregular engine (40 s -> 15 s, benchmark 42 s -> 19 s, same layouts):
- Concave no-fit polygons are built as the union of pairwise convex sums
of each footprint's convex pieces (ear clipping plus Hertel-Mehlhorn
merging on the Clipper lattice) instead of n*m edge-pair quads; a
footprint that cannot be decomposed keeps the old sweep.
- Pair and block catalogs share one private drawing per part geometry,
owned by the engine instance, so each part's best-fit search runs once
per instance and across a pipeline's trial and ordinary solves.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
BlockCatalog's PrepareBlocks pre-pass ran a full independent NFP-based
pack (PrivatePlateFill.Run) for up to 8 attempts per part type, but that
cost never touched the engine's WorkCounter/WorkBudget. For jobs with
several part types at double-digit quantities, these uncounted nested
solves could burn the entire 5-minute timeout inside the first sheet of
the first strategy variant, so Solve() never returned and nothing was
ever committed.
Charge quantity^2 * outline vertex count against the shared counter
before each nested fill, and stop issuing new block proposals once the
budget is exhausted, so the existing effort governor actually sees and
bounds this cost.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Move BlockCatalog's private-drawing Fill invocation (BestFitCache stabilization plus
the Default FillItem call) into PrivatePlateFill so the cutout fill can reuse it
without duplicating the cache handling. Behavior unchanged; Irregular filter 96/96.