Repository navigation
Conversation
ale18V
force-pushed
the
feat/training-worker-page-client-alternative
branch
from
November 11, 2026 16:29
5c926c6 to
1b7f078
Compare
This branch has not been deployed
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.
What & why
Training on the main thread can freeze the UI for large models. WebRTC's
RTCPeerConnectionis unavailable in workers, so the page retains WebRTC peers while the worker owns training, aggregation, weight serialization, and round coordination. A peer-transport adapter bridges the two using signaling events and opaque bytes.Technical plan
training.worker.tsruns Disco with WebGL and CPU fallback, using the existing dataset loaders on files and labels passed by the page.peer_transport.tsconnects page-owned peers to the worker through a MessagePort; an injectable peer factory lets DecentralizedClient use this transport without changing its training protocol.worker_messages.tshandles startup, progress, errors, cancellation, and the final model, while TrainerDashboard manages the worker lifecycle and UI. Cooperative stopping retains a forced-termination timeout and peer cleanup. Local validation covers 265 unit tests, static checks, and the webapp build; browser E2E tests run in CI.Deviations from plan
Following review, replaced the PageClient round-level bridge with peer transport and moved dataset loading into the worker.
Todo
Measure large-model main-thread overhead in the remaining WebRTC transport and final-model saving path.