ppef 1.1.0 → 1.2.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 +76 -125
- package/dist/__tests__/cli/evaluate-command.integration.test.d.ts +8 -0
- package/dist/__tests__/cli/evaluate-command.integration.test.d.ts.map +1 -0
- package/dist/__tests__/cli/evaluate-command.integration.test.js +308 -0
- package/dist/__tests__/cli/evaluate-command.integration.test.js.map +1 -0
- package/dist/__tests__/evaluators/claims-evaluator.unit.test.d.ts +8 -0
- package/dist/__tests__/evaluators/claims-evaluator.unit.test.d.ts.map +1 -0
- package/dist/__tests__/evaluators/claims-evaluator.unit.test.js +405 -0
- package/dist/__tests__/evaluators/claims-evaluator.unit.test.js.map +1 -0
- package/dist/__tests__/evaluators/metrics-evaluator.unit.test.d.ts +8 -0
- package/dist/__tests__/evaluators/metrics-evaluator.unit.test.d.ts.map +1 -0
- package/dist/__tests__/evaluators/metrics-evaluator.unit.test.js +424 -0
- package/dist/__tests__/evaluators/metrics-evaluator.unit.test.js.map +1 -0
- package/dist/__tests__/evaluators/registry.unit.test.d.ts +7 -0
- package/dist/__tests__/evaluators/registry.unit.test.d.ts.map +1 -0
- package/dist/__tests__/evaluators/registry.unit.test.js +173 -0
- package/dist/__tests__/evaluators/registry.unit.test.js.map +1 -0
- package/dist/__tests__/evaluators/robustness-evaluator.unit.test.d.ts +8 -0
- package/dist/__tests__/evaluators/robustness-evaluator.unit.test.d.ts.map +1 -0
- package/dist/__tests__/evaluators/robustness-evaluator.unit.test.js +260 -0
- package/dist/__tests__/evaluators/robustness-evaluator.unit.test.js.map +1 -0
- package/dist/__tests__/framework-pipeline.integration.test.js +36 -9
- package/dist/__tests__/framework-pipeline.integration.test.js.map +1 -1
- package/dist/__tests__/index-exports.unit.test.js +9 -12
- package/dist/__tests__/index-exports.unit.test.js.map +1 -1
- package/dist/aggregation/pipeline.d.ts.map +1 -1
- package/dist/aggregation/pipeline.js +40 -3
- package/dist/aggregation/pipeline.js.map +1 -1
- package/dist/claims/index.d.ts +6 -3
- package/dist/claims/index.d.ts.map +1 -1
- package/dist/claims/index.js +6 -3
- package/dist/claims/index.js.map +1 -1
- package/dist/cli/__tests__/aggregate.command.unit.test.js +3 -0
- package/dist/cli/__tests__/aggregate.command.unit.test.js.map +1 -1
- package/dist/cli/__tests__/binary-sut.integration.test.d.ts +8 -0
- package/dist/cli/__tests__/binary-sut.integration.test.d.ts.map +1 -0
- package/dist/cli/__tests__/binary-sut.integration.test.js +165 -0
- package/dist/cli/__tests__/binary-sut.integration.test.js.map +1 -0
- package/dist/cli/__tests__/config-loader.unit.test.d.ts +7 -0
- package/dist/cli/__tests__/config-loader.unit.test.d.ts.map +1 -0
- package/dist/cli/__tests__/config-loader.unit.test.js +611 -0
- package/dist/cli/__tests__/config-loader.unit.test.js.map +1 -0
- package/dist/cli/command-deps.d.ts +13 -1
- package/dist/cli/command-deps.d.ts.map +1 -1
- package/dist/cli/commands/aggregate.d.ts.map +1 -1
- package/dist/cli/commands/aggregate.js +3 -0
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/evaluate.d.ts +41 -0
- package/dist/cli/commands/evaluate.d.ts.map +1 -0
- package/dist/cli/commands/evaluate.js +287 -0
- package/dist/cli/commands/evaluate.js.map +1 -0
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +93 -1
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +3 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/module-loader.d.ts +23 -1
- package/dist/cli/module-loader.d.ts.map +1 -1
- package/dist/cli/module-loader.js +19 -1
- package/dist/cli/module-loader.js.map +1 -1
- package/dist/cli/types.d.ts +19 -0
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/evaluators/claims-evaluator.d.ts +87 -0
- package/dist/evaluators/claims-evaluator.d.ts.map +1 -0
- package/dist/evaluators/claims-evaluator.js +289 -0
- package/dist/evaluators/claims-evaluator.js.map +1 -0
- package/dist/evaluators/exploratory-evaluator.d.ts +136 -0
- package/dist/evaluators/exploratory-evaluator.d.ts.map +1 -0
- package/dist/evaluators/exploratory-evaluator.js +545 -0
- package/dist/evaluators/exploratory-evaluator.js.map +1 -0
- package/dist/evaluators/index.d.ts +13 -0
- package/dist/evaluators/index.d.ts.map +1 -0
- package/dist/evaluators/index.js +14 -0
- package/dist/evaluators/index.js.map +1 -0
- package/dist/evaluators/metrics-evaluator.d.ts +114 -0
- package/dist/evaluators/metrics-evaluator.d.ts.map +1 -0
- package/dist/evaluators/metrics-evaluator.js +433 -0
- package/dist/evaluators/metrics-evaluator.js.map +1 -0
- package/dist/evaluators/registry.d.ts +106 -0
- package/dist/evaluators/registry.d.ts.map +1 -0
- package/dist/evaluators/registry.js +148 -0
- package/dist/evaluators/registry.js.map +1 -0
- package/dist/evaluators/robustness-evaluator.d.ts +57 -0
- package/dist/evaluators/robustness-evaluator.d.ts.map +1 -0
- package/dist/evaluators/robustness-evaluator.js +186 -0
- package/dist/evaluators/robustness-evaluator.js.map +1 -0
- package/dist/executor/__tests__/binary-sut.unit.test.d.ts +8 -0
- package/dist/executor/__tests__/binary-sut.unit.test.d.ts.map +1 -0
- package/dist/executor/__tests__/binary-sut.unit.test.js +313 -0
- package/dist/executor/__tests__/binary-sut.unit.test.js.map +1 -0
- package/dist/executor/__tests__/checkpoint-storage.unit.test.js +43 -0
- package/dist/executor/__tests__/checkpoint-storage.unit.test.js.map +1 -1
- package/dist/executor/__tests__/executor.unit.test.js +56 -9
- package/dist/executor/__tests__/executor.unit.test.js.map +1 -1
- package/dist/executor/__tests__/resource-calculator.unit.test.d.ts +10 -0
- package/dist/executor/__tests__/resource-calculator.unit.test.d.ts.map +1 -0
- package/dist/executor/__tests__/resource-calculator.unit.test.js +104 -0
- package/dist/executor/__tests__/resource-calculator.unit.test.js.map +1 -0
- package/dist/executor/__tests__/worker-threads-executor.unit.test.d.ts +8 -0
- package/dist/executor/__tests__/worker-threads-executor.unit.test.d.ts.map +1 -0
- package/dist/executor/__tests__/worker-threads-executor.unit.test.js +276 -0
- package/dist/executor/__tests__/worker-threads-executor.unit.test.js.map +1 -0
- package/dist/executor/binary-sut.d.ts +105 -0
- package/dist/executor/binary-sut.d.ts.map +1 -0
- package/dist/executor/binary-sut.js +174 -0
- package/dist/executor/binary-sut.js.map +1 -0
- package/dist/executor/checkpoint-storage.d.ts.map +1 -1
- package/dist/executor/checkpoint-storage.js +6 -4
- package/dist/executor/checkpoint-storage.js.map +1 -1
- package/dist/executor/executor.d.ts +28 -0
- package/dist/executor/executor.d.ts.map +1 -1
- package/dist/executor/executor.js +85 -24
- package/dist/executor/executor.js.map +1 -1
- package/dist/executor/index.d.ts +4 -0
- package/dist/executor/index.d.ts.map +1 -1
- package/dist/executor/index.js +4 -0
- package/dist/executor/index.js.map +1 -1
- package/dist/executor/resource-calculator.d.ts +49 -0
- package/dist/executor/resource-calculator.d.ts.map +1 -0
- package/dist/executor/resource-calculator.js +129 -0
- package/dist/executor/resource-calculator.js.map +1 -0
- package/dist/executor/worker-entry.js +26 -10
- package/dist/executor/worker-entry.js.map +1 -1
- package/dist/executor/worker-executor.d.ts +104 -3
- package/dist/executor/worker-executor.d.ts.map +1 -1
- package/dist/executor/worker-executor.js +224 -4
- package/dist/executor/worker-executor.js.map +1 -1
- package/dist/executor/worker-threads-executor.d.ts +245 -0
- package/dist/executor/worker-threads-executor.d.ts.map +1 -0
- package/dist/executor/worker-threads-executor.js +332 -0
- package/dist/executor/worker-threads-executor.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/renderers/latex-renderer.d.ts +60 -0
- package/dist/renderers/latex-renderer.d.ts.map +1 -1
- package/dist/renderers/latex-renderer.js +299 -0
- package/dist/renderers/latex-renderer.js.map +1 -1
- package/dist/renderers/types.d.ts +9 -0
- package/dist/renderers/types.d.ts.map +1 -1
- package/dist/renderers/types.js.map +1 -1
- package/dist/robustness/index.d.ts +5 -2
- package/dist/robustness/index.d.ts.map +1 -1
- package/dist/robustness/index.js +4 -2
- package/dist/robustness/index.js.map +1 -1
- package/dist/types/evaluator.d.ts +449 -0
- package/dist/types/evaluator.d.ts.map +1 -0
- package/dist/types/evaluator.js +9 -0
- package/dist/types/evaluator.js.map +1 -0
- package/dist/types/result.d.ts +2 -0
- package/dist/types/result.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/claims/__tests__/evaluator.unit.test.d.ts +0 -12
- package/dist/claims/__tests__/evaluator.unit.test.d.ts.map +0 -1
- package/dist/claims/__tests__/evaluator.unit.test.js +0 -801
- package/dist/claims/__tests__/evaluator.unit.test.js.map +0 -1
- package/dist/claims/evaluator.d.ts +0 -33
- package/dist/claims/evaluator.d.ts.map +0 -1
- package/dist/claims/evaluator.js +0 -174
- package/dist/claims/evaluator.js.map +0 -1
- package/dist/robustness/__tests__/analyzer.unit.test.d.ts +0 -11
- package/dist/robustness/__tests__/analyzer.unit.test.d.ts.map +0 -1
- package/dist/robustness/__tests__/analyzer.unit.test.js +0 -455
- package/dist/robustness/__tests__/analyzer.unit.test.js.map +0 -1
- package/dist/robustness/analyzer.d.ts +0 -61
- package/dist/robustness/analyzer.d.ts.map +0 -1
- package/dist/robustness/analyzer.js +0 -191
- package/dist/robustness/analyzer.js.map +0 -1
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker Threads Executor
|
|
3
|
+
*
|
|
4
|
+
* Executes experiments using Node.js worker threads for parallelism.
|
|
5
|
+
* Each worker runs in isolation, preventing SUT crashes from affecting the main process.
|
|
6
|
+
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* - Main thread spawns N worker threads (75% of CPU cores by default)
|
|
9
|
+
* - Each worker receives a batch of runs via postMessage
|
|
10
|
+
* - Workers write results to sharded checkpoint files
|
|
11
|
+
* - Main thread merges shards after all workers complete
|
|
12
|
+
*
|
|
13
|
+
* Benefits:
|
|
14
|
+
* - Main thread isolation: SUT crashes don't crash the CLI
|
|
15
|
+
* - True parallelism: Workers run on separate OS threads
|
|
16
|
+
* - Resource managed: Automatic 75% resource allocation
|
|
17
|
+
* - Fault tolerance: Single worker failure doesn't stop others
|
|
18
|
+
*
|
|
19
|
+
* Dependency Injection:
|
|
20
|
+
* - Logger interface enables testing of log output
|
|
21
|
+
* - WorkerFactory interface enables mocking Worker for testing
|
|
22
|
+
* - WorkerEntryPath interface enables testing worker path resolution
|
|
23
|
+
*/
|
|
24
|
+
import type { EvaluationResult } from "../types/result.js";
|
|
25
|
+
import type { ExecutorConfig, PlannedRun } from "./executor.js";
|
|
26
|
+
import type { WorkerMessage, WorkerOutputMessage } from "./worker-executor.js";
|
|
27
|
+
import type { ResourceLimits } from "./resource-calculator.js";
|
|
28
|
+
/**
|
|
29
|
+
* Logger interface for output handling.
|
|
30
|
+
* Enables testing of log messages.
|
|
31
|
+
*/
|
|
32
|
+
export interface ILogger {
|
|
33
|
+
log(message: string): void;
|
|
34
|
+
debug(message: string): void;
|
|
35
|
+
info(message: string): void;
|
|
36
|
+
warn(message: string): void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Production logger using console.
|
|
40
|
+
*/
|
|
41
|
+
export declare class ConsoleLogger implements ILogger {
|
|
42
|
+
log(message: string): void;
|
|
43
|
+
debug(message: string): void;
|
|
44
|
+
info(message: string): void;
|
|
45
|
+
warn(message: string): void;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Worker interface.
|
|
49
|
+
* Abstraction over Node.js Worker.
|
|
50
|
+
*/
|
|
51
|
+
export interface IWorker {
|
|
52
|
+
postMessage(message: WorkerMessage): void;
|
|
53
|
+
on(event: "message", listener: (data: WorkerOutputMessage) => void): void;
|
|
54
|
+
on(event: "error", listener: (error: Error) => void): void;
|
|
55
|
+
terminate(): Promise<number>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Worker factory interface.
|
|
59
|
+
* Enables mocking of Worker construction for testing.
|
|
60
|
+
*/
|
|
61
|
+
export interface IWorkerFactory {
|
|
62
|
+
create(workerPath: string): IWorker;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Production worker factory using node:worker_threads.
|
|
66
|
+
* Registers the tsx loader when spawning workers from TypeScript source.
|
|
67
|
+
*/
|
|
68
|
+
export declare class WorkerFactory implements IWorkerFactory {
|
|
69
|
+
create(workerPath: string): IWorker;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Path resolver interface.
|
|
73
|
+
* Enables testing of worker entry path resolution.
|
|
74
|
+
*/
|
|
75
|
+
export interface IWorkerEntryPath {
|
|
76
|
+
/**
|
|
77
|
+
* Get the absolute path to the worker entry point.
|
|
78
|
+
*/
|
|
79
|
+
getWorkerEntryPath(): string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Production path resolver using import.meta.url.
|
|
83
|
+
* Handles both compiled (dist/*.js) and source (src/*.ts via tsx) contexts.
|
|
84
|
+
*/
|
|
85
|
+
export declare class WorkerEntryPath implements IWorkerEntryPath {
|
|
86
|
+
getWorkerEntryPath(): string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Batch of runs for a worker.
|
|
90
|
+
*/
|
|
91
|
+
export interface RunBatch {
|
|
92
|
+
/** Batch index */
|
|
93
|
+
index: number;
|
|
94
|
+
/** Run IDs in this batch */
|
|
95
|
+
runIds: string[];
|
|
96
|
+
/** Runs in this batch */
|
|
97
|
+
runs: PlannedRun[];
|
|
98
|
+
/** First run ID in batch */
|
|
99
|
+
firstRunId: string;
|
|
100
|
+
/** Last run ID in batch */
|
|
101
|
+
lastRunId: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Worker threads executor options.
|
|
105
|
+
*/
|
|
106
|
+
export interface WorkerThreadsExecutorOptions {
|
|
107
|
+
/** Number of worker threads (default: auto-calculated from 75% CPU) */
|
|
108
|
+
workers?: number;
|
|
109
|
+
/** Maximum memory per worker in MB */
|
|
110
|
+
maxMemoryMb?: number;
|
|
111
|
+
/** Maximum concurrent I/O operations per worker */
|
|
112
|
+
maxConcurrentIo?: number;
|
|
113
|
+
/** Logger instance */
|
|
114
|
+
logger?: ILogger;
|
|
115
|
+
/** Worker factory instance */
|
|
116
|
+
workerFactory?: IWorkerFactory;
|
|
117
|
+
/** Worker entry path resolver */
|
|
118
|
+
workerEntryPath?: IWorkerEntryPath;
|
|
119
|
+
/** Base directory for resolving module paths (default: process.cwd()) */
|
|
120
|
+
baseDir?: string;
|
|
121
|
+
/** Use registry manifest mode for SUTs (enables registry-based SUTs with worker isolation) */
|
|
122
|
+
useRegistryManifest?: boolean;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Worker threads executor class with dependency injection.
|
|
126
|
+
*
|
|
127
|
+
* Executes experiments using Node.js worker threads for parallelism.
|
|
128
|
+
* Each worker runs in isolation, preventing SUT crashes from affecting the main process.
|
|
129
|
+
*/
|
|
130
|
+
export declare class WorkerThreadsExecutor {
|
|
131
|
+
private readonly logger;
|
|
132
|
+
private readonly workerFactory;
|
|
133
|
+
private readonly workerEntryPath;
|
|
134
|
+
private readonly baseDir;
|
|
135
|
+
private readonly useRegistryManifest;
|
|
136
|
+
constructor(options?: WorkerThreadsExecutorOptions);
|
|
137
|
+
/**
|
|
138
|
+
* Split runs into batches for parallel processing.
|
|
139
|
+
* @param runs - Runs to distribute
|
|
140
|
+
* @param numberWorkers - Number of worker threads
|
|
141
|
+
* @returns Array of run batches
|
|
142
|
+
*/
|
|
143
|
+
private _createBatches;
|
|
144
|
+
/**
|
|
145
|
+
* Execute runs using multiple worker threads.
|
|
146
|
+
*
|
|
147
|
+
* Each worker writes to its own sharded checkpoint file to avoid race conditions.
|
|
148
|
+
* After all workers complete, results are aggregated and returned.
|
|
149
|
+
*
|
|
150
|
+
* @param runs - Planned runs to execute
|
|
151
|
+
* @param suts - SUT definitions (serialized and passed to workers)
|
|
152
|
+
* @param cases - Case definitions (serialized and passed to workers)
|
|
153
|
+
* @param config - Executor configuration
|
|
154
|
+
* @param options - Worker threads executor options
|
|
155
|
+
* @param checkpointDir - Checkpoint directory for shard files
|
|
156
|
+
* @returns Execution results
|
|
157
|
+
*/
|
|
158
|
+
execute(runs: PlannedRun[], suts: {
|
|
159
|
+
registration: {
|
|
160
|
+
id: string;
|
|
161
|
+
name: string;
|
|
162
|
+
version: string;
|
|
163
|
+
role: string;
|
|
164
|
+
};
|
|
165
|
+
factory: unknown;
|
|
166
|
+
}[], cases: {
|
|
167
|
+
case: {
|
|
168
|
+
caseId: string;
|
|
169
|
+
};
|
|
170
|
+
getInput: () => Promise<unknown>;
|
|
171
|
+
getInputs: () => unknown;
|
|
172
|
+
}[], config: ExecutorConfig & {
|
|
173
|
+
onResult?: (result: EvaluationResult) => void;
|
|
174
|
+
}, options?: WorkerThreadsExecutorOptions, checkpointDir?: string): Promise<{
|
|
175
|
+
results: EvaluationResult[];
|
|
176
|
+
errors: {
|
|
177
|
+
runId: string;
|
|
178
|
+
error: string;
|
|
179
|
+
}[];
|
|
180
|
+
}>;
|
|
181
|
+
/**
|
|
182
|
+
* Spawn worker threads for all batches.
|
|
183
|
+
* @param batches - Run batches
|
|
184
|
+
* @param workerPath - Path to worker entry point
|
|
185
|
+
* @param checkpointDir - Checkpoint directory
|
|
186
|
+
* @param config - Executor configuration
|
|
187
|
+
* @param suts - SUT definitions to serialize
|
|
188
|
+
* @param cases - Case definitions to serialize
|
|
189
|
+
* @returns Array of worker states
|
|
190
|
+
*/
|
|
191
|
+
private _spawnWorkers;
|
|
192
|
+
/**
|
|
193
|
+
* Handle a message from a worker.
|
|
194
|
+
* @param state - Worker state
|
|
195
|
+
* @param data - Message data
|
|
196
|
+
* @param config - Executor configuration
|
|
197
|
+
*/
|
|
198
|
+
private _handleWorkerMessage;
|
|
199
|
+
/**
|
|
200
|
+
* Wait for all workers to complete.
|
|
201
|
+
* @param workerStates - Worker states
|
|
202
|
+
* @returns Promise that resolves when all workers complete
|
|
203
|
+
*/
|
|
204
|
+
private _waitForWorkers;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Execute runs using multiple worker threads.
|
|
208
|
+
*
|
|
209
|
+
* Each worker writes to its own sharded checkpoint file to avoid race conditions.
|
|
210
|
+
* After all workers complete, results are aggregated and returned.
|
|
211
|
+
*
|
|
212
|
+
* This is a convenience function that creates a WorkerThreadsExecutor with default dependencies.
|
|
213
|
+
* For testing or custom behavior, use the WorkerThreadsExecutor class directly.
|
|
214
|
+
*
|
|
215
|
+
* @param runs - Planned runs to execute
|
|
216
|
+
* @param suts - SUT definitions (serialized and passed to workers)
|
|
217
|
+
* @param cases - Case definitions (serialized and passed to workers)
|
|
218
|
+
* @param config - Executor configuration
|
|
219
|
+
* @param options - Worker threads executor options
|
|
220
|
+
* @returns Execution results
|
|
221
|
+
*/
|
|
222
|
+
export declare const executeWithWorkerThreads: (runs: PlannedRun[], suts: {
|
|
223
|
+
registration: {
|
|
224
|
+
id: string;
|
|
225
|
+
name: string;
|
|
226
|
+
version: string;
|
|
227
|
+
role: string;
|
|
228
|
+
};
|
|
229
|
+
factory: unknown;
|
|
230
|
+
}[], cases: {
|
|
231
|
+
case: {
|
|
232
|
+
caseId: string;
|
|
233
|
+
};
|
|
234
|
+
getInput: () => Promise<unknown>;
|
|
235
|
+
getInputs: () => unknown;
|
|
236
|
+
}[], config: ExecutorConfig & {
|
|
237
|
+
onResult?: (result: EvaluationResult) => void;
|
|
238
|
+
}, options?: WorkerThreadsExecutorOptions & Partial<ResourceLimits>) => Promise<{
|
|
239
|
+
results: EvaluationResult[];
|
|
240
|
+
errors: {
|
|
241
|
+
runId: string;
|
|
242
|
+
error: string;
|
|
243
|
+
}[];
|
|
244
|
+
}>;
|
|
245
|
+
//# sourceMappingURL=worker-threads-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
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EAClB,MAAM;IACL,YAAY,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1E,OAAO,EAAE,OAAO,CAAC;CACjB,EAAE,EACH,OAAO;IAAE,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAAC,SAAS,EAAE,MAAM,OAAO,CAAA;CAAE,EAAE,EACjG,QAAQ,cAAc,GAAG;IAAE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAAE,EAC1E,UAAS,4BAA4B,GAAG,OAAO,CAAC,cAAc,CAAM,KAClE,OAAO,CAAC;IAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAGrF,CAAC"}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker Threads Executor
|
|
3
|
+
*
|
|
4
|
+
* Executes experiments using Node.js worker threads for parallelism.
|
|
5
|
+
* Each worker runs in isolation, preventing SUT crashes from affecting the main process.
|
|
6
|
+
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* - Main thread spawns N worker threads (75% of CPU cores by default)
|
|
9
|
+
* - Each worker receives a batch of runs via postMessage
|
|
10
|
+
* - Workers write results to sharded checkpoint files
|
|
11
|
+
* - Main thread merges shards after all workers complete
|
|
12
|
+
*
|
|
13
|
+
* Benefits:
|
|
14
|
+
* - Main thread isolation: SUT crashes don't crash the CLI
|
|
15
|
+
* - True parallelism: Workers run on separate OS threads
|
|
16
|
+
* - Resource managed: Automatic 75% resource allocation
|
|
17
|
+
* - Fault tolerance: Single worker failure doesn't stop others
|
|
18
|
+
*
|
|
19
|
+
* Dependency Injection:
|
|
20
|
+
* - Logger interface enables testing of log output
|
|
21
|
+
* - WorkerFactory interface enables mocking Worker for testing
|
|
22
|
+
* - WorkerEntryPath interface enables testing worker path resolution
|
|
23
|
+
*/
|
|
24
|
+
import { resolve } from "node:path";
|
|
25
|
+
import { fileURLToPath } from "node:url";
|
|
26
|
+
/**
|
|
27
|
+
* Production logger using console.
|
|
28
|
+
*/
|
|
29
|
+
export class ConsoleLogger {
|
|
30
|
+
log(message) {
|
|
31
|
+
console.log(message);
|
|
32
|
+
}
|
|
33
|
+
debug(message) {
|
|
34
|
+
console.log(message);
|
|
35
|
+
}
|
|
36
|
+
info(message) {
|
|
37
|
+
console.log(message);
|
|
38
|
+
}
|
|
39
|
+
warn(message) {
|
|
40
|
+
console.warn(message);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
import { Worker } from "node:worker_threads";
|
|
44
|
+
/**
|
|
45
|
+
* Production worker factory using node:worker_threads.
|
|
46
|
+
* Registers the tsx loader when spawning workers from TypeScript source.
|
|
47
|
+
*/
|
|
48
|
+
export class WorkerFactory {
|
|
49
|
+
create(workerPath) {
|
|
50
|
+
const execArgv = workerPath.endsWith(".ts") ? ["--import", "tsx"] : [];
|
|
51
|
+
return new Worker(workerPath, { execArgv });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Production path resolver using import.meta.url.
|
|
56
|
+
* Handles both compiled (dist/*.js) and source (src/*.ts via tsx) contexts.
|
|
57
|
+
*/
|
|
58
|
+
export class WorkerEntryPath {
|
|
59
|
+
getWorkerEntryPath() {
|
|
60
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
61
|
+
const __dirname = resolve(__filename, "..");
|
|
62
|
+
const ext = __filename.endsWith(".ts") ? ".ts" : ".js";
|
|
63
|
+
return resolve(__dirname, `worker-entry${ext}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Worker threads executor class with dependency injection.
|
|
68
|
+
*
|
|
69
|
+
* Executes experiments using Node.js worker threads for parallelism.
|
|
70
|
+
* Each worker runs in isolation, preventing SUT crashes from affecting the main process.
|
|
71
|
+
*/
|
|
72
|
+
export class WorkerThreadsExecutor {
|
|
73
|
+
logger;
|
|
74
|
+
workerFactory;
|
|
75
|
+
workerEntryPath;
|
|
76
|
+
baseDir;
|
|
77
|
+
useRegistryManifest;
|
|
78
|
+
constructor(options = {}) {
|
|
79
|
+
this.logger = options.logger ?? new ConsoleLogger();
|
|
80
|
+
this.workerFactory = options.workerFactory ?? new WorkerFactory();
|
|
81
|
+
this.workerEntryPath = options.workerEntryPath ?? new WorkerEntryPath();
|
|
82
|
+
this.baseDir = options.baseDir ?? process.cwd();
|
|
83
|
+
this.useRegistryManifest = options.useRegistryManifest ?? false;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Split runs into batches for parallel processing.
|
|
87
|
+
* @param runs - Runs to distribute
|
|
88
|
+
* @param numberWorkers - Number of worker threads
|
|
89
|
+
* @returns Array of run batches
|
|
90
|
+
*/
|
|
91
|
+
_createBatches(runs, numberWorkers) {
|
|
92
|
+
const batchSize = Math.ceil(runs.length / numberWorkers);
|
|
93
|
+
const batches = [];
|
|
94
|
+
for (let i = 0; i < runs.length; i += batchSize) {
|
|
95
|
+
const batch = runs.slice(i, i + batchSize);
|
|
96
|
+
const batchIndex = Math.floor(i / batchSize);
|
|
97
|
+
const runIds = batch.map((r) => r.runId);
|
|
98
|
+
batches.push({
|
|
99
|
+
index: batchIndex,
|
|
100
|
+
runIds,
|
|
101
|
+
runs: batch,
|
|
102
|
+
firstRunId: batch[0]?.runId ?? "none",
|
|
103
|
+
lastRunId: batch.at(-1)?.runId ?? "none",
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return batches;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Execute runs using multiple worker threads.
|
|
110
|
+
*
|
|
111
|
+
* Each worker writes to its own sharded checkpoint file to avoid race conditions.
|
|
112
|
+
* After all workers complete, results are aggregated and returned.
|
|
113
|
+
*
|
|
114
|
+
* @param runs - Planned runs to execute
|
|
115
|
+
* @param suts - SUT definitions (serialized and passed to workers)
|
|
116
|
+
* @param cases - Case definitions (serialized and passed to workers)
|
|
117
|
+
* @param config - Executor configuration
|
|
118
|
+
* @param options - Worker threads executor options
|
|
119
|
+
* @param checkpointDir - Checkpoint directory for shard files
|
|
120
|
+
* @returns Execution results
|
|
121
|
+
*/
|
|
122
|
+
async execute(runs, suts, cases, config, options = {}, checkpointDir = resolve(process.cwd(), "results/execute")) {
|
|
123
|
+
const workerCount = options.workers ?? 1;
|
|
124
|
+
this.logger.info(`WorkerThreadsExecutor: Spawning ${workerCount} workers for ${runs.length} runs`);
|
|
125
|
+
this.logger.info(`Checkpoint directory: ${checkpointDir}`);
|
|
126
|
+
// Split runs into batches
|
|
127
|
+
const batches = this._createBatches(runs, workerCount);
|
|
128
|
+
// Log batch information
|
|
129
|
+
for (const batch of batches) {
|
|
130
|
+
this.logger.debug(`Batch ${batch.index} has ${batch.runIds.length} runs`);
|
|
131
|
+
this.logger.debug(` First run: ${batch.firstRunId}, Last run: ${batch.lastRunId}`);
|
|
132
|
+
}
|
|
133
|
+
// Get worker entry path
|
|
134
|
+
const workerPath = this.workerEntryPath.getWorkerEntryPath();
|
|
135
|
+
this.logger.debug(`Worker entry path: ${workerPath}`);
|
|
136
|
+
// Spawn workers
|
|
137
|
+
const workerStates = this._spawnWorkers(batches, workerPath, checkpointDir, config, suts, cases);
|
|
138
|
+
// Wait for all workers to complete
|
|
139
|
+
await this._waitForWorkers(workerStates);
|
|
140
|
+
// Aggregate results
|
|
141
|
+
const allResults = [];
|
|
142
|
+
const allErrors = [];
|
|
143
|
+
for (const state of workerStates) {
|
|
144
|
+
allResults.push(...state.results);
|
|
145
|
+
allErrors.push(...state.errors);
|
|
146
|
+
}
|
|
147
|
+
this.logger.info(`All workers completed: ${allResults.length} results, ${allErrors.length} errors`);
|
|
148
|
+
return { results: allResults, errors: allErrors };
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Spawn worker threads for all batches.
|
|
152
|
+
* @param batches - Run batches
|
|
153
|
+
* @param workerPath - Path to worker entry point
|
|
154
|
+
* @param checkpointDir - Checkpoint directory
|
|
155
|
+
* @param config - Executor configuration
|
|
156
|
+
* @param suts - SUT definitions to serialize
|
|
157
|
+
* @param cases - Case definitions to serialize
|
|
158
|
+
* @returns Array of worker states
|
|
159
|
+
*/
|
|
160
|
+
_spawnWorkers(batches, workerPath, checkpointDir, config, suts, cases) {
|
|
161
|
+
const workerStates = [];
|
|
162
|
+
// Serialize SUTs for WorkerMessage
|
|
163
|
+
const serializedSuts = suts.map((sut) => ({
|
|
164
|
+
id: sut.registration.id,
|
|
165
|
+
module: `./dist/suts/${sut.registration.id}.js`,
|
|
166
|
+
exportName: "createSut",
|
|
167
|
+
registration: {
|
|
168
|
+
name: sut.registration.name,
|
|
169
|
+
version: sut.registration.version,
|
|
170
|
+
role: sut.registration.role,
|
|
171
|
+
},
|
|
172
|
+
}));
|
|
173
|
+
// Serialize cases for WorkerMessage
|
|
174
|
+
const serializedCases = cases.map((c) => ({
|
|
175
|
+
caseId: c.case.caseId,
|
|
176
|
+
module: `./dist/cases/${c.case.caseId}.js`,
|
|
177
|
+
exportName: "createCase",
|
|
178
|
+
}));
|
|
179
|
+
for (const batch of batches) {
|
|
180
|
+
const checkpointPath = resolve(checkpointDir, `checkpoint-worker-${String(batch.index).padStart(2, "0")}.json`);
|
|
181
|
+
const worker = this.workerFactory.create(workerPath);
|
|
182
|
+
const state = {
|
|
183
|
+
worker,
|
|
184
|
+
index: batch.index,
|
|
185
|
+
batch,
|
|
186
|
+
checkpointPath,
|
|
187
|
+
completed: false,
|
|
188
|
+
results: [],
|
|
189
|
+
errors: [],
|
|
190
|
+
};
|
|
191
|
+
// Set up message handler
|
|
192
|
+
worker.on("message", (data) => {
|
|
193
|
+
this._handleWorkerMessage(state, data, config);
|
|
194
|
+
});
|
|
195
|
+
// Set up error handler
|
|
196
|
+
worker.on("error", (error) => {
|
|
197
|
+
this.logger.warn(`Worker ${batch.index} error: ${error.message}`);
|
|
198
|
+
state.completed = true;
|
|
199
|
+
// Add error for all runs in this batch
|
|
200
|
+
for (const runId of batch.runIds) {
|
|
201
|
+
state.errors.push({ runId, error: error.message });
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
// Send initial message to worker with serialized SUTs and cases
|
|
205
|
+
const workerMessage = {
|
|
206
|
+
runs: batch.runs.map((run) => ({
|
|
207
|
+
runId: run.runId,
|
|
208
|
+
sutId: run.sutId,
|
|
209
|
+
caseId: run.caseId,
|
|
210
|
+
repetition: run.repetition,
|
|
211
|
+
config: run.config,
|
|
212
|
+
})),
|
|
213
|
+
config: {
|
|
214
|
+
repetitions: config.repetitions,
|
|
215
|
+
seedBase: config.seedBase,
|
|
216
|
+
continueOnError: config.continueOnError,
|
|
217
|
+
timeoutMs: config.timeoutMs,
|
|
218
|
+
collectProvenance: config.collectProvenance,
|
|
219
|
+
},
|
|
220
|
+
baseDir: this.baseDir,
|
|
221
|
+
suts: serializedSuts,
|
|
222
|
+
cases: serializedCases,
|
|
223
|
+
};
|
|
224
|
+
// Add registry manifest if useRegistryManifest is enabled
|
|
225
|
+
if (this.useRegistryManifest) {
|
|
226
|
+
const registryManifest = {
|
|
227
|
+
suts: suts.map((sut) => ({
|
|
228
|
+
id: sut.registration.id,
|
|
229
|
+
name: sut.registration.name,
|
|
230
|
+
version: sut.registration.version,
|
|
231
|
+
role: sut.registration.role,
|
|
232
|
+
config: {},
|
|
233
|
+
tags: [],
|
|
234
|
+
})),
|
|
235
|
+
sharedCode: "", // Registry code not bundled in this implementation
|
|
236
|
+
sutModules: Object.fromEntries(suts.map((sut) => [sut.registration.id, `./dist/suts/${sut.registration.id}.js`])),
|
|
237
|
+
exportName: "createSut",
|
|
238
|
+
};
|
|
239
|
+
workerMessage.registryManifest = registryManifest;
|
|
240
|
+
}
|
|
241
|
+
worker.postMessage(workerMessage);
|
|
242
|
+
workerStates.push(state);
|
|
243
|
+
}
|
|
244
|
+
return workerStates;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Handle a message from a worker.
|
|
248
|
+
* @param state - Worker state
|
|
249
|
+
* @param data - Message data
|
|
250
|
+
* @param config - Executor configuration
|
|
251
|
+
*/
|
|
252
|
+
_handleWorkerMessage(state, data, config) {
|
|
253
|
+
// Use type guards to discriminate the union type
|
|
254
|
+
const isError = (msg) => msg.type === "error";
|
|
255
|
+
const isSuccess = (msg) => msg.type === "done";
|
|
256
|
+
// Handle WorkerErrorMessage
|
|
257
|
+
if (isError(data)) {
|
|
258
|
+
this.logger.warn(`Worker ${state.index} error: ${data.error}`);
|
|
259
|
+
state.completed = true;
|
|
260
|
+
for (const runId of state.batch.runIds) {
|
|
261
|
+
state.errors.push({ runId, error: data.error });
|
|
262
|
+
}
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
// Handle WorkerSuccessMessage
|
|
266
|
+
if (isSuccess(data)) {
|
|
267
|
+
state.results.push(...data.results);
|
|
268
|
+
state.errors.push(...data.errors);
|
|
269
|
+
state.completed = true;
|
|
270
|
+
this.logger.debug(`Worker ${state.index} completed: ${data.results.length} results`);
|
|
271
|
+
// Call onResult callback for each result
|
|
272
|
+
if (config.onResult) {
|
|
273
|
+
for (const result of data.results) {
|
|
274
|
+
try {
|
|
275
|
+
void config.onResult(result);
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
this.logger.warn(`Error in onResult callback: ${String(error)}`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Wait for all workers to complete.
|
|
286
|
+
* @param workerStates - Worker states
|
|
287
|
+
* @returns Promise that resolves when all workers complete
|
|
288
|
+
*/
|
|
289
|
+
async _waitForWorkers(workerStates) {
|
|
290
|
+
return new Promise((resolve, reject) => {
|
|
291
|
+
let completedCount = 0;
|
|
292
|
+
const totalWorkers = workerStates.length;
|
|
293
|
+
const checkCompletion = () => {
|
|
294
|
+
completedCount = workerStates.filter((s) => s.completed).length;
|
|
295
|
+
if (completedCount === totalWorkers) {
|
|
296
|
+
clearInterval(interval);
|
|
297
|
+
clearTimeout(timeout);
|
|
298
|
+
resolve();
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
// Poll for completion
|
|
302
|
+
const interval = setInterval(checkCompletion, 100);
|
|
303
|
+
// Timeout after 1 hour
|
|
304
|
+
const timeout = setTimeout(() => {
|
|
305
|
+
clearInterval(interval);
|
|
306
|
+
const incomplete = workerStates.filter((s) => !s.completed).map((s) => s.index);
|
|
307
|
+
reject(new Error(`Worker timeout after 1 hour. Incomplete workers: ${incomplete.join(", ")}`));
|
|
308
|
+
}, 3_600_000);
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Execute runs using multiple worker threads.
|
|
314
|
+
*
|
|
315
|
+
* Each worker writes to its own sharded checkpoint file to avoid race conditions.
|
|
316
|
+
* After all workers complete, results are aggregated and returned.
|
|
317
|
+
*
|
|
318
|
+
* This is a convenience function that creates a WorkerThreadsExecutor with default dependencies.
|
|
319
|
+
* For testing or custom behavior, use the WorkerThreadsExecutor class directly.
|
|
320
|
+
*
|
|
321
|
+
* @param runs - Planned runs to execute
|
|
322
|
+
* @param suts - SUT definitions (serialized and passed to workers)
|
|
323
|
+
* @param cases - Case definitions (serialized and passed to workers)
|
|
324
|
+
* @param config - Executor configuration
|
|
325
|
+
* @param options - Worker threads executor options
|
|
326
|
+
* @returns Execution results
|
|
327
|
+
*/
|
|
328
|
+
export const executeWithWorkerThreads = async (runs, suts, cases, config, options = {}) => {
|
|
329
|
+
const executor = new WorkerThreadsExecutor(options);
|
|
330
|
+
return executor.execute(runs, suts, cases, config, options);
|
|
331
|
+
};
|
|
332
|
+
//# sourceMappingURL=worker-threads-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-threads-executor.js","sourceRoot":"","sources":["../../src/executor/worker-threads-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA0BzC;;GAEG;AACH,MAAM,OAAO,aAAa;IACzB,GAAG,CAAC,OAAe;QAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,OAAe;QACpB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,OAAe;QACnB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,OAAe;QACnB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;CACD;AAqBD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C;;;GAGG;AACH,MAAM,OAAO,aAAa;IACzB,MAAM,CAAC,UAAkB;QACxB,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,OAAO,IAAI,MAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAY,CAAC;IACxD,CAAC;CACD;AAaD;;;GAGG;AACH,MAAM,OAAO,eAAe;IAC3B,kBAAkB;QACjB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC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istical/index.js";
|
|
11
11
|
export * from "./aggregation/index.js";
|
|
12
|
+
export * from "./evaluators/index.js";
|
|
12
13
|
export * from "./claims/index.js";
|
|
13
14
|
export * from "./robustness/index.js";
|
|
14
15
|
export * from "./renderers/index.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,9 +15,11 @@ export * from "./collector/index.js";
|
|
|
15
15
|
export * from "./statistical/index.js";
|
|
16
16
|
// Aggregation
|
|
17
17
|
export * from "./aggregation/index.js";
|
|
18
|
-
//
|
|
18
|
+
// Evaluators (new extensible evaluation system)
|
|
19
|
+
export * from "./evaluators/index.js";
|
|
20
|
+
// Claims (types only)
|
|
19
21
|
export * from "./claims/index.js";
|
|
20
|
-
// Robustness
|
|
22
|
+
// Robustness (types and perturbations only)
|
|
21
23
|
export * from "./robustness/index.js";
|
|
22
24
|
// Renderers
|
|
23
25
|
export * from "./renderers/index.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,cAAc,kBAAkB,CAAC;AAEjC,WAAW;AACX,cAAc,qBAAqB,CAAC;AAEpC,WAAW;AACX,cAAc,qBAAqB,CAAC;AAEpC,YAAY;AACZ,cAAc,sBAAsB,CAAC;AAErC,cAAc;AACd,cAAc,wBAAwB,CAAC;AAEvC,cAAc;AACd,cAAc,wBAAwB,CAAC;AAEvC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,cAAc,kBAAkB,CAAC;AAEjC,WAAW;AACX,cAAc,qBAAqB,CAAC;AAEpC,WAAW;AACX,cAAc,qBAAqB,CAAC;AAEpC,YAAY;AACZ,cAAc,sBAAsB,CAAC;AAErC,cAAc;AACd,cAAc,wBAAwB,CAAC;AAEvC,cAAc;AACd,cAAc,wBAAwB,CAAC;AAEvC,gDAAgD;AAChD,cAAc,uBAAuB,CAAC;AAEtC,sBAAsB;AACtB,cAAc,mBAAmB,CAAC;AAElC,4CAA4C;AAC5C,cAAc,uBAAuB,CAAC;AAEtC,YAAY;AACZ,cAAc,sBAAsB,CAAC"}
|