{
 "schema": "cain42.e165.source.v1",
 "generated_at": "2026-11-24T02:04:21Z",
 "sources": [
  {
   "seed": 0,
   "chosen": "ucb",
   "accepted": true,
   "source_sha256": "3319b2dbae8edb49",
   "p0_sha256": "218a05dfcd515414",
   "dev_gain": 0.038515,
   "prediction": {
    "dev_gain": 0.038515,
    "coverage_gain": -0.159722
   },
   "behavioral": true,
   "diagnosis": "selection_failure+allocation_imbalance",
   "diff": "--- P0.py\n+++ candidate.py\n@@ -36,3 +36,32 @@\n def run(problems, total_budget, rng):\n     budgets = allocate(total_budget, problems)\n     return [select(p, b, rng) for p, b in zip(problems, budgets)]\n+\n+\n+def select(problem, budget, rng):\n+    Y = problem[\"Y\"]\n+    n, m = Y.shape\n+    cnt = np.zeros(n)\n+    tot = np.zeros(n)\n+    evaluated = set()\n+    k0 = min(n, max(2, int(budget) // 3))\n+    for i in [int(x) for x in rng.choice(n, k0, replace=False)]:\n+        c = int(cnt[i]) % m\n+        tot[i] += Y[i, c]\n+        cnt[i] += 1\n+        evaluated.add(int(i))\n+    used = k0\n+    while used < budget:\n+        have = np.flatnonzero(cnt > 0)\n+        mean = tot[have] / cnt[have]\n+        score = mean + 1.0 * np.sqrt(np.log(used + 1.0) / cnt[have])\n+        pick = int(have[int(np.argmax(score))])\n+        c = int(cnt[pick]) % m\n+        tot[pick] += Y[pick, c]\n+        cnt[pick] += 1\n+        evaluated.add(pick)\n+        used += 1\n+    have = np.flatnonzero(cnt > 0)\n+    problem[\"evaluated\"] = evaluated\n+    problem[\"trace\"] = [int(x) for x in have]\n+    return int(have[int(np.argmax(tot[have] / cnt[have]))])\n",
   "g2_chosen": "balanced",
   "g2_accepted": true
  },
  {
   "seed": 1,
   "chosen": null,
   "accepted": false,
   "source_sha256": "218a05dfcd515414",
   "p0_sha256": "218a05dfcd515414",
   "dev_gain": 0.001588,
   "prediction": {
    "dev_gain": 0.001588,
    "coverage_gain": -0.039062
   },
   "behavioral": false,
   "diagnosis": "selection_failure+allocation_imbalance",
   "diff": "",
   "g2_chosen": null,
   "g2_accepted": false
  },
  {
   "seed": 2,
   "chosen": null,
   "accepted": false,
   "source_sha256": "218a05dfcd515414",
   "p0_sha256": "218a05dfcd515414",
   "dev_gain": -0.132812,
   "prediction": {
    "dev_gain": -0.132812,
    "coverage_gain": -0.037326
   },
   "behavioral": false,
   "diagnosis": "selection_failure+allocation_imbalance",
   "diff": "",
   "g2_chosen": null,
   "g2_accepted": false
  },
  {
   "seed": 3,
   "chosen": "ucb",
   "accepted": true,
   "source_sha256": "3319b2dbae8edb49",
   "p0_sha256": "218a05dfcd515414",
   "dev_gain": 0.234444,
   "prediction": {
    "dev_gain": 0.234444,
    "coverage_gain": -0.159722
   },
   "behavioral": true,
   "diagnosis": "selection_failure+allocation_imbalance",
   "diff": "--- P0.py\n+++ candidate.py\n@@ -36,3 +36,32 @@\n def run(problems, total_budget, rng):\n     budgets = allocate(total_budget, problems)\n     return [select(p, b, rng) for p, b in zip(problems, budgets)]\n+\n+\n+def select(problem, budget, rng):\n+    Y = problem[\"Y\"]\n+    n, m = Y.shape\n+    cnt = np.zeros(n)\n+    tot = np.zeros(n)\n+    evaluated = set()\n+    k0 = min(n, max(2, int(budget) // 3))\n+    for i in [int(x) for x in rng.choice(n, k0, replace=False)]:\n+        c = int(cnt[i]) % m\n+        tot[i] += Y[i, c]\n+        cnt[i] += 1\n+        evaluated.add(int(i))\n+    used = k0\n+    while used < budget:\n+        have = np.flatnonzero(cnt > 0)\n+        mean = tot[have] / cnt[have]\n+        score = mean + 1.0 * np.sqrt(np.log(used + 1.0) / cnt[have])\n+        pick = int(have[int(np.argmax(score))])\n+        c = int(cnt[pick]) % m\n+        tot[pick] += Y[pick, c]\n+        cnt[pick] += 1\n+        evaluated.add(pick)\n+        used += 1\n+    have = np.flatnonzero(cnt > 0)\n+    problem[\"evaluated\"] = evaluated\n+    problem[\"trace\"] = [int(x) for x in have]\n+    return int(have[int(np.argmax(tot[have] / cnt[have]))])\n",
   "g2_chosen": null,
   "g2_accepted": false
  },
  {
   "seed": 4,
   "chosen": "ucb",
   "accepted": true,
   "source_sha256": "3319b2dbae8edb49",
   "p0_sha256": "218a05dfcd515414",
   "dev_gain": 0.07506,
   "prediction": {
    "dev_gain": 0.07506,
    "coverage_gain": -0.159722
   },
   "behavioral": true,
   "diagnosis": "selection_failure+allocation_imbalance",
   "diff": "--- P0.py\n+++ candidate.py\n@@ -36,3 +36,32 @@\n def run(problems, total_budget, rng):\n     budgets = allocate(total_budget, problems)\n     return [select(p, b, rng) for p, b in zip(problems, budgets)]\n+\n+\n+def select(problem, budget, rng):\n+    Y = problem[\"Y\"]\n+    n, m = Y.shape\n+    cnt = np.zeros(n)\n+    tot = np.zeros(n)\n+    evaluated = set()\n+    k0 = min(n, max(2, int(budget) // 3))\n+    for i in [int(x) for x in rng.choice(n, k0, replace=False)]:\n+        c = int(cnt[i]) % m\n+        tot[i] += Y[i, c]\n+        cnt[i] += 1\n+        evaluated.add(int(i))\n+    used = k0\n+    while used < budget:\n+        have = np.flatnonzero(cnt > 0)\n+        mean = tot[have] / cnt[have]\n+        score = mean + 1.0 * np.sqrt(np.log(used + 1.0) / cnt[have])\n+        pick = int(have[int(np.argmax(score))])\n+        c = int(cnt[pick]) % m\n+        tot[pick] += Y[pick, c]\n+        cnt[pick] += 1\n+        evaluated.add(pick)\n+        used += 1\n+    have = np.flatnonzero(cnt > 0)\n+    problem[\"evaluated\"] = evaluated\n+    problem[\"trace\"] = [int(x) for x in have]\n+    return int(have[int(np.argmax(tot[have] / cnt[have]))])\n",
   "g2_chosen": null,
   "g2_accepted": false
  }
 ],
 "H7": {
  "behavioral_source_rate": 0.6,
  "mutant_control": {
   "n": 90,
   "mean_treat": 0.701817,
   "mean_ctrl": 0.662451,
   "mean_diff": 0.039366,
   "ci95": [
    -0.003015,
    0.081747
   ],
   "p_one_sided": 0.03601622912600363,
   "wins": 20,
   "losses": 13,
   "ties": 57,
   "p_sign": 0.1481031842995435,
   "cohen_dz": 0.1919,
   "cluster_ci95": [
    -0.000521,
    0.075
   ]
  },
  "search_control": {
   "n": 90,
   "mean_treat": 0.701817,
   "mean_ctrl": 0.930884,
   "mean_diff": -0.229067,
   "ci95": [
    -0.294982,
    -0.163151
   ],
   "p_one_sided": 0.9999999994497902,
   "wins": 4,
   "losses": 54,
   "ties": 32,
   "p_sign": 0.999999999999887,
   "cohen_dz": -0.718,
   "cluster_ci95": [
    -0.441667,
    -0.050741
   ]
  },
  "note": "the chosen patch must change the chosen actions (behavioral) and beat the mutant and 2x-budget controls",
  "supported": false
 }
}