11 · The system as a formula

11 · The system as a formula

Babb

2026-11-23. Four questions in sequence: can the system be expressed as a formula? Wouldn't computing amounts that way be slow at scale? What is the master formula? And, asked twice more, "again", each time for a simpler form.


First pass: the system as a set of formulas


The core:


L(n+1) = L(n) ∥ e     if valid(e | Codebook, Register)
V = f_θ(L)

The log only grows by appending a valid entry, and every view is a function of the log under versioned rules θ.


An entry:


e = (t, τ, o, q, k)
τ = (φ ≪ 6) | v
v = 8·block + index

Time, type, object, amounts, and how the value is known. The type packs the phase φ and the verb v.


Saying things once:


size(e) ≈ H(e | Codebook, Register, session, run)

An entry costs only the information its frame doesn't already supply.


The Books. Each posting's legs sum to zero per unit and book:


Σ_legs q(u, b) = 0
B(a, u, T) = Σ q_e(a, u) over entries e with t_e ≤ T that are not superseded
C_T = hash(B_T)

The balance of account a in unit u at time T sums every movement up to T, and a Close commits to the balance table by its hash.


The cascade:


U_parent = Σ U_children + R,   R ≥ 0
ρ = X_parent / T_parent (utilisation)
π = Σ T_children / T_parent (parallelism)

A parent's use is its children's plus a remainder. X is CPU time and T is wall time.


Trust:


s_k = hash(s_(k−1) ∥ hash(segment_k))
retry(e1, e2) ⇔ rec1 = rec2 ∧ ps1 = ps2
gaps(r) = {1 … max ps_r} ∖ {ps_e : e from r}

Each seal chains onto the last. Two submissions are the same retry when recorder and producer sequence match. A recorder's gaps are the sequence numbers the log never received.


Efficiency:


η = Output / Σ_u Input_u

Computed per unit. Combining units needs a price table, which is a view, never a conversion.


Wouldn't this be slow at scale?


No. The formula defines what an amount is, not how it is computed. The rule is only that whatever is computed must match a full replay. How it stays fast:



  • Running totals. Each entry updates only the accounts it touches: B(a,u) ← B(a,u) + q.

  • Checkpoints. B_now = B_close + Σ entries since the close, so replay covers only the open period.

  • The Close hash makes caches safe. A cache can always be checked against the Close; one that fails is rebuilt.

  • Sums split and merge. Totals can be computed per account, segment or period in parallel. Late entries just add to the right total.

  • Corrections are deltas. A correction applies −old + new.

  • Compact runs are summed without being expanded.

  • Recording depth keeps volume down.

  • The Close hash updates incrementally if the balance table is kept as a tree.


Where it does cost:
- Full rebuilds happen only on a rule change, an audit or a suspect cache. They are linear in the size of the log, parallel, and start from a trusted seal.
- Some statistics don't merge. Medians and distinct counts need period summaries designed for them.
- Late entries for a closed period are a policy question. They are posted as an adjustment in the open period.



The formula is the contract; running totals are the engine.



The master formula, three times


First:


S = f_θ(L) = fold(step_θ, S₀, L)
where L = e₁ ∥ … ∥ eₙ, each eᵢ valid under (K, G), carrying only H(eᵢ | K, G, context)

The definition and the computation must always agree. That equality is the central guarantee, and the reason checkpoints and caches are safe.


Again, simpler:


S = Σ L          any state is the sum of the log
Sₙ₊₁ = Sₙ + eₙ₊₁

"Sum" means any combining done one entry at a time:
- money and energy add up into balances;
- tasks accumulate into a board;
- spans nest into a run tree;
- seals chain into a fingerprint.


Again, with time at the centre:


S(T) = ∫₀ᵀ ε(t) dt  =  Σ_{tᵢ ≤ T} eᵢ        dS/dT = ε(T)

The state at T is the flow of acts up to T, so answers about the past never change. Rates (power, utilisation, throughput) are the flow itself.



The log records the flow of work over time, and every answer is that flow summed up to the moment you ask about.


Report Page