← Course

The 297 Edges

A periodic table is more than a list of elements. It's also the relationships between them. 297 composition edges, 26 Bennett decompositions, 20 thermodynamic inheritance edges. The graph is the function.

~4 minutes

Why edges matter

The 258 primitives are nodes. Without edges they're a catalog. With edges they're a directed graph — and a directed graph can be traversed, queried, and used to compute things like dependency order, minimum energy, and build priority.

Mendeleev's table has one implicit edge type: the periodic relationship between elements in the same column. The Periodic Stack has three explicit types, totaling 343 edges across 258 nodes.

Composition edges (297)

The first type: X is built from Y and Z. These trace how complex primitives decompose into simpler ones. They are the backbone of the graph.

Matrix multiply is built from fused multiply-add plus reduction. Attention is built from matmul plus softmax. FFT is built from butterfly operations. Convolution is built from FFT plus pointwise multiply plus inverse FFT (by the convolution theorem). Sparse attention is built from attention plus top-k selection plus scatter. Mixture-of-experts is built from gating plus sparse routing plus per-expert FFN.

The stack has 297 composition edges. Every non-leaf primitive has at least one — because non-leaf means "built from something else." Following composition edges backwards from any primitive traces it all the way down to the leaves: the irreducible operations that don't decompose further.

With 258 nodes and 297 composition edges, the graph is denser than a tree but sparser than a mesh. Many primitives share sub-components — reduction appears as a dependency of matmul, pooling, softmax, and normalization. That sharing is what makes the stack useful for hardware design: build reduction once, and four higher-level primitives inherit it.

Example — attention's composition tree

  • Attention
  • ├── Matmul (QKᵀ)
  • │ ├── FMA
  • │ └── Reduction
  • ├── Softmax
  • │ ├── Exponentiation
  • │ └── Normalization
  • │ └── Reduction
  • └── Matmul (× V)
  • ├── FMA
  • └── Reduction

Composition edges tell you: if you want to build attention in silicon, here are the primitives you need first. They also reveal shared dependencies — reduction appears three times, which means one good reduction unit pays off three ways.

Example — sparse mixture-of-experts

  • Sparse MoE
  • ├── Gating (top-k selection)
  • │ ├── Sorting
  • │ └── Comparison
  • ├── Sparse routing
  • │ ├── Scatter
  • │ └── Indexing
  • └── Per-expert FFN
  • ├── Matmul
  • ├── Activation (GELU)
  • └── Matmul

Deeper composition trees like this are where the 297-edge count comes from. Modern AI workloads compose dozens of primitives into a single forward pass. The stack makes every dependency explicit.

Bennett decomposition edges (26)

The second type: X factors into an L₀ phase plus an L₂ phase. These come from Bennett's reversibility proof. Every L₂ primitive has a unique Bennett decomposition telling you which part is reversible (thermodynamically free) and which is erasure (thermodynamically expensive).

The stack has 26 Bennett decomposition edges — one for every L₂ primitive where the decomposition is non-trivial. This includes matmul, convolution, pooling, attention, hashing, sorting, and others where information is provably destroyed during computation.

Example — matmul's Bennett decomposition

L₀ phase: broadcast multiply. Every input pair produces a unique product. Bijective. Thermodynamically free.

L₂ phase: reduction along the shared dimension. Many values become one. Erasure. Pays Landauer's cost.

This tells you how to design matmul hardware. The broadcast multiply can be implemented reversibly — no minimum energy cost at any temperature. The reduction is where you spend your energy budget. If you want to lower matmul's joules-per-operation, optimize the reduction tree. That's where the physics says the money is.

Example — sorting's Bennett decomposition

L₀ phase: comparison network. Each compare-and-swap is a bijection on the pair — no information destroyed.

L₂ phase: the merge step that collapses multiple sorted subsequences. Positional information about original order is erased.

The 26 Bennett edges give hardware designers a precise map of where energy is spent. Every other phase can, in principle, run at zero energy cost above the thermal noise floor.

Thermodynamic inheritance edges (20)

The third type: a child operation inherits its minimum thermodynamic cost from its most expensive component. This is the chain rule for energy.

If primitive X composes primitives A and B, and A is L₂ (irreversible) but B is L₀ (reversible), then X is at minimum L₂. You cannot make a composite operation lower-cost than its highest-cost dependency. The erasure propagates upward.

The stack has 20 thermodynamic inheritance edges. They propagate Landauer costs up the composition tree, so every primitive in the graph carries a proven minimum energy bound — not an estimate, but a consequence of the second law of thermodynamics.

Why it matters

The inheritance edges make the stack computable. They turn the table from a static reference into a function. Given any goal, the stack computes the minimum energy required to achieve it — in joules, at a given temperature — by traversing the composition graph and accumulating thermodynamic costs along the inheritance edges.

This is what separates the Periodic Stack from a taxonomy. Taxonomies classify. The stack predicts.

The three edges together

297 + 26 + 20 = 343 total edges across 258 nodes. Composition tells you what to build. Bennett decomposition tells you which part is free. Inheritance tells you what the minimum cost will be.

Together, they turn the table of primitives into a design methodology. Pick a goal. Traverse the composition edges to find the dependency tree. Read the Bennett edges to identify the free phases. Sum the inheritance edges to get the energy floor. The gap between that floor and current hardware is your engineering opportunity.

Key takeaway

The stack is 258 nodes and 343 edges. 297 composition edges tell you what depends on what. 26 Bennett edges tell you where energy is spent. 20 inheritance edges propagate thermodynamic costs upward. Together, they make the stack a function: given a goal, compute the dependencies, the minimum energy, and the build order to get there.