Skip to content

#18 tls smoke: polymorph-tls conformance under deltic + 3 runtime fixes - #26

Merged
lann merged 2 commits into
mainfrom
tls-smoke
Aug 9, 2026
Merged

#18 tls smoke: polymorph-tls conformance under deltic + 3 runtime fixes#26
lann merged 2 commits into
mainfrom
tls-smoke

Conversation

@lann

@lann lann commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Closes #18.

tools/smoke-tls/run.ts — translate-only over all 8 prebuilt polymorph-tls artifacts (8/8 accepted, import surfaces pure WASI) and full execution of the three suite compositions via ct-runner + wasi-shims, with named-xfail + stale-xfail discipline. Wired into the AGENTS.md gate list.

Three runtime defects found and fixed (pins in runtime/tests/tls_smoke_pins_test.ts; details in the commit message):

  1. cycle-unsafe structural ValType equality (C2-D's siblings: sameElemType + eager JSON.stringify diagnostics in lowerStream/lowerFuture)
  2. ResourceTypeInfo identity minted per resource-table instead of per ResourceIndex → FACT stream/future transfers trapped "destination element mismatch" in wac-composed components
  3. transfer-borrow refused outside a sync-call bracket → new FactStartScope window for the prepare/start protocol, per definitions.py lift_borrow/lower_borrow/deliver_resolve

4 official-suite xfails went green and are pruned (lane totals 1254/95; webkit updated arithmetically — post-merge lane confirms). Residues filed: #24 (callback null-context-slot on the webcrypto-composed target), #25 (ct-runner tag gating).

Gates: runtime + harness across seeds {unset,1,4242}, sm-pinned, chromium + firefox lanes, websocket 55/55, webcrypto, webrtc, iroh exam 5/5, cargo.

…ime defects it exposed

The polymorph-tls suite (the one family member never examined) is the first
corpus with resource-bearing stream/future payloads and borrow-carrying
composed calls through FACT prepare/start adapters. tools/smoke-tls runs it:
translate-only over all 8 prebuilt artifacts (8/8 accepted) plus full
execution of the three suite compositions via ct-runner + wasi-shims.
Peeling the onion surfaced three runtime defects, each with fail-on-pre-fix
pins (runtime/tests/tls_smoke_pins_test.ts):

1. Structural ValType equality JSON.stringify'd resource-bearing types
   (cycle via ResourceTypeInfo.impl -> live handle tables) — the C2-D
   task.return fix had two unfixed siblings: task/streams.ts sameElemType,
   and lowerStream/lowerFuture's EAGERLY-evaluated diagnostic strings
   (thrown even on the success path). The recursive walk moved to
   cabi/types.ts (valTypeEqual) with a cycle-safe fmtValType for messages.

2. ResourceTypeInfo minted per resource-TABLE, not per ResourceIndex —
   exactly the aliasing plan-format.md C2 amendment #1 warns about. In a
   wac-composed component the src/dst future tables of a FACT transfer
   resolve own<R> through different table indices, so identity comparison
   saw two tokens for one resource: "future: destination element mismatch"
   on every resource-bearing element type. Tokens now unify per
   resourceTables[n].resource, matching wasmtime's ResourceIndex-level
   identity (47.0.3 guest_transfer does no runtime element re-check at all).

3. resource.transfer-borrow asserted a sync-call bracket, but the
   prepare/start protocol has none: borrows through [async-start] now get a
   FactStartScope window — numBorrows on the callee Task (checked at
   task.return, definitions.py lower_borrow:1821), lenders on the caller
   Subtask / a sync scope released at resolve delivery (lift_borrow:1517,
   Subtask.deliver_resolve:904).

The fixes turn 4 official-suite xfails green (async/drop-cross-task-borrow
:305,307; async/passing-resources:175,176) — pruned, lane expectation totals
1250/99 -> 1254/95 (webkit updated arithmetically; not runnable on this
host, post-merge lane is the check).

Suite status under deltic: all applicable cases green on every composition.
Named xfail residues, tracked: ct-runner tag-gating gap (#25, e.g.
delegated/decline is !delegated-signer-tagged N/A on delegated targets) and
a callback-invoked-with-null-context-slot scheduler defect on the
webcrypto-composed target only (#24, wit-bindgen async_support.rs:578).

Gates: runtime 323/323 (seeds unset/1/4242), harness 69/69 (x3 seeds),
sm-pinned + chromium + firefox lanes, websocket 55/55, webcrypto 31,
webrtc 9, iroh exam 5/5, cargo tests. smoke-tls itself PASSes across seeds.
@lann
lann enabled auto-merge (squash) August 9, 2026 19:43
@lann
lann disabled auto-merge August 9, 2026 19:46
@lann
lann merged commit 23aafd5 into main Aug 9, 2026
4 checks passed
@lannbot
lannbot deleted the tls-smoke branch August 23, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

polymorph-tls: smoke the jco-leg surface under deltic (unexamined)

1 participant