Skip to content

Support WASI TCP, UDP and DNS with bounded cancellable resources - #484

Merged
ymote merged 1 commit into
mainfrom
feat/wasi-sockets
Oct 11, 2026
Merged

ymote merged 1 commit into
mainfrom
feat/wasi-sockets

Conversation

@ymote

@ymote ymote commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Apps built for wasm32-wasip2 could use HTTP but ordinary std::net TCP, UDP and DNS imports were refused. This adds those standard WASI interfaces and advertises wasm.sockets@1, so compatible apps can install while RC5 remains able to read the catalog and marks them unavailable.

The runtime shares 32 socket/DNS handles across an app's components, caps each component's host resource table at 512 entries, and bounds native DNS work to eight concurrent resolvers with no queue. Blocking waits and stream destruction observe cancellation/deadlines; native DNS retains its permit until the OS resolver actually finishes. The shell releases workers when their last owning isolate closes and propagates cancellation through component host-service calls.

Network declarations remain disclosures. This does not add privileged raw IP sockets or remove storage, account, OS consent or reviewed-write boundaries. English/Chinese guides and ADR 0014 describe the new boundary and the unreleased/RC5 distinction.

Dependencies and developer tooling:

  • App Hub #209, pinned at c317f787: admission/availability and request-generation isolation after close/reopen.
  • App Flow #187: automatic compatibility declaration, real TCP/UDP/DNS example and a diagnostic for the reproduced libc connect export collision.

Validation on host head 29f63d66ffeb87cfef952c85f18c9a97abe89597:

  • Wasm runtime: 54 tests passed (cargo test -p octosense-wasm-host), including actual Wasm TCP/UDP/DNS, listener/accept, per-app limits, cancellation, stream cleanup and native resolver saturation.
  • Shell lifecycle/dispatch: 11 tests passed (cargo test --locked -p octosense-shell --no-default-features --features app-hub,wasm-functions wasm_service::tests). Cold-host compatibility discovery: 1 passed from the same built test executable.
  • Full shell mobile-apps check and desktop/Home packaging check passed (cargo check --locked -p octosense -p octosense-home --features mobile-apps).
  • Repository tool tests: 153 passed; generated native app definitions, dependency source checks and diff/format checks passed.
  • OnePlus 6, A6003 / Android 15 API35: 11/11 standalone runtime/JIT tests passed after desktop validation. Five tests execute real component TCP/UDP echo, localhost DNS, listener/drop, shared quotas/refund, TCP cancellation and UDP deadline; six exercise DNS worker bounds, hostname/literal handling and cancellable host waits/destruction. Total measured execution: 1.795 s. Temporary test binaries and their directory were removed.

Android evidence is from a standalone test runner through ADB, not an installed Home APK or its UID network policy/UI. No published release, public catalog, installed Home, account or user profile was changed. SDK #187's exact final head has all six CI checks green; this PR and App Hub #209 retain their own CI/review requirements before merge.

@ymote

ymote commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

