Repository navigation
feat(server): add draft residency policy - #290
Conversation
b1cc5a8 to
8cef6bb
Compare
There was a problem hiding this comment.
1 issue found across 8 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Merge PR Luce-Org#291's draft residency policy and Gemma4 draft lifecycle support into the current auto-integration stack while preserving passthrough PFlash options, transitive compression overrides, status/cancellation behavior, and existing server unit coverage. PR Luce-Org#290 is represented by this superset head.
Record the Luce-Org#291/Luce-Org#290 draft-residency integration, newly non-draft Luce-Org#321/Luce-Org#325 classification, validation, and retained worktree/transcript paths for the May 31 13:30 UTC run.
Record the post-push Luce-Org#324 head advance and conflict resolution after integrating Luce-Org#291/Luce-Org#290.
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="server/src/server/http_server.cpp">
<violation number="1" location="server/src/server/http_server.cpp:138">
P3: Duplicate `draft_residency` field initializer in both branches of the pflash if/else block. The expression `draft_residency_policy_name(config.draft_residency)` is branch-invariant and appears identically in both the `!pflash_enabled` (line 138) and `pflash_enabled` (line 164) branches. This creates a maintenance risk — any future change to the field name or value expression must be applied in two places.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| {"bsa_enabled", nullptr}, | ||
| {"bsa_alpha", nullptr}, | ||
| {"lm_head_fix", nullptr}, | ||
| {"draft_residency", draft_residency_policy_name(config.draft_residency)}, |
There was a problem hiding this comment.
P3: Duplicate draft_residency field initializer in both branches of the pflash if/else block. The expression draft_residency_policy_name(config.draft_residency) is branch-invariant and appears identically in both the !pflash_enabled (line 138) and pflash_enabled (line 164) branches. This creates a maintenance risk — any future change to the field name or value expression must be applied in two places.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At server/src/server/http_server.cpp, line 138:
<comment>Duplicate `draft_residency` field initializer in both branches of the pflash if/else block. The expression `draft_residency_policy_name(config.draft_residency)` is branch-invariant and appears identically in both the `!pflash_enabled` (line 138) and `pflash_enabled` (line 164) branches. This creates a maintenance risk — any future change to the field name or value expression must be applied in two places.</comment>
<file context>
@@ -135,6 +135,7 @@ json build_props_body(const ServerConfig & config,
{"bsa_enabled", nullptr},
{"bsa_alpha", nullptr},
{"lm_head_fix", nullptr},
+ {"draft_residency", draft_residency_policy_name(config.draft_residency)},
};
} else {
</file context>
Integrate current Luce-Org/lucebox-hub PR Luce-Org#290 head into the auto-integration patch stack.
Record the exact Luce-Org#290/Luce-Org#291 merges, current Luce-Org#321/Luce-Org#325 classification, retained worktrees, and validation for the 2026-05-31 13:57 integration run.
Add the --draft-residency {auto,persistent,request-scoped} row to the
Decode (DFlash + DDTree) flag table and reword --lazy-draft as its legacy
alias, matching the CLI help in server_main.cpp. Pairs with PR Luce-Org#290.
Co-Authored-By: WOZCODE <[email protected]>
|
lgtm |
Resolve additive conflicts: - model_backend.h: keep both CompressRequest fields (use_transitive from PR, residency_action from main Luce-Org#290). - test_server_unit.cpp: keep both includes (c2_gate.h, draft_residency.h) and both test suites; pflash_keep_ratio default asserts 0.10 (PR shipped default) alongside main's draft_residency==Auto assert. Syntax-checked test_server_unit.cpp + qwen35_backend.cpp against merged headers (rc=0).
Summary
This PR turns the existing draft park/unpark and
--lazy-draftbehavior into an explicit C++ server residency policy shared by PFlash and DFlash.On smaller or tightly split GPU setups, draft weights can remain resident after their active work is finished and compete with target restore, target shards, or the next draft load. This PR adds one shared policy surface so PFlash can release the drafter after compression and DFlash can keep its existing lazy-draft lifecycle through the same resolver.
Changes
Shared residency policy
server/src/placement/draft_residency.has the common C++ policy layer on top of the existing draft park/unpark capability.auto: preserve the existing resident behavior by default, while still honoring the low-VRAM / lazy-draft hint.persistent: keep draft weights loaded across requests.request-scoped: release or park draft weights after the request-side draft work is complete.--draft-residency auto|persistent|request-scopedto the server CLI/config surface.--lazy-draftas a compatibility alias for--draft-residency=request-scoped, so existing callers do not break while the lifecycle logic moves into the shared resolver./props.runtime.draft_residency.PFlash lifecycle
DFlash lifecycle
lazy_draftbehavior available, but express it through the same residency resolver used by PFlash.Backend coverage
server/src/placement/, so future draft-producing paths can reuse it without adding another lifecycle flag.Notes
/propsreporting.test_server_unitpassed with1568 assertions, 0 failures.init().