Do not count paired HTTP failures as matching outputs
This commit is contained in:
@@ -211,7 +211,9 @@ def summarize(rows, paired):
|
||||
pair["candidate"]["wall_seconds"] / pair["baseline"]["wall_seconds"]
|
||||
for pair in complete),
|
||||
"same_normalized_output": sum(
|
||||
normalized_output(pair["baseline"]) == normalized_output(pair["candidate"])
|
||||
pair["baseline"]["http_status"] == pair["candidate"]["http_status"] == 200
|
||||
and normalized_output(pair["baseline"]) is not None
|
||||
and normalized_output(pair["baseline"]) == normalized_output(pair["candidate"])
|
||||
for pair in complete),
|
||||
"both_quality_passed": sum(
|
||||
pair["baseline"]["quality"]["passed"] and
|
||||
|
||||
@@ -101,7 +101,9 @@ def main():
|
||||
"candidate_over_baseline_wall_ratio": c["wall_seconds"] / b["wall_seconds"],
|
||||
"baseline_quality_passed": b["quality"]["passed"],
|
||||
"candidate_quality_passed": c["quality"]["passed"],
|
||||
"same_normalized_output": normalized(b) == normalized(c),
|
||||
"same_normalized_output": (b["http_status"] == c["http_status"] == 200
|
||||
and normalized(b) is not None
|
||||
and normalized(b) == normalized(c)),
|
||||
"baseline_usage": b["response"].get("usage") if isinstance(b["response"], dict) else None,
|
||||
"candidate_usage": c["response"].get("usage") if isinstance(c["response"], dict) else None,
|
||||
"baseline_timings": (b["response"].get("timings") or {})
|
||||
|
||||
@@ -60,6 +60,11 @@ def main():
|
||||
prompt = benchmark.materialize_messages(long_case["messages"])[0]["content"]
|
||||
assert prompt.count("filler row:") == 4400
|
||||
assert prompt.count("VALID AUDIT CODE: amber-731") == 1
|
||||
failed = [{"arm": arm, "case_id": "broken", "repeat": 0, "warmup": False,
|
||||
"wall_seconds": 1.0, "http_status": 500, "response": {},
|
||||
"quality": {"passed": False}}
|
||||
for arm in ("baseline", "candidate")]
|
||||
assert benchmark.summarize(failed, True)["paired"]["same_normalized_output"] == 0
|
||||
server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Handler)
|
||||
thread = threading.Thread(target=server.serve_forever, daemon=True)
|
||||
thread.start()
|
||||
|
||||
Reference in New Issue
Block a user