[PR #1537] [CLOSED] serve: an opt-in checkpoint where a request continues the live session after a long reply (STRATA_LIVE_CKPT_MIN) #3517

Closed
opened 2026-11-07 14:42:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1537
Author: @zsariboga
Created: 10/8/2026
Status: ❌ Closed

Base: main ← Head: pr-live-ckpt


📝 Commits (1)

  • fbb3b5f serve: an opt-in checkpoint where a request continues the live session after a long reply (STRATA_LIVE_CKPT_MIN)

📊 Changes

2 files changed (+33 additions, -0 deletions)

View changed files

📝 docs/DETAILS.md (+8 -0)
📝 src/program/generate.cpp (+25 -0)

📄 Description

Rebased on main (477ac13c) and now opt-in, after @qiuzan2001's review. Thank you, the point was right: with a default of 1024 the checkpoint fired on most agent turns after a long reply. Each one is a synchronous checkpoint_save that takes one of the --prompt-cache slots, so it could push an older checkpoint out.

What it changes

  • STRATA_LIVE_CKPT_MIN=N turns it on. Unset or 0 is off, and the path is then byte-identical to main.
  • When on, a request that continues the live session saves a checkpoint where it starts. A wrap-up continuation, a forced call's opening and a reasoning-close retry are such requests. The checkpoint is saved only when the newest checkpoint below is at least N tokens back.
  • A later prompt that leaves the session right there resumes from that checkpoint instead of reading the whole reply again. A wrap-up the client's history does not carry, or a call the client renders differently, leaves the session at that point.
  • It is one ordinary checkpoint through checkpoint_at(). It is skipped for ckpt=0, STRATA_CKPT_REREAD, an incoming parked conversation and a slot source. The engine log says checkpoint at the live end: N tokens.
  • docs/DETAILS.md: one entry next to --prompt-cache-spread.

Measured (the previous version, 0.1.40.3)

Setup: RTX 5070 Ti Laptop 12 GB, Core Ultra 7 255HX, 64 GB DDR5-5600, Windows 11, Swift 1.5 IQ3_XXS.

  • A tool turn after a budget wrap-up: reused 362 / 364 before, 969 / 971 after; read 1379-3635 before, 583 / 1770 after.
  • In four opencode tasks with 1024, four live-end checkpoints were saved, 3134-4801 tokens past the one below. A 4096-token budget wrap-up then read ~1 token again instead of 4795.

How it was checked

  • Built on this branch for CUDA (sm_120, MSVC + CUDA 13).
  • Not built for HIP or SYCL: I have neither toolchain. The change is host code in src/program/generate.cpp, inside the CUDA/HIP serve loop.
  • Not re-measured end to end on this rebase. Our fork runs the same code with STRATA_LIVE_CKPT_MIN=1024 on 0.1.44.

🔄 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/1537 **Author:** [@zsariboga](https://github.com/zsariboga) **Created:** 10/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr-live-ckpt` --- ### 📝 Commits (1) - [`fbb3b5f`](https://github.com/Niko1221/Strata/commit/fbb3b5fa13155645d8a9f4048eb1a893a8dd19c7) serve: an opt-in checkpoint where a request continues the live session after a long reply (STRATA_LIVE_CKPT_MIN) ### 📊 Changes **2 files changed** (+33 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+8 -0) 📝 `src/program/generate.cpp` (+25 -0) </details> ### 📄 Description **Rebased on `main` (`477ac13c`) and now opt-in**, after @qiuzan2001's review. Thank you, the point was right: with a default of 1024 the checkpoint fired on most agent turns after a long reply. Each one is a synchronous `checkpoint_save` that takes one of the `--prompt-cache` slots, so it could push an older checkpoint out. ## What it changes - `STRATA_LIVE_CKPT_MIN=N` turns it on. Unset or 0 is off, and the path is then byte-identical to `main`. - When on, a request that continues the live session saves a checkpoint where it starts. A wrap-up continuation, a forced call's opening and a reasoning-close retry are such requests. The checkpoint is saved only when the newest checkpoint below is at least N tokens back. - A later prompt that leaves the session right there resumes from that checkpoint instead of reading the whole reply again. A wrap-up the client's history does not carry, or a call the client renders differently, leaves the session at that point. - It is one ordinary checkpoint through `checkpoint_at()`. It is skipped for `ckpt=0`, `STRATA_CKPT_REREAD`, an incoming parked conversation and a slot source. The engine log says `checkpoint at the live end: N tokens`. - `docs/DETAILS.md`: one entry next to `--prompt-cache-spread`. ## Measured (the previous version, 0.1.40.3) Setup: RTX 5070 Ti Laptop 12 GB, Core Ultra 7 255HX, 64 GB DDR5-5600, Windows 11, Swift 1.5 IQ3_XXS. - A tool turn after a budget wrap-up: reused 362 / 364 before, 969 / 971 after; read 1379-3635 before, 583 / 1770 after. - In four opencode tasks with 1024, four live-end checkpoints were saved, 3134-4801 tokens past the one below. A 4096-token budget wrap-up then read ~1 token again instead of 4795. ## How it was checked - Built on this branch for CUDA (sm_120, MSVC + CUDA 13). - Not built for HIP or SYCL: I have neither toolchain. The change is host code in `src/program/generate.cpp`, inside the CUDA/HIP serve loop. - Not re-measured end to end on this rebase. Our fork runs the same code with `STRATA_LIVE_CKPT_MIN=1024` on 0.1.44. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:42:02 +07:00
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#3517
No description provided.