Irregular overran DeadlineNestingEngine's 30 s limit by up to 50x in the
ML flag-sweep pilot (1,537 s on a 450-per-sheet part). Stack samples put
every second of the overrun in BlockCatalog.Rectangles: after a sheet fill
places a Lattice block of hundreds of detailed parts, the next block
preparation builds the free region one Clipper difference per part and
then sorts out every maximal rectangle with a quadratic dominance pass,
and neither checked the token. It shows only once best fits are cached
(a warm app, worker or sweep process), which is when the fill gets there
within the limit.
MaximalRectangles.InRegion now takes a token and a `largest` count: it
stops dominance checks past that rank, keeping every result tied in area
with the last, so its results are exactly the full search's down to that
area and Rectangles' top two are unchanged. The free region checks the
token per part. Layouts do not change; the reproducing job's whole solve
now takes 34 s instead of over 1,000.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Roslyn Bridge's duplicate scan found helpers copied verbatim between
projects, so a fix to one copy could silently miss the other. Each copy
now calls a single implementation with the same body:
- boundary nearest point: ClipperBridge.NearestBoundaryPoint (ErodedPierce,
ScrapPierceSearch)
- nesting profile of a part: NestLayoutCheck.Profile (CommonLinePair)
- part label points: PartLabels in OpenNest.Desktop (WinForms LayoutPart)
- copied common-line groups: CommonLineGroup.AmongParts (ActionClone,
PlaceTool)
- shared saved cutting parameters: CuttingParametersSerializer.SharedBy
(MCP, Console)
- bounding box of boxes: generic BoundingBox.GetBoundingBox<T> (rectangle
packing items)
- box proximity: Clearance.BoxesWithin (Expander)
Behavior is unchanged: every moved body is identical to the copies it
replaces, so the fill change in Expander and rectangle packing skips the
problem-nest corpus. Core, IO, Desktop and Engine suites and the label,
clone and common-line WinForms tests pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fill placed 30 J-shaped bars (30 x 7.5, 0.3 spacing) on a 48 x 96 sheet where
33 fit by hand. With pairs settled tight (07f30c12), two columns leave a 30.2"
strip, but the grid topped its last column up with single halves of pairs
and took that strip. The work that reached 33 was done on 2026-11-09 and left
uncommitted; this ports it onto master.
- PairFiller also tiles each pair grid with whole pairs only (FillLinear
PartialCopies = false), after the others, and refills the strip it leaves;
that grid wins only by placing more parts. Only fills without a quantity
try it: in Auto Nest's capped fills it ended N26-2ER's sheet at 103.83
instead of 103.08. The cutout lattice turns it off, since it crops its fill.
- GridEndInserter completes a strip's densest pair grid: it moves the grid
to each corner, slides copies of its parts in from the open sides and fills
the strip beyond. The J-bar strip takes three pairs stood on end, one more
bar beside them and a pair underneath: 33 parts, as laid out by hand.
Corpus: the J-bar fill places 33 (baseline 30), N26-29X keeps 136, and
every auto-nest nest keeps its saved layout.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sheet-by-sheet look-ahead cost picks the densest sheet, and a sheet of
small parts packs densest. On a braze casing mixing 35x57 to 65x89
plates with 5x28 angles and 9x4 tabs, sheet 1 took 109 small parts and
the plates followed one or two to a sheet with empty strips beside
them: 28 sheets, 220,032 sq in.
Rectangles now also runs the job large parts first, splitting types at
the widest drops in box area: the large types nest alone, each of their
sheets is repacked with every waiting small part (keeping all its large
parts), and leftovers get new sheets. The cheapest whole job wins; ties
keep the cost-first run. The braze casing takes 27 sheets and 203,616
sq in, every sheet but the last a plate with small parts in its gaps.
Problem-nest corpus (auto-nest): all saved layouts unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A part a single tab could hold level kept its outside entry to the points
where the tab steadied it, so the head detoured to them and often left the
part back over itself. Tabs hold most parts wherever they land, a part whose
tab does not is still tabbed and avoided once cut, and the detour costs
every part. Every support-tabbed perimeter now offers each entry clear of
inside corners (plus its best tab point), ranked toward the next cut like an
untabbed part's. Only when none of those fits a lead-in does the search fall
back to every entry, steadiest first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Long holed strips on a support grid were entered mid-length, and those
resting on a line of contacts beside their center of gravity on the far
side, so the head left back over the strip. Four causes:
- A support tab that cannot hold a part level still led its entries with
the steadiest point. No such entry steadies the part enough to be worth
a detour, so every entry clear of inside corners now ranks toward the
next cut, as for an untabbed part. The part is still tabbed and still
avoided once cut.
- A next part level with this one's center faced the bottom by rounding.
A level target now faces neither side on that axis.
- The tab-retention check measured a lead-in against the start tangent,
so a straight in-line corner lead-in on a tabbed outside, which runs
back off the part while the gap lies along the other edge, was refused
at every corner. A part's only open cut now measures toward its gap.
Cutouts cut in pieces keep the old rule.
- Travel measured from before the part, not from its cutouts.
A holed part now tries first the outside entry where the straight line
from its cutouts to the next part's leaves it: the shortest way between
them. The search and contour recovery both lead with it; every check
still applies.
The problem-nest corpus ranks no plate below its baseline, and none at
80% of its budget; five ConstraintConflict plates now plan BestEffort.
Five planning fingerprints change, all still Ready: rapid travel drops
14-17% on four and rises 0.5% on mixed-irregular. A kept-order replan
after a cut-off segment may now find a shorter route than the plan, so
that test checks the route is no longer rather than identical.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whole jobs placed by the fill strategies could put parts on a clamp
keep-out in three ways:
- A best-fit pair left flush on a keep-out was compacted with the clamp
obstacles held at the part spacing, so it already read as inside that
spacing; the push ignores contacts that already overlap and carried
the pair through the clamp to the sheet edge. CompactPair now holds
clamps at zero spacing, as the settle does.
- The pack area was narrowed to a clamp-free remnant only after a fill
had placed parts. With nothing filled the leftovers were packed across
the whole sheet, clamps included. They now get the same remnant.
- A rail with zero clearance left placement no margin over the
validator's keep-out, whose outlines are rounded to a 0.0001 grid, so
a flush edge could read as inside the zone. Placement keep-outs now
grow by at least the spacing slack (0.0005). The expand-spacing walls
keep the exact clamp clearance (WallRectangles).
No tolerance or validator changed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Lattice and the two Remnant strategies packed only items that were never
filled, into one remnant, and dropped whatever a fill left of its own
item. The fills see each earlier fill as one envelope, so a part's box
can still fit between the parts of the finished layout, and the one
remnant the pack tried is often a sliver that holds nothing.
After the pack-first or pairs-first step and before the settle, every
item with demand left is now offered to the remnants of the whole work
area through LeftoverPacker, clamp keep-outs counted as occupied. The
earlier steps are untouched, so a nest with nothing unplaced comes out
as before.
Three pinned nests gained parts and none lost one: mixed Fill 34 to 35,
mixed Horizontal Remnant 30 to 35, learned-angle Horizontal Remnant 24
to 26.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Linear fill finds how far a pattern's next copy must sit by sliding each
part of the copy against the parts of the pattern, and it skipped every
pair whose bounding boxes do not overlap across the slide. A part whose
box lies beside the copy's path by less than the part spacing was never
measured, so the copy could pass it closer than the spacing: columns of
a gusset pair tiled 0.04 apart (the pattern Irregular's band search had
to reject), and an Extents column pair of D-shapes 0.01 apart.
The copy distance now skips a pair only when the boxes are beside each
other by the spacing or more. A part beside the path moves the copy only
when it needs more than Epsilon beyond what the parts in the path need,
so a corner-to-corner contact at the same distance leaves layouts as
they were.
The Strip strategy's mixed pinned nest then filled a valid, denser row
of D-shapes and lost its single rectangle: the pack step tried only the
first remnant, now a sliver along the top edge. Strip offers its
leftovers to the remnants in order instead (LeftoverPacker), packs the
first that takes a part, finds the remnants again and stops when none
takes one. The nest holds 35 parts again, and the whole-plate
characterization nests are now validated as they are solved.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A Vertical or Horizontal Remnant fill of a quantity of round parts left
a deep remnant on the table: twelve 8 in. flanges took 25.6 in. of a
60 in. sheet's length and stopped 16 in. short of its far edge, where
two full-height columns need 15.1 in. Three causes:
- The low-quantity shrink scaled both sides, so stripes could not span
the side the remnant runs along. It now narrows only the trimmed axis.
- The ranking compared untrimmed counts, so the full-sheet layout always
beat the full-height columns and was then trimmed. It now ranks the
layout as it will be kept.
- The trim kept overlapping bounding boxes as interlocked pairs, which
staggered discs always are. Discs are now trimmed one by one.
The circle strategy also offers each stagger mode's stripes in both
directions to a remnant ranking. Every change is limited to remnant
fills of round parts: applied to other shapes, the trimmed ranking let
a tilted bar layout block the rest of a nest, and the disc trim moved
the Irregular engine's sample layout, so every other fill is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
FrontierPacker.Fill was one 165-line method: three local functions
(Track, Block, PrepareBlocks) closed over nine variables of the fill in
progress, the seated-parts pass repeated Block's parallel loop inline,
and the placement loop carried its retirement rules between them.
Choose kept its leader in seven loose variables behind a local function,
and BestVertex took twelve parameters, four of them outs that every
TryLowest threaded back out. Every pass of the engine goes through this
class, so the next change to the placement rule had to be made inside
all of that.
Fill now reads as its steps: TrackDemand, Seat, PrepareBlocks, then
Choose and Place until nothing fits. The fill in progress is a Sheet
(copies left, regions, pairs, blocks, parts placed, front) passed to
each step, the leader of a choice is a Leader that Consider updates, and
a candidate's point and scores travel as one Spot, with the inner-fit
box and the piece's box as Extents. The repeated expressions have one
definition each: the part's reach along the front axis, a region losing
what a part blocks, the parallel blocking pass, the two retirements of
emptied regions and pairs, and the "lower across, then lower leading
edge" tie-break shared by Choose and BestVertex. The tolerances and the
block limits (two preparations per fill, four types, three copies) are
named constants. PackAxis, Placed and SheetFill, which the whole engine
uses, have their own files.
The constructor keeps its shape: most call sites name its optional
arguments already. The two that passed positional nulls now name them.
No layout changes, and no change to the order work is metered or to the
parallel passes: a placement still blocks one pass per part. Traced
before and after: every progress report, plan, alternative, repeat
batch, tail re-plan (with its work-meter reading) and final result of
70 solves (one to three stocks, mixed spacings, finite stock, a sheet
cap, priorities, explicit costs with salvage and both offcut axes, clamp
rails, outlined sheets, oversize parts, all four quadrants, grouped and
banded jobs, four engine settings, seven searches until cancelled), the
poses and work-meter reading of 2,298 direct Fill calls (pairs, blocks,
type weights, group ranks, reach, within, seated parts, a starting
front, clamps, outline and cutout boundaries with obstacles, pair-only
orientations), and six cutout proposals. The traces are byte-identical.
Engine suite and the problem-nest corpus's auto-nest area pass.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
IrregularNestingEngine.cs was one 1,000-line file: Solve ran its nine
passes inline over 135 lines, each repeating the same "decode, report
the alternatives, take the plan if it beats the best, re-plan its tail,
report again" by hand; the nested Solver took eleven constructor
arguments and held the decode, the banded sheet, three plan-improvement
passes and the per-stock caches together; and Decode was a single
135-line loop threading ten parameters. The next pass or decode rule had
to be added inside all of that.
Solve now reads as the list of passes. A Search holds the best plan and
the reporting, so each pass is a short method (QuickPlan,
StrategyVariants, GroupedVariants, BandedVariant, ReduceSheets,
SqueezeLastSheet, SeededVariants) over three shared steps (Offer, Adopt,
Replace). The Solver takes the engine instead of its settings one by
one, and is split in two files: decoding a strategy into a plan
(TrySheets, FillSheet, Choose, PassedOver, Copies) and improving a plan
already made (ImproveTail/ReplanTail, ReduceSheets/OnOneSheetFewer/
PackEdgeFirst, Squeeze). A decode's front direction, exponent, weights
and sheet rule travel as one Strategy rather than five arguments, with
the grouped/banded flag pair as a SheetRule. Plan, Run, Trial and the
sheet costing have their own file, as does WorkCounter.
The test hooks build their solver as Solve does, so they now also pass
on TailReplanning and PruneStockTrials; no test sets either on a hook.
No layout changes. Every progress report, plan, alternative, repeat
batch, tail re-plan (with its work-meter reading) and final result was
traced before and after on 96 solves: 26 jobs (one to three stocks,
finite stock, a sheet cap, priorities, explicit costs with salvage,
clamp rail, outlined sheets, oversize parts, mixed spacings), six engine
settings, ten searches until cancelled and the plan and quick-plan
hooks. The traces are byte-identical. Engine suite and the problem-nest
corpus's auto-nest area pass.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
BandedFill.FillStrips was one 135-line method: the beam loop, the
look-ahead for band searches, the strip offers (a local function closing
over eight variables) and the beam selection all ran together, and Fill
carried its order search and hold-back pass inline the same way. The
next change to either pass had to be made inside that.
Each step is now its own method (BestOrder, HoldBack, NextStrips, Strip,
Densest, SearchesAhead, ColumnWidths, Finish), the work area and part
spacing are fields rather than a parameter threaded through every call,
the repeated "largest part left", "packer behind the strip" and
"full-height bands" expressions have one definition each, and the
tolerances and the three-copy column limit are named constants.
No layout changes. Every BandedFill result (poses and work-meter reading
after each call) was traced before and after on six jobs covering the
bands, strips and beam-of-one paths, with and without a clamp rail, one
to four sheets: the traces and the final layouts are byte-identical.
Engine suite and the problem-nest corpus's auto-nest area pass.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
On a sheet with a custom outline the plate edge review, Auto Nest's layout
check and the runner's candidate validation tested the part's spacing
outline against the usable area. That outline circumscribes arcs by up to
0.001, more than any of their slacks, so a disc whose true bounds rest on
the work-area edge read as inside the outline's edge spacing (or off the
plate at zero spacing) while the same disc on a rectangular sheet, judged
on its true bounds, was clean.
The outline test now works as the part-spacing check does: the spacing
outline finds the candidates and a failure is confirmed on the part's
native contour (NativeContours.Region: arcs circumscribed at 0.000025 and
clipped to the perimeter's true bounds). Both regions contain the material,
so a part past the usable edge by more than the slack still fails; no slack
changed. The runner now calls the layout check's own outline test
(NestLayoutCheck.InsideOutline): its separately flattened candidate could
accept a pose on a slanted edge that the layout check then rejected.
Pushes on an outlined sheet measured the same circumscribed perimeter so a
part would rest where the review passed, and box pushes stopped 0.0012
short of a wall for it. With the review confirming on native contours they
slide the material's own lines and arcs, so a round part rests on a wall
exactly as on the plate edge, and a box push rests the box on the wall.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The frontier rule lets the sheet state pick the next part and sends
small parts first, so a part as long as the layout can end up behind
them and set the sheet's length. On N26-2CJ (two 55" plates, rings,
sectors, an arc and strips on 48 x 96) Auto Nest ended at 75.2" where
the hand layout, both plates stacked along one edge, ends at 63.5".
After the search, pack the last sheet's parts again in a given order,
largest first, each at the lowest point across a strip that ends short
of where they reach now, and search the order (single-part moves, then
seeded swaps) for one that fits them all. Each strip that takes them
is followed by a shorter one. Parts that may turn freely are also
offered every 30 degrees. Work is counted, the seed is fixed, and the
squeezed sheet replaces the plan's only when the plan then ranks
better. N26-2CJ now ends at 62.1", leaving 33.4 x 47.5 against
20.3 x 47.5.
A search over few parts runs out of new orders, and decodes it has
already made cost no work, so it also ends after a run of rounds that
place nothing new, and its per-strip budget shrinks with the part
count.
CurvedPartsClearEveryInflatedClampInEveryQuadrant asked for a disc on
the sheet edge between the clamps. The squeezed sheet is 0.1" shorter
with that disc wedged on a clamp's corner, so the test now asks for a
disc below the clamps' tops.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A concave no-fit polygon is the union of the convex sums of every pair
of pieces of the two footprints. One Clipper union of all of them meets
each overlap of each pair of sums, on the order of (p*q)^2 pairs: two
line-only arc outlines of 150 vertices took minutes, and an eleven-part
job of rings, sectors and an arc spent 110 s of its Irregular solve
there.
Union the sums of each piece of the moving footprint first, then merge
those results in neighboring pairs. The same job solves in 3.3 s with
the same layout, and the benchmark jobs keep their placements.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A plate with a custom outline was pushed against its bounding box only, so
a part pushed toward a missing corner ran through it to the box edge and
ended off the sheet. Compactor's plate pushes (Push, PushBoundingBox,
SettlePlacement, Settle) now also stop at the walls of the outline: the
part of the work area that is not usable material (a missing corner, an
obstacle, each grown by the largest edge spacing). A mover is measured as
the edge review measures it, by the circumscribed perimeter of its clean
material without leads, so it rests where that review still passes. A box
push stops 0.0012 short of a wall so the geometry push after it starts
clear. A rectangular sheet has no walls and pushes exactly as before.
SheetOutline.FromGeometry eroded the whole imported outline by the chord
tolerance, so a sheet drawn 60 x 27 was stored as 59.998 x 26.998 with a
chamfer at every inside corner. Each arc is now chorded on the side that
takes material away (ClipperBridge.FlattenOneSided) and straight edges are
kept exactly. The plate header, the plate list and Edit Plate's outline
size show the size rounded to four decimals instead of the raw double.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Bands were always the full work-area height and placed flush to the
bottom or top edge. On N26-2HH (20 + 20 formed legs, 60 x 120, bottom
clamp rail) the larger leg's full-height band had less slack than the
rail's depth, so three copies dropped to the gap fill and Auto Nest
ended at 104.71 against a hand layout at 104.0.
Each type now also offers up to three lower bands, each asked for just
short of the last band's height and searched over three lengths, which
leave a strip along the sheet for the remaining parts. A band that would
lose members to clamps also tries the top edge and just past the clamps
lining either edge (ClampObstacles.ClearOfEdges, moved out of
EdgeFirstFill). N26-2HH now ends at 103.87; the README sample, help
tutorial and N26-2GT layouts are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stock-trial pruning in tail re-plans now starts only once the block budget
is spent. Before that, a skipped trial left a Lattice block attempt and its
work unspent, so a later trial could prepare a block it was refused before
and the decode could choose differently.
The quick plan no longer demotes the normal search's plans to
alternatives. The deadline wrapper, the only caller that enables
SearchUntilCancelled, already keeps the best reported plan that passes the
layout check, so a quick plan that failed the check could have hidden
valid plans. The docs drop the measured timings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tail re-plan's decode no longer packs a stock whose least possible net
cost (the whole sheet, less full salvage credit) already exceeds the best
estimate so far and whose cost ratio over the remaining part area cannot
beat the best so far. Later trials only lower the ratio and the estimates,
so the skipped trial could neither be chosen nor change the choice.
On N26-2GT this skips ~60% of the tail re-plans' trials, a fifth of the
ungrouped search's packing time. Layouts and reported plans are unchanged
on every unlimited benchmark job and on the N26-2GT and readme-mixed
oracles; first-nest's unlimited Irregular solve ran in 75 s rather than
100 s. Whole-job variants still pack every trial, since a skipped stock
may have finished the job.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A solve that can end only at its limit (SearchUntilCancelled, a cancellable
token and a listener) now decodes the first variant once without Lattice
blocks before its normal search and reports it. Block preparation for each
stock trial of the first sheet takes most of the first decode on big jobs:
on N26-2GT Default showed Irregular's first plan after ~29 s, now ~5 s.
The quick decode runs on its own work meter and shares only job-determined
caches, so the normal search decides as before; until one of its plans beats
the quick plan, they are reported as alternatives. Unlimited solves never
make a quick plan, so their results and reports are unchanged.
Co-Authored-By: Claude Opus 5.5 <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>
FillLinear.FillDeferred returns a grid whose final overlap check has not
run; Resolve runs it and returns exactly what Fill returns, and Fill is
FillDeferred(...).Resolve(). PairFiller sorts a candidate's grids with
CompareByCount, which answers from the counts a pending grid can still
have (its tiling or its bounding-box fallback) and runs the check only
when they could order the pair differently; the early abort and the
remnant pass resolve the grids they use. Every answer equals the checked
comparison, so List.Sort makes the same moves, ties included, and
layouts are bit-identical. A check that throws during the sort surfaces
unwrapped. On the bracket fill this skips about 35% of the pair grids'
final checks by work.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Row and Column strategies converge identical stripe layouts (both lay
rows along both axes), every pair remnant strip along a full side of the
work area repeats the Row strategy's spans, and the expanding and
shrinking variants revisit each other's angles, often cycling between
two. StripeConvergenceCache, kept in the pipeline's shared state and
handed to the pair remnant strips, stores each convergence, the pair's
turned bounds and each estimate row by angle; one thread tiles a row
while others wait. Every value is a pure function of its key, so layouts
are bit-identical. On a 30-copy fill of an 80-vertex bracket this cut
estimate-row tilings from 3,226 to 560.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A multi-part pattern tiles from the work area's leading edge, so the copy
before the first one never fits whole. When the tiling leaves room at its
far end, FillLinear now moves it forward by the smallest shift that fits
the most parts of that previous copy and adds them. On an arch/cup
herringbone this fits the cup row under the first arch row: 121 -> 132.
Comparisons against the frozen fillers turn the new step off through an
internal LeadingParts flag and check the default fill separately.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ctrl+F while pasting one common-line group fills the area with the group's
single merged outline as one part, then turns each placed copy back into its
parts joined at the source kerf. The old pattern fill tiled the members as
loose parts, added lone parts and joined nothing.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A tabbed part stays in the sheet, so rapids were free to pass over it and
the planner never looked for a way around. Plan Cutting now searches first
with every tabbed outside as an obstacle once its part is cut. Where a pass
stalls at a part whose approach crosses a tabbed part, only the crossed
parts become crossable and the search goes on along the same order. A
capture that search cannot plan is planned as before. Plates without
tabbed outsides are searched once, unchanged.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The spiral packed its four blocks tight to the bin origin, so a center gap
just short of a part stayed empty while slack sat at the far edges. Move
the far blocks (Q3/Q4 along X, Q2/Q4 along Y) into that slack, only as far
as the best center count needs; with no gain they stay put. Combination
selection counts the spread center too.
An 11.8 x 3.8 rectangle on a 60 x 120 sheet above the clamp rails goes from
134 to 135 parts. The 12 x 6.1 clamp case now fills the clamp-free strip
with 83 parts (was 82 beside the clamps), so the dropped-clamp gap-fill
test moves to 15 x 7 parts, where the gap fill still adds one (57 -> 58).
The mixed-items Vertical Remnant layout keeps its 35 parts with a new
digest: the full-sheet fill is trimmed to demand afterward, so its notched
parts now take the spread spiral.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5776fa80 dropped a tabbed outside's lead-out when it would reach the lead-in,
which silently changed the user's cutting settings. The emitter now keeps the
lead-out as configured again. Plan Cutting plans strictly first, as before;
only when that is refused because such a lead-out may cut its tab free does it
plan again keeping the lead-outs. Each affected part gets a "Tab lead-out"
issue (new PostVerificationKind.TabLeadOut), is treated as cut free for later
rapids, and the plan is UNVERIFIED, so applying it needs explicit acceptance.
The short reorder pass never settles for such a plan, so a clean route still
wins. Locked, fixed and posted programs keep the incomplete-check finding.
The "no single tab can steady it" support warnings caused more trouble than
they solved, so a tabbed part now counts as steady wherever its tab is: Plan
Cutting and the pre-post review warn only about a part cut with no tab at
all, and a tabbed part stays crossable once cut instead of being avoided as
one that may tip. Entry choice still prefers the steadiest tab point.
The problem-nest corpus is unchanged except N26-2AM, whose baseline is now
BestEffort with 15 tab lead-out warnings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gap pass only fills around the parts a clamped fill keeps, so a row
laid on the clamp-blind grid can still waste most of each space between
two clamps. Also take the clamped edge's row out and refill it slot by
slot, one slot between each pair of clamp keep-outs and one past each
end, each reaching the next part at the part spacing, then fill any gaps
left. Slots never overlap, so a wide rectangle above the clamps cannot
take a slot's space first. The repacked row is kept only when it places
more parts than gap-filling alone.
On a 120 x 60 sheet of 3.8 x 11.8 parts with front clamps at 20/40/60/80,
the clamped layout goes from 129 to 131 parts (the lifted layout's 134
still wins there).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A clamped fill lays parts out as if the clamps were absent and drops the
ones that hit a clamp, which can leave room for a part between two clamps
or beside one. After dropping, fill each clear rectangle the part fits
with the remaining demand, certified like the main fill, and report the
gap-filled layout as a preview. Existing parts never move.
On a 120 x 60 sheet with front clamps at 20/40/60/80, the dropped layout
of 12 x 6 parts goes from 81 to 82 parts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Irregular picks each sheet's stock on an estimate of what the leftovers
will cost, so a size that took every remaining part could lose the pick
to a plan that ended up dearer, and its trial sheet was thrown away.
Each pass now keeps those finished plans: one that beats the pass's own
plan replaces it, and the rest are reported as alternatives (at most six
a pass). No extra sheets are packed.
The progress window's layout families now include the sheet sizes, so a
one-sheet 60 x 120 layout is offered beside a one-sheet 48 x 144 best
instead of being dropped as a near copy.
With 48 x 96, 48 x 144 and 60 x 120 offered, the seven sample parts (130
copies) still take one 48 x 144 sheet and now end at 130.7" instead of
136.6"; the tutorial and synthetic nests are unchanged.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The Auto Nest progress window lists up to three whole-job layouts as
cards, the engine's best first and then the best of each other family
(sheet count and free-strip direction). Every sheet shows the distance
from its parts to the right edge (vertical strips) or the top
(horizontal strips), dimensioned on the sheet. Any card can be used:
during the search it stops it, and a finished search with more than one
layout waits for the pick. The layout used is validated and bound like
the engine's own result.
Engines may report plans that lost to their best as
NestJobStage.PlanAlternative; Irregular, Default and the time-limited
solve do. Reporting never changes a layout.
Co-Authored-By: Claude Fable 5.2 <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>
A sheet that cannot take all the remaining parts now keeps whichever
places more part area: the ordinary fill or strips largest part first.
The ordinary fill spent skinny parts early because they cover the most
area per length, leaving awkward ones for a ragged last sheet.
Inside a strip, the strip's own part fills its column first and the
others fill around it; before, pairs of smaller parts (counted as twice
a part's area) took the strip and the large part lost it. Bands also try
largest part first as a third order.
At about twice the README sample quantities the second sheet ends at
99.9" instead of 106.2" on master (104.7" before this change), and the
help tutorial's parts at 33.6" instead of 34.9". Every other benchmark
job is unchanged or better; mixed jobs solve about two to three times
slower than master.
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>
The pair search slid part 2 in from offsets on a 0.25 step grid, so a pair
that locks in a corner (two interlocking channels) stopped up to a step short
of the tightest fit. Each resting position is now also slid sideways, both
ways, and the new resting positions join the candidates.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The coarse bounding-box pass only stopped at obstacles whose box lay in
the push path, so a copy could drop past a neighbor beside the path and
end inside its spacing. A box push now also stops at an obstacle nearer
than the spacing to the side of the path.
A push ignores a part the copy starts on, so a settle could slide out of
that part and stop clear of it yet inside its spacing. SettlePlacement
now prefers a push order that keeps the part spacing, and a named order
that ends too close falls back to the other order.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
On an enclosed machine a cutout slug that tips once cut free can stand up
above the sheet and catch the enclosure door when the pallet changes. The
head already keeps off cut cutouts, so this is about clearing the door, not
the head.
Cutting Settings > Cutouts > "Slice slugs the support grid can't hold
level" (CuttingParameters.SliceTippingSlugs, off by default, saved per
machine thickness and written only when on) makes Plan Cutting cut each
such slug along the bed's contact lines (grid rows and columns, slat center
lines) before the cutout, so no piece keeps a contact and the pieces drop
between the supports. Each slice stops a kerf short of the cutout, so the
pieces stay attached until the cutout's own kerf frees them together. A
slug the bed holds level, or one on no contact, is left whole; a cutout
holding another part or another of its part's cuts is never sliced.
Slices are break cuts emitted right after the drawing's own break cuts,
pierced on themselves and led straight back to their start. The
released-contour proof now leaves out straight break cuts lying wholly
inside one of the part's closed holes, since the grid cells they free are
scrap; break cuts in material still take part. The plan fingerprint only
changes when the setting is on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shift+click in Clone Parts always kept whichever axis order landed the
copy nearest the origin, which can park it in a pocket the user didn't
want. Options > Clone push placement now picks Closest to origin (the old
behavior, still the default), Push left then down, or Push down then left.
Ctrl+click settles the copy on bounding boxes alone, so it stops square
to its neighbors' boxes instead of nesting into their shapes. Shift+click
keeps its box pass then geometry settle; both follow the chosen order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One Irregular decode of a small job took seconds because each block in the
catalog is built by the full Fill pipeline (PrivatePlateFill), and inside it
StripeFiller's estimate rows spent about 85% of the CPU in FillLinear's
perpendicular TilePattern. A stripe estimate is exactly one pattern tall, so
the pattern's copy distance, an all-pairs slide search, always exceeded the
room left and the copies were discarded after the search had run in full.
TilePattern now passes FindPatternCopyDistance the largest distance that
could still place a copy: for a whole copy, the room past the pattern; for a
pattern that may tile partially, the most room past any one of its parts. The distance
is the maximum over every pair, so the search stops as soon as it passes that
bound and the tile returns empty, which is what the full search led to. The
public CopyDistance is unchanged. StripeFiller's angle searches also reuse
each rotated pattern's bounding box per angle instead of cloning and
rotating the parts again on every probe.
Output is identical: the layouts of every benchmark job that finishes match
the previous build. Measured A/B on this machine, alternating builds per job
(Benchmark --engines Irregular --parallel 1, benchmark ms):
- N26-2A5: 15.5 s -> 8.8 s (12.6 s -> ~7.2 s in quieter runs)
- 73 of the 80 bench jobs (the other 7 time out at 5 minutes in both
builds): 1,990 s -> 1,578 s total (-21%), process CPU 6,486 s -> 3,842 s
(-41%), median job 0.91x. N26-295 now finishes in 242 s with the same
layout where it hit the 5-minute limit before.
- Problem-nest corpus auto-nest and fill areas: all at baseline.
A parallel herringbone pair build was tried and dropped: it saved 1.2 s on
N26-2A5 but cost 10 s and 45 s more CPU on P241017-01.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a plate packed edge to edge, an overlap left by hand-placing extra
parts could not be fixed: straight push chains ran into the edge and
the relaxation gave up on pairs that share material, which have no
contact normal. The relaxation now pushes such a pair along its
shortest straight way out and lets the rest settle, which cleared a
0.92 sq in overlap on a 38-part plate with every part kept square.
When moves alone still cannot settle, the relaxation runs again as a
rigid one: an off-center push also turns a part, up to 3 degrees, if
its drawing is free to rotate. Moves stay first because a tilt turns
every part the push reaches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Expand Spacing opens up a whole selection; nests that are a hair short
of fitting need the opposite: move only the parts the overlap check
flags, by the shortfall, and leave everything else where it is.
Fix Spacing pushes one part of each flagged pair straight away from the
other and ripples the push into neighbors it crowds, so rows already
locked in at the spacing can make room. When a plate is packed edge to
edge and no straight push fits, a constraint relaxation shares each
shortfall between both parts along the closest-point normal. Every
result is confirmed by the overlap check before any part moves, and is
applied only when it has fewer findings and nothing new.
NativeContours gains a coarse-flattening overload, Translated, Nested
and a closest-points GapTo for the search.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Auto Nest left N26-2A5 (14 door stops, 14 lock plates on a clamped 26x26
sheet) 8.0 high, while the shop's hand layout holds all 28 under 7.5 and
leaves a half-inch-deeper drop. Every MaxRects fit rule packs into the
whole sheet, so with room to spare it spreads the parts out and never
looks for the shortest strip.
When a rule places all the remaining demand, Rectangles now repacks it
into shorter and narrower bins, every rule and mode per probe, and offers
the tightest complete layout per axis to the stock loop, which still
picks by cost and offcut. Fit is not monotonic in bin size (7.5 packs,
7.62 and 7.74 do not), so probes walk down through stack heights (sums of
spaced part sides from the bin edge or a reached clamp) instead of
bisecting. A placement budget skips sheets finishing ~2000+ parts.
Benchmark, Rectangles on 80 recent production nests with salvage credit:
11 cheaper, 0 worse, all valid, total time 14.7 s -> 13.2 s.
The zero-clamp hash is re-captured (the squeezed layout is narrower);
the far-clamp test now compares poses, since the clamp can reorder an
identical layout.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Strip whole-job engine laid its strips, settled them and picked its pack
remnant from the bare work area, never adding the plate's clamp keep-outs the
Lattice orchestration uses. On a clamped sheet it put parts over the clamp, the
runner's layout check rejected the candidate, and Strip produced nothing (N26-2A5
rev 5: door stop at (21.09,1.50) over clamp-1).
NestStrips now treats InteractiveClamps.ClearanceRectangles as occupied space for
the iterative shrink strips (through RemnantFiller), settles with the clamp
obstacles when there are zones, and finds the pack remnant around them even
before any strip is placed. Unclamped plates take the old path unchanged.
A FixedStrategyNestingEngine theory runs all four fixed strategies on a clamped
26 x 26 sheet; only Strip failed it before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>