Fix action-aware burn-in gate

This commit is contained in:
2026-07-14 20:47:23 +08:00
parent 1db737e641
commit c5ab073af5
5 changed files with 343 additions and 14 deletions

View File

@@ -201,6 +201,32 @@ def main() -> None:
"--max-num-batched-tokens 2048"
in revised_plan["sessions"][0]["commands"]["server"]
)
accepted_burnin = {
"kind": "anchor",
"selection": {"count": 510},
"interval": {"elapsed_s": 61.25},
"pass_rate": 0.5,
"feasible": False,
}
assert controller.burnin_gate(
accepted_burnin, expected_count=510, maximum_elapsed_s=90.0
)["elapsed_s"] == 61.25
warmup = copy.deepcopy(accepted_burnin)
warmup["kind"] = "warmup"
try:
controller.burnin_gate(warmup, expected_count=510, maximum_elapsed_s=90.0)
except RuntimeError as error:
assert "non-anchor" in str(error)
else:
raise AssertionError("warmup incorrectly passed the burnin gate")
slow = copy.deepcopy(accepted_burnin)
slow["interval"]["elapsed_s"] = 91.0
try:
controller.burnin_gate(slow, expected_count=510, maximum_elapsed_s=90.0)
except RuntimeError as error:
assert "throughput gate failed" in str(error)
else:
raise AssertionError("slow burnin incorrectly passed the throughput gate")
print("action-aware constraint pilot: PASS")