Repository navigation
Add a shared WASM/WebGPU application host - #3
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/, andweb/n3.js: browser lifecycle, input, settings, and embedding.src/render/workspace.rsandsrc/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.mdanddocs/development.md: ownership, commands, and explicit baseline limits.Validation
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.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 checkpassed 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.