2026-08-28·by Sijie Wang#cybernetics#stages-gates#theory#math

reliability-and-checkpointing

Reliability decay and the optimal checkpoint

Parent: derivations

0. Claim and contribution

For a task of nn error-prone atomic steps:

  1. Exponential reliability decay — with no intermediate check, P(correct) =pn=p^n; half-life =Θ(1/(1p))=\Theta(1/(1-p)) (Thm 1–2).
  2. Restart cost without checkpoints — expected total work =n/pn=n/p^n, super-exponential (Thm 3).
  3. Checkpoints drop the exponent nkn\to k — expected execution work =n/pk=n/p^k (Thm 4).
  4. Optimal interval — exact per-interval expected work in a Poisson model, then the rigorous τ\*=2δM\tau^\*=\sqrt{2\delta M} limit, with checkpoint cost δ\delta in the accounting throughout (Thm 5). Cites only basic probability.

1. Discrete model

nn sequential steps. (A1) each step is correct (prob p(0,1)p\in(0,1)) or wrong (prob q=1pq=1-p), independently. (A2) a checkpoint perfectly detects whether the segment since the last one is all-correct. (A3) with no intermediate check, detection is only at the end (errors are silent within a pass, so each pass executes all nn steps).

2. Theorem 1 (exponential decay)

Theorem 1

P(k=1nAk)=kP(Ak)=pnP(\bigcap_{k=1}^nA_k)=\prod_kP(A_k)=p^n by independence (A1). Since p<1p<1, pn=enlnp0p^n=e^{n\ln p}\to0.

3. Theorem 2 (half-life, with bounds)

Theorem 2

m1/2m_{1/2} solving pm1/2=12p^{m_{1/2}}=\tfrac12 satisfies

m1/2=ln2ln(1q),ln2q(1q)m1/2ln2q.m_{1/2}=\frac{\ln2}{-\ln(1-q)},\qquad \frac{\ln2}{q}(1-q)\le m_{1/2}\le\frac{\ln2}{q}.
Proof

m1/2lnp=ln12m_{1/2}\ln p=\ln\tfrac12 gives the equality. From ln(1q)=j1qj/j-\ln(1-q)=\sum_{j\ge1}q^j/j: q\ge q gives the upper bound; qj=q1q\le\sum q^j=\frac{q}{1-q} gives the lower.

(e.g. q=0.01m1/2[68.6,69.3]q=0.01\Rightarrow m_{1/2}\in[68.6,69.3].)

4. Theorem 3 (restart cost, no checkpoints)

Lemma

Geometric mean. Success prob rr per trial; first-success index NN has E[N]=1/rE[N]=1/r.

Proof. P(N=j)=(1r)j1rP(N=j)=(1-r)^{j-1}r; with j1jxj1=(1x)2\sum_{j\ge1}jx^{j-1}=(1-x)^{-2}, E[N]=r(1(1r))2=1/rE[N]=r(1-(1-r))^{-2}=1/r.

Theorem 3

Redo the whole task on failure \Rightarrow expected execution work =n/pn=n/p^n.

Proof. Passes are i.i.d. with success pnp^n (Thm 1); E[#passes]=1/pnE[\#\text{passes}]=1/p^n; each pass executes nn steps (A3). Super-exponential in nn.

5. Theorem 4 (checkpoints: exponent nkn\to k)

Theorem 4

Partition into n/kn/k segments of length kk, each with a detecting checkpoint (redo only the failed segment to pass). Expected execution work =nkkpk=n/pk=\frac{n}{k}\cdot\frac{k}{p^k}=n/p^k. Ratio to Thm 3: pkn=(1/p)nkp^{k-n}=(1/p)^{n-k}, exponentially small for nkn\gg k.

(Accounting) This counts execution only, not checkpoint cost δ\delta; if δ\delta were free, k=1k=1 is optimal. The optimal granularity once δ>0\delta>0 is priced is §6 — fixing the inconsistency of counting work but not gates.

6. Theorem 5 (optimal interval, exact then asymptotic)

Theorem 5

Model. Progress in useful work; failures a Poisson process of rate λ\lambda (so M=1/λM=1/\lambda mean work between failures); checkpoint every τ\tau, cost δ\delta; a failure rolls back to the last checkpoint (redo the whole current interval).

Exact per-interval work. Per-attempt no-failure prob a=eλτa=e^{-\lambda\tau}. Truncated mean: E[Tf1Tf<τ]=0τtλeλtdt=τeλτ+1eλτλE[T_f\mathbf 1_{T_f<\tau}]=\int_0^\tau t\lambda e^{-\lambda t}dt=-\tau e^{-\lambda\tau}+\frac{1-e^{-\lambda\tau}}{\lambda}, so E[TfTf<τ]=1λτa1aE[T_f\mid T_f<\tau]=\frac1\lambda-\frac{\tau a}{1-a}; expected failed attempts 1aa\frac{1-a}{a}. Hence

E[interval work]=τ+δ+1aa(1λτa1a)(exact).\mathbb E[\text{interval work}]=\tau+\delta+\frac{1-a}{a}\Big(\frac1\lambda-\frac{\tau a}{1-a}\Big)\quad\text{(exact).}

Rare-failure limit λτ0\lambda\tau\to0. With x=λτx=\lambda\tau: 1aa(1λτa1a)=1λ(ex1)τ=λτ22+O(λ2τ3)\frac{1-a}{a}(\frac1\lambda-\frac{\tau a}{1-a})=\frac1\lambda(e^x-1)-\tau=\frac{\lambda\tau^2}{2}+O(\lambda^2\tau^3) (the linear term cancels via 1λx=τ\frac1\lambda x=\tau). So extra overhead per interval =δ+λτ22+O(λ2τ3)=\delta+\frac{\lambda\tau^2}{2}+O(\lambda^2\tau^3), and over total useful work TT:

C(τ)=δTτ+λTτ2+O(λ2τ2T).C(\tau)=\frac{\delta T}{\tau}+\frac{\lambda T\tau}{2}+O(\lambda^2\tau^2T).

Convex; C(τ)=δT/τ2+λT/2=0C'(\tau)=-\delta T/\tau^2+\lambda T/2=0\Rightarrow

τ\*=2δM(valid in λτ\*1),C(τ\*)=T2δ/M(1+o(1)),\boxed{\tau^\*=\sqrt{2\delta M}}\quad(\text{valid in }\lambda\tau^\*\ll1),\qquad C(\tau^\*)=T\sqrt{2\delta/M}\,(1+o(1)),

with checkpoint and rework costs equal at the optimum.

Remark

Second order gives Daly (2006)'s correction τ\*=2δM(113δ/2M+)\tau^\*=\sqrt{2\delta M}(1-\tfrac13\sqrt{\delta/2M}+\cdots) — cited; leading order is the result.

7. Scope

Independent steps (correlated/common-cause failures change pnp^n); perfect detection (a miss rate makes the gate only partly truncate the exponent — the "semantic error passing the type gate" case); rollback-to-checkpoint (finer recovery shrinks the τ/2\tau/2 waste and shifts τ\*\tau^\*); §2–5 discrete vs §6 continuous — consistent (both: the gate truncates the long-horizon multiplicative cost).

8. Cited vs proved

Proved: pnp^n via independence; log-series bounds; geometric mean; restart & segmented work; exact per-interval cost and its limit. Cited: exponential inter-arrival of the Poisson process; Daly's second-order correction.

about this entry

One of sijie's wiki entries. The AI on this site is grounded in the same corpus and answers in sijie's voice, with citations back to entries like this one — answering costs sijie money, so it waits behind a code: enter an access code →