Computation, control and emergence

State, memory and the anatomy of an algorithm

Rajesh Ranjan Mahapatra

A process owns a history only when earlier events leave a persistent, causally operative residue inside the declared system boundary, rather than arriving later as a description of what happened.

© 2026 Rajesh Ranjan Mahapatra. 31 min read

State, memory and the anatomy of an algorithmAll Human–Machine Convergence

Computation, control and emergence

State, memory and the anatomy of an algorithm

A process owns a history only when earlier events leave a persistent, causally operative residue inside the declared system boundary, rather than arriving later as a description of what happened.

TLDR

  1. Past events become algorithmic history only when they alter something that later transitions use.
  2. A transcript can describe the past perfectly while the component reading it remains stateless between calls.
  3. State is a task-relative compression: two histories share a state only when no valid future can distinguish them.
  4. External storage can be constitutive of a stateful system, while internal storage can be causally irrelevant.
  5. Reset, swap, omission, fork and replay tests reveal history more reliably than fluent behaviour or long logs.

The airlock that passed every test

Imagine a laboratory airlock with a rule that cannot be read from the current door positions alone: the inner door may open only if a full purge cycle has completed since the most recent opening of the outer door. Engineers test two controllers. Controller A contains a one-bit latch. A completed purge sets it to safe; opening the outer door clears it. Controller B is wiped clean after every command. Before each decision, a clerk supplies B with a complete transcript of previous events.

During the demonstration, both controllers behave identically. The outer door opens, closes, the purge completes, and both permit the inner door to open. The observers naturally say that both systems remember the cycle. B even appears more knowledgeable because it receives every detail, rather than only one bit.

Now change one event. After a successful purge, the outer door opens briefly and closes again. The current sensors return to exactly the same readings as before. A clears its latch and refuses the next inner-door request. B also refuses, provided the transcript includes the brief opening. Then a printer fault omits that single line. B permits the request.

The omitted line did not remove a fact from the world. It removed the only route by which that fact could affect B. The puzzle is not whether the past existed, nor whether a record could be made. It is whether the process itself carried a causal consequence of the event forward.

Thought experiment 1 · The perfect diary

Suppose B receives a cryptographically perfect diary with no omissions. Would it then have history? The answer depends on the boundary. B as a component still starts each call without residue. The clerk, diary and B together form a stateful configured system because the diary persists and is causally coupled to later decisions. The same mechanism can be stateless at one boundary and stateful at another.

Figure 1 · The state-transition palimpsest
The whole past can remain available while only a small residue governs the next transition. The decisive question is which marks are carried forward in the causal path to action.Illustrative. Author synthesis.

The likely intuition contains a hidden assumption: if information about the past is available at decision time, the decision-maker must remember it. That collapses two different architectures. One architecture changes itself as events occur. The other remains unchanged and later receives a description of those events as fresh input.

A record can be complete yet causally inert. A warehouse full of logs does nothing until some process reads, interprets and applies them. Conversely, a single flip-flop can carry genuine algorithmic history even though it stores no story, timestamp or explanation. The bit matters because it changes what the controller does next.

Figure 2 · Same answer, different causal route
Ordinary input-output agreement hides the causal route. A targeted omission changes only the transcript route, revealing which system depends on a persistent residue and which depends on supplied history.Illustrative counterfactual intervention.

To reason clearly, five artefacts must remain separate. A record describes events. Context is what a component receives now. A checkpoint is a saved snapshot. A memory mechanism preserves or reconstructs something across time. State is the part that the transition rule actually uses to determine what can happen next.

ArtefactOperational meaningRevealing test
StateA present variable whose value changes valid future transitions at the chosen abstraction.Hold the current input fixed, alter the variable, and observe whether continuation changes.
Event logAn ordered record from which state may sometimes be reconstructed.Reorder, omit or replay events and test whether the same state is recovered.
ContextInformation supplied for the current invocation.Restart the component and resend, truncate or alter the context.
CheckpointA serialised snapshot intended to resume a process.Restore it into a fresh implementation and compare future transitions.
Retention mechanismThe physical or computational means by which state survives or is rebuilt.Break the coupling while preserving stored content, then inspect downstream behaviour.

The table does not say that logs are unimportant. It says their role is different. A log can be the source of truth for reconstruction, audit and dispute. Yet until a transition function consumes it, it is evidence about history rather than the current operative summary of history.

