In computational biology, few packages are as battle-tested as DESeq2. With more than 70,000 citations, it is standard infrastructure for differential RNA-seq expression analysis. That is what makes the bug fixed in thelovelab/DESeq2 v1.55.1 (commit 0bbdc838df) worth studying well outside bioinformatics.

The defect was not a subtle error in the negative binomial likelihood, nor a numerical instability in dispersion estimation. It was a clean, quiet disagreement between two consecutive stages of the same pipeline over which data matrix they were analyzing.

1. Anatomy of a Silent Stage-Boundary Mismatch #

During a standard DESeq() run with sufficient replicates, the package flags extreme count outliers via Cook’s distance, replaces those counts with trimmed means, stores the sanitized matrix in assays(dds)[["replaceCounts"]], and refits its model parameters and p-values on those replaced counts.

When an analyst then calls lfcShrink(..., type="apeglm") or lfcShrink(..., type="normal") to produce shrunken log-fold changes for ranking and plotting, the downstream estimator silently read the original, unreplaced counts(dds) matrix instead of assays(dds)[["replaceCounts"]]. No warning was emitted. No error was raised. The resulting table paired p-values computed on outlier-replaced counts with shrunken effect sizes computed on the raw outlier-contaminated counts.

Nothing crashed. Every column had the right type, every row had a plausible number, and two adjacent stages of the same object had silently diverged on ground truth.

2. Why Silent State Drift Breaks AI Pipelines More Often Than Weak Models #

Engineers building AI research pipelines and multi-agent workflows spend most of their energy comparing model benchmarks. In production, however, silent stage-to-stage provenance drift is a far more common source of invalid outputs than model reasoning errors.

The pattern is identical to the DESeq2 seam:

  • Search-to-verification drift: A numerical optimizer updates a candidate certificate on disk, while the downstream exact verifier reads a stale cached artifact from a prior run and reports PASS.
  • Preprocessing-to-evaluation drift: A cleaning stage filters corrupted samples into a derived table, while the evaluation harness reads the raw table by default and reports inflated or mismatched metrics.
  • Retrieval-to-citation drift: A summary stage cites document identifiers from an updated index while pulling snippets from an older snapshot whose offsets no longer align.

In every case, each individual component works as specified in isolation. The failure lives entirely in the handoff between stages, where an implicit default silently falls back to an unmutated input.

3. Closing the Gap With Out-of-Band Provenance Checks #

You cannot fix provenance drift by asking a model to be more careful, or by adding more unit tests inside a single stage. You close it with deterministic, out-of-band invariants enforced at every boundary:

  1. Content-addressed handoffs: Every stage writes an explicit manifest carrying the SHA-256 digest of the exact input artifact it consumed and the exact output artifact it produced. Downstream stages take the digest-pinned artifact path, never a mutable implicit slot.
  2. Refuse silent fallback: When a pipeline records that outlier replacement, rational rounding, or schema migration occurred upstream, downstream consumers must assert that the transformed payload is present and active—or fail with a non-zero exit code.
  3. Negative mutation tests: Deliberately perturb one entry of the sealed witness or swap in the unreplaced input matrix and assert that the downstream verifier rejects it loudly. A check that has never been observed to fail on a poisoned input is not yet a verified check.

In our own mathematical verification work at BeaconLight Research, this discipline is why we pair Lean 4 kernels with standalone zero-float verifiers executed under python3 -O and SHA-256 receipts bound to every archive bundle. Model capability will keep improving every quarter. Provenance integrity is an architectural invariant: if two stages can silently read different inputs and still exit zero, the pipeline is unverified regardless of how strong its components are.

Drew Garman, Founder BeaconLight Research
← Prev: LightBeam 01 Next: LightBeam 03 → All LightBeams