dag-ml-wasm 0.3.23 → 0.3.27
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 +27 -0
- package/dag_ml_wasm.d.ts +118 -15
- package/dag_ml_wasm.js +573 -6
- package/dag_ml_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,17 @@ The WASM package exposes validation, DSL compilation, execution-plan
|
|
|
6
6
|
construction and synchronous host-controller execution over UTF-8 JSON strings.
|
|
7
7
|
Artifacts and data-buffer ownership remain outside the binding.
|
|
8
8
|
|
|
9
|
+
For parallel browser HPO, call `host_hpo_search_parallel_json` with a
|
|
10
|
+
dispatcher that returns a Promise for each serialized candidate task. Each Web
|
|
11
|
+
Worker loads its own WASM instance and calls `host_hpo_evaluate_worker_task_json`
|
|
12
|
+
with candidate-local controller state. The core dispatches a whole trial window
|
|
13
|
+
before awaiting results, validates scores and checkpoints, then tells the
|
|
14
|
+
optimizer in trial order. `host_hpo_search_json` remains the synchronous
|
|
15
|
+
single-worker route. For progressive pruning, tagged fold tasks call
|
|
16
|
+
`host_hpo_evaluate_worker_fold_json` and return to the coordinator after each
|
|
17
|
+
fold; pruned candidates never execute later folds. Complete candidates run one
|
|
18
|
+
full native FIT_CV pass for the exact global OOF result.
|
|
19
|
+
|
|
9
20
|
`contract_manifest_json()` returns a stable JSON manifest with the package
|
|
10
21
|
version, supported contract ids, exported Python/WASM function names and shared
|
|
11
22
|
fixture digests. Browser integrations should check it before accepting cached
|
|
@@ -113,6 +124,22 @@ injects the authoritative native seed before scheduler validation. The returned
|
|
|
113
124
|
`resultsJson` still contains native numeric `u64` values; use a lossless JSON
|
|
114
125
|
integer parser, or preserve the raw JSON, when inspecting lineage seeds exactly.
|
|
115
126
|
|
|
127
|
+
For host hyperparameter search, `host_hpo_search_json(planJson, manifestsJson,
|
|
128
|
+
envelopeJson, requestJson, checkpointJson, controller, optimizer)` runs the same
|
|
129
|
+
sequential native search as Rust and PyO3. The `controller` has the signature
|
|
130
|
+
shown above. The synchronous `optimizer(operation, payloadJson)` must return a
|
|
131
|
+
JSON string: `ask` returns `{"params": {...}}` or `{"params": null}`;
|
|
132
|
+
`report_intermediate` returns `{"prune": true|false}`; `tell`, `pruned`,
|
|
133
|
+
`fail`, and `prepare_terminal` return `{"ok": true}`; `checkpoint` returns
|
|
134
|
+
`{"continue": true|false}`. `prepare_terminal` receives a sealed prospective
|
|
135
|
+
checkpoint before an optimizer transition, so a browser host should persist it
|
|
136
|
+
durably before replying. To resume, pass the last published native checkpoint
|
|
137
|
+
as `checkpointJson` and reconcile any prepared optimizer transition first with
|
|
138
|
+
`recover_host_hpo_checkpoint_json(checkpointJson, preparedJson, interruptedJson)`;
|
|
139
|
+
use `"null"` and `"[]"` when there is no prepared terminal or interrupted trial.
|
|
140
|
+
This export runs one candidate at a time; browser worker parallelism remains
|
|
141
|
+
an adapter gap.
|
|
142
|
+
|
|
116
143
|
JavaScript-local descriptors use `binding:javascript` and a `host_local` or
|
|
117
144
|
`portable_registered` lifecycle. A Web Worker must populate its own registry;
|
|
118
145
|
functions are not cloned, posted, or embedded in replay artifacts. Resolution
|
package/dag_ml_wasm.d.ts
CHANGED
|
@@ -27,6 +27,11 @@ export class TrainingLossBinding {
|
|
|
27
27
|
readonly required_attestation_json: string;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Validate named source/sample coverage and return identity-only row indices.
|
|
32
|
+
*/
|
|
33
|
+
export function align_named_source_rows_json(request_json: string): string;
|
|
34
|
+
|
|
30
35
|
export function build_execution_plan_json(plan_id: string, graph_json: string, campaign_json: string, controller_manifests_json: string): string;
|
|
31
36
|
|
|
32
37
|
/**
|
|
@@ -75,8 +80,51 @@ export function execute_campaign_phase_json(plan_id: string, graph_json: string,
|
|
|
75
80
|
*/
|
|
76
81
|
export function execute_execution_plan_phase_json(execution_plan_json: string, trusted_controller_manifests_json: string, run_id: string, root_seed: number, phase: string, js_invoke: Function): string;
|
|
77
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Execute a no-splitter REFIT once and return the closed package and node evidence.
|
|
85
|
+
* The synchronous JS callback owns host-sidecar operator state by artifact ID.
|
|
86
|
+
*/
|
|
87
|
+
export function execute_initial_full_refit_json(plan_json: string, trusted_controller_manifests_json: string, envelope_json: string, training_sample_ids_json: string, package_id: string, run_id: string, root_seed: string, js_invoke: Function): string;
|
|
88
|
+
|
|
78
89
|
export function fold_set_fingerprint_json(json: string): string;
|
|
79
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Evaluate one FIT_CV fold only, then return to the browser coordinator for
|
|
93
|
+
* its optimizer's prune decision before any later fold is dispatched.
|
|
94
|
+
*/
|
|
95
|
+
export function host_hpo_evaluate_worker_fold_json(task_json: string, fold_index: number, trusted_controller_manifests_json: string, data_envelope_json: string, request_json: string, js_invoke: Function): string;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Evaluate one candidate inside its own Web Worker/WASM instance. The
|
|
99
|
+
* browser's dispatcher sends the serialized `HostHpoWorkerTask` to a worker,
|
|
100
|
+
* which invokes this function with its local synchronous controller callback.
|
|
101
|
+
*/
|
|
102
|
+
export function host_hpo_evaluate_worker_task_json(task_json: string, trusted_controller_manifests_json: string, data_envelope_json: string, request_json: string, js_invoke: Function): string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Run one-worker host HPO with native fold scoring, pruning and durable
|
|
106
|
+
* checkpoint transitions. Both callbacks are synchronous: the controller is
|
|
107
|
+
* `(controllerId, taskJson, exactSeed) => nodeResultJson`; the optimizer is
|
|
108
|
+
* `(operation, payloadJson) => replyJson` (see README). The browser persists
|
|
109
|
+
* its own optimizer state and native checkpoint before returning from each
|
|
110
|
+
* `prepare_terminal`/`checkpoint` callback.
|
|
111
|
+
*/
|
|
112
|
+
export function host_hpo_search_json(execution_plan_json: string, trusted_controller_manifests_json: string, data_envelope_json: string, request_json: string, checkpoint_json: string | null | undefined, js_invoke: Function, js_optimizer: Function): string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Run a true browser worker window: dispatch every candidate before awaiting
|
|
116
|
+
* any Promise, then reconcile results with native core in trial order. The
|
|
117
|
+
* dispatcher has shape `(taskJson) => Promise<workerResultJson>`; each worker
|
|
118
|
+
* owns a separate WASM instance and invokes `host_hpo_evaluate_worker_task_json`.
|
|
119
|
+
* The existing synchronous `host_hpo_search_json` remains available.
|
|
120
|
+
*/
|
|
121
|
+
export function host_hpo_search_parallel_json(execution_plan_json: string, trusted_controller_manifests_json: string, data_envelope_json: string, request_json: string, checkpoint_json: string | null | undefined, max_workers: number, js_dispatch: Function, js_optimizer: Function): Promise<string>;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Attach a new V2 PREDICT cohort to the package's signed training envelope.
|
|
125
|
+
*/
|
|
126
|
+
export function initial_full_refit_predict_envelope_json(package_json: string, cohort_json: string): string;
|
|
127
|
+
|
|
80
128
|
/**
|
|
81
129
|
* Build a K-fold `FoldSet` from a `KFoldSpec` JSON + a JSON array of sample ids.
|
|
82
130
|
* dag-ml owns the split — the host stops building folds itself.
|
|
@@ -85,6 +133,19 @@ export function kfold_split_json(spec_json: string, sample_ids_json: string, id:
|
|
|
85
133
|
|
|
86
134
|
export function loss_execution_attestation_json(training_loss_role_json: string, phase: string): string;
|
|
87
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Validate a browser-persisted prepared terminal and seal interrupted trials
|
|
138
|
+
* before resuming search. This is the same recovery contract as PyO3/C ABI.
|
|
139
|
+
*/
|
|
140
|
+
export function recover_host_hpo_checkpoint_json(checkpoint_json: string, prepared_json: string, interrupted_json: string): string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Replay selected package outputs on a fresh V2 cohort without training.
|
|
144
|
+
* Raw native payloads are hydrated from the package; host sidecars use exact
|
|
145
|
+
* caller-owned artifact handles registered for this invocation only.
|
|
146
|
+
*/
|
|
147
|
+
export function replay_initial_full_refit_json(package_json: string, envelope_json: string, output_ids_json: string, artifact_handles_json: string, run_id: string, js_invoke: Function): string;
|
|
148
|
+
|
|
88
149
|
/**
|
|
89
150
|
* Rank candidate variants and return the winner — the SELECT phase for in-browser
|
|
90
151
|
* generators/finetune. Selection stays in dag-ml (deterministic argmin/argmax +
|
|
@@ -94,6 +155,26 @@ export function loss_execution_attestation_json(training_loss_role_json: string,
|
|
|
94
155
|
*/
|
|
95
156
|
export function select_candidates_json(policy_json: string, candidates_json: string, groups_json?: string | null): string;
|
|
96
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Resolve one explicitly named output of a signed portable package.
|
|
160
|
+
*/
|
|
161
|
+
export function select_portable_output_json(package_json: string, binding_id: string): string;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Select a CV fold for stacking test predictions from validation scores.
|
|
165
|
+
*/
|
|
166
|
+
export function select_stacking_fold_json(request_json: string): string;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Select stacking producers from validation scores with the native policy.
|
|
170
|
+
*/
|
|
171
|
+
export function select_stacking_producers_json(request_json: string): string;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Objective-aware normalized CV-fold weights for stacking test predictions.
|
|
175
|
+
*/
|
|
176
|
+
export function stacking_fold_weights_json(request_json: string): string;
|
|
177
|
+
|
|
97
178
|
/**
|
|
98
179
|
* Build a stratified K-fold `FoldSet`: same OOF-once guarantee as K-fold, but
|
|
99
180
|
* balanced by a per-sample class label. `strata_json` is a JSON object mapping
|
|
@@ -115,6 +196,11 @@ export function validate_fold_set_json(json: string): void;
|
|
|
115
196
|
|
|
116
197
|
export function validate_graph_json(json: string): void;
|
|
117
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Validate a signed no-splitter REFIT package before any host operator callback.
|
|
201
|
+
*/
|
|
202
|
+
export function validate_initial_full_refit_package_json(package_json: string): void;
|
|
203
|
+
|
|
118
204
|
export function validate_pipeline_dsl_json(json: string): void;
|
|
119
205
|
|
|
120
206
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
@@ -123,6 +209,26 @@ export interface InitOutput {
|
|
|
123
209
|
readonly memory: WebAssembly.Memory;
|
|
124
210
|
readonly __wbg_localimplementationregistry_free: (a: number, b: number) => void;
|
|
125
211
|
readonly __wbg_traininglossbinding_free: (a: number, b: number) => void;
|
|
212
|
+
readonly align_named_source_rows_json: (a: number, b: number) => [number, number, number, number];
|
|
213
|
+
readonly build_execution_plan_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
214
|
+
readonly build_execution_plan_with_training_losses_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number, number, number];
|
|
215
|
+
readonly compile_pipeline_dsl_artifact_json: (a: number, b: number) => [number, number, number, number];
|
|
216
|
+
readonly compile_pipeline_dsl_artifact_with_controllers_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
217
|
+
readonly compile_pipeline_dsl_graph_json: (a: number, b: number) => [number, number, number, number];
|
|
218
|
+
readonly contract_manifest_json: () => [number, number, number, number];
|
|
219
|
+
readonly dag_ml_version: () => [number, number];
|
|
220
|
+
readonly derive_controller_manifest_json: (a: number, b: number) => [number, number, number, number];
|
|
221
|
+
readonly derive_controller_manifest_list_json: (a: number, b: number) => [number, number, number, number];
|
|
222
|
+
readonly execute_campaign_phase_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: any) => [number, number, number, number];
|
|
223
|
+
readonly execute_execution_plan_phase_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any) => [number, number, number, number];
|
|
224
|
+
readonly execute_initial_full_refit_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: any) => [number, number, number, number];
|
|
225
|
+
readonly fold_set_fingerprint_json: (a: number, b: number) => [number, number, number, number];
|
|
226
|
+
readonly host_hpo_evaluate_worker_fold_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any) => [number, number, number, number];
|
|
227
|
+
readonly host_hpo_evaluate_worker_task_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: any) => [number, number, number, number];
|
|
228
|
+
readonly host_hpo_search_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: any, l: any) => [number, number, number, number];
|
|
229
|
+
readonly host_hpo_search_parallel_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: any, m: any) => any;
|
|
230
|
+
readonly initial_full_refit_predict_envelope_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
231
|
+
readonly kfold_split_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
126
232
|
readonly localimplementationregistry_bind_training_loss: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
127
233
|
readonly localimplementationregistry_clear: (a: number) => void;
|
|
128
234
|
readonly localimplementationregistry_descriptors_json: (a: number) => [number, number, number, number];
|
|
@@ -137,23 +243,16 @@ export interface InitOutput {
|
|
|
137
243
|
readonly localimplementationregistry_unregister_loss: (a: number, b: number, c: number) => [number, number, number];
|
|
138
244
|
readonly localimplementationregistry_unregister_metric: (a: number, b: number, c: number) => [number, number, number];
|
|
139
245
|
readonly loss_execution_attestation_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
140
|
-
readonly
|
|
141
|
-
readonly
|
|
142
|
-
readonly build_execution_plan_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
143
|
-
readonly build_execution_plan_with_training_losses_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number, number, number];
|
|
144
|
-
readonly compile_pipeline_dsl_artifact_json: (a: number, b: number) => [number, number, number, number];
|
|
145
|
-
readonly compile_pipeline_dsl_artifact_with_controllers_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
146
|
-
readonly compile_pipeline_dsl_graph_json: (a: number, b: number) => [number, number, number, number];
|
|
147
|
-
readonly contract_manifest_json: () => [number, number, number, number];
|
|
148
|
-
readonly dag_ml_version: () => [number, number];
|
|
149
|
-
readonly derive_controller_manifest_json: (a: number, b: number) => [number, number, number, number];
|
|
150
|
-
readonly derive_controller_manifest_list_json: (a: number, b: number) => [number, number, number, number];
|
|
151
|
-
readonly execute_campaign_phase_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: any) => [number, number, number, number];
|
|
152
|
-
readonly execute_execution_plan_phase_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any) => [number, number, number, number];
|
|
153
|
-
readonly fold_set_fingerprint_json: (a: number, b: number) => [number, number, number, number];
|
|
154
|
-
readonly kfold_split_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
246
|
+
readonly recover_host_hpo_checkpoint_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
247
|
+
readonly replay_initial_full_refit_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: any) => [number, number, number, number];
|
|
155
248
|
readonly select_candidates_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
249
|
+
readonly select_portable_output_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
250
|
+
readonly select_stacking_fold_json: (a: number, b: number) => [number, number, number, number];
|
|
251
|
+
readonly select_stacking_producers_json: (a: number, b: number) => [number, number, number, number];
|
|
252
|
+
readonly stacking_fold_weights_json: (a: number, b: number) => [number, number, number, number];
|
|
156
253
|
readonly stratified_kfold_split_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
254
|
+
readonly traininglossbinding_invoke: (a: number) => any;
|
|
255
|
+
readonly traininglossbinding_required_attestation_json: (a: number) => [number, number];
|
|
157
256
|
readonly validate_campaign_json: (a: number, b: number) => [number, number];
|
|
158
257
|
readonly validate_controller_manifest_json: (a: number, b: number) => [number, number];
|
|
159
258
|
readonly validate_controller_manifest_list_json: (a: number, b: number) => [number, number];
|
|
@@ -161,12 +260,16 @@ export interface InitOutput {
|
|
|
161
260
|
readonly validate_execution_plan_json: (a: number, b: number) => [number, number];
|
|
162
261
|
readonly validate_fold_set_json: (a: number, b: number) => [number, number];
|
|
163
262
|
readonly validate_graph_json: (a: number, b: number) => [number, number];
|
|
263
|
+
readonly validate_initial_full_refit_package_json: (a: number, b: number) => [number, number];
|
|
164
264
|
readonly validate_pipeline_dsl_json: (a: number, b: number) => [number, number];
|
|
265
|
+
readonly wasm_bindgen_dab8739f2315efff___convert__closures_____invoke___js_sys_dd5193d6d4000a3a___Function_fn_wasm_bindgen_dab8739f2315efff___JsValue_____wasm_bindgen_dab8739f2315efff___sys__Undefined___js_sys_dd5193d6d4000a3a___Function_fn_wasm_bindgen_dab8739f2315efff___JsValue_____wasm_bindgen_dab8739f2315efff___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
266
|
+
readonly wasm_bindgen_dab8739f2315efff___convert__closures_____invoke___wasm_bindgen_dab8739f2315efff___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_dab8739f2315efff___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
165
267
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
166
268
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
167
269
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
168
270
|
readonly __externref_table_alloc: () => number;
|
|
169
271
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
272
|
+
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
170
273
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
171
274
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
172
275
|
readonly __wbindgen_start: () => void;
|
package/dag_ml_wasm.js
CHANGED
|
@@ -209,6 +209,32 @@ export class TrainingLossBinding {
|
|
|
209
209
|
}
|
|
210
210
|
if (Symbol.dispose) TrainingLossBinding.prototype[Symbol.dispose] = TrainingLossBinding.prototype.free;
|
|
211
211
|
|
|
212
|
+
/**
|
|
213
|
+
* Validate named source/sample coverage and return identity-only row indices.
|
|
214
|
+
* @param {string} request_json
|
|
215
|
+
* @returns {string}
|
|
216
|
+
*/
|
|
217
|
+
export function align_named_source_rows_json(request_json) {
|
|
218
|
+
let deferred3_0;
|
|
219
|
+
let deferred3_1;
|
|
220
|
+
try {
|
|
221
|
+
const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
222
|
+
const len0 = WASM_VECTOR_LEN;
|
|
223
|
+
const ret = wasm.align_named_source_rows_json(ptr0, len0);
|
|
224
|
+
var ptr2 = ret[0];
|
|
225
|
+
var len2 = ret[1];
|
|
226
|
+
if (ret[3]) {
|
|
227
|
+
ptr2 = 0; len2 = 0;
|
|
228
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
229
|
+
}
|
|
230
|
+
deferred3_0 = ptr2;
|
|
231
|
+
deferred3_1 = len2;
|
|
232
|
+
return getStringFromWasm0(ptr2, len2);
|
|
233
|
+
} finally {
|
|
234
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
212
238
|
/**
|
|
213
239
|
* @param {string} plan_id
|
|
214
240
|
* @param {string} graph_json
|
|
@@ -544,6 +570,52 @@ export function execute_execution_plan_phase_json(execution_plan_json, trusted_c
|
|
|
544
570
|
}
|
|
545
571
|
}
|
|
546
572
|
|
|
573
|
+
/**
|
|
574
|
+
* Execute a no-splitter REFIT once and return the closed package and node evidence.
|
|
575
|
+
* The synchronous JS callback owns host-sidecar operator state by artifact ID.
|
|
576
|
+
* @param {string} plan_json
|
|
577
|
+
* @param {string} trusted_controller_manifests_json
|
|
578
|
+
* @param {string} envelope_json
|
|
579
|
+
* @param {string} training_sample_ids_json
|
|
580
|
+
* @param {string} package_id
|
|
581
|
+
* @param {string} run_id
|
|
582
|
+
* @param {string} root_seed
|
|
583
|
+
* @param {Function} js_invoke
|
|
584
|
+
* @returns {string}
|
|
585
|
+
*/
|
|
586
|
+
export function execute_initial_full_refit_json(plan_json, trusted_controller_manifests_json, envelope_json, training_sample_ids_json, package_id, run_id, root_seed, js_invoke) {
|
|
587
|
+
let deferred9_0;
|
|
588
|
+
let deferred9_1;
|
|
589
|
+
try {
|
|
590
|
+
const ptr0 = passStringToWasm0(plan_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
591
|
+
const len0 = WASM_VECTOR_LEN;
|
|
592
|
+
const ptr1 = passStringToWasm0(trusted_controller_manifests_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
593
|
+
const len1 = WASM_VECTOR_LEN;
|
|
594
|
+
const ptr2 = passStringToWasm0(envelope_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
595
|
+
const len2 = WASM_VECTOR_LEN;
|
|
596
|
+
const ptr3 = passStringToWasm0(training_sample_ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
597
|
+
const len3 = WASM_VECTOR_LEN;
|
|
598
|
+
const ptr4 = passStringToWasm0(package_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
599
|
+
const len4 = WASM_VECTOR_LEN;
|
|
600
|
+
const ptr5 = passStringToWasm0(run_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
601
|
+
const len5 = WASM_VECTOR_LEN;
|
|
602
|
+
const ptr6 = passStringToWasm0(root_seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
603
|
+
const len6 = WASM_VECTOR_LEN;
|
|
604
|
+
const ret = wasm.execute_initial_full_refit_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, js_invoke);
|
|
605
|
+
var ptr8 = ret[0];
|
|
606
|
+
var len8 = ret[1];
|
|
607
|
+
if (ret[3]) {
|
|
608
|
+
ptr8 = 0; len8 = 0;
|
|
609
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
610
|
+
}
|
|
611
|
+
deferred9_0 = ptr8;
|
|
612
|
+
deferred9_1 = len8;
|
|
613
|
+
return getStringFromWasm0(ptr8, len8);
|
|
614
|
+
} finally {
|
|
615
|
+
wasm.__wbindgen_free(deferred9_0, deferred9_1, 1);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
547
619
|
/**
|
|
548
620
|
* @param {string} json
|
|
549
621
|
* @returns {string}
|
|
@@ -569,6 +641,187 @@ export function fold_set_fingerprint_json(json) {
|
|
|
569
641
|
}
|
|
570
642
|
}
|
|
571
643
|
|
|
644
|
+
/**
|
|
645
|
+
* Evaluate one FIT_CV fold only, then return to the browser coordinator for
|
|
646
|
+
* its optimizer's prune decision before any later fold is dispatched.
|
|
647
|
+
* @param {string} task_json
|
|
648
|
+
* @param {number} fold_index
|
|
649
|
+
* @param {string} trusted_controller_manifests_json
|
|
650
|
+
* @param {string} data_envelope_json
|
|
651
|
+
* @param {string} request_json
|
|
652
|
+
* @param {Function} js_invoke
|
|
653
|
+
* @returns {string}
|
|
654
|
+
*/
|
|
655
|
+
export function host_hpo_evaluate_worker_fold_json(task_json, fold_index, trusted_controller_manifests_json, data_envelope_json, request_json, js_invoke) {
|
|
656
|
+
let deferred6_0;
|
|
657
|
+
let deferred6_1;
|
|
658
|
+
try {
|
|
659
|
+
const ptr0 = passStringToWasm0(task_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
660
|
+
const len0 = WASM_VECTOR_LEN;
|
|
661
|
+
const ptr1 = passStringToWasm0(trusted_controller_manifests_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
662
|
+
const len1 = WASM_VECTOR_LEN;
|
|
663
|
+
const ptr2 = passStringToWasm0(data_envelope_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
664
|
+
const len2 = WASM_VECTOR_LEN;
|
|
665
|
+
const ptr3 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
666
|
+
const len3 = WASM_VECTOR_LEN;
|
|
667
|
+
const ret = wasm.host_hpo_evaluate_worker_fold_json(ptr0, len0, fold_index, ptr1, len1, ptr2, len2, ptr3, len3, js_invoke);
|
|
668
|
+
var ptr5 = ret[0];
|
|
669
|
+
var len5 = ret[1];
|
|
670
|
+
if (ret[3]) {
|
|
671
|
+
ptr5 = 0; len5 = 0;
|
|
672
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
673
|
+
}
|
|
674
|
+
deferred6_0 = ptr5;
|
|
675
|
+
deferred6_1 = len5;
|
|
676
|
+
return getStringFromWasm0(ptr5, len5);
|
|
677
|
+
} finally {
|
|
678
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Evaluate one candidate inside its own Web Worker/WASM instance. The
|
|
684
|
+
* browser's dispatcher sends the serialized `HostHpoWorkerTask` to a worker,
|
|
685
|
+
* which invokes this function with its local synchronous controller callback.
|
|
686
|
+
* @param {string} task_json
|
|
687
|
+
* @param {string} trusted_controller_manifests_json
|
|
688
|
+
* @param {string} data_envelope_json
|
|
689
|
+
* @param {string} request_json
|
|
690
|
+
* @param {Function} js_invoke
|
|
691
|
+
* @returns {string}
|
|
692
|
+
*/
|
|
693
|
+
export function host_hpo_evaluate_worker_task_json(task_json, trusted_controller_manifests_json, data_envelope_json, request_json, js_invoke) {
|
|
694
|
+
let deferred6_0;
|
|
695
|
+
let deferred6_1;
|
|
696
|
+
try {
|
|
697
|
+
const ptr0 = passStringToWasm0(task_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
698
|
+
const len0 = WASM_VECTOR_LEN;
|
|
699
|
+
const ptr1 = passStringToWasm0(trusted_controller_manifests_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
700
|
+
const len1 = WASM_VECTOR_LEN;
|
|
701
|
+
const ptr2 = passStringToWasm0(data_envelope_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
702
|
+
const len2 = WASM_VECTOR_LEN;
|
|
703
|
+
const ptr3 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
704
|
+
const len3 = WASM_VECTOR_LEN;
|
|
705
|
+
const ret = wasm.host_hpo_evaluate_worker_task_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, js_invoke);
|
|
706
|
+
var ptr5 = ret[0];
|
|
707
|
+
var len5 = ret[1];
|
|
708
|
+
if (ret[3]) {
|
|
709
|
+
ptr5 = 0; len5 = 0;
|
|
710
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
711
|
+
}
|
|
712
|
+
deferred6_0 = ptr5;
|
|
713
|
+
deferred6_1 = len5;
|
|
714
|
+
return getStringFromWasm0(ptr5, len5);
|
|
715
|
+
} finally {
|
|
716
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Run one-worker host HPO with native fold scoring, pruning and durable
|
|
722
|
+
* checkpoint transitions. Both callbacks are synchronous: the controller is
|
|
723
|
+
* `(controllerId, taskJson, exactSeed) => nodeResultJson`; the optimizer is
|
|
724
|
+
* `(operation, payloadJson) => replyJson` (see README). The browser persists
|
|
725
|
+
* its own optimizer state and native checkpoint before returning from each
|
|
726
|
+
* `prepare_terminal`/`checkpoint` callback.
|
|
727
|
+
* @param {string} execution_plan_json
|
|
728
|
+
* @param {string} trusted_controller_manifests_json
|
|
729
|
+
* @param {string} data_envelope_json
|
|
730
|
+
* @param {string} request_json
|
|
731
|
+
* @param {string | null | undefined} checkpoint_json
|
|
732
|
+
* @param {Function} js_invoke
|
|
733
|
+
* @param {Function} js_optimizer
|
|
734
|
+
* @returns {string}
|
|
735
|
+
*/
|
|
736
|
+
export function host_hpo_search_json(execution_plan_json, trusted_controller_manifests_json, data_envelope_json, request_json, checkpoint_json, js_invoke, js_optimizer) {
|
|
737
|
+
let deferred7_0;
|
|
738
|
+
let deferred7_1;
|
|
739
|
+
try {
|
|
740
|
+
const ptr0 = passStringToWasm0(execution_plan_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
741
|
+
const len0 = WASM_VECTOR_LEN;
|
|
742
|
+
const ptr1 = passStringToWasm0(trusted_controller_manifests_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
743
|
+
const len1 = WASM_VECTOR_LEN;
|
|
744
|
+
const ptr2 = passStringToWasm0(data_envelope_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
745
|
+
const len2 = WASM_VECTOR_LEN;
|
|
746
|
+
const ptr3 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
747
|
+
const len3 = WASM_VECTOR_LEN;
|
|
748
|
+
var ptr4 = isLikeNone(checkpoint_json) ? 0 : passStringToWasm0(checkpoint_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
749
|
+
var len4 = WASM_VECTOR_LEN;
|
|
750
|
+
const ret = wasm.host_hpo_search_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, js_invoke, js_optimizer);
|
|
751
|
+
var ptr6 = ret[0];
|
|
752
|
+
var len6 = ret[1];
|
|
753
|
+
if (ret[3]) {
|
|
754
|
+
ptr6 = 0; len6 = 0;
|
|
755
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
756
|
+
}
|
|
757
|
+
deferred7_0 = ptr6;
|
|
758
|
+
deferred7_1 = len6;
|
|
759
|
+
return getStringFromWasm0(ptr6, len6);
|
|
760
|
+
} finally {
|
|
761
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Run a true browser worker window: dispatch every candidate before awaiting
|
|
767
|
+
* any Promise, then reconcile results with native core in trial order. The
|
|
768
|
+
* dispatcher has shape `(taskJson) => Promise<workerResultJson>`; each worker
|
|
769
|
+
* owns a separate WASM instance and invokes `host_hpo_evaluate_worker_task_json`.
|
|
770
|
+
* The existing synchronous `host_hpo_search_json` remains available.
|
|
771
|
+
* @param {string} execution_plan_json
|
|
772
|
+
* @param {string} trusted_controller_manifests_json
|
|
773
|
+
* @param {string} data_envelope_json
|
|
774
|
+
* @param {string} request_json
|
|
775
|
+
* @param {string | null | undefined} checkpoint_json
|
|
776
|
+
* @param {number} max_workers
|
|
777
|
+
* @param {Function} js_dispatch
|
|
778
|
+
* @param {Function} js_optimizer
|
|
779
|
+
* @returns {Promise<string>}
|
|
780
|
+
*/
|
|
781
|
+
export function host_hpo_search_parallel_json(execution_plan_json, trusted_controller_manifests_json, data_envelope_json, request_json, checkpoint_json, max_workers, js_dispatch, js_optimizer) {
|
|
782
|
+
const ptr0 = passStringToWasm0(execution_plan_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
783
|
+
const len0 = WASM_VECTOR_LEN;
|
|
784
|
+
const ptr1 = passStringToWasm0(trusted_controller_manifests_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
785
|
+
const len1 = WASM_VECTOR_LEN;
|
|
786
|
+
const ptr2 = passStringToWasm0(data_envelope_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
787
|
+
const len2 = WASM_VECTOR_LEN;
|
|
788
|
+
const ptr3 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
789
|
+
const len3 = WASM_VECTOR_LEN;
|
|
790
|
+
var ptr4 = isLikeNone(checkpoint_json) ? 0 : passStringToWasm0(checkpoint_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
791
|
+
var len4 = WASM_VECTOR_LEN;
|
|
792
|
+
const ret = wasm.host_hpo_search_parallel_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, max_workers, js_dispatch, js_optimizer);
|
|
793
|
+
return ret;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Attach a new V2 PREDICT cohort to the package's signed training envelope.
|
|
798
|
+
* @param {string} package_json
|
|
799
|
+
* @param {string} cohort_json
|
|
800
|
+
* @returns {string}
|
|
801
|
+
*/
|
|
802
|
+
export function initial_full_refit_predict_envelope_json(package_json, cohort_json) {
|
|
803
|
+
let deferred4_0;
|
|
804
|
+
let deferred4_1;
|
|
805
|
+
try {
|
|
806
|
+
const ptr0 = passStringToWasm0(package_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
807
|
+
const len0 = WASM_VECTOR_LEN;
|
|
808
|
+
const ptr1 = passStringToWasm0(cohort_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
809
|
+
const len1 = WASM_VECTOR_LEN;
|
|
810
|
+
const ret = wasm.initial_full_refit_predict_envelope_json(ptr0, len0, ptr1, len1);
|
|
811
|
+
var ptr3 = ret[0];
|
|
812
|
+
var len3 = ret[1];
|
|
813
|
+
if (ret[3]) {
|
|
814
|
+
ptr3 = 0; len3 = 0;
|
|
815
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
816
|
+
}
|
|
817
|
+
deferred4_0 = ptr3;
|
|
818
|
+
deferred4_1 = len3;
|
|
819
|
+
return getStringFromWasm0(ptr3, len3);
|
|
820
|
+
} finally {
|
|
821
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
|
|
572
825
|
/**
|
|
573
826
|
* Build a K-fold `FoldSet` from a `KFoldSpec` JSON + a JSON array of sample ids.
|
|
574
827
|
* dag-ml owns the split — the host stops building folds itself.
|
|
@@ -630,6 +883,80 @@ export function loss_execution_attestation_json(training_loss_role_json, phase)
|
|
|
630
883
|
}
|
|
631
884
|
}
|
|
632
885
|
|
|
886
|
+
/**
|
|
887
|
+
* Validate a browser-persisted prepared terminal and seal interrupted trials
|
|
888
|
+
* before resuming search. This is the same recovery contract as PyO3/C ABI.
|
|
889
|
+
* @param {string} checkpoint_json
|
|
890
|
+
* @param {string} prepared_json
|
|
891
|
+
* @param {string} interrupted_json
|
|
892
|
+
* @returns {string}
|
|
893
|
+
*/
|
|
894
|
+
export function recover_host_hpo_checkpoint_json(checkpoint_json, prepared_json, interrupted_json) {
|
|
895
|
+
let deferred5_0;
|
|
896
|
+
let deferred5_1;
|
|
897
|
+
try {
|
|
898
|
+
const ptr0 = passStringToWasm0(checkpoint_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
899
|
+
const len0 = WASM_VECTOR_LEN;
|
|
900
|
+
const ptr1 = passStringToWasm0(prepared_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
901
|
+
const len1 = WASM_VECTOR_LEN;
|
|
902
|
+
const ptr2 = passStringToWasm0(interrupted_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
903
|
+
const len2 = WASM_VECTOR_LEN;
|
|
904
|
+
const ret = wasm.recover_host_hpo_checkpoint_json(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
905
|
+
var ptr4 = ret[0];
|
|
906
|
+
var len4 = ret[1];
|
|
907
|
+
if (ret[3]) {
|
|
908
|
+
ptr4 = 0; len4 = 0;
|
|
909
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
910
|
+
}
|
|
911
|
+
deferred5_0 = ptr4;
|
|
912
|
+
deferred5_1 = len4;
|
|
913
|
+
return getStringFromWasm0(ptr4, len4);
|
|
914
|
+
} finally {
|
|
915
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Replay selected package outputs on a fresh V2 cohort without training.
|
|
921
|
+
* Raw native payloads are hydrated from the package; host sidecars use exact
|
|
922
|
+
* caller-owned artifact handles registered for this invocation only.
|
|
923
|
+
* @param {string} package_json
|
|
924
|
+
* @param {string} envelope_json
|
|
925
|
+
* @param {string} output_ids_json
|
|
926
|
+
* @param {string} artifact_handles_json
|
|
927
|
+
* @param {string} run_id
|
|
928
|
+
* @param {Function} js_invoke
|
|
929
|
+
* @returns {string}
|
|
930
|
+
*/
|
|
931
|
+
export function replay_initial_full_refit_json(package_json, envelope_json, output_ids_json, artifact_handles_json, run_id, js_invoke) {
|
|
932
|
+
let deferred7_0;
|
|
933
|
+
let deferred7_1;
|
|
934
|
+
try {
|
|
935
|
+
const ptr0 = passStringToWasm0(package_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
936
|
+
const len0 = WASM_VECTOR_LEN;
|
|
937
|
+
const ptr1 = passStringToWasm0(envelope_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
938
|
+
const len1 = WASM_VECTOR_LEN;
|
|
939
|
+
const ptr2 = passStringToWasm0(output_ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
940
|
+
const len2 = WASM_VECTOR_LEN;
|
|
941
|
+
const ptr3 = passStringToWasm0(artifact_handles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
942
|
+
const len3 = WASM_VECTOR_LEN;
|
|
943
|
+
const ptr4 = passStringToWasm0(run_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
944
|
+
const len4 = WASM_VECTOR_LEN;
|
|
945
|
+
const ret = wasm.replay_initial_full_refit_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, js_invoke);
|
|
946
|
+
var ptr6 = ret[0];
|
|
947
|
+
var len6 = ret[1];
|
|
948
|
+
if (ret[3]) {
|
|
949
|
+
ptr6 = 0; len6 = 0;
|
|
950
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
951
|
+
}
|
|
952
|
+
deferred7_0 = ptr6;
|
|
953
|
+
deferred7_1 = len6;
|
|
954
|
+
return getStringFromWasm0(ptr6, len6);
|
|
955
|
+
} finally {
|
|
956
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
|
|
633
960
|
/**
|
|
634
961
|
* Rank candidate variants and return the winner — the SELECT phase for in-browser
|
|
635
962
|
* generators/finetune. Selection stays in dag-ml (deterministic argmin/argmax +
|
|
@@ -666,6 +993,113 @@ export function select_candidates_json(policy_json, candidates_json, groups_json
|
|
|
666
993
|
}
|
|
667
994
|
}
|
|
668
995
|
|
|
996
|
+
/**
|
|
997
|
+
* Resolve one explicitly named output of a signed portable package.
|
|
998
|
+
* @param {string} package_json
|
|
999
|
+
* @param {string} binding_id
|
|
1000
|
+
* @returns {string}
|
|
1001
|
+
*/
|
|
1002
|
+
export function select_portable_output_json(package_json, binding_id) {
|
|
1003
|
+
let deferred4_0;
|
|
1004
|
+
let deferred4_1;
|
|
1005
|
+
try {
|
|
1006
|
+
const ptr0 = passStringToWasm0(package_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1007
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1008
|
+
const ptr1 = passStringToWasm0(binding_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1009
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1010
|
+
const ret = wasm.select_portable_output_json(ptr0, len0, ptr1, len1);
|
|
1011
|
+
var ptr3 = ret[0];
|
|
1012
|
+
var len3 = ret[1];
|
|
1013
|
+
if (ret[3]) {
|
|
1014
|
+
ptr3 = 0; len3 = 0;
|
|
1015
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1016
|
+
}
|
|
1017
|
+
deferred4_0 = ptr3;
|
|
1018
|
+
deferred4_1 = len3;
|
|
1019
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1020
|
+
} finally {
|
|
1021
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Select a CV fold for stacking test predictions from validation scores.
|
|
1027
|
+
* @param {string} request_json
|
|
1028
|
+
* @returns {string}
|
|
1029
|
+
*/
|
|
1030
|
+
export function select_stacking_fold_json(request_json) {
|
|
1031
|
+
let deferred3_0;
|
|
1032
|
+
let deferred3_1;
|
|
1033
|
+
try {
|
|
1034
|
+
const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1035
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1036
|
+
const ret = wasm.select_stacking_fold_json(ptr0, len0);
|
|
1037
|
+
var ptr2 = ret[0];
|
|
1038
|
+
var len2 = ret[1];
|
|
1039
|
+
if (ret[3]) {
|
|
1040
|
+
ptr2 = 0; len2 = 0;
|
|
1041
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1042
|
+
}
|
|
1043
|
+
deferred3_0 = ptr2;
|
|
1044
|
+
deferred3_1 = len2;
|
|
1045
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1046
|
+
} finally {
|
|
1047
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* Select stacking producers from validation scores with the native policy.
|
|
1053
|
+
* @param {string} request_json
|
|
1054
|
+
* @returns {string}
|
|
1055
|
+
*/
|
|
1056
|
+
export function select_stacking_producers_json(request_json) {
|
|
1057
|
+
let deferred3_0;
|
|
1058
|
+
let deferred3_1;
|
|
1059
|
+
try {
|
|
1060
|
+
const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1061
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1062
|
+
const ret = wasm.select_stacking_producers_json(ptr0, len0);
|
|
1063
|
+
var ptr2 = ret[0];
|
|
1064
|
+
var len2 = ret[1];
|
|
1065
|
+
if (ret[3]) {
|
|
1066
|
+
ptr2 = 0; len2 = 0;
|
|
1067
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1068
|
+
}
|
|
1069
|
+
deferred3_0 = ptr2;
|
|
1070
|
+
deferred3_1 = len2;
|
|
1071
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1072
|
+
} finally {
|
|
1073
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* Objective-aware normalized CV-fold weights for stacking test predictions.
|
|
1079
|
+
* @param {string} request_json
|
|
1080
|
+
* @returns {string}
|
|
1081
|
+
*/
|
|
1082
|
+
export function stacking_fold_weights_json(request_json) {
|
|
1083
|
+
let deferred3_0;
|
|
1084
|
+
let deferred3_1;
|
|
1085
|
+
try {
|
|
1086
|
+
const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1087
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1088
|
+
const ret = wasm.stacking_fold_weights_json(ptr0, len0);
|
|
1089
|
+
var ptr2 = ret[0];
|
|
1090
|
+
var len2 = ret[1];
|
|
1091
|
+
if (ret[3]) {
|
|
1092
|
+
ptr2 = 0; len2 = 0;
|
|
1093
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1094
|
+
}
|
|
1095
|
+
deferred3_0 = ptr2;
|
|
1096
|
+
deferred3_1 = len2;
|
|
1097
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1098
|
+
} finally {
|
|
1099
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
|
|
669
1103
|
/**
|
|
670
1104
|
* Build a stratified K-fold `FoldSet`: same OOF-once guarantee as K-fold, but
|
|
671
1105
|
* balanced by a per-sample class label. `strata_json` is a JSON object mapping
|
|
@@ -787,6 +1221,19 @@ export function validate_graph_json(json) {
|
|
|
787
1221
|
}
|
|
788
1222
|
}
|
|
789
1223
|
|
|
1224
|
+
/**
|
|
1225
|
+
* Validate a signed no-splitter REFIT package before any host operator callback.
|
|
1226
|
+
* @param {string} package_json
|
|
1227
|
+
*/
|
|
1228
|
+
export function validate_initial_full_refit_package_json(package_json) {
|
|
1229
|
+
const ptr0 = passStringToWasm0(package_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1230
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1231
|
+
const ret = wasm.validate_initial_full_refit_package_json(ptr0, len0);
|
|
1232
|
+
if (ret[1]) {
|
|
1233
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
|
|
790
1237
|
/**
|
|
791
1238
|
* @param {string} json
|
|
792
1239
|
*/
|
|
@@ -801,20 +1248,28 @@ export function validate_pipeline_dsl_json(json) {
|
|
|
801
1248
|
function __wbg_get_imports() {
|
|
802
1249
|
const import0 = {
|
|
803
1250
|
__proto__: null,
|
|
804
|
-
|
|
1251
|
+
__wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
|
|
805
1252
|
const ret = debugString(arg1);
|
|
806
1253
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
807
1254
|
const len1 = WASM_VECTOR_LEN;
|
|
808
1255
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
809
1256
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
810
1257
|
},
|
|
811
|
-
|
|
1258
|
+
__wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
|
|
1259
|
+
const ret = typeof(arg0) === 'function';
|
|
1260
|
+
return ret;
|
|
1261
|
+
},
|
|
1262
|
+
__wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
|
|
1263
|
+
const ret = arg0 === undefined;
|
|
1264
|
+
return ret;
|
|
1265
|
+
},
|
|
1266
|
+
__wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
|
|
812
1267
|
const obj = arg1;
|
|
813
1268
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
814
1269
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
815
1270
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
816
1271
|
},
|
|
817
|
-
|
|
1272
|
+
__wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
|
|
818
1273
|
const obj = arg1;
|
|
819
1274
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
820
1275
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -822,14 +1277,83 @@ function __wbg_get_imports() {
|
|
|
822
1277
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
823
1278
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
824
1279
|
},
|
|
825
|
-
|
|
1280
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
|
|
826
1281
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
827
1282
|
},
|
|
828
|
-
|
|
1283
|
+
__wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
|
|
1284
|
+
arg0._wbg_cb_unref();
|
|
1285
|
+
},
|
|
1286
|
+
__wbg_call_6bcf8d3e20937e46: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1287
|
+
const ret = arg0.call(arg1, arg2);
|
|
1288
|
+
return ret;
|
|
1289
|
+
}, arguments); },
|
|
1290
|
+
__wbg_call_7bbd9cceba9949ad: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1291
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
1292
|
+
return ret;
|
|
1293
|
+
}, arguments); },
|
|
1294
|
+
__wbg_call_c1ad1cb1b78e8130: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
829
1295
|
const ret = arg0.call(arg1, arg2, arg3, arg4);
|
|
830
1296
|
return ret;
|
|
831
1297
|
}, arguments); },
|
|
832
|
-
|
|
1298
|
+
__wbg_new_typed_6f8b0d724fe26c07: function(arg0, arg1) {
|
|
1299
|
+
try {
|
|
1300
|
+
var state0 = {a: arg0, b: arg1};
|
|
1301
|
+
var cb0 = (arg0, arg1) => {
|
|
1302
|
+
const a = state0.a;
|
|
1303
|
+
state0.a = 0;
|
|
1304
|
+
try {
|
|
1305
|
+
return wasm_bindgen_dab8739f2315efff___convert__closures_____invoke___js_sys_dd5193d6d4000a3a___Function_fn_wasm_bindgen_dab8739f2315efff___JsValue_____wasm_bindgen_dab8739f2315efff___sys__Undefined___js_sys_dd5193d6d4000a3a___Function_fn_wasm_bindgen_dab8739f2315efff___JsValue_____wasm_bindgen_dab8739f2315efff___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
1306
|
+
} finally {
|
|
1307
|
+
state0.a = a;
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
const ret = new Promise(cb0);
|
|
1311
|
+
return ret;
|
|
1312
|
+
} finally {
|
|
1313
|
+
state0.a = 0;
|
|
1314
|
+
}
|
|
1315
|
+
},
|
|
1316
|
+
__wbg_queueMicrotask_85c90f6987555d65: function(arg0) {
|
|
1317
|
+
const ret = arg0.queueMicrotask;
|
|
1318
|
+
return ret;
|
|
1319
|
+
},
|
|
1320
|
+
__wbg_queueMicrotask_f6a1fa10b81d1fc0: function(arg0) {
|
|
1321
|
+
queueMicrotask(arg0);
|
|
1322
|
+
},
|
|
1323
|
+
__wbg_resolve_35ec7e0c6af4c82c: function(arg0) {
|
|
1324
|
+
const ret = Promise.resolve(arg0);
|
|
1325
|
+
return ret;
|
|
1326
|
+
},
|
|
1327
|
+
__wbg_static_accessor_GLOBAL_8eb4cd83130a11a0: function() {
|
|
1328
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1329
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1330
|
+
},
|
|
1331
|
+
__wbg_static_accessor_GLOBAL_THIS_1e7044f654e934db: function() {
|
|
1332
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1333
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1334
|
+
},
|
|
1335
|
+
__wbg_static_accessor_SELF_d8b50611246a6d92: function() {
|
|
1336
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1337
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1338
|
+
},
|
|
1339
|
+
__wbg_static_accessor_WINDOW_fd0bc376bf0f8b42: function() {
|
|
1340
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1341
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1342
|
+
},
|
|
1343
|
+
__wbg_then_7a850dae4493f353: function(arg0, arg1, arg2) {
|
|
1344
|
+
const ret = arg0.then(arg1, arg2);
|
|
1345
|
+
return ret;
|
|
1346
|
+
},
|
|
1347
|
+
__wbg_then_b830475380919203: function(arg0, arg1) {
|
|
1348
|
+
const ret = arg0.then(arg1);
|
|
1349
|
+
return ret;
|
|
1350
|
+
},
|
|
1351
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
1352
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 308, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1353
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_dab8739f2315efff___convert__closures_____invoke___wasm_bindgen_dab8739f2315efff___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_dab8739f2315efff___JsError___true_);
|
|
1354
|
+
return ret;
|
|
1355
|
+
},
|
|
1356
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
833
1357
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
834
1358
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
835
1359
|
return ret;
|
|
@@ -850,6 +1374,17 @@ function __wbg_get_imports() {
|
|
|
850
1374
|
};
|
|
851
1375
|
}
|
|
852
1376
|
|
|
1377
|
+
function wasm_bindgen_dab8739f2315efff___convert__closures_____invoke___wasm_bindgen_dab8739f2315efff___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_dab8739f2315efff___JsError___true_(arg0, arg1, arg2) {
|
|
1378
|
+
const ret = wasm.wasm_bindgen_dab8739f2315efff___convert__closures_____invoke___wasm_bindgen_dab8739f2315efff___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_dab8739f2315efff___JsError___true_(arg0, arg1, arg2);
|
|
1379
|
+
if (ret[1]) {
|
|
1380
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
function wasm_bindgen_dab8739f2315efff___convert__closures_____invoke___js_sys_dd5193d6d4000a3a___Function_fn_wasm_bindgen_dab8739f2315efff___JsValue_____wasm_bindgen_dab8739f2315efff___sys__Undefined___js_sys_dd5193d6d4000a3a___Function_fn_wasm_bindgen_dab8739f2315efff___JsValue_____wasm_bindgen_dab8739f2315efff___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
1385
|
+
wasm.wasm_bindgen_dab8739f2315efff___convert__closures_____invoke___js_sys_dd5193d6d4000a3a___Function_fn_wasm_bindgen_dab8739f2315efff___JsValue_____wasm_bindgen_dab8739f2315efff___sys__Undefined___js_sys_dd5193d6d4000a3a___Function_fn_wasm_bindgen_dab8739f2315efff___JsValue_____wasm_bindgen_dab8739f2315efff___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
1386
|
+
}
|
|
1387
|
+
|
|
853
1388
|
const LocalImplementationRegistryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
854
1389
|
? { register: () => {}, unregister: () => {} }
|
|
855
1390
|
: new FinalizationRegistry(ptr => wasm.__wbg_localimplementationregistry_free(ptr, 1));
|
|
@@ -863,6 +1398,10 @@ function addToExternrefTable0(obj) {
|
|
|
863
1398
|
return idx;
|
|
864
1399
|
}
|
|
865
1400
|
|
|
1401
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
1402
|
+
? { register: () => {}, unregister: () => {} }
|
|
1403
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
1404
|
+
|
|
866
1405
|
function debugString(val) {
|
|
867
1406
|
// primitive types
|
|
868
1407
|
const type = typeof val;
|
|
@@ -961,6 +1500,34 @@ function isLikeNone(x) {
|
|
|
961
1500
|
return x === undefined || x === null;
|
|
962
1501
|
}
|
|
963
1502
|
|
|
1503
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
1504
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
1505
|
+
const real = (...args) => {
|
|
1506
|
+
|
|
1507
|
+
// First up with a closure we increment the internal reference
|
|
1508
|
+
// count. This ensures that the Rust closure environment won't
|
|
1509
|
+
// be deallocated while we're invoking it.
|
|
1510
|
+
state.cnt++;
|
|
1511
|
+
const a = state.a;
|
|
1512
|
+
state.a = 0;
|
|
1513
|
+
try {
|
|
1514
|
+
return f(a, state.b, ...args);
|
|
1515
|
+
} finally {
|
|
1516
|
+
state.a = a;
|
|
1517
|
+
real._wbg_cb_unref();
|
|
1518
|
+
}
|
|
1519
|
+
};
|
|
1520
|
+
real._wbg_cb_unref = () => {
|
|
1521
|
+
if (--state.cnt === 0) {
|
|
1522
|
+
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
1523
|
+
state.a = 0;
|
|
1524
|
+
CLOSURE_DTORS.unregister(state);
|
|
1525
|
+
}
|
|
1526
|
+
};
|
|
1527
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
1528
|
+
return real;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
964
1531
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
965
1532
|
if (realloc === undefined) {
|
|
966
1533
|
const buf = cachedTextEncoder.encode(arg);
|
package/dag_ml_wasm_bg.wasm
CHANGED
|
Binary file
|