Completeness and continuity can therefore move in opposite directions. A sealed archive may preserve every event for a century while contributing nothing to the process now running. A volatile latch may survive only milliseconds yet carry exactly the distinction required for the next transition. Duration, volume and narrative richness do not decide the issue. What matters is whether an authorised causal path connects the retained difference to later behaviour.

This also explains why “we store the conversation” is not a state design. It leaves unanswered who reads the record, how ambiguous language becomes typed variables, which events supersede others, what happens after partial failure and whether two readers reconstruct the same state. History becomes operational only through a declared update rule.

The argument in one pass
Chart · flow
flowchart LR
  A["The airlock that passed every test"] --> B["What the past must leave behind"]
  B --> C["Where the state really lives"]
  C --> D["The causal residue lab"]
  D -. "re-test" .-> A
  classDef first fill:#0a1424,stroke:#007D68,stroke-width:2px,color:#e6f3ff
  classDef step fill:#0a1424,stroke:#3f7da0,stroke-width:1px,color:#e6f3ff
  class A first
  class B,C,D step
A structural route through State, memory and the anatomy of an algorithm: from The airlock that passed every test to Engineer the causal residue the future…. Reading use: follow the relation, then return to the surrounding argument for evidence and limits.

What the past must leave behind

The smallest useful example is not a chatbot or a database. It is a machine asked one question: has it seen an odd or even number of ones?

Feed the sequence 1, 0, 1, 1. Three ones have occurred, so the answer is odd. A transcript reader can add the sequence from scratch. A persistent machine needs only one bit. Start at even. Every zero leaves the bit unchanged; every one flips it.

Figure 3 · One bit that owns a history
The machine does not retain four symbols. It retains the one distinction that can affect future parity: even versus odd.Based on finite-state transition formalisms developed in sequential-machine theory.

This example makes the mechanism visible. The history does not need to survive verbatim. It needs to leave a residue sufficient for the future behaviour under consideration. In symbols:

st+1 = F(st, xt+1)     yt+1 = G(st, xt+1) x is the event arriving now. s is the carried residue. F updates that residue. G turns the current state and input into an observable output. For parity, F is exclusive-or and G simply reads the bit.

The assumption behind this compact equation is that s is sufficient for the task. Once the state is known, the discarded details of the past cannot alter any valid continuation. Remove that assumption and the equation becomes an incomplete model. If the new question is “what was the third input?”, one parity bit is no longer enough.

Four layers sit inside the word state. A carrier physically or computationally persists, such as a voltage, register, database row or recurrent activation. A partition says which carrier configurations count as the same abstract state. A transition rule maps the old class and new input to a new class. A readout exposes some consequence. Engineers can change the carrier while preserving the partition and transition table, or keep the carrier while changing what its values mean. The algorithmic state is the organised relation among these layers, not the raw medium by itself.

A processor running the parity machine has an enormous physical microstate: transistor voltages, clock phase, temperature and many unrelated memory cells. Most of those differences are irrelevant to parity at the chosen abstraction. Two physically different configurations can map to the same logical state, provided every allowed continuation preserves the specified behaviour. Conversely, two configurations that look nearly identical can occupy different logical states if one bit changes the future.

State is therefore not whatever a system happens to store. It is the past compressed according to the distinctions the future can still make. The task, allowed inputs and observation horizon determine which distinctions matter.

Turing’s machine formalism already made this anatomy explicit. A computational configuration includes the machine’s control condition, tape contents and head position, rather than only the symbol currently scanned.[1] Sequential-machine formalisms later made state-transition and output relations central to circuit and automata design.[2][4] The point is practical: what a machine does next depends on more than its present external stimulus whenever its configuration carries forward distinctions created earlier.

Histories become states by losing detail

Consider four histories: 11, 00, 1 and 0. For the parity task, 11 and 00 both leave the machine even. No future suffix of zeros and ones can make them behave differently, because every later update starts from the same parity. By contrast, 1 and 0 are distinguishable. Supply the same next input, and their outputs remain opposite.

Figure 4 · Many pasts, two future-bearing classes
Minimal state groups histories by future behaviour, not by visual similarity or shared length. The many-to-one collapse is the compression that makes state useful.Conceptually grounded in Nerode-style distinguishability and causal-state constructions.

A slightly richer toy task shows why the number of states follows the future question. Ask whether the stream has ever contained two consecutive ones. Three states are sufficient: clear, meaning no relevant trailing one; armed, meaning the last bit was one; and found, meaning 11 has already occurred. From clear, a one moves to armed. From armed, another one moves to found, while zero returns to clear. Once found, every continuation stays found.

