@elaraai/e3 1.0.98 → 1.0.100

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.
Files changed (146) hide show
  1. package/README.md +4 -5
  2. package/dist/src/browser.d.ts +2 -0
  3. package/dist/src/browser.d.ts.map +1 -1
  4. package/dist/src/browser.js +6 -0
  5. package/dist/src/browser.js.map +1 -1
  6. package/dist/src/environment-capture.d.ts +21 -0
  7. package/dist/src/environment-capture.d.ts.map +1 -1
  8. package/dist/src/environment-capture.js +48 -0
  9. package/dist/src/environment-capture.js.map +1 -1
  10. package/dist/src/export.d.ts +10 -5
  11. package/dist/src/export.d.ts.map +1 -1
  12. package/dist/src/export.js +31 -47
  13. package/dist/src/export.js.map +1 -1
  14. package/dist/src/export.spec.js +27 -16
  15. package/dist/src/export.spec.js.map +1 -1
  16. package/dist/src/function.d.ts.map +1 -1
  17. package/dist/src/function.js.map +1 -1
  18. package/dist/src/functions-cache.d.ts +60 -0
  19. package/dist/src/functions-cache.d.ts.map +1 -0
  20. package/dist/src/functions-cache.js +165 -0
  21. package/dist/src/functions-cache.js.map +1 -0
  22. package/dist/src/functions-link.spec.js +191 -12
  23. package/dist/src/functions-link.spec.js.map +1 -1
  24. package/dist/src/functions-resolve.d.ts +52 -23
  25. package/dist/src/functions-resolve.d.ts.map +1 -1
  26. package/dist/src/functions-resolve.js +244 -96
  27. package/dist/src/functions-resolve.js.map +1 -1
  28. package/dist/src/index.d.ts +8 -61
  29. package/dist/src/index.d.ts.map +1 -1
  30. package/dist/src/index.js +3 -8
  31. package/dist/src/index.js.map +1 -1
  32. package/dist/src/internal.d.ts +53 -0
  33. package/dist/src/internal.d.ts.map +1 -0
  34. package/dist/src/internal.js +29 -0
  35. package/dist/src/internal.js.map +1 -0
  36. package/dist/src/lazy-build.d.ts +25 -0
  37. package/dist/src/lazy-build.d.ts.map +1 -0
  38. package/dist/src/lazy-build.js +56 -0
  39. package/dist/src/lazy-build.js.map +1 -0
  40. package/dist/src/lazy-build.spec.d.ts +6 -0
  41. package/dist/src/lazy-build.spec.d.ts.map +1 -0
  42. package/dist/src/lazy-build.spec.js +153 -0
  43. package/dist/src/lazy-build.spec.js.map +1 -0
  44. package/dist/src/migration.d.ts +20 -163
  45. package/dist/src/migration.d.ts.map +1 -1
  46. package/dist/src/migration.js +37 -34
  47. package/dist/src/migration.js.map +1 -1
  48. package/dist/src/migration.spec.js +83 -78
  49. package/dist/src/migration.spec.js.map +1 -1
  50. package/dist/src/mutation-programs.spec.js +211 -118
  51. package/dist/src/mutation-programs.spec.js.map +1 -1
  52. package/dist/src/mutation.d.ts +37 -141
  53. package/dist/src/mutation.d.ts.map +1 -1
  54. package/dist/src/mutation.js +66 -28
  55. package/dist/src/mutation.js.map +1 -1
  56. package/dist/src/open-beast-link.spec.js +1 -1
  57. package/dist/src/open-beast-link.spec.js.map +1 -1
  58. package/dist/src/output.js.map +1 -1
  59. package/dist/src/package.d.ts +2 -38
  60. package/dist/src/package.d.ts.map +1 -1
  61. package/dist/src/package.js +42 -175
  62. package/dist/src/package.js.map +1 -1
  63. package/dist/src/record-area.d.ts +49 -37
  64. package/dist/src/record-area.d.ts.map +1 -1
  65. package/dist/src/record-area.js +211 -131
  66. package/dist/src/record-area.js.map +1 -1
  67. package/dist/src/record-area.spec.js +79 -62
  68. package/dist/src/record-area.spec.js.map +1 -1
  69. package/dist/src/record-arguments.d.ts +55 -0
  70. package/dist/src/record-arguments.d.ts.map +1 -0
  71. package/dist/src/record-arguments.js +72 -0
  72. package/dist/src/record-arguments.js.map +1 -0
  73. package/dist/src/record-builders.d.ts +547 -0
  74. package/dist/src/record-builders.d.ts.map +1 -0
  75. package/dist/src/record-builders.js +112 -0
  76. package/dist/src/record-builders.js.map +1 -0
  77. package/dist/src/record-declared.spec.d.ts +6 -0
  78. package/dist/src/record-declared.spec.d.ts.map +1 -0
  79. package/dist/src/record-declared.spec.js +251 -0
  80. package/dist/src/record-declared.spec.js.map +1 -0
  81. package/dist/src/record-guards.d.ts +114 -1
  82. package/dist/src/record-guards.d.ts.map +1 -1
  83. package/dist/src/record-guards.js +153 -2
  84. package/dist/src/record-guards.js.map +1 -1
  85. package/dist/src/record-index.d.ts +128 -350
  86. package/dist/src/record-index.d.ts.map +1 -1
  87. package/dist/src/record-index.js +44 -481
  88. package/dist/src/record-index.js.map +1 -1
  89. package/dist/src/record-index.spec.js +124 -90
  90. package/dist/src/record-index.spec.js.map +1 -1
  91. package/dist/src/record-interval.d.ts +57 -36
  92. package/dist/src/record-interval.d.ts.map +1 -1
  93. package/dist/src/record-interval.js +136 -94
  94. package/dist/src/record-interval.js.map +1 -1
  95. package/dist/src/record-interval.spec.js +48 -27
  96. package/dist/src/record-interval.spec.js.map +1 -1
  97. package/dist/src/record-keys.d.ts +146 -0
  98. package/dist/src/record-keys.d.ts.map +1 -0
  99. package/dist/src/record-keys.js +178 -0
  100. package/dist/src/record-keys.js.map +1 -0
  101. package/dist/src/record-nested-programs.d.ts +1457 -0
  102. package/dist/src/record-nested-programs.d.ts.map +1 -0
  103. package/dist/src/record-nested-programs.js +1974 -0
  104. package/dist/src/record-nested-programs.js.map +1 -0
  105. package/dist/src/record-nested.d.ts +284 -0
  106. package/dist/src/record-nested.d.ts.map +1 -0
  107. package/dist/src/record-nested.js +304 -0
  108. package/dist/src/record-nested.js.map +1 -0
  109. package/dist/src/record-nested.spec.d.ts +6 -0
  110. package/dist/src/record-nested.spec.d.ts.map +1 -0
  111. package/dist/src/record-nested.spec.js +1032 -0
  112. package/dist/src/record-nested.spec.js.map +1 -0
  113. package/dist/src/record-patches.d.ts +25 -0
  114. package/dist/src/record-patches.d.ts.map +1 -0
  115. package/dist/src/record-patches.js +27 -0
  116. package/dist/src/record-patches.js.map +1 -0
  117. package/dist/src/record-programs.d.ts +192 -26
  118. package/dist/src/record-programs.d.ts.map +1 -1
  119. package/dist/src/record-programs.js +858 -350
  120. package/dist/src/record-programs.js.map +1 -1
  121. package/dist/src/record-programs.spec.d.ts +6 -0
  122. package/dist/src/record-programs.spec.d.ts.map +1 -0
  123. package/dist/src/record-programs.spec.js +242 -0
  124. package/dist/src/record-programs.spec.js.map +1 -0
  125. package/dist/src/record-series.d.ts +101 -97
  126. package/dist/src/record-series.d.ts.map +1 -1
  127. package/dist/src/record-series.js +198 -149
  128. package/dist/src/record-series.js.map +1 -1
  129. package/dist/src/record-series.spec.js +241 -120
  130. package/dist/src/record-series.spec.js.map +1 -1
  131. package/dist/src/record-tiles.d.ts +328 -37
  132. package/dist/src/record-tiles.d.ts.map +1 -1
  133. package/dist/src/record-tiles.js +289 -100
  134. package/dist/src/record-tiles.js.map +1 -1
  135. package/dist/src/record.d.ts +66 -12
  136. package/dist/src/record.d.ts.map +1 -1
  137. package/dist/src/record.js +103 -34
  138. package/dist/src/record.js.map +1 -1
  139. package/dist/src/record.spec.js +48 -63
  140. package/dist/src/record.spec.js.map +1 -1
  141. package/dist/src/task.d.ts.map +1 -1
  142. package/dist/src/task.js +4 -1
  143. package/dist/src/task.js.map +1 -1
  144. package/dist/src/types.d.ts +103 -37
  145. package/dist/src/types.d.ts.map +1 -1
  146. package/package.json +7 -3
