{
  "task_slug": "msa-2piece-affine-gap",
  "question": "In progressive MSA, how does the SP-score gain of 2-piece affine gap cost over 1-piece affine vary with the fraction of long-indel events (pi_long), and does the gain survive the greedy progressive propagation?",
  "falsifiable_prediction": "pi_long=0 -> 2-piece SP gain <=0.5pp and sign inconsistent across 3 seeds; pi_long=0.20 -> 2-piece SP gain >=2pp and same sign across all 3 seeds. Refuted if pi_long=0.20 gain <1pp or signs disagree, or if pi_long=0 shows >1pp gain.",
  "prediction_outcome": "refuted",
  "negative_result": true,
  "dataset": "synthetic: 6 taxa, root 220bp, K2P substitutions + mixed-geometric indels; dev seeds [100, 101, 102] x 4 fam, test seeds [0, 1, 2] x 4 fam, per pi_long in [0.0, 0.05, 0.2]",
  "env": {
    "python": "3.12.3",
    "torch": "n/a (C++/no-torch experiment)",
    "extra_packages": []
  },
  "seeds": [
    0,
    1,
    2
  ],
  "arms": [
    {
      "name": "baseline-affine-1p_pi0.00",
      "is_baseline": true,
      "pi_long": 0.0,
      "params": {
        "O": 4,
        "E": 3
      },
      "what": "1-piece affine gap g(l)=O+l*E, (O,E)=(4,3) selected by dev grid search over 20 combos at pi_long=0.00.",
      "metrics": {
        "sp_score": {
          "per_seed": [
            0.4505223726174297,
            0.47787604947166856,
            0.520687106457774
          ],
          "mean": 0.4830285095156241,
          "std": 0.02887540305173256
        },
        "tc_score": {
          "per_seed": [
            0.6432841932841933,
            0.6895120584434739,
            0.9617971016414699
          ],
          "mean": 0.7648644511230458,
          "std": 0.14052545560491883
        },
        "sp_near_long_indel": {
          "per_seed": [
            0.4505223726174297,
            0.47787604947166856,
            0.520687106457774
          ],
          "mean": 0.4830285095156241,
          "std": 0.02887540305173256
        },
        "runtime_ms": {
          "per_seed": [
            5.88925,
            5.7315,
            5.506
          ],
          "mean": 5.708916666666667,
          "std": 0.1572739559565478
        },
        "peak_dp_bytes": {
          "per_seed": [
            1111635.0,
            1132325.0,
            996840.0
          ],
          "mean": 1080266.6666666667,
          "std": 59593.20743358443
        }
      }
    },
    {
      "name": "proposed-affine-2p_pi0.00",
      "is_baseline": false,
      "pi_long": 0.0,
      "params": {
        "O1": 4,
        "E1": 3,
        "O2": 28,
        "E2": 0.4
      },
      "what": "2-piece affine gap g(l)=min(O1+l*E1, O2+l*E2), (O1,E1) fixed from baseline, (O2,E2)=(28,0.4) selected by dev grid search over 20 combos at pi_long=0.00.",
      "metrics": {
        "sp_score": {
          "per_seed": [
            0.44746426864189454,
            0.4837779865176734,
            0.520687106457774
          ],
          "mean": 0.48397645387244737,
          "std": 0.02989342777736529
        },
        "tc_score": {
          "per_seed": [
            0.6398751023751024,
            0.6906432801629309,
            0.9617971016414699
          ],
          "mean": 0.7641051613931676,
          "std": 0.1413174426561889
        },
        "sp_near_long_indel": {
          "per_seed": [
            0.44746426864189454,
            0.4837779865176734,
            0.520687106457774
          ],
          "mean": 0.48397645387244737,
          "std": 0.02989342777736529
        },
        "runtime_ms": {
          "per_seed": [
            10.833,
            9.54575,
            9.59575
          ],
          "mean": 9.9915,
          "std": 0.595380375614335
        },
        "peak_dp_bytes": {
          "per_seed": [
            2901743.0,
            2864277.0,
            2591784.0
          ],
          "mean": 2785934.6666666665,
          "std": 138134.68382785775
        }
      }
    },
    {
      "name": "baseline-affine-1p_pi0.05",
      "is_baseline": true,
      "pi_long": 0.05,
      "params": {
        "O": 4,
        "E": 3
      },
      "what": "1-piece affine gap g(l)=O+l*E, (O,E)=(4,3) selected by dev grid search over 20 combos at pi_long=0.05.",
      "metrics": {
        "sp_score": {
          "per_seed": [
            0.3438406673772966,
            0.4807650142852471,
            0.520687106457774
          ],
          "mean": 0.44843092937343926,
          "std": 0.07573103960364932
        },
        "tc_score": {
          "per_seed": [
            0.3494746540799173,
            0.5655296720820852,
            0.9617971016414699
          ],
          "mean": 0.6256004759344908,
          "std": 0.25356270894796845
        },
        "sp_near_long_indel": {
          "per_seed": [
            0.26666666666666666,
            0.5,
            0.520687106457774
          ],
          "mean": 0.42911792437481355,
          "std": 0.11518043074995536
        },
        "runtime_ms": {
          "per_seed": [
            6.27,
            6.3375,
            5.4350000000000005
          ],
          "mean": 6.014166666666667,
          "std": 0.4104587541871762
        },
        "peak_dp_bytes": {
          "per_seed": [
            1272565.0,
            1282910.0,
            996840.0
          ],
          "mean": 1184105.0,
          "std": 132483.68434138095
        }
      }
    },
    {
      "name": "proposed-affine-2p_pi0.05",
      "is_baseline": false,
      "pi_long": 0.05,
      "params": {
        "O1": 4,
        "E1": 3,
        "O2": 24,
        "E2": 0.4
      },
      "what": "2-piece affine gap g(l)=min(O1+l*E1, O2+l*E2), (O1,E1) fixed from baseline, (O2,E2)=(24,0.4) selected by dev grid search over 20 combos at pi_long=0.05.",
      "metrics": {
        "sp_score": {
          "per_seed": [
            0.34078256340176144,
            0.4984279837310461,
            0.520687106457774
          ],
          "mean": 0.45329921786352717,
          "std": 0.08007856677285617
        },
        "tc_score": {
          "per_seed": [
            0.3460655631708264,
            0.563406443693034,
            0.9617971016414699
          ],
          "mean": 0.6237563695017768,
          "std": 0.2549678633680422
        },
        "sp_near_long_indel": {
          "per_seed": [
            0.27666666666666667,
            0.5,
            0.520687106457774
          ],
          "mean": 0.4324512577081469,
          "std": 0.11047961560960691
        },
        "runtime_ms": {
          "per_seed": [
            10.297749999999999,
            10.501,
            10.08375
          ],
          "mean": 10.294166666666667,
          "std": 0.1703604430481309
        },
        "peak_dp_bytes": {
          "per_seed": [
            3328741.0,
            3340870.0,
            2591784.0
          ],
          "mean": 3087131.6666666665,
          "std": 350298.69284591335
        }
      }
    },
    {
      "name": "baseline-affine-1p_pi0.20",
      "is_baseline": true,
      "pi_long": 0.2,
      "params": {
        "O": 4,
        "E": 3
      },
      "what": "1-piece affine gap g(l)=O+l*E, (O,E)=(4,3) selected by dev grid search over 20 combos at pi_long=0.20.",
      "metrics": {
        "sp_score": {
          "per_seed": [
            0.3438406673772966,
            0.4807650142852471,
            0.5561366577800793
          ],
          "mean": 0.46024744648087434,
          "std": 0.08787538459557324
        },
        "tc_score": {
          "per_seed": [
            0.3494746540799173,
            0.5655296720820852,
            0.5777887124803972
          ],
          "mean": 0.4975976795474666,
          "std": 0.10485829810786569
        },
        "sp_near_long_indel": {
          "per_seed": [
            0.26666666666666666,
            0.5,
            0.2646039603960396
          ],
          "mean": 0.3437568756875688,
          "std": 0.11048378194851981
        },
        "runtime_ms": {
          "per_seed": [
            6.1275,
            6.21325,
            6.45575
          ],
          "mean": 6.2655,
          "std": 0.1390073439306954
        },
        "peak_dp_bytes": {
          "per_seed": [
            1272565.0,
            1282910.0,
            1372935.0
          ],
          "mean": 1309470.0,
          "std": 45074.8224252372
        }
      }
    },
    {
      "name": "proposed-affine-2p_pi0.20",
      "is_baseline": false,
      "pi_long": 0.2,
      "params": {
        "O1": 4,
        "E1": 3,
        "O2": 16,
        "E2": 0.4
      },
      "what": "2-piece affine gap g(l)=min(O1+l*E1, O2+l*E2), (O1,E1) fixed from baseline, (O2,E2)=(16,0.4) selected by dev grid search over 20 combos at pi_long=0.20.",
      "metrics": {
        "sp_score": {
          "per_seed": [
            0.3405515079068217,
            0.49850328228061236,
            0.5619766242861061
          ],
          "mean": 0.46701047149118,
          "std": 0.09309893801563705
        },
        "tc_score": {
          "per_seed": [
            0.3449291995344627,
            0.5666115718981622,
            0.5730420748122806
          ],
          "mean": 0.49486094874830183,
          "std": 0.10605025509531882
        },
        "sp_near_long_indel": {
          "per_seed": [
            0.27666666666666667,
            0.4866666666666667,
            0.2913366336633664
          ],
          "mean": 0.35155665566556654,
          "std": 0.09572473831237535
        },
        "runtime_ms": {
          "per_seed": [
            10.527750000000001,
            10.49475,
            11.17525
          ],
          "mean": 10.732583333333332,
          "std": 0.3133023920893181
        },
        "peak_dp_bytes": {
          "per_seed": [
            3551327.0,
            3490903.0,
            3688646.0
          ],
          "mean": 3576958.6666666665,
          "std": 82737.77961863746
        }
      }
    }
  ],
  "headline": {
    "metric": "sp_score",
    "baseline_mean": 0.46024744648087434,
    "proposed_mean": 0.46701047149118,
    "delta": 0.006763025010305679,
    "claim": "At pi_long=0.20, 2-piece affine gains 0.68pp SP over 1-piece affine (seed signs consistent=False); at pi_long=0.00 the gain is 0.09pp (seed signs consistent=False). Prediction refuted."
  },
  "deviations": [
    "n_taxa reduced 8->6, root_len 800->220bp, families/seed 10->4, and proposed grid E2 kept at 4 values (not narrowed) to fit the 45-minute compute budget on shared 4-core CPU; see NOTES.md for full trace.",
    "match/mismatch score rescaled from an initial +2/-1 to +1/-3 and branch lengths shortened (U(0.03,0.18)->U(0.01,0.05)) after discovering the original scale made naive pairwise alignment prefer spurious tiny gaps at high sequence divergence (verified against ground truth, see NOTES.md).",
    "sp_near_long_indel is undefined for a (seed, arm) when none of that seed's 4 test families contain a true gap of length>=10 (this happens legitimately at low pi_long, since long indels are drawn with probability pi_long and pi_long=0.00 makes them rare-but-not-impossible under the short geometric tail). In that case the metric falls back to that seed's whole-alignment sp_score, logged explicitly in logs/run.log as '... falls back to sp_score=...'. Affects pi_long=0.00 (all 3 seeds) and pi_long=0.05 (1 of 3 seeds); pi_long=0.20 always had real flank data. This metric is reported for mechanism inspection only and is not the basis of the headline claim."
  ],
  "runtime_sec": 20.1
}