Skip to content

memory: clear rollback markers for every shared sequence - #365

Open
bri-prism wants to merge 1 commit into
seqcp-rollback-mtp-depthfrom
fix/pr354-shared-rollback
Open

bri-prism wants to merge 1 commit into
seqcp-rollback-mtp-depthfrom
fix/pr354-shared-rollback

Conversation

@bri-prism

Copy link
Copy Markdown
Collaborator

Stacked on #354, targeting seqcp-rollback-mtp-depth. Merge this correction into that branch before merging #354, or retarget after its parent lands.

After rollback and seq_cp(0, 1), a decode tagged with both sequence IDs consumes the shared recurrent snapshot. s_copy currently clears only the first sequence's rollback marker. A later decode on sequence 1 restores the old snapshot again and produces incorrect recurrent state. Clear the marker for every sequence sharing the advanced cell.

Extend the existing pending-rollback regression to cover both a direct fork continuation and a shared token followed by a sequence-1-only token. Both compare serialized recurrent state against an independently rolled-back reference.

Validation: assertions-enabled CPU build, existing rollback suite plus both fork cases pass on generated Qwen3.5, Nemotron-H, and DeepSeek V4 fixtures. With only the production correction removed, the new shared case fails on Qwen3.5 and Nemotron-H; the direct case still passes. DeepSeek V4 remains passing in both controls because it uses a separate state implementation. No new test file. GPU execution was not tested for this correction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant