Code Archiving Costs Outweigh the Reproducibility They Buy
Archiving research code has become a standard condition of the grant. Funders describe it as a reproducibility measure, and on paper it looks cheap: a repository link, a DOI, a README. The bill is real, though, and it lands on the grantees. Whether that spending buys the reproducibility it promises is a question the policy has largely skipped, and the evidence available so far is not encouraging.
The Archiving Mandate and Its Hidden Bill
Most major funders now ask applicants to deposit analysis code alongside publications. The requirement is usually framed as a condition of good practice rather than a line item. That framing hides the cost. Preparing code for public release is not the same as writing code that runs; the gap between the two is where the hours go.
Someone has to strip credentials, replace absolute file paths, write installation notes, and test the thing on a clean machine. In a lab of five, that work falls on whoever wrote the analysis, typically a doctoral student with a thesis deadline. The funder pays nothing for it. The grant's personnel budget was set before the mandate existed, so the time comes out of the research itself.
The mandate also assumes a chain that has not been demonstrated: that archiving produces reproducibility. A deposited repository is a record, not a working environment. Reviewers rarely open it. The evidence on actual reuse is thin, and what exists suggests that most archived code is downloaded rarely, if at all, and rerun even less often.
It is worth being precise about what the mandate measures and what it does not. A funder can count deposits, and deposits are easy to count. A funder cannot easily count the number of times a deposited script was successfully rerun by an independent party, because that event leaves no reliable trace. The metric that gets reported is therefore the one closest to hand, and the outcome the policy actually cares about sits several steps downstream where no one is watching. This is a familiar pattern in research governance: what is auditable displaces what is important, quietly and without anyone deciding to let it happen.
What Reproducibility Actually Requires
Code is the smallest part of the problem. An analysis depends on a specific version of a language runtime, a set of libraries at pinned versions, a compiler, an operating system, and the data. Change any of those and the numbers move. Archiving the script while leaving the rest to chance reproduces the appearance of reproducibility, not the result.
Deterministic builds, in which source compiles to identical output every time, remain rare in research software. The practice is standard in some corners of software engineering, where the tooling is mature, but scientific code is usually written by people trained in a discipline other than software. Pinning dependencies is a skill, and it is not taught in most statistics or biology programmes.
Then there is the tacit knowledge. A pipeline often encodes decisions that never made it into a comment: which outliers were dropped, why a parameter was set to that value, which run was the one that counted. Depositing the code does not deposit the reasoning. Replication attempts tend to succeed when the original author is available to answer questions, and that is a staffing arrangement, not an archival one.
Containerisation is often offered as the fix, and it helps. Bundling the runtime, the libraries, and the code into a single image removes a whole class of version drift. It does not remove the cost; it relocates it. Someone still has to build the image, document the base system, and rebuild it when the underlying platform is retired. Container registries themselves age, and an image that built cleanly three years ago may fail to pull today because a base layer was withdrawn. The maintenance tail simply moves further down the pipeline, where it is harder to see and easier to defer.
The Uneven Burden on Smaller Labs
Compliance costs scale badly. A large group can hire a research software engineer whose job includes making deposits clean; a two-person lab cannot. The mandate therefore favours well-resourced institutions, which is the opposite of what a policy meant to raise the floor should do. The same dynamic shows up in other archiving contexts, as a related piece on keeping old radio data readable describes.
For small teams the overhead can exceed the compute budget. A modest simulation grant might spend a few thousand euros on processing time and rather more on the weeks a postdoc spends packaging it. That imbalance is invisible in the grant ledger because the labour is salaried, but it is a real diversion of research capacity.
The comparison is not hypothetical for anyone who has run a small computational project. Compute is cheap and getting cheaper; a month of cluster time for a typical simulation study is a rounding error against a single salary month. The packaging work, by contrast, is priced at exactly that salary month and cannot be bought in bulk. A policy that costs a fixed number of skilled hours per project will always bite hardest on the projects with the fewest skilled hours to spare, and those are usually the projects with the least slack in their timelines.
Junior researchers absorb most of the load. They are the ones who know the code, they are the ones under publication pressure, and they are the ones with the least standing to say the deposit will take a month. The mandate was designed with the principal investigator in mind and executed by people who did not sit in the room when it was written.
Incentives That Reward the Wrong Thing
Publication pressure rewards new results. Nobody's promotion file lists a well-curated repository. Archiving therefore becomes a checkbox: a link pasted into the data-availability statement the week before submission, unverified and often broken by the time anyone clicks it.
Repositories have their own incentives. Many are funded to accept deposits, not to curate them. Curation is expensive, and a repository that spends its budget on making old deposits runnable has less to spend on storage and uptime. The result is a system optimised for ingestion.
Maintenance funding is scarce in every direction. Grants end, servers are retired, and the software that a paper depended on quietly stops compiling. A cost-accounting exercise for a single unreplicated result, covered in this site's accounting of a mouse-model result, shows how quickly the maintenance tail outruns the original project.
There is a structural mismatch underneath all this. Grants are awarded in fixed cycles of a few years, and the obligation to keep a deposit runnable has no natural end. Each funding round produces new deposits that inherit the same open-ended commitment, and no part of the accounting holds anyone responsible for the accumulated stock. A repository that has been accepting deposits for a decade is carrying a decade of unverified environments, most of which no one has tried to rebuild. The cost of that stock is real even when it is not being paid, which is precisely why it stays off the books.
Rethinking the Cost-Benefit Calculus
Targeted archiving may yield better returns than blanket archiving. Not every paper needs a runnable environment; some need only the data and the description. A policy that asks for the minimum sufficient artefact, rather than the maximum feasible one, would spend less and probably get more usable deposits.
The objection is predictable and it is not unreasonable. Selective archiving requires someone to decide which claims are worth the investment, and that judgement is exactly what reproducibility policy was meant to remove from the hands of authors. A curator who declines to preserve a result may be wrong, and the error is irreversible.
Shared infrastructure could lower per-lab costs, though the evidence for that is mostly analogy. Consortia that pool computing and storage do reduce duplication; whether they reduce the packaging labour is less clear, since that work is specific to each project. Cost-benefit analysis has been pushed into science funding before, as a related profile of that campaign recounts, and the hard part has always been measuring the benefit.
A middle path exists and deserves a trial. Funders could require a tested environment only for claims that other researchers are likely to build on, and a lighter deposit, data plus a description, for everything else. The decision rule would need to be written down and applied before the results are known, so that it does not become a way to bury inconvenient findings. That is a design problem, and design problems are cheaper to solve than the maintenance backlog they create.
Practical Steps for Researchers and Funders
Budget archiving costs explicitly in proposals. Add a line for research software time, even a modest one, so the work is visible in the ledger rather than hidden in a student's week.
Use lightweight, standardised metadata schemas. A short machine-readable file naming language versions, dependencies, and data locations costs an hour and saves a stranger a day.
Prioritise archiving for high-impact claims. A result that a field will build on deserves a tested environment; a routine descriptive table may need only its data.
Advocate for shared repository funding rather than per-grant deposits. Curation is infrastructure, and infrastructure is cheaper when it is paid for once.
Pilot cost-sharing models across consortia. A group of labs that splits a software engineer can test whether pooled packaging actually reduces the burden, and report the answer either way.
Funders could also fund the rebuild, not just the deposit. A small maintenance line attached to a repository, enough to keep a defined set of environments runnable, would cost a fraction of what grantees currently spend packaging deposits nobody rebuilds. The number would be visible, which is the point. A cost that is budgeted can be argued about; a cost that is hidden in salaried hours cannot, and the hidden version is the one that quietly wins.