mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1492] [Engine] save and restore sessions without an MTP drafter #3487
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#3487
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1492
Author: @Momoyeyu
Created: 10/8/2026
Status: 🔄 Open
Base:
main← Head:fix/session-save-without-mtp📝 Commits (1)
5a14ef2fix(serve): save and restore sessions without an MTP drafter📊 Changes
5 files changed (+84 additions, -13 deletions)
View changed files
📝
include/strata/core/conversation_snapshot.hpp(+6 -0)📝
src/core/conversation_snapshot_test.cpp(+17 -0)📝
src/core/conversation_state.cpp(+21 -8)📝
src/core/conversation_validation_test.cpp(+34 -0)📝
src/program/generate.cpp(+6 -5)📄 Description
Problem and result
--servecan run without--mtp, but SAVE always passedmtp.kv_state()to the session writer. An unloaded drafter hasmax_cells == 0, so saving any nonempty conversation failed with:and RESTORE never got a file to read. The in-memory snapshot path already accepts an absent drafter, so the disk path now uses the same distinction: the draft K/V source, its read bounds,
sl.kv_layersand the validate/restore calls include the drafter only when it exists. The file format and the K/V extent checks are unchanged; passing an uninitialized drafter explicitly still fails instead of bypassing validation.Related to #1444, not closing it: the failure is reproduced with the same error, but not in the reporter's Q6_K configuration, and the launch arguments are still missing there.
Related discussion
#1444.
Approach
conversation_snapshot_sourcesandconversation_session_read_limitstakeconst QsaState*; the reference overloads stay for callers that always have a drafter, so nothing else in the tree changes. SAVE/RESTORE, the memory preflight and the saved layer count follow the actual drafter presence.Validation
Rebased on
mainate88ee39d(0.2.0-beta); the commit is now5a14ef2aon top of it.Passed:
git rebase upstream/main— the single commit replayed ontoe88ee39dwith no conflicts;git diff --checkclean.src/program/generate.cppone88ee39d: SAVE sources, the read limits, validate, restore and the layer count all take the nullablesession_draft; the only other draft-passing callers are thebatch_mtpcopies, which are guarded bybatch_mtpand are not affected.Failed:
Not run:
conversation_transfer_test,conversation_validation_test,conversation_file_test,conversation_snapshot_testwere not re-run on 0.2.0-beta: the machine I have now is macOS arm64 with no CUDA toolkit and no NVIDIA GPU, so the engine does not build here. The 4055-check run in the original description was ond5ea713, and I am not restating it as a 0.2.0-beta result.Limits
The 0.2.0-beta build and test run is the one open item; I will post it in this thread as soon as a GPU is available. The SYCL copy of the session code (
sycl/src/program/generate.cpp) is not changed by this PR.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.