Viral Code
Grid v0.21 ("Viral Code") introduces executable, transmissible code parasites to halt the decay of sexual reproduction in long runs. Following two rejected physical laws—an anti-dominance tax on organic digestion (v0.19, "Stone and Leaf") and additive effort across non-locomotive actions (v0.20, "Polyphony")—and the discovery that single-line dominance was largely a naming artifact (Decision D-034), the committee addressed why mating collapses from 18% to 1% of births. Guided by founder directives mandating deep research dives and two-parent genealogies, the committee identified the Red Queen hypothesis as the missing driver: coevolving parasites penalize common genotypes and favor rare recombinants. Fulfilling the founder's directive to model contagion as partial programs rather than scalar illness, v0.21 introduces short routines with antigens that spread by touch, consume host CPU cycles, and confront independently segregating resistance loci at meiosis. After tuning resolved a sharp epidemic threshold, validation showed that viral code more than doubles births from mating (17% ± 11% vs 6% ± 4% in controls across eight 1M-tick worlds), passing the primary prediction by 2.7 control standard deviations, with no crashes and no significant harm to minds.
Two Versions That Didn't Work
Grid v0.19 ("Stone and Leaf") attempted to curb dominance by taxing organic digestion: organic food was multiplied by (1 − catalysis). Tested across eight seeds to 1M ticks against v0.18 (Decision D-033), dominance worsened: largest lineage share rose from 0.59 to 0.73, active lineages fell from 6.1 to 4.6, and crystal share fell from 30% to 25% (working mind 60.5 vs 58.1; reboots 0). Taxing organic digestion stripped crystal miners of their food buffer, letting organic generalists rule harder. Meanwhile, v0.18's live run showed minds and diversity decoupling: at 1.74M ticks, programs sustained 90 instructions per tick under a 92% ruler. Direct anti-dominance levers (v0.14, v0.16, v0.19) failed or backfired; the only diversity gains came indirectly, through new energy sources (v0.15 detritus, v0.17 rot).
Grid v0.20 ("Polyphony") extended additive summation from movement (TURN/GO) to EAT, STRIKE, BUILD, and ERODE (commit 1258293, Decision D-035). Working minds slipped from 58.1 to 56.1 and hormones fell from 2.03 to 1.66 (reboots 0). Locomotion succeeded in v0.18 because directional vectors compose emergent trajectories (Mussa-Ivaldi, Giszter & Bizzi 1994; Georgopoulos, Schwartz & Kettner 1986; Arkin 1989; by contrast Brooks' 1986 subsumption overrides, like the old first-claim rule; Ashby 1956). Feeding and striking are scalar efforts; because one routine can set effort to maximum, summing scalars provides no novel degrees of freedom—it merely saturates. Both versions were rejected.
The Lineage-Name Artifact
Prompted by 90-instruction minds flourishing beneath a 92% ruler in v0.18, the committee investigated what a "lineage" measures (Decision D-034). In genome.ts, a lineage splits only when an organism's gene-ID set and body signature drift beyond 0.7 from its founder; intra-routine mutations never alter gene IDs. Measuring v0.18 across eight seeds, paired with a graded probe on seed 1 to 500k ticks, revealed striking hidden divergence: within the largest lineage, 95% of members carried distinct routine code (topVariants 0.93–0.98), random pairs shared almost no identical routines (topCodeDiff 0.98–0.99), and within shared gene IDs, 64–74% of instructions differed by position. The "monoculture" targeted by earlier versions was largely a taxonomic artifact; a dominant lineage is an extensively diverged gene family, not a clone army. Under Decision D-034, the committee halted direct levers against topShare, preserving lineage names as clade markers while adding diversity metrics to replicate.ts.
Two New Directions and the Hybrid Tree
On 2026-09-29, the founder directed mandatory research dives before any design (PROCESS step 3b), and full two-parent genealogies (coParent and crosses in genealogy.jsonl) for the Grid Genealogy viewer.
The v0.18 genealogy run (seed 913313976, world 400, commit d391b3e) reached 2,508,813 ticks, recording 40,550 lineage events. Hybridization was widespread: 18,607 of 43,584 matings (43%) crossed lineages. At tick 542,750, 48% of matings crossed lineages, with grazing ruler DMN-422 (84%) and crystal miner TRI-1051 (14%) exchanging genes across 2,573 matings; hybrids founded 1,538 of ~3,300 lineages (e.g. SWT-4 × ANO-7 producing TRI-10, TRN-18, YRI-19, QRA-20). At tick 1,885,172, a single lineage, SMT-11411 (851 programs; 487 carried, 51 memory ops), held 100% on a combined grazing and mining diet after extensive mating with TNK-14563 and APO-12951. Heavy interbreeding may have merged two trophic niches into one gene pool—the reverse of speciation—which remains unconfirmed pending viewer analysis. Hybrids founding 55% of lineages in earlier probes was partly a metric artifact: inheriting two gene-ID families pushes distance past 0.7 automatically. Across long runs, mating decayed from 18% early to 1–5% late (3% overall in v0.18). Nothing actively rewarded sex.
The Contagion Dive and Viral Code
The v0.21 reflection memo synthesized three regularities: minds expand only with directional output; diversity grows only through new energy sources; and innovation arrives in bursts before stagnating under settled rulers. Sex decayed because the Grid lacked an adversary penalizing common genotypes.
Coevolving parasites maintain sex under the Red Queen hypothesis (Van Valen 1973). Hamilton (1980) showed virulent parasites generate cycles where sexual hosts out-reproduce clones; Hamilton, Axelrod, and Tanese (1990) showed sex succeeds when defense recombines across multiple loci. In nature, male frequency tracks trematodes in snails (Lively 1987), and C. elegans coevolving with Serratia maintains outcrossing while selfers go extinct (Morran et al. 2011). Alternatives were deferred: Chorus lacked differential signal among kin; Courtship faced negligible selection at 1–3% mating; Reach duplicated locomotion. Addressing Gemini's critique that blending inheritance pulls offspring to the parasitized mean (Fisher 1930), the committee adopted discrete, recombining MHC-like resistance loci (Doherty & Zinkernagel 1975; Penn & Potts 1999) and direct health harm.
On 2026-09-30, the founder directed that contagion be partial programs, like viruses. In Tierra (Ray 1991), parasites emerged on their own as short code that borrowed their hosts' copying code; in Avida, Zaman et al. (2014) added coevolving parasites and found that hosts evolved more complex functions. Captured sequences also supply novelty: bacteria diversify via horizontal transfer (Ochman, Lawrence & Groisman 2000; Koonin 2016), and eukaryotes repeatedly co-opt viral genes, such as syncytin in the placenta (Mi et al. 2000; Dupressoir et al. 2005; Feschotte & Gilbert 2012). Transposable elements (McClintock 1950; Kazazian 2004; Orgel & Crick 1980) persist as selfish DNA that can yield novelty. Parasites can also manipulate host behavior (Poulin 2010; Berdoy, Webster & Macdonald 2000) and trade off virulence against transmission (Anderson & May 1982; Alizon et al. 2009).
The Law: Viral Code
Implemented in commits f694c87 and 60b3127 (Decision D-036), Viral Code introduces executable parasites:
- Structure: A virus is a routine of at most 16 instructions (promoter, priority, code) plus an antigen of four symbols.
- Resistance loci: Each haplotype carries four unlinked loci from an alphabet of six symbols, recombining independently at meiosis and mutating at 0.002 × (0.5 + mutation rate). A host recognizes a locus if either diploid allele matches the antigen (codominant MHC-like surveillance; m ranges 0 to 4). Heterozygotes recognise twice as many random antigens as homozygotes.
- Execution: Appended to the host program without shifting host code offsets, the virus shares registers r0–r3, memory, and cycle budgets. Its movement sums into TURN and GO (behavioral steering), while claiming unclaimed actions elsewhere. Load equals viral instructions run last tick (0–16).
- Transmission and harm: Within 1.6 units, transmission probability per tick is BETA × (load / 16) × 0.4^m (no superinfection). Routine mutations apply at transmission (VIRUS_MUT = 0.5); antigens mutate at 0.03. Sickness accumulates at 0.0006 × load per tick. At full load, health wear (0.0038/tick) exceeds healing (0.003), establishing an Anderson–May trade-off by mechanism.
- Clearance and endogenization: Clearance occurs per tick at 0.002 × (1 + 2m), compulsory at 800 ticks; newborns are clean. Infected parents endogenize viral code into gametes with probability 0.02 (flagged as viral in origin). Environmental spillover seeds a random 2–6 instruction virus with probability 0.002 per tick (about once every 500 ticks). Energy is strictly conserved; resistance loci and viral routines are excluded from lineage distance.
Tuning the Epidemic Threshold
The committee navigated three transmission settings across pilot and validation trials:
- Pilot base 0.02: In a 50k-tick pilot across seeds 1–3, prevalence was 0–1%, extinguishing before establishing spread.
- Pilot base 0.1: At the allowed re-tune, prevalence reached 13–44%, viral load evolved toward the 16-instruction cap, and endogenized routines were run by 17–30% of programs in late seed 1.
- First validation setting (0.05, Decisions D-036 and D-037): Tested across eight seeds to 1M ticks against a control arm with GRID_VIRUS = 0 (commit 60b3127). Prevalence remained at 0–3% at every checkpoint, missing the 5–30% target. By pre-registered criteria, this was a tuning failure rather than an epidemiological test, though mating rose to 10% ± 5% versus 6% ± 4% in controls.
Transmission spans a steep epidemic threshold near R0 ≈ 1: 0.05 is subcritical and 0.1 is supercritical. Under Decision D-037, the committee set transmission to 0.075 to bisect the threshold, testing commit 5c86b21 against the control arm (val21-control.txt). Had prevalence failed again, protocol mandated introducing an endemic mechanism (such as waning immunity) rather than further parameter tuning.
Validation Results and the Red Queen
Validation of v0.21 at transmission 0.075 across eight seeds to 1M ticks (Decision D-038) supported the Red Queen hypothesis:
| Metric | No-Virus Control | v0.21 Viral Code (0.075) | Status / Criterion |
|---|---|---|---|
| System Reboots | 0 | 0 | Pass (0 required) |
| Viral Prevalence (1M / Mean) | 0% | 4% (mean ~5.5%) | Borderline: episodic, low edge of 5–30% |
| Births from Mating (1M) | 6% ± 4% | 17% ± 11% | Pass (> +1 control sd, +2.7 sd) |
| Births from Mating (Checkpoints) | 6–8% | 15–18% | Consistently elevated |
| Working Mind (inst / tick) | 64.5 ± 9.2 | 56.7 ± 18.0 | Pass (within 1 sd) |
| Memory Operations / Tick | 2.45 | 2.69 | Unharmed |
| Hormone Operations / Tick | 1.88 | 1.86 | Unharmed |
| New Behaviours | 55.0 | 70.9 | Reported |
| Host Mutation Rate | 0.13 | 0.11 | Secondary (not elevated) |
| Cross-Lineage Mating Share | 20% | 20% | Secondary (unchanged) |
| Endogenized Routines Run (1M) | 0% | ~0–3% | Co-option clause not met |
The primary prediction passed: births from mating reached 17% ± 11% versus 6% ± 4% at 1M ticks (+2.7 control sd) and held at 15–18% across every checkpoint. Parasitic code punishing common resistance genotypes sustained sex at more than double its baseline rate.
Prevalence was episodic: 16% at 250k ticks, then 2%, 0%, and 4% (mean ~5.5%, at the low edge of the target). Epidemics swept early and burned out, yet mating stayed high long after outbreaks subsided. Selection against clonal genotypes outlasts individual epidemics, or spillover continually re-seeds the threat.
What didn't happen:
- Host mutation rates did not rise (0.11 vs 0.13): hosts responded by recombining existing variation, not by mutating faster.
- Cross-lineage mating share held flat at 20% in both arms.
- The pre-registered co-option clause was not met: at 1M ticks, only ~0–3% of programs ran endogenized code.
- Working minds dipped slightly (56.7 ± 18.0 vs 64.5 ± 9.2) but remained within one standard deviation, while memory and hormones held steady.
What's Next
Under Decision D-038, Grid v0.21 was merged into main at transmission 0.075. The live run is active, recording full two-parent genealogies alongside viral epidemiological metrics.
Following the founder's research directive, the committee will conduct a dedicated research dive for v0.22 prior to proposing physical changes. This dive will investigate why epidemics burn out rather than establishing endemic stability, whether viral routines actively manipulate host locomotion to facilitate transmission, and what ecological functions absorbed viral routines perform in host genomes. Conclusions remain unconfirmed pending live observation.
Data:
- Decision D-033: v0.19 validation metrics (val19-v019.txt vs val19-base-v018.txt)
- Decision D-034: Lineage code diversity probe (val-diversity-v018.txt, seed 1 graded probe to 500k ticks)
- Decision D-035: v0.20 validation metrics (val20-v020.txt, val20b-v020.txt vs val19-base-v018.txt)
- Grid genealogy run: seed 913313976 (world 400, x64, ticks 542,750, 1,221,810, 1,885,172, ended at 2,508,813, v018g-archive-final.json)
- Decision D-036: v0.21 build and pilot (commits f694c87, 60b3127)
- Decision D-037: v0.21 first validation (val21-viral.txt vs val21-control.txt)
- Decision D-038: v0.21 final validation at transmission 0.075 (val21b-viral075.txt vs val21-control.txt, commit 5c86b21)