Add fixed and exact-trace Frontier surfaces

This commit is contained in:
2026-07-17 10:13:25 +08:00
parent 0c747448b6
commit 6e8704d525
24 changed files with 8949 additions and 6 deletions

View File

@@ -222,7 +222,11 @@ def parse_simulator(manifests: list[Path]) -> tuple[dict[str, Any], list[dict[st
sources = []
for path in manifests:
payload = load_json(path)
if payload["status"] not in {"complete", "partial_not_decision_bearing"}:
if payload["status"] not in {
"complete",
"frozen_before_real",
"partial_not_decision_bearing",
}:
raise RuntimeError(f"simulator manifest has invalid status: {path}")
sources.append({"path": str(path.resolve()), "sha256": sha256(path)})
result_by_name = {
@@ -305,12 +309,21 @@ def compare(real: dict[str, Any], simulated: dict[str, Any]) -> dict[str, Any]:
confusion = {"real_pass_sim_pass": 0, "real_pass_sim_fail": 0,
"real_fail_sim_pass": 0, "real_fail_sim_fail": 0}
anchor_grid_coverage = {
"shared": 0,
"real_only": 0,
"simulator_only": 0,
}
for name in names:
real_anchors = {row["rate"]: row for row in real[name]["anchors"]}
sim_anchors = {row["rate"]: row for row in simulated[name]["anchors"]}
if set(real_anchors) != set(sim_anchors):
raise RuntimeError(f"anchor grids differ for {name}")
for rate in real_anchors:
shared = set(real_anchors) & set(sim_anchors)
if not shared:
raise RuntimeError(f"anchor grids do not overlap for {name}")
anchor_grid_coverage["shared"] += len(shared)
anchor_grid_coverage["real_only"] += len(set(real_anchors) - shared)
anchor_grid_coverage["simulator_only"] += len(set(sim_anchors) - shared)
for rate in shared:
real_pass = real_anchors[rate]["conservative_feasible"]
sim_pass = sim_anchors[rate]["feasible"]
key = f"real_{'pass' if real_pass else 'fail'}_sim_{'pass' if sim_pass else 'fail'}"
@@ -328,6 +341,7 @@ def compare(real: dict[str, Any], simulated: dict[str, Any]) -> dict[str, Any]:
"kendall": tau,
"pairwise_non_tied": pairwise,
"anchor_confusion": confusion,
"anchor_grid_coverage": anchor_grid_coverage,
}
@@ -356,7 +370,7 @@ def plot(path: Path, rows: list[dict[str, Any]], metrics: dict[str, Any]) -> Non
x + width / 2,
[row["simulator"] for row in rows],
width,
label="Frontier profile-only",
label="Frontier simulator",
)
axis.set_xticks(x, labels, fontsize=8)
axis.set_ylabel("Max tested SLO-feasible request rate / GPU")
@@ -374,7 +388,7 @@ def plot(path: Path, rows: list[dict[str, Any]], metrics: dict[str, Any]) -> Non
)
axis.text(
0.01,
0.98,
0.82,
annotation,
transform=axis.transAxes,
va="top",