@mark1russell7/layout-contract 0.9.5 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,13 +31,16 @@ The package has one runtime dependency: `@mark1russell7/rigor-generators`, the h
31
31
  | The space functions | `checkSpace`, `checkConfig`, `canonicalConfig`, `configId`, `spaceSize`, `spaceShapeKinds`, `paramLevels`, `enumerateSpace`, `productSpace`, `joinConfigs`, `splitConfig`, `SpaceSize`, `SpaceSizeOptions`, `EnumerateOptions`, `GridOptions`, `SampleOptions` |
32
32
  | The option declarations | `OptionSchema`, `OptionDeclaration`, `AnyOption`, `NumberOption`, `BooleanOption`, `EnumOption`, `ValueOption`, `ListItem`, `NoDefault`, `DeclaredStrategy`, `listOptions`, `optionDefaults`, `checkOptions`, `clampOptions`, `sweepValues`, `sweepOf`, `sweepGrid`, `checkSchema` |
33
33
  | The strategy catalog | `StrategyCatalog`, `StrategyCatalogSource`, `CatalogEntry`, `ParamRoute`, `StrategyMember`, `CatalogLimit`, `OutputRow`, `OutputEvidence`, `OutputGridClass`, `OutputGridCounts`, `StrategyCatalogSchema`, `STRATEGY_CATALOG_SCHEMA`, `STRATEGY_CATALOG_SCHEMAS`, `OUTPUT_GRID_PROPERTIES`, `OUTPUT_NEAR_WHOLE`, `OUTPUT_CLASS_MIN_INPUTS`, `NODE_POSITIONS_DIMENSION`, `outputGridClass`, `parseStrategyCatalog`, `writeStrategyCatalog`, `checkCatalog`, `catalogDefaults`, `catalogOptions`, `catalogChoices`, `catalogKey`, `decodeOptionValue`, `encodeOptionValue` |
34
- | The turn | `turnBox`, `turnPort`, `turnMargin`, `turnRegion`, `turnSide`, `turnPoint` |
34
+ | The turn | `turnBox`, `turnPort`, `turnMargin`, `turnRegion`, `turnResize`, `turnSide`, `turnPoint` |
35
+ | The resize | `Resize`, `SizeBounds`, `sizeBoundsOf`, `sizeFits`, `resizeBox`, `resizeProblems`, `countResizeBreaks` |
35
36
  | The tolerances | `EPS`, `EPS_STEPS`, `RECORD_EPS`, `RECORD_SCALE`, `Tolerance`, `DEFAULT_TOLERANCE` |
36
- | The hard rules | `HARD_RULE_VERSION`, `shapesOverlap`, `circleOverlaps`, `circlesOutside`, `placedCircle`, `PlacedCircle`, `segmentThroughShape`, `countLinksThroughShapes`, `ShapeLink`, `countOverlaps`, `countObstacleHits`, `regionHitsRect`, `rectInRegion`, `countOutside`, `ContainerTest`, `countPortsOffBorder`, `packHard`, `PackHard`, `PACK_HARD_RULES`, `placedRect`, `checkInput` |
37
+ | The hard rules | `HARD_RULE_VERSION`, `shapesOverlap`, `circleOverlaps`, `circlesOutside`, `placedCircle`, `PlacedCircle`, `segmentThroughShape`, `countLinksThroughShapes`, `ShapeLink`, `countOverlaps`, `countObstacleHits`, `regionHitsRect`, `rectInRegion`, `countOutside`, `ContainerTest`, `countPortsOffBorder`, `packHard`, `PackHard`, `PACK_HARD_RULES`, `countResizeBreaks`, `placedRect`, `checkInput` |
37
38
 
38
39
  ## The rules
39
40
 
40
41
  - **The turn.** A turn is 90 degrees clockwise, with the y axis down. A point (`px`, `py`) of a box of height `h` goes to (`h - py`, `px`). Each side moves one step clockwise. The router gets the turned box and ports, and does not read `turn`.
42
+ - **The resize.** A box with `resize` can get another size from the packer, in its bounds. A bound that the resize does not set is the size of the box. The placement gives the size after the turn in `w` and `h`, and `applyPack` gives the box that size. A port with `x` or `y` moves with the scale, and a port with `along` keeps its place. Only a `rect` box without a shape can have a resize (`checkInput`).
43
+ - **The rule `size-kept`.** It counts each placement with a size outside the bounds of its box. `packHard` gives it only for an input with a resize or an output with a size. Thus the counts of the other inputs do not change.
41
44
  - **The margin.** A margin is a ring around a box. No other box and no route enters it. A route from a port of the box crosses the ring at a right angle.
42
45
  - **The gap.** The gap is the free space between two boxes with their margins. Routes use it. Two boxes are `mA + gap + mB` apart.
43
46
  - **The pair gaps.** `pairGaps` gives a minimum distance to some pairs of boxes: `{ a, b, gap, lanes? }`. For its pair, the `gap` of an entry replaces `mA + gap + mB`.
