# What structural signals indicate that speculative branch-and-validate execution has silently collapsed into serial validation **Date of Record:** 2026 November 18 **Scope:** Applies to multi-agent systems that speculatively fork an agent graph into parallel candidate branches, execute them concurrently, and select a winning branch via a validator (critic, scorer, or consensus check), rolling back losers. Does not apply to single-agent speculative decoding, nor to fan-out systems where branches are independent and never reconciled. ## Core Distinction Speculative multi-agent rollback has two failure regimes that look identical on dashboards. The first is *benign speculation loss*: branches run in parallel, the validator picks one, and losers are discarded — wasted compute, but the invariant "the committed branch was validated against the actual state it will be committed into" holds. The second is *silent serialization*: the scheduler still reports N concurrent branches, but the validator has begun gating on state that only the winner's own descendants produce, so each branch is effectively validated in sequence against a moving target. The distinguishing signal is not throughput or branch count. It is whether the *validation predicate's input closure* is a subset of the branch's speculative read set. When the validator reads anything written after the fork point — including sibling branches' side effects — the branches are no longer speculative; they are a serial pipeline wearing a fork's instrumentation. ## What Was Observed In a planner-executor graph with three forked planner branches (A, B, C) and a shared `workspace` store, the validator was configured to score each branch against `workspace.latest_summary`. Under load, branch A completed first and wrote its summary at t=40ms; B and C were still mid-execution. The validator, invoked per-branch as each finished, scored A against A's own summary (correct), B against A's summary (stale, since B had not yet written), and C against B's summary. The result: B and C were scored against *predecessor* state rather than their own proposed state, and the "winner" was whichever branch happened to write last, not whichever was best. Concurrency metrics showed 3.0 average in-flight branches throughout. The only observable anomaly was a rise in validator-input cache misses and a correlated drop in *rollback rate* — losers were being committed as winners because the validator was comparing apples to the wrong apples. Rollback rate going to zero is the canonical tell: a healthy speculative system rolls back roughly (N-1)/N of its branches. ## Condition of Validity The invariant "speculative branches are independently validatable" holds only when, for every branch `b` and validator `v`: 1. `reads(v) ⊆ writes(b) ∪ immutable_fork_snapshot`, and 2. `writes(b) ∩ writes(b') = ∅` for all sibling branches `b' ≠ b` (no write-write conflict on the validation surface), and 3. the fork snapshot is frozen — no branch may mutate the snapshot the validator reads. If condition 1 fails because the validator reads a *shared mutable* field that any branch can write, condition 2 is violated transitively: branch A's write becomes an input to B's validation. This is the boundary. It is non-obvious because the fork point is usually correct — the graph *is* forked — but the validator is wired to a store that is *not* branch-scoped. The failure is in the validation topology, not the execution topology. ## Decision Boundary Do not attempt to "fix" this by adding a lock around the validator. Serializing the validator converts silent serialization into explicit serialization and destroys the throughput that justified speculation. The correct decision boundary is: - If `writes(validator_input) ∩ writes(branches) ≠ ∅` and the shared field is *intended* to be shared (e.g., a global budget counter), scope it as a read-only projection computed *after* all branches commit, and validate against each branch's private proposal instead. - If the shared field is *unintended* (a leaky workspace), re-scope the store to be branch-local with copy-on-fork semantics; the validator must read `branch.private_view`, never `workspace.latest`. - If neither is feasible, the system is not speculative — demote to serial and stop paying for fork instrumentation. The signal to act is rollback rate approaching zero concurrent with validator-input cache misses rising, or a divergence between `branch.private_view` and the value the validator actually scored. ## Operational Effect Left unaddressed, the system commits the last-writer branch, which correlates with *slowest* branch, not best — a systematic bias toward whichever branch was scheduled last or blocked longest. Downstream, the committed state may satisfy the validator's stale predicate while violating the branch's own postconditions, producing a graph that passes validation and fails execution. Recovery requires replaying the fork with branch-scoped validation. The operational rule: instrument the validator's *input provenance*, not just its output score; a validator that cannot name which branch's writes it read is already serialized. ```python from dataclasses import dataclass, field from typing import FrozenSet class SpeculationCollapseError(RuntimeError): """Raised when a validator's read set leaks outside a branch's speculative write set.""" @dataclass(frozen=True) class Branch: name: str writes: FrozenSet[str] private_view: dict @dataclass class Validator: name: str reads: FrozenSet[str] fork_snapshot: FrozenSet[str] = field(default_factory=frozenset) def assert_independent_validation( validator: Validator, branches: list[Branch] ) -> None: """Enforce the validity condition before committing any branch. A branch is independently validatable only if the validator reads nothing outside that branch's writes plus the frozen fork snapshot, and no two branches write the same field. """ # Condition 2: no write-write conflicts across siblings. seen: dict[str, str] = {} for b in branches: for w in b.writes: if w in seen: raise SpeculationCollapseError( f"write-write conflict on {w!r}: branches " f"{seen[w]!r} and {b.name!r} both claim it; " f"validation is no longer branch-local" ) seen[w] = b.name # Condition 1 & 3: validator reads must be covered per-branch. for b in branches: uncovered = validator.reads - (b.writes | validator.fork_snapshot) if uncovered: raise SpeculationCollapseError( f"validator {validator.name!r} reads {sorted(uncovered)} " f"which branch {b.name!r} does not write and is not in the " f"fork snapshot; branch is being validated against " f"predecessor or sibling state (silent serialization)" ) def commit_winner( validator: Validator, branches: list[Branch], scores: dict[str, float] ) -> Branch: assert_independent_validation(validator, branches) if len(scores) != len(branches): raise SpeculationCollapseError( "every branch must be scored against its own private_view" ) winner = max(branches, key=lambda b: scores[b.name]) losers = [b for b in branches if b is not winner] if not losers: raise SpeculationCollapseError( "zero rollback: no losing branch, speculation did not occur" ) return winner ```