[PR #3121] [CLOSED] conversation cache: opt-in overwrite growth for snapshot buffers #4466

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3121
Author: @JumpEggKiller
Created: 10/19/2026
Status: ❌ Closed

Base: main ← Head: perf/conversation-buffer-overwrite


📝 Commits (1)

  • 0d2c9ab Add opt-in overwrite growth for conversation snapshot buffers

📊 Changes

6 files changed (+385 additions, -40 deletions)

View changed files

📝 CMakeLists.txt (+3 -0)
➕ bench/results/conversation-overwrite/README.md (+64 -0)
➕ bench/results/conversation-overwrite/historical-v0145.csv (+19 -0)
📝 include/strata/core/conversation_buffer.hpp (+86 -39)
➕ src/core/conversation_buffer_test.cpp (+197 -0)
📝 src/core/conversation_snapshot.cpp (+16 -1)

📄 Description

Summary

Parking a long conversation grows host K/V buffers and then overwrites the new bytes with the snapshot copy. Add an opt-in overwrite growth path to avoid initializing those bytes twice. Only STRATA_SNAPSHOT_NOFILL=1 enables it; the default still fills new bytes. Related: #2264.

What changed

  • Store each ConversationBuffer segment in owned raw byte storage while preserving value semantics, address stability and ordinary resize filling.
  • Add resize_for_overwrite and use it at the snapshot capture call site under the opt-in switch. Keep the existing cache policy and snapshot format.
  • Add host tests for full overwrite, retained prefixes, segment boundaries, copy/move, allocation failure, failed transfer callbacks and discard/retry.
  • Include sanitized historical v0.1.45 park timings and their limits in bench/results/conversation-overwrite/.

Validation and remaining work

Standalone buffer tests on this main-based candidate: 92 checks pass with MSVC 19.44, C++17, optimized build. A separate v0.1.44.1 backport builds CUDA sm_86 and passes 92 buffer checks, 4,219 cache checks and 36 checkpoint split allocation-failure cases.

The CSV is historical evidence from one patched v0.1.45 binary and two RTX 3090 cards at a 262,144-token context. It includes a slower overwrite run under host contention; it is not a current-main or backport benchmark. The README documents exactly what is timed and omitted. No model, private path, config, prompt, binary or credential is included.

Draft: not ready for review. Full current-main CUDA, HIP and SYCL builds remain outstanding. HIP/SYCL toolchains are unavailable on this host. Fresh same-binary backport A/B, prefix edits, two alternating long histories, HTTP error recovery, and a NOFILL-enabled 3-hour/50-request soak are not yet complete. No production binary has been replaced. There is no claim that temperature zero makes outputs deterministic or that all failure modes have been covered.


🔄 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/3121 **Author:** [@JumpEggKiller](https://github.com/JumpEggKiller) **Created:** 10/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `perf/conversation-buffer-overwrite` --- ### 📝 Commits (1) - [`0d2c9ab`](https://github.com/Niko1221/Strata/commit/0d2c9abf84a908be37a15ff45574d96c80db92c0) Add opt-in overwrite growth for conversation snapshot buffers ### 📊 Changes **6 files changed** (+385 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+3 -0) ➕ `bench/results/conversation-overwrite/README.md` (+64 -0) ➕ `bench/results/conversation-overwrite/historical-v0145.csv` (+19 -0) 📝 `include/strata/core/conversation_buffer.hpp` (+86 -39) ➕ `src/core/conversation_buffer_test.cpp` (+197 -0) 📝 `src/core/conversation_snapshot.cpp` (+16 -1) </details> ### 📄 Description ## Summary Parking a long conversation grows host K/V buffers and then overwrites the new bytes with the snapshot copy. Add an opt-in overwrite growth path to avoid initializing those bytes twice. Only `STRATA_SNAPSHOT_NOFILL=1` enables it; the default still fills new bytes. Related: #2264. ## What changed - Store each `ConversationBuffer` segment in owned raw byte storage while preserving value semantics, address stability and ordinary resize filling. - Add `resize_for_overwrite` and use it at the snapshot capture call site under the opt-in switch. Keep the existing cache policy and snapshot format. - Add host tests for full overwrite, retained prefixes, segment boundaries, copy/move, allocation failure, failed transfer callbacks and discard/retry. - Include sanitized historical v0.1.45 park timings and their limits in `bench/results/conversation-overwrite/`. ## Validation and remaining work Standalone buffer tests on this main-based candidate: 92 checks pass with MSVC 19.44, C++17, optimized build. A separate v0.1.44.1 backport builds CUDA sm_86 and passes 92 buffer checks, 4,219 cache checks and 36 checkpoint split allocation-failure cases. The CSV is historical evidence from one patched v0.1.45 binary and two RTX 3090 cards at a 262,144-token context. It includes a slower overwrite run under host contention; it is not a current-main or backport benchmark. The README documents exactly what is timed and omitted. No model, private path, config, prompt, binary or credential is included. **Draft: not ready for review.** Full current-main CUDA, HIP and SYCL builds remain outstanding. HIP/SYCL toolchains are unavailable on this host. Fresh same-binary backport A/B, prefix edits, two alternating long histories, HTTP error recovery, and a NOFILL-enabled 3-hour/50-request soak are not yet complete. No production binary has been replaced. There is no claim that temperature zero makes outputs deterministic or that all failure modes have been covered. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:36:14 +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#4466
No description provided.