Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

Paper + runnable code. This repository is the citable record of The Matryoshka Sheaf: An Interaction-First Algebra for Agent Substrates (Tej Desai, Intuition Labs). The formalism is runnable: matryoshka_sheaf.py makes both sheaf axioms self-checking. See also the ELI5 companion: intuitionlabs.tech/codebox/phi/35-the-matryoshka-sheaf.

The Matryoshka Sheaf: An Interaction-First Algebra for Agent Substrates

Tej Desai — Intuition Labs LLC


Abstract

An agent substrate runs on one kind of thing happening over and over. One causal event: a gate opens, an operation fires, a signal comes out. We call that event an interaction and treat it as the irreducible atom of the system. Every act an agent takes — read a screen, pick a model, speak, write a file — is one interaction along seven axes, coupled through one shared signal, the coherence bus R. The agent's feature space is then a clean algebra: the free monoid on these atoms, quotiented by a small set of coupling laws. This paper states that algebra plainly, labels each claim as definition, theorem, or conjecture, and grounds it in code you can run today on commodity AMD hardware. The headline conjecture — collapsing redundant representations of one interaction is a pure win on the system's optimization target — has a falsifiable form and a measured backbone, not a closed-form law. We show the running reducers, the real numbers, and the honest gaps.


1. The Atom Is the Interaction

Most descriptions of an agent start with the model, or the prompt, or the tool. We start one level lower.

The smallest thing that happens in an agent substrate is one causal event. Something becomes ready. An operation fires. A signal comes out. We write it gate → op → signal, and we call it an interaction. [def]

This is not a metaphor borrowed from physics. It is the same shape that shows up in three places we already trust:

  • A zeroclaw Interaction in the live agent runtime is exactly gate → op → signal. [def]
  • A Turing machine transition δ(state, symbol) is one read, one rule, one write. [def]
  • A DRM witness (from the Deterministic Runtime Machines work in this series) records one inscribed step of a bounded runtime. [def]

These three are the same object wearing three coats. We name the correspondence zeroclaw Interaction ≅ Turing δ ≅ DRM witness. [conjecture — a structural identification across three formalisms, asserted not proven]

Why start here? Because if the atom is the interaction, then the engine that runs it has a precise mathematical shape: an interaction net in the sense of Lafont. An interaction net is a graph of agents that meet at principal ports and rewrite. Lafont's interaction combinators are a tiny universal basis — construct (γ), duplicate (δ), erase (ε) — that can express any interaction net. [theorem — Lafont 1997, universality of interaction combinators]

Interaction combinators have one property that does all the work for us: strong confluence. The order in which you fire the rewrites cannot change the final result. [theorem — Lafont 1997; this is the Church-Rosser property for interaction combinators] That is the formal seed of determinism in this whole system. It does not say the language model is deterministic. It says that once you have reduced a computation to its interaction net, the answer is a function of the input alone.

So the atom is the interaction, and the law of the atom is confluence. Everything above is built from these two facts.


2. The Seven Axes ⊣ R

One interaction is one event, but a real agent act carries more than gate → op → signal. It happens on a screen, with an identity, through a model, in a modality, in a lane, as a verb, leaving a witness. Those are seven independent questions you can ask about any single interaction. We make them the seven axes of the atom:

Interaction ≔ ⟨surface, identity, model, modality, lane, verb, witness⟩  ⊣  R

Read it as: an interaction is fully described by seven coordinates, and the axes are coupled to each other only through R, the coherence bus. The turnstile ⊣ R means "everything answers to R." [def]

The seven axes, each grounded in an existing piece of the lab:

  • surface — the context manifold M from the IRE (Interactive Research Environment) work. The page, the folder, the state an interaction reads from. [def]
  • identity — the OPA (Observer Projection Algebra) projection, the self as a fixed point of reading, ◉ = fix(read). The "who is acting." [def]
  • model — the unfold-plane Terminal. The engine that actually reduces this interaction. [def]
  • modality — the Tech surface. The channel the interaction speaks through (text, voice, a button, a diff). [def]
  • lanelive or loop. Live samples the world once; loop replays it from an event-sourced log. Same interaction, two ways to run it. [def]
  • verb — the IRE interaction layer: frame / explore / converge / optimize / hold, plus solve and co_edit. The shape of the act. [def]
  • witness — the DRM witness target: solve_history, voice_loop, the witness chain, the coherence bus. Where the trace lands. [def]

