server: resolve Responses response ids to KV prefixes - #752
Open
perfloop-agent wants to merge 2 commits into
Open
server: resolve Responses response ids to KV prefixes#752perfloop-agent wants to merge 2 commits into
perfloop-agent wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resp_id before response serialization and retain a bounded record for its exact model frontier, prompt configuration, and generated tool-call bindings.previous_response_idrequests from that record, render and tokenize only the supplied continuation tail, and synchronize it onto the saved prefix.Persistence and limits
Disk-backed response state now follows the normal continued-cache boundary instead of copying a checkpoint after every completed turn. A failed or over-budget write still advances the recorded boundary, preventing short tails from repeatedly staging the same payload. Durable records restore their response metadata and tool-call bindings after restart; ids between durable boundaries remain live-process continuations and require replay after restart or slot displacement.
The response-state index is FIFO-bounded. The endpoint benchmark covers HTTP dispatch through prefix synchronization with a byte-tokenizer/checkpoint fixture; it does not measure model or GPU inference throughput.
Testing
make -B cpu -j2make -B ds4_test -j2 && ./ds4_test --servermake -B tests/responses_replay_bench -j2 && ./tests/responses_replay_bench --turns 172 --iterations 20No model-backed Metal, SSD-streaming, CUDA, or distributed run was performed.
Workload:
in-memory steady-state 8k-token Responses response-id host ingresshost_ingress_ns/opAuthored and verified by Perfloop: every claim above was co-measured on both trees and independently re-verified before submission — the full record is public: case_avefhzk2jy. Replies from this account are human-approved, and a human operator is accountable for this contribution.