E12: model speciation — the merge-compatibility limit of the sexual society

New analytic result for the evolution-of-sex paper: how far can two lineages
diverge before recombination (model merging) stops working? Frames merge failure
as biological reproductive isolation via Bateson-Dobzhansky-Muller
incompatibilities. src/knowledge/speciation.py, kind: speciation, on the E7-E11
genotype machinery (pure seeded NumPy, bitwise-reproducible; no external
simulator whose separate RNG would break that).

- BDM construction (E12.yaml): ancestor + two lineages substituting disjoint loci
  (each parent adaptive, incompatibility-free), a fraction rho of cross-lineage
  pairs are BDMIs. Sweeping divergence d reproduces the predicted
  compatible -> outbreeding depression -> hybrid inviability curve; the isolation
  cliff moves to lower d as epistasis density rises (iso at d=20: 0.00/0.03/0.50
  for rho 0.1/0.25/0.5); incompatibilities snowball ~ (d/2)^2 (Orr-Turelli).
- NK variant (E12_nk.yaml): parents = hill-climbed local optima; the epistasis
  wedge — recombination gain flips 0 -> -0.13 and OD rate 0 -> 0.90 as ruggedness
  K rises. At matched divergence, mergeability is governed by epistasis, the axis
  no divergence-only ML merge predictor captures.

plot_E12.py (3-panel), +7 tests (138 green), README with honest positioning
(concedes the empirical phenomenon to Pari 2024 / Zhou 2026 + permutation
artefacts to Git Re-Basin; claims the predictive theory + the epistasis wedge).
Wired into make layer1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Giorgio Gilestro 2026-07-08 22:40:02 +01:00
parent ae1779a9a8
commit db9452c9d4
14 changed files with 470 additions and 1 deletions

BIN
results/E12/E12.pdf Normal file

Binary file not shown.

BIN
results/E12/E12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

47
results/E12/README.md Normal file
View file