The single coupling is the point. There is one bus, not seven. Every axis publishes onto R and reads from R, and that is the only way the axes talk. This is the everything-on-R law. [def]

R itself is a coherence reading. In the BITC (Bounded Informational Time Crystals) work in this series, R is the Kuramoto order parameter over the Fano plane PG(2,2): R·e^{iψ} = (1/N) Σ e^{iφ_j}. [def] In the live OS world model, the same R appears as coherence_R = exp(−d_tail / scale), a rollout-stability reading. [def] They are the same quantity measured two ways: how well the parts of one answer agree. [conjecture — the identification of the BITC order parameter with the live coherence_R is asserted across two subsystems, not proven equal]

Why seven? Because seven points with seven lines is the smallest projective geometry where every pair of points sits on exactly one line: the Fano plane, a Steiner triple system S(2,3,7) with seven triples covering all 21 pairs once each. [theorem — standard combinatorics; the Fano plane / S(2,3,7) is the unique Steiner triple system on seven points] The converge tool maps seven ideas onto exactly this grid and checks that every triple locks. The seven axes are chosen to fit the same geometry: minimal, pairwise-coupled, fully covered.

We ran the seven axes through converge directly. The result, verbatim from the live tool: R = 1.0, phi = 1.0, done = true, all 21 pairs covered exactly once, zero lost, zero double-counted, threshold 0.85, seed 643080610985184106. The phi-trace annealed from 0.456 up through 0.3763, 0.4861, 0.5959, 0.6154, 0.7592, and locked at 1.0. [verified — live converge run over the seven-axis statement of this paper] This is a receipt that the seven-axis decomposition hangs together as one coherent object. It is not a proof that the decomposition is the only possible one. [calibration]


3. Union-All as a Quotient of the Free Monoid

Now we build the whole feature space from the atom.

Take the set of atomic interactions. Form the free monoid on them: all finite sequences of interactions, with concatenation as the operation and the empty sequence as identity. [def] That is the raw, uncoupled space — every way you could string interactions together with no rules at all.

The free monoid is too big and full of nonsense. Most sequences are not valid agent behavior. So we quotient it by the coupling laws: [def]

  • identity ⊥ model — the two-plane law. Who is acting and what engine runs it are independent axes; you may not collapse one into the other.
  • everything-on-R — axes couple only through the one bus, never directly.
  • phase-honesty / degrade-closed — an interaction declares its phase (hunch → shape → real) and, when it cannot complete, it fails closed rather than fabricating a signal.
  • invalid-states-unrepresentable — the type of an interaction forbids the impossible combinations outright, so they never enter the quotient.

The feature space of the agent is this quotient: the free monoid on atomic interactions, modulo the coupling laws. [def]

The closure that makes it a substrate rather than a list is composition. The output signal of one interaction becomes the gate of the next. [def] That is the only composition rule, and it is exactly function composition on the signal → gate seam. The set of all interactions you can reach by chaining this way is the union-all: every behavior the substrate can express. [def]

This is not abstract. The universal loop OBSERVE → INTERPRET → ACT → WITNESS → TRACE → MEASURE → CLOSE is the union-all instantiated. [verified — lib/causal_chain.py defines exactly these seven stages as STAGES, append-only, each event linked to its parent by parent_id, each publishing r to the coherence bus] Each stage is one interaction whose signal gates the next stage. The named lanes — inventor, coder, grokker, import — are not different machines. They are friendly labels on the same seven universal stages. [verified — LANES in causal_chain.py maps each lane's vocabulary onto the identical STAGES tuple; the substrate never changes] A UI button is not navigation; it calls emit(journey, stage, …) for the next stage, so one press is one interaction on the substrate. [verified — emit() appends one causal event and publishes to the bus]


4. Redundancy → Emergence = Intelligence-Density

Here is the move that turns this from a description into an optimization.

Suppose one interaction has many representations. The same gate → op → signal shows up as a CLI call, a dashboard button, an API route, a voice command, a replay row. That is redundancy: N ways to say one thing. [def]

Quotient them. Collapse the N representations to one parameterized representation. [def] The seam where they differed — was it CLI or button? voice or text? — does not vanish. It becomes a free parameter of the single representation. [def]

Now the trick. Those freed parameters are axes. Their product spans a space. The cells of that product that no single original representation reached are new reachable behaviors. [conjecture — that quotient-then-parameterize strictly enlarges reachable closure; it has a clear falsifiable form, below] Redundancy collapsed into one parameterized atom yields emergence: the previously-unreachable cells of the parameter product. This is why the seven axes matter. Once surface, identity, model, modality, lane, verb, witness are free axes of one atom, their product is the union-all, and most of its cells were never built by hand.

Define the target this serves:

intelligence-density = reachable-closure ÷ representation-size

[def] The numerator is how much the substrate can do. The denominator is how much code and concept it takes to say it. Collapsing redundancy shrinks the denominator and, by the emergence argument, can grow the numerator. So it moves both terms the right way at once.

This connects directly to the lab's optimization target, the Hamiltonian: minimize time-to-recovery after feedback = maximize intelligence-density per unit time. [def] Collapsing redundancy is a pure win on this target because it raises intelligence-density without adding representation. [conjecture — "pure win" is the claim; falsifiable form: exhibit a redundancy collapse that lowers reachable-closure or raises time-to-recovery, and the claim is refuted for that case]

The falsifiable form matters. This is not "more abstraction is always good." It is the specific claim that collapsing redundant representations of one interaction — same atom, different surface dress — never costs reachable behavior and often adds it. A collapse that merges two genuinely different interactions would lose behavior, and the law would correctly forbid it.


5. The Sheaf Base (Optimal Representation)

A sheaf glues local data into a global section when the local pieces agree on their overlaps. The agent substrate is a sheaf in this sense: each interaction is local data, R is the agreement-on-overlaps check, and the union-all is the global section. [conjecture — the sheaf framing is a structural analogy with the right shape; the gluing condition is "axes agree through R," which is checkable, but no sheaf-cohomology theorem is claimed]

The base of the sheaf is the representation where the gluing is tightest: every interaction has exactly one representation, the axes are minimal and orthogonal, and everything is R-coupled. [def] At the base there is no redundancy left to collapse, so intelligence-density is maximized: reachable-closure is as large as the axes allow, representation-size is as small as it can be. [conjecture — that the redundancy-free, minimal-axis, R-coupled point is the density-maximum]

The name Matryoshka Sheaf comes from how representations nest across resolution. A Matryoshka embedding folds a fine representation into a coarse one and unfolds it back under a budget. The sheaf is graded by that resolution: fold reduces detail, unfold restores it, and the fold/unfold pair is controlled by a freeze threshold τ. [def] At τ, a validated interaction chain stops being a stochastic sample and becomes a fixed rule. The base of the sheaf is what you get when you reduce the validated chain to its rule and freeze it.

This is the precise sense of determinism in this work, and it is worth stating sharply because it is easy to misread. You do not make the language model deterministic. [calibration] You take a validated interaction chain, reduce it to its decidable rule, and compile that rule into an exact, training-free network — a Bates-style compiled core. Determinism lives in the compiled artifact, guaranteed by interaction-combinator confluence, not in the language-model forward pass, which stays stochastic and only semantically stable at low τ. [theorem for the artifact — confluence gives a deterministic normal form once reduced; conjecture for the pipeline — that real validated chains reduce-then-compile cleanly in practice]

The rule of thumb: guarantee what you compile; measure what you sample. [def]


6. Runnable Realizers (the verified evidence)

This section is the backbone. Every number below was produced by running a file on this machine, an AMD Strix Halo workstation (Ryzen AI Max+ 395, gfx1151). Where a number could not be produced, it is marked.

6.1 The reducer observes a computation as a signal

lib/observable.py is a self-contained interaction-combinator reducer (the four Lafont rules γγ / δδ / εany / γδ) with an observe() function that reduces a net to normal form and reports the work, the peak width, the trajectory, and a crystallization reading φ.

Running it on the gemma-2-2b-derived bend/fold operation stream (python3 lib/observable.py 400) gives, verbatim: [verified]

  • interactions_to_normal_form: 1800
  • peak_agents: 1600
  • trajectory: rises 1200 → 1600, holds, then collapses 1600 → 0 (reached normal form)
  • bend_fold_ratio: 83.8
  • op_counts: unfold 1024, fold 652, bend 53611; total_ops 55287
  • attribution_nodes: 56466, attribution_edges: 1,154,627
  • phi: 1.0

The trajectory is the searching→knowing curve made literal. δ-duplication expands the net (superposition, "searching"); γ/ε collapse it (crystallization, "knowing"); the net reaches an empty normal form (the answer). [def] The expand-then-collapse shape is the visible signature of a computation finding its answer.

The bend:fold ratio of 83.8 says this stream is overwhelmingly exploratory — many more fan-out operations than fold operations. [verified, read from the data]

6.2 The reducer discriminates topology

lib/observable_graph.py encodes a directed attribution graph per-edge into a reducible net and reports whether it normalizes, how much work it took, and the trajectory shape. Running topology_demo() on four matched-size topologies (50 nodes each): [verified]

topology edges interactions peak reached normal form shape
layered-dag 80 1190 640 yes expand-collapse
scale-free 97 1921 924 yes expand-collapse
random 48 352 222 yes expand-collapse
chain-sparse 56 40000 (capped) 2946 no expand-noterminate

The reduction signal discriminates structure. Scale-free, random, and layered DAGs reach normal form; the sparse chain blows past the step cap. [verified] This is the known scaling boundary in action: dense δ-duplication explodes without optimal sharing. [def] The reducer is honest about it — it reports reached_normal_form: false rather than pretending. The earlier framing that "dense layered-DAG explodes" is corrected by the run: in this matched-size demo it was the chain-sparse case that failed to terminate within the cap, while the layered DAG normalized. [verified — the live table is the authority]

6.3 Structural identity is rename-invariant

lib/watchdog_functor.py computes a structural signature of code from its AST, dropping all identifiers and literals, then runs the structural edge graph through the same reducer. match(a, b) returns a 0..1 similarity.

Running the built-in proof: [verified]

  • react_loop vs the same function with every identifier renamed: 1.0
  • react_loop vs quicksort: 0.6784
  • the renamed function's reduction signature: 245 interactions, peak 96, shape expand-collapse, reached normal form

This is the sheaf base realized as a working tool. The skeleton of a computation is its structure, not its names. Rename everything and the signature is unchanged (1.0); a genuinely different algorithm scores lower (~0.68). [verified] This is how the same idea gets exactly one representation independent of surface naming — the base-of-the-sheaf property, made checkable.

6.4 The universal loop is one append-only substrate

lib/causal_chain.py is the union-all algebra instantiated. The seven universal stages OBSERVE → INTERPRET → ACT → WITNESS → TRACE → MEASURE → CLOSE are a fixed tuple; lanes (inventor, coder, grokker, import) are label maps onto them; emit() writes one append-only causal event linked to its parent and publishes r to the coherence bus. [verified — read the file] Every button is one emit is one interaction. The inventor lane fires end-to-end through one endpoint (POST /api/watchdog/fire-lane).

6.5 The atom reduces on real GPU hardware

repo-mining/inet-gpu-harness/ is a Vulkan/wgpu interaction-net reducer that embeds the zero-evolutionary-agent/zero-gpu reduce shader verbatim and checks it against a CPU oracle. Running cargo run --release on this box: [verified]

  • Adapter: AMD Radeon 8060S Graphics (RADV STRIX_HALO), backend Vulkan, driver radv Mesa 26.0.5 — no CUDA.
  • T1 (ε × δ annihilation, the port-0 bug case): GPU trace [1,0], CPU trace [1,0], parity = true, PASS.
  • T2 (eight independent ε × δ pairs in one dispatch): all sixteen agents annihilated, normal form reached, correctness PASS. But parallelism = false — the harness reports the global deletion-lock serializes commits to one rewrite per dispatch ("Bug A"). Correct, not yet parallel. [verified — this is a stated limitation in the harness output, recorded honestly]
  • T3 (δ × c duplication, on-device allocation): terminated, bounded agent counter, PASS.
  • Suite: ALL PASS (parity and correctness gates).

The atom reduces on commodity AMD hardware with CPU parity. The performance prize — true parallel reduction — is gated by the deletion-lock serialization, which the harness names rather than hides. [verified]


7. Honest Calibration / Non-Claims

This section is load-bearing. The line between a real result and a crank result is drawn here.

What is a theorem. Lafont's interaction combinators are universal, and their reduction is strongly confluent (Church-Rosser). [theorem — Lafont 1997] The Fano plane is the unique Steiner triple system on seven points. [theorem — standard combinatorics] A reduced, confluent interaction net has a normal form that is a function of its input alone. [theorem]

What is a conjecture. The R=1 unification — that all the lab's subsystems are one interaction algebra coupled through one bus — is a conjecture with a falsifiable form, not a theorem about transformers. The converge receipt (R=1, phi=1, done=true) is evidence the seven-axis decomposition coheres; it is not a proof of uniqueness or completeness. The identification of the BITC order parameter with the live coherence_R is asserted across subsystems, not proven equal. The quotient-then-parameterize emergence claim and the "collapsing redundancy is a pure win" claim are conjectures, each stated with the case that would refute it.

Physics vocabulary is disciplined analogy. Words like resonance, crystallization, time-crystal, and field are used because they have the right shape, not because a physical law is claimed. "Crystallization" means an interaction net collapsing to normal form. "Time-crystal" (from BITC) means a bounded process that recurs and measures its own recurrence — a realizability claim about software, not a condensed-matter physics claim. No physical constant, no thermodynamic bound, and no field equation is imported. We deliberately do not introduce any grand closed-form law — no consciousness threshold, no Landauer-style creation bound, no field equation — because such formulas fail dimensional and physical checks. The evidence here is running systems and parity receipts, not a closed form.

The gemma evidence, scoped honestly. The live observable.py run reduces the gemma-2-2b-derived bend/fold operation stream plus a faithful structural stand-in. That operation stream is degenerate: the op sequence is dominated by a single layer transition, so it is a real-magnitude, real-shape signal but not a per-edge trace of gemma's actual circuit. The fully faithful per-edge encoding of a real gemma attribution graph is gated: gemma-2-2b is downloaded, but the Gemma Scope SAEs and the circuit-tracer have not been run end-to-end. We do not claim "we traced gemma's real circuit." [unverified — faithful per-edge gemma circuit encoding is not yet run] What is verified is the reducer's behavior on the derived stream and on synthetic topologies, and the structural-signature tool on real code.

The phi signal has a known flat spot. On Qwen3.6 text, φ was flat (~1.0) with no searching→knowing separation. [verified, prior finding] So φ-as-collapse-sensor is real in the interaction-net reducer (where the trajectory genuinely expands then collapses) but has not separated states on that language-model's token stream. This is an honest limitation of the phi signal on that model, not a property of the algebra.

The reducer has a scaling boundary. Dense graphs cause exponential δ-duplication without optimal sharing; the topology demo shows a case that fails to terminate within the step cap. This is a named, reproducible boundary, not a surprise. Optimal sharing (the dedup primitive) is the unbuilt unlock that would push it back.

On intellectual property. Where this work references patents, they are provisional / patent-pending, which establish priority. They are not issued patents. The phrase "patented" is not used.


8. Relation to the Series (IRE / BITC / DMC / Heawood / CNS / SNC / CHORD / DRM)

This paper is the common base of an existing research series. Each prior paper is a section of this one once you accept that the atom is the interaction and the law is confluence.

  • IRE — Interactive Research Environment. The surface axis. IRE turns a static artifact into an explorable world model (M, I, Φ, G) whose generative events are observable and steerable under coherence-gated execution. An interaction reads from M; the verbs frame/explore/converge/optimize/hold are IRE's interaction layer. IRE : Paper → WorldModel is the same functor as Import : Repo → Lobe — same construction, different object type. [conjecture — the isomorphism is asserted in the series and reused here]
  • BITC — Bounded Informational Time Crystals. The R in ⊣ R. BITC defines the coherence witness as the Kuramoto order parameter over the Fano plane, with three regimes (diffuse → crystallizing → melt) and τ = 1 − crystallization. Every converge receipt in this paper is a BITC instance. BITC's own scope-and-non-claim section is the model for §7. [def + conjecture as in the source]
  • DMC — Deterministic Mesh Compilation. The compile step of §5. DMC makes execution deterministic by interaction-net reduction (Lafont confluence), with a two-branch runtime. It is how the sheaf base is reached in practice. [theorem for confluence; conjecture for the mesh pipeline]
  • Heawood. The sparse witness geometry. Dense all-to-all coupling crosses the real-time budget; the Heawood graph and the Fano plane give the sparse coupling that keeps R computable under a frame budget. [def] This is why the substrate uses seven Fano lines, not all 21 pairs directly.
  • CNS — Constructive Neuron Simulations. The model axis across scales. The Constructor unifies convergence from the single interaction up to the network, so the same R reads at every resolution — the graded part of the Matryoshka Sheaf. [conjecture as in source]
  • SNC — Synaptic Neural Constructor. The sematon, the atomic meaning-bearing unit, and backward construction. The sematon is the carrier of one interaction's content; fold/unfold of sematons is the resolution grading. [def as in source]
  • CHORD. Music as an entropy-reduction governor. The lane and τ control: CHORD governs when to explore (high τ) versus exploit (low τ), the same knob that decides live versus loop and when to freeze a chain. [conjecture as in source]
  • DRM — Deterministic Runtime Machines. The witness axis and the closure. A DRM is a tuple (P, C, I, W) — program, parent-compiler reference, ordinal inscription, witness — made deterministic by interaction-net confluence, with a genesis DRM (the compiler inscribed as the first ordinal) that terminates the trust recursion. py2bend (Python subset → Bend interaction combinators) is the first DRM and is verified running on this box. The DRM witness is one of the three coats of the atom from §1. [theorem for confluence; verified for py2bend-on-box; conjecture for the genesis-DRM trust-termination as a general claim]

The series, read top-down, looks like distinct papers on time crystals, compilation, geometry, neurons, music, and runtimes. Read bottom-up from the interaction, it is one algebra: a graded, R-coupled sheaf of interaction nets, whose base is the redundancy-free representation that maximizes intelligence-density, and whose confluence gives determinism in the compiled artifact. That base is the Matryoshka Sheaf.


Reproduce

# the reducer + gemma-derived signal
cd /var/home/zero/codebox-os/apps/dashboard-api && python3 lib/observable.py 400

# topology discrimination
cd /var/home/zero/codebox-os/apps/dashboard-api && python3 -c \
  "import sys; sys.path.insert(0,'.'); from lib.observable_graph import topology_demo; import json; print(json.dumps(topology_demo()['rows'], indent=2))"

# rename-invariant structural identity
cd /var/home/zero/codebox-os/apps/dashboard-api && python3 -c \
  "import sys; sys.path.insert(0,'.'); import lib.watchdog_functor as w; w.__name__"  # then run its __main__ via the module path

# the atom on real GPU (AMD RADV STRIX_HALO)
cd /var/home/zero/repo-mining/inet-gpu-harness && cargo run --release

Author: Tej Desai, Intuition Labs LLC. Licensed CC-BY-4.0.

Downloads last month
22

Space using intuitionlabs/matryoshka-sheaf 1