refactor(gpu): comlink split-port for worker control plane (wave X1) - #205
Open
josstei wants to merge 71 commits into
Open
refactor(gpu): comlink split-port for worker control plane (wave X1)#205josstei wants to merge 71 commits into
josstei wants to merge 71 commits into
Conversation
baseline hash=afa9ed05; timing baseline 251.078ms, budget 263.632ms
…ssagePort frame path untouched; golden hash afa9ed05 held; net src -411 LOC pre-collateral; 16 legacy tests migrate in Tasks 3-4 testkit sendCommand removed as typecheck:app collateral (full mock rewrite in Task 3); pre-commit bypassed ONE TIME by owner approval 2026-07-06 (vitest-related lane runs the 16 accepted-legacy tests; typecheck:app/golden/timing/census/build/dev:smoke all green)
… dead validation tests
service.test.ts: 7 envelope-dispatch cases -> 5 rewritten onto the comlink
WorkerControlApi + 2 deleted (setBrightness/setPreset, redundant with
split-port.test.ts's driver.record coverage) + 1 added (stats-content case
asserting fps/frameTime/gpuTime/uploadTime), net -1.
protocol.test.ts: 3 cases -> 1 rewritten onto the surviving FRAME/STATS
factory + 2 deleted (isValidWorkerMessage/isValidWorkerResponse, both
removed by the port) + 1 added (guard coverage for the 7 surviving
discriminants), net -1.
service.ts: maybePostStats dropped uploadTime from the STATS payload during
the comlink port (consumed by video-session.ts and streaming-render.service.ts).
Re-add it; widen the local WorkerRendererPipeline.getStats type to
RenderStats & { uploadTime?: number } since RenderStats itself never
declared the field (pre-port this lived on a wrapper type the port
collapsed away).
2035 -> 2033 tests. Full suite and typecheck green.
Move UIController responsibilities to their owning services and add the shared PlatformBootstrap base for main/renderer lifecycle handling. Validated locally: - npm run typecheck - npm run lint - npm run lint:dead-code - npm run test:run - npm run dev:smoke - npm run build:vite - npx playwright test tests/e2e/app-launch.spec.js tests/e2e/notes-panel.spec.js tests/e2e/streaming-smoke.spec.js --project=electron
Mirror BaseOrchestrator's declared event handler subscription in BaseService and remove manual bindEventHandlers calls from renderer services. Validated locally: - npm run typecheck - npx vitest run tests/unit/platform/core/service.base.test.ts tests/unit/renderer/infrastructure/services/settings/settings-cinematic-mode.service.test.ts tests/unit/renderer/infrastructure/services/settings/settings-fullscreen.service.test.ts tests/unit/renderer/presentation/bridges/ui-event.bridge.test.ts tests/unit/renderer/presentation/bridges/capture-ui.bridge.test.ts tests/unit/renderer/presentation/bridges/transcode-ui.bridge.test.ts - npm run lint - npm run lint:dead-code - npm run test:run - npm run dev:smoke
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
Comlink split-port: the worker control plane (init/resize/preset/brightness/capture/release/destroy) now rides a dedicated MessagePort via comlink, while the frame path stays byte-untouched on the raw worker channel. Catalog row #1 of the 2026-07-05 cycle-2 catalog; spike-evidenced (CRITERION: PASS, controller-reproduced).
Numbers
afa9ed05held pre/post (golden byte-test, driver-call parity)src/platform/gpu/application/video-session.tsdiff vs main: empty (byte-unchanged)Test-count arithmetic
2,030 baseline → 2,033: +4 golden/timing/split-port adds, +1 stats-content, −1 fixtures sendCommand case, −1 net service/protocol prunes with coverage-parity (setBrightness/setPreset covered strictly stronger by split-port end-to-end).
Disclosure
Commit 86efa1e landed with a ONE-TIME owner-approved pre-commit bypass (2026-07-06) — lint-staged's vitest-related lane ran the 16 legacy tests that Tasks 3–4 subsequently migrated; all behavioral gates (typecheck:app, golden parity, timing, census, build, dev:smoke) were green at bypass time; commitlint validated post-hoc.
Accepted post-port notes
Adoption conditions satisfied