Fix prefix pilot warmup validation

This commit is contained in:
2026-07-14 12:58:01 +08:00
parent 8eeba597b3
commit 93daf291f6
2 changed files with 82 additions and 6 deletions

View File

@@ -78,6 +78,57 @@ def main() -> None:
) + controller.SAFETY_H20_HOURS,
3.0,
)
selection = {
"selected_count": 122,
"request_id_order_sha256": "request-hash",
"arrival_order_sha256": "arrival-hash",
"input_length_order_sha256": "length-hash",
}
warmup = {
"kind": "warmup",
"selection": {"count": 16},
"invariants": {
"warmup_16": True,
"warmup_exact_16": True,
"warmup_long": True,
},
}
controller.validate_result_selection(
result=warmup,
selection=selection,
cell="tp1_mns8",
role="burnin",
warmup=True,
)
measured = {
"kind": "anchor",
"selection": {
"count": 122,
"request_id_order_sha256": "request-hash",
"arrival_order_sha256": "arrival-hash",
"raw_length_order_sha256": "length-hash",
},
"invariants": {},
}
controller.validate_result_selection(
result=measured,
selection=selection,
cell="tp1_mns8",
role="low1",
warmup=False,
)
try:
controller.validate_result_selection(
result=warmup,
selection=selection,
cell="tp1_mns8",
role="low1",
warmup=False,
)
except RuntimeError as error:
assert "selection count mismatch" in str(error)
else:
raise AssertionError("measured selection accepted a warmup subset")
print("fidelity pilot tools: PASS")