@gmitch215/folio 1.0.0 → 1.1.0
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 +455 -26
- package/dist/affine-state.d.ts +171 -0
- package/dist/affine-state.js +763 -0
- package/dist/affine.d.ts +160 -0
- package/dist/affine.js +571 -0
- package/dist/bake.d.ts +8 -3
- package/dist/bake.js +5 -2
- package/dist/boundaries.d.ts +59 -0
- package/dist/boundaries.js +127 -0
- package/dist/certified.d.ts +66 -0
- package/dist/certified.js +192 -0
- package/dist/certify.d.ts +98 -0
- package/dist/certify.js +2628 -0
- package/dist/compiler.d.ts +37 -1
- package/dist/compiler.js +116 -1
- package/dist/context.d.ts +47 -0
- package/dist/context.js +139 -0
- package/dist/coordinator.d.ts +1 -1
- package/dist/coordinator.js +54 -5
- package/dist/extract.d.ts +114 -1
- package/dist/extract.js +1011 -242
- package/dist/fold.d.ts +32 -0
- package/dist/fold.js +105 -0
- package/dist/frames.d.ts +20 -2
- package/dist/frames.js +205 -10
- package/dist/inline.d.ts +182 -0
- package/dist/inline.js +766 -0
- package/dist/iteration-admission.d.ts +185 -0
- package/dist/iteration-admission.js +201 -0
- package/dist/iteration-layout.d.ts +135 -0
- package/dist/iteration-layout.js +169 -0
- package/dist/iteration-owner.d.ts +45 -0
- package/dist/iteration-owner.js +223 -0
- package/dist/iteration-worker.d.ts +1 -0
- package/dist/iteration-worker.js +216 -0
- package/dist/iteration.d.ts +329 -0
- package/dist/iteration.js +1210 -0
- package/dist/lease.d.ts +45 -0
- package/dist/lease.js +274 -0
- package/dist/managed.d.ts +78 -0
- package/dist/managed.js +448 -27
- package/dist/memo.d.ts +99 -0
- package/dist/memo.js +250 -0
- package/dist/node.d.ts +61 -5
- package/dist/node.js +421 -23
- package/dist/ownership-redirect.d.ts +30 -0
- package/dist/ownership-redirect.js +179 -0
- package/dist/ownership-slices.d.ts +44 -0
- package/dist/ownership-slices.js +72 -0
- package/dist/ownership.d.ts +161 -0
- package/dist/ownership.js +6568 -0
- package/dist/ranges.d.ts +78 -0
- package/dist/ranges.js +263 -0
- package/dist/read-scan.d.ts +18 -0
- package/dist/read-scan.js +94 -0
- package/dist/read-windows.d.ts +103 -0
- package/dist/read-windows.js +244 -0
- package/dist/router-worker.d.ts +1 -0
- package/dist/router-worker.js +4 -0
- package/dist/router.d.ts +203 -0
- package/dist/router.js +667 -0
- package/dist/runs.d.ts +44 -0
- package/dist/runs.js +182 -0
- package/dist/slices-worker.d.ts +1 -0
- package/dist/slices-worker.js +38 -0
- package/dist/slices.d.ts +126 -0
- package/dist/slices.js +441 -0
- package/dist/tasks.d.ts +14 -4
- package/dist/tasks.js +23 -9
- package/dist/transaction.d.ts +10 -0
- package/package.json +44 -4
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import type { IterationRoute } from './extract.ts';
|
|
2
|
+
import { type IterationAdmission, type IterationStop } from './iteration-admission.ts';
|
|
3
|
+
import { type IterationArena, type IterationArenaOptions, type IterationWindow } from './iteration-layout.ts';
|
|
4
|
+
import { type IterationReadWindows, type ReadWindowCounts } from './read-windows.ts';
|
|
5
|
+
export { iterationArena, iterationArenaBytes, iterationArguments, iterationEntryBytes, iterationFit, iterationFrameShadow, iterationGranules, iterationLogCeiling, iterationWindowBytes, iterationWindowCopy } from './iteration-layout.ts';
|
|
6
|
+
export type { IterationArena, IterationArenaOptions, IterationWindow } from './iteration-layout.ts';
|
|
7
|
+
/** Pool construction options. */
|
|
8
|
+
export interface IterationPoolOptions extends IterationArenaOptions {
|
|
9
|
+
/** Start of the arena, 64-byte aligned, in memory the caller keeps free while the pool is open. */
|
|
10
|
+
arenaBase: number;
|
|
11
|
+
/** Workers; defaults to up to four. */
|
|
12
|
+
width?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Undo entries per iteration of the log a batch is retried with after its log is exhausted.
|
|
15
|
+
* Defaults to `logCapacity`, which leaves the retry off; `iterationLogCeiling` is the grown size the tests use.
|
|
16
|
+
*/
|
|
17
|
+
logCeiling?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Learn read windows from the first batch that completes without a conflict: a load that falls
|
|
20
|
+
* in a window sets no mark and skips the slot and frame checks, because the worker marked the
|
|
21
|
+
* whole window before the iteration. The next full batch runs on a lowering that counts its
|
|
22
|
+
* loads, and the windows stay armed for the rest of the call only if the counts say they pay
|
|
23
|
+
* (`readWindowsPay`). Off by default.
|
|
24
|
+
*/
|
|
25
|
+
readWindows?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Keep a summary byte per 64 words of every read bitmap, set by each read mark, so a worker scans
|
|
28
|
+
* only the blocks a read touched. The scan result is the same as the full scan. Off by default.
|
|
29
|
+
*/
|
|
30
|
+
readSummary?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Guard a batch against an iteration that never returns. The worker module polls a stop word at
|
|
33
|
+
* every loop start. When the owner has waited past the limit it sets the word: every iteration
|
|
34
|
+
* in flight traps, is rolled back from the undo logs and rerun serially in order, and the loop
|
|
35
|
+
* ends with `stopped: 'stalled'`. Off by default; `true` takes the defaults of
|
|
36
|
+
* `IterationStallOptions`.
|
|
37
|
+
*/
|
|
38
|
+
stall?: boolean | IterationStallOptions;
|
|
39
|
+
}
|
|
40
|
+
/** The wait before the stall guard stops a batch: `floorMs` plus `factor` times its serial estimate. */
|
|
41
|
+
export interface IterationStallOptions {
|
|
42
|
+
/**
|
|
43
|
+
* Times the serial time of the iterations one worker runs in a batch. Default 50, above the
|
|
44
|
+
* slowdown of tracked code over plain code by an order of magnitude.
|
|
45
|
+
*/
|
|
46
|
+
factor?: number;
|
|
47
|
+
/** Least wait in ms, which also covers waking the workers and compiling the first iteration. Default 2000. */
|
|
48
|
+
floorMs?: number;
|
|
49
|
+
}
|
|
50
|
+
/** One owner call's loop. */
|
|
51
|
+
export interface IterationJob {
|
|
52
|
+
/** Iterations to run. An entry value of zero runs 2^32 times in the program; refuse that upstream. */
|
|
53
|
+
trip: number;
|
|
54
|
+
/** The owner's frame local after its prologue; the image at `[frameBase, frameBase + size)` is copied. */
|
|
55
|
+
frameBase: number;
|
|
56
|
+
/** Loop-entry value of every local in `route.locals` that has an `argument`, except the frame. */
|
|
57
|
+
entry: Readonly<Record<number, number | bigint>>;
|
|
58
|
+
/** Runs iteration `k` serially on the owner frame. A throw is the program's trap. */
|
|
59
|
+
replay(k: number): void;
|
|
60
|
+
/** Test hook: `reverse` makes one worker run a batch last to first. Default `forward`. */
|
|
61
|
+
schedule?: 'forward' | 'reverse';
|
|
62
|
+
/** Test hook, unsound: validation checks to leave out. */
|
|
63
|
+
skip?: readonly ('raw' | 'war' | 'waw' | 'frame')[];
|
|
64
|
+
/**
|
|
65
|
+
* A window an earlier call learned: the batches start on slot-private copies of it. Ignored when
|
|
66
|
+
* the arena reserves no window bytes or the window does not fit this call (see `report.window`).
|
|
67
|
+
*/
|
|
68
|
+
window?: IterationWindow;
|
|
69
|
+
/** Whether a batch that conflicts may name a window and go on with it. Default true. */
|
|
70
|
+
discover?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Runs iteration 0 through `replay` on the owner thread first and times it. That is the serial
|
|
73
|
+
* program's first iteration, so its writes stay and the batches cover iterations 1 to `trip - 1`
|
|
74
|
+
* from the owner frame it leaves. Called once with the time of that iteration, before anything
|
|
75
|
+
* is dispatched. A refusal runs the other iterations through `replay` and dispatches nothing.
|
|
76
|
+
* Without `admit` every iteration is dispatched.
|
|
77
|
+
*/
|
|
78
|
+
admit?: (plainIterationMs: number) => IterationAdmission;
|
|
79
|
+
/**
|
|
80
|
+
* Called after each batch that leaves iterations behind, with its wall (dispatch, validation,
|
|
81
|
+
* rollback and replay) and the serial time of its iterations at the time of iteration 0. True
|
|
82
|
+
* ends the dispatch and runs the rest through `replay`. Only used with `admit`.
|
|
83
|
+
*/
|
|
84
|
+
loses?: (batchWallMs: number, batchSerialMs: number) => boolean;
|
|
85
|
+
/** Like `loses`, for a batch slow enough that a second batch is not needed to confirm it. */
|
|
86
|
+
collapses?: (batchWallMs: number, batchSerialMs: number) => boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Called after each batch with the best speedup its workers could reach at the tracked time
|
|
89
|
+
* they showed. True ends the dispatch: no later batch could pay at this tracking cost. Only
|
|
90
|
+
* used with `admit`.
|
|
91
|
+
*/
|
|
92
|
+
hopeless?: (bound: number) => boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Called with the bound of the first batch when read windows were learned from it. True makes
|
|
95
|
+
* the first batch on them one iteration per worker, which `hopeless` and the projection of the
|
|
96
|
+
* next batch then judge. Only used with `admit` and `hopeless`.
|
|
97
|
+
*/
|
|
98
|
+
unproven?: (bound: number) => boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Whether `remaining` more iterations at `perIterationMs` of serial time each are worth
|
|
101
|
+
* dispatching. Asked with the online estimate before each batch after the first, where false ends
|
|
102
|
+
* the dispatch, and after the timed serial blocks of a refused loop, where true starts it. Only
|
|
103
|
+
* used with `admit`.
|
|
104
|
+
*/
|
|
105
|
+
reconsider?: (perIterationMs: number, remaining: number, last?: {
|
|
106
|
+
wallMs: number;
|
|
107
|
+
count: number;
|
|
108
|
+
}) => boolean;
|
|
109
|
+
}
|
|
110
|
+
/** What a run did. `regions`, `replayed`, `fallbacks` and `workers` parallel `ExecutionReport`. */
|
|
111
|
+
export interface IterationReport {
|
|
112
|
+
/** Workers that took part. */
|
|
113
|
+
workers: number;
|
|
114
|
+
/** Iterations run on workers, the regions of this mode. */
|
|
115
|
+
regions: number;
|
|
116
|
+
/** Dispatched iterations that were rolled back and rerun serially at the owner. */
|
|
117
|
+
replayed: number;
|
|
118
|
+
/** Iterations whose writes were undone before the rerun. */
|
|
119
|
+
rolledBack: number;
|
|
120
|
+
/** Batches whose first failure was a trap or an exhausted undo log, not a dependency. */
|
|
121
|
+
fallbacks: number;
|
|
122
|
+
/** Iterations that trapped on a worker. */
|
|
123
|
+
traps: number;
|
|
124
|
+
/** Iterations that exhausted their undo log. */
|
|
125
|
+
exhausted: number;
|
|
126
|
+
/** Iterations that trapped on an access to another iteration's stack slot. */
|
|
127
|
+
violations: number;
|
|
128
|
+
/** Batches in which the stall guard fired. */
|
|
129
|
+
stalls: number;
|
|
130
|
+
/** Iterations the stall word stopped, rolled back and rerun serially. */
|
|
131
|
+
stalledIterations: number;
|
|
132
|
+
batches: number;
|
|
133
|
+
failedBatches: number;
|
|
134
|
+
undoEntries: number;
|
|
135
|
+
/** The most undo entries one completed iteration logged. */
|
|
136
|
+
maxLogEntries: number;
|
|
137
|
+
/** Times a batch that exhausted its log was retried with the grown log. */
|
|
138
|
+
logGrowths: number;
|
|
139
|
+
/** Iterations rolled back and dispatched again by such a retry. They are not in `regions`. */
|
|
140
|
+
retried: number;
|
|
141
|
+
/** Ordered iteration pairs by hazard. */
|
|
142
|
+
conflicts: {
|
|
143
|
+
raw: number;
|
|
144
|
+
war: number;
|
|
145
|
+
waw: number;
|
|
146
|
+
frame: number;
|
|
147
|
+
};
|
|
148
|
+
/** From posting a batch to the last worker reply. */
|
|
149
|
+
dispatchMs: number;
|
|
150
|
+
validationMs: number;
|
|
151
|
+
rollbackMs: number;
|
|
152
|
+
replayMs: number;
|
|
153
|
+
/** Wasm time inside workers, summed. */
|
|
154
|
+
workerRunMs: number;
|
|
155
|
+
/** Bitmap scan and clear time inside workers, summed. */
|
|
156
|
+
workerScanMs: number;
|
|
157
|
+
/** Time the workers spent marking read windows before their iterations, summed. */
|
|
158
|
+
workerMarkMs: number;
|
|
159
|
+
/** Read bitmap words the workers scanned, summed. */
|
|
160
|
+
workerScanWords: number;
|
|
161
|
+
/** Read bitmap words they found non-zero. */
|
|
162
|
+
workerScanSet: number;
|
|
163
|
+
/**
|
|
164
|
+
* Iterations the owner ran as the serial program without dispatching them: iteration 0, the
|
|
165
|
+
* rest of a loop after a stop, or all of them when admission refused the loop.
|
|
166
|
+
*/
|
|
167
|
+
serial: number;
|
|
168
|
+
/** What ended the dispatch early, or why admission refused the loop. */
|
|
169
|
+
stopped?: IterationStop;
|
|
170
|
+
/** What the admission callback saw and chose; set when the job had one. */
|
|
171
|
+
admission?: IterationAdmission;
|
|
172
|
+
/** Frame conflicts that fell in a window's bytes; they are also in `conflicts.frame`. */
|
|
173
|
+
windowConflicts: number;
|
|
174
|
+
/** The window the batches ran on, if any, and where it came from. */
|
|
175
|
+
window?: {
|
|
176
|
+
low: number;
|
|
177
|
+
end: number;
|
|
178
|
+
source: 'given' | 'discovered';
|
|
179
|
+
/** Batches dispatched on it. */
|
|
180
|
+
batches: number;
|
|
181
|
+
};
|
|
182
|
+
/** Why a window that was offered or found was not used. */
|
|
183
|
+
windowRefused?: string;
|
|
184
|
+
/** The read windows learned from the first clean batch, with the batches that ran on them. */
|
|
185
|
+
readWindows?: IterationReadWindows & {
|
|
186
|
+
batches: number;
|
|
187
|
+
learnedFrom: number;
|
|
188
|
+
};
|
|
189
|
+
/** Why read windows were not learned, or were dropped after a batch on them conflicted. */
|
|
190
|
+
readWindowRefused?: string;
|
|
191
|
+
/** What the counted batch on the read windows saw, and whether they were armed for the loop. */
|
|
192
|
+
readWindowGate?: {
|
|
193
|
+
iterations: number;
|
|
194
|
+
counts: ReadWindowCounts;
|
|
195
|
+
saved: number;
|
|
196
|
+
spent: number;
|
|
197
|
+
/** which check the armed module runs first for a load of at most 8 bytes */
|
|
198
|
+
order: 'window' | 'exempt';
|
|
199
|
+
armed: boolean;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/** What a worker returns for one iteration. */
|
|
203
|
+
export interface IterationOutcome {
|
|
204
|
+
index: number;
|
|
205
|
+
/** 0 ran, 1 trapped, 2 undo log exhausted, 3 stopped by the stall word */
|
|
206
|
+
status: number;
|
|
207
|
+
entries: number;
|
|
208
|
+
/** wall time of the iteration inside the worker, on the tracked module */
|
|
209
|
+
runMs: number;
|
|
210
|
+
/** sorted write granules (32 bytes) from the undo log */
|
|
211
|
+
written: Int32Array;
|
|
212
|
+
/** [start, length] runs of read granules (64 bytes) */
|
|
213
|
+
reads: Int32Array;
|
|
214
|
+
/** written bit per frame byte, one i32 per 32-byte frame granule; empty when nothing was written */
|
|
215
|
+
frameWritten: Uint32Array;
|
|
216
|
+
/** bit per frame byte the iteration read before writing it, same layout; empty when none */
|
|
217
|
+
frameExposed: Uint32Array;
|
|
218
|
+
/** position in the batch of the first slot this iteration reached outside its own, or -1 */
|
|
219
|
+
touched?: number;
|
|
220
|
+
/** loads of at most 8 bytes by where they landed, from the counting module only */
|
|
221
|
+
counts?: ReadWindowCounts;
|
|
222
|
+
}
|
|
223
|
+
type Verdict = {
|
|
224
|
+
first: number;
|
|
225
|
+
firstFailure: number;
|
|
226
|
+
frameFirst: number;
|
|
227
|
+
conflicts: {
|
|
228
|
+
raw: number;
|
|
229
|
+
war: number;
|
|
230
|
+
waw: number;
|
|
231
|
+
frame: number;
|
|
232
|
+
};
|
|
233
|
+
/** Frame conflicts that fall in the first `windowWords` words; set only when that was asked for. */
|
|
234
|
+
window?: number;
|
|
235
|
+
};
|
|
236
|
+
type VerdictInput = Pick<IterationOutcome, 'status' | 'written' | 'reads'> & Partial<Pick<IterationOutcome, 'frameWritten' | 'frameExposed' | 'touched'>>;
|
|
237
|
+
type Skip = readonly ('raw' | 'war' | 'waw' | 'frame')[];
|
|
238
|
+
/** Ordered pairs by hazard and the first iteration that cannot keep its writes, or -1. */
|
|
239
|
+
interface MemoryConflicts {
|
|
240
|
+
raw: number;
|
|
241
|
+
war: number;
|
|
242
|
+
waw: number;
|
|
243
|
+
first: number;
|
|
244
|
+
}
|
|
245
|
+
/** The pairwise form: every ordered pair against every other. Any batch size; the reference. @internal */
|
|
246
|
+
export declare function pairwiseConflicts(outcomes: readonly VerdictInput[], skip: Skip): MemoryConflicts;
|
|
247
|
+
/**
|
|
248
|
+
* `pairwiseConflicts` in time linear in the sizes of the sets, for at most 32 outcomes: one table
|
|
249
|
+
* from write granule to the bit set of the iterations that wrote it, then each read granule looks
|
|
250
|
+
* its two write granules up. A pair counts once however many granules it shares, so the counts
|
|
251
|
+
* equal the pairwise form's. @internal
|
|
252
|
+
*/
|
|
253
|
+
export declare function tabledConflicts(outcomes: readonly VerdictInput[], skip: Skip): MemoryConflicts;
|
|
254
|
+
/**
|
|
255
|
+
* Index of the first outcome that cannot keep its writes, or -1. Writes land in place, so every
|
|
256
|
+
* ordered pair is checked three ways: RAW marks the reader, WAR the earlier reader, WAW the earlier
|
|
257
|
+
* writer. A fourth check covers the frame, which each iteration owns as a private copy: an
|
|
258
|
+
* iteration fails when it read a frame byte before writing it that an earlier iteration wrote, and
|
|
259
|
+
* counts once. Works on the returned lists, never on dense bitmaps. A batch of at most 32 goes
|
|
260
|
+
* through `tabledConflicts`, a larger one through the pairwise form.
|
|
261
|
+
*
|
|
262
|
+
* `windowWords` is the number of leading frame words that belong to slot-private windows; the
|
|
263
|
+
* result then also counts, as `window`, the frame conflicts that fall in them.
|
|
264
|
+
*/
|
|
265
|
+
export declare function iterationVerdict(outcomes: readonly VerdictInput[], skip?: Skip, windowWords?: number): Verdict;
|
|
266
|
+
/**
|
|
267
|
+
* The window a failed batch suggests: the span of the write granules that at least half of its
|
|
268
|
+
* iterations wrote, rounded out to 64 bytes. That is where iterations share a location they write
|
|
269
|
+
* every time, a scratch buffer, a context or an allocator's cursor, and `cap` bytes is the most a
|
|
270
|
+
* pool holds. Half and not two, because iterations that race on a shared context also write wild
|
|
271
|
+
* granules (a length read mid-update indexes anywhere), and those are rarely written twice. Whether
|
|
272
|
+
* the iterations write the window before they read it is not asked here: a window that is wrong
|
|
273
|
+
* only fails validation on the next batch.
|
|
274
|
+
*/
|
|
275
|
+
export declare function discoverWindow(outcomes: readonly Pick<IterationOutcome, 'written'>[], cap: number): {
|
|
276
|
+
window?: IterationWindow;
|
|
277
|
+
reason?: string;
|
|
278
|
+
granules: number;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Runs the loop of one owner call on worker threads. Each iteration gets a private stack slot and
|
|
282
|
+
* tracks its reads and writes inline. The owner validates a batch in order, rolls back the first
|
|
283
|
+
* failing iteration and every later one from the undo logs, and replays them through `replay`.
|
|
284
|
+
* The arena belongs to the pool until `close`.
|
|
285
|
+
*
|
|
286
|
+
* Each iteration runs on a private copy of the owner frame, taken from the owner frame when its
|
|
287
|
+
* batch is dispatched. The lowered module tracks the frame: a written bit per frame byte, and an
|
|
288
|
+
* exposed bit per 32-byte frame granule that the iteration read before it wrote the byte. An
|
|
289
|
+
* iteration fails validation, like a RAW pair, when it has an exposed granule that an earlier
|
|
290
|
+
* iteration of the same batch wrote (`conflicts.frame`); it and every later one in the batch roll
|
|
291
|
+
* back and replay. After a batch validates, each kept
|
|
292
|
+
* iteration's written frame bytes are copied into the owner frame in order, so the next batch
|
|
293
|
+
* starts from the serial frame and a replay runs on it. The guarantee: a read of an owner frame
|
|
294
|
+
* byte that the same iteration has not written yet, with a write by an earlier iteration of the
|
|
295
|
+
* batch to that byte, is detected, and an earlier batch's writes are seen through the copy.
|
|
296
|
+
* Excluded: a read of stack below the frame (callee frames, indeterminate before the callee writes
|
|
297
|
+
* them) is not tracked, and imported host functions that touch memory are not seen. The shadow
|
|
298
|
+
* is byte-exact for scalar accesses and ranges; a conservative read would only add reports.
|
|
299
|
+
*
|
|
300
|
+
* The callee stack of an iteration, the part of its slot below the frame copy, sets no marks and
|
|
301
|
+
* logs no undo entries, and a rollback does not restore it. An access that reaches another slot
|
|
302
|
+
* of the arena traps; the iteration fails with the owner of that slot, so both and every later one
|
|
303
|
+
* replay (`violations` counts them). A program that reads callee stack before writing it sees
|
|
304
|
+
* what an earlier iteration in that slot left, a rolled back one included.
|
|
305
|
+
*
|
|
306
|
+
* With `admit`, iteration 0 runs first on the owner and the batches cover the rest. Dispatch
|
|
307
|
+
* stops after a batch that exhausted an undo log, had a frame conflict, replayed more than half of
|
|
308
|
+
* its iterations, or (with `loses` and `collapses`) two batches in a row did not beat the serial
|
|
309
|
+
* time of their iterations or one took far longer than it; the rest of the loop runs through
|
|
310
|
+
* `replay` and `report.stopped` names the reason. Once an iteration fails, the workers start no
|
|
311
|
+
* further iteration of that batch, because it and every later one replay anyway.
|
|
312
|
+
*/
|
|
313
|
+
export declare class IterationPool {
|
|
314
|
+
#private;
|
|
315
|
+
readonly arena: IterationArena;
|
|
316
|
+
readonly width: number;
|
|
317
|
+
private constructor();
|
|
318
|
+
/** Bytes of memory the pool expects: the arena's memory plus any pages its grown log added. */
|
|
319
|
+
get memoryBytes(): number;
|
|
320
|
+
/** The report of the last run, also after a run that threw. */
|
|
321
|
+
get report(): IterationReport;
|
|
322
|
+
/** Lowers the route's worker module inline and starts `width` workers over `memory`. */
|
|
323
|
+
static open(route: IterationRoute, memory: WebAssembly.Memory, options: IterationPoolOptions): Promise<IterationPool>;
|
|
324
|
+
/** Runs the loop to completion with ordered validation. Blocks the calling thread. */
|
|
325
|
+
run(job: IterationJob): IterationReport;
|
|
326
|
+
/** Stops the workers. Safe to call twice. */
|
|
327
|
+
close(): Promise<void>;
|
|
328
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
329
|
+
}
|