Repository navigation
Bound Undo history growth after bulk edits - #1263
Merged
Merged
Conversation
This was referenced Oct 16, 2026
nihilist-narwhal
added a commit
to nihilist-narwhal/gridcraft
that referenced
this pull request
Nov 2, 2026
The undo history drops its oldest steps past 100 entries or 128 MB of snapshots (storytold#1263). The command-sequence fuzzer still compared "undo everything" with the episode's starting workbook, so any episode whose snapshots passed the budget failed with "undoing all N steps doesn't give back the starting workbook" although undo worked (seeds 104, 110 and 163 at 80 steps: a column inserted next to whole-column borders, or rows deleted after filling whole columns, each made a 100 MB step). The harness notices when an undoable command changed the workbook without the history growing, and then compares with the state before the oldest step still in the history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
skylartaylor
pushed a commit
that referenced
this pull request
Nov 18, 2026
* Fuzzer: undo checks follow the bounded undo history The undo history drops its oldest steps past 100 entries or 128 MB of snapshots (#1263). The command-sequence fuzzer still compared "undo everything" with the episode's starting workbook, so any episode whose snapshots passed the budget failed with "undoing all N steps doesn't give back the starting workbook" although undo worked (seeds 104, 110 and 163 at 80 steps: a column inserted next to whole-column borders, or rows deleted after filling whole columns, each made a 100 MB step). The harness notices when an undoable command changed the workbook without the history growing, and then compares with the state before the oldest step still in the history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fuzzer: undo and redo checks follow the reachable history boundary Review of #2332. The harness now tracks the oldest state the undo history can reach instead of a trimmed flag: whenever the history's oldest entry changes without it emptying in between, the history dropped a step, and undoing everything stops at the new oldest entry. That boundary is kept when an edit.undo in the sequence uses up the retained history before the episode ends, which used to fall back to the episode's start and report a false undo mismatch. The redo round trip no longer assumes n undos leave n redo entries: the redo history is bounded too, so when it dropped the first step undone, redo is expected to stop at the oldest entry it kept. --------- Co-authored-by: nihilist-narwhal <240798405+nihilist-narwhal@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Repeated bulk formula edits could keep about 1.45 GB of old workbook snapshots alive because Undo stopped only at 100 steps. This change estimates the cell-band storage retained by each history step and removes the oldest steps once the estimated total exceeds 128 MiB. The newest edit always remains undoable, and ordinary small edits can still use the full 100-step history.
The estimate accounts for copy-on-write bands, formulas, and cell values; it is a history budget, not a hard cap on process memory. Undo and Redo use the same trimming policy. No UI behavior or file format changes are involved.
Fixes #1227.
Validation (updated 14 October 2026 for commit
72db972de306a165af5296cb2e5f932a19c0cc02):cargo xtask cipassed locally on Windows: formatting, workspace Clippy, all workspace tests, assets, layering, WASM, parity, and keytips.This PR was opened before the required full local suite had finished because the drive was short of space. That was premature. After resolving the storage blocker without removing the existing GridCraft build cache, I reran the complete local gate on the unchanged PR commit. The local test environment also needed a writable temporary directory and permission for a loopback-socket integration test; the final run completed successfully.