Skip to content

Add a shared WASM/WebGPU application host - #3

Merged
softmarshmallow merged 1 commit into
mainfrom
feature/wasm-webgpu-baseline
Oct 2, 2026
Merged

softmarshmallow merged 1 commit into
mainfrom
feature/wasm-webgpu-baseline

Conversation

@softmarshmallow

@softmarshmallow softmarshmallow commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

N3's Rust editor now runs as a static WebAssembly/WebGPU application with the same workspace, semantic actions, menus, and user guide as the native app. Browser capabilities hide unsupported controls, including the local terminal and external settings-file editor.

The host boundary keeps filesystem effects, persistence, GPU setup, clocks, and event scheduling target-specific. Shared rendering retains its revision caches and edit lifecycle; native device limits, scheduling, and presentation policy remain intact. The browser adapter handles pinch/wheel/WebKit gestures and startup focus, and the framework-neutral JavaScript controller supports selected-file loading, downloads, status callbacks, and teardown.

Contributor commands build and serve the baseline, and a dedicated WASM CI lane runs wrapper regressions, warnings-denied Clippy, and the real bindgen build. Native verification remains independent of optional WASM setup. The opt-in Linux software-renderer lane uses one test thread after parallel GPU-backed tests crashed on both committed HEAD and this port; all assertions and exact captures remain enabled. The engineering contract records the shared product model and each host's performance ownership.

Review focus

  • src/web.rs, src/web/, and web/n3.js: browser lifecycle, input, settings, and embedding.
  • src/render/workspace.rs and src/asset_io/native/: shared rendering and native effect boundaries.
  • vendor/egui-winit/N3-PATCH.md: the narrowly scoped WASM compatibility patch and upstream notices.
  • docs/architecture/platform-boundaries.md and docs/development.md: ownership, commands, and explicit baseline limits.

Validation

  • Native just verify: 939 Rust tests passed, 1 existing ignored test; 81 Python tests and 6 JavaScript wrapper tests passed. Formatting, Clippy, and exact native guide checks passed.
  • just ci-macos: native app bundle, ad-hoc signature, metadata/icon checks, and 35 focused integration tests passed.
  • just web-verify: wrapper regressions, warnings-denied WASM Clippy, and static WASM/glue build passed.
  • Fresh rebuilt browser smoke: WebGPU initialization, Shift+I before any focus switch, viewport deselection, and double-click edit entry passed. Earlier baseline review also covered multi-object selection, held Z/Space, blur cancellation, gestures, file round-tripping, preference synchronization, and teardown.
  • Linux just ci checks: formatting, Clippy, tooling, inventory validation, and 938 focused Rust tests passed with the contained serial test policy. All 104 Linux guide images match the previous receipt exactly; the refreshed receipt records only intended prose/manifest changes. just ci-docs check passed all 27 features and 133 exact artifacts. The underlying parallel-test fault remains tracked in TODO.md.

The results above are local verification. Hosted results are reported in this pull request’s checks.

Baseline limits

Requires a secure context and available WebGPU. No local shell/PTY or arbitrary filesystem access; external asset-resource resolution and recovery need later work. Downloads do not establish durable save completion. One editor lifetime per WASM module is supported; an iframe isolates independent lifetimes. Broader browser/device, physical trackpad, touch, IME, and accessibility coverage remains follow-up work.

Large-mesh orbit performance and native/browser profiling are tracked separately in issue #2. The reported slowdown is not yet measured or attributed; this baseline does not establish performance parity.

@softmarshmallow
softmarshmallow merged commit 78ed7bf into main Oct 2, 2026
8 checks passed
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