[beta] Decentralized sharded WebGPU compute pool - #4
Open
ThyFriendlyFox wants to merge 3 commits into
Open
Conversation
…, pool + beta panel Co-authored-by: ThyFriendlyFox <thyfriendlyfox@gmail.com>
Co-authored-by: ThyFriendlyFox <thyfriendlyfox@gmail.com>
Co-authored-by: ThyFriendlyFox <thyfriendlyfox@gmail.com>
ThyFriendlyFox
marked this pull request as ready for review
June 23, 2026 22:06
ThyFriendlyFox
added a commit
that referenced
this pull request
Jul 31, 2026
AGENTS.md requires mirroring iOS feature work into kotlin/ or recording why not. Phases T (terminal screen), F (package manager) and G (the Node layer) are iOS-only, and until now that was a silent gap in the contract. Measured rather than guessed, so the record is decision-shaped: - T and F are portable work, not blocked work: TerminalScreen (27 KB) and PackageManager (32 KB) are pure logic over Foundation, HTTP and zlib, all of which Android has, and the pyte/pnpm/semver corpora transfer as the Android harness. - G splits 72 % engine-agnostic JS bootstrap (165 KB, ports verbatim) to 28 % host bridge (65 KB of Swift). Android has no public JavaScriptCore, but @JavascriptInterface gives JS synchronous calls into Kotlin — the direction require()/readFileSync/execSync need — so parity is feasible without a third-party engine and without breaking invariant #4. The reverse direction is async, which only reshapes the event loop. Android build re-verified green (gradlew assembleDebug). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
A beta scaffold for a decentralized, sharded WebGPU compute pool: many browser GPUs cooperating to run inference-style workloads, contributed voluntarily to form a shared pool. Off by default behind a feature flag and fully isolated from the existing app.
How it works
Large-model inference is dominated by big matrix multiplies (the core transformer-layer op). The pool splits each matmul into row-block shards and spreads them across every participating GPU, then reassembles the result. Each node is both a worker (computes shards for others) and a requester (dispatches its own jobs).
What's included (
src/compute/)webgpu.tsShardScheduler.tssignaling.tspeer.tsPeerLink— a peer as a remoteWorkeroverRTCDataChannelComputePool.tsrunSharded()/runDemo()ComputePoolView.tstypes.tsPlus
compute-coordinator/— a tiny reference signaling/membership broker (relays WebRTC handshakes only; shard payloads go peer-to-peer).Enabling
A ⚡ launcher then opens the panel. With no coordinator the pool runs as a single node ("solo") and still demonstrates the full shard → compute → merge pipeline on one GPU.
Testing
npm run build(tsc + vite) passes; the compute module is isolated and the app is unchanged when the flag is off.peer_joined, signal relay, andpeer_leftall pass.Beta limitations (see
src/compute/README.md)