Skip to content

refactor(server): group backend plan by concern - #693

Closed
Graffioh wants to merge 4 commits into
Luce-Org:mainfrom
Graffioh:codex/backend-plan-structure
Closed

refactor(server): group backend plan by concern#693
Graffioh wants to merge 4 commits into
Luce-Org:mainfrom
Graffioh:codex/backend-plan-structure

Conversation

@Graffioh

@Graffioh Graffioh commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Second slice of the server refactor stack, following #691.

  • replace the flat BackendPlan::args() view with read-only snapshots by concern
  • keep model path and inspected GGUF metadata together in Model
  • separate Placement, Cache, Speculation, and generic Execution values
  • put the four current DeepSeek-specific construction values in a small explicit DeepSeek4 group
  • consume mutable BackendArgs once at preparation, after normalization and admission
  • make backend dispatch and server startup/reporting read the same grouped plan
  • remove the unused server-admission parameter from inert-feature warning collection

Execution now contains only stream_fd and chunk; it is no longer a miscellaneous model-path and DeepSeek bag. No architecture hierarchy or variant is introduced.

Stack

This is PR 2 of 3:

  1. refactor(server): seal backend construction behind a plan #691 — backend planning and owned architecture configs, head d6ef2f7cf
  2. refactor(server): group backend plan by concern #693 — grouped effective backend plan (this draft, single review commit 90062dc21)
  3. refactor(server): establish owned generation lifecycle #692 — owned generation lifecycle, head 66b9295bb

This branch is directly based on the current #691 head. Because the branches live in a fork, the PR targets main and temporarily displays the preceding stack commits.

Review only this PR's delta: Graffioh/lucebox-hub@codex/backend-plan-boundary...codex/backend-plan-structure

The following #692 delta is: Graffioh/lucebox-hub@codex/backend-plan-structure...codex/luce-engine-implementation

Resulting boundary

BackendArgs (mutable input)
        |
  prepare_backend (consume once)
        |
BackendPlan {
  model,
  placement,
  cache,
  speculation,
  execution,
  deepseek4
}
   /          \
factory     read-only startup/reporting

The grouped field carriers are public read-only views; only the private builder can populate the plan. Persistent architecture configs introduced in #691 own their path storage, so the plan and returned backend have independent lifetimes.

Why this shape

  • Model couples the path with the metadata inspected from that path.
  • Execution remains small and architecture-neutral.
  • DeepSeek4 is a simple field group, not a hierarchy or variant. A variant becomes useful only if more families accumulate distinct option sets.
  • BackendPlan remains the one effective launch snapshot for construction and startup reporting.

A separate BackendRuntimeInfo is deferred until it can replace reporting state rather than duplicate it. Explicit SpecLA configuration is also deferred because removing the current environment bridge would be a broader behavior change across low-level graph helpers.

Tests

  • HIP/gfx1151 builds: dflash_server, test_feature_gate, test_server_unit, test_deepseek4_unit, test_generate, and test_dflash
  • 449/449 model-free server and plan/feature tests pass
  • compile-time checks verify the direct ModelBackend return type and absence of a flat args() view
  • focused tests cover owned model data and the explicit DeepSeek option group
  • git diff --check

@Graffioh
Graffioh force-pushed the codex/backend-plan-structure branch from 72c2c9d to 6700cde Compare September 3, 2026 10:03
@Graffioh

Graffioh commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Incorporated into #691 as commit 6c9abb0. #692 is now rebased directly onto the combined #691 endpoint, leaving a two-PR server-refactor stack.

@Graffioh Graffioh closed this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant