refactor(server): add backend-neutral IPC process layer#2
Open
weicj wants to merge 2 commits into
Open
Conversation
7e66774 to
6a9cbe5
Compare
a40136e to
fb77dd2
Compare
fb77dd2 to
ad8662b
Compare
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
This stacked PR refactors the native mixed-backend IPC path introduced by Luce-Org#246 into a backend-neutral process layer.
Luce-Org#246 adds the first mixed-backend user: DFlash remote draft placement. This PR keeps that behavior unchanged, but separates the reusable daemon lifecycle from the DFlash-specific feature/proposal protocol so future IPC modes, such as PFlash compression, can share the same process boundary instead of duplicating fork/pipe/work-dir handling.
One reason to do this refactor now is performance work: internal A/B checks did not show the IPC path as an obvious wall-time bottleneck, and some same-backend isolation tests were unexpectedly competitive. A shared IPC process layer gives future latency and transport optimization a single place to improve.
Problem
Before this refactor, the remote draft IPC client owned two different responsibilities:
feature_slice,propose, feature payload files, and hidden-state response handling.That was acceptable while DFlash draft was the only IPC mode, but it makes the new
backend_ipc_daemonharder to extend cleanly.Architecture Shape
Before:
After:
Changes
Generalized the standalone daemon entry point
backend_ipc_daemon.--backend-ipc-mode=dflash-draft.Added a generic backend IPC process wrapper
common/backend_ipc.{h,cpp}.BackendIpcProcessfor daemon lifecycle ownership.BackendIpcLaunchConfigfor binary path, mode, payload path, mode args, and work dir.BackendIpcMode, currently withdflash-draftas the first mode.Kept DFlash draft as a mode on top of the generic process layer
DFlashDraftIpcClientnow delegates process startup, pipes, ready status, scratch directory, and shutdown toBackendIpcProcess.DFlashDraftIpcClient:feature_sliceandpropose.dflash_draft_ipc_daemon.cpp.Updated docs and build wiring
backend_ipc.cpptodflash_common.backend_ipc_daemon.Notes
dflash_server,backend_ipc_daemon, andtest_server_unit;test_server_unitpassed. HIP ROCm 6.3.3/gfx906 was checked with fix(hip): map Gemma4 BSA runtime calls Luce-Org/lucebox-hub#258 applied, because current mainline HIP builds are otherwise blocked by the Gemma4 runtime mapping issue fixed there.