跳到主要内容

Evaluation · Agent 每次修改都要通过的门禁

标准化的评估指标定义、Pareto 前沿分析、硬性门禁判定和 regret 计算——Agent 的任何修改必须在 commit 之前通过 Evaluation 门禁,不通过则必须回滚或重新提案。

GATE P0 Python/C++
Evaluation Gate
# Agent proposes change → evaluation gate judges
$ eval.run(snap_before, snap_after)
Gate: {WNS: -0.042ns, TNS: -2.1ns, HPWL: 1.25e7}
$ eval.judge(gate, proposal)
→ PASS: all hard gates satisfied, on Pareto front
iMapsynthesisiFPfloorplaniPDNpoweriPLplacementiCTSclockiTOoptimizationiRTroutingiSTAtimingAiEDAdesign dataiPCLlayout modeliMapsynthesisiFPfloorplaniPDNpoweriPLplacementiCTSclockiTOoptimizationiRTroutingiSTAtimingAiEDAdesign dataiPCLlayout model

核心能力

Metric Schema

标准化的评估指标定义——WNS / TNS / HPWL / density / power / DRC count / congestion 等,每个指标有明确的方向(minimize / maximize)、阈值和单位。支持自定义扩展指标,所有指标在统一框架下比较。

Gate

硬性门禁判定——critical false-negative 不得漏报、约束语义必须完整。Agent 的修改如果导致关键路径的 WNS 恶化超过阈值、或者引入新的 DRC 违例,门禁直接判定 FAIL,该 commit 被拒绝。

Pareto

多目标 trade-off 的 Pareto 前沿分析。在 WNS vs HPWL vs density 等多维空间中,定位当前提案在 Pareto 前沿上的位置——是否被已有候选 dominate,或者是否拓展了新的前沿。

Regret

量化未选中最优候选的损失。给定一个选中的 commit 和同一轮的其他候选,regret 计算实际选择与全局最优之间的指标差距——帮助 Agent 在下一轮迭代中做出更好的 trade-off 决策。

Coverage

验证覆盖率的量化追踪。统计哪些设计对象经过了 evaluation、哪些 corner case 被覆盖、哪些约束组合被验证——确保 Agent 的修改不会在未覆盖的路径上引入隐藏问题。

评测示例

from ieda import AgentClient
from ieda.evaluation import MetricSchema, Gate, ParetoFront

client = AgentClient()

# Define evaluation metrics
metrics = MetricSchema([
    {"name": "wns", "direction": "maximize", "gate": {"min": -0.050}},
    {"name": "hpwl", "direction": "minimize"},
    {"name": "density", "direction": "minimize", "gate": {"max": 0.85}},
    {"name": "drc_count", "direction": "minimize", "gate": {"max": 0}},
])

# Run evaluation on a snapshot pair
result = client.call("eval.run",
    before="snap_7f3a",
    after="snap_8b2c",
    metrics=metrics)

# Gate judgment
judgment = Gate.judge(result)
if judgment.passed:
    print(f"PASS — all hard gates satisfied")
    print(f"Pareto rank: {judgment.pareto_rank}")
    print(f"Regret (vs best): {judgment.regret:.4f}")
else:
    print(f"FAIL — {judgment.failures}")

指标 Schema

MetricDefinition {
  name: str                    // 指标名称, e.g. "wns", "hpwl", "drc_count"
  direction: "minimize" | "maximize" | "target"
  unit?: str                   // 单位, e.g. "ns", "um", "count"
  gate?: GateRule {            // 硬性门禁规则
    min?: f64                  // 最小允许值
    max?: f64                  // 最大允许值
    strict?: bool              // 是否严格不等(默认 false = inclusive)
  }
  weight?: f64                 // 多目标汇总时的权重
}

GateJudgment {
  passed: bool                 // 门禁是否通过
  metrics: {}MetricValue       // 各指标的实际值
  pareto_rank: int             // 在当前 Pareto 前沿上的排名
  regret: f64                  // 相对最优候选的 regret 值
  failures: []GateFailure      // 未通过的门禁列表
  coverage: f64                // 验证覆盖率 (0.0 ~ 1.0)
}

Verification Hub

完整的验证闭环——从形式化验证到硅结果比对。

工具链 →

Agent Runtime

了解 Agent 如何在平台中运行探索-评估-提交循环。

Platform →

Performance

追踪 Evaluation 的计算成本——每次门禁判断的延迟和资源消耗。

Performance →