@mark1russell7/layout-contract 0.2.21 → 0.3.1
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 +10 -3
- package/build/index.d.ts +31 -6
- package/build/index.d.ts.map +1 -1
- package/build/index.js +200 -27
- package/build/index.js.map +1 -1
- package/build/{measures-CQAuu3T5.d.ts → measures-BLoTbQwB.d.ts} +30 -4
- package/build/{measures-CQAuu3T5.d.ts.map → measures-BLoTbQwB.d.ts.map} +1 -1
- package/build/text.d.ts +1 -1
- package/package.json +4 -1
- package/src/hash.ts +7 -6
- package/src/input.ts +50 -2
- package/src/random.ts +10 -9
- package/src/record.ts +82 -3
- package/src/utf8.ts +48 -9
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The shared contract of two layout engines: [`packing`](https://github.com/mark1russell7/packing) places boxes, and [`highways`](https://github.com/mark1russell7/highways) routes the edges between them. Neither engine depends on the other. Both use this contract, so a placement and a routing compose.
|
|
4
4
|
|
|
5
|
-
The package has
|
|
5
|
+
The package has one runtime dependency: `@mark1russell7/rigor-generators`, the home of the seeded generator `mulberry32`.
|
|
6
6
|
|
|
7
7
|
## The contents
|
|
8
8
|
|
|
@@ -11,8 +11,8 @@ The package has no runtime dependencies.
|
|
|
11
11
|
| Geometry | `Point`, `Rect`, `Region`, `Side`, `Sides`, `Margin`, `marginSides`, `grow`, `boundsOf`, `regionArea`, `translate`, `overlapOf` |
|
|
12
12
|
| The shape kinds | `ShapeKind`, `SHAPE_KINDS`, `SHAPE_KIND_IDS`, `ShapeKindSpec`, `ShapeGeometry`, `DEFAULT_SHAPES`, `ShapeSupport`, `ShapeBound`, `RuleLevel`, `ShapeLevel`, `ShapeCheck`, `isShapeKind`, `shapeKindOf`, `shapeKindsOf`, `itemShapeOf`, `shapeKindProblem`, `shapesOf`, `ruleLevel`, `shapeLevel`, `shapeSupportProblems`, `boxArea`, `checkShapes` |
|
|
13
13
|
| The input `layout-input/1` | `LayoutInput`, `LayoutBox` (`Item` for the packer), `Port`, `portPoint`, `LayoutEdge`, `LayoutContainer`, `Obstacle`, `LayoutCell`, `LayoutGenerator`, `PairGap`, `canonicalInput` |
|
|
14
|
-
| The packer | `PackInput`, `toPackInput`, `Placement`, `PackOutput`, `StageTrace`, `applyPack` |
|
|
15
|
-
| The record `layout-record/1` | `LayoutRecord`, `Stage`, `Supports`, `RunFacts`, `RunEnv`, `toLayoutRecord` |
|
|
14
|
+
| The packer | `PackInput`, `PackLink`, `toPackInput`, `packLinks`, `Placement`, `PackOutput`, `StageTrace`, `applyPack` |
|
|
15
|
+
| The record `layout-record/1` | `LayoutRecord`, `Stage`, `Supports`, `RunFacts`, `RunEnv`, `toLayoutRecord`, `checkLayoutRecord`, `parseLayoutRecord` |
|
|
16
16
|
| The strategies | `StrategyInfo` |
|
|
17
17
|
| The measures | `MeasureSpec`, `Direction`, `JointMeasureId`, `JOINT_MEASURES`, `JOINT_MOVED_MIN`, `Verdict`, `compareMeasure`, `minEffectOf` |
|
|
18
18
|
| The balance and stability measures | `balanceOf`, `Balance`, `nearestGaps`, `procrustesOf`, `ProcrustesOptions`, `perChange`, `balanceMeasures`, `balanceMeasureSpecs`, `BALANCE_MEASURE_SUFFIXES`, `BalanceMeasureSuffix`, `BALANCE_SIDE_DEPTH`, `PlacedBox` |
|
|
@@ -69,6 +69,13 @@ The package has no runtime dependencies.
|
|
|
69
69
|
- **The output hash.** `outputHash` gives the first 16 hex characters of the SHA-256 of the canonical JSON of an output. Each number goes to the grid of `RECORD_EPS` first.
|
|
70
70
|
- **The corpus checks.** `checkDeclared` and `checkSplit` give a list of `ClaimBreak`. An empty list tells that each claim is true. `corpusHashOf` gives the corpus hash of `packing`.
|
|
71
71
|
- **The verdict.** `verdict` compares two strategies on one measure, with the family as the unit. A verdict counts only when it holds for the mean of the family means and for the mean of the inputs.
|
|
72
|
+
- **The record.** A run writes one `layout-record/1` line of JSON Lines. The formats of the engines tell the fields. These rules are new in 0.3.0:
|
|
73
|
+
- `deterministic` is `true` when two runs with the same seed give the same output. A skipped record has `null`, because no run made a claim.
|
|
74
|
+
- A record without `skipped` has a boolean `deterministic`. `checkLayoutRecord` refuses `null` on it.
|
|
75
|
+
- An old skipped record has `deterministic: true`. `checkLayoutRecord` accepts it, and `parseLayoutRecord` gives `null` in its place.
|
|
76
|
+
- `env` gives the computer of the run: `node`, `os`, `arch`, `runner`, `cpu` and `cpus`. A timing record also gives `mode`, and it can give `context`.
|
|
77
|
+
- `env.mode` is the mode of the timing, for example `process` or `fresh` of `paired-time/1`. `env.context` is `ci` or `local`, with the Node flags.
|
|
78
|
+
- `checkLayoutRecord(value)` gives the problems of one record. `parseLayoutRecord(value)` throws a `TypeError` with them. Both accept fields that the format does not know.
|
|
72
79
|
- **The tolerances.** `EPS` (`1e-6`) is for the float compares in an engine. `RECORD_EPS` (`1e-3`) is for the compares on a written file. A record writes the tolerance of each hard rule in its field `tolerance`. The defaults are `overlap` `0.001` and `through` `0.5`.
|
|
73
80
|
|
|
74
81
|
## An example
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as FAMILY_ANY_KIND, A as shapesOf, B as PackInputOptions, C as itemShapeOf, Ct as marginSides, D as shapeKindsOf, E as shapeKindProblem, Et as translate, F as LayoutEdge, G as packLinks, H as PairGap, I as LayoutGenerator, J as ClaimBreak, K as portPoint, L as LayoutInput, M as LayoutBox, N as LayoutCell, O as shapeLevel, P as LayoutContainer, Q as Declares, R as Obstacle, S as isShapeKind, St as grow, T as shapeKindOf, Tt as regionArea, U as Port, V as PackLink, W as canonicalInput, X as CorpusSplit, Y as CorpusEntry, Z as DeclaredClaim, _ as ShapeKindSpec, _t as Region, a as MeasureSpec, at as checkDeclared, b as boxArea, bt as Sides, c as minEffectOf, ct as declaredClaimOf, d as SHAPE_KINDS, dt as leaveOneSeedOut, et as FamilyBy, f as SHAPE_KIND_IDS, ft as splitFileName, g as ShapeKind, gt as Rect, h as ShapeGeometry, ht as Point, i as JointMeasureId, it as SplitFold, j as Item, k as shapeSupportProblems, l as DEFAULT_SHAPES, lt as declaredCounts, m as ShapeCheck, mt as Margin, n as JOINT_MEASURES, nt as SPLIT_SCHEMA, o as Verdict, ot as checkSplit, p as ShapeBound, pt as splitFolds, q as toPackInput, r as JOINT_MOVED_MIN, rt as SplitCorpus, s as compareMeasure, st as corpusHashOf, t as Direction, tt as FamilyCell, u as RuleLevel, ut as familyOf, v as ShapeLevel, vt as SIDES, w as ruleLevel, wt as overlapOf, x as checkShapes, xt as boundsOf, y as ShapeSupport, yt as Side, z as PackInput } from "./measures-BLoTbQwB.js";
|
|
2
2
|
/** The epsilon for the float compares in an engine. */
|
|
3
3
|
export declare const EPS = 1e-6;
|
|
4
4
|
/**
|
|
@@ -90,8 +90,11 @@ export interface LayoutRecord {
|
|
|
90
90
|
readonly hard: Readonly<Record<string, number>>;
|
|
91
91
|
/** The tolerance of each hard rule of the run. */
|
|
92
92
|
readonly tolerance?: Readonly<Partial<Tolerance>>;
|
|
93
|
-
/**
|
|
94
|
-
|
|
93
|
+
/**
|
|
94
|
+
* The value is `true` when two runs with the same seed give the same positions.
|
|
95
|
+
* A skipped record has `null`, because no run made a claim. Each other record has a boolean.
|
|
96
|
+
*/
|
|
97
|
+
readonly deterministic: boolean | null;
|
|
95
98
|
/** The id of the prediction that was written before the run. */
|
|
96
99
|
readonly prediction?: string;
|
|
97
100
|
/** The median of `msRuns`, or the time of the one run. */
|
|
@@ -125,6 +128,10 @@ export interface RunEnv {
|
|
|
125
128
|
readonly cpu: string;
|
|
126
129
|
/** The count of the logical processors. */
|
|
127
130
|
readonly cpus: number;
|
|
131
|
+
/** The mode of the timing, for example `process` or `fresh` of `paired-time/1`. Each timing record names its mode. */
|
|
132
|
+
readonly mode?: string;
|
|
133
|
+
/** The context of the run, for example `ci` or `local`, with the Node flags. */
|
|
134
|
+
readonly context?: string;
|
|
128
135
|
}
|
|
129
136
|
/** The facts of a run that the input does not give. */
|
|
130
137
|
export type RunFacts = Omit<LayoutRecord, "schema" | "input" | "inputHash" | "set" | "nodes" | "edges" | "shapes">;
|
|
@@ -133,6 +140,18 @@ export type RunFacts = Omit<LayoutRecord, "schema" | "input" | "inputHash" | "se
|
|
|
133
140
|
* The input also gives `shapes`. An input with only `rect` boxes gets no `shapes`, so its record does not change.
|
|
134
141
|
*/
|
|
135
142
|
export declare function toLayoutRecord(input: LayoutInput, run: RunFacts): LayoutRecord;
|
|
143
|
+
/**
|
|
144
|
+
* This function gives the problems of one `layout-record/1` value. An empty list means a good record.
|
|
145
|
+
* A record that has `skipped` has `deterministic: null`. An old skipped record with a boolean is also correct.
|
|
146
|
+
* A record without `skipped` has a boolean. The check accepts fields that the format does not know.
|
|
147
|
+
*/
|
|
148
|
+
export declare function checkLayoutRecord(value: unknown): string[];
|
|
149
|
+
/**
|
|
150
|
+
* This function reads one `layout-record/1` value, for example one parsed line of a JSON Lines file.
|
|
151
|
+
* It throws a `TypeError` with the problems of `checkLayoutRecord`.
|
|
152
|
+
* An old skipped record has a boolean `deterministic`. The result has `null` in its place, because no run made that claim.
|
|
153
|
+
*/
|
|
154
|
+
export declare function parseLayoutRecord(value: unknown): LayoutRecord;
|
|
136
155
|
/** This function gives the area of a placed box: its shape or its rectangle, at its position. A box without a position gives `undefined`. */
|
|
137
156
|
export declare function placedRect(box: LayoutBox): Rect | undefined;
|
|
138
157
|
/**
|
|
@@ -299,9 +318,15 @@ export interface StrategyInfo<O = unknown, S extends Supports = Supports> {
|
|
|
299
318
|
/** The value is `true` when the result depends only on the input, the options and the seed. */
|
|
300
319
|
readonly deterministic: boolean;
|
|
301
320
|
}
|
|
302
|
-
/**
|
|
321
|
+
/**
|
|
322
|
+
* This function gives a generator of random numbers in [0, 1). It is `mulberry32`, as in `docs/FORMAT.md` of `packing`.
|
|
323
|
+
* Its home is `@mark1russell7/rigor-generators`. This function keeps the name and the signature of the API.
|
|
324
|
+
*/
|
|
303
325
|
export declare function mulberry32(seed: number): () => number;
|
|
304
|
-
/**
|
|
326
|
+
/**
|
|
327
|
+
* This function gives the FNV-1a hash of 32 bits of the UTF-8 bytes of a string.
|
|
328
|
+
* It stays here because `fnv1a32` of `@mark1russell7/rigor-generators` encodes a lone surrogate as U+FFFD. This function encodes the 3 bytes of its code.
|
|
329
|
+
*/
|
|
305
330
|
export declare function fnv1a32(text: string): number;
|
|
306
331
|
/** This function gives the generator of one step of a seeded generator: `mulberry32(fnv1a32("<seed>:<step>"))`. */
|
|
307
332
|
export declare function stepRandom(seed: number, step: string): () => number;
|
|
@@ -1127,5 +1152,5 @@ export declare const EDGES_STEP: CorpusStep;
|
|
|
1127
1152
|
* The steps `container`, `obstacles` and `boxes` each have a stream of `stepRandom`. Each value is a whole number, so the family is `exact`.
|
|
1128
1153
|
*/
|
|
1129
1154
|
export declare const RECT_SCATTERED: CorpusFamily<LayoutInput>;
|
|
1130
|
-
export { ClaimBreak, CorpusEntry, CorpusSplit, DEFAULT_SHAPES, DeclaredClaim, Declares, Direction, FAMILY_ANY_KIND, FamilyBy, FamilyCell, Item, JOINT_MEASURES, JOINT_MOVED_MIN, JointMeasureId, LayoutBox, LayoutCell, LayoutContainer, LayoutEdge, LayoutGenerator, LayoutInput, Margin, MeasureSpec, Obstacle, PackInput, PairGap, Point, Port, Rect, Region, RuleLevel, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, ShapeBound, ShapeCheck, ShapeGeometry, ShapeKind, ShapeKindSpec, ShapeLevel, ShapeSupport, Side, Sides, SplitCorpus, SplitFold, Verdict, boundsOf, boxArea, canonicalInput, checkDeclared, checkShapes, checkSplit, compareMeasure, corpusHashOf, declaredClaimOf, declaredCounts, familyOf, grow, isShapeKind, itemShapeOf, leaveOneSeedOut, marginSides, minEffectOf, overlapOf, portPoint, regionArea, ruleLevel, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, splitFileName, splitFolds, toPackInput, translate };
|
|
1155
|
+
export { ClaimBreak, CorpusEntry, CorpusSplit, DEFAULT_SHAPES, DeclaredClaim, Declares, Direction, FAMILY_ANY_KIND, FamilyBy, FamilyCell, Item, JOINT_MEASURES, JOINT_MOVED_MIN, JointMeasureId, LayoutBox, LayoutCell, LayoutContainer, LayoutEdge, LayoutGenerator, LayoutInput, Margin, MeasureSpec, Obstacle, PackInput, PackInputOptions, PackLink, PairGap, Point, Port, Rect, Region, RuleLevel, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, ShapeBound, ShapeCheck, ShapeGeometry, ShapeKind, ShapeKindSpec, ShapeLevel, ShapeSupport, Side, Sides, SplitCorpus, SplitFold, Verdict, boundsOf, boxArea, canonicalInput, checkDeclared, checkShapes, checkSplit, compareMeasure, corpusHashOf, declaredClaimOf, declaredCounts, familyOf, grow, isShapeKind, itemShapeOf, leaveOneSeedOut, marginSides, minEffectOf, overlapOf, packLinks, portPoint, regionArea, ruleLevel, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, splitFileName, splitFolds, toPackInput, translate };
|
|
1131
1156
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/balance.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/strategy-space.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;qBACa;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;iBCzBf;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;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/balance.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/strategy-space.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;qBACa;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;iBCzBf;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;;;;;WAK7B;;WAEA;;WAEA;;WAEA;;;;;WAKA;;WAEA,MAAM;;WAEN;WACA;;;;;;YAOC,WAAW,SAAS;;iBAGf;WACN;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;YAIC,WAAW,KAAK;;;;;wBAMZ,eAAe,OAAO,aAAa,KAAK,WAAW;;;;;;wBAkDnD,kBAAkB;;;;;;wBA8BlB,kBAAkB,iBAAiB;;wBC9JnC,WAAW,KAAK,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;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;;;;;;qBAoBZ,gBAAgB,aAAa"}
|
package/build/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mulberry32 as mulberry32$1 } from "@mark1russell7/rigor-generators";
|
|
1
2
|
// src/geometry.ts
|
|
2
3
|
/** The sides in clockwise order, from the top. */
|
|
3
4
|
const SIDES = [
|
|
@@ -388,16 +389,56 @@ function portPoint(box, port) {
|
|
|
388
389
|
};
|
|
389
390
|
}
|
|
390
391
|
}
|
|
391
|
-
/**
|
|
392
|
-
function
|
|
392
|
+
/**
|
|
393
|
+
* This function gives the packer input of a file. An input without a container gets `{ fixed: "none" }`, so the packer picks the size.
|
|
394
|
+
* The edges are not in the packer input. With the option `links`, their links are in it.
|
|
395
|
+
*/
|
|
396
|
+
function toPackInput(input, options = {}) {
|
|
393
397
|
return {
|
|
394
398
|
container: input.container ?? { fixed: "none" },
|
|
395
399
|
items: input.boxes,
|
|
396
400
|
...input.obstacles === void 0 ? {} : { obstacles: input.obstacles },
|
|
397
401
|
...input.gap === void 0 ? {} : { gap: input.gap },
|
|
398
|
-
...input.pairGaps === void 0 ? {} : { pairGaps: input.pairGaps }
|
|
402
|
+
...input.pairGaps === void 0 ? {} : { pairGaps: input.pairGaps },
|
|
403
|
+
...options.links === true ? { links: packLinks(input) } : {}
|
|
399
404
|
};
|
|
400
405
|
}
|
|
406
|
+
/**
|
|
407
|
+
* This function gives the links of the edges of a file, with indexes into `input.boxes`.
|
|
408
|
+
* - Each link has `a` below `b`. The list is sorted by `a` and then by `b`.
|
|
409
|
+
* - The edges of one pair of boxes make one link. Its weight is the count of the edges, and a link of one edge has no weight.
|
|
410
|
+
* - The function does not use an edge to a box that is not in `input.boxes`, or an edge from a box to the same box.
|
|
411
|
+
*/
|
|
412
|
+
function packLinks(input) {
|
|
413
|
+
const index = /* @__PURE__ */ new Map();
|
|
414
|
+
input.boxes.forEach((box, i) => {
|
|
415
|
+
if (!index.has(box.id)) index.set(box.id, i);
|
|
416
|
+
});
|
|
417
|
+
const count = /* @__PURE__ */ new Map();
|
|
418
|
+
for (const edge of input.edges ?? []) {
|
|
419
|
+
const s = index.get(edge.source);
|
|
420
|
+
const t = index.get(edge.target);
|
|
421
|
+
if (s === void 0 || t === void 0 || s === t) continue;
|
|
422
|
+
const a = Math.min(s, t);
|
|
423
|
+
const b = Math.max(s, t);
|
|
424
|
+
const key = `${a} ${b}`;
|
|
425
|
+
const c = count.get(key);
|
|
426
|
+
if (c === void 0) count.set(key, {
|
|
427
|
+
a,
|
|
428
|
+
b,
|
|
429
|
+
n: 1
|
|
430
|
+
});
|
|
431
|
+
else c.n += 1;
|
|
432
|
+
}
|
|
433
|
+
return [...count.values()].sort((x, y) => x.a - y.a || x.b - y.b).map(({ a, b, n }) => n === 1 ? {
|
|
434
|
+
a,
|
|
435
|
+
b
|
|
436
|
+
} : {
|
|
437
|
+
a,
|
|
438
|
+
b,
|
|
439
|
+
weight: n
|
|
440
|
+
});
|
|
441
|
+
}
|
|
401
442
|
/** This function compares two strings by their UTF-16 code units, as `Array.prototype.sort` does without a compare function. */
|
|
402
443
|
const byCode$1 = (x, y) => x < y ? -1 : x > y ? 1 : 0;
|
|
403
444
|
/**
|
|
@@ -556,6 +597,100 @@ function toLayoutRecord(input, run) {
|
|
|
556
597
|
...onlyRect ? {} : { shapes }
|
|
557
598
|
};
|
|
558
599
|
}
|
|
600
|
+
const isFields = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
601
|
+
const STAGES = [
|
|
602
|
+
"pack",
|
|
603
|
+
"route",
|
|
604
|
+
"joint"
|
|
605
|
+
];
|
|
606
|
+
const RECORD_STRINGS = [
|
|
607
|
+
"step",
|
|
608
|
+
"strategy",
|
|
609
|
+
"corpus",
|
|
610
|
+
"input",
|
|
611
|
+
"inputHash",
|
|
612
|
+
"set"
|
|
613
|
+
];
|
|
614
|
+
const RECORD_NUMBERS = [
|
|
615
|
+
"seed",
|
|
616
|
+
"nodes",
|
|
617
|
+
"edges",
|
|
618
|
+
"ms"
|
|
619
|
+
];
|
|
620
|
+
const RECORD_OPTIONAL_STRINGS = [
|
|
621
|
+
"prediction",
|
|
622
|
+
"outputHash",
|
|
623
|
+
"skipped",
|
|
624
|
+
"commit"
|
|
625
|
+
];
|
|
626
|
+
const ENV_STRINGS = [
|
|
627
|
+
"node",
|
|
628
|
+
"os",
|
|
629
|
+
"arch",
|
|
630
|
+
"runner",
|
|
631
|
+
"cpu"
|
|
632
|
+
];
|
|
633
|
+
const ENV_OPTIONAL_STRINGS = ["mode", "context"];
|
|
634
|
+
/** This function adds a problem for each value of a map that is not a number. */
|
|
635
|
+
function numberMap(out, v, name) {
|
|
636
|
+
if (!isFields(v)) {
|
|
637
|
+
out.push(`${name} is not an object`);
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
for (const [key, n] of Object.entries(v)) if (typeof n !== "number") out.push(`${name}.${key} is not a number`);
|
|
641
|
+
}
|
|
642
|
+
/** This function gives the problems of the field `env` of a record. */
|
|
643
|
+
function envProblems(env) {
|
|
644
|
+
if (!isFields(env)) return ["env is not an object"];
|
|
645
|
+
const out = [];
|
|
646
|
+
for (const key of ENV_STRINGS) if (typeof env[key] !== "string") out.push(`env.${key} is not a string`);
|
|
647
|
+
if (typeof env["cpus"] !== "number") out.push("env.cpus is not a number");
|
|
648
|
+
for (const key of ENV_OPTIONAL_STRINGS) if (env[key] !== void 0 && typeof env[key] !== "string") out.push(`env.${key} is not a string`);
|
|
649
|
+
return out;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* This function gives the problems of one `layout-record/1` value. An empty list means a good record.
|
|
653
|
+
* A record that has `skipped` has `deterministic: null`. An old skipped record with a boolean is also correct.
|
|
654
|
+
* A record without `skipped` has a boolean. The check accepts fields that the format does not know.
|
|
655
|
+
*/
|
|
656
|
+
function checkLayoutRecord(value) {
|
|
657
|
+
if (!isFields(value)) return ["the record is not an object"];
|
|
658
|
+
const out = [];
|
|
659
|
+
const v = value;
|
|
660
|
+
if (v["schema"] !== "layout-record/1") out.push("schema is not layout-record/1");
|
|
661
|
+
if (typeof v["stage"] !== "string" || !STAGES.includes(v["stage"])) out.push("stage is not pack, route or joint");
|
|
662
|
+
for (const key of RECORD_STRINGS) if (typeof v[key] !== "string") out.push(`${key} is not a string`);
|
|
663
|
+
for (const key of RECORD_NUMBERS) if (typeof v[key] !== "number") out.push(`${key} is not a number`);
|
|
664
|
+
for (const key of RECORD_OPTIONAL_STRINGS) if (v[key] !== void 0 && typeof v[key] !== "string") out.push(`${key} is not a string`);
|
|
665
|
+
if (!isFields(v["options"])) out.push("options is not an object");
|
|
666
|
+
numberMap(out, v["measures"], "measures");
|
|
667
|
+
numberMap(out, v["hard"], "hard");
|
|
668
|
+
if (v["tolerance"] !== void 0) numberMap(out, v["tolerance"], "tolerance");
|
|
669
|
+
const shapes = v["shapes"];
|
|
670
|
+
if (shapes !== void 0 && (!Array.isArray(shapes) || !shapes.every(isShapeKind))) out.push("shapes is not a list of shape kinds");
|
|
671
|
+
const msRuns = v["msRuns"];
|
|
672
|
+
if (msRuns !== void 0 && (!Array.isArray(msRuns) || !msRuns.every((n) => typeof n === "number"))) out.push("msRuns is not a list of numbers");
|
|
673
|
+
if (v["env"] !== void 0) out.push(...envProblems(v["env"]));
|
|
674
|
+
const deterministic = v["deterministic"];
|
|
675
|
+
if (v["skipped"] === void 0) {
|
|
676
|
+
if (typeof deterministic !== "boolean") out.push("deterministic is not a boolean, and the record has no skipped");
|
|
677
|
+
} else if (deterministic !== null && typeof deterministic !== "boolean") out.push("deterministic of a skipped record is not null or a boolean");
|
|
678
|
+
return out;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* This function reads one `layout-record/1` value, for example one parsed line of a JSON Lines file.
|
|
682
|
+
* It throws a `TypeError` with the problems of `checkLayoutRecord`.
|
|
683
|
+
* An old skipped record has a boolean `deterministic`. The result has `null` in its place, because no run made that claim.
|
|
684
|
+
*/
|
|
685
|
+
function parseLayoutRecord(value) {
|
|
686
|
+
const problems = checkLayoutRecord(value);
|
|
687
|
+
if (problems.length > 0) throw new TypeError(`The record is not a layout-record/1: ${problems.join(", ")}.`);
|
|
688
|
+
const record = value;
|
|
689
|
+
return record.skipped !== void 0 && record.deterministic !== null ? {
|
|
690
|
+
...record,
|
|
691
|
+
deterministic: null
|
|
692
|
+
} : record;
|
|
693
|
+
}
|
|
559
694
|
// src/rules.ts
|
|
560
695
|
/** This function gives the area of a placed box: its shape or its rectangle, at its position. A box without a position gives `undefined`. */
|
|
561
696
|
function placedRect(box) {
|
|
@@ -1376,30 +1511,68 @@ function balanceMeasureSpecs(stage) {
|
|
|
1376
1511
|
]);
|
|
1377
1512
|
}
|
|
1378
1513
|
// src/utf8.ts
|
|
1379
|
-
/**
|
|
1380
|
-
function
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1514
|
+
/**
|
|
1515
|
+
* This function writes the UTF-8 bytes of a string into `out`, from the index `at`, and gives the index after the last byte.
|
|
1516
|
+
* With no `out`, it writes nothing and gives the count of the bytes. A lone surrogate gives the 3 bytes of its code.
|
|
1517
|
+
* It reads the UTF-16 code units, so it makes no string for each character (L81: `sha256Hex` allocated 2 GB in one pair).
|
|
1518
|
+
*/
|
|
1519
|
+
function utf8Write(text, out, at = 0) {
|
|
1520
|
+
let n = at;
|
|
1521
|
+
for (let i = 0; i < text.length; i++) {
|
|
1522
|
+
let c = text.charCodeAt(i);
|
|
1523
|
+
if (c >= 55296 && c < 56320 && i + 1 < text.length) {
|
|
1524
|
+
const low = text.charCodeAt(i + 1);
|
|
1525
|
+
if (low >= 56320 && low < 57344) {
|
|
1526
|
+
c = 65536 + (c - 55296 << 10) + (low - 56320);
|
|
1527
|
+
i++;
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
if (c < 128) {
|
|
1531
|
+
if (out !== void 0) out[n] = c;
|
|
1532
|
+
n += 1;
|
|
1533
|
+
} else if (c < 2048) {
|
|
1534
|
+
if (out !== void 0) {
|
|
1535
|
+
out[n] = 192 | c >> 6;
|
|
1536
|
+
out[n + 1] = 128 | c & 63;
|
|
1537
|
+
}
|
|
1538
|
+
n += 2;
|
|
1539
|
+
} else if (c < 65536) {
|
|
1540
|
+
if (out !== void 0) {
|
|
1541
|
+
out[n] = 224 | c >> 12;
|
|
1542
|
+
out[n + 1] = 128 | c >> 6 & 63;
|
|
1543
|
+
out[n + 2] = 128 | c & 63;
|
|
1544
|
+
}
|
|
1545
|
+
n += 3;
|
|
1546
|
+
} else {
|
|
1547
|
+
if (out !== void 0) {
|
|
1548
|
+
out[n] = 240 | c >> 18;
|
|
1549
|
+
out[n + 1] = 128 | c >> 12 & 63;
|
|
1550
|
+
out[n + 2] = 128 | c >> 6 & 63;
|
|
1551
|
+
out[n + 3] = 128 | c & 63;
|
|
1552
|
+
}
|
|
1553
|
+
n += 4;
|
|
1554
|
+
}
|
|
1388
1555
|
}
|
|
1556
|
+
return n;
|
|
1557
|
+
}
|
|
1558
|
+
/** This function gives the UTF-8 bytes of a string. It does not use `TextEncoder`, because `TextEncoder` encodes a lone surrogate as U+FFFD. */
|
|
1559
|
+
function utf8(text) {
|
|
1560
|
+
const bytes = new Uint8Array(utf8Write(text));
|
|
1561
|
+
utf8Write(text, bytes);
|
|
1389
1562
|
return bytes;
|
|
1390
1563
|
}
|
|
1391
1564
|
// src/random.ts
|
|
1392
|
-
/**
|
|
1565
|
+
/**
|
|
1566
|
+
* This function gives a generator of random numbers in [0, 1). It is `mulberry32`, as in `docs/FORMAT.md` of `packing`.
|
|
1567
|
+
* Its home is `@mark1russell7/rigor-generators`. This function keeps the name and the signature of the API.
|
|
1568
|
+
*/
|
|
1393
1569
|
function mulberry32(seed) {
|
|
1394
|
-
|
|
1395
|
-
return () => {
|
|
1396
|
-
s = s + 1831565813 | 0;
|
|
1397
|
-
let t = Math.imul(s ^ s >>> 15, 1 | s);
|
|
1398
|
-
t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
|
|
1399
|
-
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
1400
|
-
};
|
|
1570
|
+
return mulberry32$1(seed);
|
|
1401
1571
|
}
|
|
1402
|
-
/**
|
|
1572
|
+
/**
|
|
1573
|
+
* This function gives the FNV-1a hash of 32 bits of the UTF-8 bytes of a string.
|
|
1574
|
+
* It stays here because `fnv1a32` of `@mark1russell7/rigor-generators` encodes a lone surrogate as U+FFFD. This function encodes the 3 bytes of its code.
|
|
1575
|
+
*/
|
|
1403
1576
|
function fnv1a32(text) {
|
|
1404
1577
|
let h = 2166136261;
|
|
1405
1578
|
for (const b of utf8(text)) h = Math.imul(h ^ b, 16777619) >>> 0;
|
|
@@ -1682,12 +1855,12 @@ const K = [
|
|
|
1682
1855
|
* It uses no API of Node or of the browser.
|
|
1683
1856
|
*/
|
|
1684
1857
|
function sha256Hex(text) {
|
|
1685
|
-
const
|
|
1686
|
-
const bits =
|
|
1687
|
-
const total = Math.ceil((
|
|
1858
|
+
const length = utf8Write(text);
|
|
1859
|
+
const bits = length * 8;
|
|
1860
|
+
const total = Math.ceil((length + 9) / 64) * 64;
|
|
1688
1861
|
const data = new Uint8Array(total);
|
|
1689
|
-
data
|
|
1690
|
-
data[
|
|
1862
|
+
utf8Write(text, data);
|
|
1863
|
+
data[length] = 128;
|
|
1691
1864
|
const view = new DataView(data.buffer);
|
|
1692
1865
|
view.setUint32(total - 8, Math.floor(bits / 4294967296));
|
|
1693
1866
|
view.setUint32(total - 4, bits >>> 0);
|
|
@@ -4256,6 +4429,6 @@ const RECT_SCATTERED = Object.freeze({
|
|
|
4256
4429
|
};
|
|
4257
4430
|
}
|
|
4258
4431
|
});
|
|
4259
|
-
export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CORPUS_DIMENSIONS, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_STEP_VERSION, EPS, FAMILY_ANY_KIND, INVALIDATED_FIELD, JOINT_MEASURES, JOINT_MOVED_MIN, PACK_HARD_RULES, RECORD_EPS, RECORD_SCALE, RECT_SCATTERED, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_SPACE_SCHEMA, VERDICT_DRAWS, VERDICT_EXACT_CAP, VERDICT_EXACT_MAX, VERDICT_RUNS, VERDICT_SEED, applyPack, balanceMeasureSpecs, balanceMeasures, balanceOf, boundsOf, boxArea, canonicalConfig, canonicalInput, canonicalJson, checkConfig, checkDeclared, checkInput, checkShapes, checkSpace, checkSplit, compareMeasure, composeFamily, configId, corpusHashOf, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, createFamilyRegistry, declaredClaimOf, declaredCounts, dimensionAt, dimensionSupports, dimensionUnit, documentHash, edgeStep, enumerateSpace, exercised, familyKind, familyOf, fnv1a32, grow, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, levelsOf, marginSides, minEffectOf, mulberry32, nearestGaps, outputGroups, outputHash, overlapOf, ownerDimension, packHard, paramActive, paramLevels, paramProblem, paramValue, perChange, pickMoves, placedRect, portPoint, portfolio, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resolveDimensions, ruleLevel, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, sharedDimension, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, toLayoutRecord, toPackInput, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnSide, verdict };
|
|
4432
|
+
export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CORPUS_DIMENSIONS, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_STEP_VERSION, EPS, FAMILY_ANY_KIND, INVALIDATED_FIELD, JOINT_MEASURES, JOINT_MOVED_MIN, PACK_HARD_RULES, RECORD_EPS, RECORD_SCALE, RECT_SCATTERED, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_SPACE_SCHEMA, VERDICT_DRAWS, VERDICT_EXACT_CAP, VERDICT_EXACT_MAX, VERDICT_RUNS, VERDICT_SEED, applyPack, balanceMeasureSpecs, balanceMeasures, balanceOf, boundsOf, boxArea, canonicalConfig, canonicalInput, canonicalJson, checkConfig, checkDeclared, checkInput, checkLayoutRecord, checkShapes, checkSpace, checkSplit, compareMeasure, composeFamily, configId, corpusHashOf, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, createFamilyRegistry, declaredClaimOf, declaredCounts, dimensionAt, dimensionSupports, dimensionUnit, documentHash, edgeStep, enumerateSpace, exercised, familyKind, familyOf, fnv1a32, grow, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, levelsOf, marginSides, minEffectOf, mulberry32, nearestGaps, outputGroups, outputHash, overlapOf, ownerDimension, packHard, packLinks, paramActive, paramLevels, paramProblem, paramValue, parseLayoutRecord, perChange, pickMoves, placedRect, portPoint, portfolio, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resolveDimensions, ruleLevel, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, sharedDimension, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, toLayoutRecord, toPackInput, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnSide, verdict };
|
|
4260
4433
|
|
|
4261
4434
|
//# sourceMappingURL=index.js.map
|