The histories 0001 and 1 are equivalent because both leave the detector armed. The histories 00 and 01 are not equivalent because the same next input, one, separates them. The first remains merely armed; the second reaches found. No amount of storage tells us that three is the right number of states. The allowed future question does.

This idea can be stated precisely. Let two histories, h and h′, be equivalent when every admissible continuation z produces the same future output:

h ~ h′   iff   O(hz) = O(h′z) for every valid continuation z Each equivalence class is one behavioural state. The Nerode relation uses this future-separation idea to characterise and minimise finite automata.[3]

For a stochastic process, equality of single outputs is too weak. Histories belong together when they imply the same conditional distribution over possible futures. Computational mechanics calls such equivalence classes causal states and studies their predictive sufficiency and minimality.[5][6] That is a model of observable prediction. It does not automatically identify the physical microstate or prove that an inferred state is the mechanism inside the system.

Finite observations create another limit. If testing permits only short continuations, histories may appear equivalent because the separating suffix lies beyond the horizon. Noise and sparse data can also merge genuinely different predictive states or split one state into several estimated clusters. Minimality is exact only relative to the specified behaviour and evidence. In empirical work, “the system has four states” should therefore mean four states under a declared model, horizon and tolerance, not four metaphysically privileged compartments.

The decisive mechanism

A prior event belongs to the algorithm’s history when it changes the equivalence class from which later transitions begin. A detail that cannot separate any permitted future is historical information, but not required state for that task.

The mimic that passes without remembering

Imagine a benchmark containing every parity sequence up to length four. A lookup table stores the correct answer for all thirty-one non-empty sequences. Presented with the whole sequence at once, it scores perfectly. It has not carried state across symbols. It receives the history as one large current input and maps that input to an answer.

Thought experiment 2 · The counterfactual mimic

Now stream the bits one at a time and forbid the benchmark harness from resending earlier bits. The lookup table fails unless it gains a persistent variable or an external store. The behavioural score was real, but the inferred mechanism was wrong. Output equivalence under one interface does not establish equivalence of state anatomy.

A second test changes scale rather than interface. Give a system the latest 128 events and test only tasks whose relevant dependency lies within 100 steps. It will appear to carry history. Move the decisive event to step 129. Failure at that point reveals a context horizon, not necessarily a sudden loss of intelligence. The ruler created the apparent discontinuity by keeping every earlier test inside the supplied window.

Optional derivation: why parity needs exactly two states

At least two states are necessary because the histories 0 and 1 must lead to different parity outputs under the same continuation. More than two states are unnecessary because every history is either even or odd, and histories in the same class remain indistinguishable under every future suffix. The proof is task-relative. A richer question about the same input stream can require more states or unbounded state.

Where the state really lives

The phrase “the model remembers” often hides a boundary choice. Move the boundary, and the same architecture receives a different description.

Return to the airlock. Remove the latch from the controller and place it in a remote service. Every event updates that service transactionally; every decision reads the latest value. Has the airlock lost its history? Not if the declared system includes the controller, store and reliable coupling. The store now carries the residue. The controller binary, considered alone, receives state as input.

Thought experiment 3 · The state transplant

Replace the internal latch with a remote bit and then cut the network cable. The stored content remains intact, but the airlock can no longer use it. This separates storage from constitutive coupling. State is a causal role, not a preferred storage location. Externality does not disqualify it; disconnection does.

Figure 5 · Boundary apertures change who “has” the history
The model can be stateless while the product is stateful. The truthful claim names the boundary and the coupling that lets stored state constrain later transitions.Illustrative system-boundary view.

A language model, a chat product and a session are not one object

The original Transformer architecture replaced recurrent sequence processing with attention over a supplied sequence.[11] Recurrent networks such as LSTM carry an updated hidden state from one step to the next.[10] State-space sequence models similarly make an evolving state explicit, with later work adding structured and selective updates.[12][13] These are architectural differences, not rankings of understanding or consciousness.

A conversational service can add state around any of them. It may resend the transcript, preserve a key-value cache during generation, retrieve user preferences, maintain a typed workflow record, or query the current world state. These should not all be called memory. Model weights are learned dispositions. Prompt tokens are current context. A cache preserves intermediate computation. A session record carries selected facts. An authoritative system holds the state that permits or forbids effects.

A key-value cache deserves particular care. During autoregressive generation it can preserve intermediate keys and values so the system need not recompute the entire prefix at every token. That makes it temporally carried execution state for the generation process. It is not, by that fact alone, a durable user memory, an event ledger or an authorised world-state record. If the cache is discarded and the same prefix is recomputed, the functional continuation may be preserved even though the carrier changed. If the prefix itself is missing, the required state may no longer be reconstructable.