@@ -21,26 +21,28 @@
21
21
  * runtime — TypeScript, C, Python — files a row under the same key, which is
22
22
  * what lets a maintained index equal its rebuild byte for byte.
23
23
  */
24
- import { East, Expr, FloatType, IntegerType, OptionType, StructType, SetType, isTypeEqual, printType, } from '@elaraai/east';
24
+ import { East, FloatType, IntegerType, OptionType, SetType, StructType, isTypeEqual, none, printType, some } from '@elaraai/east';
25
+ import { INDEX_PURITY, checkEntryParams, checkPure, indexRunner, indexedEntry, onlyOptions, signatureOf } from './record-guards.js';
26
+ import { checkLeading, fieldReader, leadingValue, leadingValues, optionField } from './record-keys.js';
27
+ import { lazyBuilds } from './lazy-build.js';
25
28
  /** The finest level: a level-28 cell is `cell` wide. */
26
29
  export const AREA_FINEST_LEVEL = 28;
27
30
  /** The key of a row with no place: its `x` or its `y` is `none`. */
28
31
  export const AREA_UNPLACED = -1n;
29
- /** The reserved name of the area index's generated key field. */
30
- export const AREA_FIELD = '__area';
31
32
  /**
32
33
  * The exponent of the largest power of two at most `cell`: the finest cell's
33
34
  * side, as the index files rows by it.
34
35
  *
36
+ * @param constructor - The declaration, for the refusal
35
37
  * @param name - The index, for the refusal
36
38
  * @param cell - The finest cell's side the author declared, in world units
37
39
  * @returns `e`, with `2^e ≤ cell < 2^(e+1)`
38
40
  * @throws {Error} When `cell` is not a positive finite number, or is so large or
39
41
  * small that the domain, `2^(e+27)` either side of zero, is not a finite Float
40
42
  */
