Skip to main content

The Fractal Geometry of Software: What PyTorch and Ray Reveal

Platino Labs Data Room publishes public Python import graphs from ten repositories, revealing dependency cycles and code structure.

AI-written
Inewgen
30 Oct 2026Source: Dev.to3 min read (0 views)
Share
The Fractal Geometry of Software: What PyTorch and Ray Reveal

Stock photo for illustration only, not from the actual event

Font size
  • Platino Labs published public Python import graphs from ten repositories in the Platino Labs Data Room.
  • PyTorch's largest component contains about 65.7% of modules, while Ray holds roughly 23.4% of 4,108 modules.
  • Extraction uses Abstract Syntax Tree (AST) and Tarjan's algorithm followed by Kahn's topological ordering.
  • Total published graph size reaches 46,259,186 bytes, reducing storage compared to mapped source files by 79.93%.

Code search can find a function, and retrieval-augmented generation can retrieve relevant passages, but neither approach explains how software modules depend on one another. A codebase functions as more than a collection of text; it is a directed structure where files import modules, modules connect to other modules, and certain paths lead back to their origin.

We extracted public Python import graphs for ten repositories and published the sanitized JSON in the Platino Labs Data Room. These graphs expose structural facts that passage searches cannot answer: the shape and scale of strongly connected components within the declared import graph. Retrieval systems and dependency graphs solve distinct problems, as similarity between passages does not indicate whether module A imports module B or how many modules participate in a cycle.

The processing pipeline parses Python source code using the abstract syntax tree (AST) to extract import relationships and publish a graph rather than relying on language model embeddings. For a fixed source revision, the extraction transforms syntax into deterministic edges. The release introduces a strongly connected component (SCC) layer, utilizing iterative Tarjan followed by Kahn's topological ordering.

python code data structure computer screen

Stock photo for illustration only, not from the actual event

65.7%Modules in PyTorch's largest component
23.4%Modules in Ray's largest component
46.2 MBTotal SCC graph assets size across 10 repos

The largest PyTorch component contains about 65.7% of the modules in its graph, whereas Ray's largest contains about 23.4% of its 4,108 modules. These numbers measure topology rather than engineering quality, detailing how many components exist, how many are cyclic, and the scale of the largest cycle. Import cycles can influence startup and initialization when dealing with eager imports, making isolated testing and refactoring more complex.

Never miss the latest news?

Subscribe to get news summaries by email - not often enough to be annoying.

โฆษณา

Analyzing software structure through import graphs and SCC algorithms offers valuable insight into the architectural complexity of large open-source projects. Dependency cycles do not automatically indicate flawed code; instead, they provide topology measurements that help developers understand module loading behavior and maintainability as systems scale.

The PyTorch graph asset measures 7,468,906 bytes (7.47 MB), and all ten current SCC assets total 46,259,186 bytes. Across the ten repositories, the release reports a 79.93% reduction in storage compared to mapped source files. Publishing this data in JSON format with commit pins enables developers to inspect bytes, recompute the SCC layer, and evaluate code structure directly.

Source: Dev.to

Comments

Leave a Comment
0/2000

Found something wrong in this article? Report an issue with this article