M checkpoints recorded; harness statuses; memory test split; P6A-12
- results note docs/evaluation/results/2026-10-06-m-checkpoints.md: both checkpoints, owner's assessment (IR-tax closed at the engineering level, layer 7 GO; cost hypothesis open); plan status and order - P6A-12: source type-check completeness (E1001 reached the verifier from a source run); not a layer 7 blocker - harness: metrics.agent_status (max_tokens for a reply cut at its length limit, provider_rate_limited for 429/usage limits) and metrics.evaluation_status (accepted/rejected/evaluator_error/ infrastructure_failure/not_evaluated), kept apart; termination records max_tokens; checkpoint rows show both; evaluator contract: an infrastructure failure sets "infrastructure": true - interpreter memory test: fast form (20k-320k iterations, 256 KiB threshold via Options.collect_threshold) in zig build test; full form (100k/1M/4M) in zig build test-extended; CI job 'extended' also runs conformance with --collect-every-step
This commit is contained in:
1 parent
222c0c884c
commit
c2c238d9b1
13 files changed
+251
-19
No files matched your search
@@ -358,6 +358,51 @@ def cycles(profile, test_command, commands):
|
||||
return m
|
||||
|
||||
|
||||
_FINISH = re.compile(r'"(?:finish_reason|stop_reason|finish|reason)"\s*:\s*"([a-z_]+)"')
|
||||
_RATE_LIMIT = re.compile(r"\b429\b|rate[ _-]?limit|usage limit|too many requests", re.IGNORECASE)
|
||||
|
||||
|
||||
def agent_status(termination, transcript_path, stderr_path):
|
||||
"""How the agent's session ended, apart from what the evaluator says
|
||||
about the repository (protocol §28):
|
||||
|
||||
finished / exited the CLI ended normally
|
||||
max_tokens the last model reply stopped at its length
|
||||
limit (finish_reason length / max_tokens)
|
||||
provider_rate_limited the provider refused further requests (429,
|
||||
usage limit); the CLI then exited with an error
|
||||
error_exit, wall_time otherwise as recorded in `termination`
|
||||
"""
|
||||
def tail(path, n=200_000):
|
||||
try:
|
||||
with open(path, encoding="utf-8", errors="replace") as f:
|
||||
return f.read()[-n:]
|
||||
except OSError:
|
||||
return ""
|
||||
t = tail(transcript_path)
|
||||
reasons = _FINISH.findall(t)
|
||||
if reasons and reasons[-1] in ("length", "max_tokens"):
|
||||
return "max_tokens"
|
||||
if termination == "error_exit" and _RATE_LIMIT.search(tail(stderr_path) + t[-20_000:]):
|
||||
return "provider_rate_limited"
|
||||
return termination
|
||||
|
||||
|
||||
def evaluation_status(verdict):
|
||||
"""accepted / rejected / evaluator_error / infrastructure_failure /
|
||||
not_evaluated. An evaluator reports an infrastructure failure with
|
||||
`"infrastructure": true` in its verdict (harness.md, evaluator contract)."""
|
||||
if verdict is None:
|
||||
return "not_evaluated"
|
||||
if verdict.get("infrastructure"):
|
||||
return "infrastructure_failure"
|
||||
if verdict.get("accepted"):
|
||||
return "accepted"
|
||||
if "gates" not in verdict and verdict.get("error"):
|
||||
return "evaluator_error"
|
||||
return "rejected"
|
||||
|
||||
|
||||
def normalize_usage(u):
|
||||
"""Input (including cached), output and cached-input tokens from the
|
||||
differently named usage fields of the CLIs; None when not reported."""
|
||||
@@ -456,6 +501,9 @@ def run_native(task_dir, lang_name, agent_name, model, out_dir, effort=None, see
|
||||
with open(os.path.join(run_dir, "patch.diff"), "w") as f:
|
||||
f.write(diff_tree(pristine, workspace))
|
||||
verdict = record.evaluate(evaluator, workspace, lang_name, task.dir, lim["command_timeout"] * 4, os.path.join(run_dir, "evaluator.log")) if evaluator else None
|
||||
status = agent_status(termination, transcript, os.path.join(run_dir, "stderr.log"))
|
||||
if status == "max_tokens":
|
||||
termination = "max_tokens"
|
||||
|
||||
rec = {
|
||||
"schema": "aji-eval-native/1",
|
||||
@@ -476,7 +524,8 @@ def run_native(task_dir, lang_name, agent_name, model, out_dir, effort=None, see
|
||||
"limits": lim,
|
||||
"hardware": util.hardware(),
|
||||
"seed": seed,
|
||||
"metrics": {"elapsed_seconds": elapsed, "exit_code": code, "termination": termination, "tool_calls": facts.get("tool_calls"),
|
||||
"metrics": {"elapsed_seconds": elapsed, "exit_code": code, "termination": termination,
|
||||
"agent_status": status, "evaluation_status": evaluation_status(verdict), "tool_calls": facts.get("tool_calls"),
|
||||
"usage": facts.get("usage"), "agent_facts": {k: v for k, v in facts.items() if k not in ("usage", "tool_calls", "model")},
|
||||
"input_tokens": tokens["input"], "output_tokens": tokens["output"], "cached_input_tokens": tokens["cached_input"], "context": ctx,
|
||||
"toolchain_invocations": cyc["toolchain_invocations"],
|
||||
|
||||
Reference in new issue
Block a user