E-N done: native smoke recorded; ajieval profile for cost/failure analysis
18 runs, 17 accepted; frontier agents at ceiling; GLM Aji/AIR 1/2 (BUDGET). No compression signal; Aji/AIR costs more for every agent. Plan and protocol updated (budget-terminated runs are judged on their final repository). ajieval profile: per-run termination, output tokens, source size and diagnostic-code occurrences, without task content.
This commit is contained in:
1 parent
2ee1ff192f
commit
e959156c65
5 files changed
+70
-2
No files matched your search
@@ -200,6 +200,10 @@ def main(argv=None):
|
||||
sm.add_argument("paths", nargs="+")
|
||||
sm.set_defaults(fn=lambda a: print(report.summary(a.paths)))
|
||||
|
||||
pf = sub.add_parser("profile", help="per-run cost profile: termination, output tokens, solution size, diagnostic codes")
|
||||
pf.add_argument("paths", nargs="+")
|
||||
pf.set_defaults(fn=lambda a: print(report.profile(a.paths)))
|
||||
|
||||
c = sub.add_parser("classify", help="record the primary failure category of a run (protocol §27)")
|
||||
c.add_argument("run")
|
||||
c.add_argument("category", choices=CATEGORIES)
|
||||
|
||||
@@ -135,3 +135,66 @@ def summary(paths):
|
||||
out.append(f"| {k} | {len(rs)} | {acc} | {round(acc / len(rs), 3)} | {mean(cyc)} | {mean([r['metrics'].get('tool_calls') for r in rs])} | {mean([r['metrics'].get('elapsed_seconds') for r in rs])} | {mean(unc)} |")
|
||||
out.append("")
|
||||
return "\n".join(out)
|
||||
|
||||
|
||||
def _source_size(run_dir, exts):
|
||||
files = lines = nbytes = 0
|
||||
ws = os.path.join(run_dir, "workspace")
|
||||
for root, dirs, names in os.walk(ws):
|
||||
dirs[:] = [d for d in dirs if d not in ("target", ".zig-cache", "zig-cache", "zig-out", ".git")]
|
||||
for n in names:
|
||||
if os.path.splitext(n)[1] in exts:
|
||||
p = os.path.join(root, n)
|
||||
with open(p, "rb") as f:
|
||||
data = f.read()
|
||||
files, lines, nbytes = files + 1, lines + data.count(b"\n"), nbytes + len(data)
|
||||
return files, lines, nbytes
|
||||
|
||||
|
||||
def _diagnostic_codes(r, run_dir):
|
||||
"""Counts of verifier/compiler diagnostic codes seen in the run's command
|
||||
outputs (codes only: no message text, no task content)."""
|
||||
import collections
|
||||
import re
|
||||
|
||||
from . import native
|
||||
|
||||
counts = collections.Counter()
|
||||
if r.get("track") == "B":
|
||||
cmds = native.command_events(r["agent"]["name"], os.path.join(run_dir, "transcript.jsonl"))
|
||||
outputs = [o for _, _, o in cmds]
|
||||
else:
|
||||
outputs = [json.loads(l).get("output") or "" for l in open(os.path.join(run_dir, "events.jsonl")) if '"event": "command"' in l]
|
||||
lang = r["language"]["name"]
|
||||
for o in outputs:
|
||||
if lang == "aji_air":
|
||||
counts.update(re.findall(r'"code":"([ET]\d{4})"', o))
|
||||
elif lang == "rust":
|
||||
counts.update(re.findall(r"error\[(E\d{4})\]", o))
|
||||
counts["error(no code)"] += len(re.findall(r"(?m)^error: ", o))
|
||||
else:
|
||||
counts["error"] += len(re.findall(r": error: ", o))
|
||||
return dict(counts.most_common())
|
||||
|
||||
|
||||
def profile(paths):
|
||||
"""Per-run cost profile for failure and cost analysis (protocol §27,
|
||||
§38): termination, output tokens, solution size and diagnostic codes.
|
||||
Shareable: numbers and diagnostic codes only."""
|
||||
from . import languages
|
||||
|
||||
out = ["| task | language | agent | termination | output tokens | source files / lines / bytes | diagnostic codes (count) |",
|
||||
"|---|---|---|---|---|---|---|"]
|
||||
for p in paths:
|
||||
for f in sorted(glob.glob(os.path.join(p, "**", "run.json"), recursive=True)):
|
||||
if "/superseded/" in f:
|
||||
continue
|
||||
r = util.read_json(f)
|
||||
d = os.path.dirname(f)
|
||||
exts = set(languages.load(r["language"]["name"]).get("source_extensions", []))
|
||||
files, lines, nbytes = _source_size(d, exts)
|
||||
codes = _diagnostic_codes(r, d)
|
||||
m = r["metrics"]
|
||||
out.append(f"| {r['task']['id']} | {r['language']['name']} | {_agent_key(r)} | {m.get('termination')} | {m.get('output_tokens')} | "
|
||||
f"{files} / {lines} / {nbytes} | {', '.join(f'{k} {v}' for k, v in codes.items()) or '-'} |")
|
||||
return "\n".join(out)
|
||||
Reference in new issue
Block a user