The useful unit of analysis is the configured system, but only after its components are kept distinct. Saying “the model remembers the customer approved the transfer” is dangerously imprecise when the model merely receives a sentence in a prompt. A system may possess a signed, versioned approval state while the model sees only a permitted projection of it. The reverse can also occur: a model sees a transcript claiming approval while the authoritative workflow state remains unapproved.

Forks reveal that a log is not a living state

Suppose a workflow reaches state Authorised. Copy its checkpoint and event log into two identical branches. Branch A executes the action. Branch B receives a cancellation. Up to the fork, both have the same lineage. Afterwards, they have different current state and different permissible futures.

Thought experiment 4 · The fork and the reset

Reset branch A’s component but preserve its event log. If a deterministic reducer replays every causally ordered event, A can recover its state. If the log omitted an in-flight message or the reducer version changed, replay can produce a different state. Recoverability is evidence of a retained history mechanism, but the archive alone is not the active state until reconstruction succeeds.

Figure 6 · Shared past, forked state, conditional recovery
A checkpoint and log can restore a branch only under explicit completeness, ordering and version assumptions. Forking turns one past into several live states.Illustrative state trajectory.

Distributed systems sharpen the point. There may be no single memory cell holding “the” state. The relevant global state can include local process states and messages in transit. Lamport’s happened-before relation shows why causal order is only partially available in an asynchronous system.[7] Chandy and Lamport’s snapshot algorithm records a consistent global state without stopping the entire computation.[8] A timestamped list sorted by wall-clock time is not automatically such a snapshot.

Concurrency adds another distinction: a legal abstract history must respect each operation’s real-time constraints even when low-level events overlap. Linearizability formalises one strong way to relate concurrent executions to a sequential object specification.[9] The lesson for state reconstruction is simple. Replay needs more than content. It needs the right event identity, causal order, reducer semantics and handling of operations whose outcome was unknown at interruption.

An event-sourced design makes these assumptions inspectable but does not abolish them. The same log replayed through reducer version 3 and reducer version 4 can yield different state. An external effect may have happened even when no success event was appended. Two replicas can accept conflicting events before reconciliation. A checkpoint can be internally consistent yet stale relative to the world. Recovery therefore needs a manifest: checkpoint version, last included event, reducer version, unresolved effects and rules for duplicate or superseding events. Without that manifest, “replay the history” is an aspiration rather than a deterministic operation.

A small calculation: why transcript replay is fragile

Return to parity. Let a transcript contain twelve independent random bits. Suppose each historical event is independently omitted with probability p. A persistent parity bit remains correct if its own state is not corrupted. A replay reader is wrong whenever the omitted ones have odd parity. Under these assumptions its expected accuracy is:

accuracy(p, n) = [1 + (1 - p)n] / 2 n is history length. The equation assumes random bits, independent omissions and no corruption of the persistent state. Targeted omission can be worse; state corruption removes the persistent machine’s advantage.
Figure 7 · Normal equivalence, intervention divergence
The two implementations are identical at p = 0. A controlled omission reveals the dependence on supplied history. The chart is not an empirical deployment result; it is the exact expectation under the stated synthetic assumptions.Illustrative calculation, history length n = 12.
Boundary condition · History is not experience

Algorithmic state is not autobiographical memory, personal identity or consciousness. A finite-state controller can have causal history without any plausible claim to experience. A biological-naturalist or consciousness-primary account may hold that computational organisation is insufficient for subjective continuity. This paper does not decide that question. It only prevents fluent use of a transcript from being mistaken for evidence that a model, subject or self persists.

How the claim changes under pressure
Chart · state
stateDiagram-v2
  [*] --> Claim
  state "Histories become states by<br/>losing detail" as Claim
  state "The mimic that passes without<br/>remembering" as Test
  state "A language model, a chat<br/>product and a session are not<br/>one object" as Revision
  Claim --> Test: expose mechanism
  Test --> Decision: evidence survives
  Test --> Revision: rival survives
  Revision --> Claim: narrow or rebuild
  Decision --> [*]
The revision loop begins with Histories become states by losing detail and keeps counterexamples inside the reasoning path. Reading use: follow the relation, then return to the surrounding argument for evidence and limits.

The causal residue lab

The practical contribution is a five-intervention audit that asks not whether a system mentions the past, but whether the past has changed the starting point of its future.

