Skip to content

wasm-gui: a WebAssembly Linux desktop (M1–M6) rendered by the native Rust client#104

Open
NathanFlurry wants to merge 655 commits into
mainfrom
wasm-gui-desktop
Open

wasm-gui: a WebAssembly Linux desktop (M1–M6) rendered by the native Rust client#104
NathanFlurry wants to merge 655 commits into
mainfrom
wasm-gui-desktop

Conversation

@NathanFlurry

@NathanFlurry NathanFlurry commented Jun 20, 2026

Copy link
Copy Markdown
Member

Experiment under experiments/wasm-gui/: a graphical Linux desktop built by cross-compiling real, standard X11 software to wasm32-wasip1 with our own toolchain and running it inside the real secure-exec V8 sidecar, rendered by a native Rust app on crates/secure-exec-client (per SPEC §1a: no wasmer / node:wasi / TS client / Command::new in the execute+render path).

What works (all wasm guests in one VM, over host_net AF_UNIX)

  • M1–M5: the standard X.Org window manager twm decorates a real libX11 client window; multi-client compositing. Tests: test-m4b.sh, test-m5-multiclient.sh, test-m5-twm.sh.
  • M6.4 — robust multi-app desktop: twm concurrently manages a real libX11 window and a stock xclock (live analog face), past 30s, 3/3 deterministic. test-m6-desktop.sh. Proof: ~/tmp/gui-progress/m6-desktop-robust.png.
  • M6.1 (input): host-driven input via XTEST reaches a real libX11 client (ButtonPress → window repaints). test-m6-input.sh.
  • M6.2 (fonts): real X core fonts served by the server; libX11 locale DB install so Xt apps build a fontset; Xft stack cross-compiled (expat + fontconfig + libXft).

Core sidecar fixes (benefit all of secure-exec)

  • sync-RPC fairness: net.poll blocked the single service thread up to 50ms, starving other guests; lowered to 3ms so it round-robins.
  • WASM execution budget: long-running guests (the X server) were killed at the 30s default fuel budget; configurable via limits.resources.maxWasmFuel.

Notes

  • Cross-compiled from source: Xvfb, twm, xclock, libX11/libxcb/libXt/libXaw/libXft/fontconfig/freetype/pixman/… (see third_party/, scripts/).
  • The live winit window blit needs a machine with a display to verify (the dev box is headless); the input delivery path is verified headlessly via XTEST.
  • Remaining M6: xterm (needs a kernel-PTY-spawn shim + a wasm shell); then M7 (JWM), M8 (GTK DE). See experiments/wasm-gui/SPEC.md.

@railway-app

railway-app Bot commented Jun 20, 2026

Copy link
Copy Markdown

🚅 Environment secure-exec-pr-104 in rivet-frontend has no services deployed.

@NathanFlurry NathanFlurry force-pushed the wasm-gui-desktop branch 29 times, most recently from 89726df to 172f709 Compare June 21, 2026 04:41
…t (Phase 1)

- SX_SERIAL_LAUNCH=1 boots the Xfce clients strictly one at a time (each gated on becoming active then
  settling for SX_SERIAL_SETTLE_MS, default 12s, with a per-app timeout safety cap), removing the
  concurrent-boot CPU/thread oversubscription that flakily blanked the desktop.
- Measured: 5/5 FULL renders (95-99.9% coverage), ~61s, zero total-black, vs ~1/3 concurrent. Confirms
  concurrency as the flaky-black root; determinism (Phase 1) achieved. See DESKTOP-BOOT-PERF.md.
…r (per-app init dominates); real levers = cap concurrent compile / batch launch / trim dbus sleeps
…t 94% idle (1.17/20 cores); serialized not blocked; concurrency is the speed win, compile-burst is the flakiness
@NathanFlurry NathanFlurry force-pushed the wasm-gui-desktop branch 22 times, most recently from 6636753 to 7a09801 Compare July 4, 2026 02:09
…sure-boot harness (RECV_OFFBROKER, RPC_BLOCK_US, DEADLINE_PROBE, POLLWAITPROF, POLL_TRACE, HOPPROF, RPC_PROFILE, TEE_GUEST_STDERR, SX_SERIAL_SETTLE_MS, SX_READY_GATE, POLL_MAX_WAIT_MS, INLINE_SOCKET_DATA)
…were launched twice (second dbusd collides on the bound socket); unblocks the concurrent launch-gate livelock (all 5 xclients launch vs 1)
…lkit (rpc-block threshold, deadline-probe, guest-stderr tee) + inline net.write scaffold (gated OFF, refuted)
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