@onimaxxing/worldgen 0.21.2 → 0.21.3
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 +26 -0
- package/index.d.ts +110 -0
- package/index.js +8 -0
- package/package.json +1 -1
- package/parallel/oni_wasm.d.ts +18 -482
- package/parallel/oni_wasm.js +30 -1141
- package/parallel/oni_wasm_bg.wasm +0 -0
- package/parallel/oni_wasm_bg.wasm.d.ts +2 -46
- package/serial/oni_wasm.d.ts +20 -0
- package/serial/oni_wasm.js +37 -0
- package/serial/oni_wasm_bg.wasm +0 -0
- package/serial/oni_wasm_bg.wasm.d.ts +1 -0
package/parallel/oni_wasm.js
CHANGED
|
@@ -2,867 +2,10 @@
|
|
|
2
2
|
import { startWorkers } from './snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* wasm-vs-native divergence. Targets one sim cell index, one tick.
|
|
7
|
-
* @param {number} target_sim_idx
|
|
8
|
-
* @param {number} target_tick
|
|
9
|
-
*/
|
|
10
|
-
export function arm_thermal_pair_trace(target_sim_idx, target_tick) {
|
|
11
|
-
wasm.arm_thermal_pair_trace(target_sim_idx, target_tick);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Bench harness — time just the Rust `generate_with_settings` call without
|
|
16
|
-
* the JSON-serialization overhead every production entry point pays.
|
|
17
|
-
*
|
|
18
|
-
* Gated behind `debug` so release WASM doesn't ship with it. Returns a
|
|
19
|
-
* small JSON blob containing per-phase wall-clock in ms so the bench
|
|
20
|
-
* script can separate cluster-gen time from
|
|
21
|
-
* `build_result` + `serde_json::to_string` cost.
|
|
22
|
-
* @param {number} seed
|
|
23
|
-
* @param {string} cluster_id
|
|
24
|
-
* @returns {string}
|
|
25
|
-
*/
|
|
26
|
-
export function bench_cluster_phases(seed, cluster_id) {
|
|
27
|
-
let deferred2_0;
|
|
28
|
-
let deferred2_1;
|
|
29
|
-
try {
|
|
30
|
-
const ptr0 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
31
|
-
const len0 = WASM_VECTOR_LEN;
|
|
32
|
-
const ret = wasm.bench_cluster_phases(seed, ptr0, len0);
|
|
33
|
-
deferred2_0 = ret[0];
|
|
34
|
-
deferred2_1 = ret[1];
|
|
35
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
36
|
-
} finally {
|
|
37
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Bench harness — returns the accumulated phase totals as JSON
|
|
43
|
-
* (`{"phase": {"ms": number, "calls": number}, ...}`) and clears the
|
|
44
|
-
* accumulator. Gated behind `debug`.
|
|
45
|
-
* @returns {string}
|
|
46
|
-
*/
|
|
47
|
-
export function bench_profile_dump() {
|
|
48
|
-
let deferred1_0;
|
|
49
|
-
let deferred1_1;
|
|
50
|
-
try {
|
|
51
|
-
const ret = wasm.bench_profile_dump();
|
|
52
|
-
deferred1_0 = ret[0];
|
|
53
|
-
deferred1_1 = ret[1];
|
|
54
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
55
|
-
} finally {
|
|
56
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Bench harness — enable the fine-grained `oni_worldgen::profile`
|
|
62
|
-
* phase accumulator. Pair with `bench_profile_dump()` after running the
|
|
63
|
-
* measured work. Gated behind `debug`.
|
|
64
|
-
*/
|
|
65
|
-
export function bench_profile_enable() {
|
|
66
|
-
wasm.bench_profile_enable();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Drop the cached cluster. Snapshot edits persist.
|
|
71
|
-
*/
|
|
72
|
-
export function clear_cluster_cache() {
|
|
73
|
-
wasm.clear_cluster_cache();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Compute a `ClusterDigest` from a coordinate, returning JSON.
|
|
78
|
-
*
|
|
79
|
-
* This is the canonical Rust path for digest regeneration — calling
|
|
80
|
-
* this function from JS via wasm-pack ensures the digest comes from
|
|
81
|
-
* the SAME math the production WASM build uses, not from a separate
|
|
82
|
-
* native binary that might have different precision.
|
|
83
|
-
*
|
|
84
|
-
* `mode` must be either "templates" or "notemplates".
|
|
85
|
-
*
|
|
86
|
-
* On parse error returns a JSON object with an `error` field.
|
|
87
|
-
* Variant of [`compute_digest_from_coordinate`] that takes the
|
|
88
|
-
* cluster id directly instead of going through `parse_coordinate`.
|
|
89
|
-
* Required when the coordinate's prefix maps to multiple clusters —
|
|
90
|
-
* e.g. when a mod registers several clusters with the same
|
|
91
|
-
* `coordinatePrefix` (Cluster Generation Manager has three clusters
|
|
92
|
-
* at `CGSM-C`). The C# side disambiguates via `SNAPSHOT_CLUSTER`
|
|
93
|
-
* for the same reason; this is the symmetric Rust knob.
|
|
94
|
-
*
|
|
95
|
-
* `coordinate` is still used for output schema fields (`coordinate`,
|
|
96
|
-
* story/mixing extraction via the matching CS-side parser), but the
|
|
97
|
-
* cluster lookup is performed against `cluster_id` directly. For
|
|
98
|
-
* vanilla unambiguous prefixes the two functions produce identical
|
|
99
|
-
* digests when `cluster_id` matches the prefix's mapped cluster.
|
|
100
|
-
* @param {string} coordinate
|
|
101
|
-
* @param {string} cluster_id
|
|
102
|
-
* @param {number} seed
|
|
103
|
-
* @param {string} mode
|
|
104
|
-
* @returns {string}
|
|
105
|
-
*/
|
|
106
|
-
export function compute_digest_for_cluster(coordinate, cluster_id, seed, mode) {
|
|
107
|
-
let deferred4_0;
|
|
108
|
-
let deferred4_1;
|
|
109
|
-
try {
|
|
110
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
111
|
-
const len0 = WASM_VECTOR_LEN;
|
|
112
|
-
const ptr1 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
113
|
-
const len1 = WASM_VECTOR_LEN;
|
|
114
|
-
const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
115
|
-
const len2 = WASM_VECTOR_LEN;
|
|
116
|
-
const ret = wasm.compute_digest_for_cluster(ptr0, len0, ptr1, len1, seed, ptr2, len2);
|
|
117
|
-
deferred4_0 = ret[0];
|
|
118
|
-
deferred4_1 = ret[1];
|
|
119
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
120
|
-
} finally {
|
|
121
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* @param {string} coordinate
|
|
127
|
-
* @param {string} mode
|
|
128
|
-
* @returns {string}
|
|
129
|
-
*/
|
|
130
|
-
export function compute_digest_from_coordinate(coordinate, mode) {
|
|
131
|
-
let deferred3_0;
|
|
132
|
-
let deferred3_1;
|
|
133
|
-
try {
|
|
134
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
135
|
-
const len0 = WASM_VECTOR_LEN;
|
|
136
|
-
const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
137
|
-
const len1 = WASM_VECTOR_LEN;
|
|
138
|
-
const ret = wasm.compute_digest_from_coordinate(ptr0, len0, ptr1, len1);
|
|
139
|
-
deferred3_0 = ret[0];
|
|
140
|
-
deferred3_1 = ret[1];
|
|
141
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
142
|
-
} finally {
|
|
143
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Apply a structured mutations payload to the generated cluster
|
|
149
|
-
* before computing the digest. Used by mod extensions to fold
|
|
150
|
-
* post-snapshot overrides (CGM geyser swap, SO_POI pins, vanilla-
|
|
151
|
-
* starmap replacement) into the digest without modifying the
|
|
152
|
-
* worldgen pipeline.
|
|
153
|
-
*
|
|
154
|
-
* The `overrides_json` schema is generic — not CGM-named — so any
|
|
155
|
-
* mod can use it:
|
|
156
|
-
* ```json
|
|
157
|
-
* {
|
|
158
|
-
* "entityReplacements": [
|
|
159
|
-
* { "worldIdx": 0, "cell": 100, "newTag": "GeyserGeneric_hot_water",
|
|
160
|
-
* "newResolvedTemplate": "hot_water" }
|
|
161
|
-
* ],
|
|
162
|
-
* "worldLocationOverrides": [
|
|
163
|
-
* { "worldIdx": 2, "q": 3, "r": -2 }
|
|
164
|
-
* ],
|
|
165
|
-
* "poiUpserts": [
|
|
166
|
-
* { "poiType": "HarvestableSpacePOI_X", "q": 5, "r": 5 }
|
|
167
|
-
* ],
|
|
168
|
-
* "vanillaDestinationsReplace": [
|
|
169
|
-
* { "destType": "CarbonaceousAsteroid", "distance": 0 }
|
|
170
|
-
* ]
|
|
171
|
-
* }
|
|
172
|
-
* ```
|
|
173
|
-
*
|
|
174
|
-
* Pass `""` or `"{}"` for `overrides_json` to skip mutations entirely
|
|
175
|
-
* (equivalent to [`compute_digest_for_cluster`]).
|
|
176
|
-
* @param {string} coordinate
|
|
177
|
-
* @param {string} cluster_id
|
|
178
|
-
* @param {number} seed
|
|
179
|
-
* @param {string} mode
|
|
180
|
-
* @param {string} overrides_json
|
|
181
|
-
* @returns {string}
|
|
182
|
-
*/
|
|
183
|
-
export function compute_digest_with_overrides(coordinate, cluster_id, seed, mode, overrides_json) {
|
|
184
|
-
let deferred5_0;
|
|
185
|
-
let deferred5_1;
|
|
186
|
-
try {
|
|
187
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
188
|
-
const len0 = WASM_VECTOR_LEN;
|
|
189
|
-
const ptr1 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
190
|
-
const len1 = WASM_VECTOR_LEN;
|
|
191
|
-
const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
192
|
-
const len2 = WASM_VECTOR_LEN;
|
|
193
|
-
const ptr3 = passStringToWasm0(overrides_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
194
|
-
const len3 = WASM_VECTOR_LEN;
|
|
195
|
-
const ret = wasm.compute_digest_with_overrides(ptr0, len0, ptr1, len1, seed, ptr2, len2, ptr3, len3);
|
|
196
|
-
deferred5_0 = ret[0];
|
|
197
|
-
deferred5_1 = ret[1];
|
|
198
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
199
|
-
} finally {
|
|
200
|
-
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Geyser stats compute, exposed for the mod-extensions transformer.
|
|
206
|
-
* After a CGM blacklist re-roll substitutes a generic geyser
|
|
207
|
-
* template, this function re-derives the 5 MNI-projected ints
|
|
208
|
-
* (emit/avg/idle/erupt/dormant/active) the digest hashes.
|
|
209
|
-
*
|
|
210
|
-
* `template` is a bare geyser id (no `GeyserGeneric_` prefix) —
|
|
211
|
-
* e.g. `"hot_water"`, `"small_volcano"`, `"oil_drip"`. Returns
|
|
212
|
-
* `{"error": "..."}` for unknown templates.
|
|
213
|
-
*
|
|
214
|
-
* `seed` is the per-cell `globalWorldSeed + cluster_x + cluster_y` —
|
|
215
|
-
* same as the existing geyser RNG path.
|
|
216
|
-
*
|
|
217
|
-
* Output JSON schema mirrors the `GeyserStats` interface in the
|
|
218
|
-
* `mod-extensions` transformer module:
|
|
219
|
-
* ```json
|
|
220
|
-
* {
|
|
221
|
-
* "rate": 4310,
|
|
222
|
-
* "idle": 112,
|
|
223
|
-
* "erupt": 500,
|
|
224
|
-
* "dorm": 71,
|
|
225
|
-
* "active": 125
|
|
226
|
-
* }
|
|
227
|
-
* ```
|
|
228
|
-
* @param {number} seed
|
|
229
|
-
* @param {string} template
|
|
230
|
-
* @returns {string}
|
|
231
|
-
*/
|
|
232
|
-
export function compute_geyser_stats(seed, template) {
|
|
233
|
-
let deferred2_0;
|
|
234
|
-
let deferred2_1;
|
|
235
|
-
try {
|
|
236
|
-
const ptr0 = passStringToWasm0(template, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
237
|
-
const len0 = WASM_VECTOR_LEN;
|
|
238
|
-
const ret = wasm.compute_geyser_stats(seed, ptr0, len0);
|
|
239
|
-
deferred2_0 = ret[0];
|
|
240
|
-
deferred2_1 = ret[1];
|
|
241
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
242
|
-
} finally {
|
|
243
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* are sampled. Used for vibe-checking U59 backwall plumbing.
|
|
249
|
-
* @param {string} coordinate
|
|
250
|
-
* @param {number} world_idx
|
|
251
|
-
* @returns {string}
|
|
252
|
-
*/
|
|
253
|
-
export function debug_dump_backwall_distribution(coordinate, world_idx) {
|
|
254
|
-
let deferred2_0;
|
|
255
|
-
let deferred2_1;
|
|
256
|
-
try {
|
|
257
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
258
|
-
const len0 = WASM_VECTOR_LEN;
|
|
259
|
-
const ret = wasm.debug_dump_backwall_distribution(ptr0, len0, world_idx);
|
|
260
|
-
deferred2_0 = ret[0];
|
|
261
|
-
deferred2_1 = ret[1];
|
|
262
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
263
|
-
} finally {
|
|
264
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Probe the cluster-level (overworld) PointGenerator seed state for a
|
|
270
|
-
* coordinate. Returns the values that drive the very first PD pass in
|
|
271
|
-
* `WorldLayout.GenerateOverworld` so we can diff them against the C#
|
|
272
|
-
* snapshot's equivalent fields to localize early OW-site divergence.
|
|
273
|
-
* @param {string} coordinate
|
|
274
|
-
* @returns {string}
|
|
275
|
-
*/
|
|
276
|
-
export function debug_dump_cluster_pd_seed_state(coordinate) {
|
|
277
|
-
let deferred2_0;
|
|
278
|
-
let deferred2_1;
|
|
279
|
-
try {
|
|
280
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
281
|
-
const len0 = WASM_VECTOR_LEN;
|
|
282
|
-
const ret = wasm.debug_dump_cluster_pd_seed_state(ptr0, len0);
|
|
283
|
-
deferred2_0 = ret[0];
|
|
284
|
-
deferred2_1 = ret[1];
|
|
285
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
286
|
-
} finally {
|
|
287
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Probe per-channel noise hashes for one coordinate. Output:
|
|
293
|
-
* `{"base":"<sha>","override":"...","density":"...","heat":"..."}`.
|
|
294
|
-
* Used to find which noise channel diverges from CS for AQU-A.
|
|
295
|
-
* @param {string} coordinate
|
|
296
|
-
* @returns {string}
|
|
297
|
-
*/
|
|
298
|
-
export function debug_dump_noise_channel_hashes(coordinate) {
|
|
299
|
-
let deferred2_0;
|
|
300
|
-
let deferred2_1;
|
|
301
|
-
try {
|
|
302
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
303
|
-
const len0 = WASM_VECTOR_LEN;
|
|
304
|
-
const ret = wasm.debug_dump_noise_channel_hashes(ptr0, len0);
|
|
305
|
-
deferred2_0 = ret[0];
|
|
306
|
-
deferred2_1 = ret[1];
|
|
307
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
308
|
-
} finally {
|
|
309
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Per-TC backwall lookup tag inspector. For each spawn_backwall TC,
|
|
315
|
-
* dumps: node_type, tags, biome_tag found, derived band name, and
|
|
316
|
-
* whether the lookup resolves in base or DLC-scoped form.
|
|
317
|
-
* Bisect tool for "Reef/Abyss backwall stamps never fire" findings.
|
|
318
|
-
* @param {string} coordinate
|
|
319
|
-
* @param {number} world_idx
|
|
320
|
-
* @returns {string}
|
|
321
|
-
*/
|
|
322
|
-
export function debug_dump_noise_channels(coordinate, world_idx) {
|
|
323
|
-
let deferred2_0;
|
|
324
|
-
let deferred2_1;
|
|
325
|
-
try {
|
|
326
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
327
|
-
const len0 = WASM_VECTOR_LEN;
|
|
328
|
-
const ret = wasm.debug_dump_noise_channels(ptr0, len0, world_idx);
|
|
329
|
-
deferred2_0 = ret[0];
|
|
330
|
-
deferred2_1 = ret[1];
|
|
331
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
332
|
-
} finally {
|
|
333
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Dump `placed_templates` (template name + cluster-space anchor cell)
|
|
339
|
-
* per world for one coordinate. Returns
|
|
340
|
-
* `{"worlds":[{"name":..,"placed":[[name,x,y],...]},...]}`.
|
|
341
|
-
* @param {string} coordinate
|
|
342
|
-
* @returns {string}
|
|
343
|
-
*/
|
|
344
|
-
export function debug_dump_placed_templates(coordinate) {
|
|
345
|
-
let deferred2_0;
|
|
346
|
-
let deferred2_1;
|
|
347
|
-
try {
|
|
348
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
349
|
-
const len0 = WASM_VECTOR_LEN;
|
|
350
|
-
const ret = wasm.debug_dump_placed_templates(ptr0, len0);
|
|
351
|
-
deferred2_0 = ret[0];
|
|
352
|
-
deferred2_1 = ret[1];
|
|
353
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
354
|
-
} finally {
|
|
355
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* @param {string} coordinate
|
|
361
|
-
* @param {number} world_idx
|
|
362
|
-
* @returns {string}
|
|
363
|
-
*/
|
|
364
|
-
export function debug_dump_tc_backwall_lookup(coordinate, world_idx) {
|
|
365
|
-
let deferred2_0;
|
|
366
|
-
let deferred2_1;
|
|
367
|
-
try {
|
|
368
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
369
|
-
const len0 = WASM_VECTOR_LEN;
|
|
370
|
-
const ret = wasm.debug_dump_tc_backwall_lookup(ptr0, len0, world_idx);
|
|
371
|
-
deferred2_0 = ret[0];
|
|
372
|
-
deferred2_1 = ret[1];
|
|
373
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
374
|
-
} finally {
|
|
375
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* Dump the U59 backwall layer for one world of a coordinate.
|
|
381
|
-
*
|
|
382
|
-
* Returns JSON:
|
|
383
|
-
* ```json
|
|
384
|
-
* {
|
|
385
|
-
* "world_name": "...", "width": w, "height": h,
|
|
386
|
-
* "spawn_backwall_tc_count": N,
|
|
387
|
-
* "total_tc_count": M,
|
|
388
|
-
* "backwall_histogram": { "Vacuum": k, "Coquina": k, ... },
|
|
389
|
-
* "samples_by_tc": [
|
|
390
|
-
* {"tc_idx": i, "node_type": "...", "biome_tag": "...",
|
|
391
|
-
* "all_cells_count": n, "spawn_backwall": true|false,
|
|
392
|
-
* "sample_cells": [{"cell": idx, "element": "...", "mass": f, "temp": f}, ...]}
|
|
393
|
-
* ]
|
|
394
|
-
* }
|
|
395
|
-
* ```
|
|
396
|
-
* Sampling: up to `max_tc_samples` TCs whose `spawn_backwall=true` are
|
|
397
|
-
* shown; for each, up to 5 random cells (deterministic seed = tc_idx)
|
|
398
|
-
* Dump raw backwall_noise samples + per-cell backwall element
|
|
399
|
-
* for selected TCs. Filters cells to `available_terrain_points`
|
|
400
|
-
* (the actually-stamped set), so reports the TRUE noise / element
|
|
401
|
-
* distribution rather than the broader polygon containment set
|
|
402
|
-
* that the prior vibe check used.
|
|
403
|
-
* @param {string} coordinate
|
|
404
|
-
* @param {number} world_idx
|
|
405
|
-
* @param {string} target_biome
|
|
406
|
-
* @returns {string}
|
|
407
|
-
*/
|
|
408
|
-
export function debug_dump_tc_backwall_noise(coordinate, world_idx, target_biome) {
|
|
409
|
-
let deferred3_0;
|
|
410
|
-
let deferred3_1;
|
|
411
|
-
try {
|
|
412
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
413
|
-
const len0 = WASM_VECTOR_LEN;
|
|
414
|
-
const ptr1 = passStringToWasm0(target_biome, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
415
|
-
const len1 = WASM_VECTOR_LEN;
|
|
416
|
-
const ret = wasm.debug_dump_tc_backwall_noise(ptr0, len0, world_idx, ptr1, len1);
|
|
417
|
-
deferred3_0 = ret[0];
|
|
418
|
-
deferred3_1 = ret[1];
|
|
419
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
420
|
-
} finally {
|
|
421
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Dump TC properties for parity diff. Returns per-TC type, position,
|
|
427
|
-
* poly vertices (hex bits), all_cells count, available_terrain count.
|
|
428
|
-
* @param {string} coordinate
|
|
429
|
-
* @param {number} world_idx
|
|
430
|
-
* @returns {string}
|
|
431
|
-
*/
|
|
432
|
-
export function debug_dump_tc_details(coordinate, world_idx) {
|
|
433
|
-
let deferred2_0;
|
|
434
|
-
let deferred2_1;
|
|
435
|
-
try {
|
|
436
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
437
|
-
const len0 = WASM_VECTOR_LEN;
|
|
438
|
-
const ret = wasm.debug_dump_tc_details(ptr0, len0, world_idx);
|
|
439
|
-
deferred2_0 = ret[0];
|
|
440
|
-
deferred2_1 = ret[1];
|
|
441
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
442
|
-
} finally {
|
|
443
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* Dump per-TC RNG states for one coordinate. Each entry mirrors CS
|
|
449
|
-
* rng_trace format: (pre_inext, pre_inextp, pre_seed, post_inext,
|
|
450
|
-
* post_inextp, post_seed) per terrain cell. Used to localize the first
|
|
451
|
-
* TC where RNG state diverges from CS.
|
|
452
|
-
* @param {string} coordinate
|
|
453
|
-
* @returns {string}
|
|
454
|
-
*/
|
|
455
|
-
export function debug_dump_tc_rng_states(coordinate) {
|
|
456
|
-
let deferred2_0;
|
|
457
|
-
let deferred2_1;
|
|
458
|
-
try {
|
|
459
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
460
|
-
const len0 = WASM_VECTOR_LEN;
|
|
461
|
-
const ret = wasm.debug_dump_tc_rng_states(ptr0, len0);
|
|
462
|
-
deferred2_0 = ret[0];
|
|
463
|
-
deferred2_1 = ret[1];
|
|
464
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
465
|
-
} finally {
|
|
466
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Dump raw `mob_spawns` for one world of a coordinate, as JSON
|
|
472
|
-
* `{template:[{cell,tag,...},...], ambient:[...], world_name, width, height}`.
|
|
473
|
-
* Debug-only — used to localize the V-AQU w[0] +1000 ambient mob delta.
|
|
474
|
-
* @param {string} coordinate
|
|
475
|
-
* @param {number} world_idx
|
|
476
|
-
* @returns {string}
|
|
477
|
-
*/
|
|
478
|
-
export function debug_dump_world_mobs(coordinate, world_idx) {
|
|
479
|
-
let deferred2_0;
|
|
480
|
-
let deferred2_1;
|
|
481
|
-
try {
|
|
482
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
483
|
-
const len0 = WASM_VECTOR_LEN;
|
|
484
|
-
const ret = wasm.debug_dump_world_mobs(ptr0, len0, world_idx);
|
|
485
|
-
deferred2_0 = ret[0];
|
|
486
|
-
deferred2_1 = ret[1];
|
|
487
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
488
|
-
} finally {
|
|
489
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* Diagnostic: return the current SETTINGS.element_overrides as JSON.
|
|
495
|
-
* Lets callers verify a `snapshot_*` push actually landed in the
|
|
496
|
-
* thread-local cache before invoking a `generate_*` / digest call.
|
|
497
|
-
* Gated behind the `debug` feature so production builds stay slim.
|
|
498
|
-
* @returns {string}
|
|
499
|
-
*/
|
|
500
|
-
export function debug_settings_element_overrides() {
|
|
501
|
-
let deferred1_0;
|
|
502
|
-
let deferred1_1;
|
|
503
|
-
try {
|
|
504
|
-
const ret = wasm.debug_settings_element_overrides();
|
|
505
|
-
deferred1_0 = ret[0];
|
|
506
|
-
deferred1_1 = ret[1];
|
|
507
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
508
|
-
} finally {
|
|
509
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* Drain the per-thread debug-capture buffer populated by
|
|
515
|
-
* instrumented points in `oni-worldgen`. Returns the accumulated
|
|
516
|
-
* lines as a single newline-separated string and empties the
|
|
517
|
-
* buffer. Pair with `compute_digest_for_cluster` or
|
|
518
|
-
* `dump_tc_polys_for_cluster` to capture intermediate state during
|
|
519
|
-
* worldgen.
|
|
520
|
-
* @returns {string}
|
|
521
|
-
*/
|
|
522
|
-
export function drain_debug_capture() {
|
|
523
|
-
let deferred1_0;
|
|
524
|
-
let deferred1_1;
|
|
525
|
-
try {
|
|
526
|
-
const ret = wasm.drain_debug_capture();
|
|
527
|
-
deferred1_0 = ret[0];
|
|
528
|
-
deferred1_1 = ret[1];
|
|
529
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
530
|
-
} finally {
|
|
531
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* Diagnostic: dump the cluster layout's world placements as seen by
|
|
537
|
-
* Rust after snapshot merge. Used to verify CGM augmentations
|
|
538
|
-
* (sizeMultiplier, forcedWorldTraits, etc) survived the JSON
|
|
539
|
-
* round-trip into Rust's `WorldPlacement` struct.
|
|
540
|
-
* @param {string} cluster_id
|
|
541
|
-
* @returns {string}
|
|
542
|
-
*/
|
|
543
|
-
export function dump_cluster_placements(cluster_id) {
|
|
544
|
-
let deferred2_0;
|
|
545
|
-
let deferred2_1;
|
|
546
|
-
try {
|
|
547
|
-
const ptr0 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
548
|
-
const len0 = WASM_VECTOR_LEN;
|
|
549
|
-
const ret = wasm.dump_cluster_placements(ptr0, len0);
|
|
550
|
-
deferred2_0 = ret[0];
|
|
551
|
-
deferred2_1 = ret[1];
|
|
552
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
553
|
-
} finally {
|
|
554
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
* Diagnostic: dump every terrain cell's polygon vertices. Returns a
|
|
560
|
-
* JSON object `{ site_id: [[vx_hex, vy_hex], ...], ... }` so the
|
|
561
|
-
* mod-parity scripts can diff per-cell polygons against the CS
|
|
562
|
-
* snapshot. Pairs with `dump_tc_positions_for_cluster` for full
|
|
563
|
-
* per-cell geometry diff.
|
|
564
|
-
* @param {string} coordinate
|
|
565
|
-
* @param {string} cluster_id
|
|
566
|
-
* @param {number} seed
|
|
567
|
-
* @param {number} world_idx
|
|
568
|
-
* @returns {string}
|
|
569
|
-
*/
|
|
570
|
-
export function dump_tc_polys_for_cluster(coordinate, cluster_id, seed, world_idx) {
|
|
571
|
-
let deferred3_0;
|
|
572
|
-
let deferred3_1;
|
|
573
|
-
try {
|
|
574
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
575
|
-
const len0 = WASM_VECTOR_LEN;
|
|
576
|
-
const ptr1 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
577
|
-
const len1 = WASM_VECTOR_LEN;
|
|
578
|
-
const ret = wasm.dump_tc_polys_for_cluster(ptr0, len0, ptr1, len1, seed, world_idx);
|
|
579
|
-
deferred3_0 = ret[0];
|
|
580
|
-
deferred3_1 = ret[1];
|
|
581
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
582
|
-
} finally {
|
|
583
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
* Diagnostic: dump every terrain cell's site_id + node_type +
|
|
589
|
-
* polygon centroid (raw bits) for a generated cluster. Lets the
|
|
590
|
-
* mod-parity scripts diff per-cell positions directly against the
|
|
591
|
-
* CS snapshot's `tc_positions` field when only `tc_positions_sha`
|
|
592
|
-
* fails. Output is a JSON array of "site_id,node_type,cx_hex,cy_hex"
|
|
593
|
-
* strings sorted by site_id (matching the digest hash input).
|
|
594
|
-
* @param {string} coordinate
|
|
595
|
-
* @param {string} cluster_id
|
|
596
|
-
* @param {number} seed
|
|
597
|
-
* @param {number} world_idx
|
|
598
|
-
* @returns {string}
|
|
599
|
-
*/
|
|
600
|
-
export function dump_tc_positions_for_cluster(coordinate, cluster_id, seed, world_idx) {
|
|
601
|
-
let deferred3_0;
|
|
602
|
-
let deferred3_1;
|
|
603
|
-
try {
|
|
604
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
605
|
-
const len0 = WASM_VECTOR_LEN;
|
|
606
|
-
const ptr1 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
607
|
-
const len1 = WASM_VECTOR_LEN;
|
|
608
|
-
const ret = wasm.dump_tc_positions_for_cluster(ptr0, len0, ptr1, len1, seed, world_idx);
|
|
609
|
-
deferred3_0 = ret[0];
|
|
610
|
-
deferred3_1 = ret[1];
|
|
611
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
612
|
-
} finally {
|
|
613
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* Diagnostic: dump every terrain cell's node_type for a given world
|
|
619
|
-
* in a CGM-style pipeline run. Comparing direct vs pipeline output
|
|
620
|
-
* reveals whether the divergence is in subworld assignment (upstream
|
|
621
|
-
* of element bands) or in element-band sampling (downstream).
|
|
622
|
-
* @param {string} cluster_id
|
|
623
|
-
* @param {number} seed
|
|
624
|
-
* @param {number} world_idx
|
|
625
|
-
* @param {string} coordinate
|
|
626
|
-
* @returns {string}
|
|
627
|
-
*/
|
|
628
|
-
export function dump_terrain_cell_node_types(cluster_id, seed, world_idx, coordinate) {
|
|
629
|
-
let deferred3_0;
|
|
630
|
-
let deferred3_1;
|
|
631
|
-
try {
|
|
632
|
-
const ptr0 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
633
|
-
const len0 = WASM_VECTOR_LEN;
|
|
634
|
-
const ptr1 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
635
|
-
const len1 = WASM_VECTOR_LEN;
|
|
636
|
-
const ret = wasm.dump_terrain_cell_node_types(ptr0, len0, seed, world_idx, ptr1, len1);
|
|
637
|
-
deferred3_0 = ret[0];
|
|
638
|
-
deferred3_1 = ret[1];
|
|
639
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
640
|
-
} finally {
|
|
641
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
/**
|
|
646
|
-
* Diagnostic: compute f32 transcendentals on a list of test inputs and
|
|
647
|
-
* dump the bit patterns. Used to confirm wasm32 libm vs x86 ucrt have
|
|
648
|
-
* different f32::ln/f32::exp outputs (suspected root of OASIS W1
|
|
649
|
-
* thermal divergence).
|
|
650
|
-
* @returns {string}
|
|
651
|
-
*/
|
|
652
|
-
export function dump_transcendental_test() {
|
|
653
|
-
let deferred1_0;
|
|
654
|
-
let deferred1_1;
|
|
655
|
-
try {
|
|
656
|
-
const ret = wasm.dump_transcendental_test();
|
|
657
|
-
deferred1_0 = ret[0];
|
|
658
|
-
deferred1_1 = ret[1];
|
|
659
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
660
|
-
} finally {
|
|
661
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
/**
|
|
666
|
-
* Diagnostic: dump per-cell element_idx + mass-bits + temp-bits for
|
|
667
|
-
* one world's `sim_cells`. Used to find the FIRST concretely-different
|
|
668
|
-
* cell when a digest hash diverges. Output is TSV (idx, elem_idx,
|
|
669
|
-
* mass_bits, temp_bits) — bits so f32s round-trip exactly through JSON.
|
|
670
|
-
* @param {string} coordinate
|
|
671
|
-
* @param {string} cluster_id
|
|
672
|
-
* @param {number} seed
|
|
673
|
-
* @param {string} mode
|
|
674
|
-
* @param {number} world_idx
|
|
675
|
-
* @param {string} overrides_json
|
|
676
|
-
* @returns {string}
|
|
677
|
-
*/
|
|
678
|
-
export function dump_world_cells(coordinate, cluster_id, seed, mode, world_idx, overrides_json) {
|
|
679
|
-
let deferred5_0;
|
|
680
|
-
let deferred5_1;
|
|
681
|
-
try {
|
|
682
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
683
|
-
const len0 = WASM_VECTOR_LEN;
|
|
684
|
-
const ptr1 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
685
|
-
const len1 = WASM_VECTOR_LEN;
|
|
686
|
-
const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
687
|
-
const len2 = WASM_VECTOR_LEN;
|
|
688
|
-
const ptr3 = passStringToWasm0(overrides_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
689
|
-
const len3 = WASM_VECTOR_LEN;
|
|
690
|
-
const ret = wasm.dump_world_cells(ptr0, len0, ptr1, len1, seed, ptr2, len2, world_idx, ptr3, len3);
|
|
691
|
-
deferred5_0 = ret[0];
|
|
692
|
-
deferred5_1 = ret[1];
|
|
693
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
694
|
-
} finally {
|
|
695
|
-
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
/**
|
|
700
|
-
* Dump cell state after exactly N settle ticks for a specific world.
|
|
701
|
-
* Used to bisect wasm-vs-native f32 divergence at tick granularity.
|
|
702
|
-
* @param {string} coordinate
|
|
703
|
-
* @param {number} world_idx
|
|
704
|
-
* @param {number} target_tick
|
|
705
|
-
* @returns {string}
|
|
706
|
-
*/
|
|
707
|
-
export function dump_world_cells_at_tick(coordinate, world_idx, target_tick) {
|
|
708
|
-
let deferred2_0;
|
|
709
|
-
let deferred2_1;
|
|
710
|
-
try {
|
|
711
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
712
|
-
const len0 = WASM_VECTOR_LEN;
|
|
713
|
-
const ret = wasm.dump_world_cells_at_tick(ptr0, len0, world_idx, target_tick);
|
|
714
|
-
deferred2_0 = ret[0];
|
|
715
|
-
deferred2_1 = ret[1];
|
|
716
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
717
|
-
} finally {
|
|
718
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
/**
|
|
723
|
-
* Dump post-settle cell-state for a specific world (debug feature).
|
|
724
|
-
*
|
|
725
|
-
* Returns NDJSON-like JSON `{ "world_index": N, "width": W, "height": H,
|
|
726
|
-
* "element_idx": [Rust idx per cell], "element_names": [Rust ELEMENTS],
|
|
727
|
-
* "mass_hex": ["%08X" per cell, BE digit order],
|
|
728
|
-
* "temp_hex": ["%08X" per cell, BE digit order] }`.
|
|
729
|
-
*
|
|
730
|
-
* Mirrors `compute_digest_from_coordinate` setup so the post-settle
|
|
731
|
-
* state is identical to what the digest hashes — enables cell-by-cell
|
|
732
|
-
* diff between WASM and native, which is the diagnostic needed to
|
|
733
|
-
* hunt the OASIS W1 wasm-vs-native settle divergence (May 2026).
|
|
734
|
-
* Variant of [`dump_world_cells_settled`] that takes the cluster id +
|
|
735
|
-
* seed directly instead of going through `parse_coordinate`. Mirrors
|
|
736
|
-
* `compute_digest_for_cluster` — required when the coordinate prefix
|
|
737
|
-
* is ambiguous across mod clusters (e.g. CGSM has 3 clusters at
|
|
738
|
-
* `CGSM-C`).
|
|
739
|
-
* @param {string} cluster_id
|
|
740
|
-
* @param {number} seed
|
|
741
|
-
* @param {number} world_idx
|
|
742
|
-
* @returns {string}
|
|
743
|
-
*/
|
|
744
|
-
export function dump_world_cells_for_cluster(cluster_id, seed, world_idx) {
|
|
745
|
-
let deferred2_0;
|
|
746
|
-
let deferred2_1;
|
|
747
|
-
try {
|
|
748
|
-
const ptr0 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
749
|
-
const len0 = WASM_VECTOR_LEN;
|
|
750
|
-
const ret = wasm.dump_world_cells_for_cluster(ptr0, len0, seed, world_idx);
|
|
751
|
-
deferred2_0 = ret[0];
|
|
752
|
-
deferred2_1 = ret[1];
|
|
753
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
754
|
-
} finally {
|
|
755
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
/**
|
|
760
|
-
* Variant that ALSO sets story / mixing levels from a coordinate
|
|
761
|
-
* string (matching the `compute_digest_for_cluster` semantics). Use
|
|
762
|
-
* when you want the dump to reflect the same worldgen pass the
|
|
763
|
-
* digest is computed against.
|
|
764
|
-
* @param {string} cluster_id
|
|
765
|
-
* @param {number} seed
|
|
766
|
-
* @param {number} world_idx
|
|
767
|
-
* @param {string} coordinate
|
|
768
|
-
* @returns {string}
|
|
769
|
-
*/
|
|
770
|
-
export function dump_world_cells_for_cluster_coord(cluster_id, seed, world_idx, coordinate) {
|
|
771
|
-
let deferred3_0;
|
|
772
|
-
let deferred3_1;
|
|
773
|
-
try {
|
|
774
|
-
const ptr0 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
775
|
-
const len0 = WASM_VECTOR_LEN;
|
|
776
|
-
const ptr1 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
777
|
-
const len1 = WASM_VECTOR_LEN;
|
|
778
|
-
const ret = wasm.dump_world_cells_for_cluster_coord(ptr0, len0, seed, world_idx, ptr1, len1);
|
|
779
|
-
deferred3_0 = ret[0];
|
|
780
|
-
deferred3_1 = ret[1];
|
|
781
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
782
|
-
} finally {
|
|
783
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
/**
|
|
788
|
-
* @param {string} coordinate
|
|
789
|
-
* @param {number} world_idx
|
|
790
|
-
* @returns {string}
|
|
791
|
-
*/
|
|
792
|
-
export function dump_world_cells_settled(coordinate, world_idx) {
|
|
793
|
-
let deferred2_0;
|
|
794
|
-
let deferred2_1;
|
|
795
|
-
try {
|
|
796
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
797
|
-
const len0 = WASM_VECTOR_LEN;
|
|
798
|
-
const ret = wasm.dump_world_cells_settled(ptr0, len0, world_idx);
|
|
799
|
-
deferred2_0 = ret[0];
|
|
800
|
-
deferred2_1 = ret[1];
|
|
801
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
802
|
-
} finally {
|
|
803
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
/**
|
|
808
|
-
* Diagnostic: dump per-TC info (node_id, position, node_type, tags)
|
|
809
|
-
* for one world. Used to detect per-overworld-cell subworld-assignment
|
|
810
|
-
* drift when `ow_types_sha` matches (set/count) but actual placement
|
|
811
|
-
* differs.
|
|
812
|
-
* @param {string} coordinate
|
|
813
|
-
* @param {string} cluster_id
|
|
814
|
-
* @param {number} seed
|
|
815
|
-
* @param {string} mode
|
|
816
|
-
* @param {number} world_idx
|
|
817
|
-
* @returns {string}
|
|
818
|
-
*/
|
|
819
|
-
export function dump_world_tcs(coordinate, cluster_id, seed, mode, world_idx) {
|
|
820
|
-
let deferred4_0;
|
|
821
|
-
let deferred4_1;
|
|
822
|
-
try {
|
|
823
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
824
|
-
const len0 = WASM_VECTOR_LEN;
|
|
825
|
-
const ptr1 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
826
|
-
const len1 = WASM_VECTOR_LEN;
|
|
827
|
-
const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
828
|
-
const len2 = WASM_VECTOR_LEN;
|
|
829
|
-
const ret = wasm.dump_world_tcs(ptr0, len0, ptr1, len1, seed, ptr2, len2, world_idx);
|
|
830
|
-
deferred4_0 = ret[0];
|
|
831
|
-
deferred4_1 = ret[1];
|
|
832
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
833
|
-
} finally {
|
|
834
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
* Diagnostic: dump per-world traits + subworld files for a generated
|
|
840
|
-
* cluster. Used to debug `world_traits_sha` / `subworld_files_sha`
|
|
841
|
-
* divergence — once a digest hash diverges, this tells you the
|
|
842
|
-
* actual content difference.
|
|
843
|
-
* @param {string} coordinate
|
|
844
|
-
* @param {string} cluster_id
|
|
845
|
-
* @param {number} seed
|
|
846
|
-
* @param {string} mode
|
|
847
|
-
* @returns {string}
|
|
5
|
+
* Drop the cached cluster. Snapshot edits persist.
|
|
848
6
|
*/
|
|
849
|
-
export function
|
|
850
|
-
|
|
851
|
-
let deferred4_1;
|
|
852
|
-
try {
|
|
853
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
854
|
-
const len0 = WASM_VECTOR_LEN;
|
|
855
|
-
const ptr1 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
856
|
-
const len1 = WASM_VECTOR_LEN;
|
|
857
|
-
const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
858
|
-
const len2 = WASM_VECTOR_LEN;
|
|
859
|
-
const ret = wasm.dump_world_traits(ptr0, len0, ptr1, len1, seed, ptr2, len2);
|
|
860
|
-
deferred4_0 = ret[0];
|
|
861
|
-
deferred4_1 = ret[1];
|
|
862
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
863
|
-
} finally {
|
|
864
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
865
|
-
}
|
|
7
|
+
export function clear_cluster_cache() {
|
|
8
|
+
wasm.clear_cluster_cache();
|
|
866
9
|
}
|
|
867
10
|
|
|
868
11
|
/**
|
|
@@ -900,65 +43,6 @@ export function evaluate_noise(tree_kind, tree_value, width, height, seed) {
|
|
|
900
43
|
return v3;
|
|
901
44
|
}
|
|
902
45
|
|
|
903
|
-
/**
|
|
904
|
-
* Extract the parts of a generated cluster's state that mod
|
|
905
|
-
* extensions (CGM and equivalents) need to compute post-snapshot
|
|
906
|
-
* overrides. Companion to [`compute_digest_with_overrides`].
|
|
907
|
-
*
|
|
908
|
-
* Mod-extensions consume this snapshot, compute structured
|
|
909
|
-
* mutations (e.g. CGM's geyser blacklist re-rolls, SO_POI pins,
|
|
910
|
-
* vanilla-starmap replacements) in TS, then pass the resulting
|
|
911
|
-
* `overrides_json` back to [`compute_digest_with_overrides`] to
|
|
912
|
-
* fold them into the digest.
|
|
913
|
-
*
|
|
914
|
-
* Schema (JSON):
|
|
915
|
-
* ```json
|
|
916
|
-
* {
|
|
917
|
-
* "globalWorldSeed": 1000824071,
|
|
918
|
-
* "isExpansion1": true,
|
|
919
|
-
* "worlds": [
|
|
920
|
-
* { "placementIndex": 0, "offsetX": 0, "offsetY": 0,
|
|
921
|
-
* "worldWidth": 96, "clusterLocation": { "q": 0, "r": 0 },
|
|
922
|
-
* "entitySpawners": [
|
|
923
|
-
* { "tag": "GeyserGeneric", "cell": 100,
|
|
924
|
-
* "resolvedGeyserTemplate": "hot_water" }
|
|
925
|
-
* ]
|
|
926
|
-
* }
|
|
927
|
-
* ],
|
|
928
|
-
* "poiLocations": [
|
|
929
|
-
* { "poiType": "HarvestableSpacePOI_X", "location": { "q": 5, "r": 5 } }
|
|
930
|
-
* ],
|
|
931
|
-
* "vanillaDestinations": [ { "destType": "...", "distance": 0 } ]
|
|
932
|
-
* }
|
|
933
|
-
* ```
|
|
934
|
-
*
|
|
935
|
-
* The schema is the symmetric input to the TS `Snapshot` interface
|
|
936
|
-
* in `packages/oxygen-not-included-mod-extensions/src/cgm/transformer.ts`.
|
|
937
|
-
* @param {string} coordinate
|
|
938
|
-
* @param {string} cluster_id
|
|
939
|
-
* @param {number} seed
|
|
940
|
-
* @param {string} mode
|
|
941
|
-
* @returns {string}
|
|
942
|
-
*/
|
|
943
|
-
export function extract_overrideable_state(coordinate, cluster_id, seed, mode) {
|
|
944
|
-
let deferred4_0;
|
|
945
|
-
let deferred4_1;
|
|
946
|
-
try {
|
|
947
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
948
|
-
const len0 = WASM_VECTOR_LEN;
|
|
949
|
-
const ptr1 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
950
|
-
const len1 = WASM_VECTOR_LEN;
|
|
951
|
-
const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
952
|
-
const len2 = WASM_VECTOR_LEN;
|
|
953
|
-
const ret = wasm.extract_overrideable_state(ptr0, len0, ptr1, len1, seed, ptr2, len2);
|
|
954
|
-
deferred4_0 = ret[0];
|
|
955
|
-
deferred4_1 = ret[1];
|
|
956
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
957
|
-
} finally {
|
|
958
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
|
|
962
46
|
/**
|
|
963
47
|
* The ONI game build this WASM was parity-baselined against (e.g.
|
|
964
48
|
* `"737195"`).
|
|
@@ -1023,29 +107,6 @@ export function generate_cluster_cells(seed, cluster_id) {
|
|
|
1023
107
|
}
|
|
1024
108
|
}
|
|
1025
109
|
|
|
1026
|
-
/**
|
|
1027
|
-
* Generate a cluster and return the rendered SimCell grid for each world.
|
|
1028
|
-
* Returns JSON with element_idx, mass_hex, temp_hex, disease_idx, disease_count arrays.
|
|
1029
|
-
* This is the same data format as the C# snapshot for parity verification.
|
|
1030
|
-
* @param {number} seed
|
|
1031
|
-
* @param {string} cluster_id
|
|
1032
|
-
* @returns {string}
|
|
1033
|
-
*/
|
|
1034
|
-
export function generate_cluster_rendered(seed, cluster_id) {
|
|
1035
|
-
let deferred2_0;
|
|
1036
|
-
let deferred2_1;
|
|
1037
|
-
try {
|
|
1038
|
-
const ptr0 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1039
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1040
|
-
const ret = wasm.generate_cluster_rendered(seed, ptr0, len0);
|
|
1041
|
-
deferred2_0 = ret[0];
|
|
1042
|
-
deferred2_1 = ret[1];
|
|
1043
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1044
|
-
} finally {
|
|
1045
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
110
|
/**
|
|
1050
111
|
* Generate a cluster with provided cluster YAML config override.
|
|
1051
112
|
* @param {number} seed
|
|
@@ -1137,85 +198,6 @@ export function generate_map_data(coordinate) {
|
|
|
1137
198
|
return ret;
|
|
1138
199
|
}
|
|
1139
200
|
|
|
1140
|
-
/**
|
|
1141
|
-
* Generate a cluster from coordinate and return per-world element grids.
|
|
1142
|
-
* Used for parity verification against C# snapshots.
|
|
1143
|
-
* @param {string} coordinate
|
|
1144
|
-
* @returns {string}
|
|
1145
|
-
*/
|
|
1146
|
-
export function generate_rendered_from_coordinate(coordinate) {
|
|
1147
|
-
let deferred2_0;
|
|
1148
|
-
let deferred2_1;
|
|
1149
|
-
try {
|
|
1150
|
-
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1151
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1152
|
-
const ret = wasm.generate_rendered_from_coordinate(ptr0, len0);
|
|
1153
|
-
deferred2_0 = ret[0];
|
|
1154
|
-
deferred2_1 = ret[1];
|
|
1155
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1156
|
-
} finally {
|
|
1157
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
/**
|
|
1162
|
-
* Generate a single SandstoneDefault world and return timing + cell count data.
|
|
1163
|
-
* @param {number} seed
|
|
1164
|
-
* @returns {string}
|
|
1165
|
-
*/
|
|
1166
|
-
export function generate_sandstone_default(seed) {
|
|
1167
|
-
let deferred1_0;
|
|
1168
|
-
let deferred1_1;
|
|
1169
|
-
try {
|
|
1170
|
-
const ret = wasm.generate_sandstone_default(seed);
|
|
1171
|
-
deferred1_0 = ret[0];
|
|
1172
|
-
deferred1_1 = ret[1];
|
|
1173
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1174
|
-
} finally {
|
|
1175
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
/**
|
|
1180
|
-
* Generate terrain cells for the starting world and return as JSON.
|
|
1181
|
-
* Used to verify WASM vs native parity.
|
|
1182
|
-
* @param {number} seed
|
|
1183
|
-
* @param {string} cluster_id
|
|
1184
|
-
* @returns {string}
|
|
1185
|
-
*/
|
|
1186
|
-
export function generate_terrain_cells(seed, cluster_id) {
|
|
1187
|
-
let deferred2_0;
|
|
1188
|
-
let deferred2_1;
|
|
1189
|
-
try {
|
|
1190
|
-
const ptr0 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1191
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1192
|
-
const ret = wasm.generate_terrain_cells(seed, ptr0, len0);
|
|
1193
|
-
deferred2_0 = ret[0];
|
|
1194
|
-
deferred2_1 = ret[1];
|
|
1195
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1196
|
-
} finally {
|
|
1197
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
/**
|
|
1202
|
-
* Generate a VanillaSandstoneCluster (8-world DLC cluster) and return timing + cell count data.
|
|
1203
|
-
* @param {number} seed
|
|
1204
|
-
* @returns {string}
|
|
1205
|
-
*/
|
|
1206
|
-
export function generate_vanilla_sandstone_cluster(seed) {
|
|
1207
|
-
let deferred1_0;
|
|
1208
|
-
let deferred1_1;
|
|
1209
|
-
try {
|
|
1210
|
-
const ret = wasm.generate_vanilla_sandstone_cluster(seed);
|
|
1211
|
-
deferred1_0 = ret[0];
|
|
1212
|
-
deferred1_1 = ret[1];
|
|
1213
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1214
|
-
} finally {
|
|
1215
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
201
|
/**
|
|
1220
202
|
* Re-run ambient mob spawning against the cached cluster's current
|
|
1221
203
|
* cell state and return the refreshed entity lists. Call after
|
|
@@ -1268,64 +250,39 @@ export function noise_node_kinds() {
|
|
|
1268
250
|
}
|
|
1269
251
|
|
|
1270
252
|
/**
|
|
1271
|
-
*
|
|
1272
|
-
*
|
|
1273
|
-
*
|
|
1274
|
-
*
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
/**
|
|
1290
|
-
* Diagnostic: serialize a specific subworld via its name lookup and
|
|
1291
|
-
* return both an alphabetical-keys hash AND an iteration-order JSON.
|
|
1292
|
-
* The two should match across "direct load" and "snapshot roundtrip"
|
|
1293
|
-
* paths if the bug isn't in HashMap iteration order.
|
|
1294
|
-
* @param {string} name
|
|
253
|
+
* Partial worldgen: generate only the selected worlds of a cluster.
|
|
254
|
+
* Cluster-level pre-passes (mixing, trait selection) run over every
|
|
255
|
+
* placement; per-world phases run only for the selected slots.
|
|
256
|
+
* Stateless; does not touch `CLUSTER_CACHE`.
|
|
257
|
+
*
|
|
258
|
+
* Geyser output matches a full generate exactly, and each world
|
|
259
|
+
* carries the digest-format geyser hashes. Verified element-wise by
|
|
260
|
+
* `tests/partial_parity.rs` and against the digest corpus by
|
|
261
|
+
* `scripts/partials_geyser_verify.mjs`.
|
|
262
|
+
*
|
|
263
|
+
* Story-trait templates and starmap locations are never produced;
|
|
264
|
+
* both depend on cross-world state a partial run lacks. Stock story
|
|
265
|
+
* traits carry no geysers, so geyser output is unaffected. Cell
|
|
266
|
+
* grids are pre-settle, as with `generate`; there is no partial
|
|
267
|
+
* settle (use `generate` + `advance` for settled state).
|
|
268
|
+
* @param {string} coordinate
|
|
269
|
+
* @param {string} options_json
|
|
1295
270
|
* @returns {string}
|
|
1296
271
|
*/
|
|
1297
|
-
export function
|
|
1298
|
-
let
|
|
1299
|
-
let
|
|
272
|
+
export function partials_from_coordinate(coordinate, options_json) {
|
|
273
|
+
let deferred3_0;
|
|
274
|
+
let deferred3_1;
|
|
1300
275
|
try {
|
|
1301
|
-
const ptr0 = passStringToWasm0(
|
|
276
|
+
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1302
277
|
const len0 = WASM_VECTOR_LEN;
|
|
1303
|
-
const
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
/**
|
|
1313
|
-
* Diagnostic: dump cache.subworlds in its raw HashMap iteration
|
|
1314
|
-
* order (NOT sorted), with each subworld's JSON. Used to detect
|
|
1315
|
-
* HashMap iteration-order drift that's invisible to sorted-key
|
|
1316
|
-
* fingerprints.
|
|
1317
|
-
* @returns {string}
|
|
1318
|
-
*/
|
|
1319
|
-
export function probe_subworlds_iteration_order_hash() {
|
|
1320
|
-
let deferred1_0;
|
|
1321
|
-
let deferred1_1;
|
|
1322
|
-
try {
|
|
1323
|
-
const ret = wasm.probe_subworlds_iteration_order_hash();
|
|
1324
|
-
deferred1_0 = ret[0];
|
|
1325
|
-
deferred1_1 = ret[1];
|
|
278
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
279
|
+
const len1 = WASM_VECTOR_LEN;
|
|
280
|
+
const ret = wasm.partials_from_coordinate(ptr0, len0, ptr1, len1);
|
|
281
|
+
deferred3_0 = ret[0];
|
|
282
|
+
deferred3_1 = ret[1];
|
|
1326
283
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
1327
284
|
} finally {
|
|
1328
|
-
wasm.__wbindgen_free(
|
|
285
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1329
286
|
}
|
|
1330
287
|
}
|
|
1331
288
|
|
|
@@ -1338,17 +295,6 @@ export function set_skip_templates(skip) {
|
|
|
1338
295
|
wasm.set_skip_templates(skip);
|
|
1339
296
|
}
|
|
1340
297
|
|
|
1341
|
-
/**
|
|
1342
|
-
* Toggle the per-thread oni-voronoi debug-capture flag. Off by
|
|
1343
|
-
* default so production hot paths don't pay for the per-iteration
|
|
1344
|
-
* trace. Mod-parity diff scripts flip this on around the worldgen
|
|
1345
|
-
* call.
|
|
1346
|
-
* @param {boolean} enabled
|
|
1347
|
-
*/
|
|
1348
|
-
export function set_voronoi_debug_capture(enabled) {
|
|
1349
|
-
wasm.set_voronoi_debug_capture(enabled);
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1352
298
|
/**
|
|
1353
299
|
* Drop both the SettingsCache and the cluster cache. The next
|
|
1354
300
|
* `generate_*` call reloads the embedded stock defaults.
|
|
@@ -1850,63 +796,6 @@ export function snapshot_to_files(snapshot_json) {
|
|
|
1850
796
|
}
|
|
1851
797
|
}
|
|
1852
798
|
|
|
1853
|
-
/**
|
|
1854
|
-
* Drain the thermal pair trace buffer (one entry per pair-fire).
|
|
1855
|
-
* @returns {string}
|
|
1856
|
-
*/
|
|
1857
|
-
export function take_thermal_pair_trace() {
|
|
1858
|
-
let deferred1_0;
|
|
1859
|
-
let deferred1_1;
|
|
1860
|
-
try {
|
|
1861
|
-
const ret = wasm.take_thermal_pair_trace();
|
|
1862
|
-
deferred1_0 = ret[0];
|
|
1863
|
-
deferred1_1 = ret[1];
|
|
1864
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1865
|
-
} finally {
|
|
1866
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1867
|
-
}
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
/**
|
|
1871
|
-
* Diagnostic: test f64::cos / f64::sin for a specific input. Used
|
|
1872
|
-
* to verify WASM precision against native Rust + system libm.
|
|
1873
|
-
* @param {bigint} angle_bits
|
|
1874
|
-
* @returns {string}
|
|
1875
|
-
*/
|
|
1876
|
-
export function test_cos_sin(angle_bits) {
|
|
1877
|
-
let deferred1_0;
|
|
1878
|
-
let deferred1_1;
|
|
1879
|
-
try {
|
|
1880
|
-
const ret = wasm.test_cos_sin(angle_bits);
|
|
1881
|
-
deferred1_0 = ret[0];
|
|
1882
|
-
deferred1_1 = ret[1];
|
|
1883
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1884
|
-
} finally {
|
|
1885
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
/**
|
|
1890
|
-
* Diagnostic: ucrt-port logf on a JSON list of input bit patterns.
|
|
1891
|
-
* Returns per-input output bit pattern for cross-platform verification.
|
|
1892
|
-
* @param {string} input_bits_json
|
|
1893
|
-
* @returns {string}
|
|
1894
|
-
*/
|
|
1895
|
-
export function ucrt_logf_batch(input_bits_json) {
|
|
1896
|
-
let deferred2_0;
|
|
1897
|
-
let deferred2_1;
|
|
1898
|
-
try {
|
|
1899
|
-
const ptr0 = passStringToWasm0(input_bits_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1900
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1901
|
-
const ret = wasm.ucrt_logf_batch(ptr0, len0);
|
|
1902
|
-
deferred2_0 = ret[0];
|
|
1903
|
-
deferred2_1 = ret[1];
|
|
1904
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1905
|
-
} finally {
|
|
1906
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
799
|
export class wbg_rayon_PoolBuilder {
|
|
1911
800
|
static __wrap(ptr) {
|
|
1912
801
|
ptr = ptr >>> 0;
|