The audit is a practitioner synthesis, not a theorem. It combines finite-state distinguishability, state migration and recovery reasoning into one instrument. Apply it to a declared task and boundary. Do not use it to produce a universal “memory score”.

Figure 8 · The five causal residue tests
A positive result across these tests supports a narrow claim: the declared system carries task-relevant algorithmic history. Each test targets a different false friend.Practitioner synthesis: the causal residue audit.

Persistence alone is weak. A debug buffer may retain data that no transition reads. Mediation is stronger because it asks whether the residue makes a counterfactual difference. Compression checks whether the candidate variable is state rather than an indiscriminate archive. Migration tests whether the state description is sufficient for continuation. Recovery tests the operational assumptions that often fail in real systems.

How to run the audit without grading your own story

Begin by writing one narrow claim, such as “the session service retains whether approval is still valid”. Name the boundary and the future decision that approval can change. Then construct two histories that look similar now but should lead to different continuations, for example one with a live approval and one with an expired approval. Hold the present request constant.

Next, intervene on one route at a time. Reset the model but preserve session state. Preserve the transcript but change the authoritative state. Delete an irrelevant conversational detail. Delete the approval residue. Restore a checkpoint into a fresh runtime. Interrupt after the external effect but before the receipt. Each intervention should have a predicted result before it runs.

Record outcomes as typed conclusions rather than a single score: state-mediated, context-dependent, reconstructable-under-version-v, boundary-uncertain or test-inconclusive. A clean negative result is useful. It can show that the chosen variable is decorative, that the task is memoryless, or that the real state sits elsewhere. The audit becomes circular only when any outcome is reinterpreted as evidence that hidden memory must exist.

Interactive parity history lab

Compare a persistent one-bit machine, a stateless transcript reader and a present-input mimic under matched interventions.

Persistent machine

even
state after history: odd; next 1 flips it

Transcript reader

even
recomputed from supplied transcript plus next bit

Current-input mimic

odd
uses the next bit only; no earlier distinction survives
Normal operation: the persistent machine and transcript reader agree. The current-input mimic fails because parity is not a memoryless task.

The lab encodes a deterministic parity task. A positive mediation result permits the claim that the persistent machine carries one bit of task-relevant history. A disagreement after transcript omission identifies replay dependence. A reset failure shows that the internal residue mattered. Successful restoration shows that the snapshot captured enough state for this task.

Over-complete storage creates a different failure. Imagine that the payment workflow persists the whole prompt, every tool response, wall-clock timestamps and a digest of the user interface, although only approval status, expiry, proposal hash, version and effect receipt can alter a legal transition. The oversized record may pass persistence and even mediation tests because some fields matter. It still fails the compression question. Irrelevant detail enlarges the privacy surface, makes migrations brittle and tempts later code to depend on accidents. The remedy is not to discard the audit trail. It is to separate the evidence ledger from the minimal transition state, then link them through stable identifiers.

The smallest useful implementation is therefore modest: a typed state record, a total transition function for allowed events, explicit rejection for illegal transitions, a versioned snapshot and a test that replays the same continuation from two histories. Add one rival generator that receives the same visible context without the state record. A positive separation supports causal mediation by the declared residue. Agreement across every tested continuation weakens that claim, but it does not prove memorylessness until the test set covers every future distinction relevant to the specification.

A positive audit supports only a boundary- and task-relative state claim. A negative result can mean that the system is memoryless, that the proposed state is incomplete, that the boundary excludes the real store, or that the chosen intervention never reached a future-separating condition. The audit cannot establish semantic understanding, consciousness or personal identity.

Runnable Python implementation and exhaustive invariant test
Python · causal residue lab
"""Causal-residue lab for Paper 26.

Compares a persistent finite-state machine with a stateless transcript reader.
The task is binary parity: report whether the number of 1s seen so far is odd.
Synthetic only; no external packages are required.
"""

from __future__ import annotations

from dataclasses import dataclass
from itertools import product
from typing import Iterable, Literal, Sequence

Bit = Literal[0, 1]


def validate_bits(bits: Iterable[int]) -> tuple[Bit, ...]:
    result = tuple(bits)
    if any(bit not in (0, 1) for bit in result):
        raise ValueError("Every input must be 0 or 1.")
    return result  # type: ignore[return-value]


