space-data-module-sdk 0.8.14 → 0.8.16
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/bin/space-data-module.js +91 -0
- package/docs/_shell/consumer-assets.html +5 -0
- package/docs/browser-wasmedge-isomorphic.html +261 -0
- package/docs/byo-wasm-quickstart.html +226 -0
- package/docs/byo-wasm-quickstart.md +204 -0
- package/docs/conformance.html +156 -0
- package/docs/conformance.md +92 -0
- package/docs/emception-shared-memory-verdict.md +209 -0
- package/docs/events-abi.html +313 -0
- package/docs/events-abi.md +530 -0
- package/docs/families/analytics.html +178 -0
- package/docs/families/analytics.md +104 -0
- package/docs/families/attitude.html +157 -0
- package/docs/families/attitude.md +36 -0
- package/docs/families/behavior.html +157 -0
- package/docs/families/behavior.md +36 -0
- package/docs/families/breakup.html +157 -0
- package/docs/families/breakup.md +36 -0
- package/docs/families/conjunction.html +186 -0
- package/docs/families/conjunction.md +121 -0
- package/docs/families/data-source.html +318 -0
- package/docs/families/effects.html +157 -0
- package/docs/families/effects.md +36 -0
- package/docs/families/environment.html +170 -0
- package/docs/families/environment.md +73 -0
- package/docs/families/estimation.html +190 -0
- package/docs/families/estimation.md +128 -0
- package/docs/families/gnc.html +157 -0
- package/docs/families/gnc.md +36 -0
- package/docs/families/maneuver.html +209 -0
- package/docs/families/maneuver.md +206 -0
- package/docs/families/obstruction.html +191 -0
- package/docs/families/obstruction.md +96 -0
- package/docs/families/propagator.html +333 -0
- package/docs/families/propulsion.html +157 -0
- package/docs/families/propulsion.md +36 -0
- package/docs/families/reentry.html +157 -0
- package/docs/families/reentry.md +36 -0
- package/docs/families/rf.html +193 -0
- package/docs/families/rf.md +136 -0
- package/docs/families/scheduler.html +157 -0
- package/docs/families/scheduler.md +36 -0
- package/docs/families/sensor.html +157 -0
- package/docs/families/sensor.md +36 -0
- package/docs/families/signature.html +157 -0
- package/docs/families/signature.md +36 -0
- package/docs/flatsql-host-contract.html +176 -0
- package/docs/flatsql-streaming-standard.html +375 -0
- package/docs/gpu-module-abi.html +233 -0
- package/docs/harness-family-matrix.md +135 -0
- package/docs/index.html +216 -85
- package/docs/isomorphic-pthreads.html +228 -0
- package/docs/isomorphic-pthreads.md +84 -0
- package/docs/isomorphic-sdn-runtime-plan.html +274 -0
- package/docs/language-runtime-matrix.html +182 -0
- package/docs/llms.txt +86 -0
- package/docs/module-bundle-runtime-plan.html +146 -0
- package/docs/module-publication-standard.html +503 -0
- package/docs/node-red-default-node-parity.html +201 -0
- package/docs/propagator-abi.md +73 -21
- package/docs/protect-and-sign.html +181 -0
- package/docs/protect-and-sign.md +120 -0
- package/docs/protocol-installation.html +296 -0
- package/docs/publication-submission.html +158 -0
- package/docs/publication-submission.md +78 -0
- package/docs/secrets-capability.html +206 -0
- package/docs/styles.css +860 -167
- package/docs/testing-harness.html +408 -0
- package/docs/tri-runtime-parity-gate.html +182 -0
- package/docs/tri-runtime-parity.html +203 -0
- package/include/orbpro/orbpro_event_runner.h +951 -0
- package/include/orbpro/orbpro_events_abi.h +565 -0
- package/include/orbpro/orbpro_propagator_abi.h +17 -0
- package/package.json +15 -5
- package/schemas/orbpro/Events.fbs +501 -0
- package/schemas/orbpro/Propagator.fbs +72 -9
- package/schemas/orbpro/reference-frame-crosswalk.json +108 -0
- package/schemas/orbpro/reference-frame.lock.json +98 -0
- package/src/browser.js +13 -0
- package/src/conformance/abiDriver.js +225 -0
- package/src/conformance/index.js +151 -0
- package/src/conformance/propagatorSuite.js +526 -0
- package/src/conformance/selfTest.js +275 -0
- package/src/conformance/selfTestCorpus.js +68 -0
- package/src/conformance/twoBodyReference.js +132 -0
- package/src/generated/orbpro/events-abi.js +206 -0
- package/src/generated/orbpro/events-abi.ts +319 -0
- package/src/generated/orbpro/propagator/reference-frame.js +17 -0
- package/src/generated/orbpro/propagator/reference-frame.ts +91 -1
- package/src/generated/orbpro/propagator-abi.js +17 -0
- package/src/generated/orbpro/propagator-abi.ts +17 -0
- package/src/generated/spacedatastandards/plg/CCT.d.ts +94 -0
- package/src/generated/spacedatastandards/plg/CCT.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/CCT.js +208 -0
- package/src/generated/spacedatastandards/plg/CCT.ts +281 -0
- package/src/generated/spacedatastandards/plg/CCTCategory.d.ts +98 -0
- package/src/generated/spacedatastandards/plg/CCTCategory.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/CCTCategory.js +177 -0
- package/src/generated/spacedatastandards/plg/CCTCategory.ts +269 -0
- package/src/generated/spacedatastandards/plg/CCTCategoryRollup.d.ts +54 -0
- package/src/generated/spacedatastandards/plg/CCTCategoryRollup.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/CCTCategoryRollup.js +106 -0
- package/src/generated/spacedatastandards/plg/CCTCategoryRollup.ts +144 -0
- package/src/generated/spacedatastandards/plg/PLG.d.ts +46 -2
- package/src/generated/spacedatastandards/plg/PLG.d.ts.map +1 -1
- package/src/generated/spacedatastandards/plg/PLG.js +78 -5
- package/src/generated/spacedatastandards/plg/PLG.ts +90 -5
- package/src/generated/spacedatastandards/plg/capabilityClass.d.ts +181 -0
- package/src/generated/spacedatastandards/plg/capabilityClass.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/capabilityClass.js +183 -0
- package/src/generated/spacedatastandards/plg/capabilityClass.ts +208 -0
- package/src/generated/spacedatastandards/plg/main.d.ts +4 -0
- package/src/generated/spacedatastandards/plg/main.d.ts.map +1 -1
- package/src/generated/spacedatastandards/plg/main.js +4 -0
- package/src/generated/spacedatastandards/plg/main.ts +4 -0
- package/src/generated/spacedatastandards/plg/pluginCategory.d.ts +40 -2
- package/src/generated/spacedatastandards/plg/pluginCategory.d.ts.map +1 -1
- package/src/generated/spacedatastandards/plg/pluginCategory.js +40 -2
- package/src/generated/spacedatastandards/plg/pluginCategory.ts +40 -2
- package/src/host/browserModuleHarness.js +8 -0
- package/src/host/wasiThreadHost.js +189 -14
- package/src/index.d.ts +18 -1
- package/src/testing/isomorphicHarness.js +233 -0
- package/src/transport/index.js +16 -0
- package/src/transport/records.js +1015 -3
package/bin/space-data-module.js
CHANGED
|
@@ -42,6 +42,8 @@ async function main(argv) {
|
|
|
42
42
|
return runParity(rest);
|
|
43
43
|
case "parity-gate":
|
|
44
44
|
return runParityGateCommand(rest);
|
|
45
|
+
case "conformance":
|
|
46
|
+
return runConformanceCommand(rest);
|
|
45
47
|
case "protect":
|
|
46
48
|
return runProtect(rest);
|
|
47
49
|
case "sign":
|
|
@@ -241,6 +243,9 @@ function printUsage() {
|
|
|
241
243
|
space-data-module parity-gate (THE isomorphism acceptance gate: certified artifact set x real lanes)
|
|
242
244
|
space-data-module parity-gate --artifact rf-fspl=./dist/isomorphic/module.wasm:module --json
|
|
243
245
|
space-data-module parity-gate --gate-manifest ./parity/negative-control.json --expect-fail (prove the gate can fail)
|
|
246
|
+
space-data-module conformance propagator --artifact ./dist/isomorphic/module.wasm (official-harness conformance: WASM artifacts only)
|
|
247
|
+
space-data-module conformance propagator --artifact ./dist/isomorphic/module.wasm --vectors ./vectors/vectors.json --json
|
|
248
|
+
space-data-module conformance propagator --self-test (must exit 0 BY failing: planted defects all caught)
|
|
244
249
|
space-data-module flow check ./flows/my.flow.json --deps ./modules-root
|
|
245
250
|
space-data-module flow compile ./flows/my.flow.json --deps ./modules-root [--out ./flows/my/dist]
|
|
246
251
|
space-data-module protect --manifest ./manifest.json --wasm ./dist/module.wasm --json
|
|
@@ -401,6 +406,92 @@ async function runParity(argv) {
|
|
|
401
406
|
return report.ok ? 0 : 2;
|
|
402
407
|
}
|
|
403
408
|
|
|
409
|
+
// space-data-module conformance <family> --artifact ./dist/isomorphic/module.wasm
|
|
410
|
+
// [--vectors ./vectors/vectors.json] [--json]
|
|
411
|
+
// [--leak-warmup N] [--leak-cycles N] [--leak-entities N]
|
|
412
|
+
// space-data-module conformance <family> --self-test (must exit 0 BY failing)
|
|
413
|
+
//
|
|
414
|
+
// The official-harness conformance runner (finding
|
|
415
|
+
// graph/findings/official-harness-shapes.md §5): WASM artifacts ONLY, family-
|
|
416
|
+
// dispatched, shipped with its own negative control. PASS / PASS-WITH-GAPS
|
|
417
|
+
// exit 0 (gaps are named); FAIL exits 1. The self-test runs the suite against
|
|
418
|
+
// mock propagators with planted defects — one per real defect class the
|
|
419
|
+
// finding documented — and exits 0 only when every defect is CAUGHT.
|
|
420
|
+
async function runConformanceCommand(argv) {
|
|
421
|
+
const [family, ...rest] = argv;
|
|
422
|
+
if (!family || family.startsWith("--")) {
|
|
423
|
+
throw new Error(
|
|
424
|
+
"conformance requires a family argument, e.g. `space-data-module conformance propagator ...`",
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
const options = { json: false, selfTest: false, leak: {} };
|
|
428
|
+
for (let index = 0; index < rest.length; index += 1) {
|
|
429
|
+
const value = rest[index];
|
|
430
|
+
switch (value) {
|
|
431
|
+
case "--artifact":
|
|
432
|
+
case "--wasm":
|
|
433
|
+
options.artifactPath = path.resolve(requireValue(rest, ++index, value));
|
|
434
|
+
break;
|
|
435
|
+
case "--vectors":
|
|
436
|
+
options.vectorsPath = path.resolve(requireValue(rest, ++index, value));
|
|
437
|
+
break;
|
|
438
|
+
case "--json":
|
|
439
|
+
options.json = true;
|
|
440
|
+
break;
|
|
441
|
+
case "--self-test":
|
|
442
|
+
options.selfTest = true;
|
|
443
|
+
break;
|
|
444
|
+
case "--leak-warmup":
|
|
445
|
+
options.leak.warmupCycles = Number(requireValue(rest, ++index, value));
|
|
446
|
+
break;
|
|
447
|
+
case "--leak-cycles":
|
|
448
|
+
options.leak.measureCycles = Number(requireValue(rest, ++index, value));
|
|
449
|
+
break;
|
|
450
|
+
case "--leak-entities":
|
|
451
|
+
options.leak.entities = Number(requireValue(rest, ++index, value));
|
|
452
|
+
break;
|
|
453
|
+
default:
|
|
454
|
+
throw new Error(`conformance: unknown flag ${value}`);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
const conformance = await import("../src/conformance/index.js");
|
|
459
|
+
|
|
460
|
+
if (options.selfTest) {
|
|
461
|
+
if (family !== "propagator") {
|
|
462
|
+
throw new conformance.UnknownConformanceFamilyError(family);
|
|
463
|
+
}
|
|
464
|
+
const outcome = await conformance.runPropagatorSelfTest();
|
|
465
|
+
if (options.json) {
|
|
466
|
+
console.log(JSON.stringify(outcome, null, 2));
|
|
467
|
+
} else {
|
|
468
|
+
console.log(conformance.formatSelfTestReport(outcome));
|
|
469
|
+
}
|
|
470
|
+
return outcome.ok ? 0 : 1;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
if (!options.artifactPath) {
|
|
474
|
+
throw new Error("conformance requires --artifact <module.wasm> (or --self-test).");
|
|
475
|
+
}
|
|
476
|
+
const report = await conformance.runConformance({
|
|
477
|
+
family,
|
|
478
|
+
artifactPath: options.artifactPath,
|
|
479
|
+
vectorsPath: options.vectorsPath,
|
|
480
|
+
leak: options.leak,
|
|
481
|
+
});
|
|
482
|
+
if (options.json) {
|
|
483
|
+
console.log(JSON.stringify(report, null, 2));
|
|
484
|
+
} else {
|
|
485
|
+
const text = conformance.formatConformanceReport(report);
|
|
486
|
+
if (report.verdict === "FAIL") {
|
|
487
|
+
console.error(text);
|
|
488
|
+
} else {
|
|
489
|
+
console.log(text);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return report.verdict === "FAIL" ? 1 : 0;
|
|
493
|
+
}
|
|
494
|
+
|
|
404
495
|
// space-data-module parity-gate [--gate-manifest ./parity/gate.json]
|
|
405
496
|
// [--artifact <id>=<path>[:<surface>]] [--lanes ...] [--json]
|
|
406
497
|
// [--require-native-wasmedge] [--expect-fail] [--timeout-sec N]
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<!-- SDN_CONSUMER_ASSETS_START -->
|
|
2
|
+
<link rel="stylesheet" href="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" crossorigin="anonymous">
|
|
3
|
+
<script defer src="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" crossorigin="anonymous" data-sdn-wallet-public-client="v1"></script>
|
|
4
|
+
<script defer src="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.52fde607eee38ffa116188201f50258ed50bd18c9f06c1af9678f763147a8fe5.js" integrity="sha384-dgeojhJ8vTszHXIbv7O7nZcEzqD10oUYYJjBmPrV7+kLQEUlXLQD4ek5Q7HOFiO5" crossorigin="anonymous" data-nav-style-url="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.36a36359ce18322185e9ff179f88175bab67d5ad84a14d9c08a54f2ff27267e7.css" data-nav-style-integrity="sha384-c4M8Fg+kYaeOYYtJVr7jJsde24IhSWkWaRyAOHEZU9jozhRck089aw+mnHwxymds" data-wallet-client-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" data-wallet-client-integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" data-wallet-style-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" data-wallet-style-integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" data-wallet-client-id="sdn-module-sdk-pages-v1" data-wallet-callback-uri="https://digitalarsenal.github.io/space-data-module-sdk/wallet-callback.html" data-wallet-registry-sha256="e1ce6fe903c9700484a8a87d96581c8cad97063dabf63030b4518a31a3bdaa93"></script>
|
|
5
|
+
<!-- SDN_CONSUMER_ASSETS_END -->
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="description" content="Use this profile when you want one compiled .wasm artifact that can be loaded" />
|
|
7
|
+
<title>Browser / WasmEdge isomorphism — Space Data Module SDK</title>
|
|
8
|
+
<link rel="stylesheet" href="./styles.css" />
|
|
9
|
+
<!-- SDN_CONSUMER_ASSETS_START -->
|
|
10
|
+
<link rel="stylesheet" href="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" crossorigin="anonymous">
|
|
11
|
+
<script defer src="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" crossorigin="anonymous" data-sdn-wallet-public-client="v1"></script>
|
|
12
|
+
<script defer src="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.52fde607eee38ffa116188201f50258ed50bd18c9f06c1af9678f763147a8fe5.js" integrity="sha384-dgeojhJ8vTszHXIbv7O7nZcEzqD10oUYYJjBmPrV7+kLQEUlXLQD4ek5Q7HOFiO5" crossorigin="anonymous" data-nav-style-url="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.36a36359ce18322185e9ff179f88175bab67d5ad84a14d9c08a54f2ff27267e7.css" data-nav-style-integrity="sha384-c4M8Fg+kYaeOYYtJVr7jJsde24IhSWkWaRyAOHEZU9jozhRck089aw+mnHwxymds" data-wallet-client-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" data-wallet-client-integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" data-wallet-style-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" data-wallet-style-integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" data-wallet-client-id="sdn-module-sdk-pages-v1" data-wallet-callback-uri="https://digitalarsenal.github.io/space-data-module-sdk/wallet-callback.html" data-wallet-registry-sha256="e1ce6fe903c9700484a8a87d96581c8cad97063dabf63030b4518a31a3bdaa93"></script>
|
|
13
|
+
<!-- SDN_CONSUMER_ASSETS_END -->
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<a class="skip-link" href="#main">Skip to content</a>
|
|
17
|
+
<sdn-stack-nav active="module-sdk"></sdn-stack-nav>
|
|
18
|
+
<header class="site-header">
|
|
19
|
+
<a class="site-brand" href="./">Space Data Module SDK</a>
|
|
20
|
+
<nav class="header-links" aria-label="Site">
|
|
21
|
+
<a href="./byo-wasm-quickstart.html">Quickstart</a>
|
|
22
|
+
<a href="./conformance.html">Conformance</a>
|
|
23
|
+
<a href="https://github.com/DigitalArsenal/space-data-module-sdk">GitHub</a>
|
|
24
|
+
<a class="stack-button" href="#stack">Stack</a>
|
|
25
|
+
</nav>
|
|
26
|
+
</header>
|
|
27
|
+
<div class="shell">
|
|
28
|
+
<nav class="sidebar" id="sidebar" aria-label="Documentation">
|
|
29
|
+
<h2>Start here</h2><ul>
|
|
30
|
+
<li><a href="./index.html"><span>Harness family matrix</span></a></li>
|
|
31
|
+
<li><a href="./byo-wasm-quickstart.html"><span>BYO-wasm quickstart</span></a></li>
|
|
32
|
+
<li><a href="./conformance.html"><span>Conformance kit</span></a></li>
|
|
33
|
+
<li><a href="./protect-and-sign.html"><span>Protect and sign</span></a></li>
|
|
34
|
+
<li><a href="./publication-submission.html"><span>Publication and listing</span></a></li>
|
|
35
|
+
</ul>
|
|
36
|
+
<h2>Dynamics</h2><ul>
|
|
37
|
+
<li><a href="./families/propagator.html"><span>Propagator</span><span class="tag tag-shipped">shipped</span></a></li>
|
|
38
|
+
<li><a href="./families/maneuver.html"><span>Maneuver</span><span class="tag tag-experimental">experimental</span></a></li>
|
|
39
|
+
<li><a href="./families/propulsion.html"><span>Propulsion</span><span class="tag tag-planned">planned</span></a></li>
|
|
40
|
+
<li><a href="./families/attitude.html"><span>Attitude</span><span class="tag tag-planned">planned</span></a></li>
|
|
41
|
+
<li><a href="./families/gnc.html"><span>GNC</span><span class="tag tag-planned">planned</span></a></li>
|
|
42
|
+
</ul>
|
|
43
|
+
<h2>Environment and interaction</h2><ul>
|
|
44
|
+
<li><a href="./families/rf.html"><span>RF</span><span class="tag tag-designed">designed</span></a></li>
|
|
45
|
+
<li><a href="./families/sensor.html"><span>Sensor</span><span class="tag tag-planned">planned</span></a></li>
|
|
46
|
+
<li><a href="./families/signature.html"><span>Signature</span><span class="tag tag-planned">planned</span></a></li>
|
|
47
|
+
<li><a href="./families/environment.html"><span>Environment</span><span class="tag tag-planned">planned</span></a></li>
|
|
48
|
+
<li><a href="./families/obstruction.html"><span>Obstruction</span><span class="tag tag-designed">designed</span></a></li>
|
|
49
|
+
</ul>
|
|
50
|
+
<h2>Event physics</h2><ul>
|
|
51
|
+
<li><a href="./families/breakup.html"><span>Breakup</span><span class="tag tag-planned">planned</span></a></li>
|
|
52
|
+
<li><a href="./families/reentry.html"><span>Reentry</span><span class="tag tag-planned">planned</span></a></li>
|
|
53
|
+
<li><a href="./families/conjunction.html"><span>Conjunction</span><span class="tag tag-designed">designed</span></a></li>
|
|
54
|
+
<li><a href="./families/effects.html"><span>Effects</span><span class="tag tag-planned">planned</span></a></li>
|
|
55
|
+
</ul>
|
|
56
|
+
<h2>Estimation, data and logic</h2><ul>
|
|
57
|
+
<li><a href="./families/estimation.html"><span>Estimation</span><span class="tag tag-experimental">experimental</span></a></li>
|
|
58
|
+
<li><a href="./families/data-source.html"><span>Data source</span><span class="tag tag-shipped">shipped</span></a></li>
|
|
59
|
+
<li><a href="./families/analytics.html"><span>Analytics</span><span class="tag tag-experimental">experimental</span></a></li>
|
|
60
|
+
<li><a href="./families/scheduler.html"><span>Scheduler</span><span class="tag tag-planned">planned</span></a></li>
|
|
61
|
+
<li><a href="./families/behavior.html"><span>Behavior</span><span class="tag tag-planned">planned</span></a></li>
|
|
62
|
+
</ul>
|
|
63
|
+
<h2>Runtime contract</h2><ul>
|
|
64
|
+
<li><a href="./events-abi.html"><span>Event locator ABI</span></a></li>
|
|
65
|
+
<li><a href="./module-publication-standard.html"><span>Module publication standard</span></a></li>
|
|
66
|
+
<li><a href="./browser-wasmedge-isomorphic.html" aria-current="page"><span>Browser / WasmEdge isomorphism</span></a></li>
|
|
67
|
+
<li><a href="./isomorphic-pthreads.html"><span>Isomorphic pthreads</span></a></li>
|
|
68
|
+
<li><a href="./tri-runtime-parity.html"><span>Tri-runtime parity</span></a></li>
|
|
69
|
+
<li><a href="./tri-runtime-parity-gate.html"><span>Tri-runtime parity gate</span></a></li>
|
|
70
|
+
<li><a href="./testing-harness.html"><span>Testing harness</span></a></li>
|
|
71
|
+
<li><a href="./language-runtime-matrix.html"><span>Language and runtime matrix</span></a></li>
|
|
72
|
+
</ul>
|
|
73
|
+
<h2>Host surfaces</h2><ul>
|
|
74
|
+
<li><a href="./flatsql-host-contract.html"><span>FlatSQL host contract</span></a></li>
|
|
75
|
+
<li><a href="./flatsql-streaming-standard.html"><span>FlatSQL streaming standard</span></a></li>
|
|
76
|
+
<li><a href="./secrets-capability.html"><span>Credential lanes</span></a></li>
|
|
77
|
+
<li><a href="./protocol-installation.html"><span>Protocol installation</span></a></li>
|
|
78
|
+
<li><a href="./gpu-module-abi.html"><span>GPU module ABI</span></a></li>
|
|
79
|
+
<li><a href="./module-bundle-runtime-plan.html"><span>Module bundle runtime</span></a></li>
|
|
80
|
+
<li><a href="./isomorphic-sdn-runtime-plan.html"><span>Isomorphic SDN runtime</span></a></li>
|
|
81
|
+
<li><a href="./node-red-default-node-parity.html"><span>Node-RED node parity</span></a></li>
|
|
82
|
+
</ul>
|
|
83
|
+
</nav>
|
|
84
|
+
<main class="doc" id="main">
|
|
85
|
+
<h1>Browser / WasmEdge isomorphism</h1>
|
|
86
|
+
<p>Use this profile when you want one compiled <code>.wasm</code> artifact that can be loaded unchanged in:</p>
|
|
87
|
+
<ul>
|
|
88
|
+
<li>the browser harness</li>
|
|
89
|
+
<li>the WasmEdge command/runtime harness</li>
|
|
90
|
+
</ul>
|
|
91
|
+
<h2 id="canonical-build-rule"><a class="anchor" href="#canonical-build-rule" aria-hidden="true">#</a>Canonical Build Rule</h2>
|
|
92
|
+
<p>Declare:</p>
|
|
93
|
+
<div class="codeblock"><div class="codeblock-head">json</div><pre><code>{
|
|
94
|
+
"runtimeTargets": ["browser", "wasmedge"]
|
|
95
|
+
}</code></pre></div>
|
|
96
|
+
<p>That target pair now defaults to the shared <code>single-thread</code> artifact profile.</p>
|
|
97
|
+
<p>The compiler logic lives in <code>src/compiler/compileModule.js</code>.</p>
|
|
98
|
+
<p>The practical effect is:</p>
|
|
99
|
+
<ul>
|
|
100
|
+
<li><code>["wasmedge"]</code> keeps the higher-capability WasmEdge pthread default</li>
|
|
101
|
+
<li><code>["browser", "wasmedge"]</code> chooses the portable single-thread artifact instead</li>
|
|
102
|
+
</ul>
|
|
103
|
+
<p>Use the pure <code>["wasmedge"]</code> target when you want maximum WasmEdge-native guest capability and do not need browser loading from the same binary.</p>
|
|
104
|
+
<h3 id="pthreads-variant-shared-memory-isomorphic-threading"><a class="anchor" href="#pthreads-variant-shared-memory-isomorphic-threading" aria-hidden="true">#</a>Pthreads variant (shared-memory, isomorphic threading)</h3>
|
|
105
|
+
<p>When a module needs real guest threads (the <code>emscripten-pthreads</code> thread model, default for <code>["wasmedge"]</code>), the SDK compiles it through the <strong>wasi-threads</strong> toolchain (<code>clang --target=wasm32-wasip1-threads -pthread</code>), <strong>not</strong> Emscripten <code>-pthread</code> (which emits a browser-only Web-Worker build that cannot thread under WasmEdge). It <strong>enforces</strong> the wasi-threads link flags and <strong>validates the emitted <code>.wasm</code></strong> — the artifact must import <code>wasi.thread-spawn</code>, export <code>wasi_thread_start</code>, be a shared-memory/atomics wasm, and carry no Emscripten worker hooks, or the compile is rejected. That guardrail is documented in <a href="./isomorphic-pthreads.html"><code>docs/isomorphic-pthreads.md</code></a>. This present document covers the portable <code>single-thread</code> loading profile; read the pthreads doc before shipping a threaded WasmEdge artifact.</p>
|
|
106
|
+
<h2 id="cross-origin-isolation-is-required-for-any-wasi-threadswasi-sequential-guest"><a class="anchor" href="#cross-origin-isolation-is-required-for-any-wasi-threadswasi-sequential-guest" aria-hidden="true">#</a>Cross-Origin Isolation Is Required For Any wasi-threads/wasi-sequential Guest</h2>
|
|
107
|
+
<p><strong>Settled policy</strong> (<code>module-sdk-target-forces-sab-coop-coep</code>, arbitrated 2026-07-28, closed 2026-08-06): a host serving a module built through the <code>wasm32-wasip1-threads</code> toolchain — the <code>emscripten-pthreads</code> (real threading) model <strong>or</strong> the <code>wasi-sequential</code> model — to a browser MUST serve that page cross-origin isolated (<code>Cross-Origin-Opener-Policy: same-origin</code> + <code>Cross-Origin-Embedder-Policy: require-corp</code>, or the equivalent). There is no build-flag escape hatch:</p>
|
|
108
|
+
<ul>
|
|
109
|
+
<li><code>--target=wasm32-wasip1-threads</code> with <strong>zero</strong> feature flags still emits <code>+atomics</code> — the triple implies atomics.</li>
|
|
110
|
+
<li>A driver-default link on that triple declares a <strong>shared</strong> memory (limits flags <code>0x03</code>) with no <code>--shared-memory</code>/<code>--import-memory</code> on the link line.</li>
|
|
111
|
+
<li><code>--no-shared-memory</code> is not a wasm-ld flag. Nothing in <code>compileModule.js</code> can produce an unshared artifact on this triple. See the guardrail chain in <code>src/compiler/pthreadArtifactGuard.js</code> (<code>assertSequentialArtifact</code>) and <a href="./isomorphic-pthreads.html"><code>docs/isomorphic-pthreads.md</code></a>.</li>
|
|
112
|
+
</ul>
|
|
113
|
+
<p>This means an inherently-sequential guest (<code>wasi-sequential</code>, no real threading) still needs a shared-memory instantiation — same as a real threaded guest — because it shares the same compiled triple. The portable <strong><code>single-thread</code></strong> profile this document otherwise covers (Emscripten/ emception, the <code>["browser"]</code> / <code>["browser","wasmedge"]</code> default: no shared memory, no atomics) is the one exception and needs <strong>no</strong> cross-origin isolation. Check which profile a guest actually uses — <code>runtimeTargets</code> alone does not tell you; an explicit <code>threadModel</code> does — before assuming either way.</p>
|
|
114
|
+
<p><strong>How production achieves it today</strong> (both patterns are live and <code>crossOriginIsolated</code>-verified, not hypothetical):</p>
|
|
115
|
+
<ol>
|
|
116
|
+
<li><strong>Native headers</strong>, when the host directly fronts the origin (e.g. a Caddy-fronted droplet): set <code>Cross-Origin-Opener-Policy: same-origin</code> and <code>Cross-Origin-Embedder-Policy: require-corp</code> at the web server, which survives a CDN in front of it.</li>
|
|
117
|
+
<li><strong>A COI service worker</strong>, when the host is a static CDN that cannot set custom response headers (GitHub Pages is the concrete case: Pages sends no COOP/COEP at all). The worker intercepts navigation/asset fetches and re-serves them with the isolation headers injected, then the page does one capped self-heal reload. Reference implementation: <code>coi-serviceworker.js</code> + <code>coi-bootstrap.js</code> in the <code>spaceaware-ui</code> (<code>sdn-js</code>) and OrbPro Pages surfaces — verified live via <code>window.crossOriginIsolated === true</code> and <code>typeof SharedArrayBuffer !== "undefined"</code> in a real browser, per <code>deployment/topology.json</code>. Do not invent a second shim; port that one.</li>
|
|
118
|
+
</ol>
|
|
119
|
+
<p>Either path additionally constrains <strong>every other subresource</strong> the page loads to be CORP/CORS-clean under <code>require-corp</code> — third-party embeds, fonts, tiles, imagery all have to cooperate. This is exactly the surface the standing "node UIs load ZERO external-origin bytes" law removes as a concern for the surfaces that already follow it; a new module-serving surface that does NOT yet follow that law has to solve subresource compatibility separately, before COI, not after.</p>
|
|
120
|
+
<p><strong>The guardrail, concretely</strong>: verify <code>crossOriginIsolated</code>/<code>SharedArrayBuffer</code> with a real browser (<code>live-verify.mjs</code>-style, not a raw <code>curl -I</code> — a service-worker-injected header is invisible to a plain HTTP request) as part of standing up ANY new surface that serves a <code>wasi-threads</code>/<code>wasi-sequential</code> artifact, before assuming module instantiation works. A silent regression here fails as an instantiation error in the browser console, not a build error — there is currently no automated CI check for it; add one alongside the new surface's own verify tooling rather than assuming this document is enough.</p>
|
|
121
|
+
<h2 id="canonical-module-repo-layout"><a class="anchor" href="#canonical-module-repo-layout" aria-hidden="true">#</a>Canonical Module Repo Layout</h2>
|
|
122
|
+
<p>Module repos should publish the shared compiled artifact under a stable runtime path, not a plugin-named filename:</p>
|
|
123
|
+
<ul>
|
|
124
|
+
<li>required: <code>dist/isomorphic/module.wasm</code></li>
|
|
125
|
+
</ul>
|
|
126
|
+
<p>If a repo also ships a browser-specific adapter, place it under:</p>
|
|
127
|
+
<ul>
|
|
128
|
+
<li>optional: <code>dist/browser/module.js</code></li>
|
|
129
|
+
<li>optional: <code>dist/browser/module.wasm</code></li>
|
|
130
|
+
</ul>
|
|
131
|
+
<p>That keeps the artifact name stable across repos and lets runtime intent live in the path rather than in the filename.</p>
|
|
132
|
+
<h2 id="toolchain-options"><a class="anchor" href="#toolchain-options" aria-hidden="true">#</a>Toolchain Options</h2>
|
|
133
|
+
<p>The recommended browser-side build selector for module repos is:</p>
|
|
134
|
+
<ul>
|
|
135
|
+
<li><code>SDN_WASM_TOOLCHAIN=local-emsdk</code>: default. Build with a repo-local <code>deps/emsdk</code> checkout and avoid Homebrew or any other machine-global Emscripten install.</li>
|
|
136
|
+
<li><code>SDN_WASM_TOOLCHAIN=sdn-emception</code>: optional SDK-first path for repos that use <code>compileModuleFromSource(...)</code> or an SDK-driven build script to emit the shared <code>dist/isomorphic/module.wasm</code> artifact.</li>
|
|
137
|
+
<li><code>SDN_WASM_TOOLCHAIN=path</code>: explicit escape hatch when a repo intentionally wants to use a preinstalled Emscripten toolchain from <code>PATH</code>.</li>
|
|
138
|
+
</ul>
|
|
139
|
+
<p>The isomorphic contract is the compiled wasm path, not the browser wrapper. A repo can publish only <code>dist/isomorphic/module.wasm</code> and still satisfy the browser/WasmEdge shared-artifact requirement when it loads through the SDK harnesses.</p>
|
|
140
|
+
<h2 id="loader-entry-points"><a class="anchor" href="#loader-entry-points" aria-hidden="true">#</a>Loader Entry Points</h2>
|
|
141
|
+
<p>The supported browser/WasmEdge entry points are:</p>
|
|
142
|
+
<ul>
|
|
143
|
+
<li>browser entry bundle: <code>src/browser.js</code></li>
|
|
144
|
+
<li>isomorphic loader: <code>src/host/isomorphicLoader.js</code></li>
|
|
145
|
+
<li>browser harness: <code>src/host/browserModuleHarness.js</code></li>
|
|
146
|
+
<li>browser WASI shim: <code>src/host/wasiShim.js</code></li>
|
|
147
|
+
<li>browser edge shims: <code>src/host/browserEdgeShims.js</code></li>
|
|
148
|
+
<li>browser host adapter: <code>src/host/browserHost.js</code></li>
|
|
149
|
+
</ul>
|
|
150
|
+
<p>On the server path, <code>loadModule(...)</code> now chooses the raw WasmEdge command harness automatically for standalone artifacts with <code>_start</code>. The <code>--serve-plugin-invoke</code> runner protocol remains available for explicit runtime-host / runner-backed flows.</p>
|
|
151
|
+
<h2 id="what-the-browser-shims-cover"><a class="anchor" href="#what-the-browser-shims-cover" aria-hidden="true">#</a>What The Browser Shims Cover</h2>
|
|
152
|
+
<p>The browser edge shims map host capabilities onto browser-native surfaces:</p>
|
|
153
|
+
<ul>
|
|
154
|
+
<li><code>filesystem</code>: in-memory virtual filesystem with <code>resolvePath</code>, <code>readFile</code>, <code>writeFile</code>, <code>appendFile</code>, <code>deleteFile</code>, <code>mkdir</code>, <code>readdir</code>, <code>stat</code>, <code>rename</code></li>
|
|
155
|
+
<li><code>http</code>: <code>fetch</code></li>
|
|
156
|
+
<li><code>websocket</code>: browser <code>WebSocket</code></li>
|
|
157
|
+
<li><code>network</code>: async browser-host dispatch that routes to the available transport adapters</li>
|
|
158
|
+
<li><code>ipfs</code>, <code>protocol_handle</code>, <code>protocol_dial</code>: async browser-host adapters that can be supplied by the embedding runtime</li>
|
|
159
|
+
<li><code>clock</code>, <code>random</code>, <code>timers</code>, <code>schedule_cron</code>, <code>context_*</code>, <code>crypto_*</code>: browser-native implementations in the browser host adapter</li>
|
|
160
|
+
</ul>
|
|
161
|
+
<p>These are host shims, not raw WasmEdge socket imports. When an embedding host needs to override the reference behavior, pass <code>capabilityAdapters</code> keyed by the canonical capability ids. That same generic async capability boundary is shared by <code>BrowserHost</code>, <code>NodeHost</code>, <code>createRuntimeHost()</code>, <code>loadModule(...)</code>, and <code>createBrowserModuleHarness(...)</code>.</p>
|
|
162
|
+
<h2 id="current-boundary"><a class="anchor" href="#current-boundary" aria-hidden="true">#</a>Current Boundary</h2>
|
|
163
|
+
<p>One binary can load in both browser and WasmEdge today when it stays within the shared profile:</p>
|
|
164
|
+
<ul>
|
|
165
|
+
<li>standalone WASI imports</li>
|
|
166
|
+
<li>optional sync <code>space_data_module_host</code> imports</li>
|
|
167
|
+
<li>command invoke surfaces through <code>_start</code> on WasmEdge and direct or command invoke surfaces in the browser harness</li>
|
|
168
|
+
<li>no Emscripten pthread imports</li>
|
|
169
|
+
</ul>
|
|
170
|
+
<p>Not browser-portable from the same raw guest binary:</p>
|
|
171
|
+
<ul>
|
|
172
|
+
<li>WasmEdge-native socket/TLS extension imports</li>
|
|
173
|
+
<li>pthread-oriented <code>env.*</code> imports</li>
|
|
174
|
+
<li>raw guest async hostcalls that need a broader ABI than the current sync <code>space_data_module_host</code> bridge</li>
|
|
175
|
+
</ul>
|
|
176
|
+
<p>Today’s portable split is:</p>
|
|
177
|
+
<ul>
|
|
178
|
+
<li>the guest-visible <code>space_data_module_host</code> import remains a sync-only subset for sync-safe operations</li>
|
|
179
|
+
<li>the host and harness APIs can still await filesystem, network, IPFS, and protocol adapters through the generic async capability boundary in both browser and Node-hosted test/runtime flows</li>
|
|
180
|
+
</ul>
|
|
181
|
+
<p>For browser-hosted networking and IPFS/protocol work, use the browser edge shims or host-delegated adapters instead of relying on raw WasmEdge socket extensions.</p>
|
|
182
|
+
<h2 id="checked-in-demo"><a class="anchor" href="#checked-in-demo" aria-hidden="true">#</a>Checked-In Demo</h2>
|
|
183
|
+
<p>The canonical example is:</p>
|
|
184
|
+
<ul>
|
|
185
|
+
<li><code>examples/isomorphic-loader/README.md</code></li>
|
|
186
|
+
</ul>
|
|
187
|
+
<p>That example includes:</p>
|
|
188
|
+
<ul>
|
|
189
|
+
<li>manifest: <code>examples/isomorphic-loader/manifest.json</code></li>
|
|
190
|
+
<li>guest source: <code>examples/isomorphic-loader/module.c</code></li>
|
|
191
|
+
<li>build script: <code>examples/isomorphic-loader/build-demo.mjs</code></li>
|
|
192
|
+
<li>browser loader: <code>examples/isomorphic-loader/browser-demo.mjs</code></li>
|
|
193
|
+
<li>browser page: <code>examples/isomorphic-loader/browser-demo.html</code></li>
|
|
194
|
+
<li>WasmEdge loader: <code>examples/isomorphic-loader/wasmedge-demo.mjs</code></li>
|
|
195
|
+
</ul>
|
|
196
|
+
<p>Both demos load the same generated artifact:</p>
|
|
197
|
+
<ul>
|
|
198
|
+
<li><code>examples/isomorphic-loader/generated/dist/isomorphic/module.wasm</code></li>
|
|
199
|
+
</ul>
|
|
200
|
+
<h2 id="streaming-into-the-same-artifact"><a class="anchor" href="#streaming-into-the-same-artifact" aria-hidden="true">#</a>Streaming Into The Same Artifact</h2>
|
|
201
|
+
<p>If that shared artifact owns resident state, such as an SDN module that imports <code>flatsql</code> internally, stream raw FlatBuffer frames into the live instance with <code>createModuleFlatBufferStreamPump(...)</code>.</p>
|
|
202
|
+
<p>Use:</p>
|
|
203
|
+
<ul>
|
|
204
|
+
<li>a persistent <code>direct</code> browser harness for browser-resident state</li>
|
|
205
|
+
<li>a persistent runtime-backed harness on the server/WasmEdge side</li>
|
|
206
|
+
<li>chunked size-prefixed FlatBuffer stream input</li>
|
|
207
|
+
<li>many small invokes, not one monolithic invoke envelope</li>
|
|
208
|
+
</ul>
|
|
209
|
+
<p>That path is documented in <code>docs/flatsql-streaming-standard.md</code>.</p>
|
|
210
|
+
|
|
211
|
+
<p class="doc-footer">
|
|
212
|
+
Source of truth for this page:
|
|
213
|
+
<code>docs/browser-wasmedge-isomorphic.md</code>. Regenerate with
|
|
214
|
+
<code>npm run build:docs</code>.
|
|
215
|
+
</p>
|
|
216
|
+
</main>
|
|
217
|
+
<nav class="rail" aria-label="On this page"><h2>On this page</h2><ul><li><a class="depth-2" href="#canonical-build-rule">Canonical Build Rule</a></li>
|
|
218
|
+
<li><a class="depth-3" href="#pthreads-variant-shared-memory-isomorphic-threading">Pthreads variant (shared-memory, isomorphic threading)</a></li>
|
|
219
|
+
<li><a class="depth-2" href="#cross-origin-isolation-is-required-for-any-wasi-threadswasi-sequential-guest">Cross-Origin Isolation Is Required For Any wasi-threads/wasi-sequential Guest</a></li>
|
|
220
|
+
<li><a class="depth-2" href="#canonical-module-repo-layout">Canonical Module Repo Layout</a></li>
|
|
221
|
+
<li><a class="depth-2" href="#toolchain-options">Toolchain Options</a></li>
|
|
222
|
+
<li><a class="depth-2" href="#loader-entry-points">Loader Entry Points</a></li>
|
|
223
|
+
<li><a class="depth-2" href="#what-the-browser-shims-cover">What The Browser Shims Cover</a></li>
|
|
224
|
+
<li><a class="depth-2" href="#current-boundary">Current Boundary</a></li>
|
|
225
|
+
<li><a class="depth-2" href="#checked-in-demo">Checked-In Demo</a></li>
|
|
226
|
+
<li><a class="depth-2" href="#streaming-into-the-same-artifact">Streaming Into The Same Artifact</a></li></ul></nav>
|
|
227
|
+
</div>
|
|
228
|
+
<section id="stack" class="section" aria-labelledby="stack-title">
|
|
229
|
+
<div class="section-head">
|
|
230
|
+
<p class="eyebrow">SDN Stack</p>
|
|
231
|
+
<h2 id="stack-title">Connected sites</h2>
|
|
232
|
+
</div>
|
|
233
|
+
<div class="link-list">
|
|
234
|
+
<a href="https://spacedatastandards.org/">
|
|
235
|
+
<span>Standards</span>
|
|
236
|
+
<small>Canonical schemas, record contracts, and generated bindings.</small>
|
|
237
|
+
</a>
|
|
238
|
+
<a href="https://digitalarsenal.github.io/flatbuffers/">
|
|
239
|
+
<span>FlatBuffers</span>
|
|
240
|
+
<small>Binary encoding, schema tooling, and runtime documentation.</small>
|
|
241
|
+
</a>
|
|
242
|
+
<a href="https://digitalarsenal.github.io/flatsql/">
|
|
243
|
+
<span>FlatSQL</span>
|
|
244
|
+
<small>SQL-style queries over FlatBuffer-backed datasets and streams.</small>
|
|
245
|
+
</a>
|
|
246
|
+
<a href="https://spacedatanetwork.org/">
|
|
247
|
+
<span>SDN</span>
|
|
248
|
+
<small>Distributed publication, discovery, delivery, and marketplace infrastructure.</small>
|
|
249
|
+
</a>
|
|
250
|
+
<a href="https://digitalarsenal.github.io/space-data-module-sdk/" class="active">
|
|
251
|
+
<span>Module SDK</span>
|
|
252
|
+
<small>WASM module packaging, validation, and host compatibility tooling.</small>
|
|
253
|
+
</a>
|
|
254
|
+
</div>
|
|
255
|
+
</section>
|
|
256
|
+
<footer class="site-footer">
|
|
257
|
+
Space Data Module SDK — Apache-2.0. Every ABI page renders a Markdown
|
|
258
|
+
source in <code>docs/</code>; edit the Markdown, never the HTML.
|
|
259
|
+
</footer>
|
|
260
|
+
</body>
|
|
261
|
+
</html>
|