Upstream first or the path lifting property of a covering space

Applying mathematical concepts to FOSS deployments provides new and interesting ways of understanding the interrelated nature of open source software.
3 readers like this
3 readers like this
Math formulas in green writing

João Trindade. Modified by Jason Baker. CC BY-SA 2.0.

Don't be scared; when you reach the end of this article, you will understand its title.

Understand spaces

Geometry and Topology is an area of mathematics that deals with spaces, usually topological, and various additional structures you can define on them.

How do you turn a set of elements into a list? "You use the list() function!" say my Pythonic friends. But essentially, you add the idea of an order. You take the set and explain which point in that set is next. Similarly, spaces are sets of elements with these additional concepts:

  • For a topological space, add the idea of a neighborhood. You explain how to tell that two points are close.
  • For a metric space, add the idea of a distance. You explain how to measure the distance between any two points of the set.

There are many types of spaces in mathematics, from a well-known Euclidean space to a less known but not less common differentiable manifold all the way to exotic structures invented moments ago. And the research in this area circles around finding relationships between different structures and determining whether they define the same basic object.

For example, it is quite easy to prove that a metric space is always a topological space. But it is a bit harder to show that there are topological spaces that can not be expressed in terms of distance.

However, for the casual weekend topologists out there, I recommend two-dimensional surfaces, for example, the good old sphere, torus, or a Mobius strip. Not as square and flat as the Euclidean plane, but still manageable. And the classification theory of two-dimensional compact manifolds is a lot of fun.

Covering space

Take a spring coil and look at it from the top. You will see a circle.

 

spring

(Aleksandra Fedorova, CC BY-SA 4.0)

Expressing this fact in mathematical language, you would say that the coil itself is the total space. In this case, on its own, it is just a one-dimensional line. It is made up of various components:

  • The circle you see is a base space.
  • The line of sight defines the covering map.
  • If you had a laser sight, the points where the laser would cut the coil would be called a fiber.

And altogether, total space, base space, and covering map define the covering space or a covering of a circle by a line with discrete fiber.

Homework: Can a circle cover a line?

The critical quality of the covering space, which makes it different from just any projection, is that the neighborhood of each fiber point in the total space works very much the same as the neighborhood of its projection in the base space. This allows you to reason about specific properties of a total space using the pre-existing knowledge of a base space and vice versa.

And mathematicians just love to move between spaces in this way. Once you hit a certain roadblock with the space you are currently researching, you craft a clever mapping of the space onto familiar grounds. You prove something there and then transfer the result back into the original space, where it can lead to new and exciting breakthroughs.

Path lifting property

What does it all have to do with upstream first?, you may ask. (We are yet in the early stages of developing a proper mathematical apparatus for this theory. Feel free to add your suggestions and corrections in the comments section below.)

Look at how code is delivered to an enterprise-level Linux distribution, for example, CentOS Stream. There is an open source project and community which develops a specific version of a piece of software, for example, Firefox. We call such a project upstream. Once the upstream project releases a Firefox version, it gets packaged to Fedora. And then someday, the new CentOS Stream version is bootstrapped using the content of the Fedora package, which contains a specific version of Firefox from the upstream project.

When the upstream project releases a critical update of Firefox, the update is packaged and released in Fedora. But it is also packaged and released via CentOS Stream.

The FOSS space

Consider the set of all patches to all upstream projects, Fedora, and CentOS Stream. Obviously*, this is a topological space, where the Git history defines the neighborhood of a patch.

(*) Sometimes mathematicians use the word obviously to hide the fact that they can not really explain the concept in detail.

This space is not easy to grasp, and while you can connect some of the dots with a path, its global properties are yet to be explored.

The covering map

Take any commit in the FOSS space and map it to a commit in CentOS Stream, which implements the same functionality or fixes the same issue. For a regular commit in CentOS Stream, the map is trivial. The map points to its downstream version for any upstream change or a change in Fedora. Therefore, FOSS space can be represented as a covering space with CentOS Stream as its base.

Lifting a path

The path lifting property tells you that for every path in the base (a change in CentOS Stream), there should be a lifted path in the layers (a change in Fedora and in the upstream project, which maps onto it). In other words, it represents the same bugfix.

And the upstream first principle tells you to build that path.

Wrap up

Applying mathematical concepts to FOSS deployments provides new and interesting ways of understanding the interrelated nature of open source software. I hope this has been an insightful and interesting foray into space and the upstream first principle.

Tags
Aleksandra is a long-term member of the Fedora community, Fedora Ambassador and elected member of the Fedora Council. She works in Red Hat on Continuous Integration for RHEL, CentOS Stream and Fedora. She also has PhD in Geometry and Topology.

2 Comments

Thank you Aleksandra!  As a fellow mathematician (though I fear a somewhat lapsed one), I always enjoy seeing this kind of illumination of mathematical concepts with relevant concrete examples.  Great article!

Thank you

There are some powerful mathematical concepts which I'd love to see more popularized in the everyday life. For example iso- (and homeo-)morphism or an idea of a manifold. And I wish people would see more often that mathematics is not limited to the Calculus and Statistics, but that it also helps us frame the way we think about complex structures.

Maybe I'll write something about it next year :)

In reply to by Chris Hermansen

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.