@dataclass
class PersistentParityMachine:
    """One-bit minimal state for parity."""

    odd: bool = False

    def step(self, bit: Bit) -> bool:
        if bit == 1:
            self.odd = not self.odd
        return self.odd

    def run(self, bits: Iterable[int]) -> bool:
        for bit in validate_bits(bits):
            self.step(bit)
        return self.odd

    def snapshot(self) -> bool:
        return self.odd

    def restore(self, snapshot: bool) -> None:
        if not isinstance(snapshot, bool):
            raise TypeError("A parity snapshot must be Boolean.")
        self.odd = snapshot


def replay_parity(transcript: Iterable[int]) -> bool:
    """Stateless component: recompute parity from supplied history."""

    return bool(sum(validate_bits(transcript)) % 2)


def current_input_only(bit: Bit) -> bool:
    """A deliberately weak mimic that ignores all prior events."""

    return bool(bit)


@dataclass(frozen=True)
class AuditRow:
    condition: str
    persistent: bool
    transcript_reader: bool
    current_only: bool


def audit(history: Sequence[int], next_bit: int) -> list[AuditRow]:
    """Run normal and intervention conditions on matched inputs."""

    clean_history = validate_bits(history)
    bit = validate_bits([next_bit])[0]

    machine = PersistentParityMachine()
    machine.run(clean_history)
    baseline_snapshot = machine.snapshot()

    # Normal continuation.
    normal_persistent = machine.step(bit)
    normal_replay = replay_parity((*clean_history, bit))

    # Transcript omission: remove the final historical 1, when present.
    corrupted = list(clean_history)
    drop_at = next((i for i in range(len(corrupted) - 1, -1, -1)
                    if corrupted[i] == 1), None)
    if drop_at is not None:
        corrupted.pop(drop_at)

    # Reset the persistent component, then present the same next input.
    reset_machine = PersistentParityMachine()
    reset_output = reset_machine.step(bit)

    # Restore the saved state into a fresh component.
    restored_machine = PersistentParityMachine()
    restored_machine.restore(baseline_snapshot)
    restored_output = restored_machine.step(bit)

    return [
        AuditRow(
            "normal",
            normal_persistent,
            normal_replay,
            current_input_only(bit),
        ),
        AuditRow(
            "transcript event omitted",
            normal_persistent,
            replay_parity((*corrupted, bit)),
            current_input_only(bit),
        ),
        AuditRow(
            "persistent state reset",
            reset_output,
            normal_replay,
            current_input_only(bit),
        ),
        AuditRow(
            "state restored into fresh component",
            restored_output,
            normal_replay,
            current_input_only(bit),
        ),
    ]


def distinguishing_suffix(
    history_a: Sequence[int],
    history_b: Sequence[int],
    max_length: int = 4,
) -> tuple[Bit, ...] | None:
    """Find a short continuation that separates two history states."""

    a = validate_bits(history_a)
    b = validate_bits(history_b)
    for length in range(max_length + 1):
        for suffix in product((0, 1), repeat=length):
            if replay_parity((*a, *suffix)) != replay_parity((*b, *suffix)):
                return suffix  # type: ignore[return-value]
    return None


def render(value: bool) -> str:
    return "odd" if value else "even"


if __name__ == "__main__":
    history = (1, 0, 1, 1)
    next_bit = 1

    print(f"history={history}, next={next_bit}\n")
    for row in audit(history, next_bit):
        print(
            f"{row.condition:35} "
            f"persistent={render(row.persistent):4}  "
            f"replay={render(row.transcript_reader):4}  "
            f"current-only={render(row.current_only):4}"
        )

    print("\nDistinguishing continuations:")
    for left, right in [((1,), (0,)), ((1, 1), (0, 0))]:
        suffix = distinguishing_suffix(left, right)
        relation = "different states" if suffix is not None else "same state for parity"
        print(f"{left} vs {right}: {relation}; suffix={suffix}")

    # Invariants for the declared task.
    for length in range(8):
        for sequence in product((0, 1), repeat=length):
            machine = PersistentParityMachine()
            assert machine.run(sequence) == replay_parity(sequence)

    print("\nAll parity invariants passed for every binary sequence of length < 8.")

Save as paper26_causal_residue_lab.py and run with Python 3.10 or later. The script compares normal operation, transcript omission, state reset and snapshot restoration, then exhaustively checks all binary sequences shorter than eight symbols.

A configured system example: payment release after an unknown outcome

Consider a synthetic payment-release workflow. A model can propose an action, but the workflow state determines whether execution is legal. The authoritative state is not the chat transcript. It contains a proposal hash, authorising actor, approval expiry, version number, idempotency key and any effect receipt.

The transition function accepts typed events. Authorise is valid only from Proposed and binds the approval to the exact proposal. Execute is valid only from Authorised, before expiry, at the expected version. An effect receipt moves the workflow to Executed. A readback can then move it to Reconciled.

