foo<<<bar===t>>> I’m kidding, but only a bit: the (in hindsight, reasonable) lesson of the Pijul paper[1] is that if you want to do the most general merge and (therefore) avoid any arbitrary choices, you’re forced to extend your model from consistent files as sequences to files potentially containing conflicts as DAGs (or something even more complicated if you have data more complex than a single flat sequence or edits other than insertions). Or you can very carefully make a consistent set of arbitrary choices, like implementations of operational transformation usually do. [1] https://doi.org/10.1016/j.entcs.2013.09.018
A Categorical Theory of Patches
Samuel Mimram, Cinzia Di Giusto
2013 · arXiv
- HN score
- 0
- Mentions
- 12
- Readers
- 12
- Months
- 12
From the abstract
When working with distant collaborators on the same documents, one often uses a version control system, which is a program tracking the history of files and helping importing modifications brought by others as patches. The implementation of such a system requires to handle lots of situations depending on the operations performed by users on files, and it is thus difficult to ensure that all the corner cases have been correctly addressed. Here, instead of verifying the implementation of such a system, we adopt a complementary approach: we introduce a theoretical model, which is defined abstractly by the universal property that it should satisfy, and work out a concrete description of it. We begin by defining a category of files and patches, where the operation of merging the effect of two coinitial patches is defined by pushout. Since two patches can be incompatible, such a pushout does not necessarily exist in the category, which raises the question of which is the correct category to represent and manipulate files in conflicting state. We provide an answer by investigating the free completion of the category of files under finite colimits, and give an explicit description of this category: its objects are finite sets labeled by lines equipped with a transitive relation and morphisms are partial functions respecting labeling and relations.
Metadata: arXiv. Abstracts retain their original authors’ rights.
In the conversation
Original HN comments, with labels from simple text rules. A label describes the whole comment and may miss context or irony. Read the discussion to make up your own mind. About the labels
12 selected excerpts · 12 total mentions
No big deal from my perspective. I was just explaining my cautious wording. I know you've been open about working with/from "ideas/people" in the darcs community, and good about the shoulders [1] the pijul work stands on/improves, and I also dislike people not giving credit where it is due. Sometimes a few bad apples ruin many things. FWIW, I liked the name "Anu" better. :-/ EDIT: and thanks for all your hard work on Pijul! [1] https://arxiv.org/abs/1311.3903
In the vaguest sense, sure. But if a file is a list of lines, this "ambiguous file" is a digraph of lines. If a file is instead a tree of strings, what does an "ambiguous file" look like? See this paper which was the source of some of the main ideas of Pijul, and in particular, note that its extension to structured data is listed as "future work", which means it probably hasn't been done yet. https://arxiv.org/pdf/1311.3903.pdf
I have no real understanding of this, but following the bread crumbs, I found this in Pijul's site (my emphasis below): > In that paper, and in Pijul, the definition of a file is slightly expanded, to included these cases, and “artificially add” all pushouts of all possible patches to the space of files. > The resulting structure is a graph of byte chunks (which can be for instance binary blocks, lines, or smaller parts, such as indentation). > The relation between them, described by the graph edges, is the order in which they appear in the files. This graph acts as a “cache” of applied patches. From: https://pijul.com/model/#pushouts-and-distributed-algorithms The paper is they mention is the same one in GP's linked article. A Categorical Theory of Patches - https://arxiv.org/abs/1311.3903
Rust or any procedural language seems not to be the most apt lang to do a first implementation / rewrite of a patch theory. Patches themselves have already been generalized to paths using HOTT ref: https://www.cs.cmu.edu/~rwh/papers/htpt/paper.pdf. The takeaway from https://arxiv.org/abs/1311.3903 is the use of commutation to allow for push out while the HOT ref discusses pseudocommutation regarding merges. See the footnote about commutation being inaccurate term regarding darts model. With the addition of ojo "ghost" deletes and pseudo edges, a formal implementation should provide a non-exponential model/algorithm amenable for optimization.
Pijul (https://pijul.org/) is based on a categorical theory of patches (https://arxiv.org/abs/1311.3903). It is similar to Darcs but written in Rust. They claim that Pijul has solved the exponential merge problem. The docs, FAQ, and blogs, in particular the last one, are interesting readings.
I am a mathematician and generally bearish on category theory in programming. The best argument for it I've seen so far is that it can inform the design of your system to give it desirable properties, like how the DVCS Pijul [1] bases its data structures on patches and its merge operation on categorical pushouts [2] -- also explained at length in a series of blog posts [3]. I found the whole idea and reasoning behing the merge system very convincing, and am not sure it could have been arrived at or explained as clearly without category theory guiding the way. [1] https://pijul.org/ [2] https://arxiv.org/abs/1311.3903 [3] https://jneem.github.io/merging/
This article has led me to Shapiro & Preguiça (2007) https://arxiv.org/pdf/0710.1784.pdf The whole idea that commutativity gives you a better-behaved transition to consistency reminds me of how the theory of patches gives DARCS/Pijul better handling of branches than Git. Cf. Mimram & Giusto (2013) https://arxiv.org/pdf/1311.3903.pdf
> Pijul is the only version control system based on a complete mathematical theory of patches. [1] Can someone please provide a link to that theory? [1] https://nest.pijul.com/ EDIT: This? https://arxiv.org/abs/1311.3903
Yeah, the logic behind it is based on patch theory (a subset of category theory) as put forth in this paper: https://arxiv.org/abs/1311.3903 It's a really interesting idea.
Thanks for mentioning 'Dat Project', hadn't heard of it before. Do you know if any of these distributed file stores are making use of this[1] result like Pijul? It'd be amazing if these projects converge on making version control, package management and any sort of information distribution (internet) into the same thing. Currently it feels like they are all working in separate corners on what they consider to be 'the abstraction that will eat the world' so to speak.. [1]: https://arxiv.org/abs/1311.3903
This might be deeper than you are looking for, but this is the theory it's based on, and even has diagrams. :) https://arxiv.org/abs/1311.3903
Keep following the thread.
More in EconomicsMore from the same topics.
Statistical Consequences of Fat Tails: Real World Preasymptotics, Epistemology, and Applications
Nassim Nicholas Taleb
(The third edition corrects minor typos and adds 3 chapters synthesized from published papers plus an appendix on maximum entropy distributions.) The monograph investigates the misapplication of conventional statistical techniques to fat tailed distributions and looks for remedies, when possible.
Impact of community masking on COVID-19: A cluster-randomized trial in Bangladesh
Jason Abaluck, Laura H. Kwong, Ashley Styczynski +19
Persuading people to mask Even in places where it is obligatory, people tend to optimistically overstate their compliance for mask wearing.
Markets are efficient if and only if P = NP
Philip Maymin
I prove that if markets are weak-form efficient, meaning current prices fully reflect all information available in past prices, then P = NP, meaning every computational problem whose solution can be verified in polynomial time can also be solved in polynomial time.