package/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as CorpusSplit, A as shapeKindsOf, At as grow, B as LayoutInput, Bt as toRect, C as checkShapes, Ct as Side, D as ruleLevel, Dt as boxCenterDistance, E as itemShapeOf, Et as boundsOf, F as LayoutBox, Ft as pointSegmentDistance, G as PairGap, H as PackInput, Ht as translate, I as LayoutCell, It as regionArea, J as packLinks, K as Port, L as LayoutContainer, Lt as scaleRect, M as shapeSupportProblems, Mt as overlapOf, N as shapesOf, Nt as pointInRing, O as shapeKindOf, Ot as crossingPoint, P as Item, Pt as pointInRings, Q as CorpusEntry, R as LayoutEdge, Rt as segmentsCross, S as boxArea, St as SIDES, T as isShapeKind, Tt as SizedRect, U as PackInputOptions, V as Obstacle, Vt as toSizedRect, W as PackLink, X as toPackInput, Y as portPoint, Z as ClaimBreak, _ as ShapeKind, _t as Margin, a as MeasureSpec, at as SPLIT_SCHEMA, b as ShapeLimit, bt as Region, c as minEffectOf, ct as checkDeclared, d as SHAPE_KINDS, dt as declaredClaimOf, et as DeclaredClaim, f as SHAPE_KIND_IDS, ft as declaredCounts, g as ShapeInput, gt as splitFolds, h as ShapeGeometry, ht as splitFileName, i as JointMeasureId, it as FamilyCell, j as shapeLevel, jt as marginSides, k as shapeKindProblem, kt as dropIndex, l as DEFAULT_SHAPES, lt as checkSplit, m as ShapeCheck, mt as leaveOneSeedOut, n as JOINT_MEASURES, nt as FAMILY_ANY_KIND, o as Verdict, ot as SplitCorpus, p as ShapeBound, pt as familyOf, q as canonicalInput, r as JOINT_MOVED_MIN, rt as FamilyBy, s as compareMeasure, st as SplitFold, t as Direction, tt as Declares, u as RuleLevel, ut as corpusHashOf, v as ShapeKindSpec, vt as Point, w as inputShapeLevel, wt as Sides, x as ShapeSupport, xt as Ring, y as ShapeLevel, yt as Rect, z as LayoutGenerator, zt as snapRect } from "./measures-D5hOVn9j.js";
1
+ import { $ as CorpusEntry, A as shapeKindsOf, At as dropIndex, B as LayoutInput, Bt as snapRect, C as checkShapes, Ct as SIDES, D as ruleLevel, Dt as boundsOf, E as itemShapeOf, Et as SizedRect, F as LayoutBox, Ft as pointInRings, G as PairGap, H as PackInput, Ht as toSizedRect, I as LayoutCell, It as pointSegmentDistance, J as canonicalInput, K as Port, L as LayoutContainer, Lt as regionArea, M as shapeSupportProblems, Mt as marginSides, N as shapesOf, Nt as overlapOf, O as shapeKindOf, Ot as boxCenterDistance, P as Item, Pt as pointInRing, Q as ClaimBreak, R as LayoutEdge, Rt as scaleRect, S as boxArea, St as Ring, T as isShapeKind, Tt as Sides, U as PackInputOptions, Ut as translate, V as Obstacle, Vt as toRect, W as PackLink, X as portPoint, Y as packLinks, Z as toPackInput, _ as ShapeKind, _t as splitFolds, a as MeasureSpec, at as FamilyCell, b as ShapeLimit, bt as Rect, c as minEffectOf, ct as SplitFold, d as SHAPE_KINDS, dt as corpusHashOf, et as CorpusSplit, f as SHAPE_KIND_IDS, ft as declaredClaimOf, g as ShapeInput, gt as splitFileName, h as ShapeGeometry, ht as leaveOneSeedOut, i as JointMeasureId, it as FamilyBy, j as shapeLevel, jt as grow, k as shapeKindProblem, kt as crossingPoint, l as DEFAULT_SHAPES, lt as checkDeclared, m as ShapeCheck, mt as familyOf, n as JOINT_MEASURES, nt as Declares, o as Verdict, ot as SPLIT_SCHEMA, p as ShapeBound, pt as declaredCounts, q as Resize, r as JOINT_MOVED_MIN, rt as FAMILY_ANY_KIND, s as compareMeasure, st as SplitCorpus, t as Direction, tt as DeclaredClaim, u as RuleLevel, ut as checkSplit, v as ShapeKindSpec, vt as Margin, w as inputShapeLevel, wt as Side, x as ShapeSupport, xt as Region, y as ShapeLevel, yt as Point, z as LayoutGenerator, zt as segmentsCross } from "./measures-Aan-rHz1.js";
2
2
  import { AnyOption, BooleanOption, DeclaredStrategy, EnumOption, EnumerateOptions, EnumerateOptions as EnumerateOptions$1, GridOptions, KindOptions, KindOptions as KindOptions$1, ListItem, MemberRule, NoDefault, NoDefaultReason, NumberOption, OptionDeclaration, OptionIssue, OptionRef, OptionScale, OptionSchema, OptionSetting, OptionSupports, ParamKind, ParamValue, ParamWhen, STRATEGY_SPACE_SCHEMA, SampleOptions, ShapeFilter, SpaceConstraint, SpaceParam, SpaceSize, SpaceSize as SpaceSize$1, SpaceSizeOptions, SpaceSizeOptions as SpaceSizeOptions$1, SpaceStage, StageChoice, StageOption, StrategyConfig, StrategyConfig as StrategyConfig$1, StrategySpace, StrategySpace as StrategySpace$1, SweepOptions, ValueOption, canonicalConfig, checkConfig, checkOptions, checkSchema, clampOptions, configId, declarationIssues, joinConfigs, listOptions, optionDefaults, optionIssue, paramActive, paramLevels, paramProblem, paramValue, productSpace, splitConfig, sweepGrid, sweepOf, sweepValues } from "@mark1russell7/strategy-space";
3
3
  /** The epsilon for the float compares in an engine. */
4
4
  export declare const EPS = 1e-6;
@@ -29,12 +29,17 @@ export interface Tolerance {
29
29
  * Routes are sampled curves that follow the margin line, so `through` is larger.
30
30
  */
31
31
  export declare const DEFAULT_TOLERANCE: Tolerance;
32
- /** The position of one item. `turn` is 90 when the packer turned a turnable item. */
32
+ /**
33
+ * The position of one item. `turn` is 90 when the packer turned a turnable item.
34
+ * `w` and `h` are the size of the placed item after the turn, when the packer resized an item with `resize`. Without them, the item keeps its size.
35
+ */
33
36
  export interface Placement {
34
37
  readonly id: string;
35
38
  readonly x: number;
36
39
  readonly y: number;
37
40
  readonly turn?: 0 | 90;
41
+ readonly w?: number;
42
+ readonly h?: number;
38
43
  }
39
44
  /** The facts of one stage of a strategy, for the records and the site. */
40
45
  export interface StageTrace {
@@ -64,6 +69,8 @@ export interface PackOutput {
64
69
  * This function gives the input with the output of a packer applied. Each placed box gets its position.
65
70
  * A turned box gets its turned size, ports, margin and shape. Each moved obstacle moves.
66
71
  * The container gets the size of the output. The router reads this result. It does not read `turn`.
72
+ *
73
+ * A placement with `w` or `h` gives the box that size after the turn (`resizeBox`).
67
74
  */
68
75
  export declare function applyPack(input: LayoutInput, output: PackOutput): LayoutInput;
69
76
  /** The stage of a record: the packer, the router, or both together. */
@@ -150,6 +157,22 @@ export interface Carried {
150
157
  readonly fingerprints: Readonly<Record<string, string>>;
151
158
  /** The id of the run that measured the record. */
152
159
  readonly run?: string;
160
+ /** The facts of a change of the measure code between the measure and the run that keeps the record. Without the field, the measure code did not change. */
161
+ readonly code?: CarriedCode;
162
+ }
163
+ /**
164
+ * The facts of a carry over a change of the measure code (L147 rule B). A run kept the record because a code audit gave no difference.
165
+ * Such a record is a bridge only: the next full run at the commit `to` or later measures it again.
166
+ */
167
+ export interface CarriedCode {
168
+ /** The commit of the measure code of the record. A record that a run carried before keeps this commit. */
169
+ readonly from: string;
170
+ /** The commit of the run that keeps the record. */
171
+ readonly to: string;
172
+ /** The count of the pairs of the code audit. Each pair had the same record, without the times, at the two commits. */
173
+ readonly audit: number;
174
+ /** The 95 % upper bound of the rate of a difference, from 0 differences in `audit` pairs (the Wilson interval). It is above 0 and not above 1. */
175
+ readonly upper: number;
153
176
  }
154
177
  /**
155
178
  * The values that a strategy supports, for each dimension of a taxonomy.
@@ -206,9 +229,15 @@ export interface CarryFacts {
206
229
  readonly from?: Readonly<Record<string, string>>;
207
230
  /** The id of the run that measured the record. A record that a run carried before keeps its `carried.run`. */
208
231
  readonly run?: string;
232
+ /**
233
+ * The facts of a change of the measure code, for a carry over such a change. A record with `carried.code` keeps its `carried.code.from`.
234
+ * Without this value, a record keeps its `carried.code`.
235
+ */
236
+ readonly code?: CarriedCode;
209
237
  }
210
238
  /**
211
239
  * This function gives a record that a run keeps after an engine release, with the field `carried` (L147).
240
+ * With `facts.code`, the run keeps the record over a change of the measure code. Then the engine versions can be the same.
212
241
  * A record that a run carried before keeps the versions and the run of its measure, so `carried.from` always names the measure.
213
242
  * The function throws a `RangeError` for a skipped record: a skip makes no claim on an output, so the run measures the pair again.
214
243
  * It also throws a `RangeError` when `checkLayoutRecord` refuses the field `carried` of the result.
@@ -311,6 +340,11 @@ export interface PackHard {
311
340
  readonly "in-container": number;
312
341
  readonly "locked-kept": number;
313
342
  readonly complete: number;
343
+ /**
344
+ * The count of the placements whose size is not in the bounds of their box (`countResizeBreaks`).
345
+ * `packHard` gives it only when a box of the input has `resize` or a placement has `w` or `h`. Thus the counts of the other inputs do not change.
346
+ */
347
+ readonly "size-kept"?: number;
314
348
  }
315
349
  /**
316
350
  * The hard rules of a pack, with the shape kinds that each rule supports.
@@ -331,6 +365,12 @@ export declare function rectInRegion(region: Region, rect: Rect): boolean;
331
365
  * The box counts with its margin. A box with a shape counts as its bounding box.
332
366
  */
333
367
  export declare function countObstacleHits(boxes: readonly LayoutBox[], obstacles: readonly Obstacle[] | undefined, tolerance?: number): number;
368
+ /**
369
+ * This function gives the count of the placements whose size is not in the bounds of their box (`sizeFits`).
370
+ * The bounds are in the axes of the placed box: a turned box has the turned bounds. A placement without `w` or `h` keeps that size of the box.
371
+ * A placement of an id that is not in the input does not count.
372
+ */
373
+ export declare function countResizeBreaks(input: LayoutInput, output: PackOutput): number;
334
374
  /**
335
375
  * This function gives the count of each hard rule of the output of a packer.
336
376
  * It applies the output with `applyPack`. Only the placed boxes and the locked boxes count for the overlaps and the container.
@@ -339,6 +379,7 @@ export declare function countObstacleHits(boxes: readonly LayoutBox[], obstacles
339
379
  * A locked box without a placement, or with a move of more than `RECORD_EPS`, breaks `locked-kept`.
340
380
  * A locked box without a position in the input is a bad input, not a break. `checkInput` finds it.
341
381
  * Another box without a placement that is not in `overflow` breaks `complete`.
382
+ * `size-kept` is in the result only when a box has `resize` or a placement has `w` or `h` (`countResizeBreaks`).
342
383
  *
343
384
  * `options` goes to `countOutside` for `in-container`.
344
385
  */
@@ -348,6 +389,8 @@ export declare function packHard(input: LayoutInput, output: PackOutput, toleran
348
389
  * A problem is a bad input, not a break of a hard rule. Thus an engine refuses the input.
349
390
  * In `pairGaps`, an unknown box, a pair of one box, a repeated pair in either order, a bad `gap` and bad `lanes` are problems.
350
391
  * A port with `along` and no `side`, with `x` or `y`, or with a value outside [0, 1] is a problem.
392
+ *
393
+ * A bad `resize` is a problem (`resizeProblems`).
351
394
  */
352
395
  export declare function checkInput(input: LayoutInput): readonly string[];
353
396
  /** This function gives the side after a turn of 90 degrees clockwise. */
@@ -362,10 +405,44 @@ export declare function turnPoint(x: number, y: number, h: number): [number, num
362
405
  export declare function turnPort(port: Port, h: number): Port;
363
406
  /** This function gives a margin after the turn: the value of each side moves one side clockwise. */
364
407
  export declare function turnMargin(margin: Margin): Margin;
408
+ /** This function gives the bounds of a resize after the turn: the bounds of the width and of the height change places. */
409
+ export declare function turnResize(resize: Resize): Resize;
365
410
  /** This function gives a region relative to the origin of a box of height `h` after the turn. */
366
411
  export declare function turnRegion(region: Region, h: number): Region;
367
- /** This function gives a box after the turn: the size, the ports, the margin and the shape turn. The position stays. */
412
+ /** This function gives a box after the turn: the size, the ports, the margin, the shape and the bounds of a resize turn. The position stays. */
368
413
  export declare function turnBox(box: LayoutBox): LayoutBox;
414
+ /** The bounds of the size of a box, with each value set. */
415
+ export interface SizeBounds {
416
+ readonly minW: number;
417
+ readonly maxW: number;
418
+ readonly minH: number;
419
+ readonly maxH: number;
420
+ /** With `keep`, the ratio of the width to the height stays the ratio of `w` to `h` of the box. */
421
+ readonly aspect: "keep" | "free";
422
+ }
423
+ /**
424
+ * This function gives the bounds of the size of a box. A bound that `resize` does not set is the size of the box.
425
+ * A box without `resize` gives the bounds of its own size, so it keeps its size.
426
+ */
427
+ export declare function sizeBoundsOf(box: LayoutBox): SizeBounds;
428
+ /**
429
+ * This function tells if a size is in the bounds of a box, with the tolerance `RECORD_EPS` of the records.
430
+ * With the aspect `keep`, the ratio of `w` to `h` also stays the ratio of the box, in the same tolerance.
431
+ * A size that is not positive and finite is not in the bounds.
432
+ */
433
+ export declare function sizeFits(box: LayoutBox, w: number, h: number): boolean;
434
+ /**
435
+ * This function gives a box at the size `w` by `h`. The position, the margin and the other fields stay.
436
+ * A port with `x` or `y` moves with the scale of its axis. A port with `along` keeps its place on its side.
437
+ * The function does not test the bounds: `sizeFits` does. A box with a shape is a bad input for a resize (`resizeProblems`).
438
+ */
439
+ export declare function resizeBox(box: LayoutBox, w: number, h: number): LayoutBox;
440
+ /**
441
+ * This function gives the problems of the `resize` of a box. A box without `resize` has no problem.
442
+ * Only a `rect` box without a shape can have a resize. Each bound is a positive finite number.
443
+ * The size of the box is in its bounds, and `aspect` is `keep` or `free`.
444
+ */
445
+ export declare function resizeProblems(box: LayoutBox): string[];
369
446
  /** A placed box: its id and its bounding box. */
370
447
  export interface PlacedBox extends Rect {
371
448
  readonly id: string;
@@ -600,6 +677,8 @@ export declare function outputHash(value: unknown, options?: HashOptions): strin
600
677
  * The placements, the moved obstacles and the overflow are in the order of their ids. A placement without `turn` gets `turn: 0`.
601
678
  * Thus two packers with the same result in a different order have the same form.
602
679
  * The function throws a `RangeError` when `placements`, `overflow` or `moved` has an id two times.
680
+ *
681
+ * A placement has `w` and `h` only when the packer set them, so the form of an output without a resize does not change.
603
682
  */
604
683
  export declare function packOutputForm(output: PackOutput): unknown;
605
684
  /** The hash of a probe that the strategy refused or does not support. It has no reason text, so a new text of a refusal does not change a fingerprint. */
@@ -1474,5 +1553,5 @@ export declare const CIRCLE_SCATTERED: CorpusFamily<LayoutInput>;
1474
1553
  * The steps `container`, `obstacles` and `boxes` each have a stream of `stepRandom`. Each value is a whole number, so the family is `exact`.
1475
1554
  */
1476
1555
  export declare const RECT_SCATTERED: CorpusFamily<LayoutInput>;
1477
- export { type AnyOption, type BooleanOption, ClaimBreak, CorpusEntry, CorpusSplit, DEFAULT_SHAPES, DeclaredClaim, type DeclaredStrategy, Declares, Direction, type EnumOption, type EnumerateOptions, FAMILY_ANY_KIND, FamilyBy, FamilyCell, type GridOptions, Item, JOINT_MEASURES, JOINT_MOVED_MIN, JointMeasureId, type KindOptions, LayoutBox, LayoutCell, LayoutContainer, LayoutEdge, LayoutGenerator, LayoutInput, type ListItem, Margin, MeasureSpec, type MemberRule, type NoDefault, type NoDefaultReason, type NumberOption, Obstacle, type OptionDeclaration, type OptionIssue, type OptionRef, type OptionScale, type OptionSchema, type OptionSetting, type OptionSupports, PackInput, PackInputOptions, PackLink, PairGap, type ParamKind, type ParamValue, type ParamWhen, Point, Port, Rect, Region, Ring, RuleLevel, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_SPACE_SCHEMA, type SampleOptions, ShapeBound, ShapeCheck, type ShapeFilter, ShapeGeometry, ShapeInput, ShapeKind, ShapeKindSpec, ShapeLevel, ShapeLimit, ShapeSupport, Side, Sides, SizedRect, type SpaceConstraint, type SpaceParam, type SpaceSize, type SpaceSizeOptions, type SpaceStage, SplitCorpus, SplitFold, type StageChoice, type StageOption, type StrategyConfig, type StrategySpace, type SweepOptions, type ValueOption, Verdict, boundsOf, boxArea, boxCenterDistance, canonicalConfig, canonicalInput, checkConfig, checkDeclared, checkOptions, checkSchema, checkShapes, checkSplit, clampOptions, compareMeasure, configId, corpusHashOf, crossingPoint, declarationIssues, declaredClaimOf, declaredCounts, dropIndex, familyOf, grow, inputShapeLevel, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, listOptions, marginSides, minEffectOf, optionDefaults, optionIssue, overlapOf, packLinks, paramActive, paramLevels, paramProblem, paramValue, pointInRing, pointInRings, pointSegmentDistance, portPoint, productSpace, regionArea, ruleLevel, scaleRect, segmentsCross, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, snapRect, splitConfig, splitFileName, splitFolds, sweepGrid, sweepOf, sweepValues, toPackInput, toRect, toSizedRect, translate };
1556
+ export { type AnyOption, type BooleanOption, ClaimBreak, CorpusEntry, CorpusSplit, DEFAULT_SHAPES, DeclaredClaim, type DeclaredStrategy, Declares, Direction, type EnumOption, type EnumerateOptions, FAMILY_ANY_KIND, FamilyBy, FamilyCell, type GridOptions, Item, JOINT_MEASURES, JOINT_MOVED_MIN, JointMeasureId, type KindOptions, LayoutBox, LayoutCell, LayoutContainer, LayoutEdge, LayoutGenerator, LayoutInput, type ListItem, Margin, MeasureSpec, type MemberRule, type NoDefault, type NoDefaultReason, type NumberOption, Obstacle, type OptionDeclaration, type OptionIssue, type OptionRef, type OptionScale, type OptionSchema, type OptionSetting, type OptionSupports, PackInput, PackInputOptions, PackLink, PairGap, type ParamKind, type ParamValue, type ParamWhen, Point, Port, Rect, Region, Resize, Ring, RuleLevel, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_SPACE_SCHEMA, type SampleOptions, ShapeBound, ShapeCheck, type ShapeFilter, ShapeGeometry, ShapeInput, ShapeKind, ShapeKindSpec, ShapeLevel, ShapeLimit, ShapeSupport, Side, Sides, SizedRect, type SpaceConstraint, type SpaceParam, type SpaceSize, type SpaceSizeOptions, type SpaceStage, SplitCorpus, SplitFold, type StageChoice, type StageOption, type StrategyConfig, type StrategySpace, type SweepOptions, type ValueOption, Verdict, boundsOf, boxArea, boxCenterDistance, canonicalConfig, canonicalInput, checkConfig, checkDeclared, checkOptions, checkSchema, checkShapes, checkSplit, clampOptions, compareMeasure, configId, corpusHashOf, crossingPoint, declarationIssues, declaredClaimOf, declaredCounts, dropIndex, familyOf, grow, inputShapeLevel, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, listOptions, marginSides, minEffectOf, optionDefaults, optionIssue, overlapOf, packLinks, paramActive, paramLevels, paramProblem, paramValue, pointInRing, pointInRings, pointSegmentDistance, portPoint, productSpace, regionArea, ruleLevel, scaleRect, segmentsCross, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, snapRect, splitConfig, splitFileName, splitFolds, sweepGrid, sweepOf, sweepValues, toPackInput, toRect, toSizedRect, translate };
1478
1557
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["StrategySpace","KindOptions","SpaceSizeOptions","SpaceSize","EnumerateOptions","StrategyConfig"],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/balance.ts","../src/frame.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/corpus-manifest.ts","../src/strategy-space.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;;qBACa;;qBAGA;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;iBC5Bf;WACN;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA,WAAW,SAAS;;;iBAId;WACN,qBAAqB;;WAErB;;WAEA;aAAiB;aAAoB;;;WAErC;aAA2B;aAAqB;aAAoB;;WACpE,iBAAiB;;;;;;;wBAQZ,UAAU,OAAO,aAAa,QAAQ,aAAa;;YC/BvD;;iBAGK;WACN;WACA,OAAO;WACP;WACA;;WAEA,SAAS,SAAS;WAClB;;WAEA;;WAEA;WACA;WACA;WACA;WACA;;WAEA,kBAAkB;;WAElB,UAAU,SAAS;;WAEnB,MAAM,SAAS;;WAEf,YAAY,SAAS,QAAQ;;WAE7B;;;;;;;WAOA;;WAEA;;WAEA;;WAEA;;;;;;WAMA;;WAEA;;WAEA;;WAEA;;;;;WAKA;;WAEA,MAAM;;WAEN;WACA;;;;;;WAMA,UAAU;;;;;;iBAOJ;;WAEN,MAAM,SAAS;;WAEf,IAAI,SAAS;;WAEb,cAAc,SAAS;;WAEvB;;;;;;YAOC,WAAW,SAAS;;iBAGf;WACN;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;YAIC,WAAW,KAAK;;;;;wBAMZ,eAAe,OAAO,aAAa,KAAK,WAAW;;;;;wBAqEnD,WAAW,QAAQ,KAAK;;;;;;wBASxB,kBAAkB;;;;;;wBAuClB,kBAAkB,iBAAiB;;iBAQlC;;WAEN,IAAI,SAAS;;WAEb,cAAc,SAAS;;WAEvB,OAAO,SAAS;;WAEhB;;;;;;;;wB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,cAAc,QAAO,QAAQ,mBAAwB;;YAUzE,qBAAqB,KAAK;;;;;;wBAOtB,eAAe,cAAc,MAAM,qBAAqB;;;;;wBA+BxD,kBAAkB,KAAK,iBAAiB;;;;;wBA+FxC,YAAY,KAAK,YAAY;;wBAa7B,cAAc,KAAK,YAAY;;;;;;wBAsB/B,SAAS,KAAK,iBAAiB,iBAAiB;;;;;;;;wBAsChD,kBACd,qBAAqB,mBACrB,OAAM,SAAS,eAAe,cAC9B,gBACA,cACC;;wBA8Ha,qBAAqB,IAAI,aAAa,WAAU,SAAS,aAAa,MAAW,eAAe;;iBA2G/F;WACN;WACA;;WAEA;WACA;;WAEA,qBAAqB;;WAErB;WACA,aAAa;;WAEb,cAAc,MAAM;;EAE7B,MAAM,OAAO,aAAa,cAAc,MAAM,kBAAkB;;;iBAIjD;;WAEN;;WAEA;WACA;;WAEA,QAAQ,OAAO;;;;;;;wBAWV,cAAc,MAAM,aAAa,cAAc,gBAAgB,cAAc,UAAS,iBAAsB,aAAa;;;;;qBA+D5H,YAAY;;;;qBA0BZ,eAAe;;;;;;;;;qBAuBf,kBAAkB,aAAa;;;;;;qBAqD/B,gBAAgB,aAAa"}
1
+ {"version":3,"file":"index.d.ts","names":["StrategySpace","KindOptions","SpaceSizeOptions","SpaceSize","EnumerateOptions","StrategyConfig"],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/resize.ts","../src/balance.ts","../src/frame.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/corpus-manifest.ts","../src/strategy-space.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;;qBACa;;qBAGA;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;;;;iBCxBf;WACN;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA,WAAW,SAAS;;;iBAId;WACN,qBAA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AK;;;;;;wBAOtB,eAAe,cAAc,MAAM,qBAAqB;;;;;wBA+BxD,kBAAkB,KAAK,iBAAiB;;;;;wBA+FxC,YAAY,KAAK,YAAY;;wBAa7B,cAAc,KAAK,YAAY;;;;;;wBAsB/B,SAAS,KAAK,iBAAiB,iBAAiB;;;;;;;;wBAsChD,kBACd,qBAAqB,mBACrB,OAAM,SAAS,eAAe,cAC9B,gBACA,cACC;;wBA8Ha,qBAAqB,IAAI,aAAa,WAAU,SAAS,aAAa,MAAW,eAAe;;iBA2G/F;WACN;WACA;;WAEA;WACA;;WAEA,qBAAqB;;WAErB;WACA,aAAa;;WAEb,cAAc,MAAM;;EAE7B,MAAM,OAAO,aAAa,cAAc,MAAM,kBAAkB;;;iBAIjD;;WAEN;;WAEA;WACA;;WAEA,QAAQ,OAAO;;;;;;;wBAWV,cAAc,MAAM,aAAa,cAAc,gBAAgB,cAAc,UAAS,iBAAsB,aAAa;;;;;qBA+D5H,YAAY;;;;qBA0BZ,eAAe;;;;;;;;;qBAuBf,kBAAkB,aAAa;;;;;;qBAqD/B,gBAAgB,aAAa"}
package/build/index.js CHANGED
@@ -619,6 +619,83 @@ function canonicalInput(input) {
619
619
  pairGaps
620
620
  };
621
621
  }
622
+ // src/resize.ts
623
+ /** The names of the bounds of a resize. */
624
+ const BOUNDS = [
625
+ "minW",
626
+ "maxW",
627
+ "minH",
628
+ "maxH"
629
+ ];
630
+ /**
631
+ * This function gives the bounds of the size of a box. A bound that `resize` does not set is the size of the box.
632
+ * A box without `resize` gives the bounds of its own size, so it keeps its size.
633
+ */
634
+ function sizeBoundsOf(box) {
635
+ const r = box.resize;
636
+ return {
637
+ minW: r?.minW ?? box.w,
638
+ maxW: r?.maxW ?? box.w,
639
+ minH: r?.minH ?? box.h,
640
+ maxH: r?.maxH ?? box.h,
641
+ aspect: r?.aspect ?? "free"
642
+ };
643
+ }
644
+ /**
645
+ * This function tells if a size is in the bounds of a box, with the tolerance `RECORD_EPS` of the records.
646
+ * With the aspect `keep`, the ratio of `w` to `h` also stays the ratio of the box, in the same tolerance.
647
+ * A size that is not positive and finite is not in the bounds.
648
+ */
649
+ function sizeFits(box, w, h) {
650
+ if (!(w > 0 && h > 0 && Number.isFinite(w) && Number.isFinite(h))) return false;
651
+ const b = sizeBoundsOf(box);
652
+ if (w < b.minW - .001 || w > b.maxW + .001 || h < b.minH - .001 || h > b.maxH + .001) return false;
653
+ return b.aspect === "free" || Math.abs(w * box.h - h * box.w) <= .001 * (box.w + box.h);
654
+ }
655
+ /** This function gives a port of a box of the size `w` by `h` after a resize to `toW` by `toH`. A port with `along` keeps its value. */
656
+ function resizePort(port, w, h, toW, toH) {
657
+ return {
658
+ ...port,
659
+ ...port.x === void 0 ? {} : { x: port.x * toW / w },
660
+ ...port.y === void 0 ? {} : { y: port.y * toH / h }
661
+ };
662
+ }
663
+ /**
664
+ * This function gives a box at the size `w` by `h`. The position, the margin and the other fields stay.
665
+ * A port with `x` or `y` moves with the scale of its axis. A port with `along` keeps its place on its side.
666
+ * The function does not test the bounds: `sizeFits` does. A box with a shape is a bad input for a resize (`resizeProblems`).
667
+ */
668
+ function resizeBox(box, w, h) {
669
+ if (w === box.w && h === box.h) return box;
670
+ return {
671
+ ...box,
672
+ w,
673
+ h,
674
+ ...box.ports === void 0 ? {} : { ports: box.ports.map((p) => resizePort(p, box.w, box.h, w, h)) }
675
+ };
676
+ }
677
+ /**
678
+ * This function gives the problems of the `resize` of a box. A box without `resize` has no problem.
679
+ * Only a `rect` box without a shape can have a resize. Each bound is a positive finite number.
680
+ * The size of the box is in its bounds, and `aspect` is `keep` or `free`.
681
+ */
682
+ function resizeProblems(box) {
683
+ const r = box.resize;
684
+ if (r === void 0) return [];
685
+ const at = `box ${box.id}`;
686
+ if (typeof r !== "object" || r === null) return [`${at}: the resize is not an object`];
687
+ const problems = [];
688
+ if (box.shape !== void 0 || shapeKindOf(box) !== "rect") problems.push(`${at}: only a rect box without a shape can have a resize`);
689
+ for (const k of BOUNDS) {
690
+ const v = r[k];
691
+ if (v !== void 0 && !(typeof v === "number" && v > 0 && Number.isFinite(v))) problems.push(`${at}: the resize bound ${k} ${String(v)} is not positive and finite`);
692
+ }
693
+ if (r.aspect !== void 0 && r.aspect !== "keep" && r.aspect !== "free") problems.push(`${at}: the resize aspect ${String(r.aspect)} is not keep or free`);
694
+ const b = sizeBoundsOf(box);
695
+ if (!(b.minW <= box.w && box.w <= b.maxW)) problems.push(`${at}: the width ${box.w} is not in the resize bounds ${b.minW} to ${b.maxW}`);
696
+ if (!(b.minH <= box.h && box.h <= b.maxH)) problems.push(`${at}: the height ${box.h} is not in the resize bounds ${b.minH} to ${b.maxH}`);
697
+ return problems;
698
+ }
622
699
  // src/turn.ts
623
700
  /** This function gives the side after a turn of 90 degrees clockwise. */
624
701
  function turnSide(side) {
@@ -655,6 +732,17 @@ function turnMargin(margin) {
655
732
  left: m.bottom
656
733
  };
657
734
  }
735
+ /** This function gives the bounds of a resize after the turn: the bounds of the width and of the height change places. */
736
+ function turnResize(resize) {
737
+ const { minW, maxW, minH, maxH, ...rest } = resize;
738
+ return {
739
+ ...rest,
740
+ ...minH === void 0 ? {} : { minW: minH },
741
+ ...maxH === void 0 ? {} : { maxW: maxH },
742
+ ...minW === void 0 ? {} : { minH: minW },
743
+ ...maxW === void 0 ? {} : { maxH: maxW }
744
+ };
745
+ }
658
746
  /** This function gives a region relative to the origin of a box of height `h` after the turn. */
659
747
  function turnRegion(region, h) {
660
748
  switch (region.kind) {
@@ -690,7 +778,7 @@ function turnRegion(region, h) {
690
778
  }
691
779
  }
692
780
  }
693
- /** This function gives a box after the turn: the size, the ports, the margin and the shape turn. The position stays. */
781
+ /** This function gives a box after the turn: the size, the ports, the margin, the shape and the bounds of a resize turn. The position stays. */
694
782
  function turnBox(box) {
695
783
  return {
696
784
  ...box,
@@ -698,7 +786,8 @@ function turnBox(box) {
698
786
  h: box.w,
699
787
  ...box.ports === void 0 ? {} : { ports: box.ports.map((p) => turnPort(p, box.h)) },
700
788
  ...box.margin === void 0 ? {} : { margin: turnMargin(box.margin) },
701
- ...box.shape === void 0 ? {} : { shape: turnRegion(box.shape, box.h) }
789
+ ...box.shape === void 0 ? {} : { shape: turnRegion(box.shape, box.h) },
790
+ ...box.resize === void 0 ? {} : { resize: turnResize(box.resize) }
702
791
  };
703
792
  }
704
793
  // src/output.ts
@@ -706,6 +795,8 @@ function turnBox(box) {
706
795
  * This function gives the input with the output of a packer applied. Each placed box gets its position.
707
796
  * A turned box gets its turned size, ports, margin and shape. Each moved obstacle moves.
708
797
  * The container gets the size of the output. The router reads this result. It does not read `turn`.
798
+ *
799
+ * A placement with `w` or `h` gives the box that size after the turn (`resizeBox`).
709
800
  */
710
801
  function applyPack(input, output) {
711
802
  const at = new Map(output.placements.map((p) => [p.id, p]));
@@ -713,8 +804,9 @@ function applyPack(input, output) {
713
804
  const boxes = input.boxes.map((box) => {
714
805
  const p = at.get(box.id);
715
806
  if (p === void 0) return box;
807
+ const turned = p.turn === 90 ? turnBox(box) : box;
716
808
  return {
717
- ...p.turn === 90 ? turnBox(box) : box,
809
+ ...p.w === void 0 && p.h === void 0 ? turned : resizeBox(turned, p.w ?? turned.w, p.h ?? turned.h),
718
810
  x: p.x,
719
811
  y: p.y
720
812
  };
@@ -807,6 +899,17 @@ function numberMap(out, v, name) {
807
899
  }
808
900
  /** This function tells if a value is an object whose values are strings. */
809
901
  const isStringMap = (v) => isFields$1(v) && Object.values(v).every((s) => typeof s === "string");
902
+ /** This function gives the problems of the field `carried.code` of a record. */
903
+ function codeProblems(code) {
904
+ if (!isFields$1(code)) return ["carried.code is not an object"];
905
+ const out = [];
906
+ for (const key of ["from", "to"]) if (typeof code[key] !== "string" || code[key] === "") out.push(`carried.code.${key} is not a commit`);
907
+ if (out.length === 0 && code["from"] === code["to"]) out.push("carried.code.to is the commit of carried.code.from");
908
+ if (!Number.isInteger(code["audit"]) || code["audit"] < 1) out.push("carried.code.audit is not a count of 1 or more");
909
+ const upper = code["upper"];
910
+ if (typeof upper !== "number" || !(upper > 0 && upper <= 1)) out.push("carried.code.upper is not above 0 and at most 1");
911
+ return out;
912
+ }
810
913
  /** This function gives the problems of the field `carried` of a record. */
811
914
  function carriedProblems(carried) {
812
915
  if (!isFields$1(carried)) return ["carried is not an object"];
@@ -817,12 +920,13 @@ function carriedProblems(carried) {
817
920
  "fingerprints"
818
921
  ]) if (!isStringMap(carried[key])) out.push(`carried.${key} is not a map of strings`);
819
922
  if (carried["run"] !== void 0 && typeof carried["run"] !== "string") out.push("carried.run is not a string");
923
+ if (carried["code"] !== void 0) out.push(...codeProblems(carried["code"]));
820
924
  if (out.length > 0) return out;
821
925
  const from = carried["from"];
822
926
  const to = carried["to"];
823
927
  const names = (m) => Object.keys(m).sort().join(",");
824
928
  if (names(from) === "" || names(from) !== names(to)) out.push("carried.from and carried.to do not name the same engines");
825
- else if (Object.keys(from).every((name) => from[name] === to[name])) out.push("carried.to has no other version than carried.from");
929
+ else if (carried["code"] === void 0 && Object.keys(from).every((name) => from[name] === to[name])) out.push("carried.to has no other version than carried.from");
826
930
  if (Object.keys(carried["fingerprints"]).length === 0) out.push("carried.fingerprints is empty");
827
931
  return out;
828
932
  }
@@ -896,6 +1000,7 @@ function parseLayoutRecord(value) {
896
1000
  }
897
1001
  /**
898
1002
  * This function gives a record that a run keeps after an engine release, with the field `carried` (L147).
1003
+ * With `facts.code`, the run keeps the record over a change of the measure code. Then the engine versions can be the same.
899
1004
  * A record that a run carried before keeps the versions and the run of its measure, so `carried.from` always names the measure.
900
1005
  * The function throws a `RangeError` for a skipped record: a skip makes no claim on an output, so the run measures the pair again.
901
1006
  * It also throws a `RangeError` when `checkLayoutRecord` refuses the field `carried` of the result.
@@ -905,11 +1010,17 @@ function carryRecord(record, facts) {
905
1010
  const from = record.carried?.from ?? facts.from;
906
1011
  if (from === void 0) throw new RangeError(`The record of ${record.strategy} on ${record.input} has no carried.from, so the carry needs from.`);
907
1012
  const run = record.carried?.run ?? facts.run;
1013
+ const before = record.carried?.code;
1014
+ const code = facts.code === void 0 ? before : {
1015
+ ...facts.code,
1016
+ from: before?.from ?? facts.code.from
1017
+ };
908
1018
  const carried = {
909
1019
  from,
910
1020
  to: facts.to,
911
1021
  fingerprints: facts.fingerprints,
912
- ...run === void 0 ? {} : { run }
1022
+ ...run === void 0 ? {} : { run },
1023
+ ...code === void 0 ? {} : { code }
913
1024
  };
914
1025
  const problems = carriedProblems(carried);
915
1026
  if (problems.length > 0) throw new RangeError(`The carry of ${record.strategy} on ${record.input} is bad: ${problems.join(", ")}.`);
@@ -1464,6 +1575,23 @@ function countObstacleHits(boxes, obstacles, tolerance = DEFAULT_TOLERANCE.overl
1464
1575
  return count;
1465
1576
  }
1466
1577
  /**
1578
+ * This function gives the count of the placements whose size is not in the bounds of their box (`sizeFits`).
1579
+ * The bounds are in the axes of the placed box: a turned box has the turned bounds. A placement without `w` or `h` keeps that size of the box.
1580
+ * A placement of an id that is not in the input does not count.
1581
+ */
1582
+ function countResizeBreaks(input, output) {
1583
+ const was = new Map(input.boxes.map((b) => [b.id, b]));
1584
+ let count = 0;
1585
+ for (const p of output.placements) {
1586
+ if (p.w === void 0 && p.h === void 0) continue;
1587
+ const box = was.get(p.id);
1588
+ if (box === void 0) continue;
1589
+ const placed = p.turn === 90 ? turnBox(box) : box;
1590
+ if (!sizeFits(placed, p.w ?? placed.w, p.h ?? placed.h)) count++;
1591
+ }
1592
+ return count;
1593
+ }
1594
+ /**
1467
1595
  * This function gives the count of each hard rule of the output of a packer.
1468
1596
  * It applies the output with `applyPack`. Only the placed boxes and the locked boxes count for the overlaps and the container.
1469
1597
  * `no-overlap` counts the pairs of boxes and the pairs of a box and an obstacle. A pair of `pairGaps` uses its gap in place of the margins. `HARD_RULE_VERSION` tells the version of these counts.
@@ -1471,6 +1599,7 @@ function countObstacleHits(boxes, obstacles, tolerance = DEFAULT_TOLERANCE.overl
1471
1599
  * A locked box without a placement, or with a move of more than `RECORD_EPS`, breaks `locked-kept`.
1472
1600
  * A locked box without a position in the input is a bad input, not a break. `checkInput` finds it.
1473
1601
  * Another box without a placement that is not in `overflow` breaks `complete`.
1602
+ * `size-kept` is in the result only when a box has `resize` or a placement has `w` or `h` (`countResizeBreaks`).
1474
1603
  *
1475
1604
  * `options` goes to `countOutside` for `in-container`.
1476
1605
  */
@@ -1499,14 +1628,21 @@ function packHard(input, output, tolerance = DEFAULT_TOLERANCE.overlap, options
1499
1628
  boxes: kept
1500
1629
  }, tolerance, options),
1501
1630
  "locked-kept": lockedMoved,
1502
- complete: incomplete
1631
+ complete: incomplete,
1632
+ ...resizes(input, output) ? { "size-kept": countResizeBreaks(input, output) } : {}
1503
1633
  };
1504
1634
  }
1635
+ /** This function tells if a box of the input has `resize` or a placement of the output has `w` or `h`. */
1636
+ function resizes(input, output) {
1637
+ return input.boxes.some((b) => b.resize !== void 0) || output.placements.some((p) => p.w !== void 0 || p.h !== void 0);
1638
+ }
1505
1639
  /**
1506
1640
  * This function gives the problems of an input file. An empty list tells that the file is good.
1507
1641
  * A problem is a bad input, not a break of a hard rule. Thus an engine refuses the input.
1508
1642
  * In `pairGaps`, an unknown box, a pair of one box, a repeated pair in either order, a bad `gap` and bad `lanes` are problems.
1509
1643
  * A port with `along` and no `side`, with `x` or `y`, or with a value outside [0, 1] is a problem.
1644
+ *
1645
+ * A bad `resize` is a problem (`resizeProblems`).
1510
1646
  */
1511
1647
  function checkInput(input) {
1512
1648
  const problems = [];
@@ -1519,6 +1655,7 @@ function checkInput(input) {
1519
1655
  const shape = shapeKindProblem(box);
1520
1656
  if (shape !== void 0) problems.push(shape);
1521
1657
  for (const port of box.ports ?? []) problems.push(...alongProblems(box.id, port));
1658
+ problems.push(...resizeProblems(box));
1522
1659
  }
1523
1660
  if (countPortsOffBorder(input.boxes) > 0) problems.push("a fixed port is not on the border of its box");
1524
1661
  for (const edge of input.edges ?? []) if (!ids.has(edge.source) || !ids.has(edge.target)) problems.push(`edge ${edge.id}: a box of the edge is not in the input`);
@@ -2490,6 +2627,8 @@ function byId(a, b) {
2490
2627
  * The placements, the moved obstacles and the overflow are in the order of their ids. A placement without `turn` gets `turn: 0`.
2491
2628
  * Thus two packers with the same result in a different order have the same form.
2492
2629
  * The function throws a `RangeError` when `placements`, `overflow` or `moved` has an id two times.
2630
+ *
2631
+ * A placement has `w` and `h` only when the packer set them, so the form of an output without a resize does not change.
2493
2632
  */
2494
2633
  function packOutputForm(output) {
2495
2634
  uniqueIds("placements", output.placements.map((p) => p.id));
@@ -2500,7 +2639,9 @@ function packOutputForm(output) {
2500
2639
  id: p.id,
2501
2640
  x: p.x,
2502
2641
  y: p.y,
2503
- turn: p.turn ?? 0
2642
+ turn: p.turn ?? 0,
2643
+ ...p.w === void 0 ? {} : { w: p.w },
2644
+ ...p.h === void 0 ? {} : { h: p.h }
2504
2645
  })).sort(byId),
2505
2646
  overflow: [...output.overflow].sort(),
2506
2647
  size: {
@@ -5164,6 +5305,6 @@ const RECT_SCATTERED = /* @__PURE__ */ Object.freeze({
5164
5305
  };
5165
5306
  }
5166
5307
  });
5167
- export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CIRCLE_SCATTERED, CORPUS_DIMENSIONS, CORPUS_MANIFEST_SCHEMA, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_KEY_STEP, EDGE_KEY_STEP_VERSION, EDGE_STEP_VERSION, EPS, EPS_STEPS, FAMILY_ANY_KIND, FRAME_SCHEMA, FRAME_STATES, HARD_RULE_VERSION, INVALIDATED_FIELD, JOINT_MEASURES, JOINT_MOVED_MIN, NODE_POSITIONS_DIMENSION, OUTPUT_CLASS_MIN_INPUTS, OUTPUT_GRID_PROPERTIES, OUTPUT_NEAR_WHOLE, PACK_HARD_RULES, RECORD_EPS, RECORD_SCALE, RECT_SCATTERED, REFUSED_PROBE, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_CATALOG_SCHEMA, STRATEGY_CATALOG_SCHEMAS, STRATEGY_SPACE_SCHEMA, VERDICT_DRAWS, VERDICT_EXACT_CAP, VERDICT_EXACT_MAX, VERDICT_RUNS, VERDICT_SEED, applyPack, balanceMeasureSpecs, balanceMeasures, balanceOf, boundsOf, boxArea, boxCenterDistance, canonicalConfig, canonicalInput, canonicalJson, carryRecord, catalogChoices, catalogDefaults, catalogKey, catalogOptions, checkCatalog, checkConfig, checkDeclared, checkInput, checkLayoutRecord, checkOptions, checkSchema, checkShapes, checkSpace, checkSplit, circleOverlaps, circlesOutside, clampOptions, compareMeasure, composeFamily, configId, corpusHashOf, corpusManifestText, countLinksThroughShapes, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, createFamilyRegistry, crossingPoint, declarationIssues, declaredClaimOf, declaredCounts, decodeOptionValue, dimensionAt, dimensionSupports, dimensionUnit, documentHash, dropIndex, edgeKeyStep, edgeStep, encodeOptionValue, enumerateSpace, exercised, familyKind, familyOf, fingerprintOf, fixedPointMove, fnv1a32, frameAt, frameMove, frameOf, grow, hardRuleOf, inputShapeLevel, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, levelsOf, lineJson, listOptions, manifestText, marginSides, minEffectOf, mulberry32, nearestGaps, optionDefaults, optionIssue, outputGridClass, outputGroups, outputHash, outputOf, overlapOf, ownerDimension, packHard, packLinks, packOutputForm, paramActive, paramLevels, paramProblem, paramValue, parseLayoutRecord, parseStrategyCatalog, perChange, pickMoves, placedCircle, placedRect, pointInRing, pointInRings, pointSegmentDistance, portPoint, portfolio, probeHash, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resolveDimensions, ruleLevel, scaleRect, segmentThroughShape, segmentsCross, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, shapesOverlap, sharedDimension, snapRect, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnSide, verdict, writeStrategyCatalog };
5308
+ export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CIRCLE_SCATTERED, CORPUS_DIMENSIONS, CORPUS_MANIFEST_SCHEMA, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_KEY_STEP, EDGE_KEY_STEP_VERSION, EDGE_STEP_VERSION, EPS, EPS_STEPS, FAMILY_ANY_KIND, FRAME_SCHEMA, FRAME_STATES, HARD_RULE_VERSION, INVALIDATED_FIELD, JOINT_MEASURES, JOINT_MOVED_MIN, NODE_POSITIONS_DIMENSION, OUTPUT_CLASS_MIN_INPUTS, OUTPUT_GRID_PROPERTIES, OUTPUT_NEAR_WHOLE, PACK_HARD_RULES, RECORD_EPS, RECORD_SCALE, RECT_SCATTERED, REFUSED_PROBE, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_CATALOG_SCHEMA, STRATEGY_CATALOG_SCHEMAS, STRATEGY_SPACE_SCHEMA, VERDICT_DRAWS, VERDICT_EXACT_CAP, VERDICT_EXACT_MAX, VERDICT_RUNS, VERDICT_SEED, applyPack, balanceMeasureSpecs, balanceMeasures, balanceOf, boundsOf, boxArea, boxCenterDistance, canonicalConfig, canonicalInput, canonicalJson, carryRecord, catalogChoices, catalogDefaults, catalogKey, catalogOptions, checkCatalog, checkConfig, checkDeclared, checkInput, checkLayoutRecord, checkOptions, checkSchema, checkShapes, checkSpace, checkSplit, circleOverlaps, circlesOutside, clampOptions, compareMeasure, composeFamily, configId, corpusHashOf, corpusManifestText, countLinksThroughShapes, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, countResizeBreaks, createFamilyRegistry, crossingPoint, declarationIssues, declaredClaimOf, declaredCounts, decodeOptionValue, dimensionAt, dimensionSupports, dimensionUnit, documentHash, dropIndex, edgeKeyStep, edgeStep, encodeOptionValue, enumerateSpace, exercised, familyKind, familyOf, fingerprintOf, fixedPointMove, fnv1a32, frameAt, frameMove, frameOf, grow, hardRuleOf, inputShapeLevel, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, levelsOf, lineJson, listOptions, manifestText, marginSides, minEffectOf, mulberry32, nearestGaps, optionDefaults, optionIssue, outputGridClass, outputGroups, outputHash, outputOf, overlapOf, ownerDimension, packHard, packLinks, packOutputForm, paramActive, paramLevels, paramProblem, paramValue, parseLayoutRecord, parseStrategyCatalog, perChange, pickMoves, placedCircle, placedRect, pointInRing, pointInRings, pointSegmentDistance, portPoint, portfolio, probeHash, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resizeBox, resizeProblems, resolveDimensions, ruleLevel, scaleRect, segmentThroughShape, segmentsCross, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, shapesOverlap, sharedDimension, sizeBoundsOf, sizeFits, snapRect, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnResize, turnSide, verdict, writeStrategyCatalog };
5168
5309
 
5169
5310
  //# sourceMappingURL=index.js.map