space-data-module-sdk 0.9.8 → 0.9.9
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/docs/events-abi.html +1 -1
- package/docs/events-abi.md +1 -1
- package/package.json +1 -1
- package/schemas/orbpro/Propagator.fbs +4 -4
- package/schemas/orbpro/reference-frame-crosswalk.json +4 -4
- package/src/compiler/compileModule.js +51 -2
- package/src/flow/flowCompiler.js +1 -1
- package/src/testing/headlessShell.js +80 -0
- package/src/testing/parityGate.js +3 -19
- package/src/testing/parityLanes.js +4 -22
package/docs/events-abi.html
CHANGED
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
<p>A GMAT-style <code>Propagate ... {Sat.Altitude = 400}</code> is this ABI with one component whose <code>isStopCondition</code> is true and whose <code>g = parameter - goalValue</code>. Nothing is added to the propagator ABI, and that is an engineering decision, not a scoping convenience:</p>
|
|
179
179
|
<ol>
|
|
180
180
|
<li><strong>It is the same algorithm.</strong> A stop condition is <code>(event function, root refinement)</code>. Putting a second copy of Brent behind <code>plugin_propagate</code> would be two implementations of one algorithm that must agree — exactly the drift the generated-ABI lane exists to end.</li>
|
|
181
|
-
<li><strong>It would break every shipped propagator.</strong> The propagator export set is a per-epoch state evaluation. Adding stop conditions to it makes root refinement a family-wide obligation on <code>sgp4</code>, <code>
|
|
181
|
+
<li><strong>It would break every shipped propagator.</strong> The propagator export set is a per-epoch state evaluation. Adding stop conditions to it makes root refinement a family-wide obligation on <code>sgp4</code>, <code>ffm</code> and <code>keplerian-reference</code>, all in the field. That is a breaking ABI change and an owner decision.</li>
|
|
182
182
|
<li><strong>A propagator is a state SOURCE.</strong> It has no opinion about what is interesting, and giving it one couples every propagator to the parameter catalog.</li>
|
|
183
183
|
</ol>
|
|
184
184
|
<p><strong>Backward propagation is not a mode.</strong> It is <code>stop</code> earlier than <code>start</code>. The runner steps negatively, the consumer's propagator is asked for earlier epochs, and every hit carries <code>BACKWARD</code>. There is no second code path to keep in agreement with the first.</p>
|
package/docs/events-abi.md
CHANGED
|
@@ -344,7 +344,7 @@ not a scoping convenience:
|
|
|
344
344
|
agree — exactly the drift the generated-ABI lane exists to end.
|
|
345
345
|
2. **It would break every shipped propagator.** The propagator export set is a
|
|
346
346
|
per-epoch state evaluation. Adding stop conditions to it makes root
|
|
347
|
-
refinement a family-wide obligation on `sgp4`, `
|
|
347
|
+
refinement a family-wide obligation on `sgp4`, `ffm` and
|
|
348
348
|
`keplerian-reference`, all in the field. That is a breaking ABI change and
|
|
349
349
|
an owner decision.
|
|
350
350
|
3. **A propagator is a state SOURCE.** It has no opinion about what is
|
package/package.json
CHANGED
|
@@ -50,7 +50,7 @@ attribute "abi_c_helper_prefix";
|
|
|
50
50
|
// (A) orbpro.propagator (THIS) TEME=0 J2000=1 ICRF=2 ECEF=3 MCI=4 MCMF=5,
|
|
51
51
|
// then the appended axis roster at 6+
|
|
52
52
|
// (B) orbpro.plugins ECI=0 ECEF=1 TEME=2 ICRF=3
|
|
53
|
-
// (PropagatorState.fbs / "PRST" — the wire the compiled sgp4,
|
|
53
|
+
// (PropagatorState.fbs / "PRST" — the wire the compiled sgp4, ffm,
|
|
54
54
|
// conjunction-assessment and sensor-shader modules already emit)
|
|
55
55
|
// (C) OrbPro engine ReferenceFrame.js — NINE members, not two:
|
|
56
56
|
// FIXED=0 INERTIAL=1 TEME=2 VVLH=3 ENU=4 NED=5 NEU=6 RIC=7 LVLH=8
|
|
@@ -69,7 +69,7 @@ attribute "abi_c_helper_prefix";
|
|
|
69
69
|
// collapsing (A) and (B) is a wire break, not a Wave-0 edit — see
|
|
70
70
|
// graph/tasks/sdk-reference-frame-enum-unification.md, which also owns the
|
|
71
71
|
// (A)-vs-(C) inversion at 0/1. The reference pattern for a correct seam is
|
|
72
|
-
// propagator.
|
|
72
|
+
// propagator.ffm/index.js createSourceFromState.
|
|
73
73
|
//
|
|
74
74
|
// The crosswalk between all of these is DATA, in
|
|
75
75
|
// schemas/orbpro/reference-frame-crosswalk.json, and
|
|
@@ -146,8 +146,8 @@ enum StateFlags : uint (abi, abi_c_name: "OrbProStateFlags", abi_c_prefix: "ORBP
|
|
|
146
146
|
|
|
147
147
|
// Synced to the ratified SDS VCM.propagatorFamily vocabulary (schema/VCM/main.fbs)
|
|
148
148
|
// so any provider self-identifying in PropagatorDescribeSourcesBatchResult uses
|
|
149
|
-
// the SAME family codes SDS already carries —
|
|
150
|
-
// integrators map to COWELL (no
|
|
149
|
+
// the SAME family codes SDS already carries — FFM/Cowell-class numerical
|
|
150
|
+
// integrators map to COWELL (no FFM-specific code needed); new codes go
|
|
151
151
|
// through Themis's SDS auto-ratification law, never invented here first.
|
|
152
152
|
enum PropagatorSourceKind : ubyte {
|
|
153
153
|
NONE = 0,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"vocabularies": [
|
|
5
5
|
{
|
|
6
6
|
"id": "orbpro.plugins",
|
|
7
|
-
"description": "PropagatorState.fbs / \"PRST\" \u2014 the wire the compiled sgp4,
|
|
7
|
+
"description": "PropagatorState.fbs / \"PRST\" \u2014 the wire the compiled sgp4, ffm, conjunction-assessment and sensor-shader modules already emit. Its values are FROZEN by artifacts in the field; collapsing it into the ABI enum is a wire break, tracked as sdk-reference-frame-enum-unification.",
|
|
8
8
|
"repo": "space-data-network-modules",
|
|
9
9
|
"source": "propagator/sgp4/schemas/PropagatorState.fbs",
|
|
10
10
|
"members": {
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
"id": "modules.
|
|
79
|
-
"description": "The
|
|
78
|
+
"id": "modules.ffm.coords",
|
|
79
|
+
"description": "The FFM (Full Force Model) propagator's internal chain vocabulary.",
|
|
80
80
|
"repo": "space-data-network-modules",
|
|
81
|
-
"source": "propagator/
|
|
81
|
+
"source": "propagator/ffm/lib/coords_types.h",
|
|
82
82
|
"members": {
|
|
83
83
|
"TEME": "TEME",
|
|
84
84
|
"GCRF": "ICRF",
|
|
@@ -170,6 +170,54 @@ const MAX_STACK_SIZE_BYTES = 1024 * 1024 * 1024;
|
|
|
170
170
|
const SEQUENTIAL_INITIAL_MEMORY_BYTES = 16 * 1024 * 1024;
|
|
171
171
|
const SEQUENTIAL_MAX_MEMORY_BYTES = 2147483648;
|
|
172
172
|
|
|
173
|
+
// Those are DEFAULTS, not a contract. On wasm32-wasip1-threads the memory a
|
|
174
|
+
// sequential guest defines is SHARED (the triple implies atomics; see
|
|
175
|
+
// assertSequentialArtifact), and a browser reserves a shared memory's whole
|
|
176
|
+
// maximum up front because it can never move: three 2 GiB guests on one page
|
|
177
|
+
// are 6 GiB of address space, which a phone refuses. `initialMemoryBytes` /
|
|
178
|
+
// `maximumMemoryBytes` (declared in index.d.ts) size a guest to its measured
|
|
179
|
+
// need. Whole 64 KiB pages, initial <= maximum <= 4 GiB (wasm32).
|
|
180
|
+
const WASM_PAGE_BYTES = 64 * 1024;
|
|
181
|
+
const WASM32_MAX_MEMORY_BYTES = 4 * 1024 * 1024 * 1024;
|
|
182
|
+
|
|
183
|
+
function resolveMemoryBytes(name, value, fallback) {
|
|
184
|
+
if (value === undefined || value === null) {
|
|
185
|
+
return fallback;
|
|
186
|
+
}
|
|
187
|
+
if (
|
|
188
|
+
typeof value !== "number" ||
|
|
189
|
+
!Number.isInteger(value) ||
|
|
190
|
+
value < WASM_PAGE_BYTES ||
|
|
191
|
+
value > WASM32_MAX_MEMORY_BYTES ||
|
|
192
|
+
value % WASM_PAGE_BYTES !== 0
|
|
193
|
+
) {
|
|
194
|
+
throw new Error(
|
|
195
|
+
`${name} must be a whole number of 64 KiB pages between ${WASM_PAGE_BYTES} and ` +
|
|
196
|
+
`${WASM32_MAX_MEMORY_BYTES} bytes, got ${JSON.stringify(value)}.`,
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
return value;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function resolveSequentialMemory(options) {
|
|
203
|
+
const maximum = resolveMemoryBytes(
|
|
204
|
+
"maximumMemoryBytes",
|
|
205
|
+
options.maximumMemoryBytes,
|
|
206
|
+
SEQUENTIAL_MAX_MEMORY_BYTES,
|
|
207
|
+
);
|
|
208
|
+
const initial = resolveMemoryBytes(
|
|
209
|
+
"initialMemoryBytes",
|
|
210
|
+
options.initialMemoryBytes,
|
|
211
|
+
Math.min(SEQUENTIAL_INITIAL_MEMORY_BYTES, maximum),
|
|
212
|
+
);
|
|
213
|
+
if (initial > maximum) {
|
|
214
|
+
throw new Error(
|
|
215
|
+
`initialMemoryBytes ${initial} exceeds maximumMemoryBytes ${maximum}.`,
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
return { initial, maximum };
|
|
219
|
+
}
|
|
220
|
+
|
|
173
221
|
function resolveStackSize(stackSize) {
|
|
174
222
|
if (stackSize === undefined || stackSize === null) {
|
|
175
223
|
return null;
|
|
@@ -212,11 +260,12 @@ function buildCompilerArgs(exportedSymbols, options = {}) {
|
|
|
212
260
|
// that cannot allocate is not "sequential", it is broken. Same ceiling as
|
|
213
261
|
// PTHREAD_FINAL_LINK_FLAGS' --max-memory, unshared and unimported so the
|
|
214
262
|
// browser needs no cross-origin isolation to load it.
|
|
263
|
+
const sequentialMemory = resolveSequentialMemory(options);
|
|
215
264
|
const sequentialArgs = [
|
|
216
265
|
"-O3",
|
|
217
266
|
"-mbulk-memory",
|
|
218
|
-
`-Wl,--initial-memory=${
|
|
219
|
-
`-Wl,--max-memory=${
|
|
267
|
+
`-Wl,--initial-memory=${sequentialMemory.initial}`,
|
|
268
|
+
`-Wl,--max-memory=${sequentialMemory.maximum}`,
|
|
220
269
|
];
|
|
221
270
|
if (options.noEntry === true) {
|
|
222
271
|
sequentialArgs.push("-mexec-model=reactor");
|
package/src/flow/flowCompiler.js
CHANGED
|
@@ -1395,7 +1395,7 @@ export function validateFlowAPIDeclaration(flow, issues) {
|
|
|
1395
1395
|
// Ruling C (provider method vocabulary): providers in one family are NOT
|
|
1396
1396
|
// required to share a uniform method vocabulary beyond whatever the
|
|
1397
1397
|
// binding's own declared `methodId` demands — sgp4 exposes
|
|
1398
|
-
// ingest_omm/upsert_cat/propagate_state/propagate_path/catalog_query,
|
|
1398
|
+
// ingest_omm/upsert_cat/propagate_state/propagate_path/catalog_query, ffm
|
|
1399
1399
|
// exposes invoke/ingest_state/propagate_state/prepare_trajectory_segments/
|
|
1400
1400
|
// describe_trajectory_segments; a node that asks for "propagator satisfying
|
|
1401
1401
|
// propagate_state" resolves against either, a node that asks for
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// The only browser the parity lanes launch: Chromium's headless shell from
|
|
2
|
+
// the Playwright cache (owner rule 2026-10-16). Never Google Chrome.app, Chrome
|
|
3
|
+
// for Testing, Chromium.app or a `channel` browser: a full browser started
|
|
4
|
+
// from a background process registers with the window server, aborts in
|
|
5
|
+
// HIServices on macOS and throws crash dialogs on the operator's screen. The
|
|
6
|
+
// headless shell has no window-server registration and runs with an isolated
|
|
7
|
+
// user-data-dir, which is what a parity lane needs.
|
|
8
|
+
//
|
|
9
|
+
// Resolution order: `context.chromeBinary`, SDM_CHROME_BINARY, CHROME_BINARY
|
|
10
|
+
// (each must itself be a headless shell), then the newest installed shell
|
|
11
|
+
// under PLAYWRIGHT_BROWSERS_PATH (default ~/Library/Caches/ms-playwright, or
|
|
12
|
+
// ~/.cache/ms-playwright on Linux).
|
|
13
|
+
import { constants as fsConstants, existsSync, readdirSync } from "node:fs";
|
|
14
|
+
import { access } from "node:fs/promises";
|
|
15
|
+
import os from "node:os";
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
import process from "node:process";
|
|
18
|
+
|
|
19
|
+
const FORBIDDEN = /Google Chrome|Chrome for Testing|Chromium\.app|google-chrome|chromium-browser/;
|
|
20
|
+
const SHELL = /chrome-headless-shell|headless_shell/;
|
|
21
|
+
|
|
22
|
+
function cacheRoots() {
|
|
23
|
+
if (process.env.PLAYWRIGHT_BROWSERS_PATH) return [process.env.PLAYWRIGHT_BROWSERS_PATH];
|
|
24
|
+
return [
|
|
25
|
+
path.join(os.homedir(), "Library", "Caches", "ms-playwright"),
|
|
26
|
+
path.join(os.homedir(), ".cache", "ms-playwright"),
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Installed headless shells, newest first. */
|
|
31
|
+
export function installedHeadlessShells() {
|
|
32
|
+
const found = [];
|
|
33
|
+
for (const cache of cacheRoots()) {
|
|
34
|
+
if (!existsSync(cache)) continue;
|
|
35
|
+
const dirs = readdirSync(cache).filter((d) => /^chromium_headless_shell-\d+$/.test(d));
|
|
36
|
+
dirs.sort((a, b) => Number(b.split("-")[1]) - Number(a.split("-")[1]));
|
|
37
|
+
for (const dir of dirs) {
|
|
38
|
+
for (const sub of readdirSync(path.join(cache, dir))) {
|
|
39
|
+
if (!sub.startsWith("chrome-headless-shell")) continue;
|
|
40
|
+
for (const name of ["chrome-headless-shell", "chrome-headless-shell.exe"]) {
|
|
41
|
+
const bin = path.join(cache, dir, sub, name);
|
|
42
|
+
if (existsSync(bin)) found.push(bin);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return found;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The headless-shell binary the browser lanes spawn. An explicit choice is
|
|
52
|
+
* honoured only when it is a headless shell; a full browser is refused.
|
|
53
|
+
*/
|
|
54
|
+
export async function resolveHeadlessShell(context = {}) {
|
|
55
|
+
const explicit =
|
|
56
|
+
context.chromeBinary ?? process.env.SDM_CHROME_BINARY ?? process.env.CHROME_BINARY;
|
|
57
|
+
if (explicit) {
|
|
58
|
+
const candidate = String(explicit);
|
|
59
|
+
if (FORBIDDEN.test(candidate) || !SHELL.test(candidate)) {
|
|
60
|
+
throw new Error(
|
|
61
|
+
`browser lane: ${candidate} is not a Chromium headless shell. Only the Playwright ` +
|
|
62
|
+
"chromium_headless_shell may be launched (never Google Chrome.app, Chrome for Testing or Chromium.app).",
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return candidate;
|
|
66
|
+
}
|
|
67
|
+
for (const candidate of installedHeadlessShells()) {
|
|
68
|
+
try {
|
|
69
|
+
await access(candidate, fsConstants.X_OK);
|
|
70
|
+
return candidate;
|
|
71
|
+
} catch {
|
|
72
|
+
// not executable here; try the next install
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
throw new Error(
|
|
76
|
+
"browser lane: no Chromium headless shell found under the Playwright cache " +
|
|
77
|
+
"(npx playwright install chromium-headless-shell), and SDM_CHROME_BINARY is unset. " +
|
|
78
|
+
"The browser lane requires a REAL browser context — jsdom masks SAB/threading realities.",
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -55,6 +55,7 @@ import path from "node:path";
|
|
|
55
55
|
import process from "node:process";
|
|
56
56
|
import { createRequire } from "node:module";
|
|
57
57
|
import { fileURLToPath } from "node:url";
|
|
58
|
+
import { resolveHeadlessShell } from "./headlessShell.js";
|
|
58
59
|
import { promisify } from "node:util";
|
|
59
60
|
|
|
60
61
|
import { toLoadableWasmBytes } from "../bundle/artifactBytes.js";
|
|
@@ -529,26 +530,9 @@ async function ensureDockerLane(context) {
|
|
|
529
530
|
|
|
530
531
|
// --- Browser probe lane ---------------------------------------------------------
|
|
531
532
|
|
|
532
|
-
|
|
533
|
-
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
|
|
534
|
-
"/Applications/Chromium.app/Contents/MacOS/Chromium",
|
|
535
|
-
"/usr/bin/google-chrome-stable",
|
|
536
|
-
"/usr/bin/google-chrome",
|
|
537
|
-
"/usr/bin/chromium",
|
|
538
|
-
"/usr/bin/chromium-browser",
|
|
539
|
-
];
|
|
540
|
-
|
|
533
|
+
// Only the Playwright chromium headless shell is launched (headlessShell.js).
|
|
541
534
|
export async function resolveChromeBinary(context = {}) {
|
|
542
|
-
|
|
543
|
-
context.chromeBinary ?? process.env.SDM_CHROME_BINARY ?? process.env.CHROME_BINARY;
|
|
544
|
-
if (explicit) return String(explicit);
|
|
545
|
-
for (const candidate of CHROME_CANDIDATES) {
|
|
546
|
-
if (await binaryExists(candidate)) return candidate;
|
|
547
|
-
}
|
|
548
|
-
throw new Error(
|
|
549
|
-
"browser lane: no Chrome/Chromium binary found (set SDM_CHROME_BINARY). " +
|
|
550
|
-
"The browser lane requires a REAL browser context — jsdom masks SAB/threading realities.",
|
|
551
|
-
);
|
|
535
|
+
return resolveHeadlessShell(context);
|
|
552
536
|
}
|
|
553
537
|
|
|
554
538
|
const PROBE_HTML = `<!doctype html>
|
|
@@ -27,6 +27,7 @@ import path from "node:path";
|
|
|
27
27
|
import process from "node:process";
|
|
28
28
|
import { fileURLToPath } from "node:url";
|
|
29
29
|
import { promisify } from "node:util";
|
|
30
|
+
import { resolveHeadlessShell } from "./headlessShell.js";
|
|
30
31
|
|
|
31
32
|
import { ExitClass, assertWasmEdgeVersionMatchesPin } from "./parityHarness.js";
|
|
32
33
|
import { normalizeWasmEdgeOutcome } from "./wasmedgeOutput.js";
|
|
@@ -379,30 +380,11 @@ export async function runDockerWasmEdgeLane(context) {
|
|
|
379
380
|
return runs;
|
|
380
381
|
}
|
|
381
382
|
|
|
382
|
-
// --- Browser lane (
|
|
383
|
-
|
|
384
|
-
const CHROME_CANDIDATES = [
|
|
385
|
-
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
|
|
386
|
-
"/Applications/Chromium.app/Contents/MacOS/Chromium",
|
|
387
|
-
"/usr/bin/google-chrome-stable",
|
|
388
|
-
"/usr/bin/google-chrome",
|
|
389
|
-
"/usr/bin/chromium",
|
|
390
|
-
"/usr/bin/chromium-browser",
|
|
391
|
-
];
|
|
383
|
+
// --- Browser lane (Chromium headless shell; never jsdom, never Chrome.app) ----
|
|
392
384
|
|
|
385
|
+
// Only the Playwright chromium headless shell is launched (headlessShell.js).
|
|
393
386
|
export async function resolveChromeBinary(context = {}) {
|
|
394
|
-
|
|
395
|
-
context.chromeBinary ??
|
|
396
|
-
process.env.SDM_CHROME_BINARY ??
|
|
397
|
-
process.env.CHROME_BINARY;
|
|
398
|
-
if (explicit) return String(explicit);
|
|
399
|
-
for (const candidate of CHROME_CANDIDATES) {
|
|
400
|
-
if (await binaryExists(candidate)) return candidate;
|
|
401
|
-
}
|
|
402
|
-
throw new Error(
|
|
403
|
-
"browser lane: no Chrome/Chromium binary found. Set SDM_CHROME_BINARY. " +
|
|
404
|
-
"(The browser lane requires a REAL browser context — jsdom masks SAB/threading realities.)",
|
|
405
|
-
);
|
|
387
|
+
return resolveHeadlessShell(context);
|
|
406
388
|
}
|
|
407
389
|
|
|
408
390
|
async function buildBrowserRunnerBundle() {
|