@mark1russell7/layout-contract 0.5.2 → 0.5.4

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/build/index.d.ts CHANGED
@@ -695,7 +695,10 @@ export interface SpaceParam {
695
695
  /** Without `when`, the param is active each time its option is chosen. */
696
696
  readonly when?: ParamWhen;
697
697
  }
698
- /** The rule of the members of a meta option: a count from `min` to `max`. Members with `ordered: false` are sorted by their `configId`. */
698
+ /**
699
+ * The rule of the members of a meta option: a count from `min` to `max`. Members with `ordered: false` are sorted by their `configId`.
700
+ * With `min` and `max` 0, the option chooses its members from the input, so a config lists none. This form has no `pool` and no `view`.
701
+ */
699
702
  export interface MemberRule {
700
703
  readonly min: number;
701
704
  readonly max: number;
@@ -810,11 +813,19 @@ export interface SampleOptions extends ShapeFilter {
810
813
  /**
811
814
  * How a point keeps the constraints. With `reject` (the default), a point that breaks a constraint draws again.
812
815
  * With `walk`, a point draws its stages from the largest to the smallest. Each stage draws only from the options that keep the constraints with the stages before it.
816
+ * The stages of `fixed` draw before the other stages.
813
817
  * A space whose constraints reject most draws gets its sample with `walk`. The two values give different configs for one seed.
814
818
  * A sample of `walk` is not uniform over the valid configs. Each option of the largest stage gets an equal share, whatever count of valid configs it has.
815
819
  * Thus a mean over this sample is not a mean of the space.
816
820
  */
817
821
  readonly draw?: "reject" | "walk";
822
+ /**
823
+ * The options that each config of the sample has. A key is the name of a stage, and its value is the id of one option of that stage. The other stages draw as before.
824
+ * A stage of a product space has the name of its part before its own name, for example `pack.placement`.
825
+ * A fixed meta option needs `meta: "sample"`. A meta option of another stage of the same part goes out, because such an option replaces the fixed stage.
826
+ * A fixed option that the shape filter removes, or that the constraints forbid, gets a `RangeError` with the reason.
827
+ */
828
+ readonly fixed?: Readonly<Record<string, string>>;
818
829
  }
819
830
  /** The options of `enumerateSpace`. */
820
831
  export type EnumerateOptions = GridOptions | SampleOptions;
@@ -874,6 +885,7 @@ export declare function spaceSize(space: StrategySpace, options: SpaceSizeOption
874
885
  * - A meta option with a `pool` gives only the entries of its pool. With `shapes`, only the entries whose members support each kind count.
875
886
  * - A sample draws again when a point chooses a meta option without a member list. `spaceSize` gives such an option 0.
876
887
  * - With `shapes`, a sample throws a `RangeError` when the space has no config for the kinds. The error names the stages without an option and the meta options without members.
888
+ * - With `fixed`, each config has the fixed option at each named stage. A fixed option that the space, the shape filter or the constraints do not permit gets a `RangeError` with the reason.
877
889
  */
878
890
  export declare function enumerateSpace(space: StrategySpace, options: EnumerateOptions): StrategyConfig[];
879
891
  /**
@@ -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/strategy-options.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;;;;;;YAOC,WAAW,SAAS;;iBAGf;WACN;W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;;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":[],"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/strategy-options.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;;;;;;YAOC,WAAW,SAAS;;iBAGf;WACN;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;YAIC,WAAW,KAAK;;;;;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AO,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
@@ -2918,13 +2918,16 @@ function fitsWalk(constraints, fixed, stage, id) {
2918
2918
  fixed.delete(stage);
2919
2919
  return ok;
2920
2920
  }
2921
- /** This function gives the plan of a walk. Stages of equal size keep the order of the space. */
2922
- function walkPlan(stages, lists, constraints, n) {
2921
+ /**
2922
+ * This function gives the plan of a walk. Stages of equal size keep the order of the space.
2923
+ * The stages of `first` go first, for example the stages of the sample option `fixed`. Thus the other stages draw only from the options that keep the constraints with them.
2924
+ */
2925
+ function walkPlan(stages, lists, constraints, n, first = /* @__PURE__ */ new Set()) {
2923
2926
  return {
2924
2927
  stages,
2925
2928
  lists,
2926
2929
  n,
2927
- order: stages.map((_, k) => k).sort((a, b) => lists[b].length - lists[a].length || a - b),
2930
+ order: stages.map((_, k) => k).sort((a, b) => Number(first.has(stages[b].name)) - Number(first.has(stages[a].name)) || lists[b].length - lists[a].length || a - b),
2928
2931
  naming: stages.map((s) => constraints.filter((c) => c.if.stage === s.name || otherStage(c) === s.name))
2929
2932
  };
2930
2933
  }
@@ -3073,7 +3076,9 @@ function optionProblems(stage, o) {
3073
3076
  if (o.supports !== void 0) out.push(...supportsProblems(o.supports, at));
3074
3077
  if (o.members !== void 0) {
3075
3078
  const { min, max, ordered } = o.members;
3076
- if (!Number.isInteger(min) || !Number.isInteger(max) || min < 1 || min > max || typeof ordered !== "boolean") out.push(["members", `${at} has a member rule without whole counts 1 <= min <= max and a boolean ordered`]);
3079
+ const noList = min === 0 && max === 0;
3080
+ if (!Number.isInteger(min) || !Number.isInteger(max) || !noList && (min < 1 || min > max) || typeof ordered !== "boolean") out.push(["members", `${at} has a member rule without whole counts 1 <= min <= max or min = max = 0, and a boolean ordered`]);
3081
+ if (noList && (o.members.pool !== void 0 || o.members.view !== void 0)) out.push(["members", `${at} has no member list, so its member rule cannot have a pool or a view`]);
3077
3082
  const pool = o.members.pool;
3078
3083
  if (pool !== void 0 && (!Array.isArray(pool) || pool.length === 0 || !pool.every((entry) => Array.isArray(entry)))) out.push(["pool", `${at} has a pool that is not a list of one or more member lists`]);
3079
3084
  const view = o.members.view;
@@ -3592,7 +3597,7 @@ const memberSpaces = /* @__PURE__ */ new WeakMap();
3592
3597
  * This function tells if an option of a restricted space has a member list. A base option and a meta option with a `pool` have one.
3593
3598
  * A different meta option has one when its members have a base config. `restrict` keeps only the pool entries that fit.
3594
3599
  */
3595
- const hasMembers = (space, stage, o) => o.members === void 0 || o.members.pool !== void 0 || combos(memberSpaces.get(o) ?? partOf(space, stage).space, 1, false, 0n).length > 0;
3600
+ const hasMembers = (space, stage, o) => o.members === void 0 || o.members.max === 0 || o.members.pool !== void 0 || combos(memberSpaces.get(o) ?? partOf(space, stage).space, 1, false, 0n).length > 0;
3596
3601
  /** This function tells if a restricted space has a config. A base config counts. With `meta`, a meta config counts when each of its meta options has a member list. */
3597
3602
  const hasConfig = (space, meta) => combos(space, 1, meta, 0n).some((c) => c.base || [...c.choices].every(([stage, o]) => o === null || hasMembers(space, stage, o)));
3598
3603
  /** This function gives the error of a sample of a space that has no config for the shape kinds `shapes`. `kept` is the restricted space. */
@@ -3609,6 +3614,68 @@ function noSample(space, kept, shapes, meta) {
3609
3614
  if (empty.length === 0 && removed.length === 0) text += " The constraints remove each config.";
3610
3615
  return new RangeError(text);
3611
3616
  }
3617
+ /** This function gives a constraint in words, for the reason of an error. */
3618
+ function constraintText(c) {
3619
+ const ref = (r) => `${r.stage} ${r.option === null ? "has no option" : `is ${r.option}`}`;
3620
+ return "not" in c.then ? `if ${ref(c.if)}, then not ${ref(c.then.not)}` : `if ${ref(c.if)}, then ${ref(c.then)}`;
3621
+ }
3622
+ /**
3623
+ * This function throws a `RangeError` for a bad `fixed` option of a sample. A stage or an option that the space does not have is bad.
3624
+ * A meta option without `meta: "sample"` is bad, and so are two fixed options that a constraint forbids.
3625
+ */
3626
+ function assertFixed(space, fixed, meta) {
3627
+ for (const [stage, id] of Object.entries(fixed)) {
3628
+ const s = space.stages.find((x) => x.name === stage);
3629
+ if (s === void 0) throw new RangeError(`The option fixed names the stage ${stage}, and the space ${space.engine} has no such stage.`);
3630
+ const o = s.options.find((x) => x.id === id);
3631
+ if (o === void 0) throw new RangeError(`The option fixed names the option ${String(id)} of the stage ${stage}, and the stage has no such option.`);
3632
+ if (o.members !== void 0 && !meta) throw new RangeError(`The option fixed names the meta option ${stage}.${id}, and a sample with meta skip has no meta option. Set meta to "sample".`);
3633
+ }
3634
+ const ids = new Map(Object.entries(fixed));
3635
+ const other = (c) => "not" in c.then ? c.then.not.stage : c.then.stage;
3636
+ const broken = (space.constraints ?? []).filter((c) => ids.has(c.if.stage) && ids.has(other(c)) && !holds(c, ids));
3637
+ if (broken.length > 0) {
3638
+ const names = Object.entries(fixed).map(([stage, id]) => `${stage}.${id}`);
3639
+ throw new RangeError(`The constraints of the space ${space.engine} forbid the fixed options ${names.join(", ")}. The broken constraints: ${broken.map(constraintText).join("; ")}.`);
3640
+ }
3641
+ }
3642
+ /**
3643
+ * This function gives the restricted space `kept` with only the fixed option at each fixed stage. A fixed stage that was optional stops being optional.
3644
+ * A meta option of another stage of the part of a fixed stage goes out. A sample gives no option to the other stages of the part of its meta option.
3645
+ */
3646
+ function fixStages(space, kept, fixed, shapes) {
3647
+ const prefix = prefixes(kept);
3648
+ const parts = new Set(Object.keys(fixed).map((stage) => prefix.get(stage)));
3649
+ const stages = kept.stages.map((s) => {
3650
+ const id = fixed[s.name];
3651
+ if (id === void 0) return parts.has(prefix.get(s.name)) ? {
3652
+ ...s,
3653
+ options: s.options.filter((o) => o.members === void 0)
3654
+ } : s;
3655
+ const options = s.options.filter((o) => o.id === id).map((o) => o.members === void 0 ? o : withMemberSpace(o, memberSpaces.get(o) ?? partOf(kept, s.name).space));
3656
+ if (options.length === 0) throw new RangeError(`The fixed option ${s.name}.${id} of the space ${space.engine} does not support the shape kinds ${(shapes ?? []).join(", ")}.`);
3657
+ return {
3658
+ ...s,
3659
+ options,
3660
+ optional: false
3661
+ };
3662
+ });
3663
+ return {
3664
+ ...kept,
3665
+ stages
3666
+ };
3667
+ }
3668
+ /** This function gives a copy of a meta option whose members come from `members`. */
3669
+ function withMemberSpace(o, members) {
3670
+ const copy = { ...o };
3671
+ memberSpaces.set(copy, members);
3672
+ return copy;
3673
+ }
3674
+ /** This function gives the error of a sample whose fixed options keep each constraint between them. The constraints with the other stages remove each config. */
3675
+ function noFixedSample(space, fixed) {
3676
+ const names = Object.entries(fixed).map(([stage, id]) => `${stage}.${id}`);
3677
+ return /* @__PURE__ */ new RangeError(`The space ${space.engine} has no config with the fixed options ${names.join(", ")}. No constraint between two fixed options breaks, so the constraints with the other stages remove each config.`);
3678
+ }
3612
3679
  /** This function gives the count of the base configs of a space that is known to be good. */
3613
3680
  const baseCount = (space, levels, limit) => combos(space, levels, false, limit).reduce((sum, c) => sum + c.weight, 0n);
3614
3681
  /** This function throws a `RangeError` for a list of shape kinds with a kind that is not declared. */
@@ -3691,10 +3758,10 @@ const subSeed = (seed, step) => Math.floor(stepRandom(seed, step)() * 4294967296
3691
3758
  * This function gives a sample of a space: Latin hypercube strata over the options, the params and the member counts.
3692
3759
  * `canon` is the space of `canonicalConfig`: the space before a shape filter. A member of an option with `view: "bounds"` can have an option that the filter removed.
3693
3760
  */
3694
- function sampleConfigs(space, n, seed, meta, maxTries, canon = space, walk = false) {
3761
+ function sampleConfigs(space, n, seed, meta, maxTries, canon = space, walk = false, first = /* @__PURE__ */ new Set()) {
3695
3762
  const stages = space.stages;
3696
3763
  const prefix = prefixes(space);
3697
- const bounded = new Set(stages.filter((s) => meta && s.options.some((o) => memberSpaces.has(o))).map((s) => prefix.get(s.name)));
3764
+ const bounded = new Set(stages.filter((s) => meta && s.options.some((o) => memberSpaces.has(o) || o.members?.max === 0)).map((s) => prefix.get(s.name)));
3698
3765
  const lists = stages.map((s) => {
3699
3766
  const list = s.options.filter((o) => meta || o.members === void 0);
3700
3767
  if (s.optional) list.push(null);
@@ -3708,7 +3775,7 @@ function sampleConfigs(space, n, seed, meta, maxTries, canon = space, walk = fal
3708
3775
  if (!usable.has(o)) usable.set(o, hasMembers(space, s.name, o));
3709
3776
  return usable.get(o);
3710
3777
  };
3711
- const plan = walk ? walkPlan(stages, lists, space.constraints ?? [], n) : null;
3778
+ const plan = walk ? walkPlan(stages, lists, space.constraints ?? [], n, first) : null;
3712
3779
  const points = [];
3713
3780
  let tries = 0;
3714
3781
  for (let round = 0; points.length < n; round++) {
@@ -3741,7 +3808,7 @@ function sampleConfigs(space, n, seed, meta, maxTries, canon = space, walk = fal
3741
3808
  values[active[j]][k][p.name] = sampleValue(p, (stratum + r()) / active.length);
3742
3809
  });
3743
3810
  }
3744
- if (o.members === void 0) continue;
3811
+ if (o.members === void 0 || o.members.max === 0) continue;
3745
3812
  const fixed = o.members.pool;
3746
3813
  if (fixed !== void 0) {
3747
3814
  const r = stepRandom(seed, `pool-entry:${s.name}:${o.id}`);
@@ -3797,6 +3864,7 @@ function sampleConfigs(space, n, seed, meta, maxTries, canon = space, walk = fal
3797
3864
  * - A meta option with a `pool` gives only the entries of its pool. With `shapes`, only the entries whose members support each kind count.
3798
3865
  * - A sample draws again when a point chooses a meta option without a member list. `spaceSize` gives such an option 0.
3799
3866
  * - With `shapes`, a sample throws a `RangeError` when the space has no config for the kinds. The error names the stages without an option and the meta options without members.
3867
+ * - With `fixed`, each config has the fixed option at each named stage. A fixed option that the space, the shape filter or the constraints do not permit gets a `RangeError` with the reason.
3800
3868
  */
3801
3869
  function enumerateSpace(space, options) {
3802
3870
  assertSpace(space);
@@ -3812,12 +3880,16 @@ function enumerateSpace(space, options) {
3812
3880
  if (meta !== "skip" && meta !== "sample") throw new RangeError(`The option meta is ${String(meta)}, not skip or sample.`);
3813
3881
  const draw = options.draw ?? "reject";
3814
3882
  if (draw !== "reject" && draw !== "walk") throw new RangeError(`The option draw is ${String(draw)}, not reject or walk.`);
3883
+ const fixed = options.fixed;
3884
+ if (fixed !== void 0) assertFixed(space, fixed, meta === "sample");
3815
3885
  if (options.n === 0) return [];
3816
3886
  const kept = restrict(space, options.shapes);
3887
+ const drawn = fixed === void 0 ? kept : fixStages(space, kept, fixed, options.shapes);
3817
3888
  try {
3818
- return sampleConfigs(kept, options.n, options.seed, meta === "sample", options.maxTries ?? Math.max(1e3, 100 * options.n), space, draw === "walk");
3889
+ return sampleConfigs(drawn, options.n, options.seed, meta === "sample", options.maxTries ?? Math.max(1e3, 100 * options.n), space, draw === "walk", new Set(Object.keys(fixed ?? {})));
3819
3890
  } catch (error) {
3820
3891
  if (options.shapes !== void 0 && !hasConfig(kept, meta === "sample")) throw noSample(space, kept, options.shapes, meta === "sample");
3892
+ if (fixed !== void 0 && !hasConfig(drawn, meta === "sample")) throw noFixedSample(space, fixed);
3821
3893
  throw error;
3822
3894
  }
3823
3895
  }