mirror of
https://github.com/penpot/penpot.git
synced 2026-11-02 08:00:36 +00:00
A branch base was a fully realized copy of main. With fdata/pointer-map, creation now stores main's fragment pointers: the base costs one pointer per page and shares main's fragment rows. Fragment rows are keyed by (file_id, id), so the base readers (the branch derive and get-base-data) realize the base with the source file id through realize-branch-base. The branch file's own loader finds none of main's fragments. Every writer of a snapshot that names main's fragments reads main's row FOR SHARE, so it serializes with file-gc, which takes the row FOR UPDATE and marks every fragment no committed snapshot names. Creation, the pre-merge snapshot, and the base repositioned by an update from main follow that rule. The merge and the update put main's stored pointer back on every page they left unchanged, so the merge rewrites only the pages it changed and a repositioned base shares main's fragments. The hand-written pmap bindings move to fdata/with-tracked-pointers. AI-assisted-by: claude-opus-5-5 Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>