Local CI passed on f576666 (tools/ci-local.sh --only desktop,phone,apps --linux-host --offload, 18m32s, Darwin arm64; the ubuntu jobs and the macOS jobs' portable steps (their macOS steps ran here) on the Linux build host, Linux x86_64).

GitHub would run for this PR: desktop.yml, phone.yml, apps.yml. Merged on this local pass (macOS runner queue); GitHub CI runs on the merge commit on main.

Job Step Result Time
ci-local / drift The local mapping fits the workflows PASS -
desktop.yml / desktop Prepare the pinned framework sources PASS 1s
desktop.yml / desktop Compile the desktop with the shared runtime PASS 6m26s
desktop.yml / desktop Desktop tools and scripts PASS 16s
desktop.yml / desktop (linux) Prepare the pinned framework sources PASS 0s
desktop.yml / desktop (linux) One copy of every shell source PASS -
desktop.yml / desktop (linux) One Makepad, App Hub, octos and Rinx in the locked graph PASS 2s
desktop.yml / desktop (linux) The native apps' generated places match native-apps.json PASS 0s
desktop.yml / native-host-api Prepare the pinned framework sources PASS 1s
desktop.yml / native-host-api Build the native acceptance host and pinned Hub CLI PASS 6m31s
desktop.yml / native-host-api Signed app tool calls a real OS permission API PASS 4s
phone.yml / home Prepare pinned sources and the reviewed runtime patch PASS 1s
phone.yml / home Validate launcher icons and Apple asset catalogs PASS 4s
phone.yml / home (linux) Prepare pinned sources and the reviewed runtime patch PASS 0s
phone.yml / home (linux) Verify the single runtime graph PASS 2s
phone.yml / home (linux) The native apps' generated places match native-apps.json PASS 0s
phone.yml / home (linux) The pinned octos revision PASS 0s
phone.yml / home (linux) Build octos (unless cached) PASS -
phone.yml / home (linux) Build Home, App Hub admission and runtime policy tests PASS 4m38s
phone.yml / home (linux) Test Home, App Hub admission and runtime policy PASS 49s
phone.yml / home (linux) Two-lane scenario (real kernel, scripted model) PASS 28s
phone.yml / home (linux) Build opt-in AppCard tests PASS 2m56s
phone.yml / home (linux) Test opt-in AppCard PASS 2s
phone.yml / home (linux) Build craft-engine relay and system-chat tests PASS 3m08s
phone.yml / home (linux) Test craft-engine relay and system chat PASS 15s
phone.yml / home (linux) Build linked Terminal tests PASS 3m00s
phone.yml / home (linux) Test linked Terminal PASS 1s
phone.yml / home (linux) Build Wasm and runtime policy tests PASS 1m49s
phone.yml / home (linux) Test Wasm and runtime policy PASS 14s
phone.yml / home Compile Home and its bundled modules PASS 5m08s
apps.yml / services (linux) python3 tools/setup.py PASS 0s
apps.yml / services (linux) Shared system app interface PASS 0s
apps.yml / services (linux) Kernel service PASS 34s
apps.yml / services (linux) App peers PASS 42s
apps.yml / services (linux) AI providers config PASS 4s
apps.yml / services (linux) Connected provider protocols and Linux host adapter PASS 1m08s
apps.yml / services (linux) L0 in-card chat (sys.chat, host side) PASS 17s
apps.yml / services (linux) System toolbox (workflow templates) PASS 1m55s
apps.yml / kernel-security (linux) python3 tools/setup.py PASS 0s
apps.yml / kernel-security (linux) The pinned octos revision PASS 0s
apps.yml / kernel-security (linux) Build octos (unless cached) PASS -
apps.yml / kernel-security (linux) Real-kernel tests PASS 1m00s
apps.yml / apps (linux) python3 tools/setup.py PASS 0s
apps.yml / apps (linux) Host services (Mail, AI providers, News) PASS 3m07s
apps.yml / apps (linux) Connected accounts and Rinx editor PASS 1m53s
apps.yml / apps (linux) Shell AI services (crates/ai-host) PASS 3m11s
apps.yml / apps (linux) AppCard runtime setup safeguards PASS 0s
apps.yml / apps (linux) AppCard clippy (own crates; shared runtime compiles) PASS 48s
apps.yml / apps (linux) AppCard transport and store PASS 9s
apps.yml / apps (linux) One Makepad, App Hub, octos and Rinx in the locked graph PASS 6s
linux-host / sandbox (linux) python3 tools/setup.py PASS 0s
linux-host / sandbox (linux) Process sandbox on Linux (Landlock, seccomp) PASS 2m40s

Notes:

  • GitHub runs Python 3.12; this run used Python 3.9.6
  • GitHub runs Python 3.12; the Linux host used Python 3.14.4

Native GitHub acceptance passed on the same head: embedded-browser.yml.

@ymote
ymote merged commit bcd52cf into main Oct 11, 2026
8 of 9 checks passed
ymote added a commit that referenced this pull request Oct 11, 2026
…ew's fixes

ui.py's shell, restart, full and empty runs, in a hidden desktop shell with
the real pdf engine, at the window's own size (an app area of 1292 x 662),
light and dark, just after midnight on 11 Oct; and the fixture run in
card-host at the designs' 1536 x 1024. The frames replace the first round's:
- Read mode, entered on page 2 and left on page 3 at 125%, by the bar's Exit
  read mode (light) and by the corner control (dark).
- Find from the top bar alone: the rail is Pages, Outline and Comments. Done
  gives the Comments panel back; the results' own cross folds the left side
  again.
- Remove deletes a PDF's kept cover after a restart.
- Comment dates read "Today 00:34" at 07:34 UTC.
- Storage, covers, Combine's footer and Edit's Alignment and Colour, as before.

The four runs used --budget-ms 1000. At the runtime's 64 ms, two attempts
passed every functional step of the shell journey, light and dark, and then
failed the log check on script budget overruns. Each overrun came with a
UI-thread stall in a pdf service file rename: 555 ms in pdf.save, then
262 ms in the render cache. App Hub runs host services inline on the UI
thread (#399), and this branch doesn't change those paths. The load average
was 54 to 74 then. run-64ms/ keeps the third attempt's logs and the lines
read from the second's before the third overwrote it. The README and
receipt record this, and the first 1000 ms run, which lost a tap on
Combine's Add files.

The runs were made on 12e0e4cb, on main 07b63da. The branch was then
rebased onto main bcd52cf, which brought in #484 alone (App Hub's pin
moved from d86101d7 to c317f787). The runs were not repeated on it;
setup.py --check --cargo, native_apps.py --check and the pdf service's tests
pass on it.

The app README's Verified and Known entries say the same, in English and
Chinese.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ymote added a commit that referenced this pull request Oct 11, 2026
…ew's fixes

ui.py's shell, restart, full and empty runs, in a hidden desktop shell with
the real pdf engine, at the window's own size (an app area of 1292 x 662),
light and dark, just after midnight on 11 Oct; and the fixture run in
card-host at the designs' 1536 x 1024. The frames replace the first round's:
- Read mode, entered on page 2 and left on page 3 at 125%, by the bar's Exit
  read mode (light) and by the corner control (dark).
- Find from the top bar alone: the rail is Pages, Outline and Comments. Done
  gives the Comments panel back; the results' own cross folds the left side
  again.
- Remove deletes a PDF's kept cover after a restart.
- Comment dates read "Today 00:34" at 07:34 UTC.
- Storage, covers, Combine's footer and Edit's Alignment and Colour, as before.

The four runs used --budget-ms 1000. At the runtime's 64 ms, two attempts
passed every functional step of the shell journey, light and dark, and then
failed the log check on script budget overruns. Each overrun came with a
UI-thread stall in a pdf service file rename: 555 ms in pdf.save, then
262 ms in the render cache. App Hub runs host services inline on the UI
thread (#399), and this branch doesn't change those paths. The load average
was 54 to 74 then. run-64ms/ keeps the third attempt's logs and the lines
read from the second's before the third overwrote it. The README and
receipt record this, and the first 1000 ms run, which lost a tap on
Combine's Add files.

The runs were made on 12e0e4cb, on main 07b63da. The branch was then
rebased onto main bcd52cf, which brought in #484 alone (App Hub's pin
moved from d86101d7 to c317f787). The runs were not repeated on it;
setup.py --check --cargo, native_apps.py --check and the pdf service's tests
pass on it.

The app README's Verified and Known entries say the same, in English and
Chinese.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ymote added a commit that referenced this pull request Oct 11, 2026
…ew's fixes

ui.py's shell, restart, full and empty runs, in a hidden desktop shell with
the real pdf engine, at the window's own size (an app area of 1292 x 662),
light and dark, just after midnight on 11 Oct; and the fixture run in
card-host at the designs' 1536 x 1024. The frames replace the first round's:
- Read mode, entered on page 2 and left on page 3 at 125%, by the bar's Exit
  read mode (light) and by the corner control (dark).
- Find from the top bar alone: the rail is Pages, Outline and Comments. Done
  gives the Comments panel back; the results' own cross folds the left side
  again.
- Remove deletes a PDF's kept cover after a restart.
- Comment dates read "Today 00:34" at 07:34 UTC.
- Storage, covers, Combine's footer and Edit's Alignment and Colour, as before.

The four runs used --budget-ms 1000. At the runtime's 64 ms, two attempts
passed every functional step of the shell journey, light and dark, and then
failed the log check on script budget overruns. Each overrun came with a
UI-thread stall in a pdf service file rename: 555 ms in pdf.save, then
262 ms in the render cache. App Hub runs host services inline on the UI
thread (#399), and this branch doesn't change those paths. The load average
was 54 to 74 then. run-64ms/ keeps the third attempt's logs and the lines
read from the second's before the third overwrote it. The README and
receipt record this, and the first 1000 ms run, which lost a tap on
Combine's Add files.

The runs were made on 12e0e4cb, on main 07b63da. The branch was then
rebased onto main bcd52cf, which brought in #484 alone (App Hub's pin
moved from d86101d7 to c317f787). The runs were not repeated on it;
setup.py --check --cargo, native_apps.py --check and the pdf service's tests
pass on it.

The app README's Verified and Known entries say the same, in English and
Chinese.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant