Repository navigation
Conversation
A slot save file holds the target context state and the context checkpoints, but not the state of the draft context. After a restore, a draft that is fed from the target's batches (e.g. draft-mtp) has seen none of the restored prompt, and fewer drafts are accepted for the rest of the conversation. If the slot held another conversation before the restore, the draft context still holds that one. The draft state is now appended after the checkpoint appendix, the way the RAM prompt cache already keeps it. Readers without this change ignore it, and a file without it restores with an empty draft context. A restore drops the slot's old draft state first. Assisted-by: Claude Code
rcfa
force-pushed
the
pr/slot-draft-state
branch
from
October 20, 2026 19:02
b714921 to
f075bf6
Compare
Author
|
Rebased onto master ab06204 (after #181). Written by an AI agent (Claude Code) for @rcfa.
Verified on gfx1150 (Radeon 890M, Vulkan), Qwen3.8-Flash-Next IQ3_XXS with MTP, master build vs this branch: |
rcfa
added a commit
to rcfa/strix-llama.cpp
that referenced
this pull request
Oct 23, 2026
…file Master's ckpt_read_buf() takes the bytes left after the offset, as load_slot_checkpoints() does. (folded into halo-box#171 for the PR) Assisted-by: Claude Code
rcfa
added a commit
to rcfa/strix-llama.cpp
that referenced
this pull request
Oct 27, 2026
…file Master's ckpt_read_buf() takes the bytes left after the offset, as load_slot_checkpoints() does. (folded into halo-box#171 for the PR) Assisted-by: Claude Code
rcfa
added a commit
to rcfa/strix-llama.cpp
that referenced
this pull request
Nov 1, 2026
…file Master's ckpt_read_buf() takes the bytes left after the offset, as load_slot_checkpoints() does. (folded into halo-box#171 for the PR) Assisted-by: Claude Code
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.
Draft, with a scope question first
This change is general server code, not Strix specific. ggml-org master has the same slot-save path, the same draft
contexts and the same gap (checked against 8bb3cf0 today), and I found no open PR or issue for it in ggml-org,
halo-box/llama.cpp or here. By AGENTS.md that would make it a halo-box/llama.cpp change. I am opening it here as a
draft because it extends the slot-file appendix that came in through #98 (itself a forward-port of
ggml-org#26004), and because we hit it with this fork's target model (Qwen3.8-Flash-Next, qwen4exp, with
the shared MTP head). If you would rather not carry it here, please close it; as an agent I cannot open it in
halo-box/llama.cpp.
This PR was written by an AI agent (Claude Code), working for @rcfa; what was and was not verified is listed below.
Overview
A slot save file holds the target context state and, since #98, the context checkpoints. It does not hold the state
of the draft context. A draft that is fed from the target's batches (draft-mtp here) has therefore seen none of the
restored prompt after
/slots/{id}?action=restore, and fewer drafts are accepted for the rest of the conversation.If the slot held another conversation before the restore, the draft context still holds that one instead.
The change appends the draft context's sequence state after the checkpoint appendix (
SDFTmagic, version, oneblob), the way the RAM prompt cache already keeps it (
llama_state_seq_get_data_extonctx_dft). On restore itfirst drops the slot's old draft state, then loads the appendix if there is one. Older readers stop after the
checkpoints and never see it; a file without it restores with an empty draft context. The output does not change:
the target verifies every draft.
We use it to move conversations between two quants of the same model under memory pressure (save every slot, restart
the server on the smaller quant, restore), which is how we found it.
Measurements
P = 16384 tokens of unseen text, saved after a prefill with
n_predict: 0; every run then sends P plus the next 64tokens and decodes 128 tokens greedily (
ignore_eos). One run each:Every continuation processed only the 64 new tokens. The slot file grows by the draft state, 36.6 MiB at 16k tokens
for this MTP head (771 -> 807 MiB).
File compatibility, each restore on a fresh server process:
Both restore all 16384 tokens and the 2 checkpoints, and then draft like master after a restore: master stops reading
after the checkpoints, and this PR starts with an empty draft context when there is no appendix.
Correctness
same 128 tokens as master's own prefill.
test-backend-ops, the corpus comparison andllama-benchdo not apply; the greedy outputs are identical.
Not verified
draft-mtp.draft-simple,draft-eagle3,draft-dflashanddraft-dsparkkeep their draft context thesame way (fed from the target's batches through
process()), but we have no such draft models here.tools/serverpytest suite (including its slot-save tests) was not run: it needs Python packages and modeldownloads we have not installed on this machine.
conversation with one image saved, restored on another quant and answered a follow-up correctly (draft state
0.3 MiB). Not repeated on this branch.
Generated with Claude Code