Paper notes for the correctness-gated optimizer
这些笔记只回答三个问题:原工作实际优化了什么、其中哪一部分能成为 Pysolate 的source-bound pass、它如何处理正确性和副作用。它们不把整篇论文或系统写成 Pysolate 已经实现的能力。
阅读规则
一个优化只有同时满足以下条件,才进入 pass 主线:
- 能表示为一个或多个 bounded target-CPython AST 的转换,或者 source-bound occurrence overlay;
- streaming overlay 只接受 exact Guest parser 已接受的complete-prefix AST snapshot;
- formal execution 和 execution patch 前,完整 source 必须验证并seal;
- transformed AST 可以重新编译并绑定 original/derived identity;
- AST analysis 不产生 capability authority;
- effect、freshness、workspace、exception 和 fallback 条件可由 Host 检查;
- 不满足条件时执行 unchanged source。
Runtime scheduling、KV cache、placement、learned planning、workflow induction 和 approximate model/operator selection不计入 pass。
Pysolate 当前边界见主仓库的 Correctness-gated Agent Python passes。
当前分析
| Paper | 可吸收的 optimization kernel | Pysolate pass | 结论 |
|---|---|---|---|
| stratum | CSE、constant folding、predicate pushdown、vectorization | effectful_cse、pure_region_fold、capability_projection_pushdown、batch_map_fusion | 已实现 pure_scalar_cse 与 pure_scalar_fold 两个纯 scalar 子集;其余需要 Host effect contract |
| LLMCompiler | ready-task scheduling、streaming task dispatch | program-derived incremental event graph | 吸收 ready queue,不吸收 LLM planner 或完整 Python CFG |
| APPL | Future、first-demand synchronization | Host-owned pseudo-future;hidden submit/materialize | 不向 Python 暴露 Future;普通 Python 仍需 exception/control barriers |
| LLM-Tool Compiler | 相似 tool-call fusion | capability_batch_fusion | 不使用 GPT fuser 作为 legality authority |
| AWO / Meta-tools | deterministic composite tool | 极窄 straight_line_meta_tool_fusion | 主机制改变 agent policy,整体属于 program synthesis,不是 semantic pass |
| AAFLOW | map-to-batch operator lowering | batch_operator_lowering | 只吸收有 exact rewrite law 的 batching |
跨论文结论
这些系统通常以任务成功率、accuracy、latency 或 throughput 为验收指标。该证据不足以证明 transformed program 保持相同的 result、exception、logical effects、workspace disposition 和 failure behavior。Replay 或 restart 也不等于 rollback。
Pysolate 的可用差异不是更激进地提前执行。它通过 effect level、sealed Plan、freshness、private workspace、physical/logical accounting 和 terminal ambiguity 限制优化:
- 完整 source 在 formal Python execution 前验证;
- 提前发生的只能是 Host-qualified speculative-safe physical work;
- safe physical work 未被 exact occurrence claim 时成为 cancelled、late 或 orphaned work;
- write 和 unknown effect 不提前;
- external effect 可能 started 后不 replay unchanged source;
- private Guest、prepared memory 和 workspace branch 可以 discard,但不声称通用外部 rollback。
不进入 pass 主线的近邻
- SGLang、Parrot、Halo、Helium、ReCache、CacheTTL:主要是 KV/prefix cache、serving 或 placement。
- Conveyor:在完整 AST 出现前重叠 token decoding 与 partial execution。
- FlowCompile:搜索 model、budget 和 workflow topology,会改变 accuracy–latency trade-off。
- AWM:从历史轨迹合成 workflow,改变程序算法。
- AIOS 和 CPU-centric agent serving:resource scheduling 和 execution management。
- SWE-agent:Agent-Computer Interface 设计。
这些工作可以进入 related work,但不能计入“由 Pysolate 统一实现的source-bound passes”。