Fix prefix pilot warmup validation
This commit is contained in:
@@ -233,8 +233,37 @@ def run_client(
|
||||
f"client failed: cell={entry['cell']} role={role} rc={process.returncode}"
|
||||
)
|
||||
result = json.loads((output / "result.json").read_text(encoding="utf-8"))
|
||||
validate_result_selection(
|
||||
result=result,
|
||||
selection=selection,
|
||||
cell=entry["cell"],
|
||||
role=role,
|
||||
warmup=warmup,
|
||||
)
|
||||
entry["results"].append(
|
||||
{"anchor": float(selection["anchor"]), "dir": str(output), "kind": result["kind"]}
|
||||
)
|
||||
return result
|
||||
|
||||
|
||||
def validate_result_selection(
|
||||
*,
|
||||
result: dict[str, Any],
|
||||
selection: dict[str, Any],
|
||||
cell: str,
|
||||
role: str,
|
||||
warmup: bool,
|
||||
) -> None:
|
||||
if warmup:
|
||||
if result["kind"] != "warmup" or int(result["selection"]["count"]) != 16:
|
||||
raise RuntimeError(f"invalid warmup selection: {cell} {role}")
|
||||
for key in ("warmup_16", "warmup_exact_16", "warmup_long"):
|
||||
if not result["invariants"].get(key, False):
|
||||
raise RuntimeError(f"warmup invariant {key} failed: {cell} {role}")
|
||||
return
|
||||
|
||||
if int(result["selection"]["count"]) != int(selection["selected_count"]):
|
||||
raise RuntimeError(f"selection count mismatch: {entry['cell']} {role}")
|
||||
raise RuntimeError(f"selection count mismatch: {cell} {role}")
|
||||
for key in (
|
||||
"request_id_order_sha256",
|
||||
"arrival_order_sha256",
|
||||
@@ -244,11 +273,7 @@ def run_client(
|
||||
"input_length_order_sha256" if key == "raw_length_order_sha256" else key
|
||||
)
|
||||
if result["selection"][key] != selection[manifest_key]:
|
||||
raise RuntimeError(f"selection hash mismatch {key}: {entry['cell']} {role}")
|
||||
entry["results"].append(
|
||||
{"anchor": float(selection["anchor"]), "dir": str(output), "kind": result["kind"]}
|
||||
)
|
||||
return result
|
||||
raise RuntimeError(f"selection hash mismatch {key}: {cell} {role}")
|
||||
|
||||
|
||||
def execute_cell(
|
||||
|
||||
Reference in New Issue
Block a user