Skip to content

LEP: Successor locks for scoped causality tracking#39

Open
mjansson wants to merge 1 commit into
mainfrom
mjansson/successor-locks-lep
Open

LEP: Successor locks for scoped causality tracking#39
mjansson wants to merge 1 commit into
mainfrom
mjansson/successor-locks-lep

Conversation

@mjansson

Copy link
Copy Markdown
Collaborator

Summary

This proposal adds causal exclusive locks for unmergeable files in Lore's free branching model.

Each unmergeable file gains a server-side per-file "head" pointer naming the latest revision that modified it within a lock scope. An exclusive lock can only be acquired on a branch whose last-modification revision for the file (looked up via Lore's existing per-file-id back-pointer index) equals that head — i.e. the branch already contains every prior committed edit in scope.

Each unmergeable file becomes one linear edit chain per scope, embedded in the larger DAG; the lock acquisition is the gate that enforces successor-only progress within the scope. Scopes are first-class server-side entities with their own identity and lifecycle, independent of any specific branch; each branch carries a scope_id in its metadata, inherited from its parent at creation.

A repository has a default scope that all branches join unless they explicitly opt into another scope; a repository that only ever uses the default scope behaves identically to a global per-file chain (the degenerate case).

The check is constant-bounded — a single revision-id comparison against Lore's existing back-pointer lookup — with no path-keyed state and no materialized (branch × file) indices.

@mjansson mjansson requested review from ayyyee and ragnarula June 20, 2026 02:31

@rajpratham1 rajpratham1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This proposal is well thought out and addresses a real limitation of exclusive locking in a free-branching workflow. The distinction between temporal locking and causal ordering is clearly explained, and the introduction of scoped successor locks provides a scalable solution without introducing expensive global state. The design also does a good job of leveraging existing infrastructure (back-pointer index and mutable store) instead of adding complex new indexing.

@rajpratham1 rajpratham1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice proposal overall. I like how it separates lock state from causality rather than trying to make a single mechanism solve both problems. The motivation clearly explains why traditional exclusive locks are insufficient under free branching, and the scoped successor-chain approach feels like a natural extension of Lore's existing architecture.

The design also scales well by reusing the existing per-file back-pointer lookup and keeping the validation to a constant-bounded revision comparison instead of introducing branch × file state. The scope abstraction is well motivated and avoids unnecessary coupling between release branches, main, and experimental work.
I also appreciate that the proposal discusses lifecycle management, enforcement policies, and the degenerate cases up front, making it easier to reason about operational behavior.

I don't see any blocking concerns from what I've reviewed. Looks solid to me and I'm happy to approve. Nice work! 🚀

@mjansson mjansson force-pushed the mjansson/successor-locks-lep branch from eec6169 to cf76f1b Compare June 22, 2026 00:40
Signed-off-by: Mattias Jansson <mattias.jansson@epicgames.com>
@mjansson mjansson force-pushed the mjansson/successor-locks-lep branch from cf76f1b to a09b07c Compare June 22, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants