Death #4 — Octonion Fano-plane routing for the distributed-inference mesh
Status: planning only. No code, no deploys.
Scope: the per-token critical path of scripts/bench-trisplit.ts — 84 sequential fetch() hops across tri-a-NN, tri-g-NN, tri-d-NN plus 16 cobordism POSTs per token. This document specifies which of those 84 hops the Fano-plane grouping makes order-independent and how the dispatcher gets to skip the wait without changing the model arithmetic.
Companion to:
FORMAL_LEDGER.mdline 354 (Fano Grouping Invariant) and line 623 (Death #4 / α-teleportation).AMPLITUHEDRON_PLAN.md(Death #2, prefix-volume capture).AEON_FLOW_TRANSPORT_PLAN.md(Death #3, WebSocket binary substrate).
1. What the Lean modules pin down
Two Lean modules constrain the design.
open-source/gnosis-math/Gnosis/FanoOctonionNonAssoc.lean
mulImag(lines 99–160) is the full signed-basis Fano table, with the seven canonical triples(1,2,3), (1,4,5), (1,7,6), (2,4,6), (2,5,7), (3,4,7), (3,6,5)enumerated explicitly. This is the only triple list we use for the routing assignment in §3; we do not invent new lines.fano_non_associative(line 219, witness at line 220 bydecide) — the pointwise associator on(e₁, e₂, e₄):(e₁·e₂)·e₄ = +e₇whilee₁·(e₂·e₄) = -e₇. Both sides land on index 7; the sign differs. Read into the mesh: a single Fano line carries the same destination index for either grouping; only the sign (the orientation / direction-of-flow) flips. The destination payload identity is preserved.anticomm_triple_123(line 237) —eᵢ·eⱼ = -(eⱼ·eᵢ)on(e₁, e₂, e₃). Read into the mesh: forward and backward traversals along a Fano line produce the same residual up to sign.
open-source/gnosis-math/Gnosis/TopologicalOctonions.lean
fano_grouping_invariant(line 54) — the high-level statement that AST parenthesis grouping dictates the resulting state. This is the permission slip for Death #4: we are allowed to dispatch independent groupings concurrently, but we are not allowed to silently re-parenthesize a single grouping mid-flight.
open-source/gnosis-math/Gnosis/UniversalIntelligenceSSM.lean
alphaDrift(line 85) — α-teleportation jump primitive: when a node's energy hits 0, its query/key state advances and energy resets. Lean treats this as a step on a discrete state; we lift it to "redirect a residual along a Fano line that bypasses one or more sequential hops without re-running them."
What the Lean does NOT prove and we therefore enforce in code:
- That a Fano-line jump preserves the floating-point residual up to bit equivalence. The Lean works on signed basis indices; our wire carries f32 buffers. The implementation must validate jumped-residual fingerprints against the non-jumped path during a parallel-bench window before the jump is allowed to overwrite the canonical chain.
- That two distinct Fano lines whose destination indices coincide still produce the same f32 residual. The signed-index identity is necessary, not sufficient.
2. What classical constraint Death #4 cancels
scripts/bench-trisplit.ts lines 198–207 implement a strict left-fold:
for l in 0..28:
a = await postSplitA(l, residual, ...) // ATTN
b = await postSplitB(l, a.batchXb, ...) // GATE-UP
c = await postSplitC(l, a.batchX, b.batchHb) // DOWN → new residual
residual = c.residualThree constraints are baked in:
- Intra-layer ordering. Within layer
l,cwaits onb,bwaits ona. Hard data dependencies —bconsumesa.batchXb,cconsumes botha.batchXandb.batchHb. Death #4 does NOT relax this: the AST of(a → b → c)is a fixed parenthesization within one layer. - Inter-layer ordering. Layer
l+1'sawaits on layerl'sc.residual. Death #4 targets this constraint: the residual stream between layers is a sum of contributions, and the Fano grouping says different contributions can ride different lines and reconcile at the destination instead of waiting at the source. - Token-boundary ordering. Token
t+1waits on tokent's lm_head. Death #4 does NOT touch this; speculative decoding is the right primitive there.
The single classical merge Death #4 relaxes: "the residual at layer l+1 input is the same buffer that exited layer l." It is not. It is a sum of two contributions, written today as one buffer because we serialize. The Fano line says: dispatch the contribution that is already known at layer l-1 directly to layer l+1's input port, while the contribution that depends on layer l rides the normal chain. Both arrive at the same input port, both add elementwise (the residual stream is, mechanically, an additive identity), and the wait is shortened to the slower of the two paths instead of the sum.
This is a strict claim. The transformer residual stream is x_{l+1} = x_l + attn(x_l) + ffn(x_l + attn(x_l)). The first term x_l is exactly the kind of contribution that does not depend on layer l's compute and can teleport.
3. Fano-plane assignment (concrete worker mapping)
The Fano plane has 7 points and 7 lines; each line carries 3 points. We assign:
| Fano point | Mesh role | Concrete worker(s) |
|---|---|---|
| e₁ | Cobordism embed mesh | worker-cobordism-s0..s7 (8 shards, treated as one collective point) |
| e₂ | Tri-A (ATTN) ring | tri-a-00..tri-a-27 |
| e₃ | Tri-G (GATE-UP) ring | tri-g-00..tri-g-27 |
| e₄ | Tri-D (DOWN) ring | tri-d-00..tri-d-27 |
| e₅ | Cobordism lm_head mesh | same 8 shards in lm_head role |
| e₆ | Layer-warden (residual sidecar / KV cache) | layer-warden worker |
| e₇ | Cobordism-warden (vocab partition oracle) | cobordism-warden worker |
The seven Fano lines from FanoOctonionNonAssoc.lean then carry these mesh-level meanings:
| Line | Mesh interpretation | What rides it |
|---|---|---|
| (e₁, e₂, e₃) | Embed → ATTN → GATE-UP. The "warm token onset" line. | Initial residual at pos=0. |
| (e₁, e₄, e₅) | Embed → DOWN → lm_head. The skip-attention shortcut. | The residual additive contribution x_l that flows through the residual stream untouched by attn at the current layer. |
| (e₁, e₇, e₆) | Embed → cobordism-warden → layer-warden. | Vocab partition validation + KV write-back, both off the hot path. |
| (e₂, e₄, e₆) | ATTN → DOWN → layer-warden. | The "attn contribution" line: attn(x_l) ships to DOWN and to the KV cache in parallel, not in series. |
| (e₂, e₅, e₇) | ATTN → lm_head → cobordism-warden. | Late-layer ATTN tap for early-exit / speculative-head probes. |
| (e₃, e₄, e₇) | GATE-UP → DOWN → cobordism-warden. | The "ffn contribution" line: GATE-UP's output and DOWN's input prefetch reconcile at cobordism-warden when speculative. |
| (e₃, e₆, e₅) | GATE-UP → layer-warden → lm_head. | Mid-FFN sidecar for residual snapshotting (Amplituhedron capture point). |
The non-associativity from fano_non_associative is the routing license: (e₁·e₂)·e₄ and e₁·(e₂·e₄) both deliver to e₇, but with opposite signs. Mesh reading: the same destination port receives the contribution either way; the sign records which grouping produced it, which is what the receiving worker needs to know to combine residuals correctly. This is why the assignment uses signed contributions, not just sums: a Fano-routed payload arrives with a ± flag in its 10-byte aeon-flow header (Death #3 substrate), and the receiving worker adds-or-subtracts based on that flag.
4. What runs in parallel that currently serializes
The most load-bearing parallel pair, identified concretely in the chain:
Pair X — tri-d-NN /split-c of layer l and tri-a-(NN+1) /split-a of layer l+1.
Today (bench-trisplit.ts lines 200–203), tri-a-(NN+1) waits for tri-d-NN because layer l+1's ATTN consumes c.residual. But the residual stream decomposition x_{l+1} = x_l + attn(x_l) + ffn(...) says that the x_l term is already known before layer l even starts. Specifically: x_l is what tri-a-NN received as input. If we ride that buffer down line (e₁, e₄, e₅) — the skip-attention shortcut — directly to tri-a-(NN+1)'s "residual seed" port, then tri-a-(NN+1) can begin its own attention compute in parallel with layer l's GATE-UP and DOWN, accumulating its attn(x_{l+1}) contribution, and reconciles with layer l's ffn(...) contribution at tri-d-(NN+1).
In numbers from the bench's docblock (lines 18–21): per-layer wall is dominated by a + g + d summed (~90–200 ms per layer warm). With Pair X exploited, layers l and l+1 overlap on the DOWN/ATTN boundary. Twenty-eight layers means up to 27 such overlapping pairs. The critical-path collapse is from 28 × (a + g + d) to roughly a + max(28 × g, 28 × d) + d, but only when the residual seed arrives in time.
Two more pairs are real but smaller:
- Pair Y —
tri-a-NN /split-aand the layer-warden KV write of layerl-1. Line (e₂, e₄, e₆) lets the previous layer's KV ship to layer-warden in parallel with the current layer's ATTN. Todayworker-node1writes KV inline. The win is per-token wall, ~1–3 ms per layer. - Pair Z — cobordism lm_head probe and final-layer DOWN. Line (e₂, e₅, e₇) lets a partial logits computation start one layer early on a speculative residual. This composes with Death #2's lm_head logit cache, not separate from it.
Pair X is the only one worth a Fano-routing implementation on its own. Pairs Y and Z fall out of the same dispatcher with negligible extra code.
5. The α-teleportation jump primitive
The ledger names "α-teleportation jumps" (UniversalIntelligenceSSM.lean:81–90, FORMAL_LEDGER.md:623) but does not pin a Rust signature. Treat it as a typed dispatcher action; the call sites are limited to the coordinator (today bench-trisplit.ts, future distributed-inference-host/src/pipeline.ts).
Conceptual signature, in Rust-ish prose only (no code commitment):
alpha_jump(
line: FanoLine, // one of the 7 lines, encoded as 3-bit field
sign: Orientation, // +1 or -1, from the associator
payload: ResidualSlice, // the f32 contribution
src_layer: u16, // layer the contribution originated at
dst_port: WorkerPort, // the receiving worker's residual-seed port
sequence: TokenSeq, // for the aeon-flow header
) -> JoinHandle<DispatchAck>It dispatches one frame on the Death #3 WebSocket substrate (WebSocketFlowTransport) using stream-id 0xAF60..0xAF6F (a previously unallocated band inside the 0xAF00 Aether Forward namespace; see Death #3 §3 stream-id table). The receiving worker has a new endpoint /residual-seed that accumulates signed contributions into a per-token slot and notifies the local forward-loop when the slot is "fully resolved" — i.e., all expected contributions for this token at this layer have arrived. Fully-resolved means a small bitset of expected lines has been ticked; the bitset is keyed by (token_seq, dst_layer).
The jump dispatches from the coordinator at the moment the embed step completes (for x_l contributions that ride the line untouched) or from tri-a-NN at the moment its ATTN compute completes (for attn(x_l) contributions). It does not fire from inside a WASM forward call; it fires from the host worker's outer loop after a forward_range_*_chunk returns.
The Lean does not justify f32 equivalence (see §1). Therefore the first deployment runs Pair X jumps in shadow mode: the canonical chain still computes c.residual and passes it forward; the jumped seed is delivered too, the receiving worker compares fingerprints, and a divergence pages the on-call. Only after a measurement window without divergence does the chain switch to using the jumped seed and skip the wait.
6. Composition with Deaths #1, #2, #3
The compositional reading the user asked for, in one paragraph each:
Death #1 (MatVec memo) — a memo hit is a Fano-degenerate jump. When cached_mat_vec returns a hit, the matmul output materializes "without compute," which is mechanically the same as receiving the result on a Fano line of length 0. The bookkeeping is identical: the receiving slot in the residual stream is filled from a side channel rather than from the upstream worker. The two systems share the receipt-and-tick logic at the destination and differ only in whether the side channel is local memory (Death #1) or a jumped frame (Death #4).
Death #2 (Amplituhedron volume) — capture is a maximally-grouped Fano line. A volume hit replays the entire prefix's residual + KV. In Fano terms, the longest possible grouping ((((e₁·e₂)·e₃)·e₄)...) collapses to a single named state — the prefix_hash — and the dispatcher delivers the post-prefill residual directly to the first-decode worker. Death #4's line (e₃, e₆, e₅) is exactly the wire the volume-capture sidecar uses: GATE-UP → layer-warden → lm_head, which is where the residual snapshot is written and read back. Death #4 does not change Death #2's cache shape; it gives Death #2 a named line on the wire instead of a special-cased fetch.
Death #3 (aeon-flow WebSocket) — the substrate the jumps ride on. Every α-teleportation jump is one binary frame with a 10-byte header on a persistent WebSocket. Without Death #3 the jump is paying full HTTPS framing, which on 27 jumped pairs per token is most of the win. Death #4 reserves stream-id band 0xAF60..0xAF6F and is otherwise a pure consumer of the Death #3 transport.
The order of operations on the wire, per layer pair (l, l+1): Death #2 supplies the prefix volume at t=0 (skipping prefill entirely on second-and-later sessions); Death #4 dispatches the residual seed for l+1 while l is still computing GATE-UP/DOWN; Death #3 carries the dispatch in 10 bytes; Death #1 satisfies the matmul cache hits within the per-layer compute. They stack without conflict because each one targets a different cost: prefill (#2), inter-layer wait (#4), wire framing (#3), per-layer matmul (#1).
7. Honest scope cut — what Death #4 does NOT do
- Does not change the model arithmetic. Layer outputs are bit-equivalent to the chain output. The Fano routing changes when and where contributions arrive at the residual-seed port, not what they contain. Validation must include f32-fingerprint diff for at least one bench run before the chain trusts jumped seeds.
- Does not relax intra-layer ordering. The
(a → b → c)parenthesization within layerlis a fixed AST node with hard data dependencies. The Fano grouping operates between layers, not inside one. - Does not handle speculative decode. Branching across token candidates is orthogonal; the existing
inner_verify_batchpath stays as-is. - Does not change weights, knot format, or model fingerprinting. Cache coherence rules from Death #2 carry over unchanged.
- Does not require new workers. All seven Fano-point roles are already deployed (
tri-a-NN,tri-g-NN,tri-d-NN,worker-cobordism-sN,layer-warden,cobordism-warden). Only the dispatcher and one new endpoint per layer station (/residual-seed) are added. - Does not handle layer-warden being down. Pair Y degrades cleanly (KV write goes back to inline); Pair X requires either layer-warden up or a fallback to the canonical chain.
8. Estimated impact in the autoregressive bench
Assumptions from the bench docblock: 28 layers, warm 3–6 s/token today, 4–8 generated tokens per session, per-layer wall ~150 ms warm.
Without Death #4, per token: 28 × (a + g + d) summed sequentially ≈ 28 × 150 = 4.2 s warm.
With Pair X exploited (ATTN of l+1 overlaps DOWN of l):
- ATTN of layer
l+1runs concurrently with the ~30 ms tail of DOWNl. - Per-layer save ≈ min(a_NN, d_(NN-1)) ≈ 25–40 ms warm.
- Across 27 overlapping pairs: 27 × 30 = ~810 ms saved per token.
- Predicted warm per-token wall: ~3.4 s, ~19 % reduction.
Across 8 generated tokens: ~33.6 s → ~27.2 s, ~6.4 s saved per session. Over the 10-session bench scenario from AMPLITUHEDRON_PLAN.md §7 (where Death #2 has already collapsed prefill on sessions 2–10), Death #4 saves ~6 s × 9 = ~54 s on top, taking the bench from ~31 s (Death #1+#2+#3) to ~25 s. End-to-end uplift versus no-cache baseline (112 s) is ~4.5×, vs ~3.5× from #1+#2+#3 alone.
These are upper-bound estimates assuming the residual seed always arrives before tri-a-(NN+1)'s ATTN compute is ready to consume it. If the seed lags, the dispatcher falls back to the canonical chain transparently — so the floor is "no worse than today," matching the substrate-level guarantee from Death #3 §1.
9. Open questions where the ledger underspecifies
- f32 path equivalence for jumped seeds. The Lean works on signed basis indices; we run f32. No theorem says
a_via_chain = a_via_jumpbitwise, only that the destination index is the same. The shadow-mode validation is the operational answer; a Lean theorem on the residual-stream additive identity (x_{l+1} = x_l + attn(x_l) + ffn(...)is associative under f32 add only up to an ε) would let us drop shadow mode. As of writing, there is no Lean module proving this. Open. - Sign reconciliation across a long path.
fano_non_associativeproduces a sign flip between(e₁·e₂)·e₄ande₁·(e₂·e₄). The mesh handles this by tagging the orientation on the wire. There is no Lean theorem on the sign-tracking discipline across a path of more than 3 hops; we assume signs compose by Boolean XOR (sMulinFanoOctonionNonAssoc.lean:60) but a multi-hop theorem would harden this. - Fano-line allocation under partial mesh failure. If
cobordism-warden(e₇) is down, three of the seven lines lose their middle/end vertex. The ledger does not specify how routing degrades. Implementation choice: jumps along disabled lines fall back to the chain; this is conservative but loses Pair X gains for any session where layer-warden is missing. - Token-boundary jumps. The ledger's "α-teleportation jumps" wording in
FORMAL_LEDGER.md:623could be read as endorsing cross-token jumps (e.g., reusing residual seeds across consecutive tokens). We deliberately do not pursue this in Death #4. A Lean module on autoregressive residual continuity would be required. - Concurrent jumps from multiple coordinators. Same-prefix concurrent capture is named in
AMPLITUHEDRON_PLAN.md§8 as a Lean gap; the same gap applies here for residual-seed concurrent dispatch. Resolution mirrors Death #2: second concurrent dispatch is a no-op if the fingerprint matches, fingerprint mismatch increments model fingerprint and clears.