
digraph G {
  graph [
    bgcolor="white", pad="0.28", nodesep="0.38", ranksep="0.58",
    fontname="WenQuanYi Zen Hei", fontcolor="#17212B", fontsize=24,
    labelloc="t", labeljust="l"
  ];
  node [
    shape=box, style="rounded,filled", margin="0.18,0.12",
    fontname="WenQuanYi Zen Hei", fontcolor="#17212B", fontsize=12,
    color="#CBD5E1", penwidth=1.3, fillcolor="#F8FAFC"
  ];
  edge [
    fontname="WenQuanYi Zen Hei", fontcolor="#64748B", fontsize=10,
    color="#64748B", penwidth=1.5, arrowsize=0.75
  ];

  label="图 2-4  真实 benchmark 与 lit 自测试的执行管线";
  rankdir=TB;

  subgraph cluster_prod {
    label="真实目标 / benchmark";
    color="#5EEAD4"; style="rounded,filled"; fillcolor="#F0FDFA";
    psrc [label="源码", fillcolor="#FEF3C7", color="#D97706"];
    psym [label="symcc / ko-clang\n-O2 / -O1", fillcolor="#CCFBF1", color="#0F766E"];
    pafl [label="afl-clang-fast\nPCGUARD / CmpLog", fillcolor="#DBEAFE", color="#2563EB"];
    pexec [label="afl-fuzz + MPI helper\n真实输入、真实位图", fillcolor="#DCFCE7", color="#15803D"];
    psrc -> psym -> pexec;
    psrc -> pafl -> pexec;
  }

  subgraph cluster_test {
    label="lit / unittest";
    color="#FDBA74"; style="rounded,filled"; fillcolor="#FFF7ED";
    tsrc [label=".c / .ll / .py", fillcolor="#FEF3C7", color="#D97706"];
    tbuild [label="%symcc 或 %opt\n常见 -O0；可强制 -fno-builtin", fillcolor="#FFEDD5", color="#C2410C"];
    tcheck [label="单次运行\nFileCheck / telemetry / Python 断言", fillcolor="#DCFCE7", color="#15803D"];
    tsrc -> tbuild -> tcheck;
  }

  prod [shape=note, label="回答：真实优化与 campaign 中是否触发、是否增益", fillcolor="#F1F5F9"];
  test [shape=note, label="回答：机制是否存在、表达式与产出是否正确", fillcolor="#F1F5F9"];
  pexec -> prod;
  tcheck -> test;
  warning [shape=note, label="两条管线可能走不同约束形态\n自测试通过 ≠ -O2 目标必然触发", fillcolor="#FEE2E2", color="#B91C1C"];
  prod -> warning [style=dotted, arrowhead=none];
  test -> warning [style=dotted, arrowhead=none];

}
