Add long-rl-20261014-v3_untied-grpo_s0
Browse files- runs/long-rl-20261014-v3_untied-grpo_s0/eval_dev.jsonl +0 -0
- runs/long-rl-20261014-v3_untied-grpo_s0/eval_old_dev.jsonl +0 -0
- runs/long-rl-20261014-v3_untied-grpo_s0/final.pt +3 -0
- runs/long-rl-20261014-v3_untied-grpo_s0/found_targets.jsonl +0 -0
- runs/long-rl-20261014-v3_untied-grpo_s0/lean_gate.jsonl +170 -0
- runs/long-rl-20261014-v3_untied-grpo_s0/pretrain.pt +3 -0
- runs/long-rl-20261014-v3_untied-grpo_s0/source/harness.py +436 -0
- runs/long-rl-20261014-v3_untied-grpo_s0/source/lean_gate.py +82 -0
- runs/long-rl-20261014-v3_untied-grpo_s0/source/lean_tok.py +319 -0
- runs/long-rl-20261014-v3_untied-grpo_s0/source/pretrain.py +871 -0
- runs/long-rl-20261014-v3_untied-grpo_s0/source/remote.sh +27 -0
- runs/long-rl-20261014-v3_untied-grpo_s0/summary.json +0 -0
runs/long-rl-20261014-v3_untied-grpo_s0/eval_dev.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
runs/long-rl-20261014-v3_untied-grpo_s0/eval_old_dev.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
runs/long-rl-20261014-v3_untied-grpo_s0/final.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a55717365ac12ce3cad164d34ce15f09f8f3b6a19b48f94718e7132c1f808f67
|
| 3 |
+
size 38588127
|
runs/long-rl-20261014-v3_untied-grpo_s0/found_targets.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
runs/long-rl-20261014-v3_untied-grpo_s0/lean_gate.jsonl
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"utc": "2026-10-14T20:09:57Z", "samples": 12000, "parse_fail": 4168, "distinct_checked": 7769, "lean_ok": 1217, "lean_rej": 6552, "parse_reasons": {"unbound": 2530, "formula": 895, "name": 166, "expected (": 154, "PR position": 113, "exact not last": 102, "no-eos": 85, "expected )": 51, "expected by": 31, "expected :=": 22, "expected ;": 8, "expected =>": 4, "trailing tokens": 3, "expected .elim": 2, "ORE box": 1, "expected ,": 1}, "lean_wall_s": 25.899222135543823, "lean_proc_s": 489.66762590408325, "workers": 96, "chunk": 400}
|
| 2 |
+
{"utc": "2026-10-14T20:11:24Z", "samples": 11992, "parse_fail": 4079, "distinct_checked": 7829, "lean_ok": 1101, "lean_rej": 6728, "parse_reasons": {"unbound": 2924, "formula": 373, "PR position": 166, "name": 143, "expected (": 138, "exact not last": 117, "no-eos": 83, "expected )": 75, "expected :=": 40, "expected =>": 5, "expected by": 5, "expected ;": 3, "expected None": 3, "trailing tokens": 3, "ORE box": 1}, "lean_wall_s": 23.718323469161987, "lean_proc_s": 462.35239028930664, "workers": 96, "chunk": 400}
|
| 3 |
+
{"utc": "2026-10-14T20:12:46Z", "samples": 11992, "parse_fail": 3938, "distinct_checked": 7979, "lean_ok": 1005, "lean_rej": 6974, "parse_reasons": {"unbound": 2953, "formula": 331, "no-eos": 140, "name": 130, "expected (": 106, "exact not last": 87, "PR position": 75, "expected )": 70, "expected :=": 38, "expected ;": 3, "trailing tokens": 3, "expected None": 1, "expected .elim": 1}, "lean_wall_s": 23.026408195495605, "lean_proc_s": 440.2243778705597, "workers": 96, "chunk": 400}
|
| 4 |
+
{"utc": "2026-10-14T20:14:12Z", "samples": 12016, "parse_fail": 4334, "distinct_checked": 7613, "lean_ok": 675, "lean_rej": 6938, "parse_reasons": {"unbound": 3351, "formula": 230, "no-eos": 199, "expected (": 161, "name": 145, "exact not last": 98, "PR position": 61, "expected )": 55, "expected :=": 21, "trailing tokens": 7, "expected ;": 2, "expected .elim": 1, "ORE box": 1, "eof": 1, "expected =>": 1}, "lean_wall_s": 22.072162628173828, "lean_proc_s": 402.09759998321533, "workers": 96, "chunk": 400}
|
| 5 |
+
{"utc": "2026-10-14T20:15:40Z", "samples": 12008, "parse_fail": 4512, "distinct_checked": 7432, "lean_ok": 262, "lean_rej": 7170, "parse_reasons": {"unbound": 3578, "no-eos": 237, "formula": 196, "name": 136, "expected (": 123, "exact not last": 85, "expected )": 59, "PR position": 56, "expected :=": 21, "trailing tokens": 17, "expected =>": 2, "expected ;": 1, "expected ,": 1}, "lean_wall_s": 26.189969539642334, "lean_proc_s": 477.6323666572571, "workers": 96, "chunk": 400}
|
| 6 |
+
{"utc": "2026-10-14T20:17:09Z", "samples": 12016, "parse_fail": 4308, "distinct_checked": 7636, "lean_ok": 731, "lean_rej": 6905, "parse_reasons": {"unbound": 3385, "no-eos": 234, "formula": 213, "name": 145, "expected (": 88, "exact not last": 72, "expected )": 57, "expected :=": 41, "PR position": 39, "trailing tokens": 25, "expected ;": 4, "ORE box": 3, "expected exact": 1, "expected =>": 1}, "lean_wall_s": 23.945940256118774, "lean_proc_s": 445.5392327308655, "workers": 96, "chunk": 400}
|
| 7 |
+
{"utc": "2026-10-14T20:18:37Z", "samples": 12000, "parse_fail": 4175, "distinct_checked": 7749, "lean_ok": 1125, "lean_rej": 6624, "parse_reasons": {"unbound": 3299, "no-eos": 239, "formula": 199, "name": 136, "exact not last": 86, "expected (": 65, "PR position": 52, "expected :=": 43, "expected )": 37, "trailing tokens": 11, "expected ;": 4, "ORE box": 2, "expected ,": 1, "expected =>": 1}, "lean_wall_s": 23.47976589202881, "lean_proc_s": 454.1050617694855, "workers": 96, "chunk": 400}
|
| 8 |
+
{"utc": "2026-10-14T20:19:46Z", "samples": 12000, "parse_fail": 3842, "distinct_checked": 8082, "lean_ok": 1443, "lean_rej": 6639, "parse_reasons": {"unbound": 3106, "no-eos": 221, "formula": 145, "name": 122, "exact not last": 71, "expected (": 63, "PR position": 38, "expected )": 32, "expected :=": 26, "trailing tokens": 10, "expected ;": 4, "ORE box": 2, "expected =>": 2}, "lean_wall_s": 23.53160858154297, "lean_proc_s": 468.3376820087433, "workers": 96, "chunk": 400}
|
| 9 |
+
{"utc": "2026-10-14T20:21:04Z", "samples": 12000, "parse_fail": 3684, "distinct_checked": 8221, "lean_ok": 1699, "lean_rej": 6522, "parse_reasons": {"unbound": 2918, "no-eos": 245, "formula": 158, "name": 113, "exact not last": 87, "PR position": 47, "expected (": 41, "trailing tokens": 24, "expected )": 24, "expected :=": 17, "expected =>": 7, "ORE box": 1, "expected ;": 1, "expected None": 1}, "lean_wall_s": 21.104041814804077, "lean_proc_s": 431.7828357219696, "workers": 96, "chunk": 400}
|
| 10 |
+
{"utc": "2026-10-14T20:22:38Z", "samples": 12024, "parse_fail": 3572, "distinct_checked": 8370, "lean_ok": 2047, "lean_rej": 6323, "parse_reasons": {"unbound": 2803, "no-eos": 227, "formula": 216, "name": 105, "exact not last": 73, "expected )": 52, "expected (": 40, "PR position": 30, "expected :=": 16, "expected ;": 3, "ORE box": 2, "eof": 1, "expected None": 1, "trailing tokens": 1, "expected :": 1, "expected =>": 1}, "lean_wall_s": 25.858011722564697, "lean_proc_s": 525.2154393196106, "workers": 96, "chunk": 400}
|
| 11 |
+
{"utc": "2026-10-14T20:23:57Z", "samples": 12008, "parse_fail": 3500, "distinct_checked": 8414, "lean_ok": 2317, "lean_rej": 6097, "parse_reasons": {"unbound": 2746, "no-eos": 234, "formula": 181, "name": 127, "exact not last": 67, "expected )": 57, "expected (": 49, "PR position": 20, "expected :=": 6, "expected =>": 6, "expected ;": 3, "ORE box": 3, "expected exact": 1}, "lean_wall_s": 17.426267862319946, "lean_proc_s": 346.4730775356293, "workers": 96, "chunk": 400}
|
| 12 |
+
{"utc": "2026-10-14T20:25:17Z", "samples": 11984, "parse_fail": 3382, "distinct_checked": 8503, "lean_ok": 2573, "lean_rej": 5930, "parse_reasons": {"unbound": 2642, "no-eos": 220, "formula": 149, "name": 104, "exact not last": 89, "expected )": 69, "expected (": 49, "PR position": 27, "expected :=": 17, "expected None": 5, "expected ;": 4, "expected =>": 3, "ORE box": 2, "expected :": 1, "expected exact": 1}, "lean_wall_s": 20.51312804222107, "lean_proc_s": 425.0716645717621, "workers": 96, "chunk": 400}
|
| 13 |
+
{"utc": "2026-10-14T20:26:40Z", "samples": 12000, "parse_fail": 3234, "distinct_checked": 8677, "lean_ok": 2830, "lean_rej": 5847, "parse_reasons": {"unbound": 2500, "no-eos": 237, "name": 141, "formula": 137, "expected )": 72, "expected (": 62, "exact not last": 46, "PR position": 20, "expected :=": 7, "expected ;": 5, "expected =>": 3, "ORE box": 2, "expected exact": 1, "expected None": 1}, "lean_wall_s": 26.411577224731445, "lean_proc_s": 565.3293600082397, "workers": 96, "chunk": 400}
|
| 14 |
+
{"utc": "2026-10-14T20:28:07Z", "samples": 12024, "parse_fail": 3019, "distinct_checked": 8906, "lean_ok": 3133, "lean_rej": 5773, "parse_reasons": {"unbound": 2300, "no-eos": 219, "formula": 162, "name": 95, "exact not last": 77, "expected )": 73, "expected (": 44, "PR position": 18, "expected :=": 18, "expected ;": 5, "expected :": 4, "ORE box": 2, "expected exact": 1, "eof": 1}, "lean_wall_s": 22.635719537734985, "lean_proc_s": 496.43288469314575, "workers": 96, "chunk": 400}
|
| 15 |
+
{"utc": "2026-10-14T20:29:15Z", "samples": 11992, "parse_fail": 2960, "distinct_checked": 8924, "lean_ok": 3356, "lean_rej": 5568, "parse_reasons": {"unbound": 2290, "no-eos": 170, "formula": 129, "name": 101, "exact not last": 76, "expected )": 69, "expected (": 52, "PR position": 25, "expected :=": 25, "expected ;": 9, "ORE box": 8, "expected =>": 3, "expected :": 2, "eof": 1}, "lean_wall_s": 19.45387101173401, "lean_proc_s": 428.93832302093506, "workers": 96, "chunk": 400}
|
| 16 |
+
{"utc": "2026-10-14T20:30:28Z", "samples": 12016, "parse_fail": 2671, "distinct_checked": 9243, "lean_ok": 3603, "lean_rej": 5640, "parse_reasons": {"unbound": 2028, "formula": 146, "no-eos": 141, "name": 102, "expected )": 79, "exact not last": 71, "expected (": 37, "PR position": 23, "expected :=": 20, "expected ;": 9, "expected =>": 9, "ORE box": 4, "expected None": 1, "expected exact": 1}, "lean_wall_s": 25.893638134002686, "lean_proc_s": 587.2551398277283, "workers": 96, "chunk": 400}
|
| 17 |
+
{"utc": "2026-10-14T20:31:50Z", "samples": 11992, "parse_fail": 2480, "distinct_checked": 9395, "lean_ok": 3811, "lean_rej": 5584, "parse_reasons": {"unbound": 1857, "formula": 178, "no-eos": 135, "name": 95, "exact not last": 62, "expected )": 47, "expected (": 44, "PR position": 28, "expected :=": 11, "expected ;": 7, "trailing tokens": 5, "expected None": 5, "ORE box": 4, "expected =>": 2}, "lean_wall_s": 19.31399130821228, "lean_proc_s": 451.3856952190399, "workers": 96, "chunk": 400}
|
| 18 |
+
{"utc": "2026-10-14T20:33:25Z", "samples": 11992, "parse_fail": 2478, "distinct_checked": 9397, "lean_ok": 4015, "lean_rej": 5382, "parse_reasons": {"unbound": 1886, "formula": 152, "no-eos": 125, "name": 112, "exact not last": 50, "expected (": 45, "expected )": 45, "PR position": 29, "expected :=": 13, "expected ;": 9, "trailing tokens": 4, "expected =>": 2, "ORE box": 2, "expected exact": 1, "eof": 1, "expected None": 1, "expected :": 1}, "lean_wall_s": 22.676646947860718, "lean_proc_s": 530.1047801971436, "workers": 96, "chunk": 400}
|
| 19 |
+
{"utc": "2026-10-14T20:34:42Z", "samples": 12000, "parse_fail": 2282, "distinct_checked": 9590, "lean_ok": 4188, "lean_rej": 5402, "parse_reasons": {"unbound": 1703, "formula": 163, "name": 102, "no-eos": 101, "expected )": 78, "exact not last": 50, "expected (": 36, "PR position": 19, "expected :=": 11, "expected ;": 9, "ORE box": 4, "expected =>": 3, "expected None": 2, "expected :": 1}, "lean_wall_s": 23.321382522583008, "lean_proc_s": 534.5874037742615, "workers": 96, "chunk": 400}
|
| 20 |
+
{"utc": "2026-10-14T20:36:13Z", "samples": 12008, "parse_fail": 2327, "distinct_checked": 9537, "lean_ok": 4326, "lean_rej": 5211, "parse_reasons": {"unbound": 1718, "formula": 139, "no-eos": 119, "name": 116, "expected )": 86, "exact not last": 54, "PR position": 35, "expected (": 29, "expected ;": 13, "expected :=": 9, "ORE box": 3, "expected =>": 2, "expected :": 1, "expected False": 1, "expected None": 1, "eof": 1}, "lean_wall_s": 26.079872846603394, "lean_proc_s": 611.7514963150024, "workers": 96, "chunk": 400}
|
| 21 |
+
{"utc": "2026-10-14T20:37:39Z", "samples": 12016, "parse_fail": 2388, "distinct_checked": 9489, "lean_ok": 4389, "lean_rej": 5100, "parse_reasons": {"unbound": 1791, "formula": 117, "name": 110, "no-eos": 105, "expected )": 102, "exact not last": 61, "expected (": 32, "ORE box": 20, "expected :=": 16, "PR position": 15, "expected =>": 9, "expected ;": 7, "expected None": 1, "eof": 1, "expected .elim": 1}, "lean_wall_s": 26.503092288970947, "lean_proc_s": 625.3785450458527, "workers": 96, "chunk": 400}
|
| 22 |
+
{"utc": "2026-10-14T20:39:05Z", "samples": 11976, "parse_fail": 2462, "distinct_checked": 9382, "lean_ok": 4500, "lean_rej": 4882, "parse_reasons": {"unbound": 1825, "formula": 130, "name": 104, "no-eos": 104, "expected )": 92, "exact not last": 73, "expected (": 65, "ORE box": 23, "PR position": 19, "expected :=": 10, "expected ;": 8, "expected =>": 5, "expected None": 3, "trailing tokens": 1}, "lean_wall_s": 25.82015061378479, "lean_proc_s": 605.7932081222534, "workers": 96, "chunk": 400}
|
| 23 |
+
{"utc": "2026-10-14T20:40:31Z", "samples": 11984, "parse_fail": 2281, "distinct_checked": 9583, "lean_ok": 4549, "lean_rej": 5034, "parse_reasons": {"unbound": 1702, "formula": 135, "name": 99, "no-eos": 91, "exact not last": 67, "expected )": 62, "expected (": 59, "PR position": 19, "ORE box": 18, "trailing tokens": 10, "expected :=": 7, "expected =>": 6, "expected ;": 3, "expected None": 2, "expected False": 1}, "lean_wall_s": 28.21295428276062, "lean_proc_s": 650.8571515083313, "workers": 96, "chunk": 400}
|
| 24 |
+
{"utc": "2026-10-14T20:42:00Z", "samples": 11992, "parse_fail": 2391, "distinct_checked": 9481, "lean_ok": 4652, "lean_rej": 4829, "parse_reasons": {"unbound": 1819, "formula": 125, "no-eos": 110, "name": 92, "expected )": 70, "exact not last": 64, "expected (": 50, "PR position": 29, "ORE box": 23, "expected ;": 5, "expected :=": 4}, "lean_wall_s": 26.95016121864319, "lean_proc_s": 636.5018100738525, "workers": 96, "chunk": 400}
|
| 25 |
+
{"utc": "2026-10-14T20:43:22Z", "samples": 12000, "parse_fail": 2317, "distinct_checked": 9552, "lean_ok": 4679, "lean_rej": 4873, "parse_reasons": {"unbound": 1757, "formula": 156, "name": 94, "no-eos": 88, "expected )": 67, "exact not last": 64, "expected (": 22, "PR position": 17, "expected ;": 13, "expected :=": 11, "ORE box": 10, "trailing tokens": 8, "expected =>": 7, "expected None": 1, "expected False": 1, "expected :": 1}, "lean_wall_s": 23.17416286468506, "lean_proc_s": 535.6025533676147, "workers": 96, "chunk": 400}
|
| 26 |
+
{"utc": "2026-10-14T20:44:44Z", "samples": 12000, "parse_fail": 2326, "distinct_checked": 9531, "lean_ok": 4768, "lean_rej": 4763, "parse_reasons": {"unbound": 1690, "formula": 156, "name": 112, "no-eos": 92, "exact not last": 78, "expected )": 72, "PR position": 43, "expected (": 34, "expected :=": 23, "ORE box": 16, "expected ;": 4, "trailing tokens": 3, "expected None": 2, "expected =>": 1}, "lean_wall_s": 20.702407598495483, "lean_proc_s": 487.177348613739, "workers": 96, "chunk": 400}
|
| 27 |
+
{"utc": "2026-10-14T20:46:22Z", "samples": 12000, "parse_fail": 2250, "distinct_checked": 9622, "lean_ok": 4858, "lean_rej": 4764, "parse_reasons": {"unbound": 1633, "formula": 152, "no-eos": 125, "name": 111, "expected )": 71, "exact not last": 58, "PR position": 25, "expected :=": 24, "expected (": 20, "expected ;": 12, "trailing tokens": 8, "ORE box": 6, "expected =>": 3, "expected None": 1, "expected False": 1}, "lean_wall_s": 26.88777256011963, "lean_proc_s": 630.9663329124451, "workers": 96, "chunk": 400}
|
| 28 |
+
{"utc": "2026-10-14T20:47:54Z", "samples": 12016, "parse_fail": 2274, "distinct_checked": 9586, "lean_ok": 4872, "lean_rej": 4714, "parse_reasons": {"unbound": 1699, "no-eos": 107, "name": 107, "formula": 101, "expected )": 79, "exact not last": 65, "PR position": 38, "expected :=": 32, "expected (": 24, "ORE box": 10, "expected ;": 5, "expected None": 2, "expected =>": 2, "trailing tokens": 2, "eof": 1}, "lean_wall_s": 25.528864860534668, "lean_proc_s": 591.9206330776215, "workers": 96, "chunk": 400}
|
| 29 |
+
{"utc": "2026-10-14T20:49:35Z", "samples": 12008, "parse_fail": 2248, "distinct_checked": 9617, "lean_ok": 4914, "lean_rej": 4703, "parse_reasons": {"unbound": 1603, "formula": 128, "no-eos": 115, "name": 113, "expected )": 101, "exact not last": 78, "PR position": 39, "expected (": 38, "ORE box": 13, "expected :=": 11, "expected None": 4, "expected ;": 4, "expected =>": 1}, "lean_wall_s": 27.29756498336792, "lean_proc_s": 636.2182412147522, "workers": 96, "chunk": 400}
|
| 30 |
+
{"utc": "2026-10-14T20:51:16Z", "samples": 12024, "parse_fail": 2191, "distinct_checked": 9690, "lean_ok": 4977, "lean_rej": 4713, "parse_reasons": {"unbound": 1626, "formula": 131, "name": 104, "no-eos": 102, "expected )": 71, "exact not last": 61, "expected (": 35, "PR position": 25, "ORE box": 15, "expected :=": 12, "expected ;": 5, "expected =>": 1, "expected ,": 1, "expected :": 1, "eof": 1}, "lean_wall_s": 27.560036420822144, "lean_proc_s": 664.3764770030975, "workers": 96, "chunk": 400}
|
| 31 |
+
{"utc": "2026-10-14T20:52:56Z", "samples": 11984, "parse_fail": 2270, "distinct_checked": 9580, "lean_ok": 4965, "lean_rej": 4615, "parse_reasons": {"unbound": 1679, "formula": 157, "no-eos": 117, "name": 87, "expected )": 86, "exact not last": 56, "expected (": 33, "PR position": 17, "expected :=": 12, "expected ;": 10, "ORE box": 9, "trailing tokens": 3, "expected =>": 2, "eof": 2}, "lean_wall_s": 31.90582799911499, "lean_proc_s": 748.2100269794464, "workers": 96, "chunk": 400}
|
| 32 |
+
{"utc": "2026-10-14T20:54:37Z", "samples": 11992, "parse_fail": 2269, "distinct_checked": 9586, "lean_ok": 5079, "lean_rej": 4507, "parse_reasons": {"unbound": 1718, "formula": 121, "name": 100, "no-eos": 95, "exact not last": 73, "expected )": 64, "expected :=": 31, "expected (": 21, "ORE box": 15, "expected ;": 13, "PR position": 12, "trailing tokens": 3, "expected =>": 3}, "lean_wall_s": 27.963403940200806, "lean_proc_s": 655.2182397842407, "workers": 96, "chunk": 400}
|
| 33 |
+
{"utc": "2026-10-14T20:56:15Z", "samples": 11992, "parse_fail": 2371, "distinct_checked": 9488, "lean_ok": 5159, "lean_rej": 4329, "parse_reasons": {"unbound": 1745, "formula": 165, "no-eos": 109, "expected )": 108, "name": 98, "exact not last": 65, "expected (": 33, "PR position": 23, "expected :=": 9, "expected ;": 8, "ORE box": 7, "expected None": 1}, "lean_wall_s": 26.547719717025757, "lean_proc_s": 626.8635187149048, "workers": 96, "chunk": 400}
|
| 34 |
+
{"utc": "2026-10-14T20:57:53Z", "samples": 12000, "parse_fail": 2390, "distinct_checked": 9485, "lean_ok": 5221, "lean_rej": 4264, "parse_reasons": {"unbound": 1729, "formula": 147, "name": 117, "expected )": 117, "no-eos": 113, "exact not last": 64, "expected :=": 31, "PR position": 29, "expected (": 18, "ORE box": 13, "expected ;": 11, "expected =>": 1}, "lean_wall_s": 25.604358673095703, "lean_proc_s": 603.1715891361237, "workers": 96, "chunk": 400}
|
| 35 |
+
{"utc": "2026-10-14T20:59:27Z", "samples": 11992, "parse_fail": 2261, "distinct_checked": 9586, "lean_ok": 5249, "lean_rej": 4337, "parse_reasons": {"unbound": 1666, "formula": 141, "expected )": 113, "no-eos": 95, "name": 94, "exact not last": 66, "expected (": 44, "PR position": 14, "expected ;": 10, "ORE box": 9, "expected :=": 5, "expected =>": 2, "eof": 1, "expected None": 1}, "lean_wall_s": 26.965041399002075, "lean_proc_s": 627.33096575737, "workers": 96, "chunk": 400}
|
| 36 |
+
{"utc": "2026-10-14T21:01:12Z", "samples": 12008, "parse_fail": 2198, "distinct_checked": 9647, "lean_ok": 5291, "lean_rej": 4356, "parse_reasons": {"unbound": 1622, "expected )": 124, "no-eos": 112, "formula": 112, "name": 92, "exact not last": 64, "expected (": 33, "PR position": 10, "ORE box": 9, "expected :=": 9, "expected ;": 8, "expected False": 1, "expected =>": 1, "eof": 1}, "lean_wall_s": 27.849985122680664, "lean_proc_s": 652.3303291797638, "workers": 96, "chunk": 400}
|
| 37 |
+
{"utc": "2026-10-14T21:02:44Z", "samples": 12008, "parse_fail": 2167, "distinct_checked": 9676, "lean_ok": 5315, "lean_rej": 4361, "parse_reasons": {"unbound": 1516, "formula": 145, "expected )": 142, "no-eos": 116, "name": 83, "exact not last": 73, "expected (": 46, "PR position": 13, "ORE box": 12, "expected ;": 12, "expected :=": 3, "expected None": 2, "expected =>": 2, "expected exact": 1, "eof": 1}, "lean_wall_s": 27.17712903022766, "lean_proc_s": 650.5435626506805, "workers": 96, "chunk": 400}
|
| 38 |
+
{"utc": "2026-10-14T21:04:18Z", "samples": 12008, "parse_fail": 2109, "distinct_checked": 9748, "lean_ok": 5377, "lean_rej": 4371, "parse_reasons": {"unbound": 1496, "expected )": 155, "formula": 136, "no-eos": 96, "name": 81, "exact not last": 72, "expected (": 33, "PR position": 16, "expected =>": 6, "ORE box": 6, "expected ;": 5, "expected :=": 4, "expected False": 1, "expected None": 1, "expected :": 1}, "lean_wall_s": 25.958377361297607, "lean_proc_s": 629.1870677471161, "workers": 96, "chunk": 400}
|
| 39 |
+
{"utc": "2026-10-14T21:05:55Z", "samples": 12016, "parse_fail": 2058, "distinct_checked": 9810, "lean_ok": 5443, "lean_rej": 4367, "parse_reasons": {"unbound": 1451, "formula": 138, "expected )": 110, "no-eos": 101, "name": 93, "exact not last": 81, "expected (": 51, "PR position": 13, "ORE box": 7, "expected =>": 5, "expected ;": 5, "expected :=": 3}, "lean_wall_s": 26.264113187789917, "lean_proc_s": 643.751701593399, "workers": 96, "chunk": 400}
|
| 40 |
+
{"utc": "2026-10-14T21:07:31Z", "samples": 12024, "parse_fail": 2206, "distinct_checked": 9677, "lean_ok": 5475, "lean_rej": 4202, "parse_reasons": {"unbound": 1527, "formula": 160, "name": 137, "no-eos": 117, "expected )": 97, "exact not last": 65, "expected (": 45, "expected =>": 26, "PR position": 15, "ORE box": 6, "expected :=": 4, "expected ;": 3, "expected exact": 2, "expected None": 1, "expected False": 1}, "lean_wall_s": 27.874884843826294, "lean_proc_s": 662.1535770893097, "workers": 96, "chunk": 400}
|
| 41 |
+
{"utc": "2026-10-14T21:09:17Z", "samples": 11984, "parse_fail": 2270, "distinct_checked": 9554, "lean_ok": 5520, "lean_rej": 4034, "parse_reasons": {"unbound": 1596, "formula": 154, "no-eos": 121, "expected )": 107, "name": 103, "exact not last": 68, "expected (": 54, "expected =>": 21, "PR position": 20, "expected :=": 10, "expected ;": 7, "ORE box": 4, "expected None": 3, "expected .elim": 1, "expected False": 1}, "lean_wall_s": 25.065842390060425, "lean_proc_s": 587.4415602684021, "workers": 96, "chunk": 400}
|
| 42 |
+
{"utc": "2026-10-14T21:10:47Z", "samples": 11992, "parse_fail": 2180, "distinct_checked": 9663, "lean_ok": 5578, "lean_rej": 4085, "parse_reasons": {"unbound": 1637, "formula": 140, "name": 95, "no-eos": 94, "expected )": 66, "exact not last": 57, "expected (": 45, "PR position": 13, "expected :=": 10, "expected =>": 8, "ORE box": 5, "expected None": 4, "trailing tokens": 3, "expected exact": 2, "expected ;": 1}, "lean_wall_s": 27.832992553710938, "lean_proc_s": 664.2822291851044, "workers": 96, "chunk": 400}
|
| 43 |
+
{"utc": "2026-10-14T21:12:29Z", "samples": 11992, "parse_fail": 2092, "distinct_checked": 9753, "lean_ok": 5683, "lean_rej": 4070, "parse_reasons": {"unbound": 1528, "formula": 149, "no-eos": 121, "expected )": 76, "name": 68, "exact not last": 47, "expected (": 43, "PR position": 18, "expected ;": 16, "trailing tokens": 6, "ORE box": 5, "expected :=": 5, "expected =>": 5, "expected None": 3, "expected exact": 1, "eof": 1}, "lean_wall_s": 28.59545612335205, "lean_proc_s": 693.6329770088196, "workers": 96, "chunk": 400}
|
| 44 |
+
{"utc": "2026-10-14T21:14:05Z", "samples": 11992, "parse_fail": 2420, "distinct_checked": 9422, "lean_ok": 5716, "lean_rej": 3706, "parse_reasons": {"unbound": 1829, "expected )": 133, "no-eos": 116, "formula": 112, "name": 92, "exact not last": 50, "expected (": 33, "PR position": 30, "expected :=": 11, "expected ;": 6, "expected =>": 4, "expected exact": 3, "ORE box": 1}, "lean_wall_s": 28.47995138168335, "lean_proc_s": 673.6968758106232, "workers": 96, "chunk": 400}
|
| 45 |
+
{"utc": "2026-10-14T21:15:42Z", "samples": 11992, "parse_fail": 2336, "distinct_checked": 9502, "lean_ok": 5741, "lean_rej": 3761, "parse_reasons": {"unbound": 1743, "formula": 160, "no-eos": 110, "expected )": 90, "name": 88, "exact not last": 57, "expected (": 35, "expected ;": 25, "PR position": 12, "ORE box": 5, "expected =>": 5, "expected None": 3, "expected exact": 2, "expected :=": 1}, "lean_wall_s": 25.941174745559692, "lean_proc_s": 615.2026739120483, "workers": 96, "chunk": 400}
|
| 46 |
+
{"utc": "2026-10-14T21:17:12Z", "samples": 12000, "parse_fail": 2178, "distinct_checked": 9664, "lean_ok": 5828, "lean_rej": 3836, "parse_reasons": {"unbound": 1651, "formula": 135, "no-eos": 98, "name": 95, "expected )": 52, "exact not last": 48, "expected (": 48, "PR position": 15, "expected ;": 14, "trailing tokens": 9, "ORE box": 6, "expected exact": 2, "expected =>": 2, "expected None": 2, "expected :=": 1}, "lean_wall_s": 20.375157594680786, "lean_proc_s": 483.46306920051575, "workers": 96, "chunk": 400}
|
| 47 |
+
{"utc": "2026-10-14T21:18:40Z", "samples": 12008, "parse_fail": 2173, "distinct_checked": 9681, "lean_ok": 5821, "lean_rej": 3860, "parse_reasons": {"unbound": 1589, "formula": 132, "no-eos": 122, "expected )": 111, "name": 99, "exact not last": 50, "PR position": 26, "expected (": 16, "expected ;": 11, "expected =>": 4, "expected :=": 4, "trailing tokens": 3, "expected exact": 2, "ORE box": 2, "eof": 1, "expected None": 1}, "lean_wall_s": 20.173993587493896, "lean_proc_s": 485.1020052433014, "workers": 96, "chunk": 400}
|
| 48 |
+
{"utc": "2026-10-14T21:20:10Z", "samples": 12008, "parse_fail": 2394, "distinct_checked": 9454, "lean_ok": 5858, "lean_rej": 3596, "parse_reasons": {"unbound": 1741, "no-eos": 146, "expected )": 130, "formula": 123, "name": 99, "expected (": 47, "exact not last": 38, "PR position": 26, "expected ;": 16, "expected :=": 9, "ORE box": 7, "expected exact": 5, "expected =>": 5, "eof": 1, "expected None": 1}, "lean_wall_s": 20.8448269367218, "lean_proc_s": 490.91973757743835, "workers": 96, "chunk": 400}
|
| 49 |
+
{"utc": "2026-10-14T21:21:51Z", "samples": 12008, "parse_fail": 2242, "distinct_checked": 9600, "lean_ok": 5861, "lean_rej": 3739, "parse_reasons": {"unbound": 1663, "no-eos": 113, "formula": 112, "expected )": 97, "name": 84, "exact not last": 58, "expected (": 52, "PR position": 20, "expected ;": 19, "expected exact": 7, "expected :=": 6, "ORE box": 4, "expected =>": 3, "eof": 2, "expected None": 1, "expected by": 1}, "lean_wall_s": 31.556702852249146, "lean_proc_s": 735.8777132034302, "workers": 96, "chunk": 400}
|
| 50 |
+
{"utc": "2026-10-14T21:23:34Z", "samples": 12008, "parse_fail": 2169, "distinct_checked": 9659, "lean_ok": 6006, "lean_rej": 3653, "parse_reasons": {"unbound": 1595, "no-eos": 123, "formula": 97, "expected )": 91, "name": 88, "exact not last": 58, "expected (": 51, "expected ;": 22, "PR position": 21, "expected =>": 10, "expected :=": 5, "ORE box": 4, "expected None": 2, "expected False": 1, "expected exact": 1}, "lean_wall_s": 30.758761167526245, "lean_proc_s": 731.6647448539734, "workers": 96, "chunk": 400}
|
| 51 |
+
{"utc": "2026-10-14T21:25:20Z", "samples": 12024, "parse_fail": 2077, "distinct_checked": 9787, "lean_ok": 6064, "lean_rej": 3723, "parse_reasons": {"unbound": 1496, "formula": 118, "no-eos": 117, "expected )": 94, "name": 84, "exact not last": 60, "expected (": 48, "PR position": 33, "expected ;": 15, "expected =>": 5, "ORE box": 2, "trailing tokens": 2, "expected None": 1, "expected False": 1, "expected exact": 1}, "lean_wall_s": 32.80461072921753, "lean_proc_s": 805.7388834953308, "workers": 96, "chunk": 400}
|
| 52 |
+
{"utc": "2026-10-14T21:27:02Z", "samples": 12024, "parse_fail": 2017, "distinct_checked": 9837, "lean_ok": 5978, "lean_rej": 3859, "parse_reasons": {"unbound": 1426, "formula": 143, "no-eos": 108, "name": 90, "expected )": 71, "expected (": 54, "exact not last": 41, "trailing tokens": 24, "expected ;": 23, "expected =>": 15, "PR position": 13, "ORE box": 3, "expected :=": 2, "expected None": 1, "eof": 1, "expected exact": 1, "expected .elim": 1}, "lean_wall_s": 31.462103366851807, "lean_proc_s": 772.0671081542969, "workers": 96, "chunk": 400}
|
| 53 |
+
{"utc": "2026-10-14T21:28:33Z", "samples": 11984, "parse_fail": 2059, "distinct_checked": 9761, "lean_ok": 6100, "lean_rej": 3661, "parse_reasons": {"unbound": 1480, "formula": 131, "expected )": 93, "no-eos": 92, "name": 85, "expected (": 67, "exact not last": 49, "PR position": 21, "expected =>": 15, "ORE box": 14, "expected ;": 6, "expected :=": 2, "expected exact": 1, "eof": 1, "expected False": 1, "expected None": 1}, "lean_wall_s": 32.867095947265625, "lean_proc_s": 802.4571447372437, "workers": 96, "chunk": 400}
|
| 54 |
+
{"utc": "2026-10-14T21:30:16Z", "samples": 11984, "parse_fail": 2318, "distinct_checked": 9506, "lean_ok": 6100, "lean_rej": 3406, "parse_reasons": {"unbound": 1532, "formula": 180, "expected )": 166, "no-eos": 105, "name": 100, "PR position": 62, "expected (": 58, "exact not last": 54, "expected =>": 29, "expected ;": 13, "ORE box": 11, "expected :=": 6, "eof": 2}, "lean_wall_s": 29.696063995361328, "lean_proc_s": 702.0444524288177, "workers": 96, "chunk": 400}
|
| 55 |
+
{"utc": "2026-10-14T21:31:50Z", "samples": 11992, "parse_fail": 2267, "distinct_checked": 9571, "lean_ok": 6160, "lean_rej": 3411, "parse_reasons": {"unbound": 1597, "expected )": 163, "no-eos": 115, "name": 97, "formula": 88, "exact not last": 67, "expected (": 47, "PR position": 35, "expected =>": 19, "expected ;": 16, "expected :=": 11, "ORE box": 7, "expected exact": 2, "expected \u27e9": 1, "expected None": 1, "eof": 1}, "lean_wall_s": 31.973193883895874, "lean_proc_s": 751.1371581554413, "workers": 96, "chunk": 400}
|
| 56 |
+
{"utc": "2026-10-14T21:33:38Z", "samples": 11984, "parse_fail": 2370, "distinct_checked": 9469, "lean_ok": 6195, "lean_rej": 3274, "parse_reasons": {"unbound": 1678, "expected )": 177, "no-eos": 143, "formula": 109, "name": 106, "expected (": 58, "exact not last": 44, "PR position": 25, "expected :=": 13, "ORE box": 8, "expected ;": 7, "expected exact": 1, "eof": 1}, "lean_wall_s": 30.150190830230713, "lean_proc_s": 717.9495434761047, "workers": 96, "chunk": 400}
|
| 57 |
+
{"utc": "2026-10-14T21:35:25Z", "samples": 11992, "parse_fail": 2303, "distinct_checked": 9547, "lean_ok": 6220, "lean_rej": 3327, "parse_reasons": {"unbound": 1573, "expected )": 193, "no-eos": 152, "name": 117, "formula": 102, "exact not last": 65, "expected (": 45, "PR position": 34, "ORE box": 6, "expected ;": 6, "expected :=": 4, "expected =>": 2, "expected exact": 2, "expected False": 1, "expected None": 1}, "lean_wall_s": 29.54671335220337, "lean_proc_s": 700.4575655460358, "workers": 96, "chunk": 400}
|
| 58 |
+
{"utc": "2026-10-14T21:37:09Z", "samples": 11992, "parse_fail": 2460, "distinct_checked": 9380, "lean_ok": 6245, "lean_rej": 3135, "parse_reasons": {"unbound": 1690, "expected )": 246, "no-eos": 167, "formula": 108, "name": 103, "exact not last": 63, "expected (": 44, "expected ;": 14, "PR position": 13, "ORE box": 4, "expected :=": 4, "expected exact": 1, "expected fun": 1, "expected \u27e9": 1, "expected =>": 1}, "lean_wall_s": 25.500520944595337, "lean_proc_s": 600.47731590271, "workers": 96, "chunk": 400}
|
| 59 |
+
{"utc": "2026-10-14T21:38:49Z", "samples": 11992, "parse_fail": 2411, "distinct_checked": 9443, "lean_ok": 6241, "lean_rej": 3202, "parse_reasons": {"unbound": 1785, "expected )": 161, "no-eos": 129, "name": 95, "formula": 87, "exact not last": 57, "expected (": 47, "PR position": 20, "expected ;": 11, "ORE box": 7, "expected :=": 6, "expected None": 2, "trailing tokens": 2, "expected exact": 1, "expected =>": 1}, "lean_wall_s": 29.4754319190979, "lean_proc_s": 699.5321316719055, "workers": 96, "chunk": 400}
|
| 60 |
+
{"utc": "2026-10-14T21:40:21Z", "samples": 12000, "parse_fail": 2332, "distinct_checked": 9483, "lean_ok": 6269, "lean_rej": 3214, "parse_reasons": {"unbound": 1657, "formula": 174, "expected )": 150, "no-eos": 111, "name": 86, "expected (": 44, "exact not last": 43, "trailing tokens": 19, "PR position": 18, "expected ;": 14, "ORE box": 9, "expected exact": 2, "expected None": 2, "expected =>": 2, "expected :": 1}, "lean_wall_s": 30.84562587738037, "lean_proc_s": 733.7741339206696, "workers": 96, "chunk": 400}
|
| 61 |
+
{"utc": "2026-10-14T21:41:58Z", "samples": 11992, "parse_fail": 2310, "distinct_checked": 9527, "lean_ok": 6315, "lean_rej": 3212, "parse_reasons": {"unbound": 1667, "expected )": 158, "formula": 111, "no-eos": 98, "name": 96, "expected (": 62, "exact not last": 53, "PR position": 34, "trailing tokens": 8, "expected :=": 6, "expected None": 4, "expected ;": 4, "ORE box": 4, "expected exact": 4, "eof": 1}, "lean_wall_s": 29.044689416885376, "lean_proc_s": 687.0257651805878, "workers": 96, "chunk": 400}
|
| 62 |
+
{"utc": "2026-10-14T21:43:31Z", "samples": 12000, "parse_fail": 2305, "distinct_checked": 9533, "lean_ok": 6270, "lean_rej": 3263, "parse_reasons": {"unbound": 1707, "expected )": 158, "no-eos": 113, "name": 103, "formula": 80, "exact not last": 55, "expected (": 46, "PR position": 19, "expected :=": 10, "expected ;": 9, "expected exact": 2, "ORE box": 1, "trailing tokens": 1, "eof": 1}, "lean_wall_s": 25.61898159980774, "lean_proc_s": 603.0217487812042, "workers": 96, "chunk": 400}
|
| 63 |
+
{"utc": "2026-10-14T21:45:00Z", "samples": 12008, "parse_fail": 2413, "distinct_checked": 9431, "lean_ok": 6334, "lean_rej": 3097, "parse_reasons": {"unbound": 1747, "expected )": 162, "name": 128, "no-eos": 108, "formula": 106, "expected (": 66, "exact not last": 46, "PR position": 22, "expected ;": 10, "expected :=": 7, "ORE box": 4, "expected exact": 3, "expected :": 2, "expected =>": 2}, "lean_wall_s": 25.22343111038208, "lean_proc_s": 591.373673915863, "workers": 96, "chunk": 400}
|
| 64 |
+
{"utc": "2026-10-14T21:46:23Z", "samples": 12008, "parse_fail": 2439, "distinct_checked": 9424, "lean_ok": 6367, "lean_rej": 3057, "parse_reasons": {"unbound": 1886, "formula": 157, "name": 103, "no-eos": 102, "expected )": 100, "expected (": 36, "exact not last": 32, "PR position": 11, "expected ;": 5, "ORE box": 3, "eof": 2, "expected :=": 1, "expected =>": 1}, "lean_wall_s": 19.95714783668518, "lean_proc_s": 471.4890546798706, "workers": 96, "chunk": 400}
|
| 65 |
+
{"utc": "2026-10-14T21:47:59Z", "samples": 12008, "parse_fail": 2251, "distinct_checked": 9586, "lean_ok": 6372, "lean_rej": 3214, "parse_reasons": {"unbound": 1613, "name": 132, "expected )": 130, "formula": 111, "no-eos": 106, "expected (": 80, "exact not last": 41, "PR position": 13, "expected ;": 8, "expected :=": 5, "expected exact": 3, "expected =>": 3, "expected None": 2, "trailing tokens": 2, "ORE box": 2}, "lean_wall_s": 27.581908702850342, "lean_proc_s": 648.9683327674866, "workers": 96, "chunk": 400}
|
| 66 |
+
{"utc": "2026-10-14T21:49:30Z", "samples": 12008, "parse_fail": 2295, "distinct_checked": 9562, "lean_ok": 6386, "lean_rej": 3176, "parse_reasons": {"unbound": 1740, "name": 121, "formula": 107, "expected )": 104, "no-eos": 92, "expected (": 50, "exact not last": 50, "PR position": 18, "ORE box": 4, "expected ;": 4, "expected None": 2, "expected :=": 2, "expected exact": 1}, "lean_wall_s": 27.780021905899048, "lean_proc_s": 651.0408689975739, "workers": 96, "chunk": 400}
|
| 67 |
+
{"utc": "2026-10-14T21:50:55Z", "samples": 12008, "parse_fail": 2307, "distinct_checked": 9527, "lean_ok": 6423, "lean_rej": 3104, "parse_reasons": {"unbound": 1717, "formula": 134, "name": 110, "no-eos": 94, "expected )": 83, "expected (": 81, "exact not last": 55, "PR position": 14, "expected :=": 6, "expected ;": 5, "expected None": 3, "ORE box": 2, "eof": 2, "expected exact": 1}, "lean_wall_s": 21.069489240646362, "lean_proc_s": 487.037526845932, "workers": 96, "chunk": 400}
|
| 68 |
+
{"utc": "2026-10-14T21:52:25Z", "samples": 12008, "parse_fail": 2327, "distinct_checked": 9507, "lean_ok": 6404, "lean_rej": 3103, "parse_reasons": {"unbound": 1712, "formula": 130, "expected )": 116, "name": 115, "no-eos": 92, "expected (": 67, "exact not last": 51, "PR position": 30, "expected ;": 5, "ORE box": 3, "expected None": 2, "expected :=": 2, "expected exact": 1, "trailing tokens": 1}, "lean_wall_s": 23.891263008117676, "lean_proc_s": 561.821634054184, "workers": 96, "chunk": 400}
|
| 69 |
+
{"utc": "2026-10-14T21:53:49Z", "samples": 12016, "parse_fail": 2317, "distinct_checked": 9527, "lean_ok": 6408, "lean_rej": 3119, "parse_reasons": {"unbound": 1691, "name": 134, "expected )": 112, "formula": 106, "no-eos": 93, "expected (": 70, "exact not last": 53, "PR position": 26, "expected ;": 11, "expected :=": 10, "ORE box": 5, "expected exact": 2, "expected =>": 2, "expected False": 1, "expected None": 1}, "lean_wall_s": 24.956759214401245, "lean_proc_s": 586.9852478504181, "workers": 96, "chunk": 400}
|
| 70 |
+
{"utc": "2026-10-14T21:55:24Z", "samples": 12016, "parse_fail": 2167, "distinct_checked": 9696, "lean_ok": 6486, "lean_rej": 3210, "parse_reasons": {"unbound": 1598, "name": 124, "expected )": 123, "formula": 112, "no-eos": 91, "exact not last": 52, "expected (": 39, "PR position": 14, "expected ;": 7, "expected :=": 4, "ORE box": 2, "expected False": 1}, "lean_wall_s": 25.49229335784912, "lean_proc_s": 613.5245180130005, "workers": 96, "chunk": 400}
|
| 71 |
+
{"utc": "2026-10-14T21:56:56Z", "samples": 12008, "parse_fail": 2308, "distinct_checked": 9544, "lean_ok": 6474, "lean_rej": 3070, "parse_reasons": {"unbound": 1760, "expected )": 144, "formula": 101, "name": 98, "no-eos": 94, "expected (": 42, "exact not last": 37, "PR position": 11, "expected :=": 8, "expected ;": 7, "expected None": 3, "ORE box": 2, "expected exact": 1}, "lean_wall_s": 28.256895542144775, "lean_proc_s": 669.8958902359009, "workers": 96, "chunk": 400}
|
| 72 |
+
{"utc": "2026-10-14T21:58:20Z", "samples": 11984, "parse_fail": 2576, "distinct_checked": 9254, "lean_ok": 6023, "lean_rej": 3231, "parse_reasons": {"unbound": 1870, "expected )": 201, "formula": 126, "name": 121, "no-eos": 92, "expected (": 81, "exact not last": 51, "PR position": 13, "expected ;": 7, "expected =>": 4, "ORE box": 3, "expected None": 2, "expected :=": 2, "expected fun": 1, "expected exact": 1, "eof": 1}, "lean_wall_s": 23.031874656677246, "lean_proc_s": 526.430853843689, "workers": 96, "chunk": 400}
|
| 73 |
+
{"utc": "2026-10-14T21:59:55Z", "samples": 11984, "parse_fail": 2378, "distinct_checked": 9427, "lean_ok": 5969, "lean_rej": 3458, "parse_reasons": {"unbound": 1765, "expected )": 132, "name": 129, "formula": 106, "no-eos": 101, "expected (": 76, "exact not last": 38, "PR position": 11, "expected :=": 8, "expected ;": 5, "expected None": 2, "expected exact": 1, "expected =>": 1, "ORE box": 1, "expected by": 1, "eof": 1}, "lean_wall_s": 28.427818298339844, "lean_proc_s": 670.1405205726624, "workers": 96, "chunk": 400}
|
| 74 |
+
{"utc": "2026-10-14T22:01:21Z", "samples": 11984, "parse_fail": 2539, "distinct_checked": 9292, "lean_ok": 6027, "lean_rej": 3265, "parse_reasons": {"unbound": 1885, "expected )": 171, "name": 126, "formula": 107, "no-eos": 95, "expected (": 75, "exact not last": 50, "expected :=": 15, "PR position": 9, "expected ;": 3, "ORE box": 2, "expected None": 1}, "lean_wall_s": 29.09805464744568, "lean_proc_s": 673.2343544960022, "workers": 96, "chunk": 400}
|
| 75 |
+
{"utc": "2026-10-14T22:03:00Z", "samples": 11984, "parse_fail": 2569, "distinct_checked": 9253, "lean_ok": 6036, "lean_rej": 3217, "parse_reasons": {"unbound": 1852, "expected )": 186, "name": 138, "formula": 131, "no-eos": 104, "expected (": 60, "exact not last": 60, "PR position": 22, "expected ;": 8, "ORE box": 4, "expected :=": 2, "eof": 1, "expected None": 1}, "lean_wall_s": 30.043668746948242, "lean_proc_s": 685.1592583656311, "workers": 96, "chunk": 400}
|
| 76 |
+
{"utc": "2026-10-14T22:04:34Z", "samples": 11992, "parse_fail": 2668, "distinct_checked": 9173, "lean_ok": 5999, "lean_rej": 3174, "parse_reasons": {"unbound": 1997, "formula": 164, "expected )": 136, "name": 136, "no-eos": 102, "expected (": 68, "exact not last": 47, "ORE box": 6, "expected ;": 5, "PR position": 5, "expected None": 2}, "lean_wall_s": 27.48456072807312, "lean_proc_s": 622.5182929039001, "workers": 96, "chunk": 400}
|
| 77 |
+
{"utc": "2026-10-14T22:06:08Z", "samples": 11992, "parse_fail": 2495, "distinct_checked": 9347, "lean_ok": 6067, "lean_rej": 3280, "parse_reasons": {"unbound": 1847, "formula": 162, "name": 132, "expected )": 106, "no-eos": 102, "expected (": 56, "exact not last": 52, "PR position": 13, "expected ;": 12, "expected :=": 4, "ORE box": 3, "trailing tokens": 2, "expected None": 2, "expected fun": 1, "expected False": 1}, "lean_wall_s": 26.89565348625183, "lean_proc_s": 624.102379322052, "workers": 96, "chunk": 400}
|
| 78 |
+
{"utc": "2026-10-14T22:07:42Z", "samples": 11992, "parse_fail": 2359, "distinct_checked": 9469, "lean_ok": 6039, "lean_rej": 3430, "parse_reasons": {"unbound": 1729, "name": 134, "formula": 129, "expected )": 120, "no-eos": 88, "expected (": 77, "exact not last": 52, "expected ;": 12, "PR position": 9, "expected None": 2, "expected exact": 2, "eof": 2, "ORE box": 1, "expected :=": 1, "expected False": 1}, "lean_wall_s": 25.20472764968872, "lean_proc_s": 596.4047560691833, "workers": 96, "chunk": 400}
|
| 79 |
+
{"utc": "2026-10-14T22:09:05Z", "samples": 11992, "parse_fail": 2508, "distinct_checked": 9327, "lean_ok": 6068, "lean_rej": 3259, "parse_reasons": {"unbound": 1897, "name": 134, "formula": 123, "expected )": 112, "no-eos": 89, "expected (": 76, "exact not last": 52, "PR position": 13, "expected ;": 4, "expected None": 2, "ORE box": 2, "expected =>": 2, "trailing tokens": 1, "expected :=": 1}, "lean_wall_s": 25.382673501968384, "lean_proc_s": 585.5407574176788, "workers": 96, "chunk": 400}
|
| 80 |
+
{"utc": "2026-10-14T22:10:44Z", "samples": 11992, "parse_fail": 2378, "distinct_checked": 9450, "lean_ok": 6059, "lean_rej": 3391, "parse_reasons": {"unbound": 1783, "name": 125, "formula": 119, "expected )": 111, "no-eos": 86, "expected (": 67, "exact not last": 48, "PR position": 13, "expected ;": 12, "trailing tokens": 4, "expected :=": 4, "ORE box": 2, "expected None": 2, "eof": 2}, "lean_wall_s": 27.173335552215576, "lean_proc_s": 643.1946277618408, "workers": 96, "chunk": 400}
|
| 81 |
+
{"utc": "2026-10-14T22:12:10Z", "samples": 11992, "parse_fail": 2331, "distinct_checked": 9494, "lean_ok": 6134, "lean_rej": 3360, "parse_reasons": {"unbound": 1699, "formula": 158, "name": 130, "expected (": 92, "expected )": 90, "no-eos": 73, "exact not last": 49, "PR position": 14, "expected ;": 14, "expected :=": 4, "ORE box": 3, "expected False": 2, "expected =>": 1, "expected exact": 1, "expected None": 1}, "lean_wall_s": 27.167165279388428, "lean_proc_s": 639.7873821258545, "workers": 96, "chunk": 400}
|
| 82 |
+
{"utc": "2026-10-14T22:13:35Z", "samples": 11992, "parse_fail": 2271, "distinct_checked": 9567, "lean_ok": 6114, "lean_rej": 3453, "parse_reasons": {"unbound": 1707, "name": 132, "no-eos": 94, "formula": 92, "expected )": 86, "expected (": 76, "exact not last": 37, "PR position": 14, "expected ;": 14, "expected :=": 8, "ORE box": 6, "expected exact": 2, "expected False": 2, "expected =>": 1}, "lean_wall_s": 27.267072439193726, "lean_proc_s": 644.1354551315308, "workers": 96, "chunk": 400}
|
| 83 |
+
{"utc": "2026-10-14T22:15:09Z", "samples": 12000, "parse_fail": 2416, "distinct_checked": 9435, "lean_ok": 6129, "lean_rej": 3306, "parse_reasons": {"unbound": 1827, "formula": 141, "expected )": 107, "name": 104, "no-eos": 81, "expected (": 52, "exact not last": 43, "expected ;": 27, "PR position": 18, "expected :=": 9, "ORE box": 3, "expected exact": 2, "eof": 1, "expected None": 1}, "lean_wall_s": 28.01153588294983, "lean_proc_s": 661.2045247554779, "workers": 96, "chunk": 400}
|
| 84 |
+
{"utc": "2026-10-14T22:16:37Z", "samples": 11992, "parse_fail": 2272, "distinct_checked": 9556, "lean_ok": 6211, "lean_rej": 3345, "parse_reasons": {"unbound": 1637, "formula": 159, "name": 111, "expected )": 104, "no-eos": 81, "expected (": 67, "exact not last": 60, "expected ;": 23, "PR position": 12, "trailing tokens": 6, "ORE box": 5, "expected :=": 2, "expected None": 1, "expected False": 1, "expected exact": 1, "expected =>": 1, "eof": 1}, "lean_wall_s": 27.655733346939087, "lean_proc_s": 650.1741392612457, "workers": 96, "chunk": 400}
|
| 85 |
+
{"utc": "2026-10-14T22:18:08Z", "samples": 12008, "parse_fail": 2231, "distinct_checked": 9637, "lean_ok": 6267, "lean_rej": 3370, "parse_reasons": {"unbound": 1537, "expected )": 186, "formula": 168, "name": 104, "no-eos": 94, "exact not last": 55, "expected (": 47, "PR position": 21, "expected ;": 8, "ORE box": 4, "eof": 3, "expected None": 1, "expected =>": 1, "expected :=": 1, "trailing tokens": 1}, "lean_wall_s": 27.91726326942444, "lean_proc_s": 661.8555037975311, "workers": 96, "chunk": 400}
|
| 86 |
+
{"utc": "2026-10-14T22:19:44Z", "samples": 12008, "parse_fail": 1974, "distinct_checked": 9856, "lean_ok": 6274, "lean_rej": 3582, "parse_reasons": {"unbound": 1369, "formula": 152, "expected )": 117, "name": 115, "no-eos": 74, "exact not last": 44, "trailing tokens": 40, "expected (": 36, "expected ;": 12, "PR position": 9, "ORE box": 5, "expected =>": 1}, "lean_wall_s": 29.69005060195923, "lean_proc_s": 733.1396479606628, "workers": 96, "chunk": 400}
|
| 87 |
+
{"utc": "2026-10-14T22:21:23Z", "samples": 12000, "parse_fail": 1763, "distinct_checked": 10068, "lean_ok": 6485, "lean_rej": 3583, "parse_reasons": {"unbound": 1144, "formula": 127, "expected )": 115, "no-eos": 115, "name": 103, "expected (": 61, "exact not last": 40, "PR position": 33, "expected ;": 19, "ORE box": 4, "expected :=": 1, "expected None": 1}, "lean_wall_s": 32.664477586746216, "lean_proc_s": 807.732339143753, "workers": 96, "chunk": 400}
|
| 88 |
+
{"utc": "2026-10-14T22:22:57Z", "samples": 12000, "parse_fail": 1809, "distinct_checked": 10023, "lean_ok": 6657, "lean_rej": 3366, "parse_reasons": {"unbound": 1119, "expected )": 228, "formula": 135, "name": 118, "no-eos": 87, "exact not last": 40, "expected (": 32, "expected ;": 15, "PR position": 14, "expected =>": 6, "ORE box": 4, "trailing tokens": 3, "expected .elim": 3, "expected None": 2, "expected :=": 2, "expected by": 1}, "lean_wall_s": 31.974695682525635, "lean_proc_s": 781.5453209877014, "workers": 96, "chunk": 400}
|
| 89 |
+
{"utc": "2026-10-14T22:24:33Z", "samples": 11984, "parse_fail": 2078, "distinct_checked": 9766, "lean_ok": 6194, "lean_rej": 3572, "parse_reasons": {"unbound": 1264, "trailing tokens": 179, "expected )": 135, "formula": 132, "name": 117, "no-eos": 103, "exact not last": 65, "expected (": 41, "expected ;": 13, "PR position": 12, "ORE box": 10, "expected exact": 3, "expected None": 1, "expected .elim": 1, "eof": 1, "expected :=": 1}, "lean_wall_s": 25.7009015083313, "lean_proc_s": 625.4599142074585, "workers": 96, "chunk": 400}
|
| 90 |
+
{"utc": "2026-10-14T22:26:08Z", "samples": 11992, "parse_fail": 2091, "distinct_checked": 9755, "lean_ok": 6278, "lean_rej": 3477, "parse_reasons": {"unbound": 1263, "expected )": 297, "formula": 143, "name": 126, "no-eos": 102, "exact not last": 62, "expected (": 59, "expected ;": 14, "PR position": 14, "ORE box": 9, "expected None": 2}, "lean_wall_s": 26.781551837921143, "lean_proc_s": 654.197863817215, "workers": 96, "chunk": 400}
|
| 91 |
+
{"utc": "2026-10-14T22:27:36Z", "samples": 12008, "parse_fail": 1830, "distinct_checked": 10012, "lean_ok": 6199, "lean_rej": 3813, "parse_reasons": {"unbound": 1127, "expected )": 177, "formula": 138, "name": 120, "no-eos": 95, "expected (": 59, "exact not last": 56, "expected :=": 21, "expected ;": 17, "PR position": 7, "ORE box": 5, "expected exact": 4, "expected None": 2, "eof": 1, "trailing tokens": 1}, "lean_wall_s": 26.52012825012207, "lean_proc_s": 646.9113850593567, "workers": 96, "chunk": 400}
|
| 92 |
+
{"utc": "2026-10-14T22:29:02Z", "samples": 11992, "parse_fail": 1852, "distinct_checked": 9991, "lean_ok": 6213, "lean_rej": 3778, "parse_reasons": {"unbound": 1166, "expected )": 160, "formula": 141, "name": 133, "no-eos": 93, "exact not last": 52, "expected (": 46, "expected ;": 31, "PR position": 15, "expected :=": 7, "trailing tokens": 3, "expected None": 2, "ORE box": 2, "expected exact": 1}, "lean_wall_s": 26.94020438194275, "lean_proc_s": 653.1738102436066, "workers": 96, "chunk": 400}
|
| 93 |
+
{"utc": "2026-10-14T22:30:24Z", "samples": 12008, "parse_fail": 2093, "distinct_checked": 9763, "lean_ok": 5892, "lean_rej": 3871, "parse_reasons": {"unbound": 1301, "expected )": 259, "formula": 143, "name": 139, "no-eos": 104, "expected (": 50, "exact not last": 39, "expected ;": 28, "PR position": 17, "expected :=": 7, "ORE box": 2, "expected =>": 2, "expected None": 1, "trailing tokens": 1}, "lean_wall_s": 26.44663095474243, "lean_proc_s": 636.3849940299988, "workers": 96, "chunk": 400}
|
| 94 |
+
{"utc": "2026-10-14T22:31:59Z", "samples": 12024, "parse_fail": 2022, "distinct_checked": 9858, "lean_ok": 5860, "lean_rej": 3998, "parse_reasons": {"unbound": 1302, "expected )": 157, "formula": 152, "name": 125, "no-eos": 102, "expected (": 77, "exact not last": 56, "expected ;": 20, "PR position": 13, "ORE box": 8, "expected :=": 4, "trailing tokens": 2, "expected None": 2, "expected =>": 1, "expected fun": 1}, "lean_wall_s": 27.645519495010376, "lean_proc_s": 676.1658310890198, "workers": 96, "chunk": 400}
|
| 95 |
+
{"utc": "2026-10-14T22:33:24Z", "samples": 11992, "parse_fail": 1893, "distinct_checked": 9952, "lean_ok": 5569, "lean_rej": 4383, "parse_reasons": {"unbound": 1246, "expected )": 152, "name": 122, "no-eos": 94, "formula": 88, "exact not last": 78, "expected (": 64, "expected ;": 16, "PR position": 12, "expected exact": 9, "trailing tokens": 5, "expected :=": 4, "ORE box": 2, "expected False": 1}, "lean_wall_s": 25.097898960113525, "lean_proc_s": 612.7628240585327, "workers": 96, "chunk": 400}
|
| 96 |
+
{"utc": "2026-10-14T22:34:50Z", "samples": 12000, "parse_fail": 2251, "distinct_checked": 9590, "lean_ok": 5299, "lean_rej": 4291, "parse_reasons": {"unbound": 1397, "expected )": 297, "formula": 148, "name": 132, "no-eos": 112, "exact not last": 56, "expected (": 50, "expected ;": 23, "expected exact": 12, "PR position": 11, "expected :=": 5, "trailing tokens": 2, "expected None": 2, "ORE box": 2, "expected =>": 1, "expected False": 1}, "lean_wall_s": 27.71550965309143, "lean_proc_s": 651.0970411300659, "workers": 96, "chunk": 400}
|
| 97 |
+
{"utc": "2026-10-14T22:36:20Z", "samples": 12008, "parse_fail": 2148, "distinct_checked": 9714, "lean_ok": 5157, "lean_rej": 4557, "parse_reasons": {"unbound": 1343, "expected )": 181, "name": 178, "formula": 107, "no-eos": 106, "expected (": 66, "exact not last": 62, "expected exact": 33, "expected ;": 27, "PR position": 17, "ORE box": 15, "trailing tokens": 6, "expected :=": 3, "expected None": 1, "expected fun": 1, "expected =>": 1, "eof": 1}, "lean_wall_s": 23.323671102523804, "lean_proc_s": 560.8518600463867, "workers": 96, "chunk": 400}
|
| 98 |
+
{"utc": "2026-10-14T22:37:51Z", "samples": 11984, "parse_fail": 1961, "distinct_checked": 9890, "lean_ok": 5077, "lean_rej": 4813, "parse_reasons": {"unbound": 1190, "name": 185, "expected )": 152, "formula": 151, "no-eos": 96, "exact not last": 46, "expected (": 45, "expected ;": 33, "trailing tokens": 26, "expected exact": 23, "PR position": 8, "ORE box": 2, "expected :=": 2, "eof": 1, "expected False": 1}, "lean_wall_s": 28.17161726951599, "lean_proc_s": 692.0480282306671, "workers": 96, "chunk": 400}
|
| 99 |
+
{"utc": "2026-10-14T22:39:23Z", "samples": 11992, "parse_fail": 2209, "distinct_checked": 9632, "lean_ok": 4872, "lean_rej": 4760, "parse_reasons": {"unbound": 1360, "expected )": 206, "name": 163, "formula": 143, "no-eos": 126, "exact not last": 63, "expected (": 59, "expected ;": 33, "expected exact": 30, "ORE box": 10, "PR position": 6, "expected :=": 6, "expected None": 3, "trailing tokens": 1}, "lean_wall_s": 23.92076587677002, "lean_proc_s": 565.3661906719208, "workers": 96, "chunk": 400}
|
| 100 |
+
{"utc": "2026-10-14T22:40:50Z", "samples": 11992, "parse_fail": 2374, "distinct_checked": 9494, "lean_ok": 4745, "lean_rej": 4749, "parse_reasons": {"unbound": 1410, "expected )": 262, "name": 204, "formula": 125, "no-eos": 124, "exact not last": 95, "expected (": 70, "expected ;": 34, "expected exact": 29, "PR position": 13, "ORE box": 5, "expected fun": 1, "trailing tokens": 1, "expected :=": 1}, "lean_wall_s": 26.76303768157959, "lean_proc_s": 626.8147611618042, "workers": 96, "chunk": 400}
|
| 101 |
+
{"utc": "2026-10-14T22:42:23Z", "samples": 11992, "parse_fail": 2261, "distinct_checked": 9592, "lean_ok": 4685, "lean_rej": 4907, "parse_reasons": {"unbound": 1441, "name": 180, "expected )": 173, "formula": 110, "no-eos": 108, "expected (": 81, "exact not last": 69, "expected exact": 34, "expected ;": 27, "PR position": 16, "ORE box": 7, "trailing tokens": 7, "expected :=": 4, "expected =>": 3, "expected None": 1}, "lean_wall_s": 26.65763783454895, "lean_proc_s": 617.8226144313812, "workers": 96, "chunk": 400}
|
| 102 |
+
{"utc": "2026-10-14T22:43:45Z", "samples": 12008, "parse_fail": 2375, "distinct_checked": 9503, "lean_ok": 4654, "lean_rej": 4849, "parse_reasons": {"unbound": 1544, "expected )": 214, "name": 196, "formula": 122, "no-eos": 104, "exact not last": 73, "expected (": 47, "expected exact": 32, "expected ;": 21, "PR position": 15, "ORE box": 2, "expected :=": 2, "expected None": 1, "trailing tokens": 1, "expected =>": 1}, "lean_wall_s": 26.455332040786743, "lean_proc_s": 617.5499365329742, "workers": 96, "chunk": 400}
|
| 103 |
+
{"utc": "2026-10-14T22:45:12Z", "samples": 12008, "parse_fail": 2259, "distinct_checked": 9597, "lean_ok": 4552, "lean_rej": 5045, "parse_reasons": {"unbound": 1410, "expected )": 234, "name": 171, "formula": 115, "no-eos": 105, "exact not last": 92, "expected (": 72, "expected ;": 24, "PR position": 15, "expected exact": 10, "expected :=": 5, "ORE box": 4, "eof": 1, "expected None": 1}, "lean_wall_s": 28.62271785736084, "lean_proc_s": 673.6834053993225, "workers": 96, "chunk": 400}
|
| 104 |
+
{"utc": "2026-10-14T22:46:42Z", "samples": 12008, "parse_fail": 2391, "distinct_checked": 9486, "lean_ok": 4557, "lean_rej": 4929, "parse_reasons": {"unbound": 1488, "expected )": 230, "name": 219, "exact not last": 105, "no-eos": 102, "formula": 95, "expected (": 71, "PR position": 27, "expected :=": 23, "expected ;": 21, "expected exact": 3, "expected None": 3, "ORE box": 2, "expected fun": 1, "expected =>": 1}, "lean_wall_s": 27.128578186035156, "lean_proc_s": 642.9656145572662, "workers": 96, "chunk": 400}
|
| 105 |
+
{"utc": "2026-10-14T22:48:09Z", "samples": 12000, "parse_fail": 2309, "distinct_checked": 9554, "lean_ok": 4526, "lean_rej": 5028, "parse_reasons": {"unbound": 1522, "expected )": 176, "name": 156, "formula": 117, "no-eos": 96, "exact not last": 92, "expected (": 68, "PR position": 33, "expected ;": 23, "expected :=": 17, "ORE box": 5, "expected exact": 2, "expected None": 1, "expected =>": 1}, "lean_wall_s": 30.596632957458496, "lean_proc_s": 722.1738317012787, "workers": 96, "chunk": 400}
|
| 106 |
+
{"utc": "2026-10-14T22:49:35Z", "samples": 12008, "parse_fail": 2255, "distinct_checked": 9614, "lean_ok": 4523, "lean_rej": 5091, "parse_reasons": {"unbound": 1421, "expected )": 217, "name": 145, "formula": 127, "no-eos": 112, "expected (": 73, "exact not last": 68, "PR position": 32, "expected ;": 29, "expected :=": 22, "ORE box": 5, "expected exact": 2, "expected None": 1, "expected =>": 1}, "lean_wall_s": 29.62581753730774, "lean_proc_s": 700.4540174007416, "workers": 96, "chunk": 400}
|
| 107 |
+
{"utc": "2026-10-14T22:51:03Z", "samples": 12008, "parse_fail": 2321, "distinct_checked": 9544, "lean_ok": 4500, "lean_rej": 5044, "parse_reasons": {"unbound": 1510, "expected )": 180, "name": 157, "formula": 110, "no-eos": 105, "expected (": 100, "exact not last": 70, "PR position": 41, "expected ;": 35, "expected :=": 7, "ORE box": 4, "expected exact": 1, "expected None": 1}, "lean_wall_s": 29.792757987976074, "lean_proc_s": 703.0759348869324, "workers": 96, "chunk": 400}
|
| 108 |
+
{"utc": "2026-10-14T22:52:32Z", "samples": 12008, "parse_fail": 2239, "distinct_checked": 9623, "lean_ok": 4513, "lean_rej": 5110, "parse_reasons": {"unbound": 1428, "name": 177, "expected )": 148, "formula": 136, "no-eos": 100, "expected (": 86, "exact not last": 73, "expected ;": 27, "PR position": 25, "expected :=": 16, "ORE box": 14, "trailing tokens": 4, "expected exact": 3, "expected =>": 1, "expected None": 1}, "lean_wall_s": 27.727168798446655, "lean_proc_s": 660.4511694908142, "workers": 96, "chunk": 400}
|
| 109 |
+
{"utc": "2026-10-14T22:54:02Z", "samples": 12016, "parse_fail": 2221, "distinct_checked": 9642, "lean_ok": 4506, "lean_rej": 5136, "parse_reasons": {"unbound": 1437, "name": 175, "formula": 133, "expected )": 118, "no-eos": 110, "expected (": 78, "exact not last": 76, "expected :=": 30, "PR position": 29, "expected ;": 17, "trailing tokens": 12, "ORE box": 3, "expected by": 1, "expected =>": 1, "expected fun": 1}, "lean_wall_s": 26.823585987091064, "lean_proc_s": 635.0606343746185, "workers": 96, "chunk": 400}
|
| 110 |
+
{"utc": "2026-10-14T22:55:22Z", "samples": 12008, "parse_fail": 2369, "distinct_checked": 9531, "lean_ok": 4534, "lean_rej": 4997, "parse_reasons": {"unbound": 1531, "expected )": 214, "name": 193, "formula": 124, "no-eos": 90, "expected (": 77, "exact not last": 74, "PR position": 27, "expected ;": 25, "ORE box": 6, "expected :=": 4, "trailing tokens": 2, "expected None": 1, "eof": 1}, "lean_wall_s": 26.80534791946411, "lean_proc_s": 634.6311254501343, "workers": 96, "chunk": 400}
|
| 111 |
+
{"utc": "2026-10-14T22:56:41Z", "samples": 12016, "parse_fail": 2419, "distinct_checked": 9472, "lean_ok": 4532, "lean_rej": 4940, "parse_reasons": {"unbound": 1538, "name": 203, "expected )": 192, "formula": 134, "expected (": 111, "no-eos": 97, "exact not last": 65, "PR position": 36, "expected ;": 26, "expected :=": 10, "ORE box": 3, "expected exact": 1, "expected None": 1, "expected False": 1, "trailing tokens": 1}, "lean_wall_s": 26.802114009857178, "lean_proc_s": 630.3221938610077, "workers": 96, "chunk": 400}
|
| 112 |
+
{"utc": "2026-10-14T22:58:02Z", "samples": 12016, "parse_fail": 2315, "distinct_checked": 9557, "lean_ok": 4527, "lean_rej": 5030, "parse_reasons": {"unbound": 1489, "name": 185, "expected )": 175, "formula": 126, "no-eos": 110, "expected (": 90, "exact not last": 56, "PR position": 36, "expected ;": 24, "expected :=": 18, "ORE box": 3, "trailing tokens": 2, "expected fun": 1}, "lean_wall_s": 25.939996480941772, "lean_proc_s": 613.3566524982452, "workers": 96, "chunk": 400}
|
| 113 |
+
{"utc": "2026-10-14T22:59:31Z", "samples": 12008, "parse_fail": 2517, "distinct_checked": 9350, "lean_ok": 4515, "lean_rej": 4835, "parse_reasons": {"unbound": 1532, "expected )": 255, "name": 224, "formula": 168, "no-eos": 109, "expected (": 86, "exact not last": 74, "PR position": 35, "expected ;": 20, "expected :=": 10, "expected None": 1, "ORE box": 1, "expected =>": 1, "eof": 1}, "lean_wall_s": 26.77546191215515, "lean_proc_s": 624.6659529209137, "workers": 96, "chunk": 400}
|
| 114 |
+
{"utc": "2026-10-14T23:01:00Z", "samples": 12008, "parse_fail": 2471, "distinct_checked": 9400, "lean_ok": 4524, "lean_rej": 4876, "parse_reasons": {"unbound": 1537, "expected )": 237, "name": 197, "formula": 153, "no-eos": 109, "expected (": 87, "exact not last": 66, "PR position": 39, "expected ;": 25, "expected :=": 14, "expected None": 3, "ORE box": 2, "eof": 1, "expected =>": 1}, "lean_wall_s": 29.19335961341858, "lean_proc_s": 687.0242283344269, "workers": 96, "chunk": 400}
|
| 115 |
+
{"utc": "2026-10-14T23:02:32Z", "samples": 12016, "parse_fail": 2472, "distinct_checked": 9417, "lean_ok": 4512, "lean_rej": 4905, "parse_reasons": {"unbound": 1532, "expected )": 240, "name": 219, "expected (": 143, "formula": 110, "no-eos": 98, "exact not last": 64, "PR position": 29, "expected ;": 23, "expected :=": 7, "ORE box": 5, "expected None": 2}, "lean_wall_s": 25.749471187591553, "lean_proc_s": 603.5210554599762, "workers": 96, "chunk": 400}
|
| 116 |
+
{"utc": "2026-10-14T23:03:53Z", "samples": 12008, "parse_fail": 2652, "distinct_checked": 9223, "lean_ok": 4519, "lean_rej": 4704, "parse_reasons": {"unbound": 1698, "expected )": 219, "name": 198, "formula": 158, "expected (": 127, "no-eos": 105, "exact not last": 75, "expected ;": 28, "PR position": 24, "expected :=": 9, "trailing tokens": 5, "ORE box": 2, "expected ,": 1, "expected None": 1, "eof": 1, "expected =>": 1}, "lean_wall_s": 26.60149598121643, "lean_proc_s": 601.1522743701935, "workers": 96, "chunk": 400}
|
| 117 |
+
{"utc": "2026-10-14T23:05:19Z", "samples": 12008, "parse_fail": 2545, "distinct_checked": 9329, "lean_ok": 4522, "lean_rej": 4807, "parse_reasons": {"unbound": 1598, "expected )": 215, "name": 203, "formula": 149, "no-eos": 104, "expected (": 100, "exact not last": 99, "expected ;": 36, "PR position": 22, "expected :=": 7, "trailing tokens": 5, "ORE box": 5, "expected None": 1, "eof": 1}, "lean_wall_s": 26.862579345703125, "lean_proc_s": 622.9800028800964, "workers": 96, "chunk": 400}
|
| 118 |
+
{"utc": "2026-10-14T23:06:46Z", "samples": 12016, "parse_fail": 2563, "distinct_checked": 9319, "lean_ok": 4559, "lean_rej": 4760, "parse_reasons": {"unbound": 1562, "expected )": 281, "name": 200, "formula": 136, "expected (": 119, "no-eos": 104, "exact not last": 96, "PR position": 22, "expected ;": 21, "expected :=": 17, "expected None": 3, "ORE box": 1, "expected =>": 1}, "lean_wall_s": 27.940216302871704, "lean_proc_s": 650.3209438323975, "workers": 96, "chunk": 400}
|
| 119 |
+
{"utc": "2026-10-14T23:08:09Z", "samples": 12016, "parse_fail": 2884, "distinct_checked": 9005, "lean_ok": 4554, "lean_rej": 4451, "parse_reasons": {"unbound": 1821, "expected )": 338, "name": 247, "formula": 127, "expected (": 102, "no-eos": 91, "exact not last": 86, "expected ;": 34, "PR position": 24, "ORE box": 7, "expected :=": 4, "expected exact": 1, "eof": 1, "expected None": 1}, "lean_wall_s": 25.883225202560425, "lean_proc_s": 584.8352739810944, "workers": 96, "chunk": 400}
|
| 120 |
+
{"utc": "2026-10-14T23:09:34Z", "samples": 12016, "parse_fail": 2672, "distinct_checked": 9202, "lean_ok": 4513, "lean_rej": 4689, "parse_reasons": {"unbound": 1740, "expected )": 267, "name": 181, "expected (": 115, "formula": 111, "no-eos": 96, "exact not last": 86, "PR position": 31, "expected ;": 23, "expected :=": 18, "ORE box": 1, "eof": 1, "expected None": 1, "expected =>": 1}, "lean_wall_s": 29.28572106361389, "lean_proc_s": 664.8952186107635, "workers": 96, "chunk": 400}
|
| 121 |
+
{"utc": "2026-10-14T23:10:54Z", "samples": 12016, "parse_fail": 2519, "distinct_checked": 9366, "lean_ok": 4558, "lean_rej": 4808, "parse_reasons": {"unbound": 1688, "name": 167, "expected )": 147, "expected (": 140, "formula": 132, "no-eos": 97, "exact not last": 82, "expected ;": 40, "PR position": 14, "expected :=": 4, "ORE box": 2, "expected None": 2, "expected exact": 1, "expected False": 1, "expected =>": 1, "trailing tokens": 1}, "lean_wall_s": 26.489450693130493, "lean_proc_s": 622.354743719101, "workers": 96, "chunk": 400}
|
| 122 |
+
{"utc": "2026-10-14T23:12:11Z", "samples": 12024, "parse_fail": 2485, "distinct_checked": 9405, "lean_ok": 4560, "lean_rej": 4845, "parse_reasons": {"unbound": 1646, "name": 193, "expected )": 167, "formula": 127, "expected (": 112, "no-eos": 98, "exact not last": 75, "expected ;": 33, "PR position": 22, "expected :=": 8, "ORE box": 1, "expected None": 1, "expected exact": 1, "trailing tokens": 1}, "lean_wall_s": 29.21339440345764, "lean_proc_s": 685.4741690158844, "workers": 96, "chunk": 400}
|
| 123 |
+
{"utc": "2026-10-14T23:13:37Z", "samples": 12016, "parse_fail": 2419, "distinct_checked": 9461, "lean_ok": 4573, "lean_rej": 4888, "parse_reasons": {"unbound": 1600, "name": 194, "expected )": 136, "formula": 123, "no-eos": 103, "exact not last": 97, "expected (": 91, "expected ;": 38, "PR position": 21, "trailing tokens": 5, "expected =>": 4, "expected :=": 4, "ORE box": 2, "expected exact": 1}, "lean_wall_s": 26.631606578826904, "lean_proc_s": 630.4642424583435, "workers": 96, "chunk": 400}
|
| 124 |
+
{"utc": "2026-10-14T23:15:00Z", "samples": 12016, "parse_fail": 2561, "distinct_checked": 9313, "lean_ok": 4579, "lean_rej": 4734, "parse_reasons": {"unbound": 1708, "name": 183, "formula": 179, "expected )": 142, "expected (": 111, "no-eos": 105, "exact not last": 72, "expected ;": 26, "expected :=": 16, "PR position": 13, "expected =>": 3, "expected None": 2, "eof": 1}, "lean_wall_s": 26.207833290100098, "lean_proc_s": 607.7456455230713, "workers": 96, "chunk": 400}
|
| 125 |
+
{"utc": "2026-10-14T23:16:31Z", "samples": 12016, "parse_fail": 2503, "distinct_checked": 9371, "lean_ok": 4601, "lean_rej": 4770, "parse_reasons": {"unbound": 1673, "expected )": 204, "name": 162, "formula": 131, "expected (": 113, "no-eos": 107, "exact not last": 64, "expected ;": 26, "PR position": 15, "expected exact": 3, "expected =>": 2, "expected fun": 1, "expected :=": 1, "trailing tokens": 1}, "lean_wall_s": 25.455918312072754, "lean_proc_s": 591.953099489212, "workers": 96, "chunk": 400}
|
| 126 |
+
{"utc": "2026-10-14T23:17:52Z", "samples": 11976, "parse_fail": 2701, "distinct_checked": 9146, "lean_ok": 4582, "lean_rej": 4564, "parse_reasons": {"unbound": 1766, "expected )": 222, "name": 181, "formula": 146, "exact not last": 104, "expected (": 103, "no-eos": 99, "expected ;": 35, "PR position": 17, "expected :=": 10, "expected =>": 6, "ORE box": 5, "expected exact": 3, "trailing tokens": 2, "eof": 1, "expected None": 1}, "lean_wall_s": 26.038540601730347, "lean_proc_s": 590.6472454071045, "workers": 96, "chunk": 400}
|
| 127 |
+
{"utc": "2026-10-14T23:19:12Z", "samples": 11984, "parse_fail": 2818, "distinct_checked": 9044, "lean_ok": 4566, "lean_rej": 4478, "parse_reasons": {"unbound": 1857, "expected )": 265, "name": 185, "expected (": 119, "formula": 104, "no-eos": 96, "exact not last": 73, "expected ;": 72, "PR position": 28, "ORE box": 9, "expected :=": 6, "expected exact": 2, "expected None": 1, "expected =>": 1}, "lean_wall_s": 25.631471872329712, "lean_proc_s": 583.5457720756531, "workers": 96, "chunk": 400}
|
| 128 |
+
{"utc": "2026-10-14T23:20:42Z", "samples": 11984, "parse_fail": 2560, "distinct_checked": 9268, "lean_ok": 4543, "lean_rej": 4725, "parse_reasons": {"unbound": 1638, "expected )": 207, "name": 206, "no-eos": 111, "formula": 111, "expected (": 95, "exact not last": 74, "expected ;": 70, "PR position": 27, "expected exact": 4, "trailing tokens": 4, "ORE box": 3, "expected :=": 2, "expected fun": 2, "expected None": 2, "eof": 2, "expected =>": 1, "expected False": 1}, "lean_wall_s": 28.035094022750854, "lean_proc_s": 644.9748585224152, "workers": 96, "chunk": 400}
|
| 129 |
+
{"utc": "2026-10-14T23:22:09Z", "samples": 11984, "parse_fail": 2571, "distinct_checked": 9274, "lean_ok": 4580, "lean_rej": 4694, "parse_reasons": {"unbound": 1674, "name": 231, "expected )": 166, "no-eos": 113, "expected (": 112, "formula": 91, "exact not last": 68, "expected ;": 59, "PR position": 23, "trailing tokens": 12, "ORE box": 11, "expected :=": 3, "expected None": 2, "expected fun": 2, "expected =>": 2, "expected \u27e9": 1, "expected exact": 1}, "lean_wall_s": 27.311538696289062, "lean_proc_s": 627.5497841835022, "workers": 96, "chunk": 400}
|
| 130 |
+
{"utc": "2026-10-14T23:23:35Z", "samples": 11984, "parse_fail": 2451, "distinct_checked": 9420, "lean_ok": 4673, "lean_rej": 4747, "parse_reasons": {"unbound": 1553, "name": 205, "expected )": 201, "formula": 124, "no-eos": 119, "exact not last": 67, "expected (": 64, "expected ;": 63, "PR position": 27, "expected :=": 13, "ORE box": 6, "expected =>": 4, "trailing tokens": 3, "expected fun": 2}, "lean_wall_s": 25.5584077835083, "lean_proc_s": 602.0439114570618, "workers": 96, "chunk": 400}
|
| 131 |
+
{"utc": "2026-10-14T23:24:59Z", "samples": 11992, "parse_fail": 2418, "distinct_checked": 9426, "lean_ok": 4658, "lean_rej": 4768, "parse_reasons": {"unbound": 1560, "name": 246, "expected )": 192, "no-eos": 110, "formula": 95, "expected (": 76, "expected ;": 51, "exact not last": 50, "PR position": 19, "ORE box": 8, "expected :=": 7, "expected None": 1, "trailing tokens": 1, "expected =>": 1, "expected exact": 1}, "lean_wall_s": 28.440274953842163, "lean_proc_s": 672.029182434082, "workers": 96, "chunk": 400}
|
| 132 |
+
{"utc": "2026-10-14T23:26:23Z", "samples": 11992, "parse_fail": 2397, "distinct_checked": 9440, "lean_ok": 4653, "lean_rej": 4787, "parse_reasons": {"unbound": 1521, "name": 245, "expected )": 189, "no-eos": 112, "formula": 108, "exact not last": 67, "expected ;": 59, "expected (": 52, "expected :=": 22, "PR position": 18, "expected None": 1, "expected .elim": 1, "trailing tokens": 1, "eof": 1}, "lean_wall_s": 26.212934970855713, "lean_proc_s": 620.6580047607422, "workers": 96, "chunk": 400}
|
| 133 |
+
{"utc": "2026-10-14T23:27:44Z", "samples": 11992, "parse_fail": 2574, "distinct_checked": 9286, "lean_ok": 4605, "lean_rej": 4681, "parse_reasons": {"unbound": 1620, "name": 265, "expected )": 196, "no-eos": 126, "expected (": 116, "formula": 96, "expected ;": 58, "exact not last": 54, "PR position": 27, "expected :=": 6, "ORE box": 4, "expected =>": 2, "expected ,": 1, "expected exact": 1, "expected fun": 1, "expected None": 1}, "lean_wall_s": 27.011820077896118, "lean_proc_s": 626.3505640029907, "workers": 96, "chunk": 400}
|
| 134 |
+
{"utc": "2026-10-14T23:29:14Z", "samples": 11992, "parse_fail": 2626, "distinct_checked": 9212, "lean_ok": 4611, "lean_rej": 4601, "parse_reasons": {"unbound": 1634, "name": 265, "expected )": 235, "formula": 161, "no-eos": 110, "expected (": 84, "exact not last": 55, "expected ;": 48, "PR position": 13, "expected :=": 11, "ORE box": 7, "expected None": 2, "expected =>": 1}, "lean_wall_s": 26.10718274116516, "lean_proc_s": 592.3210887908936, "workers": 96, "chunk": 400}
|
| 135 |
+
{"utc": "2026-10-14T23:30:47Z", "samples": 11992, "parse_fail": 2818, "distinct_checked": 9047, "lean_ok": 4644, "lean_rej": 4403, "parse_reasons": {"unbound": 1684, "expected )": 336, "name": 269, "formula": 153, "no-eos": 125, "expected (": 86, "expected ;": 64, "exact not last": 56, "ORE box": 20, "PR position": 14, "expected :=": 7, "eof": 2, "expected None": 2}, "lean_wall_s": 23.755842447280884, "lean_proc_s": 537.8088755607605, "workers": 96, "chunk": 400}
|
| 136 |
+
{"utc": "2026-10-14T23:32:15Z", "samples": 11992, "parse_fail": 2743, "distinct_checked": 9085, "lean_ok": 4670, "lean_rej": 4415, "parse_reasons": {"unbound": 1677, "expected )": 281, "name": 271, "formula": 173, "no-eos": 126, "expected (": 75, "exact not last": 66, "expected ;": 42, "PR position": 11, "expected :=": 10, "ORE box": 7, "eof": 2, "expected =>": 1, "expected fun": 1}, "lean_wall_s": 25.68881368637085, "lean_proc_s": 583.1284356117249, "workers": 96, "chunk": 400}
|
| 137 |
+
{"utc": "2026-10-14T23:33:50Z", "samples": 11992, "parse_fail": 2729, "distinct_checked": 9132, "lean_ok": 4711, "lean_rej": 4421, "parse_reasons": {"unbound": 1702, "name": 290, "expected )": 262, "no-eos": 125, "formula": 124, "exact not last": 66, "expected (": 63, "expected ;": 39, "PR position": 32, "ORE box": 13, "expected :=": 9, "expected =>": 2, "expected None": 2}, "lean_wall_s": 26.572371244430542, "lean_proc_s": 605.381377696991, "workers": 96, "chunk": 400}
|
| 138 |
+
{"utc": "2026-10-14T23:35:17Z", "samples": 11992, "parse_fail": 2813, "distinct_checked": 9034, "lean_ok": 4686, "lean_rej": 4348, "parse_reasons": {"unbound": 1794, "name": 282, "expected )": 209, "formula": 168, "no-eos": 105, "expected (": 92, "exact not last": 82, "expected ;": 35, "PR position": 21, "ORE box": 15, "expected :=": 3, "expected None": 3, "expected =>": 3, "eof": 1}, "lean_wall_s": 25.924399614334106, "lean_proc_s": 578.8839406967163, "workers": 96, "chunk": 400}
|
| 139 |
+
{"utc": "2026-10-14T23:36:57Z", "samples": 12000, "parse_fail": 2860, "distinct_checked": 9004, "lean_ok": 4699, "lean_rej": 4305, "parse_reasons": {"unbound": 1721, "name": 280, "expected )": 270, "formula": 184, "no-eos": 162, "exact not last": 77, "expected (": 74, "expected ;": 56, "PR position": 13, "ORE box": 10, "expected =>": 4, "expected :=": 4, "expected None": 3, "expected fun": 1, "eof": 1}, "lean_wall_s": 24.95562481880188, "lean_proc_s": 560.418271780014, "workers": 96, "chunk": 400}
|
| 140 |
+
{"utc": "2026-10-14T23:38:37Z", "samples": 12000, "parse_fail": 2993, "distinct_checked": 8865, "lean_ok": 4673, "lean_rej": 4192, "parse_reasons": {"unbound": 1822, "name": 324, "expected )": 267, "formula": 164, "no-eos": 148, "expected (": 95, "exact not last": 83, "expected ;": 38, "PR position": 20, "ORE box": 13, "expected =>": 8, "expected :=": 5, "expected exact": 2, "expected hh": 1, "eof": 1, "expected None": 1, "expected fun": 1}, "lean_wall_s": 26.094975233078003, "lean_proc_s": 578.2310495376587, "workers": 96, "chunk": 400}
|
| 141 |
+
{"utc": "2026-10-14T23:40:18Z", "samples": 12008, "parse_fail": 2792, "distinct_checked": 9083, "lean_ok": 4723, "lean_rej": 4360, "parse_reasons": {"unbound": 1652, "name": 276, "expected )": 249, "formula": 180, "no-eos": 140, "expected (": 100, "exact not last": 83, "expected ;": 66, "PR position": 21, "ORE box": 10, "expected =>": 10, "expected :=": 3, "expected None": 1, "expected fun": 1}, "lean_wall_s": 25.052749633789062, "lean_proc_s": 565.9450135231018, "workers": 96, "chunk": 400}
|
| 142 |
+
{"utc": "2026-10-14T23:42:01Z", "samples": 11992, "parse_fail": 2909, "distinct_checked": 8929, "lean_ok": 4713, "lean_rej": 4216, "parse_reasons": {"unbound": 1732, "name": 309, "expected )": 282, "no-eos": 154, "formula": 129, "exact not last": 94, "expected (": 81, "expected ;": 64, "PR position": 26, "ORE box": 13, "expected =>": 12, "expected :=": 7, "expected None": 2, "eof": 2, "expected False": 1, "expected fun": 1}, "lean_wall_s": 27.547568559646606, "lean_proc_s": 616.5428717136383, "workers": 96, "chunk": 400}
|
| 143 |
+
{"utc": "2026-10-14T23:43:37Z", "samples": 11992, "parse_fail": 3004, "distinct_checked": 8844, "lean_ok": 4652, "lean_rej": 4192, "parse_reasons": {"unbound": 1770, "name": 314, "expected )": 285, "formula": 182, "no-eos": 161, "exact not last": 99, "expected (": 83, "expected ;": 74, "PR position": 25, "ORE box": 5, "expected =>": 3, "expected None": 2, "expected :=": 1}, "lean_wall_s": 26.29518151283264, "lean_proc_s": 577.6344797611237, "workers": 96, "chunk": 400}
|
| 144 |
+
{"utc": "2026-10-14T23:45:05Z", "samples": 12000, "parse_fail": 3074, "distinct_checked": 8777, "lean_ok": 4689, "lean_rej": 4088, "parse_reasons": {"unbound": 1857, "name": 331, "expected )": 322, "formula": 127, "no-eos": 126, "exact not last": 99, "expected ;": 85, "expected (": 69, "ORE box": 23, "PR position": 18, "expected =>": 10, "expected :=": 5, "expected None": 1, "expected False": 1}, "lean_wall_s": 25.23004460334778, "lean_proc_s": 548.9311594963074, "workers": 96, "chunk": 400}
|
| 145 |
+
{"utc": "2026-10-14T23:46:40Z", "samples": 12000, "parse_fail": 3133, "distinct_checked": 8701, "lean_ok": 4663, "lean_rej": 4038, "parse_reasons": {"unbound": 1859, "expected )": 348, "name": 317, "no-eos": 135, "formula": 133, "expected ;": 124, "exact not last": 105, "expected (": 68, "PR position": 19, "expected =>": 10, "ORE box": 8, "expected :=": 6, "eof": 1}, "lean_wall_s": 24.742947340011597, "lean_proc_s": 537.4835600852966, "workers": 96, "chunk": 400}
|
| 146 |
+
{"utc": "2026-10-14T23:48:15Z", "samples": 12008, "parse_fail": 3145, "distinct_checked": 8731, "lean_ok": 4678, "lean_rej": 4053, "parse_reasons": {"unbound": 1963, "expected )": 331, "name": 246, "formula": 159, "no-eos": 128, "exact not last": 92, "expected ;": 92, "expected (": 78, "ORE box": 22, "PR position": 19, "expected :=": 6, "expected =>": 4, "expected None": 2, "eof": 2, "expected exact": 1}, "lean_wall_s": 24.835551738739014, "lean_proc_s": 538.7013652324677, "workers": 96, "chunk": 400}
|
| 147 |
+
{"utc": "2026-10-14T23:49:48Z", "samples": 12008, "parse_fail": 2864, "distinct_checked": 9008, "lean_ok": 4678, "lean_rej": 4330, "parse_reasons": {"unbound": 1856, "expected )": 266, "name": 225, "no-eos": 129, "formula": 116, "exact not last": 96, "expected ;": 87, "expected (": 60, "ORE box": 11, "PR position": 9, "expected =>": 4, "expected None": 2, "expected exact": 1, "expected :": 1, "expected :=": 1}, "lean_wall_s": 25.766404390335083, "lean_proc_s": 579.610456943512, "workers": 96, "chunk": 400}
|
| 148 |
+
{"utc": "2026-10-14T23:51:21Z", "samples": 12008, "parse_fail": 2913, "distinct_checked": 8940, "lean_ok": 4687, "lean_rej": 4253, "parse_reasons": {"unbound": 1950, "name": 222, "expected )": 200, "expected (": 122, "formula": 120, "no-eos": 116, "exact not last": 89, "expected ;": 61, "ORE box": 18, "PR position": 7, "expected =>": 3, "expected :=": 3, "expected None": 1, "expected exact": 1}, "lean_wall_s": 26.07420253753662, "lean_proc_s": 576.4732031822205, "workers": 96, "chunk": 400}
|
| 149 |
+
{"utc": "2026-10-14T23:52:46Z", "samples": 12008, "parse_fail": 2807, "distinct_checked": 9050, "lean_ok": 4686, "lean_rej": 4364, "parse_reasons": {"unbound": 1862, "name": 190, "formula": 161, "expected )": 142, "no-eos": 110, "exact not last": 110, "expected (": 107, "expected ;": 92, "ORE box": 18, "PR position": 9, "expected =>": 3, "expected exact": 1, "eof": 1, "expected :=": 1}, "lean_wall_s": 26.112592935562134, "lean_proc_s": 589.1111993789673, "workers": 96, "chunk": 400}
|
| 150 |
+
{"utc": "2026-10-14T23:54:15Z", "samples": 12000, "parse_fail": 2819, "distinct_checked": 9046, "lean_ok": 4649, "lean_rej": 4397, "parse_reasons": {"unbound": 1888, "name": 213, "expected )": 160, "no-eos": 119, "exact not last": 107, "formula": 100, "expected (": 96, "expected ;": 92, "ORE box": 20, "PR position": 10, "expected exact": 6, "expected =>": 3, "expected None": 3, "eof": 2}, "lean_wall_s": 24.825318574905396, "lean_proc_s": 562.7442374229431, "workers": 96, "chunk": 400}
|
| 151 |
+
{"utc": "2026-10-14T23:55:41Z", "samples": 12000, "parse_fail": 2842, "distinct_checked": 9007, "lean_ok": 4666, "lean_rej": 4341, "parse_reasons": {"unbound": 1880, "name": 210, "formula": 157, "no-eos": 115, "expected )": 111, "exact not last": 111, "expected ;": 108, "expected (": 99, "ORE box": 24, "PR position": 11, "expected exact": 6, "expected :=": 6, "expected False": 2, "expected =>": 1, "expected None": 1}, "lean_wall_s": 25.63811945915222, "lean_proc_s": 571.4998540878296, "workers": 96, "chunk": 400}
|
| 152 |
+
{"utc": "2026-10-14T23:57:10Z", "samples": 12008, "parse_fail": 2726, "distinct_checked": 9151, "lean_ok": 4676, "lean_rej": 4475, "parse_reasons": {"unbound": 1764, "name": 211, "formula": 152, "exact not last": 123, "no-eos": 113, "expected )": 112, "expected ;": 102, "expected (": 102, "ORE box": 19, "PR position": 16, "expected exact": 7, "expected :=": 2, "trailing tokens": 1, "eof": 1, "expected None": 1}, "lean_wall_s": 25.641493558883667, "lean_proc_s": 579.2304947376251, "workers": 96, "chunk": 400}
|
| 153 |
+
{"utc": "2026-10-14T23:58:41Z", "samples": 12008, "parse_fail": 2740, "distinct_checked": 9133, "lean_ok": 4629, "lean_rej": 4504, "parse_reasons": {"unbound": 1764, "name": 213, "formula": 170, "no-eos": 125, "exact not last": 125, "expected )": 116, "expected (": 96, "expected ;": 83, "ORE box": 25, "PR position": 19, "expected :=": 1, "expected False": 1, "eof": 1, "expected =>": 1}, "lean_wall_s": 25.574360370635986, "lean_proc_s": 578.3564627170563, "workers": 96, "chunk": 400}
|
| 154 |
+
{"utc": "2026-10-15T00:00:09Z", "samples": 12016, "parse_fail": 2761, "distinct_checked": 9114, "lean_ok": 4625, "lean_rej": 4489, "parse_reasons": {"unbound": 1833, "name": 206, "expected )": 147, "formula": 119, "no-eos": 114, "expected ;": 104, "expected (": 100, "exact not last": 92, "ORE box": 16, "PR position": 16, "expected :=": 7, "expected exact": 3, "expected None": 2, "eof": 1, "expected :": 1}, "lean_wall_s": 24.351658582687378, "lean_proc_s": 554.2560243606567, "workers": 96, "chunk": 400}
|
| 155 |
+
{"utc": "2026-10-15T00:01:43Z", "samples": 12016, "parse_fail": 2850, "distinct_checked": 9046, "lean_ok": 4669, "lean_rej": 4377, "parse_reasons": {"unbound": 1927, "name": 188, "expected )": 174, "formula": 130, "no-eos": 115, "expected (": 92, "exact not last": 89, "expected ;": 87, "ORE box": 22, "PR position": 12, "expected :=": 11, "expected None": 2, "expected exact": 1}, "lean_wall_s": 27.328131914138794, "lean_proc_s": 616.8582079410553, "workers": 96, "chunk": 400}
|
| 156 |
+
{"utc": "2026-10-15T00:03:01Z", "samples": 12016, "parse_fail": 3034, "distinct_checked": 8829, "lean_ok": 4645, "lean_rej": 4184, "parse_reasons": {"unbound": 2025, "expected )": 225, "name": 203, "formula": 147, "exact not last": 119, "no-eos": 105, "expected (": 99, "expected ;": 71, "ORE box": 18, "PR position": 14, "expected :=": 6, "expected exact": 1, "expected fun": 1}, "lean_wall_s": 26.49358105659485, "lean_proc_s": 578.2663412094116, "workers": 96, "chunk": 400}
|
| 157 |
+
{"utc": "2026-10-15T00:04:27Z", "samples": 12008, "parse_fail": 3135, "distinct_checked": 8727, "lean_ok": 4663, "lean_rej": 4064, "parse_reasons": {"unbound": 2059, "expected )": 257, "name": 197, "formula": 157, "no-eos": 116, "expected ;": 116, "exact not last": 114, "expected (": 75, "ORE box": 21, "PR position": 9, "expected :=": 8, "expected exact": 2, "expected None": 2, "eof": 2}, "lean_wall_s": 26.160133361816406, "lean_proc_s": 565.5157878398895, "workers": 96, "chunk": 400}
|
| 158 |
+
{"utc": "2026-10-15T00:05:55Z", "samples": 12008, "parse_fail": 3305, "distinct_checked": 8550, "lean_ok": 4664, "lean_rej": 3886, "parse_reasons": {"unbound": 2151, "expected )": 271, "name": 196, "formula": 160, "exact not last": 150, "no-eos": 135, "expected ;": 121, "expected (": 73, "ORE box": 21, "expected :=": 13, "PR position": 10, "expected :": 1, "eof": 1, "expected =>": 1, "expected exact": 1}, "lean_wall_s": 25.379317045211792, "lean_proc_s": 540.5408449172974, "workers": 96, "chunk": 400}
|
| 159 |
+
{"utc": "2026-10-15T00:07:31Z", "samples": 12008, "parse_fail": 3430, "distinct_checked": 8440, "lean_ok": 4650, "lean_rej": 3790, "parse_reasons": {"unbound": 2242, "expected )": 388, "name": 188, "formula": 139, "exact not last": 132, "no-eos": 127, "expected ;": 82, "expected (": 78, "ORE box": 25, "PR position": 12, "expected :=": 11, "expected =>": 4, "expected None": 2}, "lean_wall_s": 27.17425274848938, "lean_proc_s": 565.7399549484253, "workers": 96, "chunk": 400}
|
| 160 |
+
{"utc": "2026-10-15T00:08:59Z", "samples": 12016, "parse_fail": 3290, "distinct_checked": 8605, "lean_ok": 4690, "lean_rej": 3915, "parse_reasons": {"unbound": 2145, "expected )": 389, "name": 159, "no-eos": 124, "formula": 121, "expected ;": 109, "exact not last": 105, "expected (": 87, "ORE box": 18, "PR position": 16, "expected :=": 11, "expected exact": 2, "expected None": 2, "eof": 1, "expected =>": 1}, "lean_wall_s": 23.483498573303223, "lean_proc_s": 499.28795742988586, "workers": 96, "chunk": 400}
|
| 161 |
+
{"utc": "2026-10-15T00:10:22Z", "samples": 12008, "parse_fail": 3015, "distinct_checked": 8873, "lean_ok": 4721, "lean_rej": 4152, "parse_reasons": {"unbound": 1949, "name": 223, "expected )": 220, "exact not last": 137, "no-eos": 116, "expected ;": 102, "formula": 99, "expected (": 96, "ORE box": 43, "PR position": 14, "expected :=": 11, "expected exact": 3, "expected :": 1, "eof": 1}, "lean_wall_s": 27.303186416625977, "lean_proc_s": 603.400660276413, "workers": 96, "chunk": 400}
|
| 162 |
+
{"utc": "2026-10-15T00:11:58Z", "samples": 12016, "parse_fail": 2945, "distinct_checked": 8940, "lean_ok": 4712, "lean_rej": 4228, "parse_reasons": {"unbound": 1872, "expected )": 230, "name": 177, "formula": 149, "no-eos": 134, "expected ;": 125, "exact not last": 123, "expected (": 64, "ORE box": 32, "PR position": 18, "expected :=": 13, "expected exact": 3, "expected =>": 3, "eof": 2}, "lean_wall_s": 26.58730387687683, "lean_proc_s": 584.9401431083679, "workers": 96, "chunk": 400}
|
| 163 |
+
{"utc": "2026-10-15T00:13:32Z", "samples": 12016, "parse_fail": 2950, "distinct_checked": 8923, "lean_ok": 4731, "lean_rej": 4192, "parse_reasons": {"unbound": 1858, "expected )": 222, "name": 179, "formula": 143, "no-eos": 126, "expected ;": 122, "expected (": 116, "exact not last": 112, "ORE box": 36, "PR position": 11, "expected :=": 9, "expected None": 6, "expected exact": 6, "eof": 4}, "lean_wall_s": 25.638303518295288, "lean_proc_s": 569.1562721729279, "workers": 96, "chunk": 400}
|
| 164 |
+
{"utc": "2026-10-15T00:15:00Z", "samples": 12016, "parse_fail": 2872, "distinct_checked": 9010, "lean_ok": 4753, "lean_rej": 4257, "parse_reasons": {"unbound": 1814, "expected )": 257, "name": 183, "formula": 143, "no-eos": 122, "exact not last": 114, "expected ;": 104, "expected (": 66, "ORE box": 28, "expected :=": 16, "PR position": 14, "expected exact": 5, "trailing tokens": 3, "expected =>": 2, "expected .elim": 1}, "lean_wall_s": 26.177812576293945, "lean_proc_s": 589.3823142051697, "workers": 96, "chunk": 400}
|
| 165 |
+
{"utc": "2026-10-15T00:16:23Z", "samples": 11984, "parse_fail": 2929, "distinct_checked": 8917, "lean_ok": 4749, "lean_rej": 4168, "parse_reasons": {"unbound": 1805, "expected )": 342, "name": 148, "expected ;": 144, "no-eos": 122, "formula": 119, "exact not last": 115, "expected (": 79, "ORE box": 29, "expected :=": 17, "PR position": 5, "eof": 2, "expected fun": 1, "expected =>": 1}, "lean_wall_s": 28.053982973098755, "lean_proc_s": 626.6954734325409, "workers": 96, "chunk": 400}
|
| 166 |
+
{"utc": "2026-10-15T00:17:47Z", "samples": 11984, "parse_fail": 2993, "distinct_checked": 8861, "lean_ok": 4750, "lean_rej": 4111, "parse_reasons": {"unbound": 1823, "expected )": 355, "name": 149, "expected ;": 142, "formula": 135, "no-eos": 119, "exact not last": 110, "expected (": 97, "ORE box": 30, "PR position": 12, "expected :=": 10, "expected =>": 5, "expected None": 3, "expected exact": 2, "eof": 1}, "lean_wall_s": 23.167739152908325, "lean_proc_s": 508.59518122673035, "workers": 96, "chunk": 400}
|
| 167 |
+
{"utc": "2026-10-15T00:19:15Z", "samples": 11984, "parse_fail": 2961, "distinct_checked": 8880, "lean_ok": 4791, "lean_rej": 4089, "parse_reasons": {"unbound": 1824, "expected )": 419, "formula": 142, "name": 138, "expected ;": 126, "no-eos": 105, "exact not last": 80, "expected (": 72, "ORE box": 31, "expected :=": 12, "PR position": 4, "expected None": 3, "expected =>": 2, "expected fun": 1, "expected exact": 1, "eof": 1}, "lean_wall_s": 25.683273553848267, "lean_proc_s": 567.5410344600677, "workers": 96, "chunk": 400}
|
| 168 |
+
{"utc": "2026-10-15T00:20:37Z", "samples": 11984, "parse_fail": 3072, "distinct_checked": 8764, "lean_ok": 4768, "lean_rej": 3996, "parse_reasons": {"unbound": 1973, "expected )": 348, "formula": 170, "name": 155, "no-eos": 114, "exact not last": 99, "expected ;": 95, "expected (": 55, "ORE box": 28, "expected :=": 24, "PR position": 6, "expected None": 2, "expected =>": 1, "expected exact": 1, "expected fun": 1}, "lean_wall_s": 24.80078649520874, "lean_proc_s": 537.5755064487457, "workers": 96, "chunk": 400}
|
| 169 |
+
{"utc": "2026-10-15T00:32:51Z", "samples": 53952, "parse_fail": 37046, "distinct_checked": 16037, "lean_ok": 1554, "lean_rej": 14483, "parse_reasons": {"unbound": 20318, "expected )": 5065, "formula": 4545, "expected ;": 2945, "exact not last": 1212, "expected (": 1005, "name": 960, "no-eos": 388, "ORE box": 225, "PR position": 198, "expected :=": 129, "expected =>": 39, "expected None": 11, "expected exact": 3, "eof": 2, "expected fun": 1}, "lean_wall_s": 47.64534902572632, "lean_proc_s": 1858.6443164348602, "workers": 96, "chunk": 400}
|
| 170 |
+
{"utc": "2026-10-15T00:34:05Z", "samples": 17728, "parse_fail": 4412, "distinct_checked": 12927, "lean_ok": 6584, "lean_rej": 6343, "parse_reasons": {"unbound": 2909, "expected )": 775, "formula": 214, "name": 166, "no-eos": 111, "exact not last": 67, "ORE box": 51, "expected (": 35, "expected ;": 28, "PR position": 25, "expected =>": 14, "expected :=": 13, "expected exact": 2, "eof": 1, "expected None": 1}, "lean_wall_s": 33.876545906066895, "lean_proc_s": 1073.1539905071259, "workers": 96, "chunk": 400}
|
runs/long-rl-20261014-v3_untied-grpo_s0/pretrain.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b44677d19af814590e9bb13cf7343a797e642e27af7dcd6a4dffdb281180e590
|
| 3 |
+
size 38588451
|
runs/long-rl-20261014-v3_untied-grpo_s0/source/harness.py
ADDED
|
@@ -0,0 +1,436 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# imports the fork (model, tokenizer, train, ...), which is not resolvable here
|
| 3 |
+
# pyright: reportMissingImports=false
|
| 4 |
+
"""Harness for long_rl_20261014: pretrain on <= 6 body lines, then RL on the long-proofs set (body 7 to ~45).
|
| 5 |
+
|
| 6 |
+
Forked from the test-time-loops harness (autoresearch_loops/harness.py, sha 2eec1b61666a, the one run 590 and 512 were
|
| 7 |
+
scored with). What changed (Robbie, 2026-10-14):
|
| 8 |
+
|
| 9 |
+
- Lean is the only checker: overlay/lean_gate.py, and a sample counts iff Lean accepts its literal text. nd_verify is
|
| 10 |
+
never called; the decoded ND proof is used only to count lines.
|
| 11 |
+
- Length is body lines (proof lines after the premise block) everywhere: bands, L*, the pretraining cap.
|
| 12 |
+
- Tokenizer: overlay/lean_tok.py (ten atoms, ten premises, 160 names). The overlay directory is first on sys.path.
|
| 13 |
+
- Data (make_data.py): pretraining = Dan's cap-6 file with distractor premises; RL targets / dev / holdout = the
|
| 14 |
+
long-proofs set, band-capped. The old transfer dev pool is evaluated too (EVAL_K_OLD samples), to catch forgetting.
|
| 15 |
+
- The oracle also returns every rollout (token ids and the Lean verdict) for the GRPO arm: sample_rollouts().
|
| 16 |
+
- Sampling batch size follows the model's KV-cache depth (model.kv_layers()), so 8-loop sampling fits an A40.
|
| 17 |
+
|
| 18 |
+
1. pretrain.pretrain(train_recs, PRETRAIN_SECS, ...) -> (model, tok, stats), charged for everything
|
| 19 |
+
2. checks: params <= PARAM_CAP, tok.mode == TOK_MODE, model has an integer KNOB
|
| 20 |
+
3. pretrain.rl(model, tok, targets, train_recs, oracle, RL_SECS, ...): the arm's RL. RL_SECS is wall-clock inside rl()
|
| 21 |
+
minus Lean-gate time.
|
| 22 |
+
4. eval: dev (long-proofs set) with EVAL_K samples at EVAL_LEVEL, by band; old transfer dev with EVAL_K_OLD samples
|
| 23 |
+
5. SIGALRM at TOTAL_SECS
|
| 24 |
+
|
| 25 |
+
python3 harness.py --out artifacts/x [--seed 0] # on the pod (remote.sh)
|
| 26 |
+
ND_FORK=... python3 harness.py --out /tmp/smoke --smoke # CPU plumbing check with real Lean
|
| 27 |
+
"""
|
| 28 |
+
|
| 29 |
+
import argparse
|
| 30 |
+
import collections
|
| 31 |
+
import gzip
|
| 32 |
+
import hashlib
|
| 33 |
+
import importlib
|
| 34 |
+
import json
|
| 35 |
+
import os
|
| 36 |
+
import random
|
| 37 |
+
import shutil
|
| 38 |
+
import signal
|
| 39 |
+
import sys
|
| 40 |
+
import time
|
| 41 |
+
import traceback
|
| 42 |
+
from pathlib import Path
|
| 43 |
+
|
| 44 |
+
HERE = os.path.dirname(os.path.abspath(__file__))
|
| 45 |
+
FORK = os.environ.get("ND_FORK", "/workspace/nd-takehome")
|
| 46 |
+
DATA = os.environ.get("ND_DATA", os.path.join(HERE, "data"))
|
| 47 |
+
# overlay first (tokenizer, Lean-only gate), then the fork (model, sample, train), then this directory (pretrain.py)
|
| 48 |
+
sys.path[:0] = [os.path.join(HERE, "overlay"), FORK, HERE]
|
| 49 |
+
import importlib.util # noqa: E402
|
| 50 |
+
|
| 51 |
+
import torch # noqa: E402
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def _overlay(name):
|
| 55 |
+
"""Load overlay/<name>.py under the module name the fork imports. Fork modules put the fork directory at
|
| 56 |
+
sys.path[0] whenever they are imported (nd2lean does, inside lean_tok), so path order alone is not enough:
|
| 57 |
+
registering the module in sys.modules first is what makes every later `import lean_tok` get the overlay."""
|
| 58 |
+
spec = importlib.util.spec_from_file_location(name, os.path.join(HERE, "overlay", f"{name}.py"))
|
| 59 |
+
mod = importlib.util.module_from_spec(spec)
|
| 60 |
+
sys.modules[name] = mod
|
| 61 |
+
spec.loader.exec_module(mod)
|
| 62 |
+
return mod
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
_overlay("lean_tok")
|
| 66 |
+
gate = _overlay("lean_gate").gate
|
| 67 |
+
from eval_set import wilson # noqa: E402 (fork; wilson interval only)
|
| 68 |
+
from nd_verify.verify import parse_proof_tokens # noqa: E402 (a parser: line counts only, never a verdict)
|
| 69 |
+
from sample import generate_ids # noqa: E402 (fork)
|
| 70 |
+
|
| 71 |
+
# ---------------------------------------------------------------- the rules
|
| 72 |
+
TOTAL_SECS = int(os.environ.get("ND_TOTAL_SECS", 6.5 * 3600)) # RL_SECS excludes Lean-gate time (~80 s a round)
|
| 73 |
+
PRETRAIN_SECS = 600 # Dan's file with distractors is ~1.6x the tokens of the plain cap-6 file
|
| 74 |
+
PRETRAIN_GRACE = 30
|
| 75 |
+
RL_SECS = int(os.environ.get("ND_RL_SECS", 3 * 3600))
|
| 76 |
+
RL_GRACE = 120
|
| 77 |
+
PARAM_CAP = 10_000_000
|
| 78 |
+
TEMP = 0.8
|
| 79 |
+
MAX_NEW = 2304 # proof tokens: approach E's 80-line references run to ~1,900; checked against the pools at load
|
| 80 |
+
KV_TOKENS = 1024 * 6 * 1700 # sampling batch * KV layers * tokens: 6 layers x 1,024 x 1,700 is ~16 GB of bf16 KV
|
| 81 |
+
EVAL_K, EVAL_K_OLD = 64, 16
|
| 82 |
+
KNOB = "n_loops"
|
| 83 |
+
EVAL_LEVEL, DIAG_LEVEL = int(os.environ.get("ND_EVAL_LEVEL", 8)), 2
|
| 84 |
+
TOK_MODE = "lean_seq"
|
| 85 |
+
BANDS = ((0, 6), (7, 9), (10, 14), (15, 19), (20, 24), (25, 34), (35, 49), (50, 200))
|
| 86 |
+
DEV = "cuda" if torch.cuda.is_available() else "cpu"
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
def read(fn):
|
| 90 |
+
op = gzip.open if fn.endswith(".gz") else open
|
| 91 |
+
return [json.loads(line) for line in op(fn, "rt") if line.strip()]
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def log(msg):
|
| 95 |
+
print(f"[{time.strftime('%H:%M:%S')}] {msg}", flush=True)
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
def sha(fn):
|
| 99 |
+
return hashlib.sha256(open(fn, "rb").read()).hexdigest()[:12]
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
def band(body):
|
| 103 |
+
return next(f"{lo}-{hi}" if hi < 200 else f"{lo}+" for lo, hi in BANDS if lo <= body <= hi)
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
class Timeout(Exception):
|
| 107 |
+
pass
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
class BudgetSpent(Timeout):
|
| 111 |
+
pass
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
# ---------------------------------------------------------------- sampling and judging
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
def body_lines(nd):
|
| 118 |
+
"""(written body lines, pruned body lines) of a decoded ND proof: lines after the premise block, and those the
|
| 119 |
+
last line depends on through citations (a box rule cites the box's first and last lines, so the closure keeps a
|
| 120 |
+
needed box's hypothesis and every line its conclusion depends on)."""
|
| 121 |
+
lines = parse_proof_tokens(nd.split())
|
| 122 |
+
by = {ln["idx"]: ln for ln in lines}
|
| 123 |
+
need, todo = set(), [lines[-1]["idx"]]
|
| 124 |
+
while todo:
|
| 125 |
+
i = todo.pop()
|
| 126 |
+
if i not in need:
|
| 127 |
+
need.add(i)
|
| 128 |
+
todo += by[i]["refs"]
|
| 129 |
+
body = [ln for ln in lines if ln["rule"] != "PR"]
|
| 130 |
+
return len(body), sum(1 for ln in body if ln["idx"] in need)
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
def kv_batch(model, n_tokens):
|
| 134 |
+
layers = model.kv_layers() if hasattr(model, "kv_layers") else len(model.blocks)
|
| 135 |
+
return max(32, min(1024, KV_TOKENS // (layers * n_tokens)))
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
def new_tokens(body, max_new):
|
| 139 |
+
"""Sampling cap for a target of `body` lines: reference proofs run up to ~23 tokens per body line (16 for most), so
|
| 140 |
+
64 + 30 per line leaves >= 1.3x room, and a sample rambling without <eos> no longer holds a whole batch to max_new.
|
| 141 |
+
Rounded up to a multiple of 128 so that a few caps group the samples into full batches."""
|
| 142 |
+
return min(max_new, -(-(64 + 30 * body) // 128) * 128)
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
def sample(model, tok, recs, k, seed, max_new):
|
| 146 |
+
"""k samples per record at temperature TEMP. Returns per record a list of (ids, decoded ND proof, accepted)."""
|
| 147 |
+
prompts = [r["prompt"] for r in recs for _ in range(k)]
|
| 148 |
+
caps = [new_tokens(r["body"], max_new) for r in recs for _ in range(k)]
|
| 149 |
+
ids = [tok.encode_prompt(p) for p in prompts]
|
| 150 |
+
gen = torch.Generator(device=DEV)
|
| 151 |
+
gen.manual_seed(seed)
|
| 152 |
+
outs, nds, texts = [None] * len(prompts), [None] * len(prompts), [None] * len(prompts)
|
| 153 |
+
for cap in sorted(set(caps)):
|
| 154 |
+
order = sorted((i for i in range(len(prompts)) if caps[i] == cap), key=lambda i: len(ids[i]))
|
| 155 |
+
batch = kv_batch(model, len(ids[order[-1]]) + cap)
|
| 156 |
+
for s in range(0, len(order), batch):
|
| 157 |
+
chunk = order[s : s + batch]
|
| 158 |
+
with torch.autocast("cuda", dtype=torch.bfloat16, enabled=(DEV == "cuda")):
|
| 159 |
+
res = generate_ids(model, tok, [ids[i] for i in chunk], False, TEMP, cap, gen)
|
| 160 |
+
for i, o in zip(chunk, res, strict=True):
|
| 161 |
+
o = o[: o.index(tok.eos) + 1] if tok.eos in o else o
|
| 162 |
+
outs[i], nds[i], texts[i] = o, tok.decode(o), tok.last_text
|
| 163 |
+
if DEV == "cuda":
|
| 164 |
+
torch.cuda.empty_cache()
|
| 165 |
+
gated = gate(tok, prompts, nds, texts)
|
| 166 |
+
flat = [(o, nd, not nd.startswith("LEAN")) for o, nd in zip(outs, gated, strict=True)]
|
| 167 |
+
return [flat[i * k : (i + 1) * k] for i in range(len(recs))]
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
def judge(recs, per):
|
| 171 |
+
rows = []
|
| 172 |
+
for r, samples in zip(recs, per, strict=True):
|
| 173 |
+
good = {}
|
| 174 |
+
for _, nd, ok in samples:
|
| 175 |
+
if ok and nd not in good:
|
| 176 |
+
good[nd] = body_lines(nd)
|
| 177 |
+
rows.append({"name": r["name"], "body": r["body"], "solved": bool(good), "n_ok": sum(ok for *_, ok in samples),
|
| 178 |
+
"n_tried": len(samples), "proofs": list(good), "written": [w for w, _ in good.values()],
|
| 179 |
+
"pruned": [p for _, p in good.values()]})
|
| 180 |
+
return rows
|
| 181 |
+
|
| 182 |
+
|
| 183 |
+
def lstar(solved, recs, need=5):
|
| 184 |
+
ls = [r["body"] for r in recs if r["name"] in solved]
|
| 185 |
+
ge = {L: sum(1 for x in ls if x >= L) for L in range(7, 81)}
|
| 186 |
+
return max([L for L, c in ge.items() if c >= need], default=0), ge
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
def by_band(solved, recs):
|
| 190 |
+
by = collections.defaultdict(lambda: [0, 0])
|
| 191 |
+
for r in recs:
|
| 192 |
+
by[band(r["body"])][0] += r["name"] in solved
|
| 193 |
+
by[band(r["body"])][1] += 1
|
| 194 |
+
return {b: {"solved": k, "n": n, "rate": k / n, "ci": list(wilson(k, n))} for b, (k, n) in sorted(by.items())}
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
def gate_seconds():
|
| 198 |
+
fn = os.environ.get("LEAN_GATE_LOG")
|
| 199 |
+
return sum(r["lean_wall_s"] for r in read(fn)) if fn and os.path.exists(fn) else 0.0
|
| 200 |
+
|
| 201 |
+
|
| 202 |
+
# ---------------------------------------------------------------- the RL oracle
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
class Oracle:
|
| 206 |
+
"""What rl() gets instead of data: the model's own attempts at the RL targets, judged by Lean."""
|
| 207 |
+
|
| 208 |
+
def __init__(self, a, tok, targets):
|
| 209 |
+
self.a, self.tok = a, tok
|
| 210 |
+
self.targets = {t["name"]: t for t in targets}
|
| 211 |
+
self.found = collections.defaultdict(dict) # name -> {proof text: {written, pruned, round}}
|
| 212 |
+
self.calls = []
|
| 213 |
+
self.t0 = self.last = time.time()
|
| 214 |
+
self.uncharged = 0.0
|
| 215 |
+
|
| 216 |
+
def used(self):
|
| 217 |
+
return time.time() - self.t0 - self.uncharged
|
| 218 |
+
|
| 219 |
+
def left(self):
|
| 220 |
+
return self.a.rl_secs - self.used()
|
| 221 |
+
|
| 222 |
+
def _sample(self, model, targets, k):
|
| 223 |
+
if self.left() <= 0:
|
| 224 |
+
raise BudgetSpent(f"oracle called with {self.used():.0f}s of {self.a.rl_secs}s used")
|
| 225 |
+
recs = [self.targets[t["name"]] for t in targets]
|
| 226 |
+
call = len(self.calls) + 1
|
| 227 |
+
model.eval()
|
| 228 |
+
t0, g0 = time.time(), gate_seconds()
|
| 229 |
+
per = sample(model, self.tok, recs, k, self.a.seed * 100_000 + call, self.a.max_new)
|
| 230 |
+
secs, gate_s = time.time() - t0, gate_seconds() - g0
|
| 231 |
+
self.uncharged += gate_s
|
| 232 |
+
rows = judge(recs, per)
|
| 233 |
+
new = 0
|
| 234 |
+
for t, row in zip(recs, rows, strict=True):
|
| 235 |
+
for p, w, pl in zip(row["proofs"], row["written"], row["pruned"], strict=True):
|
| 236 |
+
if p not in self.found[t["name"]]:
|
| 237 |
+
self.found[t["name"]][p] = {"written": w, "pruned": pl, "round": call}
|
| 238 |
+
new += 1
|
| 239 |
+
solved = {n for n, d in self.found.items() if d}
|
| 240 |
+
ls, _ = lstar(solved, list(self.targets.values()))
|
| 241 |
+
n = len(recs) * k
|
| 242 |
+
self.calls.append({"round": call, "level": getattr(model, KNOB, None), "k": k, "n_targets": len(recs),
|
| 243 |
+
"sample_acc": sum(x["n_ok"] for x in rows) / max(n, 1), "new_proofs": new,
|
| 244 |
+
"targets_solved": len(solved), "lstar": ls,
|
| 245 |
+
"solved_by_band": {b: v["solved"] for b, v in by_band(solved, list(self.targets.values())).items()},
|
| 246 |
+
"sampling": {"samples": n, "secs": secs, "gate_secs": gate_s},
|
| 247 |
+
"secs": time.time() - self.last, "rl_secs_used": self.used()})
|
| 248 |
+
self.last = time.time()
|
| 249 |
+
c = self.calls[-1]
|
| 250 |
+
log(f"oracle {call}: acc {c['sample_acc']:.4f}, +{new} proofs, solved {len(solved)}/{len(self.targets)}, "
|
| 251 |
+
f"L*={ls}, {KNOB} {c['level']}, {len(recs)} targets x {k}, {n / secs:.0f} samples/s, "
|
| 252 |
+
f"RL clock {c['rl_secs_used']:.0f}/{self.a.rl_secs}s")
|
| 253 |
+
return recs, per, rows
|
| 254 |
+
|
| 255 |
+
def sample(self, model, targets, k):
|
| 256 |
+
"""k attempts per target. Returns per target {name, prompt, body, proofs (distinct Lean-accepted ND proofs),
|
| 257 |
+
n_ok, n_tried}. Raises BudgetSpent once the budget is used up."""
|
| 258 |
+
recs, _, rows = self._sample(model, targets, k)
|
| 259 |
+
return [{"name": t["name"], "prompt": t["prompt"], "body": t["body"], "proofs": row["proofs"],
|
| 260 |
+
"n_ok": row["n_ok"], "n_tried": row["n_tried"]} for t, row in zip(recs, rows, strict=True)]
|
| 261 |
+
|
| 262 |
+
def sample_rollouts(self, model, targets, k):
|
| 263 |
+
"""As sample(), plus `rollouts`: every attempt's proof token ids (eos included when the model ended it) and
|
| 264 |
+
its Lean verdict, for policy-gradient RL."""
|
| 265 |
+
recs, per, rows = self._sample(model, targets, k)
|
| 266 |
+
return [{"name": t["name"], "prompt": t["prompt"], "body": t["body"], "proofs": row["proofs"],
|
| 267 |
+
"n_ok": row["n_ok"], "n_tried": row["n_tried"], "rollouts": [(o, ok) for o, _, ok in samples]}
|
| 268 |
+
for t, row, samples in zip(recs, rows, per, strict=True)]
|
| 269 |
+
|
| 270 |
+
|
| 271 |
+
# ---------------------------------------------------------------- stages
|
| 272 |
+
|
| 273 |
+
|
| 274 |
+
def stage_rl(a, agent, tok, model, targets, train_recs):
|
| 275 |
+
oracle = Oracle(a, tok, targets)
|
| 276 |
+
visible = [{"name": t["name"], "prompt": t["prompt"], "body": t["body"], "band": t["band"]} for t in targets]
|
| 277 |
+
stats = agent.rl(model, tok, visible, train_recs, oracle, a.rl_secs, DEV, a.seed, log)
|
| 278 |
+
if DEV == "cuda":
|
| 279 |
+
torch.cuda.synchronize()
|
| 280 |
+
model.eval()
|
| 281 |
+
with open(f"{a.out}/found_targets.jsonl", "w") as f:
|
| 282 |
+
for t in targets:
|
| 283 |
+
for p, x in oracle.found[t["name"]].items():
|
| 284 |
+
f.write(json.dumps({"name": t["name"], "prompt": t["prompt"], "body": t["body"], "proof": p, **x}) + "\n")
|
| 285 |
+
used = oracle.used()
|
| 286 |
+
log(f"rl returned: {used:.0f}s of {a.rl_secs}s charged, {oracle.uncharged:.0f}s Lean gate")
|
| 287 |
+
return {"rounds": oracle.calls, "secs": time.time() - oracle.t0, "rl_secs_used": used,
|
| 288 |
+
"gate_secs": oracle.uncharged, "targets": len(targets), "stats": dict(stats or {})}
|
| 289 |
+
|
| 290 |
+
|
| 291 |
+
def eval_pool(a, tok, model, pool, k, level, tag):
|
| 292 |
+
setattr(model, KNOB, level)
|
| 293 |
+
model.eval()
|
| 294 |
+
t0 = time.time()
|
| 295 |
+
rows = judge(pool, sample(model, tok, pool, k, a.seed * 100_000 + 7777, a.max_new))
|
| 296 |
+
solved = {r["name"] for r in rows if r["solved"]}
|
| 297 |
+
ls, _ = lstar(solved, pool)
|
| 298 |
+
out = {"level": level, "k": k, "solved": len(solved), "n": len(pool), "lstar": ls, "by_band": by_band(solved, pool),
|
| 299 |
+
"sample_acc": sum(r["n_ok"] for r in rows) / max(k * len(pool), 1),
|
| 300 |
+
"max_pruned": max((max(r["pruned"]) for r in rows if r["solved"]), default=0), "secs": time.time() - t0}
|
| 301 |
+
with open(f"{a.out}/eval_{tag}.jsonl", "w") as f:
|
| 302 |
+
for r in rows:
|
| 303 |
+
f.write(json.dumps(r) + "\n")
|
| 304 |
+
log(f"eval {tag} at {KNOB} {level}: solved {len(solved)}/{len(pool)}, L*={ls}, "
|
| 305 |
+
f"by band { {b: v['solved'] for b, v in out['by_band'].items()} }, {out['secs']:.0f}s")
|
| 306 |
+
return out
|
| 307 |
+
|
| 308 |
+
|
| 309 |
+
def stage_eval(a, tok, model, dev_pool, old_dev):
|
| 310 |
+
out = {"dev": eval_pool(a, tok, model, dev_pool, a.eval_k, a.eval_level, "dev")}
|
| 311 |
+
out["old_dev"] = eval_pool(a, tok, model, old_dev, a.eval_k_old, a.eval_level, "old_dev")
|
| 312 |
+
if not getattr(model, "untied", False):
|
| 313 |
+
out["dev_diag"] = eval_pool(a, tok, model, dev_pool, a.eval_k, a.diag_level, "dev_diag")
|
| 314 |
+
setattr(model, KNOB, a.eval_level)
|
| 315 |
+
return out
|
| 316 |
+
|
| 317 |
+
|
| 318 |
+
def write_summary(a, status, **kw):
|
| 319 |
+
s = {"status": status, "metric": kw.get("eval", {}).get("dev", {}).get("solved"),
|
| 320 |
+
"metric_old_dev": kw.get("eval", {}).get("old_dev", {}).get("solved"),
|
| 321 |
+
"metric_rl": (kw.get("rl", {}).get("rounds") or [{}])[-1].get("targets_solved"),
|
| 322 |
+
"arm": {k: os.environ.get(k) for k in ("ND_ARCH", "ND_RL")}, "harness_sha": sha(f"{HERE}/harness.py"),
|
| 323 |
+
"pretrain_sha": sha(f"{HERE}/pretrain.py"), "device": DEV,
|
| 324 |
+
"gpu": torch.cuda.get_device_name(0) if DEV == "cuda" else "cpu", "torch": torch.__version__,
|
| 325 |
+
"total_secs": time.time() - a.T0,
|
| 326 |
+
"rules": {k: globals()[k] for k in ("TOTAL_SECS", "PRETRAIN_SECS", "RL_SECS", "PARAM_CAP", "MAX_NEW",
|
| 327 |
+
"EVAL_K", "EVAL_K_OLD", "EVAL_LEVEL", "DIAG_LEVEL", "TOK_MODE")},
|
| 328 |
+
**kw}
|
| 329 |
+
with open(f"{a.out}/summary.json", "w") as f:
|
| 330 |
+
json.dump(s, f, indent=1)
|
| 331 |
+
log(f"SUMMARY status={status} metric={s['metric']} old_dev={s['metric_old_dev']} metric_rl={s['metric_rl']} "
|
| 332 |
+
f"total {s['total_secs']:.0f}s")
|
| 333 |
+
return s
|
| 334 |
+
|
| 335 |
+
|
| 336 |
+
def save_checkpoint(a, model, tok, stage):
|
| 337 |
+
path = Path(a.out) / f"{stage}.pt"
|
| 338 |
+
pending = path.with_suffix(".pt.tmp")
|
| 339 |
+
try:
|
| 340 |
+
torch.save({"state": model.state_dict(), "tok_mode": tok.mode, "stage": stage, "seed": a.seed,
|
| 341 |
+
"arm": {k: os.environ.get(k) for k in ("ND_ARCH", "ND_RL")},
|
| 342 |
+
"harness_sha": sha(f"{HERE}/harness.py"), "pretrain_sha": sha(f"{HERE}/pretrain.py")}, pending)
|
| 343 |
+
os.replace(pending, path)
|
| 344 |
+
finally:
|
| 345 |
+
pending.unlink(missing_ok=True)
|
| 346 |
+
|
| 347 |
+
|
| 348 |
+
def load_pools(a):
|
| 349 |
+
train = read(f"{DATA}/pretrain.jsonl.gz")
|
| 350 |
+
assert all(r["body"] <= 6 for r in train), "pretraining file violates the 6-body-line cap"
|
| 351 |
+
targets, dev = read(f"{DATA}/rl.jsonl"), read(f"{DATA}/dev.jsonl")
|
| 352 |
+
old = [r for r in read(f"{FORK}/data/ladder/transfer.jsonl")
|
| 353 |
+
if int(hashlib.sha1(r["key"].encode()).hexdigest(), 16) % 2 == 0] # the loops harness's dev half
|
| 354 |
+
old = [{**r, "body": r["n_lines"] - r["n_prem"]} for r in old]
|
| 355 |
+
tk, dk, pk = ({r["key"] for r in xs} for xs in (targets, dev, train))
|
| 356 |
+
assert not (tk & dk) and not (tk & pk) and not (dk & pk), "theorem leak between pools"
|
| 357 |
+
if a.smoke:
|
| 358 |
+
rng = random.Random(0)
|
| 359 |
+
train = train[:3000]
|
| 360 |
+
targets, dev, old = rng.sample(targets, 12), rng.sample(dev, 6), old[:6]
|
| 361 |
+
return train, targets, dev, old
|
| 362 |
+
|
| 363 |
+
|
| 364 |
+
def main():
|
| 365 |
+
ap = argparse.ArgumentParser()
|
| 366 |
+
ap.add_argument("--out", required=True)
|
| 367 |
+
ap.add_argument("--seed", type=int, default=0)
|
| 368 |
+
ap.add_argument("--pretrain-only", action="store_true")
|
| 369 |
+
ap.add_argument("--smoke", action="store_true", help="tiny everything, for a CPU plumbing check")
|
| 370 |
+
a = ap.parse_args()
|
| 371 |
+
a.pretrain_secs, a.rl_secs, a.eval_k, a.eval_k_old, a.max_new = PRETRAIN_SECS, RL_SECS, EVAL_K, EVAL_K_OLD, MAX_NEW
|
| 372 |
+
a.eval_level, a.diag_level = EVAL_LEVEL, DIAG_LEVEL
|
| 373 |
+
if a.smoke:
|
| 374 |
+
a.pretrain_secs, a.rl_secs, a.eval_k, a.eval_k_old, a.max_new = 20, 60, 2, 2, 160
|
| 375 |
+
os.makedirs(a.out, exist_ok=True)
|
| 376 |
+
src = Path(a.out) / "source"
|
| 377 |
+
src.mkdir(exist_ok=True)
|
| 378 |
+
for fn in ("pretrain.py", "harness.py", "remote.sh", "overlay/lean_tok.py", "overlay/lean_gate.py"):
|
| 379 |
+
shutil.copy2(Path(HERE) / fn, src / os.path.basename(fn))
|
| 380 |
+
a.T0 = time.time()
|
| 381 |
+
torch.manual_seed(a.seed)
|
| 382 |
+
|
| 383 |
+
def on_alarm(signum, frame):
|
| 384 |
+
raise Timeout()
|
| 385 |
+
|
| 386 |
+
signal.signal(signal.SIGALRM, on_alarm)
|
| 387 |
+
signal.alarm(TOTAL_SECS if not a.smoke else 1800)
|
| 388 |
+
train, targets, dev, old = load_pools(a)
|
| 389 |
+
agent = importlib.import_module("pretrain")
|
| 390 |
+
assert getattr(agent, "GRPO_TEMP", TEMP) == TEMP, "GRPO must score the distribution it samples from"
|
| 391 |
+
for name in ("lean_tok", "lean_gate"): # the Lean-only gate and the widened tokenizer, nothing from the fork
|
| 392 |
+
assert os.path.dirname(sys.modules[name].__file__) == os.path.join(HERE, "overlay"), sys.modules[name].__file__
|
| 393 |
+
log(f"pools: pretrain {len(train):,}, RL targets {len(targets):,}, dev {len(dev)}, old dev {len(old)}; "
|
| 394 |
+
f"arm {os.environ.get('ND_ARCH')}/{os.environ.get('ND_RL')}; device {DEV}; "
|
| 395 |
+
f"harness {sha(f'{HERE}/harness.py')} pretrain {sha(f'{HERE}/pretrain.py')}")
|
| 396 |
+
pre = {}
|
| 397 |
+
try:
|
| 398 |
+
t0 = time.time()
|
| 399 |
+
model, tok, pre = agent.pretrain(train, a.pretrain_secs, DEV, a.seed, log)
|
| 400 |
+
if DEV == "cuda":
|
| 401 |
+
torch.cuda.synchronize()
|
| 402 |
+
pre = dict(pre or {})
|
| 403 |
+
pre["secs"] = time.time() - t0
|
| 404 |
+
model.eval()
|
| 405 |
+
pre["n_params"] = n_params = sum(p.numel() for p in model.parameters())
|
| 406 |
+
longest = max(len(tok.encode_proof(r["proof"])) for r in targets + dev if r.get("proof")) # ladder: none
|
| 407 |
+
pre["longest_reference_tokens"] = longest
|
| 408 |
+
log(f"pretrain returned after {pre['secs']:.0f}s (budget {a.pretrain_secs}s), {n_params:,} params; "
|
| 409 |
+
f"longest reference proof {longest} tokens, MAX_NEW {a.max_new}")
|
| 410 |
+
assert longest <= a.max_new or a.smoke, f"a reference proof ({longest} tokens) exceeds MAX_NEW"
|
| 411 |
+
if pre["secs"] > a.pretrain_secs + PRETRAIN_GRACE and not a.smoke:
|
| 412 |
+
return write_summary(a, "timeout", pretrain=pre, reason="pretrain overran its budget")
|
| 413 |
+
if tok.mode != TOK_MODE or n_params > PARAM_CAP or not isinstance(getattr(model, KNOB, None), int):
|
| 414 |
+
return write_summary(a, "crash", pretrain=pre, reason="tok mode, param cap or knob check failed")
|
| 415 |
+
save_checkpoint(a, model, tok, "pretrain")
|
| 416 |
+
if a.pretrain_only:
|
| 417 |
+
return write_summary(a, "ok", stage="pretrain_only", pretrain=pre)
|
| 418 |
+
rl = stage_rl(a, agent, tok, model, targets, train)
|
| 419 |
+
if rl["rl_secs_used"] > a.rl_secs + RL_GRACE and not a.smoke:
|
| 420 |
+
return write_summary(a, "timeout", pretrain=pre, rl=rl, reason="rl overran its budget")
|
| 421 |
+
save_checkpoint(a, model, tok, "final")
|
| 422 |
+
ev = stage_eval(a, tok, model, dev, old)
|
| 423 |
+
write_summary(a, "ok", pretrain=pre, rl=rl, eval=ev)
|
| 424 |
+
except BudgetSpent as e:
|
| 425 |
+
write_summary(a, "timeout", pretrain=pre, reason=f"rl: {e}")
|
| 426 |
+
except Timeout:
|
| 427 |
+
write_summary(a, "timeout", pretrain=pre, reason=f"exceeded TOTAL_SECS={TOTAL_SECS}")
|
| 428 |
+
except Exception:
|
| 429 |
+
traceback.print_exc()
|
| 430 |
+
write_summary(a, "crash", pretrain=pre, reason=traceback.format_exc()[-2000:])
|
| 431 |
+
finally:
|
| 432 |
+
signal.alarm(0)
|
| 433 |
+
|
| 434 |
+
|
| 435 |
+
if __name__ == "__main__":
|
| 436 |
+
main()
|
runs/long-rl-20261014-v3_untied-grpo_s0/source/lean_gate.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Lean as the ONLY checker (long_rl_20261014 overlay on the fork's lean_gate.py at 51604b3).
|
| 2 |
+
|
| 3 |
+
gate(tok, prompts, nd_proofs, texts) is called by sample.generate() for a LeanTokenizer. For every distinct
|
| 4 |
+
(prompt, literal Lean text) whose text parsed in the strict grammar it asks Lean (core) whether the literal text proves the
|
| 5 |
+
theorem, and returns the ND proofs with 'LEANREJ ' prefixed where Lean rejects. Unlike the fork's gate there is no
|
| 6 |
+
nd_verify: a sample counts iff Lean accepts it (Robbie, 2026-10-14). The ND proof returned is only the decoder's rendering,
|
| 7 |
+
used for line counts. lean_check() below is the fork's, unchanged.
|
| 8 |
+
|
| 9 |
+
Log: $LEAN_GATE_LOG (default artifacts/lean_gate.jsonl), one json line per generate() call.
|
| 10 |
+
"""
|
| 11 |
+
import os, re, sys, json, time, subprocess, tempfile, shutil, collections
|
| 12 |
+
from concurrent.futures import ThreadPoolExecutor
|
| 13 |
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
| 14 |
+
|
| 15 |
+
LEAN = os.path.expanduser('~/.elan/bin/lean')
|
| 16 |
+
CHUNK = int(os.environ.get('LEAN_GATE_CHUNK', '400'))
|
| 17 |
+
WORKERS = int(os.environ.get('LEAN_GATE_WORKERS', str(max(1, (os.cpu_count() or 2) // 2))))
|
| 18 |
+
ERR = re.compile(r'^[^\n]*?:(\d+):\d+: error', re.M)
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def _run(lines, workdir, tag, depth=0):
|
| 22 |
+
"""lines: list of one-line theorem sources -> (list of bool, cpu seconds)"""
|
| 23 |
+
fn = os.path.join(workdir, f'c_{tag}.lean')
|
| 24 |
+
with open(fn, 'w') as f:
|
| 25 |
+
f.write('set_option linter.unusedVariables false\n' + '\n'.join(lines) + '\n')
|
| 26 |
+
t0 = time.time()
|
| 27 |
+
try:
|
| 28 |
+
p = subprocess.run([LEAN, '-DmaxErrors=100000000', fn], capture_output=True, text=True, timeout=60 + 2 * len(lines))
|
| 29 |
+
o = p.stdout + p.stderr; rc = p.returncode
|
| 30 |
+
except subprocess.TimeoutExpired:
|
| 31 |
+
o = ''; rc = -9
|
| 32 |
+
cpu = time.time() - t0
|
| 33 |
+
os.remove(fn)
|
| 34 |
+
bad = {int(m.group(1)) - 2 for m in ERR.finditer(o)}
|
| 35 |
+
crashed = rc not in (0, 1) or (rc == 1 and not bad) or any(b < 0 or b >= len(lines) for b in bad)
|
| 36 |
+
if crashed:
|
| 37 |
+
if len(lines) == 1:
|
| 38 |
+
return [False], cpu
|
| 39 |
+
h = len(lines) // 2
|
| 40 |
+
a, ca = _run(lines[:h], workdir, tag + 'a', depth + 1); b, cb = _run(lines[h:], workdir, tag + 'b', depth + 1)
|
| 41 |
+
return a + b, cpu + ca + cb
|
| 42 |
+
return [k not in bad for k in range(len(lines))], cpu
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def lean_check(items):
|
| 46 |
+
"""items: list of (statement text, tactic text) -> (list of bool, wall seconds, summed process seconds)"""
|
| 47 |
+
if not items:
|
| 48 |
+
return [], 0.0, 0.0
|
| 49 |
+
lines = [f'{s.replace("theorem t ", f"theorem t{k} ", 1)} {b}' for k, (s, b) in enumerate(items)]
|
| 50 |
+
wd = tempfile.mkdtemp(prefix='leangate_')
|
| 51 |
+
t0 = time.time()
|
| 52 |
+
chunks = [(lines[i:i + CHUNK], i) for i in range(0, len(lines), CHUNK)]
|
| 53 |
+
with ThreadPoolExecutor(WORKERS) as ex:
|
| 54 |
+
res = list(ex.map(lambda c: _run(c[0], wd, str(c[1])), chunks))
|
| 55 |
+
shutil.rmtree(wd, ignore_errors=True)
|
| 56 |
+
ok = [x for r, _ in res for x in r]
|
| 57 |
+
return ok, time.time() - t0, sum(c for _, c in res)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def gate(tok, prompts, nd_proofs, texts):
|
| 61 |
+
logfn = os.environ.get('LEAN_GATE_LOG', 'artifacts/lean_gate.jsonl')
|
| 62 |
+
keys = {}
|
| 63 |
+
for p, nd, tx in zip(prompts, nd_proofs, texts):
|
| 64 |
+
if tx is not None and not nd.startswith('LEANPARSE'):
|
| 65 |
+
keys.setdefault((p, tx), nd)
|
| 66 |
+
items = list(keys)
|
| 67 |
+
lean_ok, wall, cpu = lean_check([(tok.statement(p), tx) for p, tx in items])
|
| 68 |
+
verdict = dict(zip(items, lean_ok))
|
| 69 |
+
n_parse = sum(1 for nd in nd_proofs if nd.startswith('LEANPARSE'))
|
| 70 |
+
parse_reasons = collections.Counter(nd[10:] for nd in nd_proofs if nd.startswith('LEANPARSE'))
|
| 71 |
+
n_ok = sum(map(bool, lean_ok))
|
| 72 |
+
rec = {'utc': time.strftime('%FT%TZ', time.gmtime()), 'samples': len(prompts), 'parse_fail': n_parse,
|
| 73 |
+
'distinct_checked': len(items), 'lean_ok': n_ok, 'lean_rej': len(items) - n_ok,
|
| 74 |
+
'parse_reasons': dict(parse_reasons.most_common()), 'lean_wall_s': wall, 'lean_proc_s': cpu,
|
| 75 |
+
'workers': WORKERS, 'chunk': CHUNK}
|
| 76 |
+
os.makedirs(os.path.dirname(logfn) or '.', exist_ok=True)
|
| 77 |
+
with open(logfn, 'a') as f:
|
| 78 |
+
f.write(json.dumps(rec) + '\n')
|
| 79 |
+
print(f'[lean_gate] {len(prompts)} samples, parse-fail {n_parse}, distinct checked {len(items)}: lean ok {n_ok}; '
|
| 80 |
+
f'lean {wall:.1f}s wall ({cpu:.1f}s proc, {WORKERS} workers)', flush=True)
|
| 81 |
+
return [nd if tx is None or nd.startswith('LEANPARSE') or verdict[(p, tx)] else 'LEANREJ ' + nd
|
| 82 |
+
for p, nd, tx in zip(prompts, nd_proofs, texts)]
|
runs/long-rl-20261014-v3_untied-grpo_s0/source/lean_tok.py
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Lean 4 as the training surface form for the from-scratch model (run lean-format, proposal 8). One symbol per token.
|
| 2 |
+
|
| 3 |
+
The text the model reads and writes is the nd2lean.py rendering of an ND proof, linearised on one line with `;` between
|
| 4 |
+
tactics (no indentation tokens):
|
| 5 |
+
|
| 6 |
+
prompt : theorem t ( P Q R S : Prop ) ( h1 : F1 ) ... : C := by
|
| 7 |
+
proof : have n1 : F1 := h1 ; have n7 : ( P → R ) := ( fun ( n3 : P ) => by have n4 : Q := n1 n3 ; exact n4 ) ; exact n7 <eos>
|
| 8 |
+
|
| 9 |
+
Terms (exactly nd2lean's): PR `hK`; R `nA`; ANDI `⟨ nA , nB ⟩`; ANDE `nA .1|.2`; IMPE / NEGE `nF nA`; ORI `Or.inl|Or.inr nA`;
|
| 10 |
+
BOTE `False.elim nA` (tokens `False` `.elim` `nA`; was `nA .elim` before the 2026-09-22 fix, see nd2lean.py); DN `Classical.byContradiction ( fun hh => nA hh )`; IMPI `( fun ( nS : A ) => by ... ; exact nE )`;
|
| 11 |
+
NEGI the same ending `exact ( nE : False )`; ORE `Or.elim nJ <box> <box>`. `.1 .2 .elim` are glued to the name in the text.
|
| 12 |
+
|
| 13 |
+
Hypothesis names are LABELS, not line indices. 64 name tokens n1..n64; two naming schemes (stored in the ckpt as the mode):
|
| 14 |
+
lean_rand : every training presentation draws a random injective map names -> n1..n64 (names carry no order)
|
| 15 |
+
lean_seq : names are numbered in order of first appearance in the Lean text, plus a random start offset
|
| 16 |
+
(the analogue of the token format's `abs` start-index shift)
|
| 17 |
+
decode() parses the sampled tokens with the strict grammar above and returns the ND proof (spec.md format, N1..) it
|
| 18 |
+
denotes — the "nd2lean inverse" — so nd_verify, prune, normalize and every analysis script work unchanged; a sample
|
| 19 |
+
outside the grammar decodes to 'LEANPARSE <reason>' (rejected by nd_verify). The literal Lean text of the last decoded
|
| 20 |
+
sample is kept in `last_text` and is what lean_gate.py sends to Lean.
|
| 21 |
+
"""
|
| 22 |
+
import random, sys, os
|
| 23 |
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
| 24 |
+
from nd_verify.verify import parse_proof_tokens, parse_formula
|
| 25 |
+
from nd2lean import parse_prompt, translate
|
| 26 |
+
|
| 27 |
+
# long_rl_20261014 overlay (on the fork's lean_tok.py at 51604b3): ten atoms (no V, which reads as
|
| 28 |
+
# `v`), up to ten premises (h1..h10), 160 names, and a statement header that declares all ten atoms,
|
| 29 |
+
# so random atom relabelling (tok.atom_ids, HEADER_LEN; pretrain.py's gpu_batch) never touches it.
|
| 30 |
+
ATOMS = ['P', 'Q', 'R', 'S', 'T', 'U', 'W', 'X', 'Y', 'Z']
|
| 31 |
+
sys.modules['nd_verify.verify'].ATOM_NAMES.update(ATOMS) # the ND parsers (formula syntax only; proofs are judged by Lean)
|
| 32 |
+
MAXN = 160
|
| 33 |
+
MAXH = 10
|
| 34 |
+
FSYMS = ['(', ')', '¬', '∧', '∨', '→'] + ATOMS + ['False']
|
| 35 |
+
HEADER_LEN = len(['theorem', 't', '(']) + len(ATOMS) + len([':', 'Prop', ')'])
|
| 36 |
+
PSYMS = ['theorem', 't', ':', 'Prop', ':=', 'by']
|
| 37 |
+
TSYMS = ['have', 'exact', ';', 'fun', '=>', '⟨', '⟩', ',', '.1', '.2', '.elim', 'Or.inl', 'Or.inr', 'Or.elim', 'Classical.byContradiction', 'hh']
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
class ParseFail(Exception):
|
| 41 |
+
pass
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def ftoks(f):
|
| 45 |
+
"""formula tuple -> Lean tokens (fully parenthesised, as nd2lean.lf)"""
|
| 46 |
+
t = f[0]
|
| 47 |
+
if t == 'atom': return [f[1]]
|
| 48 |
+
if t == 'bot': return ['False']
|
| 49 |
+
if t == 'not': return ['(', '¬'] + ftoks(f[1]) + [')']
|
| 50 |
+
op = {'and': '∧', 'or': '∨', 'imp': '→'}[t]
|
| 51 |
+
return ['('] + ftoks(f[1]) + [op] + ftoks(f[2]) + [')']
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def fnd(f):
|
| 55 |
+
"""formula tuple -> ND tokens (spec.md)"""
|
| 56 |
+
t = f[0]
|
| 57 |
+
if t == 'atom': return f[1]
|
| 58 |
+
if t == 'bot': return 'F'
|
| 59 |
+
if t == 'not': return f'( ~ {fnd(f[1])} )'
|
| 60 |
+
op = {'and': '&', 'or': 'v', 'imp': '>'}[t]
|
| 61 |
+
return f'( {fnd(f[1])} {op} {fnd(f[2])} )'
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def prompt_tokens(prompt):
|
| 65 |
+
prem, concl = parse_prompt(prompt)
|
| 66 |
+
if len(prem) > MAXH:
|
| 67 |
+
raise ValueError('too many premises')
|
| 68 |
+
out = ['theorem', 't', '('] + ATOMS + [':', 'Prop', ')']
|
| 69 |
+
for j, p in enumerate(prem):
|
| 70 |
+
out += ['(', f'h{j+1}', ':'] + ftoks(p) + [')']
|
| 71 |
+
return out + [':'] + ftoks(concl) + [':=', 'by']
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def proof_tokens(proof):
|
| 75 |
+
"""ND proof body -> Lean tokens with names as ('n', ND index). Mirrors nd2lean.translate (which must have accepted
|
| 76 |
+
the proof); a closed box that no rule cites is dropped, as in nd2lean."""
|
| 77 |
+
lines = parse_proof_tokens(proof.split())
|
| 78 |
+
stack = [[]] # token lists of the open boxes' statements; stack[0] = top level
|
| 79 |
+
hyp = [None] # (idx, formula) of each open box
|
| 80 |
+
last = [None]
|
| 81 |
+
closed = {} # start idx -> (hyp formula, stmts tokens, last idx)
|
| 82 |
+
n_pr = 0
|
| 83 |
+
|
| 84 |
+
def close():
|
| 85 |
+
s = stack.pop(); h = hyp.pop(); l = last.pop()
|
| 86 |
+
closed[h[0]] = (h[1], s, l)
|
| 87 |
+
|
| 88 |
+
def box(s, e, neg=False):
|
| 89 |
+
hf, st, l = closed[s]
|
| 90 |
+
assert l == e, 'box cite'
|
| 91 |
+
ex = ['exact', '(', ('n', e), ':', 'False', ')'] if neg else ['exact', ('n', e)]
|
| 92 |
+
return ['(', 'fun', '(', ('n', s), ':'] + ftoks(hf) + [')', '=>', 'by'] + st + ex + [')']
|
| 93 |
+
|
| 94 |
+
for ln in lines:
|
| 95 |
+
i, d, f, rule, refs = ln['idx'], ln['depth'], ln['formula'], ln['rule'], ln['refs']
|
| 96 |
+
if rule == 'AS':
|
| 97 |
+
while len(stack) - 1 >= d: close()
|
| 98 |
+
stack.append([]); hyp.append((i, f)); last.append(i)
|
| 99 |
+
continue
|
| 100 |
+
while len(stack) - 1 > d: close()
|
| 101 |
+
n = lambda j: ('n', j)
|
| 102 |
+
if rule == 'PR': n_pr += 1; term = [f'h{n_pr}']
|
| 103 |
+
elif rule == 'R': term = [n(refs[0])]
|
| 104 |
+
elif rule == 'ANDI': term = ['⟨', n(refs[0]), ',', n(refs[1]), '⟩']
|
| 105 |
+
elif rule == 'ANDE1': term = [n(refs[0]), '.1']
|
| 106 |
+
elif rule == 'ANDE2': term = [n(refs[0]), '.2']
|
| 107 |
+
elif rule == 'IMPE': term = [n(refs[0]), n(refs[1])]
|
| 108 |
+
elif rule == 'NEGE': term = [n(refs[1]), n(refs[0])]
|
| 109 |
+
elif rule == 'ORI1': term = ['Or.inl', n(refs[0])]
|
| 110 |
+
elif rule == 'ORI2': term = ['Or.inr', n(refs[0])]
|
| 111 |
+
elif rule == 'BOTE': term = ['False', '.elim', n(refs[0])]
|
| 112 |
+
elif rule == 'DN': term = ['Classical.byContradiction', '(', 'fun', 'hh', '=>', n(refs[0]), 'hh', ')']
|
| 113 |
+
elif rule == 'IMPI': term = box(refs[0], refs[1])
|
| 114 |
+
elif rule == 'NEGI': term = box(refs[0], refs[1], neg=True)
|
| 115 |
+
elif rule == 'ORE': term = ['Or.elim', n(refs[0])] + box(refs[1], refs[2]) + box(refs[3], refs[4])
|
| 116 |
+
else: raise ValueError(rule)
|
| 117 |
+
stack[-1] += ['have', n(i), ':'] + ftoks(f) + [':='] + term + [';']
|
| 118 |
+
last[-1] = i
|
| 119 |
+
assert len(stack) == 1
|
| 120 |
+
return stack[0] + ['exact', ('n', lines[-1]['idx'])]
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
class LeanTokenizer:
|
| 124 |
+
def __init__(self, mode='lean_rand'):
|
| 125 |
+
assert mode in ('lean_rand', 'lean_seq')
|
| 126 |
+
self.mode = mode
|
| 127 |
+
self.itos = ['<pad>', '<eos>'] + FSYMS + PSYMS + TSYMS + [f'h{k}' for k in range(1, MAXH + 1)]
|
| 128 |
+
self.ref0 = len(self.itos)
|
| 129 |
+
self.itos += [f'n{k}' for k in range(1, MAXN + 1)]
|
| 130 |
+
self.stoi = {s: i for i, s in enumerate(self.itos)}
|
| 131 |
+
self.atom_ids = [self.stoi[x] for x in ATOMS]
|
| 132 |
+
self.pad, self.eos = 0, 1
|
| 133 |
+
self.shift = True
|
| 134 |
+
self.last_text = None
|
| 135 |
+
|
| 136 |
+
@property
|
| 137 |
+
def vocab_size(self):
|
| 138 |
+
return len(self.itos)
|
| 139 |
+
|
| 140 |
+
def encode_prompt(self, prompt):
|
| 141 |
+
return [self.stoi[t] for t in prompt_tokens(prompt)]
|
| 142 |
+
|
| 143 |
+
def encode_proof(self, body):
|
| 144 |
+
"""ND body -> ids with names numbered by first appearance (n1, n2, ...); <eos> included."""
|
| 145 |
+
order = {}
|
| 146 |
+
out = []
|
| 147 |
+
for t in proof_tokens(body):
|
| 148 |
+
if isinstance(t, tuple):
|
| 149 |
+
k = order.setdefault(t[1], len(order) + 1)
|
| 150 |
+
if k > MAXN: raise ValueError('too many names')
|
| 151 |
+
out.append(self.ref0 + k - 1)
|
| 152 |
+
else:
|
| 153 |
+
out.append(self.stoi[t])
|
| 154 |
+
return out + [self.eos]
|
| 155 |
+
|
| 156 |
+
def shift_abs(self, ids, rng):
|
| 157 |
+
"""name augmentation (the interface name is train.py's)."""
|
| 158 |
+
if not self.shift:
|
| 159 |
+
return ids
|
| 160 |
+
mx = max((x - self.ref0 + 1 for x in ids if x >= self.ref0), default=0)
|
| 161 |
+
if mx == 0:
|
| 162 |
+
return ids
|
| 163 |
+
if self.mode == 'lean_seq':
|
| 164 |
+
s = rng.randint(0, MAXN - mx)
|
| 165 |
+
return [x + s if x >= self.ref0 else x for x in ids]
|
| 166 |
+
perm = rng.sample(range(MAXN), mx)
|
| 167 |
+
return [self.ref0 + perm[x - self.ref0] if x >= self.ref0 else x for x in ids]
|
| 168 |
+
|
| 169 |
+
# ---- text ----
|
| 170 |
+
def text(self, toks):
|
| 171 |
+
"""tokens (strings) -> Lean source text of the tactic block (one line)."""
|
| 172 |
+
out = []
|
| 173 |
+
for t in toks:
|
| 174 |
+
if t in ('.1', '.2', '.elim') and out:
|
| 175 |
+
out[-1] += t
|
| 176 |
+
else:
|
| 177 |
+
out.append(t)
|
| 178 |
+
return ' '.join(out)
|
| 179 |
+
|
| 180 |
+
def statement(self, prompt):
|
| 181 |
+
return ' '.join(prompt_tokens(prompt))
|
| 182 |
+
|
| 183 |
+
def lean_source(self, prompt, proof):
|
| 184 |
+
"""(statement, tactic text) Lean checks for an ND proof: exactly what the model would write."""
|
| 185 |
+
return self.statement(prompt), self.text([self.itos[x] for x in self.encode_proof(proof)[:-1]])
|
| 186 |
+
|
| 187 |
+
# ---- inverse ----
|
| 188 |
+
def decode(self, ids):
|
| 189 |
+
toks = []
|
| 190 |
+
ended = False
|
| 191 |
+
for x in ids:
|
| 192 |
+
if x == self.pad: continue
|
| 193 |
+
if x == self.eos: ended = True; break
|
| 194 |
+
toks.append(self.itos[x])
|
| 195 |
+
self.last_text = self.text(toks) if ended else None
|
| 196 |
+
if not ended:
|
| 197 |
+
return 'LEANPARSE no-eos'
|
| 198 |
+
try:
|
| 199 |
+
return inverse(toks)
|
| 200 |
+
except ParseFail as e:
|
| 201 |
+
return f'LEANPARSE {e}'
|
| 202 |
+
|
| 203 |
+
|
| 204 |
+
def inverse(toks):
|
| 205 |
+
"""Lean tokens (strict nd2lean grammar) -> ND proof body 'N1 ... ; ... QED'. Names resolve lexically (latest binding wins,
|
| 206 |
+
as in Lean). Raises ParseFail outside the grammar: PR lines first and in order, a box's `exact` cites the box's last line,
|
| 207 |
+
the final `exact` cites the last top-level line."""
|
| 208 |
+
pos = [0]
|
| 209 |
+
out = [] # ND lines (strings)
|
| 210 |
+
forms = {} # ND idx -> formula tuple
|
| 211 |
+
n_pr = [0]; seen_non_pr = [False]
|
| 212 |
+
|
| 213 |
+
def peek():
|
| 214 |
+
return toks[pos[0]] if pos[0] < len(toks) else None
|
| 215 |
+
|
| 216 |
+
def eat(x=None):
|
| 217 |
+
t = peek()
|
| 218 |
+
if t is None or (x is not None and t != x):
|
| 219 |
+
raise ParseFail(f'expected {x}')
|
| 220 |
+
pos[0] += 1
|
| 221 |
+
return t
|
| 222 |
+
|
| 223 |
+
def name_tok():
|
| 224 |
+
t = eat()
|
| 225 |
+
if not (t[0] == 'n' and t[1:].isdigit()):
|
| 226 |
+
raise ParseFail('name')
|
| 227 |
+
return t
|
| 228 |
+
|
| 229 |
+
def formula():
|
| 230 |
+
# re-use the ND formula parser on a token-mapped slice
|
| 231 |
+
m = {'(': '(', ')': ')', '¬': '~', '∧': '&', '∨': 'v', '→': '>', 'False': 'F', **{a: a for a in ATOMS}}
|
| 232 |
+
j = pos[0]; nd = []
|
| 233 |
+
while j < len(toks) and toks[j] in m:
|
| 234 |
+
nd.append(m[toks[j]]); j += 1
|
| 235 |
+
try:
|
| 236 |
+
f, used = parse_formula(nd + ['$'], 0)
|
| 237 |
+
except Exception:
|
| 238 |
+
raise ParseFail('formula')
|
| 239 |
+
pos[0] += used
|
| 240 |
+
return f
|
| 241 |
+
|
| 242 |
+
def ref(scope):
|
| 243 |
+
t = name_tok()
|
| 244 |
+
if t not in scope:
|
| 245 |
+
raise ParseFail('unbound')
|
| 246 |
+
return scope[t]
|
| 247 |
+
|
| 248 |
+
def emit(depth, f, rule, refs):
|
| 249 |
+
i = len(out) + 1
|
| 250 |
+
out.append(f'N{i} ' + '| ' * depth + f'{fnd(f)} : {rule}' + ''.join(f' N{r}' for r in refs) + ' ;')
|
| 251 |
+
forms[i] = f
|
| 252 |
+
return i
|
| 253 |
+
|
| 254 |
+
def box(scope, depth):
|
| 255 |
+
"""'( fun ( n : A ) => by stmts exact .. )' -> (start idx, end idx, neg)"""
|
| 256 |
+
eat('('); eat('fun'); eat('('); nm = name_tok(); eat(':'); hf = formula(); eat(')'); eat('=>'); eat('by')
|
| 257 |
+
s = emit(depth + 1, hf, 'AS', [])
|
| 258 |
+
sc = dict(scope); sc[nm] = s
|
| 259 |
+
lastl = stmts(sc, depth + 1, s)
|
| 260 |
+
eat('exact')
|
| 261 |
+
if peek() == '(':
|
| 262 |
+
eat('('); e = ref(sc); eat(':'); eat('False'); eat(')'); neg = True
|
| 263 |
+
else:
|
| 264 |
+
e = ref(sc); neg = False
|
| 265 |
+
if e != lastl:
|
| 266 |
+
raise ParseFail('exact not last')
|
| 267 |
+
eat(')')
|
| 268 |
+
return s, e, neg
|
| 269 |
+
|
| 270 |
+
def stmts(scope, depth, lastl):
|
| 271 |
+
while peek() == 'have':
|
| 272 |
+
eat('have'); nm = name_tok(); eat(':'); f = formula(); eat(':=')
|
| 273 |
+
t = peek()
|
| 274 |
+
if t is None: raise ParseFail('eof')
|
| 275 |
+
if t[0] == 'h' and t[1:].isdigit():
|
| 276 |
+
eat(); k = int(t[1:])
|
| 277 |
+
if depth != 0 or seen_non_pr[0] or k != n_pr[0] + 1: raise ParseFail('PR position')
|
| 278 |
+
n_pr[0] += 1
|
| 279 |
+
i = emit(0, f, 'PR', [])
|
| 280 |
+
else:
|
| 281 |
+
seen_non_pr[0] = True
|
| 282 |
+
if t == '⟨':
|
| 283 |
+
eat(); a = ref(scope); eat(','); b = ref(scope); eat('⟩'); rule, refs, pre = 'ANDI', [a, b], None
|
| 284 |
+
elif t in ('Or.inl', 'Or.inr'):
|
| 285 |
+
eat(); a = ref(scope); rule, refs = ('ORI1' if t == 'Or.inl' else 'ORI2'), [a]
|
| 286 |
+
elif t == 'Classical.byContradiction':
|
| 287 |
+
eat(); eat('('); eat('fun'); eat('hh'); eat('=>'); a = ref(scope); eat('hh'); eat(')'); rule, refs = 'DN', [a]
|
| 288 |
+
elif t == '(':
|
| 289 |
+
s, e, neg = box(scope, depth); rule, refs = ('NEGI' if neg else 'IMPI'), [s, e]
|
| 290 |
+
elif t == 'Or.elim':
|
| 291 |
+
eat(); j = ref(scope); s1, e1, g1 = box(scope, depth); s2, e2, g2 = box(scope, depth)
|
| 292 |
+
if g1 or g2: raise ParseFail('ORE box')
|
| 293 |
+
rule, refs = 'ORE', [j, s1, e1, s2, e2]
|
| 294 |
+
elif t == 'False':
|
| 295 |
+
eat(); eat('.elim'); a = ref(scope); rule, refs = 'BOTE', [a]
|
| 296 |
+
else:
|
| 297 |
+
a = ref(scope); t2 = peek()
|
| 298 |
+
if t2 == '.1': eat(); rule, refs = 'ANDE1', [a]
|
| 299 |
+
elif t2 == '.2': eat(); rule, refs = 'ANDE2', [a]
|
| 300 |
+
elif t2 == ';': rule, refs = 'R', [a]
|
| 301 |
+
else:
|
| 302 |
+
b = ref(scope)
|
| 303 |
+
if forms[a][0] == 'not': rule, refs = 'NEGE', [b, a]
|
| 304 |
+
else: rule, refs = 'IMPE', [a, b]
|
| 305 |
+
i = emit(depth, f, rule, refs)
|
| 306 |
+
eat(';')
|
| 307 |
+
scope[nm] = i
|
| 308 |
+
lastl = i
|
| 309 |
+
return lastl
|
| 310 |
+
|
| 311 |
+
top = {}
|
| 312 |
+
lastl = stmts(top, 0, None)
|
| 313 |
+
eat('exact')
|
| 314 |
+
e = ref(top)
|
| 315 |
+
if pos[0] != len(toks):
|
| 316 |
+
raise ParseFail('trailing tokens')
|
| 317 |
+
if lastl is None or e != lastl:
|
| 318 |
+
raise ParseFail('exact not last')
|
| 319 |
+
return ' '.join(out) + ' QED'
|
runs/long-rl-20261014-v3_untied-grpo_s0/source/pretrain.py
ADDED
|
@@ -0,0 +1,871 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# imports the fork (model, tokenizer, train, ...), which is not resolvable here
|
| 2 |
+
# pyright: reportMissingImports=false
|
| 3 |
+
"""long_rl_20261014: run 512's file (autoresearch_loops ae79d23, the final RL recipe: 507 token-budget fine-tune
|
| 4 |
+
batches, 509 Muon fine-tune, 510 more and shorter rounds) with three arms picked by environment variables:
|
| 5 |
+
|
| 6 |
+
ND_ARCH=untied ND_RL=ei A: run 198's untied six blocks (control 590's patch) + the final expert-iteration recipe
|
| 7 |
+
ND_ARCH=looped ND_RL=ei B: 512's looped trunk (two alternating shared core pairs) + the same recipe
|
| 8 |
+
ND_ARCH=untied ND_RL=grpo C: run 198's untied blocks + GRPO with a found-proof pool (rl_grpo)
|
| 9 |
+
|
| 10 |
+
Changes for this experiment, all arms:
|
| 11 |
+
- tokenizer: overlay/lean_tok.py (ten atoms, ten premises h1..h10, names n1..n160)
|
| 12 |
+
- random atom relabelling: every training batch maps each row's atoms through a random permutation of the ten
|
| 13 |
+
atom tokens (gpu_batch), after the fixed statement header; the analogue of the name-offset shift
|
| 14 |
+
- targets are picked per round by body-line band, weighted toward the frontier (pick_targets), from a pool of
|
| 15 |
+
thousands instead of a fixed 1,500
|
| 16 |
+
|
| 17 |
+
The original contract (harness.py's docstring describes this experiment's changes to it):
|
| 18 |
+
|
| 19 |
+
Contract with harness.py (frozen):
|
| 20 |
+
|
| 21 |
+
pretrain(train_recs, budget_secs, device, seed, log) -> (model, tok, stats)
|
| 22 |
+
|
| 23 |
+
train_recs list of dicts {prompt, proof, n_lines<=6, key, ...}; the frozen cap-6 Stage-1 data
|
| 24 |
+
budget_secs wall-clock you are charged for, from call to return, INCLUDING model construction
|
| 25 |
+
and torch.compile. Overrun by more than the harness grace -> the run is a timeout.
|
| 26 |
+
model nn.Module; <= PARAM_CAP unique params (checked again after rl). The harness samples
|
| 27 |
+
from it with the fork's sample.generate, so it must provide:
|
| 28 |
+
- forward(idx) -> logits (B,T,V) and forward(idx, pos=, mask=, caches=) with a
|
| 29 |
+
per-block KV cache dict, exactly like the fork's GPT (model.blocks must exist)
|
| 30 |
+
- an integer `n_loops` (the harness's KNOB): the loop count applied in eval
|
| 31 |
+
mode. The harness sets it to EVAL_LEVEL for the scored eval and to DIAG_LEVEL
|
| 32 |
+
for the diagnostic one.
|
| 33 |
+
tok must provide encode_prompt, encode_proof, decode, shift_abs, pad, eos, mode, and
|
| 34 |
+
mode must be "lean_seq" (harness TOK_MODE): Lean text in and out, Lean-gated samples.
|
| 35 |
+
Decoder rule: decode() is deterministic and single-pass; it may not call the
|
| 36 |
+
verifier or try alternatives.
|
| 37 |
+
stats dict recorded in summary.json and copied into results.json. MUST contain `curve`:
|
| 38 |
+
a list of {secs, step, train_loss, val_loss} taken every ~CURVE_EVERY seconds
|
| 39 |
+
(see log_point below), so a run's trajectory survives in git. Add anything else.
|
| 40 |
+
val_loss is on VAL_N records held out from train_recs by this file; keep that.
|
| 41 |
+
|
| 42 |
+
rl(model, tok, targets, train_recs, oracle, budget_secs, device, seed, log) -> stats | None
|
| 43 |
+
|
| 44 |
+
targets list of dicts {name, prompt, n_lines}: the 1,500 RL target statements. No proofs.
|
| 45 |
+
oracle oracle.sample(model, targets_subset, k, temperature=0.8, batch=1024) samples k
|
| 46 |
+
attempts per target from the model in eval mode at its current n_loops, and returns
|
| 47 |
+
per target {name, prompt, n_lines, proofs, n_ok, n_tried}; `proofs` are the distinct
|
| 48 |
+
attempts Lean AND nd_verify accepted. This is the only source of new training data.
|
| 49 |
+
oracle.used() / oracle.left(): seconds of the RL budget charged / remaining.
|
| 50 |
+
budget_secs RL_SECS: wall-clock inside rl() minus the oracle's Lean-gate time. Returning more
|
| 51 |
+
than the grace late, or calling the oracle with nothing left, is a timeout.
|
| 52 |
+
The model is trained in place. Everything else about RL is yours: rounds, samples per target,
|
| 53 |
+
loop counts when sampling, which proofs to keep, weighting, replay, optimizer, loss.
|
| 54 |
+
|
| 55 |
+
Anything imported from the fork (ND_FORK) is fair game to copy in here and modify.
|
| 56 |
+
"""
|
| 57 |
+
|
| 58 |
+
import collections
|
| 59 |
+
import math
|
| 60 |
+
import os
|
| 61 |
+
import random
|
| 62 |
+
import time
|
| 63 |
+
|
| 64 |
+
import torch
|
| 65 |
+
import torch._inductor.config # noqa: F401 (explicit, so the attribute resolves for pyright)
|
| 66 |
+
from lean_tok import HEADER_LEN, MAXN # overlay
|
| 67 |
+
from model import GPT, Block # fork
|
| 68 |
+
from normalize import norm # fork
|
| 69 |
+
from tokenizer import make_tokenizer # fork
|
| 70 |
+
from train import loss_on # fork
|
| 71 |
+
|
| 72 |
+
# ---- knobs
|
| 73 |
+
# Unique blocks: one untied entry block, N_PAIRS pairs of N_CORE shared core blocks that the loops
|
| 74 |
+
# cycle through (loop k applies pair k % N_PAIRS, so 8 loops run A B A B A B A B and 2 loops run
|
| 75 |
+
# A B: the untied six-block topology of control 590), one untied exit block. Same compute per
|
| 76 |
+
# loop count as one shared pair; 6 unique blocks, 9.56M parameters, the untied control's count.
|
| 77 |
+
N_CORE, N_PAIRS = 2, 2
|
| 78 |
+
ARCH = os.environ.get("ND_ARCH", "untied") # untied | looped
|
| 79 |
+
RL_ALGO = os.environ.get("ND_RL", "ei") # ei | grpo
|
| 80 |
+
assert ARCH in ("untied", "looped") and RL_ALGO in ("ei", "grpo"), (ARCH, RL_ALGO)
|
| 81 |
+
N_LAYER, D, N_HEAD = 2 + N_CORE * N_PAIRS, 384, 8
|
| 82 |
+
# Core applications (loops). Training draws one count per batch from TRAIN_LOOPS, in pretraining
|
| 83 |
+
# and in rl()'s fine-tune; eval and sampling apply model.n_loops, which the harness sets for its
|
| 84 |
+
# evals and rl() sets before each oracle call. DEFAULT_LOOPS is used for the validation curve and
|
| 85 |
+
# the harness's post-pretraining greedy check.
|
| 86 |
+
TRAIN_LOOPS = (1, 2, 3, 4, 5, 6, 7, 8)
|
| 87 |
+
DEFAULT_LOOPS = 2
|
| 88 |
+
VAL_LOOPS = (1, 2, 4, 8) # val loss at each count, once, when pretraining ends
|
| 89 |
+
# ---- RL knobs: the old harness's expert iteration (600 AdamW steps per round on up to 4 proofs
|
| 90 |
+
# per solved target, weighted x4, mixed with 20,000 replayed pretraining records), except for
|
| 91 |
+
# where the samples go. Each round every target gets RL_K attempts at RL_FIRST_LOOPS; a target
|
| 92 |
+
# all of them fail on gets RL_RETRY_K more (32 in all, as before) at ONE deeper loop count from
|
| 93 |
+
# RL_RETRY_LOOPS, assigned at random, so proofs that only deeper sampling finds enter the
|
| 94 |
+
# training set and no deep sample is spent on a target one loop already solves. The random
|
| 95 |
+
# assignment makes the retry calls a controlled comparison of loop counts on resistant targets.
|
| 96 |
+
# Rounds repeat until another one would not fit in the budget.
|
| 97 |
+
RL_FIRST_LOOPS, RL_K = 1, 8
|
| 98 |
+
RL_RETRY_LOOPS, RL_RETRY_K = (2, 4, 8), 24
|
| 99 |
+
# The fine-tune sees FT_RECORDS records per round, half the old harness's 600 steps x 128: in
|
| 100 |
+
# 509 the fine-tune had grown to ~74 s of a ~137 s round, so halving it fits about 16 rounds of
|
| 101 |
+
# sampling in RL_SECS instead of 11, with 27% fewer fine-tune records per run; the mix (20-33k
|
| 102 |
+
# records) still gets at least one epoch per round. Records come in the same token-budget
|
| 103 |
+
# batches as pretraining (TOK_BUDGET below) instead of 128-record batches padded to their
|
| 104 |
+
# longest proof, which with 7-14 line RL proofs in nearly every batch was ~3x the content.
|
| 105 |
+
# It uses pretraining's optimizer split: Muon (muon_step, MUON_WD) on the block matrices and the
|
| 106 |
+
# head, AdamW at FT_LR on embeddings, norms and biases. FT_MUON_LR keeps pretraining's 10:1
|
| 107 |
+
# Muon:AdamW ratio and is where pretraining's cosine ends (MUON_LR * MIN_LR_FRAC).
|
| 108 |
+
FT_RECORDS, FT_LR, FT_MUON_LR, FT_WARMUP = 300 * 128, 3e-4, 3e-3, 50
|
| 109 |
+
RETAIN, MAX_PER_THM, RL_WEIGHT = 20000, 4, 4
|
| 110 |
+
# MLP width held at 151's 1280: the fork's Block hardcodes 4 * D (1536 at D 384 would pass the
|
| 111 |
+
# 10M cap), so PeriLNBlock swaps fc1/fc2. 1280 != 3 * D keeps muon_step's QKV-by-shape test valid.
|
| 112 |
+
D_FF = 1280
|
| 113 |
+
BS, LR, MIN_LR_FRAC, WD = 128, 1e-3, 0.3, 0.1
|
| 114 |
+
MUON_LR, MUON_MOMENTUM = 0.01, 0.95
|
| 115 |
+
# Polar Express (Amsel et al. 2025) per-iteration quintic coefficients, as in modded-nanogpt
|
| 116 |
+
# (num_iters=5, safety factor 2e-2): singular values land in ~[0.86, 1.14] instead of the
|
| 117 |
+
# fixed quintic's ~[0.68, 1.13], at the same five iterations.
|
| 118 |
+
NS_COEFFS = (
|
| 119 |
+
(8.156554524902461, -22.48329292557795, 15.878769915207462),
|
| 120 |
+
(4.042929935166739, -2.808917465908714, 0.5000178451051316),
|
| 121 |
+
(3.8916678022926607, -2.772484153217685, 0.5060648178503393),
|
| 122 |
+
(3.285753657755655, -2.3681294933425376, 0.46449024233003106),
|
| 123 |
+
(2.3465413258596377, -1.7097828382687081, 0.42323551169305323),
|
| 124 |
+
)
|
| 125 |
+
# Ten times the AdamW group's per-step multiplicative decay (lr * wd) on the Muon matrices.
|
| 126 |
+
MUON_WD = 10 * WD * LR / MUON_LR
|
| 127 |
+
TOK_MODE = "lean_seq" # required by the harness (Lean protocol)
|
| 128 |
+
# Hybrid heads: half the heads get ALiBi (Press et al. 2021) with the standard slope set for
|
| 129 |
+
# H/2 heads, 2^(-8 i / (H/2)) = 1/4 .. 1/256 with 8 heads; the other half get slope 0, i.e. no
|
| 130 |
+
# positional signal at all (NoPE), so they can look citations up by content at any distance.
|
| 131 |
+
N_ALIBI = N_HEAD // 2
|
| 132 |
+
ALIBI_SLOPES = tuple(2.0 ** (-8.0 * (i + 1) / N_ALIBI) for i in range(N_ALIBI)) + (0.0,) * (
|
| 133 |
+
N_HEAD - N_ALIBI
|
| 134 |
+
)
|
| 135 |
+
VAL_N, CURVE_EVERY = 1024, 15 # records held out for val_loss; seconds between curve points
|
| 136 |
+
# Token-budget batches (fairseq max-tokens): each step takes a run of length-sorted records with
|
| 137 |
+
# count * padded_length <= TOK_BUDGET, so a batch of short proofs has many records and a batch of
|
| 138 |
+
# long ones few, and the padded token count per step is ~constant. 128 x 144 matches the real
|
| 139 |
+
# (unpadded) tokens of the incumbent's 128-record batches (mean record ~135 tokens), whose
|
| 140 |
+
# padding to the batch max (~400) made every step ~3x larger than its content.
|
| 141 |
+
TOK_BUDGET = 128 * 144
|
| 142 |
+
# Multi-token prediction (DeepSeek-V3 2024, Gloeckle et al. 2024), pretraining only: one extra
|
| 143 |
+
# Peri-LN block reads [trunk state at t; embedding of token t+1] and predicts token t+2 through
|
| 144 |
+
# the model's own ln_f/head. Its loss is added at this weight (DeepSeek-V3's early-training value).
|
| 145 |
+
MTP_WEIGHT = 0.3
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
# Muon update adapted from KellerJordan/Muon, commit
|
| 149 |
+
# f98f1cacc0263b04290753e32be8d498c1efc806 (muon.py).
|
| 150 |
+
# MIT License
|
| 151 |
+
# Copyright (c) 2024 Keller Jordan
|
| 152 |
+
#
|
| 153 |
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 154 |
+
# of this software and associated documentation files (the "Software"), to deal
|
| 155 |
+
# in the Software without restriction, including without limitation the rights
|
| 156 |
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 157 |
+
# copies of the Software, and to permit persons to whom the Software is
|
| 158 |
+
# furnished to do so, subject to the following conditions:
|
| 159 |
+
# The above copyright notice and this permission notice shall be included in all
|
| 160 |
+
# copies or substantial portions of the Software.
|
| 161 |
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 162 |
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 163 |
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 164 |
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 165 |
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 166 |
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 167 |
+
# SOFTWARE.
|
| 168 |
+
@torch.no_grad()
|
| 169 |
+
def muon_step(params, buffers, lr):
|
| 170 |
+
"""Nesterov momentum plus five bf16 Polar Express steps, on hidden matrices only."""
|
| 171 |
+
for p, momentum in zip(params, buffers, strict=True):
|
| 172 |
+
if p.grad is None:
|
| 173 |
+
continue
|
| 174 |
+
momentum.lerp_(p.grad, 1 - MUON_MOMENTUM)
|
| 175 |
+
update = p.grad.lerp(momentum, MUON_MOMENTUM).bfloat16()
|
| 176 |
+
# Only QKV has shape (3D, D) in this GPT; orthogonalize its roles separately.
|
| 177 |
+
if update.size(0) == 3 * update.size(1):
|
| 178 |
+
update = update.reshape(3, update.size(1), update.size(1))
|
| 179 |
+
transpose = update.size(-2) > update.size(-1)
|
| 180 |
+
if transpose:
|
| 181 |
+
update = update.mT
|
| 182 |
+
update = update / (update.norm(dim=(-2, -1), keepdim=True) * (1 + 2e-2) + 1e-6)
|
| 183 |
+
for a, b, c in NS_COEFFS:
|
| 184 |
+
gram = update @ update.mT
|
| 185 |
+
polynomial = b * gram + c * gram @ gram
|
| 186 |
+
update = a * update + polynomial @ update
|
| 187 |
+
if transpose:
|
| 188 |
+
update = update.mT
|
| 189 |
+
p.mul_(1 - lr * MUON_WD)
|
| 190 |
+
# lr may be a 0-d tensor (CUDA-graphed step); scale in p's dtype like add_(alpha=-lr)
|
| 191 |
+
p.sub_(lr * update.reshape_as(p).to(p.dtype))
|
| 192 |
+
|
| 193 |
+
|
| 194 |
+
class MuonStep:
|
| 195 |
+
"""muon_step on `matrices` with fresh momentum buffers, called once per step after backward
|
| 196 |
+
(grads must keep fixed addresses: zero_grad(set_to_none=False)). On CUDA the first call
|
| 197 |
+
captures the step as one CUDA graph and later calls replay it instead of ~400 kernel
|
| 198 |
+
launches; CPU smoke runs call muon_step directly."""
|
| 199 |
+
|
| 200 |
+
def __init__(self, matrices, device):
|
| 201 |
+
self.matrices, self.device = matrices, device
|
| 202 |
+
self.buffers = [torch.zeros_like(p) for p in matrices]
|
| 203 |
+
self.lr, self.graph = torch.zeros((), device=device), None
|
| 204 |
+
|
| 205 |
+
def __call__(self, lr):
|
| 206 |
+
self.lr.fill_(lr)
|
| 207 |
+
if self.device != "cuda":
|
| 208 |
+
muon_step(self.matrices, self.buffers, self.lr)
|
| 209 |
+
return
|
| 210 |
+
if self.graph is None:
|
| 211 |
+
state = self.matrices + self.buffers
|
| 212 |
+
saved = [t.clone() for t in state]
|
| 213 |
+
side = torch.cuda.Stream()
|
| 214 |
+
side.wait_stream(torch.cuda.current_stream())
|
| 215 |
+
with torch.cuda.stream(side):
|
| 216 |
+
muon_step(self.matrices, self.buffers, self.lr) # warm-up (lazy cuBLAS init)
|
| 217 |
+
torch.cuda.current_stream().wait_stream(side)
|
| 218 |
+
self.graph = torch.cuda.CUDAGraph()
|
| 219 |
+
with torch.cuda.graph(self.graph):
|
| 220 |
+
muon_step(self.matrices, self.buffers, self.lr)
|
| 221 |
+
with torch.no_grad():
|
| 222 |
+
for t, v in zip(state, saved, strict=True):
|
| 223 |
+
t.copy_(v) # undo the warm-up and capture updates
|
| 224 |
+
self.graph.replay()
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
class PeriLNBlock(Block):
|
| 228 |
+
"""P22 Peri-LN (Kim et al. 2025): the fork's pre-LN block plus a LayerNorm on each branch
|
| 229 |
+
output, so every residual write has unit scale times a learned gain. Attention has no RoPE:
|
| 230 |
+
`mask` is the additive ALiBi bias (B or 1, H, T, S) that LoopedGPT builds once per forward
|
| 231 |
+
and cos/sin are unused."""
|
| 232 |
+
|
| 233 |
+
def __init__(self, d, h):
|
| 234 |
+
super().__init__(d, h)
|
| 235 |
+
self.fc1, self.fc2 = torch.nn.Linear(d, D_FF), torch.nn.Linear(D_FF, d)
|
| 236 |
+
self.ln_attn_out, self.ln_mlp_out = torch.nn.LayerNorm(d), torch.nn.LayerNorm(d)
|
| 237 |
+
|
| 238 |
+
def attn(self, x, cos, sin, mask, cache):
|
| 239 |
+
B, T, D = x.shape
|
| 240 |
+
q, k, v = self.qkv(x).view(B, T, 3, self.h, D // self.h).permute(2, 0, 3, 1, 4)
|
| 241 |
+
if cache is not None: # the fork's preallocated KV cache, unchanged
|
| 242 |
+
if "k" not in cache:
|
| 243 |
+
cache["k"] = k.new_empty(B, self.h, cache["max"], D // self.h)
|
| 244 |
+
cache["v"] = v.new_empty(B, self.h, cache["max"], D // self.h)
|
| 245 |
+
cache["n"] = 0
|
| 246 |
+
n0, n1 = cache["n"], cache["n"] + T
|
| 247 |
+
cache["k"][:, :, n0:n1] = k
|
| 248 |
+
cache["v"][:, :, n0:n1] = v
|
| 249 |
+
cache["n"] = n1
|
| 250 |
+
k, v = cache["k"][:, :, :n1], cache["v"][:, :, :n1]
|
| 251 |
+
y = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=mask.to(q.dtype))
|
| 252 |
+
return self.proj(y.transpose(1, 2).reshape(B, T, D))
|
| 253 |
+
|
| 254 |
+
def forward(self, x, cos, sin, mask=None, cache=None):
|
| 255 |
+
x = x + self.ln_attn_out(self.attn(self.ln1(x), cos, sin, mask, cache))
|
| 256 |
+
return x + self.ln_mlp_out(self.fc2(torch.nn.functional.gelu(self.fc1(self.ln2(x)))))
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
class LoopedGPT(GPT):
|
| 260 |
+
"""Looped trunk (Universal Transformer, Dehghani et al. 2018; sandwich layout and input
|
| 261 |
+
injection as in Geiping et al. 2025): blocks[0] is the entry block, blocks[1:-1] the core
|
| 262 |
+
pairs, of which loop k applies pair k % N_PAIRS, blocks[-1] the exit block. Every core pass
|
| 263 |
+
starts from ln_loop(state) + e, with e the entry block's output, so each pass sees an input
|
| 264 |
+
of the same scale and the prompt is re-injected instead of being buried under accumulated
|
| 265 |
+
writes.
|
| 266 |
+
|
| 267 |
+
P34: the fork's GPT with ALiBi (Press et al. 2021) instead of RoPE. Head h's attention
|
| 268 |
+
logits get -slope_h * (query position - key position), slopes 2^-1 .. 2^-8 for 8 heads, so
|
| 269 |
+
no rotation of q/k anywhere. Positions come from `pos` (sample.generate's left-padded
|
| 270 |
+
batches) or arange; key positions are kept in caches[0] so cached decoding sees the same
|
| 271 |
+
bias as the full forward. Causality/padding come from `mask` when given, else from rel < 0."""
|
| 272 |
+
|
| 273 |
+
def __init__(self, vocab, n_layer, d, n_head, seed, max_len=1024):
|
| 274 |
+
super().__init__(vocab, n_layer, d, n_head, max_len)
|
| 275 |
+
slopes = torch.tensor(ALIBI_SLOPES).view(1, n_head, 1, 1)
|
| 276 |
+
self.register_buffer("slopes", slopes, persistent=False)
|
| 277 |
+
self.ln_loop = torch.nn.LayerNorm(d)
|
| 278 |
+
self.n_loops, self.loop_rng = DEFAULT_LOOPS, random.Random(seed)
|
| 279 |
+
# Control 590's patch: run 198's trunk, the six blocks independent and applied once; n_loops is ignored.
|
| 280 |
+
self.untied = ARCH == "untied"
|
| 281 |
+
|
| 282 |
+
def kv_layers(self):
|
| 283 |
+
"""KV-cache layers sampling allocates at the current n_loops (the harness sizes batches by it)."""
|
| 284 |
+
return len(self.blocks) if self.untied else 2 + N_CORE * self.n_loops
|
| 285 |
+
|
| 286 |
+
def forward(self, idx, pos=None, mask=None, caches=None):
|
| 287 |
+
return self.head(self.ln_f(self.features(idx, pos, mask, caches)[0]))
|
| 288 |
+
|
| 289 |
+
def features(self, idx, pos=None, mask=None, caches=None):
|
| 290 |
+
"""The trunk: (final hidden state before ln_f, the ALiBi bias used)."""
|
| 291 |
+
B, T = idx.shape
|
| 292 |
+
if pos is None: # training/val: one (1, H, T, T) bias broadcast over the batch
|
| 293 |
+
pos = torch.arange(T, device=idx.device)[None]
|
| 294 |
+
key_pos = pos
|
| 295 |
+
if caches is not None: # incremental decoding: keys are every cached token
|
| 296 |
+
c = caches[0]
|
| 297 |
+
if "pos" not in c:
|
| 298 |
+
c["pos"], c["n_pos"] = pos.new_empty(pos.size(0), c["max"]), 0
|
| 299 |
+
n0, n1 = c["n_pos"], c["n_pos"] + T
|
| 300 |
+
c["pos"][:, n0:n1] = pos
|
| 301 |
+
c["n_pos"] = n1
|
| 302 |
+
key_pos = c["pos"][:, :n1]
|
| 303 |
+
rel = pos[:, None, :, None] - key_pos[:, None, None, :] # (B or 1, 1, T, S)
|
| 304 |
+
bias = -self.slopes * rel.to(self.slopes.dtype)
|
| 305 |
+
bias = bias.masked_fill(rel < 0 if mask is None else ~mask, float("-inf"))
|
| 306 |
+
if self.untied:
|
| 307 |
+
x = self.emb(idx)
|
| 308 |
+
for j, b in enumerate(self.blocks):
|
| 309 |
+
x = b(x, None, None, bias, None if caches is None else caches[j])
|
| 310 |
+
return x, bias
|
| 311 |
+
n = self.loop_rng.choice(TRAIN_LOOPS) if self.training else self.n_loops
|
| 312 |
+
entry, *core, exit_block = self.blocks
|
| 313 |
+
x = e = entry(self.emb(idx), None, None, bias, None if caches is None else caches[0])
|
| 314 |
+
for loop in range(n):
|
| 315 |
+
x = self.ln_loop(x) + e
|
| 316 |
+
for i in range(N_CORE):
|
| 317 |
+
j = 1 + (loop % N_PAIRS) * N_CORE + i # index in self.blocks
|
| 318 |
+
# sample.generate makes one cache dict per unique block; a shared block's keys
|
| 319 |
+
# and values differ per pass, so each pass gets its own sub-cache inside it.
|
| 320 |
+
c = caches and caches[j].setdefault(loop, {"max": caches[j]["max"]})
|
| 321 |
+
x = core[j - 1](x, None, None, bias, c)
|
| 322 |
+
x = exit_block(x, None, None, bias, None if caches is None else caches[-1])
|
| 323 |
+
return x, bias
|
| 324 |
+
|
| 325 |
+
|
| 326 |
+
class MTPHead(torch.nn.Module):
|
| 327 |
+
"""The MTP module. A separate nn.Module, never registered on the model, so the harness's
|
| 328 |
+
parameter count, RL AdamW and sampler never see it; it is dropped when pretrain() returns."""
|
| 329 |
+
|
| 330 |
+
def __init__(self, d, h):
|
| 331 |
+
super().__init__()
|
| 332 |
+
self.ln_h, self.ln_e = torch.nn.LayerNorm(d), torch.nn.LayerNorm(d)
|
| 333 |
+
self.proj = torch.nn.Linear(2 * d, d, bias=False)
|
| 334 |
+
self.block = PeriLNBlock(d, h)
|
| 335 |
+
|
| 336 |
+
|
| 337 |
+
def mtp_loss(model, mtp, x, m):
|
| 338 |
+
"""The fork's loss_on (next-token CE on proof tokens) plus MTP_WEIGHT times the CE of the
|
| 339 |
+
MTP module's token-(t+2) prediction at the same proof positions. Returns (total, main)."""
|
| 340 |
+
h, bias = model.features(x[:, :-1])
|
| 341 |
+
logits = model.head(model.ln_f(h))
|
| 342 |
+
V = logits.size(-1)
|
| 343 |
+
ce = torch.nn.functional.cross_entropy(
|
| 344 |
+
logits.reshape(-1, V).float(), x[:, 1:].reshape(-1), reduction="none"
|
| 345 |
+
)
|
| 346 |
+
main = (ce * m[:, 1:].reshape(-1)).sum() / m[:, 1:].sum()
|
| 347 |
+
# Position t (0..T-3) gets h_t and emb(x_{t+1}); causal attention over these keeps every
|
| 348 |
+
# prediction of x_{t+2} a function of x_{<=t+1}.
|
| 349 |
+
z = mtp.proj(torch.cat((mtp.ln_h(h[:, :-1]), mtp.ln_e(model.emb(x[:, 1:-1]))), -1))
|
| 350 |
+
z = mtp.block(z, None, None, bias[..., :-1, :-1], None)
|
| 351 |
+
ce2 = torch.nn.functional.cross_entropy(
|
| 352 |
+
model.head(model.ln_f(z)).reshape(-1, V).float(), x[:, 2:].reshape(-1), reduction="none"
|
| 353 |
+
)
|
| 354 |
+
aux = (ce2 * m[:, 2:].reshape(-1)).sum() / m[:, 2:].sum().clamp(min=1)
|
| 355 |
+
return main + MTP_WEIGHT * aux, main, aux
|
| 356 |
+
|
| 357 |
+
|
| 358 |
+
def val_loss(model, ids, mask, ref_max, lens, tok, gen, autocast):
|
| 359 |
+
"""Mean loss over the first VAL_N records (never trained on), no shift augmentation."""
|
| 360 |
+
model.eval()
|
| 361 |
+
tot = 0.0
|
| 362 |
+
with torch.no_grad(), autocast:
|
| 363 |
+
for i in range(0, VAL_N, BS):
|
| 364 |
+
idxs = torch.arange(i, min(i + BS, VAL_N), device=ids.device)
|
| 365 |
+
x, m = ids[idxs], mask[idxs]
|
| 366 |
+
T = int(lens[idxs].max())
|
| 367 |
+
tot += loss_on(model, x[:, :T], m[:, :T]).item() * len(idxs)
|
| 368 |
+
model.train()
|
| 369 |
+
return tot / VAL_N
|
| 370 |
+
|
| 371 |
+
|
| 372 |
+
def to_gpu(data, tok, device):
|
| 373 |
+
"""Pad all (prompt, proof) records once into (N, T) ids + proof mask on the device."""
|
| 374 |
+
N, T = len(data), max(len(p) + len(q) for p, q in data)
|
| 375 |
+
ids = torch.full((N, T), tok.pad, dtype=torch.long)
|
| 376 |
+
mask = torch.zeros((N, T), dtype=torch.bool)
|
| 377 |
+
ref_max = torch.zeros(
|
| 378 |
+
N, dtype=torch.long
|
| 379 |
+
) # largest N<k> index used in the proof, for the shift augmentation
|
| 380 |
+
for i, (p, q) in enumerate(data):
|
| 381 |
+
ids[i, : len(p) + len(q)] = torch.tensor(p + q)
|
| 382 |
+
mask[i, len(p) : len(p) + len(q)] = True
|
| 383 |
+
ref_max[i] = max((x - tok.ref0 + 1 for x in q if x >= tok.ref0), default=0)
|
| 384 |
+
return ids.to(device), mask.to(device), ref_max.to(device), (ids != tok.pad).sum(1).to(device)
|
| 385 |
+
|
| 386 |
+
|
| 387 |
+
def token_batches(lens, n_train, gen, rng, first=VAL_N):
|
| 388 |
+
"""One epoch of token-budget batches: a random permutation of the n_train records from
|
| 389 |
+
`first` on, stably sorted by length (equal lengths stay shuffled), cut greedily into runs of
|
| 390 |
+
consecutive records with count * max_len <= TOK_BUDGET, and the runs' order shuffled.
|
| 391 |
+
Returns (order, cuts)."""
|
| 392 |
+
perm = torch.randperm(n_train, device=lens.device, generator=gen) + first
|
| 393 |
+
order = perm[torch.argsort(lens[perm], stable=True)]
|
| 394 |
+
sorted_lens = lens[order].cpu()
|
| 395 |
+
cuts, s = [], 0
|
| 396 |
+
while s < len(sorted_lens):
|
| 397 |
+
window = sorted_lens[s : s + TOK_BUDGET // int(sorted_lens[s])]
|
| 398 |
+
# count * max_len is non-decreasing along the window, so the fits form a prefix.
|
| 399 |
+
e = s + int((torch.arange(1, len(window) + 1) * window <= TOK_BUDGET).sum())
|
| 400 |
+
cuts.append((s, e, int(sorted_lens[e - 1]))) # sorted: last is the batch's max length
|
| 401 |
+
s = e
|
| 402 |
+
rng.shuffle(cuts)
|
| 403 |
+
return order, cuts
|
| 404 |
+
|
| 405 |
+
|
| 406 |
+
def gpu_batch(ids, mask, ref_max, lens, idxs, tok, gen, max_len=None, augment=True):
|
| 407 |
+
"""The fork's batch() + tok.shift_abs, vectorised: a random per-row offset is added to
|
| 408 |
+
every ref token, and each row's atoms go through a random permutation of the ten atom tokens
|
| 409 |
+
(positions after the statement header, which declares all ten in a fixed order). augment=False
|
| 410 |
+
leaves rows as sampled (policy-gradient rollouts)."""
|
| 411 |
+
x, m = ids[idxs], mask[idxs]
|
| 412 |
+
# Known on the host for training batches: passing it avoids a GPU sync every step.
|
| 413 |
+
T = int(lens[idxs].max()) if max_len is None else max_len
|
| 414 |
+
x, m = x[:, :T].clone(), m[:, :T]
|
| 415 |
+
if not augment:
|
| 416 |
+
return x, m
|
| 417 |
+
atom_ids = torch.tensor(tok.atom_ids, device=x.device)
|
| 418 |
+
slot = torch.full((tok.vocab_size,), -1, dtype=torch.long, device=x.device)
|
| 419 |
+
slot[atom_ids] = torch.arange(len(atom_ids), device=x.device)
|
| 420 |
+
a = slot[x]
|
| 421 |
+
a[:, :HEADER_LEN] = -1
|
| 422 |
+
perm = torch.rand(len(idxs), len(atom_ids), device=x.device, generator=gen).argsort(1)
|
| 423 |
+
x = torch.where(a >= 0, atom_ids[perm.gather(1, a.clamp(min=0))], x)
|
| 424 |
+
if tok.mode in ("abs", "lean_seq"): # lean_seq: names n1.. get the same start offset
|
| 425 |
+
room = MAXN - ref_max[idxs]
|
| 426 |
+
shift = (
|
| 427 |
+
(torch.rand(len(idxs), device=x.device, generator=gen) * (room + 1))
|
| 428 |
+
.long()
|
| 429 |
+
.clamp(max=room)
|
| 430 |
+
)
|
| 431 |
+
is_ref = (x >= tok.ref0) & m
|
| 432 |
+
x = torch.where(is_ref, x + shift[:, None], x)
|
| 433 |
+
return x, m
|
| 434 |
+
|
| 435 |
+
|
| 436 |
+
def pretrain(train_recs, budget_secs, device, seed, log):
|
| 437 |
+
t0 = time.time()
|
| 438 |
+
tok = make_tokenizer(TOK_MODE)
|
| 439 |
+
data = [(tok.encode_prompt(r["prompt"]), tok.encode_proof(r["proof"])) for r in train_recs]
|
| 440 |
+
ids, mask, ref_max, lens = to_gpu(data, tok, device)
|
| 441 |
+
gen = torch.Generator(device=device)
|
| 442 |
+
gen.manual_seed(seed)
|
| 443 |
+
model = LoopedGPT(tok.vocab_size, N_LAYER, D, N_HEAD, seed)
|
| 444 |
+
model.blocks = torch.nn.ModuleList(PeriLNBlock(D, N_HEAD) for _ in range(N_LAYER))
|
| 445 |
+
model.blocks.apply(model._init) # fork init: zero biases
|
| 446 |
+
model = model.to(device)
|
| 447 |
+
mtp = MTPHead(D, N_HEAD)
|
| 448 |
+
mtp.apply(model._init)
|
| 449 |
+
mtp = mtp.to(device)
|
| 450 |
+
# Compile the repeated blocks once each (torch >= 2.9; dynamic shapes, ~14 s): ~14% faster
|
| 451 |
+
# steps. The coalescing tiling analysis crashes on dynamic shapes, so it is off. Undone at
|
| 452 |
+
# handoff so the harness's RL fine-tune and KV-cache sampling run eager.
|
| 453 |
+
torch._inductor.config.triton.coalesce_tiling_analysis = False
|
| 454 |
+
compiled = list(model.blocks) + [mtp.block]
|
| 455 |
+
for b in compiled if device == "cuda" else []: # CPU smoke runs stay eager
|
| 456 |
+
b.compile(dynamic=True)
|
| 457 |
+
for p in list(model.blocks.parameters()) + list(mtp.parameters()):
|
| 458 |
+
if p.ndim == 2:
|
| 459 |
+
# Orthogonal matrices have element second moment gain^2 / max(rows, cols).
|
| 460 |
+
torch.nn.init.orthogonal_(p, gain=0.02 * math.sqrt(max(p.shape)))
|
| 461 |
+
log(
|
| 462 |
+
f"pretrain: {model.n_params():,} params, {len(data):,} records on {device} "
|
| 463 |
+
f"after {time.time() - t0:.0f}s, budget {budget_secs}s"
|
| 464 |
+
)
|
| 465 |
+
# The output readout joins the hidden matrices under Muon; embeddings stay on AdamW.
|
| 466 |
+
trainable = list(model.parameters()) + list(mtp.parameters())
|
| 467 |
+
matrices = [p for p in model.blocks.parameters() if p.ndim == 2] + [model.head.weight]
|
| 468 |
+
matrices += [p for p in mtp.parameters() if p.ndim == 2]
|
| 469 |
+
matrix_ids = {id(p) for p in matrices}
|
| 470 |
+
auxiliary = [p for p in trainable if id(p) not in matrix_ids]
|
| 471 |
+
muon = MuonStep(matrices, device)
|
| 472 |
+
opt = torch.optim.AdamW(
|
| 473 |
+
auxiliary, lr=LR, weight_decay=WD, betas=(0.9, 0.95), fused=device == "cuda"
|
| 474 |
+
)
|
| 475 |
+
autocast = torch.autocast("cuda", dtype=torch.bfloat16, enabled=(device == "cuda"))
|
| 476 |
+
model.train()
|
| 477 |
+
step, last_loss, records_seen = 0, float("nan"), 0
|
| 478 |
+
curve, recent, recent_aux, next_point = [], [], [], CURVE_EVERY
|
| 479 |
+
n_train = len(data) - VAL_N # records [0, VAL_N) are the val slice
|
| 480 |
+
rng, cuts, batches_per_epoch = random.Random(seed), [], None
|
| 481 |
+
order = torch.empty(0, dtype=torch.long, device=device)
|
| 482 |
+
while True:
|
| 483 |
+
frac = (
|
| 484 |
+
time.time() - t0
|
| 485 |
+
) / budget_secs # cosine over wall-clock, so the cap is the schedule
|
| 486 |
+
if frac >= 1.0:
|
| 487 |
+
break
|
| 488 |
+
step += 1
|
| 489 |
+
# No warmup (as in modded-nanogpt): Muon's step is normalized and Adam's is ~lr per
|
| 490 |
+
# element from step 1, and Peri-LN normalizes every branch write.
|
| 491 |
+
lr = LR * MIN_LR_FRAC + 0.5 * LR * (1 - MIN_LR_FRAC) * (1 + math.cos(math.pi * frac))
|
| 492 |
+
for g in opt.param_groups:
|
| 493 |
+
g["lr"] = lr
|
| 494 |
+
if not cuts: # new epoch
|
| 495 |
+
order, cuts = token_batches(lens, n_train, gen, rng)
|
| 496 |
+
batches_per_epoch = len(cuts)
|
| 497 |
+
s, e, T = cuts.pop()
|
| 498 |
+
idxs = order[s:e]
|
| 499 |
+
records_seen += e - s
|
| 500 |
+
x, m = gpu_batch(ids, mask, ref_max, lens, idxs, tok, gen, T)
|
| 501 |
+
with autocast:
|
| 502 |
+
loss, main, aux = mtp_loss(model, mtp, x, m)
|
| 503 |
+
model.zero_grad(set_to_none=False) # grads keep fixed addresses for the Muon CUDA graph
|
| 504 |
+
mtp.zero_grad(set_to_none=False)
|
| 505 |
+
loss.backward()
|
| 506 |
+
torch.nn.utils.clip_grad_norm_(trainable, 1.0)
|
| 507 |
+
opt.step()
|
| 508 |
+
muon(MUON_LR * lr / LR)
|
| 509 |
+
if step % 20 == 0:
|
| 510 |
+
last_loss = main.item() # the next-token CE, comparable with earlier runs
|
| 511 |
+
recent.append(last_loss)
|
| 512 |
+
recent_aux.append(aux.item())
|
| 513 |
+
if (
|
| 514 |
+
time.time() - t0 >= next_point
|
| 515 |
+
): # curve point: mean recent train loss + val loss on the held-out slice
|
| 516 |
+
curve.append(
|
| 517 |
+
{
|
| 518 |
+
"secs": round(time.time() - t0),
|
| 519 |
+
"step": step,
|
| 520 |
+
"train_loss": sum(recent) / len(recent) if recent else last_loss,
|
| 521 |
+
"val_loss": val_loss(model, ids, mask, ref_max, lens, tok, gen, autocast),
|
| 522 |
+
"mtp_loss": sum(recent_aux) / len(recent_aux) if recent_aux else None,
|
| 523 |
+
}
|
| 524 |
+
)
|
| 525 |
+
log(
|
| 526 |
+
f"pretrain step {step} train {curve[-1]['train_loss']:.4f} "
|
| 527 |
+
f"val {curve[-1]['val_loss']:.4f} lr {lr:.2e} {curve[-1]['secs']}s"
|
| 528 |
+
)
|
| 529 |
+
recent, recent_aux, next_point = [], [], next_point + CURVE_EVERY
|
| 530 |
+
val_by_loops = {}
|
| 531 |
+
for n in (VAL_LOOPS if not model.untied else (DEFAULT_LOOPS,)) if step else (): # no steps: a checkpoint rebuild, not a training run
|
| 532 |
+
model.n_loops = n
|
| 533 |
+
val_by_loops[n] = val_loss(model, ids, mask, ref_max, lens, tok, gen, autocast)
|
| 534 |
+
model.n_loops = DEFAULT_LOOPS
|
| 535 |
+
log(f"pretrain val loss by loops: {val_by_loops}")
|
| 536 |
+
for b in compiled:
|
| 537 |
+
b._compiled_call_impl = None
|
| 538 |
+
model.eval()
|
| 539 |
+
return (
|
| 540 |
+
model,
|
| 541 |
+
tok,
|
| 542 |
+
{
|
| 543 |
+
"steps": step,
|
| 544 |
+
"records_seen": records_seen,
|
| 545 |
+
"epochs": records_seen / n_train,
|
| 546 |
+
"batches_per_epoch": batches_per_epoch,
|
| 547 |
+
"tok_budget": TOK_BUDGET,
|
| 548 |
+
"last_loss": last_loss,
|
| 549 |
+
"train_loops": TRAIN_LOOPS,
|
| 550 |
+
"default_loops": DEFAULT_LOOPS,
|
| 551 |
+
"val_by_loops": val_by_loops,
|
| 552 |
+
"curve": curve,
|
| 553 |
+
},
|
| 554 |
+
)
|
| 555 |
+
|
| 556 |
+
|
| 557 |
+
def finetune(model, tok, data, rng, device):
|
| 558 |
+
"""The RL fine-tune: pretraining's optimizers (Muon on the hidden matrices, AdamW on the
|
| 559 |
+
rest), linear warmup then cosine to lr/10, over FT_RECORDS records in token-budget batches
|
| 560 |
+
(to_gpu / token_batches / gpu_batch, as pretraining). Muon's momentum restarts every round,
|
| 561 |
+
as AdamW's moments did. The model is in train mode, so every batch draws its own loop count
|
| 562 |
+
from TRAIN_LOOPS. Returns (last loss, steps)."""
|
| 563 |
+
ids, mask, ref_max, lens = to_gpu(data, tok, device)
|
| 564 |
+
gen = torch.Generator(device=device)
|
| 565 |
+
gen.manual_seed(rng.getrandbits(31))
|
| 566 |
+
plan, seen = [], 0 # (order, start, end, padded length) per step, epoch after epoch
|
| 567 |
+
while seen < FT_RECORDS:
|
| 568 |
+
order, cuts = token_batches(lens, len(data), gen, rng, first=0)
|
| 569 |
+
for s, e, T in cuts:
|
| 570 |
+
if seen >= FT_RECORDS:
|
| 571 |
+
break
|
| 572 |
+
plan.append((order, s, e, T))
|
| 573 |
+
seen += e - s
|
| 574 |
+
matrices = [p for p in model.blocks.parameters() if p.ndim == 2] + [model.head.weight]
|
| 575 |
+
matrix_ids = {id(p) for p in matrices}
|
| 576 |
+
auxiliary = [p for p in model.parameters() if id(p) not in matrix_ids]
|
| 577 |
+
opt = torch.optim.AdamW(auxiliary, lr=FT_LR, weight_decay=0.1, betas=(0.9, 0.95))
|
| 578 |
+
muon = MuonStep(matrices, device)
|
| 579 |
+
autocast = torch.autocast("cuda", dtype=torch.bfloat16, enabled=(device == "cuda"))
|
| 580 |
+
model.train()
|
| 581 |
+
for step, (order, s, e, T) in enumerate(plan, 1):
|
| 582 |
+
lr = (
|
| 583 |
+
FT_LR * step / FT_WARMUP
|
| 584 |
+
if step < FT_WARMUP
|
| 585 |
+
else FT_LR / 10 + 0.45 * FT_LR * (1 + math.cos(math.pi * step / len(plan)))
|
| 586 |
+
)
|
| 587 |
+
for g in opt.param_groups:
|
| 588 |
+
g["lr"] = lr
|
| 589 |
+
x, m = gpu_batch(ids, mask, ref_max, lens, order[s:e], tok, gen, T)
|
| 590 |
+
with autocast:
|
| 591 |
+
loss = loss_on(model, x, m)
|
| 592 |
+
model.zero_grad(set_to_none=False) # grads keep fixed addresses for the Muon CUDA graph
|
| 593 |
+
loss.backward()
|
| 594 |
+
torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0)
|
| 595 |
+
opt.step()
|
| 596 |
+
muon(FT_MUON_LR * lr / FT_LR)
|
| 597 |
+
model.eval()
|
| 598 |
+
return loss.item(), len(plan)
|
| 599 |
+
|
| 600 |
+
|
| 601 |
+
# Targets per round, picked by pick_targets: the old harness's fixed 1,500 targets, now drawn from the
|
| 602 |
+
# whole pool (thousands, body 7 to ~45) with the samples aimed at the frontier.
|
| 603 |
+
N_ROUND = 1500
|
| 604 |
+
|
| 605 |
+
|
| 606 |
+
def pick_targets(targets, found, rng, n=N_ROUND):
|
| 607 |
+
"""n targets for this round. Bands (body lines) get weight 0.1 + their solved fraction up to one
|
| 608 |
+
band past the highest band with any solve, and 0.02 beyond it, so sampling follows the frontier
|
| 609 |
+
instead of spending most of a round on targets far out of reach; within a band, unsolved targets
|
| 610 |
+
come first."""
|
| 611 |
+
bands = sorted({t["band"] for t in targets}, key=lambda b: int(b.split("-")[0].rstrip("+")))
|
| 612 |
+
by = {b: [t for t in targets if t["band"] == b] for b in bands}
|
| 613 |
+
rate = {b: sum(bool(found[t["name"]]) for t in by[b]) / len(by[b]) for b in bands}
|
| 614 |
+
top = max((i for i, b in enumerate(bands) if rate[b] > 0), default=-1)
|
| 615 |
+
w = {b: (0.1 + rate[b]) if i <= top + 1 else 0.02 for i, b in enumerate(bands)}
|
| 616 |
+
out = []
|
| 617 |
+
for b in bands:
|
| 618 |
+
k = min(len(by[b]), round(n * w[b] / sum(w.values())))
|
| 619 |
+
unsolved = [t for t in by[b] if not found[t["name"]]]
|
| 620 |
+
solved = [t for t in by[b] if found[t["name"]]]
|
| 621 |
+
rng.shuffle(unsolved)
|
| 622 |
+
rng.shuffle(solved)
|
| 623 |
+
out += (unsolved + solved)[:k]
|
| 624 |
+
return out
|
| 625 |
+
|
| 626 |
+
|
| 627 |
+
@torch.no_grad()
|
| 628 |
+
def rollout_stats(model, tok, rows, device):
|
| 629 |
+
"""Diagnostics on a round's own rollouts, before any update on them, at the model's current n_loops: mean per-token
|
| 630 |
+
entropy of the policy at temperature 1 (sampling uses TEMP), mean -log p of the sampled tokens, mean rollout
|
| 631 |
+
length in tokens, and targets whose rollouts all pass / all fail (zero GRPO advantage). Batching uses its own
|
| 632 |
+
generator and rng, so the run's random streams are the same as without it."""
|
| 633 |
+
items = [(tok.encode_prompt(r["prompt"]), ids) for r in rows for ids, _ in r["rollouts"]]
|
| 634 |
+
ids, mask, _, lens = to_gpu(items, tok, device)
|
| 635 |
+
gen = torch.Generator(device=device)
|
| 636 |
+
gen.manual_seed(0)
|
| 637 |
+
order, cuts = token_batches(lens, len(items), gen, random.Random(0), first=0)
|
| 638 |
+
model.eval()
|
| 639 |
+
sums = {k: 0.0 for k in ("entropy", "nll", "entropy_t", "nll_t")}
|
| 640 |
+
n = 0
|
| 641 |
+
for s, e, T in cuts:
|
| 642 |
+
x, m = gpu_batch(ids, mask, None, lens, order[s:e], tok, gen, T, augment=False)
|
| 643 |
+
with torch.autocast("cuda", dtype=torch.bfloat16, enabled=(device == "cuda")):
|
| 644 |
+
logits = model(x[:, :-1]).float()
|
| 645 |
+
m = m[:, 1:]
|
| 646 |
+
for suffix, temp in (("", 1.0), ("_t", GRPO_TEMP)):
|
| 647 |
+
logp = torch.log_softmax(logits / temp, -1)
|
| 648 |
+
sums["entropy" + suffix] += float(((-(logp.exp() * logp).sum(-1)) * m).sum())
|
| 649 |
+
sums["nll" + suffix] += float((-logp.gather(-1, x[:, 1:, None]).squeeze(-1) * m).sum())
|
| 650 |
+
n += float(m.sum())
|
| 651 |
+
# At the sampling temperature E[-log q(token)] = H(q) exactly, so nll_t well above entropy_t means the sampler
|
| 652 |
+
# and this forward pass disagree.
|
| 653 |
+
return {**{k: v / n for k, v in sums.items()}, "tokens": n / len(items),
|
| 654 |
+
"all_pass": sum(all(ok for _, ok in r["rollouts"]) for r in rows),
|
| 655 |
+
"all_fail": sum(not any(ok for _, ok in r["rollouts"]) for r in rows)}
|
| 656 |
+
|
| 657 |
+
|
| 658 |
+
def fmt_stats(rs):
|
| 659 |
+
return (f"rollout entropy {rs['entropy']:.3f}, nll {rs['nll']:.3f}, at T={GRPO_TEMP} entropy "
|
| 660 |
+
f"{rs['entropy_t']:.3f} nll {rs['nll_t']:.3f}, {rs['tokens']:.0f} tokens, "
|
| 661 |
+
f"all pass {rs['all_pass']}, all fail {rs['all_fail']}")
|
| 662 |
+
|
| 663 |
+
|
| 664 |
+
def rl(model, tok, targets, train_recs, oracle, budget_secs, device, seed, log):
|
| 665 |
+
if RL_ALGO == "grpo":
|
| 666 |
+
return rl_grpo(model, tok, targets, train_recs, oracle, device, seed, log)
|
| 667 |
+
return rl_ei(model, tok, targets, train_recs, oracle, device, seed, log)
|
| 668 |
+
|
| 669 |
+
|
| 670 |
+
def rl_ei(model, tok, targets, train_recs, oracle, device, seed, log):
|
| 671 |
+
rng = random.Random(seed)
|
| 672 |
+
found = {t["name"]: {} for t in targets} # name -> {normalized proof: proof text}
|
| 673 |
+
rounds, round_secs, retries, ft_steps, history = 0, 0.0, [], [], []
|
| 674 |
+
# Start a round only if one as long as the last (plus 15%) still fits in the budget.
|
| 675 |
+
while oracle.left() > 1.15 * round_secs:
|
| 676 |
+
t0 = oracle.used()
|
| 677 |
+
model.n_loops = RL_FIRST_LOOPS
|
| 678 |
+
picked = pick_targets(targets, found, rng)
|
| 679 |
+
rows = oracle.sample_rollouts(model, picked, RL_K)
|
| 680 |
+
rs = rollout_stats(model, tok, rows, device) # first pass only: comparable to the GRPO arm's rounds
|
| 681 |
+
failed = [t for t, row in zip(picked, rows, strict=True) if not row["proofs"]]
|
| 682 |
+
rng.shuffle(failed)
|
| 683 |
+
for i, n in enumerate(RL_RETRY_LOOPS):
|
| 684 |
+
part = failed[i :: len(RL_RETRY_LOOPS)]
|
| 685 |
+
if not part:
|
| 686 |
+
continue
|
| 687 |
+
model.n_loops = n
|
| 688 |
+
part_rows = oracle.sample(model, part, RL_RETRY_K)
|
| 689 |
+
cracked = sum(bool(row["proofs"]) for row in part_rows)
|
| 690 |
+
retries.append(
|
| 691 |
+
{"round": rounds + 1, "loops": n, "targets": len(part), "cracked": cracked}
|
| 692 |
+
)
|
| 693 |
+
rows += part_rows
|
| 694 |
+
for row in rows:
|
| 695 |
+
for proof in row["proofs"]:
|
| 696 |
+
found[row["name"]].setdefault(norm(proof), proof)
|
| 697 |
+
mix = []
|
| 698 |
+
for t in targets:
|
| 699 |
+
proofs = list(found[t["name"]].values())
|
| 700 |
+
rng.shuffle(proofs)
|
| 701 |
+
mix += [(t["prompt"], proof) for proof in proofs[:MAX_PER_THM]] * RL_WEIGHT
|
| 702 |
+
n_rl = len(mix)
|
| 703 |
+
# No solves yet: skip the fine-tune and sample again (the old harness stopped RL here). The round is still
|
| 704 |
+
# logged, with its rollout stats.
|
| 705 |
+
loss, steps = float("nan"), 0
|
| 706 |
+
if n_rl:
|
| 707 |
+
mix += [(r["prompt"], r["proof"]) for r in rng.sample(train_recs, RETAIN)]
|
| 708 |
+
data = [(tok.encode_prompt(p), tok.encode_proof(q)) for p, q in mix]
|
| 709 |
+
loss, steps = finetune(model, tok, data, rng, device)
|
| 710 |
+
ft_steps.append(steps)
|
| 711 |
+
rounds += 1
|
| 712 |
+
round_secs = oracle.used() - t0
|
| 713 |
+
history.append({"round": rounds, "rollouts": rs})
|
| 714 |
+
log(
|
| 715 |
+
f"rl round {rounds}: {n_rl} RL records, fine-tune loss {loss:.4f} in {steps} steps, "
|
| 716 |
+
f"{fmt_stats(rs)}, round {round_secs:.0f}s, {oracle.left():.0f}s left"
|
| 717 |
+
)
|
| 718 |
+
model.n_loops = DEFAULT_LOOPS
|
| 719 |
+
return {
|
| 720 |
+
"rounds": rounds,
|
| 721 |
+
"first_loops": RL_FIRST_LOOPS,
|
| 722 |
+
"k_first": RL_K,
|
| 723 |
+
"retry_loops": RL_RETRY_LOOPS,
|
| 724 |
+
"k_retry": RL_RETRY_K,
|
| 725 |
+
"retries": retries,
|
| 726 |
+
"ft_records": FT_RECORDS,
|
| 727 |
+
"ft_steps": ft_steps,
|
| 728 |
+
"ft_optimizer": "muon (polar express) on block matrices and head + adamw on the rest",
|
| 729 |
+
"ft_lr": FT_LR,
|
| 730 |
+
"ft_muon_lr": FT_MUON_LR,
|
| 731 |
+
"history": history,
|
| 732 |
+
}
|
| 733 |
+
|
| 734 |
+
|
| 735 |
+
# ---- GRPO arm (ND_RL=grpo). Group-relative policy gradient (GRPO, Shao et al. 2024) with Dr. GRPO's
|
| 736 |
+
# unnormalised advantages r - mean(r) and a constant length normaliser instead of each rollout's length
|
| 737 |
+
# (Liu et al. 2025), and DAPO's dropping of groups that are all pass or all fail (Yu et al. 2025), since
|
| 738 |
+
# they carry no signal. The found-proof pool: once Lean accepts a proof of a target, a later group on
|
| 739 |
+
# that target with no success gets one stored proof in place of a failed rollout, with reward 1, so a
|
| 740 |
+
# target solved once keeps giving a gradient (that member is off-policy; the rest are the model's own).
|
| 741 |
+
# Same target picking, rollouts per target (EI's first pass) and budget as the EI arm; one pass over each
|
| 742 |
+
# round's rollouts in many steps, so a PPO clipped ratio (Schulman et al. 2017) against the sampling policy
|
| 743 |
+
# keeps later steps from moving far, with DAPO's clip-higher and a dual clip on negative advantages (Ye et
|
| 744 |
+
# al. 2020), Leon's settings. The loss and the ratio score the distribution the rollouts came from, logits
|
| 745 |
+
# / GRPO_TEMP (the harness's TEMP). Optimizer split as in EI's fine-tune (Muon on the matrices, AdamW on
|
| 746 |
+
# the rest), at a tenth of its rates. v2 (2026-10-14) used AdamW 1e-4 on everything, no ratio, loss at
|
| 747 |
+
# T=1, and collapsed: unparseable samples up to 100%, entropy spikes to 0.9.
|
| 748 |
+
GRPO_G = 8 # rollouts per target per round
|
| 749 |
+
GRPO_LR, GRPO_MUON_LR, GRPO_WARMUP = FT_LR / 10, FT_MUON_LR / 10, 20
|
| 750 |
+
GRPO_TEMP = 0.8 # must equal the harness's sampling TEMP (asserted there)
|
| 751 |
+
GRPO_CLIP_LOW, GRPO_CLIP_HIGH, GRPO_DUAL_CLIP = 0.2, 0.28, 3.0
|
| 752 |
+
GRPO_LEN_NORM = 256 # constant per-rollout token normaliser
|
| 753 |
+
GRPO_RETAIN_W = 0.5 # retained-pretraining SFT term per step, in place of EI's replayed records
|
| 754 |
+
|
| 755 |
+
|
| 756 |
+
def rl_grpo(model, tok, targets, train_recs, oracle, device, seed, log):
|
| 757 |
+
rng = random.Random(seed)
|
| 758 |
+
gen = torch.Generator(device=device)
|
| 759 |
+
gen.manual_seed(seed)
|
| 760 |
+
found = {t["name"]: {} for t in targets}
|
| 761 |
+
matrices = [p for p in model.blocks.parameters() if p.ndim == 2] + [model.head.weight]
|
| 762 |
+
matrix_ids = {id(p) for p in matrices}
|
| 763 |
+
auxiliary = [p for p in model.parameters() if id(p) not in matrix_ids]
|
| 764 |
+
opt = torch.optim.AdamW(auxiliary, lr=GRPO_LR, weight_decay=0.0, betas=(0.9, 0.95))
|
| 765 |
+
muon = MuonStep(matrices, device)
|
| 766 |
+
autocast = torch.autocast("cuda", dtype=torch.bfloat16, enabled=(device == "cuda"))
|
| 767 |
+
rounds, round_secs, history, step = 0, 0.0, [], 0
|
| 768 |
+
while oracle.left() > 1.15 * round_secs:
|
| 769 |
+
t0 = oracle.used()
|
| 770 |
+
model.n_loops = RL_FIRST_LOOPS
|
| 771 |
+
picked = pick_targets(targets, found, rng)
|
| 772 |
+
rows = oracle.sample_rollouts(model, picked, GRPO_G)
|
| 773 |
+
rs = rollout_stats(model, tok, rows, device) # on-policy, before the found-proof injection and the update
|
| 774 |
+
items, adv, st = [], [], collections.Counter()
|
| 775 |
+
for row in rows:
|
| 776 |
+
for p in row["proofs"]:
|
| 777 |
+
found[row["name"]].setdefault(norm(p), p)
|
| 778 |
+
group = [(ids, float(ok)) for ids, ok in row["rollouts"]]
|
| 779 |
+
if not any(r for _, r in group) and found[row["name"]]:
|
| 780 |
+
group[0] = (tok.encode_proof(rng.choice(list(found[row["name"]].values()))), 1.0)
|
| 781 |
+
st["injected"] += 1
|
| 782 |
+
mean = sum(r for _, r in group) / len(group)
|
| 783 |
+
if mean in (0.0, 1.0):
|
| 784 |
+
st["all_fail" if mean == 0 else "all_pass"] += 1
|
| 785 |
+
continue
|
| 786 |
+
prompt = tok.encode_prompt(row["prompt"])
|
| 787 |
+
items += [(prompt, ids) for ids, _ in group]
|
| 788 |
+
adv += [r - mean for _, r in group]
|
| 789 |
+
st["groups"] += 1
|
| 790 |
+
if items:
|
| 791 |
+
retain = [(tok.encode_prompt(r["prompt"]), tok.encode_proof(r["proof"]))
|
| 792 |
+
for r in rng.sample(train_recs, min(len(items), len(train_recs)))]
|
| 793 |
+
loss, n_steps, ratio = pg_update(model, tok, items, adv, retain, opt, muon, step, gen, rng, autocast, device)
|
| 794 |
+
step += n_steps
|
| 795 |
+
st["steps"], st["items"] = n_steps, len(items)
|
| 796 |
+
st.update(ratio)
|
| 797 |
+
rounds += 1
|
| 798 |
+
round_secs = oracle.used() - t0
|
| 799 |
+
history.append({"round": rounds, **st, "rollouts": rs})
|
| 800 |
+
log(f"grpo round {rounds}: {dict(st)}, {fmt_stats(rs)}, round {round_secs:.0f}s, {oracle.left():.0f}s left")
|
| 801 |
+
model.n_loops = DEFAULT_LOOPS
|
| 802 |
+
model.eval()
|
| 803 |
+
return {"rounds": rounds, "algo": "grpo", "g": GRPO_G, "lr": GRPO_LR, "muon_lr": GRPO_MUON_LR, "temp": GRPO_TEMP,
|
| 804 |
+
"clip": [GRPO_CLIP_LOW, GRPO_CLIP_HIGH, GRPO_DUAL_CLIP], "len_norm": GRPO_LEN_NORM,
|
| 805 |
+
"retain_w": GRPO_RETAIN_W, "history": history}
|
| 806 |
+
|
| 807 |
+
|
| 808 |
+
def token_logp(model, x):
|
| 809 |
+
"""log p of each next token of x under logits / GRPO_TEMP, the sampling distribution: (B, T-1)."""
|
| 810 |
+
logits = model(x[:, :-1]).float() / GRPO_TEMP
|
| 811 |
+
return -torch.nn.functional.cross_entropy(
|
| 812 |
+
logits.reshape(-1, logits.size(-1)), x[:, 1:].reshape(-1), reduction="none"
|
| 813 |
+
).view(len(x), -1)
|
| 814 |
+
|
| 815 |
+
|
| 816 |
+
def ppo_surrogate(ratio, a):
|
| 817 |
+
"""Per-token objective to maximise: PPO's clipped min(r a, clip(r) a) with the asymmetric range
|
| 818 |
+
[1 - GRPO_CLIP_LOW, 1 + GRPO_CLIP_HIGH], and for a < 0 floored at GRPO_DUAL_CLIP * a so a token whose
|
| 819 |
+
ratio has grown large cannot drive an unbounded push-down."""
|
| 820 |
+
surr = torch.min(ratio * a, ratio.clamp(1 - GRPO_CLIP_LOW, 1 + GRPO_CLIP_HIGH) * a)
|
| 821 |
+
return torch.where(a < 0, torch.max(surr, GRPO_DUAL_CLIP * a), surr)
|
| 822 |
+
|
| 823 |
+
|
| 824 |
+
def pg_update(model, tok, items, adv, retain, opt, muon, step0, gen, rng, autocast, device):
|
| 825 |
+
"""One pass over the round's rollouts in token-budget batches, each step paired with a retained
|
| 826 |
+
pretraining batch (augmented, as in pretraining). Per token, the PPO clipped surrogate with ratio
|
| 827 |
+
p / p_old, p_old scored before the first step. Returns (last loss, steps, ratio stats)."""
|
| 828 |
+
ids, mask, _, lens = to_gpu(items, tok, device)
|
| 829 |
+
adv_t = torch.tensor(adv, device=device)
|
| 830 |
+
r_ids, r_mask, r_ref, r_lens = to_gpu(retain, tok, device)
|
| 831 |
+
order, cuts = token_batches(lens, len(items), gen, rng, first=0)
|
| 832 |
+
r_order, r_cuts = token_batches(r_lens, len(retain), gen, rng, first=0)
|
| 833 |
+
old = torch.zeros(ids.shape[0], ids.shape[1] - 1, device=device)
|
| 834 |
+
model.eval()
|
| 835 |
+
with torch.no_grad():
|
| 836 |
+
for s, e, T in cuts:
|
| 837 |
+
idxs = order[s:e]
|
| 838 |
+
x, _ = gpu_batch(ids, mask, None, lens, idxs, tok, gen, T, augment=False)
|
| 839 |
+
with autocast:
|
| 840 |
+
old[idxs, : T - 1] = token_logp(model, x)
|
| 841 |
+
model.train()
|
| 842 |
+
loss = torch.zeros(())
|
| 843 |
+
clipped = ratio_sum = n_tok = 0.0
|
| 844 |
+
for k, (s, e, T) in enumerate(cuts):
|
| 845 |
+
step = step0 + k + 1
|
| 846 |
+
warm = min(1.0, step / GRPO_WARMUP)
|
| 847 |
+
for g in opt.param_groups:
|
| 848 |
+
g["lr"] = GRPO_LR * warm
|
| 849 |
+
idxs = order[s:e]
|
| 850 |
+
x, m = gpu_batch(ids, mask, None, lens, idxs, tok, gen, T, augment=False)
|
| 851 |
+
m = m[:, 1:]
|
| 852 |
+
a = adv_t[idxs, None]
|
| 853 |
+
with autocast:
|
| 854 |
+
ratio = torch.exp(token_logp(model, x) - old[idxs, : T - 1])
|
| 855 |
+
pg = -(ppo_surrogate(ratio, a) * m).sum() / (len(idxs) * GRPO_LEN_NORM)
|
| 856 |
+
rs, re_, rT = r_cuts[k % len(r_cuts)]
|
| 857 |
+
rx, rm = gpu_batch(r_ids, r_mask, r_ref, r_lens, r_order[rs:re_], tok, gen, rT)
|
| 858 |
+
loss = pg + GRPO_RETAIN_W * loss_on(model, rx, rm)
|
| 859 |
+
with torch.no_grad():
|
| 860 |
+
out = (ratio < 1 - GRPO_CLIP_LOW) | (ratio > 1 + GRPO_CLIP_HIGH)
|
| 861 |
+
clipped += float((out & m).sum())
|
| 862 |
+
ratio_sum += float((ratio * m).sum())
|
| 863 |
+
n_tok += float(m.sum())
|
| 864 |
+
model.zero_grad(set_to_none=False) # grads keep fixed addresses for the Muon CUDA graph
|
| 865 |
+
loss.backward()
|
| 866 |
+
torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0)
|
| 867 |
+
opt.step()
|
| 868 |
+
muon(GRPO_MUON_LR * warm)
|
| 869 |
+
model.eval()
|
| 870 |
+
return loss.item(), len(cuts), {"clip_frac": round(clipped / max(n_tok, 1), 4),
|
| 871 |
+
"ratio": round(ratio_sum / max(n_tok, 1), 4)}
|
runs/long-rl-20261014-v3_untied-grpo_s0/source/remote.sh
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# Runs on the pod. Checks out Dan's fork at the pinned commit (model, sampler, nd2lean; the tokenizer and the Lean
|
| 3 |
+
# gate come from overlay/), installs Lean, runs the harness.
|
| 4 |
+
# Usage: ND_ARCH=untied|looped ND_RL=ei|grpo bash remote.sh <out-dir> [harness.py args...]
|
| 5 |
+
set -euo pipefail
|
| 6 |
+
FORK_COMMIT=51604b3feaa5e66821d1faba22238fe6d96d46d0 # dan-pandori/nd-takehome, branch dan_lean_seed2
|
| 7 |
+
export ND_FORK=/workspace/nd-takehome
|
| 8 |
+
OUT=$1; shift
|
| 9 |
+
HERE=$(cd "$(dirname "$0")" && pwd)
|
| 10 |
+
|
| 11 |
+
if [ ! -d "$ND_FORK/.git" ]; then
|
| 12 |
+
git clone -q https://github.com/dan-pandori/nd-takehome.git "$ND_FORK"
|
| 13 |
+
fi
|
| 14 |
+
git -C "$ND_FORK" cat-file -e "$FORK_COMMIT" 2>/dev/null || git -C "$ND_FORK" fetch -q origin
|
| 15 |
+
git -C "$ND_FORK" checkout -q "$FORK_COMMIT"
|
| 16 |
+
[ -f "$ND_FORK/data/train.jsonl" ] || gunzip -k "$ND_FORK/data/train.jsonl.gz"
|
| 17 |
+
# Lean 4 core is the only checker (overlay/lean_gate.py). Installed before harness.py starts, so it is not charged.
|
| 18 |
+
[ -x ~/.elan/bin/lean ] || curl -sSf https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh \
|
| 19 |
+
| sh -s -- -y --default-toolchain leanprover/lean4:v4.34.0 > /dev/null
|
| 20 |
+
export LEAN_GATE_WORKERS=$(nproc) LEAN_GATE_LOG="$OUT/lean_gate.jsonl" ND_DATA="$HERE/data"
|
| 21 |
+
mkdir -p "$OUT"
|
| 22 |
+
nvidia-smi --query-gpu=name,memory.total --format=csv,noheader
|
| 23 |
+
echo "cpus $(nproc), $(~/.elan/bin/lean --version), arm $ND_ARCH/$ND_RL"
|
| 24 |
+
PY=$(for p in python python3; do "$p" -c "import torch" 2>/dev/null && echo "$p" && break; done)
|
| 25 |
+
echo "python $($PY --version 2>&1), torch $($PY -c 'import torch; print(torch.__version__)')"
|
| 26 |
+
cd "$HERE"
|
| 27 |
+
$PY harness.py --out "$OUT" "$@" 2>&1 | tee "$OUT.log"
|
runs/long-rl-20261014-v3_untied-grpo_s0/summary.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|