Repository navigation
fix(checkpoint): keep the checkpoints a branch was made before - #102
Merged
voipmonitor merged 2 commits intoSep 28, 2026
Merged
Conversation
Supersession marked every checkpoint of an earlier request whose prompt the new prompt extends, including its longer response checkpoint. When the new request branched off before that response (a retry, an aborted turn resumed with other tokens, an auto-continue), the original line's response checkpoint lost its unique recurrent-state pages at the next L1 pressure or clean shutdown while its manifest stayed listed, so the turn that continued it failed with 'K of M pages were readable' and recomputed (lmcache-supersession-repro, R1: 13 of 22 pages). A sibling checkpoint is now superseded only when the new prompt is longer than it, i.e. the conversation moved past it; ancestors are unchanged. The shutdown flush also writes superseded pages after the current ones within the same budget: they stay listed, and a shutdown writes each at most once, so a branch restores after a restart instead of recomputing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Sep 28, 2026
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.
Problem. Reported in the GLM TP2 Discord thread by hashspamjam, mrweiner and ktsaou: a conversation that continues after a retry, an aborted turn resumed with other tokens, or an auto-continue sometimes fails to restore. The log shows "K of M pages were readable" with exactly the recurrent-state pages missing, and the whole prompt is recomputed. mrweiner's analysis and reproducer are at https://github.com/mrweiner/lmcache-supersession-repro.
When a new request's prompt checkpoint superseded an earlier request's checkpoint,
supersede()also marked every sibling of that request as superseded, including its longer response checkpoint. A branch that started before that response left the response's unique pages marked superseded while its manifest stayed listed. Those pages were then:The turn that continued the original line then failed its restore.
Fix.
This is a focused alternative to #101. See our comment there about the rest of that change.
Tests.
tests/v1/multiprocess/test_checkpoint_storage.pyandtests/v1/distributed/test_checkpoint_retention.py: 65 passed (base: 64). The newtest_a_branch_keeps_the_checkpoints_it_branched_beforeand the updated shutdown-flush test both fail on base.glm53-spark-tp2, betac10dcc1b, LMCache L1 24 GB / L2 128 GB, on-evict, prune stale). mrweiner's reproducer ran with--mode all --restart-between-cells:40239: 13 of 22 pageson both ranks, walk-down to 40000/36864, full recomputeThe shutdown flush with this PR wrote, for example, "84 current and 34 superseded checkpoint pages" in 0.2 s.
🤖 Generated with Claude Code