Space Data Module SDK

Tri-runtime parity

ONE dist/isomorphic/module.wasm, THREE runtimes, IDENTICAL behavior:

  1. browser — real headless Chrome behind COOP/COEP (cross-origin isolated, SAB-capable), running the SDK browser WASI shim. Never jsdom — jsdom masks Illegal-invocation and threading realities.
  2. wasmedge — a native WasmEdge binary, version-locked to the pin.
  3. docker-wasmedge — a pinned Docker WasmEdge container.

Cross-runtime divergence is a P1 SDK defect, never a "platform quirk". "Works in X" is inadmissible as module evidence; module-touching work needs a parity receipt from this harness.

Running

bash
space-data-module parity \
  --wasm ./dist/isomorphic/module.wasm \
  --fixture ./fixtures/parity/sgp4-command.json \
  [--lanes browser,wasmedge,docker-wasmedge] [--json] [--timeout-sec N] \
  [--wasmedge-binary <bin>] [--chrome-binary <bin>] [--docker-platform <p>]

Programmatic API (Node): runParityHarness, diffParityRuns, normalizeParityFixture, loadWasmEdgePin from space-data-module-sdk/testing.

CI wiring in this repo:

The WasmEdge pin: ONE place

src/testing/wasmedgePin.json is the single source of truth:

json
{ "wasmedgeVersion": "0.16.4", "dockerImageRepository": "space-data-module-sdk/parity-wasmedge" }

Host and container WasmEdge versions therefore pin and bump TOGETHER by editing one string. Keep the pin aligned with the node host's embedded runtime (space-data-network scripts/install-wasmedge.sh, currently 0.16.4 — the verified runtime for the libwasmedge atomic-wait fixes).

Determinism contract

Every lane receives EXACTLY the same guest-observable inputs:

Command-surface errors

A non-zero command exit with a well-formed $PIV response on stdout throws PluginInvokeError in both the browser and WasmEdge harnesses. It preserves statusCode, errorCode, errorMessage, exitCode, and the decoded response. All three parity lanes record the same error summary in commandError.

A non-zero guest exit without a response frame throws WasiExitError, with code and guest stderr. Runtime traps remain runtime failures. Exit 0 is unchanged: the response is returned, including a handler-level non-zero statusCode.

Every lane run and report summary carries exitCode (a number, or null when no exit code is available) and commandError (PluginInvokeError.toJSON(), or null). Successful runs have exitCode: 0 and commandError: null.

Fixtures

json
{
  "name": "sgp4-command-parity",
  "threadEnvVar": "SDM_PARITY_THREADS",
  "threadCounts": [1, 2, 4, 8],
  "cases": [
    {
      "id": "ingest-omm",
      "expect": "ok",
      "request": {
        "methodId": "ingest_omm",
        "inputs": [{ "portId": "omm", "payloadFile": "omm-25544.fb",
                     "typeRef": { "schemaName": "orbpro.sds.omm", "fileIdentifier": "$OMM" } }]
      }
    },
    { "id": "malformed-stdin", "stdinUtf8": "not a PIV frame" }
  ]
}

Scope and current limits (v1)