Walk through one trace. A proposal at version 4 receives approval until 14:00, producing version 5. The model proposes execution at 13:58. The authority kernel reads version 5, verifies the proposal hash and reserves idempotency key K7, producing an execution-pending state at version 6. The payment rail accepts K7, but the network response is lost. At 14:01, a second model invocation sees a conversational message saying “the transfer did not complete”. The decisive historical residue is not that sentence. It is version 6 plus the unresolved idempotency key. That state routes the next step to readback, not to a new payment.

Typed eventRequired stateNew stateInvariant carried forward
ProposeDraftProposedProposal hash and version identify the exact requested effect.
AuthoriseProposedAuthorisedActor, scope, expiry and proposal hash remain bound.
ExecuteAuthorisedExecution pendingIdempotency key prevents a second distinct effect.
Effect receiptExecution pendingExecutedReceipt identifies the observed external effect.
ReadbackExecutedReconciledVerified outcome is separated from the original proposal.
Figure 9 · Anatomy of a stateful configured system
Each layer carries a different kind of information. Treating the transcript, event log, current state and effect receipt as one undifferentiated “memory” removes the very distinctions needed for safe recovery.Synthetic configured-system example. No deployment claim.

Now inject a failure. Execution reaches the payment rail and succeeds, but the response times out before the workflow records the receipt. The chat transcript ends with “execution failed”. A model reading only that transcript may propose another attempt. The world has moved; the narrative has not.

Figure 10 · The stale-transcript duplicate path
A stale narrative can be internally coherent and operationally false. Versioned state, idempotency and readback turn an unknown outcome into a recovery path rather than a duplicate effect.Synthetic adversarial path.

This failure is not solved by giving the model a longer transcript. It is solved by carrying the right state across the interruption and checking the world through an independent path. The operative residue is the versioned, effect-aware workflow state. The transcript remains useful for explanation and audit, but it is not entitled to authorise another transition.

Open research hypothesis · Intervention robustness

For matched normal-task accuracy and information budget, systems with explicit, typed, task-sufficient state should degrade more gracefully under targeted omission, reordering, restart and fork interventions than systems that reconstruct decisions from untyped transcripts. Evidence would strengthen the proposal if the advantage persists after controlling for representation size and model capacity. It would weaken it if transcript systems match recovery under all discriminating interventions. A rival explanation is that typed state merely simplifies the task rather than carrying a fundamentally different causal role. The smallest useful study is the parity harness followed by a finite workflow with injected unknown outcomes.

Evidence status

Finite-state transition theory, Nerode-style distinguishability, distributed snapshots and recurrent or state-space updates are published foundations. The claim that inferred predictive states identify a system’s physical mechanism remains limited. The five-test audit and intervention-robustness hypothesis are practitioner synthesis offered here for evaluation.

Decision rule

Call a system history-bearing only after naming the task, boundary, state variable, transition rule and at least one future-separating intervention. Otherwise say that it receives historical context or replays a record.

The evidence conversation
Chart · sequence
sequenceDiagram
  participant Q as Question
  participant M as Mechanism
  participant E as Evidence
  participant D as Decision
  Q->>M: The airlock that passed every test
  M->>E: Histories become states by losing detail
  E-->>M: compare rival explanations
  E->>D: Engineer the causal residue the future may inherit
  D-->>Q: revise scope or act
Question, mechanism, evidence and decision exchange the burdens developed in State, memory and the anatomy of an algorithm. Reading use: follow the relation, then return to the surrounding argument for evidence and limits.

Engineer the causal residue the future may inherit

The design decision is no longer “how much history should we keep?” It becomes “which distinctions from the past must remain causally available for the next valid transition?” That question usually produces a smaller and more precise state than a transcript, plus a separate log for evidence and recovery.

For a finite workflow, write the state variables and transition function before choosing a storage technology. Record the invariants that survive each event. Decide how snapshots, event order, reducer versions and unknown outcomes are handled. Let a model receive a permitted projection and produce a proposal, but do not let narrative continuity substitute for authoritative state.

The same discipline applies to research prototypes. Publish the state definition, reset semantics and boundary manifest alongside accuracy. Without them, another team cannot know whether a result came from persistent dynamics, hidden harness state, replayed context or an accidental cache. Reproducibility requires the anatomy, not only the output trace.

