mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3231] [Engine] macOS: conversation cache parks and restores (Metal checkpoints, K/V description, memory guard) #4512
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#4512
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/3231
Author: @mnott
Created: 10/19/2026
Status: 🔄 Open
Base:
main← Head:macos-conversation-cache📝 Commits (6)
d3860a2fix(metal): conversation checkpoints validate and park on Metal4efa6b8fix(macos): memory guard reads available RAM on macOS92ff83efix(metal): validate checkpoints against the Metal window sizesb67c168fix(metal): describe the window's K/V in the session's QsaStates for conversation snapshotse993570fix(metal): session fingerprint reads the MTP file the Metal engine loads1448109fix(metal): session restore accepts the files this engine saves📊 Changes
10 files changed (+244 additions, -35 deletions)
View changed files
📝
include/strata/core/conversation_file.hpp(+15 -0)📝
metal/CMakeLists.txt(+7 -1)📝
metal/src/engine/window.cpp(+63 -16)➕
metal/tests/session_limits_test.cpp(+58 -0)📝
src/core/conversation_file.cpp(+15 -0)📝
src/core/conversation_file_test.cpp(+21 -0)📝
src/core/conversation_memory.cpp(+18 -0)📝
src/core/conversation_state.cpp(+37 -13)📝
src/core/mtp.cpp(+3 -0)📝
src/program/generate.cpp(+7 -5)📄 Description
Rebased onto v0.2.6 (same six commits).
Problem and result
On macOS (Metal) the conversation cache never parks a conversation: v0.2.6 logs
conversation cache: skip parking (conversation snapshot: invalid checkpoint running-state payload)after every request, so two alternating agent conversations re-read their whole prompt on every turn. With this change Metal parks and restores conversations.Measured on v0.2.6 vs this branch, Apple Silicon, 128 GB unified memory, Gyro-M TQ2_0, same server config (
--conversation-cache-mib 12288 --conversation-cache-slots 4), three Anthropic-API requests: conversation A (18,012 prompt tokens), a different conversation B (3,995), then A again:restored 18005 tokens (checkpoint) in 24.2 ms, 7 tokens read)Related discussion
Overview of our related macOS / Metal contributions: #4128.
Approach
Validation
Branch head
1448109465c3e06bbf2189eb37582ec23d13696d, six commits onv0.2.6.Passed:
strataon macOS.v0.2.6.Failed:
Not run:
Limits
Measured with four conversation slots and a 12 GiB budget. Slot eviction was exercised (three concurrent conversations plus the shared prefix: 5 evictions, no errors); eviction under memory pressure was not.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.