Skip to content

Conformance: jco targets blocked on upstream jco defects in composed p3 stream/future paths #28

Description

@lann

The conformance suite's jco legs (Node, browser) cannot run yet: transpiling the composed artifact (suite ⊕ polymorph:tls component) trips two defects in jco's p3 support, verified against the latest lann/jco fork build (jco-transpile-0.6.2-fa6990d, the pin the websocket sibling uses), Node 24.18, --experimental-wasm-jspi.

1. TDZ emission-order defect (shallow). With instantiation: "async", the generated module references the future.transfer trampoline inside _initGenerator before its const declaration is emitted:

ReferenceError: Cannot access 'trampoline92' before initialization

The matching stream.transfer trampoline (trampoline91 = streamTransfer) is emitted before its use; the future one lands after. Hoisting the declaration by hand gets past instantiation.

2. Missing current-task context in streamTransfer (deep). With 1 patched, the run proceeds — sync and async calls across the composed boundary work (identity.ed25519 rejection and the async identity.delegated failure both complete) — until the first p3 stream is passed across the composed wasm↔wasm boundary (connector.send), called from a detached-task continuation inside the component:

Error: missing global current task globalTaskMeta
    at streamTransfer (...)
    at ... connector.send
    at ... wit_bindgen::rt::async_support::FutureState::callback

The scheduler does not establish the current-task global when an async-lifted export's continuation (wit-bindgen 0.60 FutureState::callback) invokes a stream intrinsic. This is the composed-shape variant the websocket sibling's suite never exercises: there the p3 streams cross wasm↔JS (the suite is transpiled un-composed, the SUT is a JS host module), while here two components are fused by wac plug first. Same defect class as the scheduler issue blocking component-iroh's jco endpoint leg (lann/jco#11).

Repro: just build-wasm, wac plug --plug target/wasm32-wasip2/debug/polymorph_tls_component.wasm target/wasm32-wasip2/debug/tls_loopback.wasm -o tls-composed.wasm (any rev before the conformance cutover; after it, compose the suite per conformance/driver-ct/justfile), transpile with the fork at instantiation: "async", bind the preview2-shim wasi 0.2 imports, and call the exported async run. Under wasmtime 47 (-W component-model-async=y) the same artifact passes.

What unblocks: both defects fixed upstream (the first is mechanical; the second is scheduler work). When they land, add jco-node (and a browser leg behind the CI/CONFORMANCE_BROWSER=1 predicate, optional = true) to conformance/driver-ct/targets.toml and a driver mirroring the websocket sibling's conformance/driver-ct/jco/ (upstream @polymorph/component-test-js harness core, fresh instance per case, results JSONL into the same aggregate).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions