[PR #5503] [Engine] Allow session snapshots without a draft layer #5482

Open
opened 2026-11-07 23:44:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/5503
Author: @giphoo
Created: 11/7/2026
Status: 🔄 Open

Base: main ← Head: fix/optional-draft-snapshot


📝 Commits (1)

  • 2b2df49 Allow session snapshots without a draft layer

📊 Changes

2 files changed (+13 additions, -3 deletions)

View changed files

📝 include/strata/core/conversation_snapshot.hpp (+4 -0)
📝 src/core/conversation_state.cpp (+9 -3)

📄 Description

Problem and result

Session save/restore fails when the engine runs DFlash2 without an MTP draft layer. conversation_snapshot_sources() always required a QsaState& reference and emitted exactly one draft KV source, even when no draft KV exists.

After this change, a QsaState* overload omits the draft K/V source when nullptr is passed. The existing reference version delegates to the new pointer version.

none

Approach

DFlash2 can run without MTP, in which case there is no draft-layer KV state to serialize. The old code unconditionally dereferenced the draft parameter and emitted layers + 1 K/V sources. This adds a nullable-pointer overload and makes the draft source conditional.

No default behavior changes when a draft is present.

Validation

Passed (reference implementation, Linux/HIP, AMD W7900, DFlash2 spec 6 without MTP):

  • DFlash2 session save + incremental save + restore works without invalid K/V extent
  • MTP enabled: unchanged behavior (reference overload delegates)

Failed: none observed

Not run:

  • CUDA, SYCL, Metal builds (host-side type change only, no device code)

Limits

None identified beyond the scope: this only affects conversation_snapshot_sources and callers that pass nullptr for the draft state.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/5503 **Author:** [@giphoo](https://github.com/giphoo) **Created:** 11/7/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/optional-draft-snapshot` --- ### 📝 Commits (1) - [`2b2df49`](https://github.com/Niko1221/Strata/commit/2b2df49212e09c8105a83222d22922aa0e500504) Allow session snapshots without a draft layer ### 📊 Changes **2 files changed** (+13 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `include/strata/core/conversation_snapshot.hpp` (+4 -0) 📝 `src/core/conversation_state.cpp` (+9 -3) </details> ### 📄 Description ## Problem and result Session save/restore fails when the engine runs DFlash2 without an MTP draft layer. `conversation_snapshot_sources()` always required a `QsaState&` reference and emitted exactly one draft KV source, even when no draft KV exists. After this change, a `QsaState*` overload omits the draft K/V source when `nullptr` is passed. The existing reference version delegates to the new pointer version. ## Related discussion none ## Approach DFlash2 can run without MTP, in which case there is no draft-layer KV state to serialize. The old code unconditionally dereferenced the draft parameter and emitted `layers + 1` K/V sources. This adds a nullable-pointer overload and makes the draft source conditional. No default behavior changes when a draft is present. ## Validation **Passed (reference implementation, Linux/HIP, AMD W7900, DFlash2 spec 6 without MTP):** - DFlash2 session save + incremental save + restore works without `invalid K/V extent` - MTP enabled: unchanged behavior (reference overload delegates) **Failed:** none observed **Not run:** - CUDA, SYCL, Metal builds (host-side type change only, no device code) ## Limits None identified beyond the scope: this only affects `conversation_snapshot_sources` and callers that pass `nullptr` for the draft state. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5482
No description provided.