diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 19:47:19 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 20:49:41 -0300 |
| commit | 9e504559356ed985999d8625947d9b08ad582792 (patch) | |
| tree | 458f191f28d949d3025bd9f7f2c085e92fba634b /src/Kind.zig | |
| parent | 992d5b1aa2813fcba05d8564872f8d426eade9f6 (diff) | |
| download | pardes-9e504559356ed985999d8625947d9b08ad582792.tar.gz pardes-9e504559356ed985999d8625947d9b08ad582792.zip | |
rollback: a replica's core writes a file's text and its line index in place, as the session's does, and its rollback copy keeps none of their bytes: the epoch notes what each write into a text or an index that was there when the copy was taken took out (rollback.Epoch.wrote, from File.edit and shiftIndex), and putting the copy back writes that back, the newest first, before the saved bytes go back (unwrite), where a replica's edit made a whole new text and a whole new index at every key so that the copy could pin the old ones; the bridge the journal left for this goes with it: rollback.isEpoch, File.keepsBytes (a text a join is still sending is copied on write as before, memory.isPinned), the replica's copy-on-write in File.edit and shiftIndex's `keep` (its in-place shift is File.shiftStarts, which the rollback runs turned round); the journal's steps, its `done` and its entries come back as the copy saved them, an entry a speculation merged into and the redo entries it dropped being saved bytes and put-off frees; File.State's content and line_starts are annotated `.journal`, which the copy neither saves nor pins (line_starts leaves `.blob`); a write that could not be noted (no memory) fails the replica at its rollback; tests: rollback.zig's 'a text written in place under a copy comes back byte for byte: typed into its room, undone, cut, and grown past it' is new, and File.zig's 'a line index shifted in place equals a rebuilt one' becomes '..., and the edit turned round gives the one before back' (its every tenth shift made anew, as a replica's core made them, gives way to the shift turned round in a copy, as a rollback makes it)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/Kind.zig')
0 files changed, 0 insertions, 0 deletions
