feat(offload): isolate provider IO behind bounded frame queues - #362
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.
A paired desktop can perform file, SQLite, HTTP and layout work without putting socket or filesystem operations on the PocketJS UI thread. The native worker owns transport and fixed queues; the guest delivers at most one result and one bounded coverage upload per frame. Reconnects fence stale replies, and transport never automatically replays sent mutations. Named grants constrain provider operations. This implementation is independent of #360.
Deferred content uses renderer-neutral resource states and completion tickets, plus Solid
ResourceBoundary/ResourceImagecomponents. Applications supply fallback/error subtrees while content keeps its reserved geometry. Texture handles remain cache-owned. Native coverage decoding optionally applies a bounded column palette, allowing Mac-highlighted code without handheld tokenization or pixel expansion.Shared UI APIs include caret blinking with one cancellable virtual-clock deadline and classic controls with pressed/selected/disabled palettes, rounded panel rims and release-inside activation.
ClassicSheetuses native slide/fade transitions, retains modality until closing completes, and gives its buttons a 4px gap and 4px bottom clearance.An optional sixth frame argument carries the right analog stick. The 3DS adapter reads the New 3DS C-stick; Solid, Vue Vapor and Octane expose the same normalized/deadzoned readers. Missing hardware or old tapes read centered. DevTools lazily allocates a bounded recording lane and owns it during replay. Capture, offload and development host modes each initialize it explicitly.
Pocket Doc exercises these APIs in a separate repository against 1,000 generated Markdown files. Its provider owns full unsaved drafts; the device retains a movable bounded window. The app implements idempotent staging retries above the transport contract.
Validation: 124 targeted renderer, DevTools, 3DS-profile and platform-runtime tests; TypeScript and generated contract checks; successful production ARM build and two-screen native capture. Pocket Doc passes 28 app tests, 3,231 compiled-guest replay frames with 93 interaction checks, and 839 QuickJS frames at a 128 KiB stack. The installed device build used a 192 KiB QuickJS stack; current main independently raises the host default to 384 KiB. Earlier native sanitizer checks covered concurrent queue records and coverage/palette bounds. Current PR checks pass.
The latest production app and app-scoped pairing key are installed with byte-exact FTP readback, and its matching Mac daemon is running; the provider has received fresh device frame telemetry. A subsequent real-device demo records browsing, editing, creating a document, and opening the resulting file in Finder. Sustained frame-time acceptance remains pending. Previous builds were installed with byte-exact readback and the user accepted their UX improvements. Bounded IO does not guarantee a frame deadline for arbitrary JS or GPU work. The paired transport assumes a trusted LAN and is unencrypted. Resource UI components currently support Solid; resource state and right-stick contracts are shared across renderers.