AI & Computingpreprint2026-08-28

pi-fold: Rotation and Retention

Open access0 citations

Abstract

An agent session that outlives its context window is doing two jobs at once: rotating old material out of the window, and retaining what the session has learned. Compaction, the answer the field converged on, does both in one summarization pass, and it converged for a reason: it is simple, models are trained under it, and they are good at choosing what to hand off. This capstone of the pi-fold line measures the two jobs separately. Eight graded runs worked the same frozen 64-stage study of the curl codebase, with planted stale artifacts and a withheld final exam asking which files traveled together in the conversation: a fact about the session itself, chosen because no summary transcribes it. Compaction never answered beyond what its own summary could answer, and a line-by-line audit of the summary text accounts for its whole score of four out of sixteen: every correct answer, every wrong one, and every abstention. A lossless fold kept every byte reachable but its reader proved moody, four identical-condition draws splitting into two modes, with the mode tracking whether the model went and recovered the record. Inviting the agent to annotate its own index produced the campaign's worst score, the errors tracking the annotations. What closed the gap was a canonical memory store outside the window, offered to both mechanisms and adopted by both from its tool description alone. It lifted compaction to the shared ceiling and the composed fold matched it, neither with a wrong answer; with correctness equalized, the fold delivered that ceiling for half the money. The scope is stated rather than implied: one model, one provider, one repository, one workload family, one adjudicator, in a sequential case series whose adaptive changes are disclosed in Methods. The fold condition's spread across four draws rides every single-run comparison here, the store's zero-wrong result is two runs for two, and each composed condition is a single run. The dollar ratios depend on this provider's price tiers, with the flat-rate counterfactual stated beside the headline, and exam scores are the composed system's, mechanism plus recovery, with per-run recovery attribution published beside them. The conclusion is not that compaction is beaten. It is that the handoff summary was retention all along, a scratchpad the model curates for its future self, and that giving that scratchpad a real home outside the window serves both mechanisms, while rotation itself can then be deterministic and lossless. These cases motivate replication; they do not estimate population rates. The record includes a self-contained semantic HTML reading edition, five figures in SVG, PDF, and PNG forms, the sealed campaign after privacy review, the scoreboard and cost audits beside the co-seating, checklist, store-adoption and session-access lenses that produced them, the frozen workload, exact source, an environment manifest, and SHA-256 manifests. A verifier regenerates every derived table and figure byte-identically from the sealed evidence, recompiles the manuscript and checks its resolved references, and refuses by name the phrasings the claims contract retires. Verification checks consistency inside the declared evidence boundary; it does not recreate the original provider interactions. This is the fourth paper of the pi-fold line. It is a preprint and has not been peer reviewed. The paper and author-created research artifacts are CC BY 4.0; pi-fold software in the source snapshot is MIT licensed, and the pinned curl source retains the curl license.

// Source

View paper (DOI)Open access versionOpenAlexZenodo (CERN European Organization for Nuclear Research)Published 2026-08-28

Authors: Shane Conner