# In what scenarios must an instance abort speculative execution when a Byzantine-safe commit protocol cannot establish a quorum-stable read set **Date of Record:** 2026 November 24 **Scope:** Applies to multi-agent systems where an orchestrator dispatches speculative execution branches against a shared state store, and commits are gated by a Byzantine-fault-tolerant (BFT) quorum protocol. Does not apply to single-writer systems or to optimistic concurrency with a single authoritative sequencer. ## Core Distinction Most treatments of speculative execution conflate *speculation validity* (was the branch's local computation self-consistent?) with *commit safety* (does a quorum of replicas agree that the read set the branch consumed was the same set the commit will linearize against?). These are orthogonal. A speculative branch can be perfectly internally consistent—deterministic tool calls, well-formed reasoning trace, no local exceptions—and still be unsafe to commit because the *read set it consumed* was assembled from replicas that did not form a Byzantine quorum at read time. The failure mode is not "the agent reasoned wrong." It is "the agent reasoned correctly over a state snapshot that no quorum ever certified." This is the boundary condition: speculative execution is only committable if the read set it consumed was certified by a quorum that is *intersecting* with the commit quorum. When those two quorums are disjoint—or when the intersection is below the fault threshold—the branch must be aborted, not retried blindly, because re-reading may return a different (equally uncertified) snapshot and the agent will loop. ## What Was Observed An orchestrator agent dispatched three speculative branches (B1, B2, B3) to plan a multi-step tool sequence against a replicated state store of 7 replicas configured for f = 2 Byzantine faults (quorum size 5). Each branch performed its own read phase: it queried replicas, applied a read-repair heuristic, and assembled a local state snapshot. The branches then ran their reasoning loops independently and produced candidate commit payloads. The commit protocol required a 5-of-7 certificate. The observed trace: 1. B1 read from replicas {r1, r2, r3, r4, r5} and assembled snapshot S1. All five responded within timeout; two returned a stale epoch marker but B1's read-repair accepted the majority epoch. 2. B2 read from replicas {r3, r4, r5, r6, r7} and assembled snapshot S2. S2 differed from S1 on key `k_balance` by a delta of one transaction. 3. B3 read from replicas {r1, r6, r7, r2, r3} and assembled S3, matching neither S1 nor S2 on `k_balance`. None of the three read sets was a *certified* quorum read in the BFT sense: each was assembled by local majority-of-responders, not by a signed read certificate from a quorum. The commit phase then attempted to gather 5-of-7 endorsements for each branch's payload. B1 and B2 each obtained 5 endorsements—but from *different* 5-subsets, and the intersection of the two endorsement sets was {r3, r4, r5}, size 3, which is below the 5 required for the quorums to be guaranteed intersecting under f = 2. The protocol accepted both commits because the endorsement count check was per-branch, not cross-branch. Result: two conflicting commits linearized, and the store diverged. The critical observation: **the failure was invisible at the branch level.** Each branch's local checks passed. The protocol's per-commit quorum check passed. Only the *cross-branch quorum intersection* was violated, and nothing in the pipeline checked it. ## Condition of Validity The invariant that must hold for a speculative commit to be safe: > For any two speculative branches Bi, Bj that both attempt commit, let Q_read(Bi) be the set of replicas whose signed state Bi consumed, and Q_commit(Bi) be the endorsement set. Safety requires |Q_read(Bi) ∩ Q_commit(Bj)| ≥ f + 1 for all i ≠ j, and |Q_read(Bi)| ≥ 2f + 1 with a valid read certificate. The first clause is the non-obvious one. Standard BFT reasoning gives you |Q_commit(Bi) ∩ Q_commit(Bj)| ≥ f + 1 (quorum intersection), which guarantees no two conflicting commits both succeed *if commits are serialized through the same quorum structure*. But speculative branches read *before* they commit, and if a branch's read set was not certified by a quorum, a conflicting branch can commit a value the first branch never saw. The read certificate is what binds the branch's consumed state to a quorum that will intersect the eventual commit quorum. The condition of validity therefore is: **speculation is only committable if the read phase produced a signed certificate from ≥ 2f+1 replicas, and the commit phase re-verifies that certificate against its own endorsement set.** Without the certificate, the branch is reasoning over an uncertified snapshot and must be treated as advisory, not committable. ## Decision Boundary The abort decision is not "did the branch fail?" It is a three-way boundary: - **Commit** if the branch holds a valid read certificate from ≥ 2f+1 replicas AND the commit endorsement set intersects every concurrent branch's read certificate by ≥ f+1. - **Re-speculate** only if the branch's read certificate is *absent* (not invalid) and the branch has not yet been endorsed—re-reading with a proper certificate is safe because no commit has been attempted. - **Abort** if the branch's read certificate is *invalid* (signature mismatch, epoch below commit epoch, or fewer than 2f+1 signers) OR if a concurrent branch has already committed against a read set that does not intersect this branch's read set by f+1. The non-obvious boundary: a branch with a *valid* read certificate can still be forced to abort if a concurrent branch committed first against a read set whose intersection with this branch's certificate is exactly f (not f+1). At f intersection, one faulty replica can bridge the two read sets and forge consistency. The abort must fire at f, not at f-1. ## Operational Effect The practical consequence is that speculative execution in a BFT store must carry read certificates as first-class artifacts through the entire branch lifecycle, and the commit gate must be a *cross-branch* check, not a per-branch count. This changes the orchestrator's design: 1. Every speculative branch must attach its read certificate to its candidate payload; a branch without one is downgraded to advisory and cannot be the sole basis for a commit. 2. The commit gate must maintain a live set of committed read certificates and reject any endorsement whose certificate intersection with a committed certificate is < f+1. 3. Aborted branches must be distinguished from failed branches: an abort due to certificate non-intersection should not trigger retry-with-same-input, because the input snapshot is the problem. It should trigger re-speculation with a fresh certified read. The cost is that speculative parallelism is bounded by certificate-intersection feasibility: you cannot run more concurrent branches than the quorum structure can certify intersecting read sets for. In practice this caps effective speculation at ⌊(2f+1)/(f+1)⌋ concurrent committable branches—for f = 2, that is 1. The system can *run* three branches, but only one can commit per certificate epoch; the others must be serialized or discarded. Treating them as parallel-committable is the bug. ```python class UncertifiedReadSetError(RuntimeError): """Raised when a speculative branch attempts commit without a quorum-certified read set.""" pass class QuorumIntersectionViolation(RuntimeError): """Raised when a branch's read certificate does not intersect a committed certificate by f+1.""" pass def certify_and_commit( branch, committed_certificates, f: int, quorum_size: int, ): # A branch must carry a signed read certificate from >= 2f+1 replicas. cert = branch.read_certificate if cert is None: # No certificate: branch is advisory only, cannot commit. raise UncertifiedReadSetError( f"branch {branch.id} has no read certificate; " f"reasoned over an uncertified snapshot and cannot be committed" ) if len(cert.signers) < quorum_size: raise UncertifiedReadSetError( f"branch {branch.id} read certificate has {len(cert.signers)} signers, " f"need {quorum_size} (2f+1 with f={f})" ) if cert.epoch < branch.commit_epoch: raise UncertifiedReadSetError( f"branch {branch.id} read certificate epoch {cert.epoch} " f"predates commit epoch {branch.commit_epoch}; snapshot is stale" ) # Cross-branch check: every already-committed certificate must intersect # this branch's read set by at least f+1 replicas. for committed in committed_certificates: overlap = cert.signers & committed.signers if len(overlap) < f + 1: # At exactly f overlap, a single faulty replica can bridge the # two read sets; abort, do not retry with same input. raise QuorumIntersectionViolation( f"branch {branch.id} read cert intersects committed cert " f"{committed.id} by {len(overlap)} replicas, need {f + 1} " f"(f={f}); aborting speculation, re-speculate with fresh read" ) return branch.commit_payload ```