Table of Contents

Verified WAL Concurrency

This page is part of the documentation for Orleans.Lattice 10.5.0 (release line 10.5), built 2026-12-05. It is also published as markdown, with every table and list, at verified-wal.md, and llms.txt lists every page.

The WAL's concurrency safety properties - no acknowledged write is lost, no reader skips an offset, the GC never trims what a consumer still needs - are machine-checked: each decision point that enforces them is a pure core that production and a Coyote model both execute.

The write-ahead log (WAL) is Orleans.Lattice's durability boundary: every mutation lands in the log before it is acknowledged, and a background garbage collector trims the log once every consumer has durably consumed past a point. That machinery runs under heavy concurrency - producers appending, peer ship loops and leaf materialisers reporting cursors, the GC trimming, and shard moves quiescing and re-fencing the log - and a handful of small decision points keep it safe.

This document describes the verification apparatus for the WAL: the proven-core pattern applied to the WAL seams, and the Coyote concurrency tier that model-checks each core under adversarial interleavings. It is an assurance document; the runtime behaviour it protects is documented in the Write-Ahead Log and Cross-cluster replication. It shares the proven-core pattern, harness, and tier policy with the Verified Atomic-Commit Protocol; read that first for the full description of the pattern and the [Category("Coyote")] tier.

The proven-core pattern, applied to the WAL

As with the atomic-commit protocol, each WAL decision point is extracted into a pure core - a single function (or small pure type) that takes explicit inputs and returns a verdict, with no Task/await, no wall-clock or HLC read, no Orleans types, and no storage. The production grain hot path calls the core to make the real decision, and a Coyote model calls the same core to check it under every explored ordering, so a property proven of the core is a property of production. The extracted cores are internal and exposed to the test assembly through InternalsVisibleTo; the in-memory cursor registry the cursor models drive directly is the public InMemoryWalCursorRegistry.

The extracted WAL cores