41
- export function areaCellExponent(name, cell) {
43
+ export function areaCellExponent(constructor, name, cell) {
42
44
  if (typeof cell !== 'number' || !Number.isFinite(cell) || cell <= 0) {
43
- throw new Error(`e3.recordIndex.area '${name}' takes a cell: the finest cell's side in world units, ` +
45
+ throw new Error(`${constructor} '${name}' takes a cell: the finest cell's side in world units, ` +
44
46
  `a positive number (0.01 for a floor in metres, 1 for one in millimetres) — got ${String(cell)}`);
45
47
  }
46
48
  let e = Math.floor(Math.log2(cell));
@@ -51,160 +53,238 @@ export function areaCellExponent(name, cell) {
51
53
  // The domain is 2^(e+27) either side of zero, and a cell 2^e: both must be
52
54
  // normal, finite Floats for the arithmetic to stay exact.
53
55
  if (e + 28 > 1023 || e < -1022) {
54
- throw new Error(`e3.recordIndex.area '${name}' cell ${cell} is out of range: its domain, 2^${e + 27} world units either side of zero, is not a finite Float`);
56
+ throw new Error(`${constructor} '${name}' cell ${cell} is out of range: its domain, 2^${e + 27} world units either side of zero, is not a finite Float`);
55
57
  }
56
58
  return e;
57
59
  }
60
+ /** The finest level's cells either side of zero: the domain is `cell · 2^27` either side. */
61
+ const HALF_CELLS = 2 ** 27;
62
+ /** {@link HALF_CELLS}, an Integer. */
63
+ const HALF_CELLS_INTEGER = 1n << 27n;
64
+ /** {@link AREA_FINEST_LEVEL}, an Integer. */
65
+ const FINEST_LEVEL = 28n;
58
66
  /**
59
- * The `__area` key of a box, from its centre and its larger side: an East
60
- * function, so every runtime computes it alike.
67
+ * An area index's definition (`index.area`): its key function, one
68
+ * entry per row — one per combination of its leading values where a Set among
69
+ * them fans out — `{ on: { …on }, area }`, the row's leading fields under `on`
70
+ * and the cell's code beside them (#1432); and its projection, the whole row,
71
+ * so a window reads the index alone and no record segment (D29). It stays an
72
+ * ordinary maintained index: mutation, rebuild, storage and transport are
73
+ * shared.
61
74
  *
62
- * @param exponent - The finest cell's side is `2^exponent` world units
63
- * @returns `(cx, cy, side) → Integer`: the level-28 Morton code of the box's
64
- * cell, times 32, plus its level; `0`, the root, for a box outside the domain,
65
- * not finite, or larger than half the domain
75
+ * @param constructor - The declaration, as a refusal names it
76
+ * @param name - The index
77
+ * @param rec - Its record
78
+ * @param spec - The box's fields, whether `x`, `y` is its centre or its corner, the finest cell, and the optional leading `on`
79
+ * @param config - Its runner selection
80
+ * @returns The definition
81
+ * @throws {Error} When a field is not of its option's type, naming the option, the field and its type; when `x` and `y`
82
+ * are not both Options or neither; when `width` and `height` are not given together; or on any guard every index applies
66
83
  */
67
- export function areaCode(exponent) {
68
- const cell = 2 ** exponent;
69
- const half = 2 ** (exponent + 27);
70
- const finest = BigInt(AREA_FINEST_LEVEL);
71
- return East.function([FloatType, FloatType, FloatType], IntegerType, ($, cx, cy, side) => {
72
- // A value is finite exactly when it less itself is zero: an infinity's, or a NaN's, is a NaN.
73
- const finite = (value) => value.subtract(value).equal(0.0);
74
- const inside = (value) => value.greaterEqual(-half).and(() => value.less(half));
75
- $.if(finite(cx).and(() => finite(cy)).and(() => finite(side)).not()
76
- .or(() => inside(cx).not()).or(() => inside(cy).not()).or(() => side.greater(half)), ($) => {
77
- $.return(0n);
78
- });
79
- // The deepest level whose cell is at least twice the box's larger side:
80
- // each step up doubles the cell, exactly, and the step between its cells'
81
- // indices at the finest level. A side at most half the domain stops at the
82
- // root at the latest.
83
- const level = $.let(finest);
84
- const size = $.let(cell);
85
- const step = $.let(1n);
86
- const twice = $.let(side.multiply(2.0));
87
- $.while(size.less(twice), ($) => {
88
- $.assign(size, size.multiply(2.0));
89
- $.assign(level, level.subtract(1n));
90
- $.assign(step, step.multiply(2n));
91
- });
92
- // The finest cell holding the centre: a division by a power of two, and its
93
- // floor, are exact; the domain's lower edge is cell 0. Then the level's
94
- // cell holding it, aligned to the finest level: the bits below it cleared.
95
- const ix = $.let(East.Float.roundFloor(cx.divide(cell)).add(1n << 27n).divide(step).multiply(step));
96
- const iy = $.let(East.Float.roundFloor(cy.divide(cell)).add(1n << 27n).divide(step).multiply(step));
97
- // Its Morton code: x in the even bits, y in the odd.
98
- const code = $.let(0n);
99
- const bit = $.let(1n);
100
- $.for(East.Array.range(0n, finest), ($) => {
101
- $.assign(code, code.add(ix.remainder(2n).multiply(bit)).add(iy.remainder(2n).multiply(bit).multiply(2n)));
102
- $.assign(ix, ix.divide(2n));
103
- $.assign(iy, iy.divide(2n));
104
- $.assign(bit, bit.multiply(4n));
105
- });
106
- $.return(code.multiply(32n).add(level));
107
- });
108
- }
109
- /**
110
- * Generate the area index's pure key function: one entry per row (one per
111
- * element of a Set among the leading `on` fields), `{ …on, __area }`, using
112
- * the field index's generated function for the leading fields, as the
113
- * interval index does. It stays an ordinary maintained index: mutation,
114
- * rebuild, storage and transport are shared.
115
- *
116
- * @param name - The index, for the refusals
117
- * @param keyType - The record's key type
118
- * @param valueType - The record's row type
119
- * @param on - The exact leading fields
120
- * @param box - How the row's box is read
121
- * @param exponent - The finest cell's side is `2^exponent`
122
- * @param prefix - The leading fields' generated key function
123
- * @returns The key function, whether it fans out, and whether `x` and `y` are Options
124
- * @throws {Error} When a field is not of its option's type, naming the option,
125
- * the field and its type; when `x` and `y` are not both Options or neither;
126
- * when `width` and `height` are not given together; or when the row has a
127
- * field named `__area`, which is reserved
128
- */
129
- export function areaKey(name, keyType, valueType, on, box, exponent, prefix) {
84
+ export function areaDefinition(constructor, name, rec, spec, config) {
85
+ const { keyType, valueType } = indexedEntry(constructor, name, rec);
86
+ onlyOptions(constructor, name, spec, ['on', 'x', 'y', 'width', 'height', 'at', 'cell'], 'value' in spec ? 'an area index carries the whole row as its projection, so it takes no value' : undefined);
87
+ const exponent = areaCellExponent(constructor, name, spec.cell);
88
+ const box = {
89
+ x: spec.x, y: spec.y,
90
+ ...(spec.width !== undefined && { width: spec.width }),
91
+ ...(spec.height !== undefined && { height: spec.height }),
92
+ at: spec.at ?? 'corner',
93
+ };
130
94
  if (valueType.type !== 'Struct')
131
- throw new Error(`e3.recordIndex.area '${name}' indexes a record with Struct rows`);
95
+ throw new Error(`${constructor} '${name}' indexes a record with Struct rows`);
132
96
  const rowType = valueType;
133
- if (Object.hasOwn(rowType.fields, AREA_FIELD)) {
134
- throw new Error(`e3.recordIndex.area '${name}': the row has a field named '${AREA_FIELD}', which an area index reserves for its key`);
135
- }
136
97
  const typeOf = (option, field) => {
137
98
  const type = rowType.fields[field];
138
99
  if (type === undefined)
139
- throw new Error(`e3.recordIndex.area '${name}' ${option} names unknown row field '${field}'`);
100
+ throw new Error(`${constructor} '${name}' ${option} names unknown row field '${field}'`);
140
101
  return type;
141
102
  };
142
- const placeOptional = (option, field) => {
103
+ const placeOf = (option, field) => {
143
104
  const type = typeOf(option, field);
144
- if (isTypeEqual(type, FloatType))
145
- return false;
146
- if (isTypeEqual(type, OptionType(FloatType)))
147
- return true;
148
- throw new Error(`e3.recordIndex.area '${name}' ${option} names '${field}', of type ${printType(type)}: ${option} is a Float or an Option<Float> field`);
105
+ const place = optionField(rowType, field, FloatType);
106
+ if (place === undefined) {
107
+ throw new Error(`${constructor} '${name}' ${option} names '${field}', of type ${printType(type)}: ${option} is a Float or an Option<Float> field`);
108
+ }
109
+ return place;
149
110
  };
150
- const optional = placeOptional('x', box.x);
151
- if (placeOptional('y', box.y) !== optional) {
152
- throw new Error(`e3.recordIndex.area '${name}': x '${box.x}' and y '${box.y}' are both Options, or neither — a row is placed, or not, by both`);
111
+ const x = placeOf('x', box.x);
112
+ const y = placeOf('y', box.y);
113
+ if (x.optional !== y.optional) {
114
+ throw new Error(`${constructor} '${name}': x '${box.x}' and y '${box.y}' are both Options, or neither — a row is placed, or not, by both`);
153
115
  }
154
116
  if ((box.width === undefined) !== (box.height === undefined)) {
155
- throw new Error(`e3.recordIndex.area '${name}' takes width and height together, or neither for a point`);
117
+ throw new Error(`${constructor} '${name}' takes width and height together, or neither for a point`);
156
118
  }
157
119
  for (const [option, field] of [['width', box.width], ['height', box.height]]) {
158
120
  if (field === undefined)
159
121
  continue;
160
122
  const type = typeOf(option, field);
161
123
  if (!isTypeEqual(type, FloatType)) {
162
- throw new Error(`e3.recordIndex.area '${name}' ${option} names '${field}', of type ${printType(type)}: ${option} is a Float field`);
124
+ throw new Error(`${constructor} '${name}' ${option} names '${field}', of type ${printType(type)}: ${option} is a Float field`);
163
125
  }
164
126
  }
165
127
  if (box.at !== 'corner' && box.at !== 'centre') {
166
- throw new Error(`e3.recordIndex.area '${name}' at is "corner" or "centre", not ${JSON.stringify(box.at)}`);
128
+ throw new Error(`${constructor} '${name}' at is "corner" or "centre", not ${String(box.at)}`);
167
129
  }
168
- const fields = Object.fromEntries(on.map((field) => {
169
- const type = rowType.fields[field];
170
- return [field, type.type === 'Set' ? type.key : type];
171
- }));
172
- const indexType = StructType({ ...fields, [AREA_FIELD]: IntegerType });
173
- const multi = prefix?.multi ?? false;
174
- const prefixType = prefix === undefined ? undefined : Expr.type(prefix.fn);
175
- const code = areaCode(exponent);
176
- // Dynamic field names are erased only inside this generated East function,
177
- // as in the field and interval key generators; every type was checked above.
178
- const fn = East.function([keyType, rowType], (multi ? SetType(indexType) : indexType), ($, key, row) => {
179
- const locate = $.const(code);
180
- // The box's larger side; a point has none.
181
- const larger = $.let(box.width === undefined ? 0.0
182
- : row[box.width].abs().greaterEqual(row[box.height].abs()).ifElse(() => row[box.width].abs(), () => row[box.height].abs()), FloatType);
183
- // Its centre: `x`, `y` itself, or the minimum corner plus half the box.
184
- const centre = (at, extent) => box.at === 'centre' || extent === undefined
185
- ? at : at.add(row[extent].divide(2.0));
130
+ const on = spec.on ?? [];
131
+ const leading = checkLeading(constructor, name, rowType, on);
132
+ const indexType = StructType({ on: leading.onType, area: IntegerType });
133
+ // The row's box as the code reads it: its centre, `none` for a row not placed, and its larger side, a point's none.
134
+ const BoxType = StructType({ cx: OptionType(FloatType), cy: OptionType(FloatType), side: FloatType });
135
+ const readX = fieldReader(keyType, rowType, { option: x });
136
+ const readY = fieldReader(keyType, rowType, { option: y });
137
+ const size = box.width === undefined || box.height === undefined ? undefined : {
138
+ width: fieldReader(keyType, rowType, { field: box.width, type: FloatType }),
139
+ height: fieldReader(keyType, rowType, { field: box.height, type: FloatType }),
140
+ };
141
+ const boxOf = size === undefined
142
+ // A point: its place, no side.
143
+ ? East.function([keyType, rowType], BoxType, ($, key, row) => {
144
+ const xOf = $.const(readX);
145
+ const yOf = $.const(readY);
146
+ return { cx: xOf(key, row), cy: yOf(key, row), side: 0.0 };
147
+ })
148
+ : box.at === 'corner'
149
+ // A box by its minimum corner: its centre half the box on.
150
+ ? East.function([keyType, rowType], BoxType, ($, key, row) => {
151
+ const xOf = $.const(readX);
152
+ const yOf = $.const(readY);
153
+ const widthOf = $.const(size.width);
154
+ const heightOf = $.const(size.height);
155
+ const larger = $.const(AREA_FNS.largerSide);
156
+ const width = $.let(widthOf(key, row));
157
+ const height = $.let(heightOf(key, row));
158
+ return {
159
+ cx: xOf(key, row).match({ some: (_$, cx) => some(cx.add(width.divide(2.0))), none: () => none }),
160
+ cy: yOf(key, row).match({ some: (_$, cy) => some(cy.add(height.divide(2.0))), none: () => none }),
161
+ side: larger(width, height),
162
+ };
163
+ })
164
+ // A box by its centre.
165
+ : East.function([keyType, rowType], BoxType, ($, key, row) => {
166
+ const xOf = $.const(readX);
167
+ const yOf = $.const(readY);
168
+ const widthOf = $.const(size.width);
169
+ const heightOf = $.const(size.height);
170
+ const larger = $.const(AREA_FNS.largerSide);
171
+ return { cx: xOf(key, row), cy: yOf(key, row), side: larger(widthOf(key, row), heightOf(key, row)) };
172
+ });
173
+ // The row's cell code: unplaced, or the cell of its box's centre and larger side.
174
+ const areaOf = East.function([keyType, rowType], IntegerType, ($, key, row) => {
175
+ const locate = $.const(AREA_FNS.areaCode);
176
+ const read = $.const(boxOf);
177
+ const at = $.let(read(key, row));
186
178
  const area = $.let(AREA_UNPLACED, IntegerType);
187
- if (optional) {
188
- $.match(row[box.x], { some: ($, x) => {
189
- $.match(row[box.y], { some: ($, y) => {
190
- $.assign(area, locate(centre(x, box.width), centre(y, box.height), larger));
191
- } });
192
- } });
193
- }
194
- else {
195
- $.assign(area, locate(centre(row[box.x], box.width), centre(row[box.y], box.height), larger));
196
- }
197
- if (prefix === undefined)
198
- return { [AREA_FIELD]: area };
199
- const make = $.const(prefix.fn);
200
- const values = $.let(make(key, row), prefixType.output);
201
- const entry = (value) => ({ ...Object.fromEntries(on.map((field) => [field, on.length === 1 ? value : value[field]])), [AREA_FIELD]: area });
202
- if (!prefix.multi)
203
- return entry(values);
204
- const keys = $.let(new Set(), SetType(indexType));
205
- $.for(values, ($, value) => { $(keys.insert(entry(value))); });
206
- return keys;
179
+ $.match(at.cx, {
180
+ some: ($, cx) => {
181
+ $.match(at.cy, {
182
+ some: ($, cy) => { $.assign(area, locate(cx, cy, at.side, 2 ** exponent)); },
183
+ none: () => { },
184
+ });
185
+ },
186
+ none: () => { },
187
+ });
188
+ return area;
207
189
  });
208
- return { fn, multi, optional };
190
+ // One entry a row, under its leading values; one a combination of them where a Set among them fans it out.
191
+ let keyFn;
192
+ if (leading.multi) {
193
+ const leads = leadingValues(keyType, rowType, leading);
194
+ keyFn = East.function([keyType, rowType], SetType(indexType), ($, key, row) => {
195
+ const areaFn = $.const(areaOf);
196
+ const combinations = $.const(leads);
197
+ const area = $.let(areaFn(key, row));
198
+ return combinations(key, row).toSet((_$, on) => ({ on, area }));
199
+ });
200
+ }
201
+ else {
202
+ const lead = leadingValue(keyType, rowType, leading);
203
+ keyFn = East.function([keyType, rowType], indexType, ($, key, row) => {
204
+ const areaFn = $.const(areaOf);
205
+ const values = $.const(lead);
206
+ return { on: values(key, row), area: areaFn(key, row) };
207
+ });
208
+ }
209
+ // It carries its rows (D29): each entry's projection is the whole row, so a window reads the index alone and no
210
+ // record segment.
211
+ const valueFn = East.function([keyType, rowType], rowType, (_$, _key, row) => row);
212
+ const runner = indexRunner(config);
213
+ const role = leading.multi ? "'keys' function" : "'key' function";
214
+ checkPure(`${constructor} '${name}' ${role}`, keyFn, INDEX_PURITY);
215
+ checkEntryParams(constructor, name, role, keyType, valueType, signatureOf(keyFn).inputs);
216
+ return {
217
+ kind: 'recordIndex',
218
+ name,
219
+ record: rec,
220
+ on: Object.freeze([...on]),
221
+ area: Object.freeze({ ...box, cell: 2 ** exponent }),
222
+ keyFn,
223
+ valueFn,
224
+ multi: leading.multi,
225
+ keyType: indexType,
226
+ valueType: rowType,
227
+ runner,
228
+ };
209
229
  }
230
+ // ── The functions, each built the first time it is read ──────────────────────
231
+ /**
232
+ * The area index's East functions, each built the first time it is read, with
233
+ * no location captured ({@link lazyBuilds}, #1466): importing the SDK builds
234
+ * none of them.
235
+ */
236
+ export const AREA_FNS = lazyBuilds({
237
+ /**
238
+ * The `area` part of a box's key, from its centre, its larger side and the
239
+ * finest cell's side, a power of two: the level-28 Morton code of the box's
240
+ * cell, times 32, plus its level; `0`, the root, for a box outside the domain,
241
+ * not finite, or larger than half the domain. Every step is exact, so every
242
+ * runtime computes it alike.
243
+ *
244
+ * `(cx, cy, side, cell) → Integer`
245
+ */
246
+ get areaCode() {
247
+ return East.function([FloatType, FloatType, FloatType, FloatType], IntegerType, ($, cx, cy, side, cell) => {
248
+ const half = $.let(cell.multiply(HALF_CELLS));
249
+ // A value is finite exactly when it less itself is zero: an infinity's, or a NaN's, is a NaN.
250
+ const finite = $.let(cx.subtract(cx).equal(0.0).and(() => cy.subtract(cy).equal(0.0)).and(() => side.subtract(side).equal(0.0)));
251
+ const inside = $.let(cx.greaterEqual(half.negate()).and(() => cx.less(half)).and(() => cy.greaterEqual(half.negate())).and(() => cy.less(half)));
252
+ $.if(finite.not().or(() => inside.not()).or(() => side.greater(half)), ($) => {
253
+ $.return(0n);
254
+ });
255
+ // The deepest level whose cell is at least twice the box's larger side:
256
+ // each step up doubles the cell, exactly, and the step between its cells'
257
+ // indices at the finest level. A side at most half the domain stops at the
258
+ // root at the latest.
259
+ const level = $.let(FINEST_LEVEL);
260
+ const size = $.let(cell);
261
+ const step = $.let(1n);
262
+ const twice = $.let(side.multiply(2.0));
263
+ $.while(size.less(twice), ($) => {
264
+ $.assign(size, size.multiply(2.0));
265
+ $.assign(level, level.subtract(1n));
266
+ $.assign(step, step.multiply(2n));
267
+ });
268
+ // The finest cell holding the centre: a division by a power of two, and its
269
+ // floor, are exact; the domain's lower edge is cell 0. Then the level's
270
+ // cell holding it, aligned to the finest level: the bits below it cleared.
271
+ const ix = $.let(East.Float.roundFloor(cx.divide(cell)).add(HALF_CELLS_INTEGER).divide(step).multiply(step));
272
+ const iy = $.let(East.Float.roundFloor(cy.divide(cell)).add(HALF_CELLS_INTEGER).divide(step).multiply(step));
273
+ // Its Morton code: x in the even bits, y in the odd.
274
+ const code = $.let(0n);
275
+ const bit = $.let(1n);
276
+ $.for(East.Array.range(0n, FINEST_LEVEL), ($) => {
277
+ $.assign(code, code.add(ix.remainder(2n).multiply(bit)).add(iy.remainder(2n).multiply(bit).multiply(2n)));
278
+ $.assign(ix, ix.divide(2n));
279
+ $.assign(iy, iy.divide(2n));
280
+ $.assign(bit, bit.multiply(4n));
281
+ });
282
+ $.return(code.multiply(32n).add(level));
283
+ });
284
+ },
285
+ /** `(width, height) → the larger of their sizes`: a box's larger side. */
286
+ get largerSide() {
287
+ return East.function([FloatType, FloatType], FloatType, (_$, width, height) => width.abs().greaterEqual(height.abs()).ifElse(() => width.abs(), () => height.abs()));
288
+ },
289
+ });
210
290
  //# sourceMappingURL=record-area.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"record-area.js","sourceRoot":"","sources":["../../src/record-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