Persistent project, disposable agents: a 250k-line C compiler evolved in 120 hours for US$44

Persistent Recursive Worlds Enable Autonomous Software Evolution

Beichen Huang, Zhenyu Liang, Bowen Zheng, Ran Cheng

cs.SE, cs.AI, cs.MA, cs.NE

2026-08-11

Genesis makes the project persistent while agents stay disposable. With DeepSeek V4 Flash it built a 250k-line Rust C compiler from scratch in 123 hours for US$44, passing the full c-testsuite.

What problem this solves

Long-horizon software development outlasts any single coding agent. Context windows fill, costs climb, agents drift, and existing systems try to keep going by making the agent itself live longer: persistent sessions, long-term memory, a manager layer, or shared context. Genesis (EMI-Group, Hong Kong Polytechnic University) inverts the direction. It makes the software project persistent and lets agents be finite-lived. The question they pose: when the active agent is gone, what exactly must remain?

Method

The core is a formalism of persistent recursive worlds. A local software world is w = (v, p), where v is the accepted version (full project state and history) and p is a repository-relative path that situates the agent's work. The version fixes what exists; the path places the agent inside the project.

A finite-lived agent receives an objective in world (v, p) and produces a candidate change. Its private conversation and scratch state are not carried forward as identity. Recursive delegation changes only where work lands, not the accepted version: a parent at path p spawns a child at path q while v stays fixed. Leaf executors modify code directly; root and intermediate managers decompose objectives and review returned results. Only an accepted software event advances the version from v to v'; rejected changes leave it untouched, and the responsible parent decides acceptance using tests, constraints, and integration evidence.

So the persistent substrate is version control over a tree of delegated subtasks; continuity lives in the artifact, and the agent is a replaceable worker. The runs use DeepSeek V4 Flash with xhigh reasoning effort and 150k-token context compression.

Results

Formation: starting from a repository with no compiler implementation, Genesis built a Rust-based C compiler (jcc) of 248,989 physical lines (219,676 Rust) across 750 files, archiving 1,019 agent episodes at delegation depth 5, in 123.4 wall-clock hours (666 agent-hours) for US$44.38 in model-token cost (4.13B tokens). It passed c-testsuite 220/220, Csmith 93/93, LLVM 32/36 (88.9%), and 2,904 Rust unit tests.

Continuation: a GLM-5.2-built compiler (commit 37216cf) was handed to two branches. The GLM 5.2 branch used 98 agents at depth 4 and passed 1,445/1,448 of its retained LLVM cases in 21.99 hours; the DeepSeek V4 Flash branch used 178 agents at depth 8 and passed 1,820/1,820 in 17.10 hours. Both advanced the inherited compiler rather than rebuilding after repeated agent replacement.

Redevelopment (MESA, a Fortran stellar-evolution package): 13 modules, 139,414 Fortran lines, were rewritten into an 89,946-line Rust workspace in 33.22 hours with 272 agents for US$10.64, passing 1,052 tests with zero failures. EOS lookup and Newton solve were bit-exact, and four other workloads had relative differences from 5.1e-15 to 3.1e-9. Median speedups over Fortran ranged from 1.55x to 6.87x.

Why it matters

For anyone building long-horizon coding agents, Genesis offers a different path. The default instinct is to pile on context, stretch sessions, and add fancier memory, which runs into context limits, cost, and drift. Genesis shows an architecture where the agent is cheap and disposable and a versioned project carries continuity. A 250k-line compiler for US$44 and a cross-model handoff, with DeepSeek continuing a compiler GLM started, are concrete existence proofs. The MESA result adds an AI4Science angle: auto-porting legacy Fortran scientific code to faster Rust, bit-exact, is a real workflow win.

The cold water: this is an organizational and architectural contribution, validated on a compiler and a scientific-code rewrite, both of which have strong automated test oracles (does the compiled C work, do the numbers match). Domains without such a clear pass-or-fail signal will be harder.

Limitations

The authors explicitly do not prove that recursion is causally superior to flat or alternative organizations; recursion was operationally central but has no controlled comparison (Section 5.2). This is not Darwinian evolution, not open-ended self-modification, and there is no learning of foundation-model parameters; evolution here means version lineage, not biological or learning evolution. The archives do not log every human action, so the runs cannot prove zero human intervention. The paper claims neither full C11 conformance, nor production readiness, nor a run-to-run success rate; the compiler is a research artifact, not gcc. And as noted, the strong-test-oracle caveat applies: compiler correctness and numerical agreement are checkable, and generalization to tasks without a clear oracle is an open question.

Terms

Source

Related papers

All paper explainers