Nature Compiler is a research platform for synthesizing and testing candidate algorithms from biologically inspired computational primitives.
Its core question is now:
Which small, typed computational mechanisms produce useful behavior across more than one task family, and which components causally matter?
The first v0.5 artifact is a frozen causal assay for computation whose substrate is also its persistent state. A homogeneous, identifier-free local rule modifies edge conductance during a write, transient node activity is then cleared, and a frozen query tests whether the altered morphology redirects future information flow.
The included FluxReinforcementRule is a hand-specified, known positive
control. It validates locality, synchronous execution, morphology
freeze/reset/swap/lesion interventions, rewriting, and relabel invariance. It
is not a discovered or novel primitive.
See the Substrate-as-State protocol for the preregistered equations, information boundary, predictions, and invalidation criteria.
The next slice removes arbitrary Python from automatic candidates. It exhausts 408 canonical programs from a frozen local-rule grammar, nominates one program on a two-way depth-two fork, exhaustively reduces its declared term- neutralization family, locks the reduced program and predictions, and only then evaluates unchanged dynamics on three-way depth-two and two-way depth-three forks.
.venv/bin/python -m nature_compiler.cli search-substrate \
--output outputs/substrate-searchThe run records all candidates, the deterministic ranking, positive-control calibration, causal swap/reset/relabel interventions, the complete reduction lattice, a SHA-256 lock chain, both one-shot topology validations, and the canonical operator graph of the reduced rule. Sealed failures never promote a runner-up or trigger repair under the same campaign identity.
The committed S1 reference execution evaluates all 408 canonical programs and retains the complete 3.1 MB evidence record.
See the Substrate Rule Search protocol. The strongest S1 result is a validated declarative search pipeline and, possibly, a cross-topology candidate rule. These topologies still exercise one task family, so S1 cannot establish cross-task generality or scientific novelty. They were also exercised while the assay was being hardened, making the committed S1 run retrospective pipeline evidence rather than a historically untouched prospective holdout; that stronger test belongs to a fresh S2 protocol.
The v0.4 milestone is bounded structural synthesis over a typed algorithm language. It is not open-ended discovery. The platform does not equate an uncatalogued graph, a high novelty score, or an occupied MAP-Elites cell with scientific novelty.
v0.4 separates three independent layers:
Typed Algorithm Genome
↓
Task Adapter
↓
Benchmark Environment
Genomes contain only domain-neutral operators such as sense, compare,
integrate, decay, reinforce, inhibit, gate, broadcast, store,
move, select, allocate, prune, synchronize, delay, and saturate.
Their
channels are abstract values such as local_scalar, neighbor_signal,
internal_state, event, action_probability, and resource_budget.
Routing, ants, pheromone, food, and nests are adapter or environment concepts,
never genome concepts.
The typed language provides systematic generation and validity-preserving structural mutation. The bounded command scans a canonicalized, deduplicated portion of the grammar and deterministically samples across complexity strata. It uses delayed binary routing as the declared selection family, then reserves fresh noisy-distributed-consensus results as the second-family transfer test. It measures structural and behavioral novelty separately, preserves distinct behavioral niches with MAP-Elites, and produces automatic ablations and synthesis Research Cards.
The default command scans at most 20,000 generated graphs and evaluates at most 128 candidates. The scan budget is divided across all four abstract input bindings, then sampled round-robin across binding/node/state-scope/ feedback-polarity/delay/saturation strata, with these structural bounds:
- At most six nodes.
- At most three state channels.
- At most two delayed feedback loops.
- Delays restricted to zero or one logical update.
.venv/bin/python -m nature_compiler.cli synthesize \
--max-nodes 6 \
--max-state-channels 3 \
--max-feedback-loops 2 \
--candidate-limit 128 \
--generation-scan-limit 20000 \
--search-seeds 3 \
--validation-seeds 3 \
--heldout-param-seeds 3 \
--seed 23 \
--output outputs/synthesis/seed_23Search, validation, and joint held-out-environment seeds are disjoint. A paired parameter test also reuses validation seeds while changing only the environment, so seed and parameter generalization are not conflated. Every MAP-Elites niche receives held-out, ablation, and reduction follow-up by default. Control gates require at least three seeds and a configured mean margin, but do not constitute a confidence interval or multiple-testing correction. The command prints exact artifact paths and an honest run summary. A candidate surviving this screen is a low-confidence computational hypothesis, not a demonstrated new algorithm.
outputs/synthesis/seed_23/
└── synthesis_run_HASH_exec_HASH/
├── synthesis_run.json
├── summary.json
├── map_elites_archive.json
├── research_cards_index.json
├── research_cards/
│ └── synthesis_card_HASH_r001.json
└── genomes/
└── genome_HASH.json
Structural signatures record the primitive multiset, canonical topology, feedback, delay and saturation structure, memory topology, channel types, update semantics, and state dimensionality. Behavioral signatures record responses to disruption and delayed reward, symmetry breaking, recovery, hysteresis, noise sensitivity, scaling, exploration, and communication cost. These distances are never collapsed into a name-difference proxy.
Automatic ablation generates node-removal and compatible-bypass variants,
polarity reversals, memory/delay/saturation-disabled variants, and deterministic
randomized-wiring controls. Component labels such as necessary or
interaction-dependent are conditional on the evaluated tasks, seeds, metric,
and thresholds. Greedy reduction produces a small retained mechanism but does
not prove global minimality.
Dynamic resource allocation remains a planned third family; v0.4 deliberately implements one genuinely different transfer family (consensus) rather than claiming breadth from many shallow adapters.
Primitive Library
↓
Compatibility Graph
↓
Seeded Evolutionary Search
↓
Candidate Algorithm Blueprint
↓
Executable Simulation Adapter
↓
Benchmarks
↓
Multi-objective Fitness
↓
Research Card
↓
Keep / Reject / Revise
The v0.3 implementation includes:
- A typed knowledge graph spanning primitives, organisms, motifs, benchmarks, simulations, evidence, and compatibility.
- Seeded evolutionary search over primitive sets, using graph dataflow during mutation and deterministic crossover/selection.
- An executable route-composition adapter for the bounded subset currently supported by the ant-route simulation.
- Configurable performance, robustness, adaptability, efficiency, simplicity, and novelty fitness.
- One standardized, versioned Research Card for every evaluated composition.
- The full v0.2 primitive catalog and v0.1 route simulation.
The search engine is evolutionary for larger adapter spaces. Under the current route adapter's default bounds, however, exactly eight genomes are executable; a population of eight evaluates all of them in generation zero. The v0.3 reference run is therefore an exhaustive validation of this bounded adapter, not evidence of open-ended evolutionary discovery.
Python 3.12 or newer is required.
python -m venv .venv
.venv/bin/pip install -e '.[test]'.venv/bin/python -m nature_compiler.cli discover \
--population 8 \
--generations 4 \
--minimum-performance 0.20 \
--min-primitives 2 \
--max-primitives 6 \
--seed 23 \
--evaluation-seeds 3 \
--validation-seeds 3 \
--output outputs/discovery/seed_23The command writes:
outputs/discovery/seed_23/
├── discovery_run_run_HASH.json
├── research_cards_run_HASH.json
└── research_cards/
└── card_HASH_r002.json
The CLI prints the exact versioned paths. The discovery-run document records
the population, lineage, blueprints, benchmark
summaries, objective values, cost breakdowns, fitness contributions, and
adapter caveats. Its run ID changes with the adapter, search configuration,
benchmark templates, catalog, or package code. Cards preserve the primitive-set composition_id
while adding a run-scoped card_id, immutable revision number, and SHA-256
digests so different experiments do not silently overwrite one another.
Search uses evaluation seeds beginning at zero. Optional held-out validation uses disjoint seeds beginning at 10000 and does not alter which candidates were retained; it tests whether retained rankings survive fresh randomness.
Use custom fitness weights:
.venv/bin/python -m nature_compiler.cli discover \
--fitness-config configs/fitness_default.json \
--output outputs/discovery/custom_fitnessDefault fitness:
0.30 × performance
+ 0.20 × robustness
+ 0.15 × adaptability
+ 0.10 × efficiency
+ 0.10 × simplicity
+ 0.15 × novelty
Efficiency is one minus the weighted communication, memory, and energy costs. All values and contributions are normalized and recorded.
See DISCOVERY_ENGINE.md for exact evaluator definitions and limitations.
The audited seed-31 reference run exhaustively evaluated all eight executable route genomes on search seeds 0–2, then reevaluated the four retained candidates on held-out seeds 10000–10002.
| Candidate interpretation | Held-out task | Robustness | Causal reversal | Blockage | Fitness |
|---|---|---|---|---|---|
| Positive-feedback route stack | 0.836 | 0.486 | 0.000 | 0.490 | 0.506 |
| Same stack + forgetting | 0.837 | 0.488 | 0.000 | 0.490 | 0.453 |
| Same stack + saturating negative feedback | 0.477 | 0.186 | 0.210 | 0.169 | 0.315 |
The strongest optimizer failed the same-seed reward-reversal counterfactual. Forgetting did not change that result at the tested decay rate. Saturating negative feedback enabled some causal switching but sacrificed static performance and blockage robustness. That tradeoff is a candidate hypothesis for parameter sweeps and ablation, not a claim of a newly discovered algorithm.
The complete data are in the release run and its best Research Card.
# Graph size and epistemic warning
.venv/bin/python -m nature_compiler.cli graph summary
# Export typed nodes and edges
.venv/bin/python -m nature_compiler.cli graph export \
--output outputs/knowledge_graph.json
# Absence-of-evidence query, research-supported records only by default
.venv/bin/python -m nature_compiler.cli graph never-cooccur \
--primitives local_reinforcement phase_synchronization dynamic_pruning
# Include provisional seed hypotheses explicitly
.venv/bin/python -m nature_compiler.cli graph never-cooccur \
--include-seed-hypotheses
.venv/bin/python -m nature_compiler.cli graph strongest-support
.venv/bin/python -m nature_compiler.cli graph unbenchmarked
# Query generated cards; use the research_card_index path printed by discover
.venv/bin/python -m nature_compiler.cli graph unbenchmarked \
--research-cards outputs/discovery/seed_23/research_cards_run_HASH.jsonThe graph distinguishes:
appears_in: evidence-scoped primitive-to-organism association.generates: primitive participation in a catalogued motif.tested_by: registered benchmark binding, not automatically a result.implemented_as: registered simulation implementation.composes_with: engineering compatibility, not biological co-occurrence.
Missing graph edges are never presented as proof of absence in nature.
Likewise, is_benchmarked is true only when an exact-composition Research Card
contains a completed result; a registered test binding is reported separately.
Every generated composition receives a frozen, JSON-serializable card containing:
- Card ID, run ID, revision, composition ID, primitives, and predicted properties/capabilities.
- Biological support with the original evidence kind and status unchanged.
- Implementation and benchmark status.
- Raw benchmark summaries and normalized fitness.
- Effective benchmark and counterfactual simulation configurations.
- Novelty distance from the nearest catalogued primitive set.
- Confidence, parent compositions, seeds, code/catalog/config digests, and next experiments.
Simulation success cannot upgrade a seed_hypothesis into
research_supported. Research-supported evidence requires a source ID.
.venv/bin/python -m nature_compiler.cli catalog list --kind primitives
.venv/bin/python -m nature_compiler.cli catalog show \
--kind motifs \
--id reinforcement_forgetting_loop
.venv/bin/python -m nature_compiler.cli catalog find \
--primitive environmental_memory
.venv/bin/python -m nature_compiler.cli extract \
--organism argentine_antsThe catalog finder separates evidence records from rule-extracted candidates. Extraction is a transparent hypothesis generator over provisional signal profiles, not an automated literature claim.
Manual composition remains available for controlled hypotheses:
.venv/bin/python -m nature_compiler.cli compose \
--primitives \
local_reinforcement \
environmental_memory \
temporal_adaptation \
distributed_consensus \
negative_feedback \
--output outputs/compositions/adaptive_consensus.json.venv/bin/python -m nature_compiler.cli run \
--config configs/unequal_routes.json \
--seed 42
.venv/bin/python -m nature_compiler.cli benchmark \
--id unequal_route_optimization \
--seeds 10
.venv/bin/python -m nature_compiler.cli experiment \
--name unequal_routes \
--seeds 100The biological route selector still receives no route length or shortest-path information. See ANT_SIMULATION.md.
Read RESEARCH_METHOD.md before interpreting catalog, graph, extraction, novelty, or fitness results. The central rules are:
- Predicted capability is not measured capability.
- Simulation evidence is not biological evidence.
- An unencoded composition is not proof of historical or scientific novelty.
- Search results are conditional on the evaluator, fitness weights, seeds, and search space.
- Surprising winners and objective failures are results to investigate, not outputs to conceal.
.venv/bin/pytest