From ed6314f0907fd11c19b58d6a5d7ff117b100df05 Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Thu, 18 Jun 2026 23:41:40 -0600 Subject: [PATCH] feat(phase-16): wire the permuter into auto_driver (the near-miss yield lever) - driver per-fn flow: m2c -> match_one prefilter -> if near-miss & --permute-secs>0, run decomp-permuter (time-boxed, reuses p16_permute setup/run) -> use the score-0 winner as the draft -> whole-binary byte-gate. The permuter is closing near-misses well in the overnight batch, so it's the driver's core yield step for the unattended run. - +--permute-j (RAM-bound on the 15GiB box). --- tools/auto_driver.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/auto_driver.py b/tools/auto_driver.py index 23c74354f..188a6c40b 100644 --- a/tools/auto_driver.py +++ b/tools/auto_driver.py @@ -22,6 +22,8 @@ Usage: python3 tools/auto_driver.py [--batch 40] [--permute-secs 0] [--max-nins 150] [--once] """ import argparse, json, os, re, subprocess, sys, time, glob, shutil, signal +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import p16_permute # reuse the validated permuter setup/run (M2C_FIELD->cast expander, scratch, run) REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) OV = "ov_SC01_077" @@ -142,6 +144,7 @@ def main(): ap = argparse.ArgumentParser() ap.add_argument("--batch", type=int, default=40, help="functions per gate batch") ap.add_argument("--permute-secs", type=int, default=0, help="permuter budget per near-miss (0=skip)") + ap.add_argument("--permute-j", type=int, default=8, help="permuter -j (RAM-bound on the 15GiB box)") ap.add_argument("--max-nins", type=int, default=150, help="exclude giants (>this)") ap.add_argument("--once", action="store_true", help="one pass then exit (for trials)") a = ap.parse_args() @@ -179,11 +182,18 @@ def main(): continue cpath = os.path.join(REPO, DRAFTS, fn + ".c") open(cpath, "w").write(draft) - # prefilter; permuter optional (time-boxed) on near-misses + # prefilter; permuter (time-boxed) on near-misses — the key yield lever kind, score = match_one_score(fn, cpath) if kind == "fail": os.remove(cpath); continue # won't compile standalone -> drop (gate would revert anyway) - # (permuter integration: see permute(); kept off by default for the first trials) + if kind == "near" and a.permute_secs > 0: + write_heartbeat("permuting", pass_n, fn, banked, None, last_commit) + pd = p16_permute.setup(fn, draft) + if pd: + win = p16_permute.run_permuter(pd, a.permute_secs, a.permute_j) + if win: + # draft = the function body only (common.h provides types/macros in the TU) + open(cpath, "w").write(p16_permute.strip_externs_and_includes(open(win).read())) cand += 1 if cand == 0: continue