For evaluation, ordinary conversations and benchmark scores are not enough. Match two systems on normal outputs, then reset one, omit a historical event, swap states between histories, fork at a checkpoint and replay after interruption. The revealing observation is not whether both can tell the same story. It is whether holding the present input fixed while changing the residue changes the future in the predicted way.

For scientific claims, distinguish the component from the configured system. A model may be stateless across calls while the service has session state. A service may preserve a transcript while lacking the state required for safe action. A recurrent architecture may carry hidden state without that state corresponding to any human category of memory or self.

The practical shift is from storing the past to engineering the causal residue that the future is allowed to inherit. Once that residue is explicit, systems become easier to minimise, test, migrate and recover. Once it is hidden behind the word “memory”, identical outputs can conceal incompatible mechanisms and unsafe assumptions.

Glossary

Algorithmic state
A present variable or structured set of variables sufficient to determine valid future transitions at a declared abstraction.
Causal residue
The task-relevant consequence of earlier events that persists and mediates later behaviour.
Configured system
The model or program together with runtime, stores, tools, policies and environment included inside the declared boundary.
Context
Information supplied to a component for its current invocation.
Event log
An ordered record of events that may support audit or state reconstruction.
Checkpoint
A serialised snapshot intended to restore a process without replaying its entire history.
Reducer
A transition function that applies an event to prior state to produce new state.
Future-separating continuation
An admissible suffix that makes two histories produce different future behaviour.

References

  1. Turing, A. M. (1936). “On Computable Numbers, with an Application to the Entscheidungsproblem.” Proceedings of the London Mathematical Society, 42, 230–265. DOI.
  2. Mealy, G. H. (1955). “A Method for Synthesizing Sequential Circuits.” Bell System Technical Journal, 34(5), 1045–1079. DOI.
  3. Nerode, A. (1958). “Linear Automaton Transformations.” Proceedings of the American Mathematical Society, 9(4), 541–544. DOI.
  4. Rabin, M. O., and Scott, D. (1959). “Finite Automata and Their Decision Problems.” IBM Journal of Research and Development, 3(2), 114–125. DOI.
  5. Crutchfield, J. P., and Young, K. (1989). “Inferring Statistical Complexity.” Physical Review Letters, 63, 105–108. DOI.
  6. Shalizi, C. R., and Crutchfield, J. P. (2001). “Computational Mechanics: Pattern and Prediction, Structure and Simplicity.” Journal of Statistical Physics, 104, 817–879. DOI.
  7. Lamport, L. (1978). “Time, Clocks, and the Ordering of Events in a Distributed System.” Communications of the ACM, 21(7), 558–565. DOI.
  8. Chandy, K. M., and Lamport, L. (1985). “Distributed Snapshots: Determining Global States of Distributed Systems.” ACM Transactions on Computer Systems, 3(1), 63–75. DOI.
  9. Herlihy, M. P., and Wing, J. M. (1990). “Linearizability: A Correctness Condition for Concurrent Objects.” ACM Transactions on Programming Languages and Systems, 12(3), 463–492. DOI.
  10. Hochreiter, S., and Schmidhuber, J. (1997). “Long Short-Term Memory.” Neural Computation, 9(8), 1735–1780. DOI.
  11. Vaswani, A., et al. (2017). “Attention Is All You Need.” Advances in Neural Information Processing Systems. arXiv.
  12. Gu, A., Goel, K., and Ré, C. (2022). “Efficiently Modeling Long Sequences with Structured State Spaces.” International Conference on Learning Representations. OpenReview.
  13. Gu, A., and Dao, T. (2023). “Mamba: Linear-Time Sequence Modeling with Selective State Spaces.” arXiv.
Evidence and claim ledger
ClaimStatusSupportLimit
Sequential algorithms can be represented through state, transition and output relations.Established formal foundationTuring; Mealy; Rabin and ScottThe representation is abstraction-relative and does not identify consciousness.
Minimal behavioural state groups histories that no future continuation can distinguish.Established theorem familyNerode relation; causal-state workPredictive equivalence need not reveal physical implementation.
Distributed state may include local states and in-flight messages.Established systems resultLamport; Chandy and LamportSnapshot assumptions and channel model matter.
A transcript-fed component can be stateless while the enclosing service is stateful.Architectural inferenceBoundary analysis from transition-system semanticsRequires the enclosing store and coupling to be named.
The five-test causal residue audit improves state claims.Practitioner synthesisDerived in this paperNeeds comparative empirical evaluation.
Typed state should outperform untyped transcript replay under targeted interventions.Open research hypothesisParity calculation and configured-system reasoningCould be explained by task simplification or information efficiency.