Replicate and expand upon the Nunney 2003 'cost of substitution' paper.
Go to file
welsberr 4f36070a7f Add biological overview and Nunney analysis docs 2026-04-11 07:20:57 -04:00
config Migrate paper-scale Figure 1 configs into renunney 2026-04-11 06:19:01 -04:00
docs Add biological overview and Nunney analysis docs 2026-04-11 07:20:57 -04:00
examples Migrate orchestration control plane into renunney 2026-04-11 06:17:58 -04:00
runs Initial renunney scaffold 2026-04-11 06:16:02 -04:00
scripts Migrate Track 1 runner and API boundary into renunney 2026-04-11 06:24:12 -04:00
src/renunney Remove legacy runtime hooks from renunney Track 1 stack 2026-04-11 07:01:58 -04:00
tests Remove legacy runtime hooks from renunney Track 1 stack 2026-04-11 07:01:58 -04:00
.gitignore Initial renunney scaffold 2026-04-11 06:16:02 -04:00
Makefile Remove legacy runtime hooks from renunney Track 1 stack 2026-04-11 07:01:58 -04:00
README.md Add biological overview and Nunney analysis docs 2026-04-11 07:20:57 -04:00

README.md

renunney

Working repository for replication and reanalysis of Leonard Nunney's 2003 cost-of-substitution simulations.

Biological Question

Nunney's paper asks how rapidly an adapting population can track a moving environment before extinction becomes likely. In this model:

  • the selective optimum moves steadily through time,
  • adaptation requires repeated allelic substitutions across one or more loci,
  • population growth is density-dependent,
  • offspring survival falls as genotypes lag behind the moving optimum,
  • and "cost of substitution" is summarized by the smallest environmental-change interval T that still allows persistence.

Smaller T means faster environmental change and a harder adaptive problem.

Two Approaches

This project treats the problem in two separate ways.

Track 1: Nunney-faithful replication

  • reconstruct the published simulation and threshold heuristic as closely as possible,
  • preserve historically relevant assumptions even when they are inefficient or awkward,
  • and use that result as the baseline for replication and criticism.

Track 2: modern replacement

  • build a cleaner and faster simulator around the same biological question,
  • define threshold explicitly rather than through Nunney's heuristic,
  • and use a more performant implementation path, likely including Rust.

The current repo is centered on Track 1, with orchestration intended to support both tracks later.

Nunney's Approach

The paper-level model combines four pieces:

  • constant environmental change,
  • genotype survival w_i as a function of distance from the moving optimum,
  • density-dependent female fecundity f,
  • and Mendelian transmission with mutation.

The published threshold procedure is heuristic rather than inferential: Nunney searches for the smallest T with no extinctions in 20 runs, then checks nearby larger values. That historical rule is preserved in Track 1 because it is part of the claimed result structure.

This Repo's Approach

renunney turns that work into a clean, testable stack:

  • local Track 1 simulation kernel,
  • local threshold/search layer,
  • local analysis, reporting, extinction-dataset, and fitting layers,
  • local orchestration CLI and SQLite job registry,
  • local paper-scale Figure 1 configs,
  • and a Makefile for common operational tasks.

The repo was bootstrapped from earlier work in ../collaborations/to_ptbc/evc/cost_of_substitution, which remains useful as provenance and historical context, but the Track 1 runtime now lives in renunney.

Key Docs

Layout

  • docs/ project, migration, and paper-analysis notes
  • config/ configuration templates and paper-scale treatment configs
  • runs/state/ SQLite registries and persistent orchestration state
  • runs/results/ result artifacts collected by orchestration
  • runs/scratch/ local worker scratch and cache files
  • src/renunney/ in-repo Python package
  • scripts/ local CLI entrypoints
  • tests/ local verification

Start

Initialize the local run directories and SQLite registry:

make init

Run one local Track 1 simulation:

make track1-sim-smoke

Submit a paper-scale Figure 1 treatment:

make submit-figure1-m10

Run one worker loop locally:

make run-loop

Collate completed Figure 1 jobs:

make collate-figure1

Status

The Track 1 runtime and orchestration stack are now local to renunney. The next major step is no longer migration of Track 1 code; it is either:

  • hardening multi-host orchestration,
  • organizing publication-quality replication outputs,
  • or starting the Rust-backed Track 2 path.