@ -0,0 +1,47 @@
# E12 — Model speciation: when two diverged models are too incompatible to merge
**Claim tested.** The sexual society (E7E11) recombines complementary parents. E12 asks the limit:
**how far can two lineages diverge before recombination (model merging) stops working?** In biology the
answer is *reproductive isolation* via **BatesonDobzhanskyMuller incompatibilities** (BDMIs) — alleles
benign on their own lineage's background but deleterious *in combination*, which a recombinant inherits
untested. A merged model is a single recombinant (an F2-like *hybrid-breakdown / recombination-load*
object, not an F1), so the predicted signature as parental divergence grows is
**compatible → outbreeding depression → hybrid inviability**, arriving earlier the more epistatic the
capability landscape.
**Setup.** Pure seeded NumPy on the E7E11 genotype machinery (bitwise-reproducible; no external
simulator, whose separate RNG would break that guarantee). Two landscapes:
- **BDM** (`configs/layer1/E12.yaml`, headline): an ancestor; two lineages each substitute a *disjoint*
set of loci (each parent adaptive, neither carrying an incompatibility); a fraction `ρ` of
cross-lineage locus pairs are BDMIs (penalty `s`), biting only when a hybrid inherits *both* derived
alleles. Sweep divergence `d` (substitutions) for several `ρ`; `L=20`, 15 reps.
- **NK** (`configs/layer1/E12_nk.yaml`): parents are *local optima* (hill-climbed) on a Kauffman NK
landscape; sweep ruggedness `K`. The emergent version.
### Results
- **The three-regime collapse (BDM).** Parent fitness rises linearly with divergence; hybrid fitness
*tracks it while compatible, then peels off, peaks, and crashes*. At dense epistasis (`ρ=0.5`) hybrids
peak near `d≈8` and fall to **1.0** by `d=20` (below the ancestor = inviable); at sparse epistasis
(`ρ=0.1`) there is mild outbreeding depression and **no** isolation.
- **The isolation cliff moves with epistasis density.** Reproductive-isolation rate (P hybrid inviable)
at `d=20`: `ρ=0.1`→0.00, `ρ=0.25`→0.03, `ρ=0.5`→**0.50** — the cliff arrives at lower divergence the
denser the epistasis.
- **The OrrTurelli snowball.** The number of incompatibilities grows ~`(d/2)²` (≈48 at `d=20`, `ρ=0.5`
`0.5·10²`), so hybrid fitness falls *super-linearly* — divergence is punished faster than it accrues.
- **The epistasis wedge (NK).** At `K=0` (additive) recombination is neutral (no isolation — and the two
parents can't even diverge, since there is one peak); as ruggedness rises, recombining two adapted
local-optimum parents flips from a gain to **outbreeding depression** (recombination gain 0 → 0.13;
OD rate 0 → 0.90 across `K=0→10`). *At matched divergence, mergeability is governed by epistasis*
the axis no divergence-only merge predictor captures.
### Why it matters / positioning
The ML *phenomenon* that "specialization/divergence eventually breaks merging" is known empirically
(Pari et al. 2024; Zhou et al. 2026), and part of the apparent incompatibility is a permutation artefact
(Git Re-Basin). E12's contribution is the **predictive theory** those lack: the functional form
(compatible→OD→inviability), the **snowball** onset, and the **epistasis wedge** — merge failure as a
DobzhanskyMuller phenomenon whose onset is set by divergence *and* epistasis, not divergence alone. The
design rule: *before merging, check divergence against the landscape's ruggedness; beyond the cliff,
route (allopatry), don't merge.* **Falsifier (not triggered):** no OD/isolation progression as `d` and
`ρ` grow — instead the full progression appears, and the additive control shows none. Real-weight
confirmation (merging at increasing divergence *with* permutation alignment, isolating the residual
epistatic incompatibility) is the flagged next step; here the analytic model is the anchor.

14
results/E12/manifest.json Normal file
View file

@ -0,0 +1,14 @@
{
"experiment": "E12",
"master_seed": 12,
"git_commit": "ae1779a9a83fc8f9f36019875efed522bf488b9c",
"python": "3.14.5",
"libraries": {
"numpy": "2.5.0",
"scipy": "1.18.0",
"pandas": "3.0.3",
"pyarrow": "24.0.0"
},
"rows": 495,
"results_sha256": "0af2062c00f606ad1c2e6ca9f5974e981e0c15d699510576f5e7c6c84831f2bb"
}

View file

@ -0,0 +1,33 @@
experiment: E12
seed: 12
n_replicates: 15
source_config:
experiment: E12
kind: speciation
seed: 12
n_replicates: 15
speciation:
landscape: bdm
L: 20
rho:
- 0.1
- 0.25
- 0.5
divergences:
- 0
- 2
- 4
- 6
- 8
- 10
- 12
- 14
- 16
- 18
- 20
s: 1.0
beta: 1.0
recomb_rate: 0.5
n_offspring: 500
output:
dir: results/E12

View file

@ -0,0 +1,14 @@
{
"experiment": "E12_nk",
"master_seed": 12,
"git_commit": "ae1779a9a83fc8f9f36019875efed522bf488b9c",
"python": "3.14.5",
"libraries": {
"numpy": "2.5.0",
"scipy": "1.18.0",
"pandas": "3.0.3",
"pyarrow": "24.0.0"
},
"rows": 90,
"results_sha256": "c02706b6be6d2cd463d4af20efc1ff2d9cb2a98a1306d84cb07bbae517587e53"
}

View file

@ -0,0 +1,23 @@
experiment: E12_nk
seed: 12
n_replicates: 15
source_config:
experiment: E12_nk
kind: speciation
seed: 12
n_replicates: 15
speciation:
landscape: nk
L: 16
K:
- 0
- 2
- 4
- 6
- 8
- 10
n_pairs: 40
recomb_rate: 0.5
n_offspring: 200
output:
dir: results/E12_nk