Core Decision it owns
WalShippingWatermark The durable-contiguous tail of a WAL shard that has several flushes in flight and out of completion order - the start of the oldest in-flight flush, or the next offset when none is in flight, which the WAL shard further bounds by every abandoned flush that can still land and by one past the highest stored offset (issue #4621) - and whether an offset may be shown to a cursor-advancing reader (the replication shipper, the view maintainer, leaf replay): only offsets strictly below the tail, so no reader is ever handed an offset above a still-unfilled prefix hole.
WalGcTrimCore.ClassifyEntry (IsEntryEligible is the same predicate without the refusal reason) Whether one log entry may be trimmed, given the GC's min-acked cursor, the optional retention ceiling, the durable materialiser offset admission (which can also refuse an entry only the in-memory cursor would admit), the causal-stable frontier, the lowest offset an offset-reading consumer such as the replication shipper has not durably consumed (issue #4579), and any buffer-pin blocked-floor - the exact per-entry predicate the GC scan applies.
InMemoryWalCursorRegistry (driven directly) The per-consumer cursor max-merge and the min(cursor) GC floor scan - a consumer cursor never regresses under a stale re-delivery, and the floor is the minimum across consumers.
WalMoveFenceCore Whether an append is admitted while a shard move has fenced the log (!moveFenced), and whether a stale quiesce observation must abort (observed > expected) - the fence check that must be atomic with the offset assignment. It also owns the durable move fence of issue #4525: whether an activation comes up fenced, whether a fence may be raised, renewed, taken over or released, and whether the placement may flip. WalMoveQuiesceModel checks only the append fence.
WalAdmissionGateCore.IsDispatchRefused Whether the commit-log writer refuses a new dispatch because it is draining for shutdown - the pre-admission gate paired with a drain that must release every parked caller.
WalOffsetAllocationCore.Assign The per-shard log-offset handed to an append and the single-step advance of the offset counter - the read-and-advance that must be atomic so two concurrent appends never share an offset and the sequence stays dense.
WalOffsetAllocationCore.RecoveredNextOffset The offset a recovering shard activation resumes from: one past the highest stored offset, so a recovered allocator never reissues an acknowledged offset. Activation, the post-failure resync and the test seam all recover through it.
WalBlockedFloorCore.Meet The lowest buffer-pin HLC across consumers - the meet (minimum) each consumer's live pin is folded into, so the GC's blocked floor tracks the slowest buffering consumer and never trims an entry a live buffer still needs.
WalMoveResumeCore Whether a move's target is a clean prefix of the source tail, and the offset a crashed-and-re-driven copy resumes just past - the resume arithmetic that makes an interrupted placement move copy each retained offset exactly once.
LeafDurablePinCore The durable materialiser pin a leaf publishes for a partition: a release for a partition with nothing to lose, the never-written release (#3453), itself bounded by durable snapshot coverage (#4456, #4523), the Zero block pin for a prefix whose only durable copy is the WAL, or a trim entitlement of min(persisted checkpoint, covered) - never the pending checkpoint (#3476). The leaf gathers the inputs and maps the verdict.
WalOrphanPinRetirementCore Whether the GC may remove an orphaned materialiser pin: only on a durable leaf read that is a husk (no record, or no tree id), only for a consumer id the gate reads as a leaf's own, within the pass budget, and - the fence of issue #5358 - only when the pin grain has recorded no merge of the consumer since the retirement's token, on the activation that issued it. The bulk orphan sweep, the starvation drive's retirement and the pin store's fenced removal all route through it.
WalFallOffCore Whether the WAL has been trimmed past the first offset a replay resuming after a checkpoint still needs (checkpoint >= 0 && tail > checkpoint + 1; a durably recorded checkpoint of 0 is a real read position, issue #4433). Both the fall-off-log detector and the activation's cold-replay guard route through it, so the two cannot disagree.

The core files live under src/lattice/, src/lattice/BPlusTree/, and src/lattice/BPlusTree/Grains/ next to the grains that call them.

The live checkpoint advance (epic #5605) adds further pure cores - LeafLiveAdvanceCore, WalAppendFenceCore and HandOffMarkerCore - as does the clock floor's WalClockFloorCore (issue #4586). They are unit-tested, and the first three are checked through the TLA+ modules described below, but no Coyote model drives them yet, so they are not in this table.

The Coyote concurrency tier

Each WAL core is checked against every explored ordering of the steps that race on it, so an interleaving bug in the decision is found in test, not in production. The cores are model-checked with Microsoft Coyote using the same shared harness (CoyoteModelHarness) and the same explicit cooperative step-ordering style (a model implements ICoyoteModel and advances the steps itself; Coyote drives runtime.RandomBoolean() to explore the resulting choice space, which is not a thread schedule space - the models run at a concurrency degree of zero) described in the atomic-commit verification doc. There is no coyote rewrite pass; the concurrency is encoded as data so it is fully enumerable.

The pure-core WAL models live under test/lattice/BPlusTree/Coyote/. That directory also holds Coyote fixtures that drive production WAL admission and replay types directly (for example WalGcStarvationDriveCoyoteTests and WalAdmissionCoyoteTests); they are not pure-core models and are not covered by this table:

Model Core(s) exercised Property checked
WalShippingWatermarkModel WalShippingWatermark Under every explored order of out-of-order flush completions and reader polls, a reader that advances its cursor to an offset has every lower offset already persisted - no prefix hole is ever shipped.
WalGcTrimFloorModel WalGcTrimCore The GC trims only past the minimum acked cursor across all peers; flooring under the maximum strands a lagging consumer.
WalCursorMonotonicityModel InMemoryWalCursorRegistry (real) A consumer's cursor never regresses below its highest report; a stale re-delivery is max-merged away, not applied last-writer-wins.
WalMoveQuiesceModel WalMoveFenceCore The fence check and the offset assignment are atomic, so no append is assigned an offset once a shard move has raised the fence - every offset lands at or below the stable tail the move copies.
WalCommitLogWriterDrainModel WalAdmissionGateCore A shutdown drain releases every parked admission caller; observing the drain token in the wait set (rather than sampling it before parking) closes the lost-wakeup.
WalOffsetContiguityModel WalOffsetAllocationCore Reading and advancing the offset counter is atomic, so two concurrent appends never receive the same offset and the assigned sequence stays dense and strictly ascending.
WalBlockedFloorLifecycleModel WalBlockedFloorCore The GC's blocked floor is the minimum live buffer pin across consumers, so through every interleaving of pin-take, pin-raise, and pin-clear it never rises above a live pin and never trims an entry a buffering consumer still needs.
WalMoveRedriveModel WalMoveResumeCore A placement move's tail copy resumes just past what the target already holds, so a coordinator that crashes and re-drives at any offset boundary copies every retained offset exactly once with no duplicate and no gap.
WalDurabilityLifecycleModel WalOffsetAllocationCore, WalShippingWatermark, LeafDurablePinCore, WalGcTrimCore, WalFallOffCore End to end, with a leaf stopping at any step: appends, out-of-order flushes, read-position replay, checkpoint persists and snapshot captures that can fail, pin publication and the GC trim, with a variant in which one leaf owns nothing so the never-written release is exercised. No acknowledged write is lost or skipped, no leaf falls off the log, no trim entitlement exceeds snapshot coverage, a failed persist is rolled back, and no pin exceeds the persisted checkpoint.
WalPinRetirementModel WalOrphanPinRetirementCore A purge-cleared leaf re-created under the same grain id while a retirement takes its token, reads the leaf and removes: under every interleaving, the re-created leaf keeps a pin while it holds an un-checkpointed write.
WalPartitionReleaseModel LeafDurablePinCore, WalGcTrimCore, WalFallOffCore One leaf whose writes span two partitions, with HLC stamps and a retention TTL: the empty release of a partition the leaf has applied nothing in, writes stamped below the leaf's clock (replication, carried copies), and every GC arm that admits by stamp or by age. No acknowledged write leaves durable state, under the replay barrier of #4669 and the override hold of #4641.

Every model ships a non-vacuous guard test

As in the atomic-commit tier, a model that checks a property only has value if the property can actually fail. Every WAL model therefore ships a companion guard test that removes exactly the one fix the property depends on and asserts Coyote finds the resulting violation (AssertViolationFoundInSomeExploredRun):

  • WalShippingWatermarkModel - the guard clamps the reader at the raw next-offset tail, ignoring in-flight flushes, and Coyote finds the order in which a higher window persists first, the reader advances past the hole, and the still-in-flight lower offset is stranded.
  • WalGcTrimFloorModel - the guard floors the trim at the maximum consumer cursor, and Coyote finds the schedule that strands a lagging consumer.
  • WalCursorMonotonicityModel - the guard replaces the max-merge with a last-writer-wins assignment, and Coyote finds the stale re-delivery that regresses a consumer cursor.
  • WalMoveQuiesceModel - the guard splits the atomic fence-check-and-assign into two steps, and Coyote finds the schedule where a quiesce fences between them.
  • WalCommitLogWriterDrainModel - the guard samples the drain token before parking, and Coyote finds the lost-wakeup that leaves a caller parked after the drain.
  • WalOffsetContiguityModel - the guard splits the atomic read-and-advance of the offset counter, and Coyote finds the schedule where two appends are handed the same offset.
  • WalBlockedFloorLifecycleModel - the guard joins the floor at the maximum live buffer pin instead of the minimum, and Coyote finds the schedule where the floor rises above a lagging consumer's pin and the GC trims an entry it is still buffering.
  • WalMoveRedriveModel - the guard resumes every re-drive from the source floor instead of past what the target already holds, and Coyote finds the crash point after which the copy re-appends an offset the target already has (a duplicate).
  • WalDurabilityLifecycleModel - nine guards in ten tests (the never-written release guard runs twice, once per assertion), each removing one fix and each required to be caught by the assertion that fix protects, not merely by some violation:
    • resolving the pin against the pending checkpoint ([PublishedPinWithinPersistedBelief]);
    • not rolling back a failed checkpoint persist ([PersistedBeliefHonest]);
    • reading past the watermark ([ShippingNeverSkips]);
    • flooring the trim at the highest pin ([TrimCoveredBySnapshot]);
    • releasing a never-written leaf's pin regardless of its snapshot coverage ([ReleaseBackedBySnapshot] at the publication; with that assertion off and one leaf owning nothing, [RecoveryNeverFallsOffLog] after the trim and the restart);
    • acknowledging an append before its flush lands ([AckedWriteDurable]);
    • a cold start resuming at the persisted checkpoint over an empty projection ([ReadPositionHonest]);
    • a replay that never reads past the persisted checkpoint ([EveryAckedWriteMaterialised]);
    • a read position that advances only over the leaf's own entries, the "applied through" reading that #2270 rejected ([ReclamationEventuallyAdvances], with one leaf owning nothing).
  • WalPartitionReleaseModel - seven guards, each caught by its one assertion, [AckedWriteDurable]: an empty release before the partition's replay (#4669), a retention ceiling that yields only to a Zero pin (#4622), and, for the override hold of #4641, skipping it, dropping it without a real offset, clearing it on a persisted checkpoint, reading the holds before the GC's head bound, and a trigger on a stamp below the clock alone, which misses a merge saturated at the HLC counter ceiling.
  • WalPinRetirementModel - two guards: removing the fence, and taking the token after the leaf read; in each, Coyote finds the re-created leaf whose pin was retired (issue #5358).

A model with a green fix test and a green guard test is proven load-bearing for the assertions its guards name, and only for those. Every assertion of both end-to-end models is the reporter of at least one guard: disabling any one of them turns a guard red. The confirmation pass of the independent review (issue #4433) found four lifecycle assertions that were never the reporter; each now has its own guard.

Running the tier

The Coyote tier is opt-in and held out of the fast development loop and the deterministic CI step. Every model and guard test is tagged [Category("Coyote")].

dotnet test test/lattice/Orleans.Lattice.Tests.csproj -c Release --filter "Category=Coyote"

See the "Coyote concurrency tier" section of .github/instructions/testing.instructions.md for the tier policy and the procedure for adding a new model.

The TLA+ specification, and the scope of the assurance

The cores above are each model-checked in isolation, and WalDurabilityLifecycleModel composes five of them. Above both sits a design-level TLA+ specification in spec/wal/:

  • WalDurability.tla, the leaf lifecycle under crash-anywhere recovery, checked with every property at one fault and, through a second configuration, with every safety property at two. It includes flushes abandoned at their deadline that land late or settle as holes (LogPrefixApplied, issue #4621). A third configuration lets the environment destroy a leaf's snapshot or its state row, and the operator purge a tree, and checks that the loss is never silent: a leaf whose evidence is gone fails closed, and only the writes a purge actually deleted are carved out of ReadPositionHonest. A fourth lets a lost WAL shard activation's successor come up on another silo, which cannot see its predecessor's abandoned calls still in motion (issue #5799), checked against every invariant and the action properties, and a fifth keeps both leaves permanently active with no faults and checks every property;
  • WalMove.tla, a shard move with a durable fence, a shard crash and the loss of its coordinator, and, through a second configuration, two moves contending for the same stream (one taking over the other's lapsed fence);
  • WalPinRetirement.tla, the GC's retirement of orphaned materialiser pins - the bulk sweep and the starvation drive, each a token, a leaf read and a fenced removal as separate steps, two sweepers racing - against a leaf's fold, purge, discard and re-creation under the same grain id, and against a completed purge's tree-level tail re-driven onto a reused tree id or racing a write to the purged shard;
  • WalAppendEpoch.tla, the append-epoch fence of the fenced live checkpoint advance (epic #5605): one leaf's activations claiming an epoch at a WAL partition in three steps, the bump on a refusal, and the WAL shard refusing a superseded or retired activation's append, against a WAL shard restart, another leaf's retirement and the leaf's three-step clear. It is the first module promoted from the design draft under spec/wal/design/;
  • WalHandOffFence.tla, the hand-off fence of the same advance: a foreign author's writes to a range the owner leaf owns, bounded by the owner's durable marker - opened before the first admission, stamped at admission, and closed by a fence that re-claims the initiator's generation and records the allocator head - with another shard's range-delete walk, a WAL shard restart and a hand-off in flight across the fence gate's opening. It is the second module promoted from that draft;
  • WalRoutingFloor.tla, the routing floor of the same advance: a tree's purge raising every shard root's routing floor before it retires their rows, the floor checked where a generation is claimed, a straddling write's seam retry that never re-stamps it, and the re-created incarnation's first initialisation, against a second shard root, a purge that finished on 10.2.0 with the re-seed catch-up, and a WAL shard restart. It is the third module promoted from that draft;
  • WalLiveAdvanceCore.tla, the core of the same live advance: when an activation is armed to advance its read position over its own applied appends without reading the WAL, and the shared snapshot and GC trim that follow, with the epoch, hand-off, routing-floor and bulk-switch fences as environment constraints in the form their modules guarantee, and the unstamped watermark, its restart reset and the own unstamped append's self-report modelled directly. It also checks that a newborn leaf's pin eventually becomes usable without a replay from -1, under fairness of the leaf's own steps. It is the fourth module promoted from that draft;
  • WalBulkSwitch.tla, the bulk switch of the same advance: a bulk append's leaf born from the old rightmost leaf's range with the birth hint stored with its switch's open token and capped at the old leaf's read frontier, the drain before the narrow, the relocation of the rows the range held, and the batched close, against a crash of the shard root and a drain past its deadline. Since #5812 it also models the bulk seed, which claims no append epoch: admitted under the switch's routing generation and refused once a close re-claims it, or unstamped and reported on a never-written shard, where a batch write may seed a root while the load runs. It is the fifth module promoted from that draft;
  • WalLiveAdvanceComposite.tla, the interface check of those five modules: every producer guarantee, copied from its module, as a constraint on freely generated steps, checked against every assumption a consumer module takes of it.

It follows the pattern of the atomic-commit specification: every property and every action has a mutation that makes a property fire, and a refinement note maps each construct to production and to tests proven to go red when production regresses.

The specification found four durability defects, each filed with a reproduction and kept as a standing mutation until it is fixed. Three were reproduced against the real leaf grain before they were filed; #4467 was reproduced by the model's trace only, and its fix's grain test came with the fix:

Issue Defect
#4450 A snapshot that fails to load falls through to a cold replay of a trimmed WAL. Fixed: the replay now fails closed.
#4451 A capture during a cold rebuild claims more coverage than its rows hold. Fixed: the claim stops at what has been re-read.
#4456 A never-written leaf releases its block pin above its snapshot's coverage. Fixed: the release is bounded by coverage.
#4467 A faulted cold rebuild re-arms warm over a partial projection. Fixed: the retry stays cold.

All four are fixed, and each one's mutation is now an ordinary regression check.

The independent review of the specification found two more, each hidden by a bound or an abstraction of the first version. Both are fixed:

Issue Defect
#4523 A never-written leaf with no snapshot releases its block at its persisted checkpoint; after a cold-rebuild capture below that release and a trim, its next activation latches stale. It needs two faults. Fixed: the release fires only under durable coverage.
#4525 A move's fence lives only in the source activation's memory and the flip re-checks nothing, so a source re-activated after the copy acknowledges writes the flip discards. Fixed: the fence is a durable record every new activation re-derives, and the flip requires it still held.

Since then the models have found nine more, each reproduced before its fix:

Issue Defect
#4621 A flush abandoned at its deadline lands after readers have passed its offset. Fixed: the watermark holds below every unsettled abandoned call, and a provider trim watermark tells a hole from a trim.
#4622 A retention TTL trims a write made after an empty release. Fixed: the TTL ceiling is capped at the lowest uncovered frontier.
#4634 A cold start over a vanished snapshot replays a trimmed WAL. Fixed: the leaf row records held coverage and the activation fails closed.
#4654 A leaf whose state row vanishes comes up empty. Fixed: a rowless leaf serves data only under a create intent.
#4669 A cold leaf releases a partition its replay has not read. Fixed: no empty release before the replay barrier latches.
#4641 A write stamped below an empty release's frontier is trimmed by every stamp-based GC arm. Fixed: a durable override hold the GC reads as a block.
#4699 A move's quiesce ignores an abandoned call a predecessor activation left. Fixed: the drain check reads the process-wide registry.
#4700 A purge's shard-wide recovery flag re-creates empty a leaf the purge never reached, and strands cleared leaves when the reseed stops early. Fixed: each leaf carries its own purge marker, and recovery re-creates only a marked leaf, visiting every one.
#5358 The GC removed an orphaned pin by consumer id after a husk read taken in a separate step, so a purge-cleared leaf re-created in between lost the block pin its birth seeded under the same consumer id, and the trim could pass its un-checkpointed writes. Fixed: the removal is fenced by the pin grain's per-activation merge stamps, and the drive retires through the same fenced sequence. Found by WalPinRetirement.

The independent review of WalPinRetirement found four more, each reproduced by a test and fixed. Two (#5417, #5458) are in the model, where mutations reproduce them; the other two (#5416, #5459) are pinned by tests:

Issue Defect
#5416 A completed purge removed the tree's registry entry, which frees the id, before it cleared the tree's pin store, so a write that registered the id again in between had its birth block pin erased by the clear. Fixed: the pin store is cleared before the registry entry is removed. The model's purge tail is one step, so tests pin this order.
#5417 A completed purge re-drove its tail - WAL trim, pin-store clear, registry removal - whenever its registry removal was still recorded as owed, so a removal that landed with its record unwritten was re-driven against an id a write had registered again, trimming the new tree's acknowledged writes. Fixed: the purge records the registry lineage it removes with its completion, and a re-drive acts only while the entry still carries it.
#5458 A purged shard admitted a write whenever the registry named the id live, and while a purge's tail is owed that is the purged tree's own entry. The write re-seeded the root leaf under the purged lineage, so the tail took the entry for its own, unpinned and unregistered the live leaf, and the acknowledged write was lost on a cold replay. Fixed: the shard asks the deletion record, which holds the id until the purge has removed its registry row.
#5459 A resized tree's logical purge re-drove its completion, which removes the logical registry entry, against a logical id a create had registered again. Fixed: the completion records the lineage of the entry it removes before the first removal, and a re-drive removes nothing once the entry is gone or carries another lineage. Outside the model, which has no data-less logical id; tests pin it.

What is covered: one WAL partition shared by two leaves, with two faults per behaviour for safety and one for liveness, and a variant with snapshot and row loss and a purge; one move with one shard crash and one coordinator crash, and a variant with two contending moves; the GC's orphan-pin retirement against a leaf re-created under the same grain id, with one sweeper and the drive, and variants with one fault and with two sweepers; and, in Coyote, a leaf spanning two partitions with HLC stamps and a retention TTL (WalPartitionReleaseModel).

What is not covered:

  • more than two partitions, or several partitions in TLA+;
  • splits, resharding and saga state;
  • interleavings inside a grain turn's awaits;
  • replication consumers, beyond their effect on the trim floor;
  • liveness under two faults, or any property under three;
  • for pin retirement, several leaves or partitions per leaf, the pin's HLC frontier and override holds, the in-memory cursor registry, the order of the steps inside a purge's tree-level tail, and a resized tree's logical purge completion (both pinned by tests instead);
  • how long a write to an id created again waits while a purge's tail is owed: the model checks no liveness for re-creation (the refinement note bounds the wait);
  • how long a live leaf's pin stays at the block value before its first WAL replay checkpoints it: the model lets a checkpoint cover live writes at any time, while production advances one only by a replay.

Coverage of the leaf lifecycle does not imply coverage of any of those. Each module's refinement note lists its gaps in full.

The live checkpoint advance

The live checkpoint advance (epic #5605) lets a leaf move its read position over its own applied appends without reading the WAL. That is only safe when no other writer's record can sit unread below the new position, so the advance is fenced: an append epoch per activation, a hand-off marker per foreign writer, a routing floor across a purge, and a birth hint for a bulk-born leaf. It was designed against one draft model, spec/wal/design/WalLiveAdvance.tla, and is checked in CI by five modules promoted from it. Each module is small enough to check exhaustively, and they fit together through a written assume-guarantee contract, LiveAdvanceInterface.md:

Module What it checks Assumes
E, WalAppendEpoch A superseded or retired activation never appends, a claim's head covers every earlier allocation, no two live activations share an epoch, and only a superseded activation is ever refused. nothing
H, WalHandOffFence A foreign writer's record lands while the owner's marker is open or below the heads its close recorded, an absent or uninitialised marker holds the owner, and close heads only rise. E's entry check
R, WalRoutingFloor A write of a purged tree lands below the heads the re-created tree's first initialisation recorded, those heads lie above every record already allocated in the partition (InitHeadCoversPriorAllocations), and every live shard root's routing generation stays above its own floor. E's entry check
B, WalBulkSwitch A bulk-born leaf's birth read position is at or below every record of its range it does not hold, and the leaf resolves a contested key as every WAL reader does; every seed record lies under its switch's marker and below its close heads, or is reported; and a load never publishes over a root a batch write seeded while it ran. nothing
C, WalLiveAdvanceCore No running activation's read position ever passes a record it does not hold, whether it advances by replay or, once armed, by the live advance; the shared snapshot is honest, the GC never trims an acknowledged entry the snapshot lacks, and a newborn leaf's pin eventually becomes usable without a replay from the start. every guarantee above

The graph is E <- H, E <- R and {E, H, R, B} <- C: an arrow points from the module that assumes to the module that guarantees, and no other edge exists, so it is acyclic. A module takes another's guarantee only as an environment constraint in the interface's exact form, never by importing its state. The core's liveness property, NewbornPinEventuallyUsable, holds under weak fairness of the leaf's own steps and of the environment steps that end a hold (a close, the bulk birth, the marker's initialisation), with replay assumed only as far as the arming bounds require; it is discharged once the current activation has fallen off the log, where production's stale latch (#3477) takes over.

Because each module checks its side of an edge separately, a guarantee could be stated more weakly than the assumption that relies on it. The composite interface check, WalLiveAdvanceComposite (#5774), closes that gap: one small configuration (402,394 distinct states) generates each step freely within the shared vocabulary, keeps it only if every producer's guarantee still holds, and checks every consumer's environment guard against it, on each of its fifteen edge invariants. Its first runs found five places where a module assumed more than its producer guaranteed (F1 to F5, in the composite's note); all were closed by widening the consumer or strengthening the producer, and every edge is now clean.

Every module, and the composite, runs on a TLC shard of its own, sized by measurement. Each CI case stays within about five million states and twenty minutes, so combinations larger than that are split into scenario variants or bounded out by name. For example, CI checks the core's purge with an unclaimed survivor and a hand-off window, and separately with a 10.2.0 silo. The combination of both was checked locally and is clean at 8,913,193 states, but is kept out of CI because it exceeds the per-case budget. The design model's own combined configurations, up to about 23 million states, stay as local evidence in the design note.

The design, its models and the independent review of the production members found these defects in production. Each is fixed on the epic's integration branch, which lands on main as a whole:

Issue Defect
#5610 A bulk append grafted its leaves without checking the keys the old rightmost leaf already held, so rows at or above the first separator became unroutable. Fixed by #5646: the graft relocates them into the appended leaves and never refuses the chunk; #5677 persists the old leaf's drop.
#5614 A streamed bulk load intermittently committed duplicate or orphan rows, so counts and scans disagreed with what was loaded. Fixed by #5646, with the relocation of #5610.
#5634 The WAL append fence's rows leaked when a 10.2.0 silo retired a fenced leaf, because nothing could enumerate them. Fixed by #5653: a directory of fenced leaves and a sweep that retires the orphans.
#5642 A batch write admitted during a bulk load landed on the replaced seeded root and was unreadable until a replay. Fixed by #5646: the load drains the batch writes admitted before it and merges the replaced root's rows.
#5643 An activation's own epoch bump deactivated it when its in-flight appends met the raised entry. Fixed by #5644: the activation's own stale appends are self-fenced and re-admitted, not a supersession.
#5654 A write above the edge between a bulk graft's narrow and its link failed open onto the old leaf and was unreadable on the origin. Fixed by #5646: the narrow and the link are one persist.
#5656 The append-fence sweep never reached orphans past the first 1,024 listed leaves. Fixed by #5653: each sweep resumes after the last leaf the previous one examined and wraps around, so every listed leaf is examined in turn.
#5657 The append-fence retirement kept the loaded entry when the entry delete or delist failed after the floor raise. Fixed by #5653: once the floor is raised, the loaded entry is removed whatever fails next.
#5662 A split's close bumped its epoch in a race with a floor refusal's bump on the same epoch row, and superseded its own activation.
#5663 A shard root whose routing generation fell behind a partition's durable row made every write retry until it timed out.
#5664 A hand-off's close heads could miss the donor's appends: a stamp taken at dispatch, a partition reset by an unloaded rejection, or the gate-view fallback.
#5668 A tree's per-tree hand-off fence rows were never deleted on a tree delete or purge.
#5705 A straddling shard root's stale-generation raise re-created its marker above the routing floor after a purge.
#5706 A commit in flight when a split or bulk birth hint was captured, allocated below it, was skipped by both leaves if the donor died before applying it.
#5708 A routine refusal before allocation leaked the unapplied count and turned the live advance off for the activation.
#5709 A reachable leaf could advance past an overlapping orphan leaf's appends.
#5716 The re-seed catch-up could floor a duplicate activation's live generation and fail a re-created tree's writes as deleted.
#5752 A bulk append's birth hint was not capped at the old leaf's read position, so another author's record below it, unapplied by the old leaf, was applied by no leaf.
#5755 A bulk graft's relocation did not move the reshard read gate, so a prepared or migrated key reached the bulk-born leaf without its shadow marker.
#5756 A split donor advanced its own checkpoint past records another author appended.
#5760 Birth hints stamped the exclusive WAL head as an inclusive checkpoint, so the record at exactly the captured head was skipped.
#5766 A bulk load applied its birth hint uncapped, so a record another author appended below it, unapplied by the replaced root, was applied by no leaf.

Extending WalDurability to the allocator's re-seed (#5803), and reviewing the hand-off fence's pre-arm (#5840), found three more. The model reproduced each before its fix, each is kept as a standing mutation, and all three are fixed:

Issue Defect
#5810 A predecessor activation's late batch on another silo, starting at a different offset, landed over a successor's acknowledged batch, so every read yielded the shared offsets twice, and its blind upsert of the Azure Table provider's tail row regressed that row, so the next recovery reissued committed offsets. Fixed by #5811: a batch's commit is conditional on the tail row's ETag the provider instance last observed, under a fence generation that refuses every claim made before a refused write. Reproduced by OffsetWrittenOnceStaleWriterUnfenced, TailMonotoneStaleWriterBlindUpsert and RecoverNeverInsideCommittedUnfencedBlindTailUnstamped.
#5825 Batches commit in arrival order, so across a silo move a predecessor's lower batch could commit after its successor recovered and readers had passed the offset as a settled hole, and the entry appeared below them; the #5811 fence did not refuse it, because the successor only read the tail row. Fixed by #5827: recovery re-stamps the tail row under the ETag it read before the activation serves a read, which puts the predecessor's view out of date. Reproduced by LogPrefixAppliedRecoveryLeavesTailUnstamped.
#5841 A stale duplicate of a split's donor, still holding the span from before the split, claimed the donor's epoch after the split: its claim overwrote the split's epoch bump, and under pre-arm the split bumped only when its own activation had claimed, so its epoch-only writes of moved keys were fenced by nothing the receiver reads and an acknowledged write could be trimmed. An idle duplicate could do the same under the eager arm. Fixed by a Dekker pair: a claim writes the epoch row and then re-reads the leaf's state, and is stale if it changed; the split persists its narrowed range and then re-reads the row, bumping it whenever it exists. Reproduced by HandOffBoundStaleDonorArmsAfterSplit5841 in WalHandOffFence's StaleDonor and StaleDonorPreArm variants.

What is not covered. Each module checks one partition and one owner leaf, with two activations at most and each environment step once. The modules model the fences' effect at the WAL partition, not their scheduling: seam retries, multi-entry stamped batches, the range-delete fence as an initiator of its own, the purge's steps one by one, and several keys or appended leaves in a bulk switch are out of scope. The core over-approximates the cases in which production holds the advance. The spec/wal/ README lists every module's abstraction gaps in one place.

  • Verified Atomic-Commit Protocol - the sibling verification effort whose proven-core pattern, harness, and tier policy this work reuses.
  • Verified WAL Durability sample - a runnable demonstration of the cursor-monotonicity and trim-floor properties these models prove.
  • Chaos Tests - the end-to-end integration contract that exercises the same WAL guarantees against a live cluster under fault injection.