mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5153] [Engine] session save/restore is refused on a DFlash2-only install: "conversation snapshot: invalid K/V extent". Desktop-app #3063
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3063
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @davidvv on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5153
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Desktop app (Windows 11, installed build 0.2.10)
What happened
POST /slots/0?action=savefails on a server started with--draft dflash2 --draft-fallback none(the server's own choice for
"drafting": "auto"on this machine):engine log:
Nothing is written; the folder stays empty. It fails at 120,061 tokens and at 33 tokens, so it is not
a length limit.
RESTOREthen answers404 no saved session named ....The same save works when the MTP layer is loaded: with
--max-context 16384(MTP layer loaded,808 MiB of VRAM) it wrote 344,945,384 bytes in 444 ms, restored in 213 ms, restored again after a
full engine restart in 344 ms, and the continued turn reused 12,067 tokens (39 read, 1.04 s against
11.9 s cold). So the file format and the hand-over are fine; the failure is specific to a start
without the MTP layer — which is both the
--draft-fallback noneinstall and any start where thedraft layer is dropped for lack of VRAM:
Why it matters
Session files are the only way to keep a long conversation across an engine restart without a full
re-prefill. On this box a 120K prompt reads in 126.5 s; the same conversation as a session file is
about 1.1 GB and restores in under a second. A DFlash2 install — the recommended drafter on a card
this small — cannot save at all, so the whole disk path is unavailable to exactly the users who
need it.
Steps to reproduce
--kv q4_0 --kv-resident 0 --max-context 131072,--draft dflash2 --draft-fallback none(DFlash2 pack given to--draft-model).--slot-save-path DIR.curl -X POST "http://127.0.0.1:PORT/slots/0?action=save" -H "Content-Type: application/json" -d '{"filename":"chat1.bin"}'It also happens on a start that drops the draft layer for lack of VRAM (
this start runs without the draft layer, 2.67 GiB free), and it does not happen when the MTP layer is loaded.Reproduction status
Reproduced locally: a 120,061-token conversation, a 33-token conversation, and a start that dropped
the draft layer all fail the same way; the same save on an MTP start succeeds.
Strata version
Strata 0.2.10, engine 0.1.56 (commit
ffa80d7)Graphics card, memory and system
Cause (from reading the source)
src/program/generate.cpp(~line 14972) passes the drafter's state to the capture unconditionally:With
--draft-fallback nonethe MTP layer is never loaded (df2_solo), somtp.kv_state()(
include/strata/core/mtp.hpp:102, returningst_) is a default-constructedQsaState:max_cells == 0.conversation_snapshot_sourcesthen builds the last K/V source from it, andvalid_extent()(src/core/conversation_snapshot.cpp:25-31)rejects every non-empty conversation.
The read path already handles a drafter that is not there, in two ways:
conversation_session_read_limits(src/core/conversation_state.cpp) clamps:const int64_t dupto = (int64_t) std::min<uint64_t>(tokens, (uint64_t) std::max<int64_t>(draft.max_cells, 0));(n_st > 0 && !mtp_first) || !use_mtp ? nullptr : &mtp.kv_state()(
generate.cpp~11763).conversation_snapshot_validateandconversation_snapshot_restorealready takeconst QsaState* draftand accept
nullptr; only the save side takes a reference and always includes the layer(
image.kv.size() != layers + (draft ? 1 : 0)is already written to allow its absence).So the fix is the one the callers already expect: make
conversation_snapshot_sourcestakeconst QsaState* draftand passdf2_solo || !mtp_loaded ? nullptr : &mtp.kv_state()(or, if thesignature should stay, skip the
out.back()source when the layer was not loaded). Both the save andits matching restore then agree on
kv.size() == layers.@github-actions[bot] commented on GitHub (Nov 3, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Nov 3, 2026):
Thanks, this follows the format now.
@udqe commented on GitHub (Nov 3, 2026):
Static-read root cause (source at main as of 2026-11-03, engine 0.1.56 era; read-only audit, no build - our own box runs --mtp so we never hit this).
The refusal comes from the SAVE handler passing the MTP drafter's K/V state unconditionally: src/program/generate.cpp:14972
conversation_snapshot_sources(meta, sources, view, ss, g, mtp.kv_state(), err), and src/core/conversation_state.cpp:622-643 always appends the draft source (:639conversation_kv_source(out.back(), draft, g, upto, false, error)withupto = view.ids.size()). On a--draft dflash2 --draft-fallback noneserver the MtpDrafter is never loaded, so its state is default-constructed withmax_cells = 0(include/strata/core/mtp.hpp:102 returnsst_), andupto > st.max_cellstrips the check at src/core/conversation_snapshot.cpp:27-28 that emits exactly your string.Two things make this look like an oversight rather than a designed refusal:
// no --mtp: no draft K/V (snapshots accept null)and :11763 passes!use_mtp ? nullptr : &mtp.kv_state();conversation_snapshot_sources(hpp:139-141).Also worth deciding on purpose: session files store only the MTP draft ring (hpp:136-138, "one streamed source per QSA layer then the draft") - DFlash2's own context ring is never part of a snapshot at all. So even after the save is unblocked, a restored DFlash2-only session would carry no drafter state; refusing with a clearer message ("sessions are not supported with dflash2 drafters") may be the honest short-term answer, and a nullptr overload plus that message is a small patch.
(ai-assisted; citations: udqe static audit of v0.2.10-era main, 2x RTX 4090 Windows box - not its engine build itself)