Abstract
The use of version control is pervasive in collaborative software projects. Version control systems are based on two primary operations: diffing two versions to compute the change between them and merging two versions edited concurrently. Recent works provide solutions to diff and merge graphics assets such as images, meshes and scenes. In this work, we present a practical algorithm to diff and merge procedural programs written as node graphs. To obtain more precise diffs, we version the graphs directly rather than their textual representations. Diffing graphs is equivalent to computing the graph edit distance, which is known to be computationally infeasible. Following prior work, we propose an approximate algorithm tailored to our problem domain. We validate the proposed algorithm by applying it both to manual edits and to a large set of randomized modifications of procedural shapes and materials. We compared our method with existing state-of-the-art algorithms, showing that our approach is the only one that reliably detects user edits.
Supplemental Material
Available for Download
supplemental
- David B Blumenthal, Nicolas Boria, Johann Gamper, Sébastien Bougleux, and Luc Brun. 2020. Comparing heuristics for graph edit distance computation. The VLDB journal 29, 1 (2020), 419--458.Google ScholarDigital Library
- David B Blumenthal, Sébastien Bougleux, Johann Gamper, and Luc Brun. 2018. Ring based approximation of graph edit distance. In Structural, Syntactic, and Statistical Pattern Recognition: Joint IAPR International Workshop, S+ SSPR 2018, Beijing, China, August 17--19, 2018, Proceedings. Springer, 293--303.Google Scholar
- David B Blumenthal and Johann Gamper. 2017. Improved lower bounds for graph edit distance. IEEE Transactions on Knowledge and Data Engineering 30, 3 (2017), 503--516.Google ScholarCross Ref
- David B Blumenthal and Johann Gamper. 2020. On the exact computation of the graph edit distance. Pattern Recognition Letters 134 (2020), 46--57.Google ScholarDigital Library
- David B Blumenthal, Johann Gamper, Sébastien Bougleux, and Luc Brun. 2021. Upper bounding graph edit distance based on rings and machine learning. International Journal of Pattern Recognition and Artificial Intelligence 35, 08 (2021), 2151008.Google ScholarCross Ref
- Nicolas Boria, David B Blumenthal, Sébastien Bougleux, and Luc Brun. 2020. Improved local search for graph edit distance. Pattern Recognition Letters 129 (2020), 19--25.Google ScholarCross Ref
- H. Bunke. 1997. On a Relation Between Graph Edit Distance and Maximum Common Subgraph. Pattern Recogn. Lett. 18, 9 (1997).Google ScholarDigital Library
- Claudio Calabrese, Gabriele Salvati, Marco Tarini, and Fabio Pellacini. 2016. cSculpt: a system for collaborative sculpting. ACM Trans. Graph. 35, 4 (2016).Google ScholarDigital Library
- Edoardo Carra and Fabio Pellacini. 2019. SceneGit: A Practical System for Diffing and Merging 3D Environments. ACM Trans. Graph. 38, 6, Article 159 (2019), 15 pages.Google ScholarDigital Library
- Guilherme Cavalcanti, Paulo Borba, and Paola Accioly. 2017. Evaluating and Improving Semistructured Merge. Proc. ACM Program. Lang. 1, OOPSLA, Article 59 (oct 2017), 27 pages. Google ScholarDigital Library
- Scott Chacon. 2009. Pro Git. Apress.Google Scholar
- Hsiang-Ting Chen, Tovi Grossman, Li-Yi Wei, Ryan M. Schmidt, Björn Hartmann, George Fitzmaurice, and Maneesh Agrawala. 2014. History Assisted View Authoring for 3D Models. In Proc. SIGCHI.Google ScholarDigital Library
- Hsiang-Ting Chen, Li-Yi Wei, and Chun-Fa Chang. 2011. Nonlinear revision control for images. ACM Trans. Graph. 30 (2011).Google Scholar
- Fernando Chirigati, Juliana Freire, David Koop, and Cláudio Silva. 2013. VisTrails provenance traces for benchmarking. In ACM International Conference Proceeding Series.Google ScholarDigital Library
- Timothee Cour, Praveen Srinivasan, and Jianbo Shi. 2007. Balanced Graph Matching. In Advances in Neural Information Processing Systems 19, B. Schölkopf, J. C. Platt, and T. Hoffman (Eds.).Google Scholar
- Jonathan D. Denning, William B. Kerr, and Fabio Pellacini. 2011. MeshFlow: Interactive Visualization of Mesh Construction Sequences. ACM Trans. Graph. 30, 4 (2011).Google ScholarDigital Library
- Jonathan D. Denning and Fabio Pellacini. 2013. MeshGit: Diffing and Merging Meshes for Polygonal Modeling. ACM Trans. Graph. 32, 4 (2013).Google ScholarDigital Library
- Jonathan D. Denning, Valentina Tibaldo, and Fabio Pellacini. 2015. 3DFlow: Continuous Summarization of Mesh Editing Workflows. ACM Trans. Graph. 34, 4 (2015).Google ScholarDigital Library
- Jozef Doboš, Carmen Fan, Sebastian Friston, and Charence Wong. 2018. Screen Space 3D Diff: A Fast and Reliable Method for Real-time 3D Differencing on the Web. In Proceedings of the 23rd International ACM Conference on 3D Web Technology (Web3D '18).Google ScholarDigital Library
- Jozef Doboš, Kristian Sons, Dmitri Rubinstein, Philipp Slusallek, and Anthony Steed. 2013. XML3DRepo: a REST API for version controlled 3D assets on the web. In Web3D.Google Scholar
- Jozef Doboš and Anthony Steed. 2012a. 3D Diff: an interactive approach to mesh differencing and conflict resolution. In SIGGRAPH Asia Technical Briefs.Google Scholar
- Jozef Doboš and Anthony Steed. 2012b. 3D revision control framework. In Web3D.Google Scholar
- Jean-Rémy Falleri, Floréal Morandat, Xavier Blanc, Matias Martinez, and Martin Monperrus. 2014. Fine-grained and accurate source code differencing. In ACM/IEEE International Conference on Automated Software Engineering, ASE '14, Vasteras, Sweden - September 15 -- 19, 2014. 313--324.Google ScholarDigital Library
- Xinbo Gao, Bing Xiao, Dacheng Tao, and Xuelong Li. 2010. A Survey of Graph Edit Distance. Pattern Analysis and Applications 13, 1 (2010).Google Scholar
- Floraine Grabler, Maneesh Agrawala, Wilmot Li, Mira Dontcheva, and Takeo Igarashi. 2009. Generating Photo Manipulation Tutorials by Demonstration. ACM Trans. Graph. 28, 3 (2009).Google ScholarDigital Library
- Tovi Grossman, Justin Matejka, and George W. Fitzmaurice. 2010. Chronicle: capture, exploration, and playback of document workflow histories. In UIST.Google Scholar
- Nicholas Kong, Tovi Grossman, Björn Hartmann, Maneesh Agrawala, and George Fitzmaurice. 2012. Delta: A Tool for Representing and Comparing Workflows. In Proc. SIGCHI (CHI '12).Google ScholarDigital Library
- Gonzalo Navarro. 2001. A Guided Tour to Approximate String Matching. ACM Comput. Surv. 33, 1 (2001), 31--88.Google ScholarDigital Library
- Michel Neuhaus and Horst Bunke. 2007. Bridging the Gap between Graph Edit Distance and Kernel Machines. World Scientific Publishing.Google Scholar
- Onshape. 2014. Full-cloud 3d cad system. https://www.onshape.com/.Google Scholar
- Bryan O'Sullivan. 2009. Mercurial: The Definitive Guide. O'Reilly Media.Google ScholarDigital Library
- Mateusz Pawlik and Nikolaus Augsten. 2015. Efficient Computation of the Tree Edit Distance. ACM Trans. Database Syst. 40, 1, Article 3 (2015), 40 pages.Google ScholarDigital Library
- Kaspar Riesen and Horst Bunke. 2009. Approximate graph edit distance computation by means of bipartite graph matching. Image and Vision Computing 27, 7 (2009), 950--959. 7th IAPR-TC15 Workshop on Graph-based Representations (GbR 2007). Google ScholarDigital Library
- Kaspar Riesen, Andreas Fischer, and Horst Bunke. 2017. Improved graph edit distance approximation with simulated annealing. In Graph-Based Representations in Pattern Recognition: 11th IAPR-TC-15 International Workshop, GbRPR 2017, Anacapri, Italy, May 16--18, 2017, Proceedings 11. Springer, 222--231.Google ScholarDigital Library
- Gabriele Salvati, Christian Santoni, Valentina Tibaldo, and Fabio Pellacini. 2015. Mesh-Histo: collaborative modeling by sharing and retargeting editing histories. ACM Trans. Graph. 34, 6 (2015).Google ScholarDigital Library
- Pep Santacruz and Francesc Serratosa. 2020. Error-tolerant graph matching in linear computational cost using an initial small partial matching. Pattern Recognition Letters 134 (2020), 10--19.Google ScholarDigital Library
- Christian Santoni, Gabriele Salvati, Valentina Tibaldo, and Fabio Pellacini. 2018. LevelMerge: Collaborative Game Level Editing by Merging Labeled Graphs. IEEE CG&A 38, 4 (2018).Google Scholar
- Dana Shapira and James A Storer. 2007. Edit distance with move operations. Journal of discrete algorithms 5, 2 (2007), 380--392.Google ScholarDigital Library
- Marcelo Sousa, Isil Dillig, and Shuvendu K. Lahiri. 2018. Verified Three-Way Program Merge. Proc. ACM Program. Lang. 2, Article 165 (2018), 29 pages.Google Scholar
- Kaizhong Zhang. 1989. The editing distance between trees: algorithms and applications. Ph.D. thesis, New York University (1989).Google Scholar
- K. Zhang and D. Shasha. 1989. Simple Fast Algorithms for the Editing Distance Between Trees and Related Problems. SIAM J. Comput. 18, 6 (1989).Google ScholarDigital Library
- Kaizhong Zhang, Rick Statman, and Dennis Shasha. 1992. On the editing distance between unordered labeled trees. Inform. Process. Lett. 42, 3 (1992), 133--139.Google ScholarDigital Library
Index Terms
- NodeGit: Diffing and Merging Node Graphs
Recommendations
A graph-based algorithm for three-way merging of ordered collections in EMF models
We present an algorithm for three-way merging of ordered collections.Our algorithm performs a topological sort on a combination of linearly ordered input graphs.Within the input sequences, arbitrary moves are allowed.The implementation of our algorithm ...
Branching and merging: an investigation into current version control practices
CHASE '11: Proceedings of the 4th International Workshop on Cooperative and Human Aspects of Software EngineeringThe use of version control has become ubiquitous in software development projects. Version control systems facilitate parallel development and maintenance through branching, the creation of isolated codelines. Merging is a consequence of branching and ...
Effective Software Merging in the Presence of Object-Oriented Refactorings
Current text based Software Configuration Management (SCM) systems have trouble with refactorings. Refactorings result in global changes which lead to merge conflicts. A refactoring-aware SCM system reduces merge conflicts. This paper describes ...
Comments