Record code-trace canary fidelity gates

This commit is contained in:
2026-07-24 02:42:29 +08:00
parent e1f2557a0c
commit e0811e95b4
8 changed files with 1526 additions and 26 deletions

View File

@@ -10,7 +10,9 @@ import re
from pathlib import Path
CELL_RE = re.compile(r"r(?P<rho>[0-9p]+)-tp(?P<tp>[24])-v3")
CELL_RE = re.compile(
r"r(?P<rho>[0-9p]+)-tp(?P<tp>[24])-(?P<version>v[0-9]+)"
)
ATTENTION_FLAG = "--random_forrest_execution_time_predictor_config_atten_input_file"
@@ -18,6 +20,12 @@ def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument("--sim-root", type=Path, required=True)
parser.add_argument("--profile-manifest", type=Path, required=True)
parser.add_argument(
"--workload-mode",
choices=("prefill_decode", "prefill_only"),
default="prefill_decode",
)
parser.add_argument("--cell-version", default="v3")
parser.add_argument("--output", type=Path, required=True)
return parser.parse_args()
@@ -37,7 +45,11 @@ def main() -> None:
cells = []
for root in sorted(args.sim_root.iterdir()):
match = CELL_RE.fullmatch(root.name)
if match is None or not (root / "summary.json").is_file():
if (
match is None
or match.group("version") != args.cell_version
or not (root / "summary.json").is_file()
):
continue
manifest = json.loads((root / "manifest.json").read_text())
observed_profile_sha = manifest.get("attention_profile_sha256")
@@ -75,6 +87,8 @@ def main() -> None:
raise ValueError(f"no completed v3 calibration cells below {args.sim_root}")
payload = {
"schema": "frontier-code-trace-calibration-summary-v1",
"workload_mode": args.workload_mode,
"cell_version": args.cell_version,
"attention_profile_sha256": expected_profile_sha,
"subcritical_rule": "drain tail <= 10% of the 3660s arrival window",
"cells": cells,